Lines Matching refs:regval
128 unsigned int regval; in tps23861_read_temp() local
131 err = regmap_read(data->regmap, TEMPERATURE, ®val); in tps23861_read_temp()
135 *val = (regval * TEMPERATURE_LSB) - 20000; in tps23861_read_temp()
143 unsigned int regval; in tps23861_read_voltage() local
149 ®val, 2); in tps23861_read_voltage()
153 ®val, 2); in tps23861_read_voltage()
158 *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * VOLTAGE_LSB) / 1000; in tps23861_read_voltage()
167 unsigned int regval; in tps23861_read_current() local
177 ®val, 2); in tps23861_read_current()
181 *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * current_lsb) / 1000000; in tps23861_read_current()
188 unsigned int regval = 0; in tps23861_port_disable() local
191 regval |= BIT(channel + 4); in tps23861_port_disable()
192 err = regmap_write(data->regmap, POWER_ENABLE, regval); in tps23861_port_disable()
199 unsigned int regval = 0; in tps23861_port_enable() local
202 regval |= BIT(channel); in tps23861_port_enable()
203 regval |= BIT(channel + 4); in tps23861_port_enable()
204 err = regmap_write(data->regmap, DETECT_CLASS_RESTART, regval); in tps23861_port_enable()
373 unsigned int regval; in tps23861_port_operating_mode() local
376 regmap_read(data->regmap, OPERATING_MODE, ®val); in tps23861_port_operating_mode()
380 mode = FIELD_GET(OPERATING_MODE_PORT_1_MASK, regval); in tps23861_port_operating_mode()
383 mode = FIELD_GET(OPERATING_MODE_PORT_2_MASK, regval); in tps23861_port_operating_mode()
386 mode = FIELD_GET(OPERATING_MODE_PORT_3_MASK, regval); in tps23861_port_operating_mode()
389 mode = FIELD_GET(OPERATING_MODE_PORT_4_MASK, regval); in tps23861_port_operating_mode()
411 unsigned int regval; in tps23861_port_detect_status() local
415 ®val); in tps23861_port_detect_status()
417 switch (FIELD_GET(PORT_STATUS_DETECT_MASK, regval)) { in tps23861_port_detect_status()
449 unsigned int regval; in tps23861_port_class_status() local
453 ®val); in tps23861_port_class_status()
455 switch (FIELD_GET(PORT_STATUS_CLASS_MASK, regval)) { in tps23861_port_class_status()
480 unsigned int regval; in tps23861_port_poe_plus_status() local
482 regmap_read(data->regmap, POE_PLUS, ®val); in tps23861_port_poe_plus_status()
484 if (BIT(port + 3) & regval) in tps23861_port_poe_plus_status()
492 u16 regval; in tps23861_port_resistance() local
496 ®val, in tps23861_port_resistance()
499 switch (FIELD_GET(PORT_RESISTANCE_RSN_MASK, regval)) { in tps23861_port_resistance()
501 return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB) / 10000; in tps23861_port_resistance()
503 return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB_LOW) / 10000; in tps23861_port_resistance()