Lines Matching refs:client
264 struct i2c_client *client; member
297 static u8 w83793_read_value(struct i2c_client *client, u16 reg);
298 static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value);
299 static int w83793_probe(struct i2c_client *client,
301 static int w83793_detect(struct i2c_client *client,
303 static int w83793_remove(struct i2c_client *client);
304 static void w83793_init_client(struct i2c_client *client);
389 struct i2c_client *client = to_i2c_client(dev); in store_beep() local
390 struct w83793_data *data = i2c_get_clientdata(client); in store_beep()
407 data->beeps[index] = w83793_read_value(client, W83793_REG_BEEP(index)); in store_beep()
410 w83793_write_value(client, W83793_REG_BEEP(index), data->beeps[index]); in store_beep()
427 struct i2c_client *client = to_i2c_client(dev); in store_beep_enable() local
428 struct w83793_data *data = i2c_get_clientdata(client); in store_beep_enable()
440 data->beep_enable = w83793_read_value(client, W83793_REG_OVT_BEEP) in store_beep_enable()
443 w83793_write_value(client, W83793_REG_OVT_BEEP, data->beep_enable); in store_beep_enable()
455 struct i2c_client *client = to_i2c_client(dev); in store_chassis_clear() local
456 struct w83793_data *data = i2c_get_clientdata(client); in store_chassis_clear()
468 reg = w83793_read_value(client, W83793_REG_CLR_CHASSIS); in store_chassis_clear()
469 w83793_write_value(client, W83793_REG_CLR_CHASSIS, reg | 0x80); in store_chassis_clear()
502 struct i2c_client *client = to_i2c_client(dev); in store_fan_min() local
503 struct w83793_data *data = i2c_get_clientdata(client); in store_fan_min()
514 w83793_write_value(client, W83793_REG_FAN_MIN(index), in store_fan_min()
516 w83793_write_value(client, W83793_REG_FAN_MIN(index) + 1, val & 0xff); in store_fan_min()
544 struct i2c_client *client = to_i2c_client(dev); in store_pwm() local
545 struct w83793_data *data = i2c_get_clientdata(client); in store_pwm()
561 w83793_write_value(client, W83793_REG_PWM_STOP_TIME(index), in store_pwm()
566 w83793_read_value(client, W83793_REG_PWM(index, nr)) & 0xc0; in store_pwm()
568 w83793_write_value(client, W83793_REG_PWM(index, nr), in store_pwm()
601 struct i2c_client *client = to_i2c_client(dev); in store_temp() local
602 struct w83793_data *data = i2c_get_clientdata(client); in store_temp()
612 w83793_write_value(client, W83793_REG_TEMP[index][nr], in store_temp()
662 struct i2c_client *client = to_i2c_client(dev); in store_temp_mode() local
663 struct w83793_data *data = i2c_get_clientdata(client); in store_temp_mode()
690 w83793_read_value(client, W83793_REG_TEMP_MODE[index]); in store_temp_mode()
693 w83793_write_value(client, W83793_REG_TEMP_MODE[index], in store_temp_mode()
732 struct i2c_client *client = to_i2c_client(dev); in store_sf_setup() local
733 struct w83793_data *data = i2c_get_clientdata(client); in store_sf_setup()
744 w83793_read_value(client, W83793_REG_PWM_DEFAULT) & 0xc0; in store_sf_setup()
746 w83793_write_value(client, W83793_REG_PWM_DEFAULT, in store_sf_setup()
751 w83793_write_value(client, W83793_REG_PWM_UPTIME, in store_sf_setup()
756 w83793_write_value(client, W83793_REG_PWM_DOWNTIME, in store_sf_setup()
760 w83793_read_value(client, W83793_REG_TEMP_CRITICAL) & 0x80; in store_sf_setup()
762 w83793_write_value(client, W83793_REG_TEMP_CRITICAL, in store_sf_setup()
833 struct i2c_client *client = to_i2c_client(dev); in store_sf_ctrl() local
834 struct w83793_data *data = i2c_get_clientdata(client); in store_sf_ctrl()
845 w83793_write_value(client, W83793_REG_TEMP_FAN_MAP(index), val); in store_sf_ctrl()
850 w83793_read_value(client, W83793_REG_PWM_ENABLE); in store_sf_ctrl()
855 w83793_write_value(client, W83793_REG_PWM_ENABLE, in store_sf_ctrl()
863 w83793_read_value(client, W83793_REG_TEMP_CRUISE(index)); in store_sf_ctrl()
867 w83793_write_value(client, W83793_REG_TEMP_CRUISE(index), in store_sf_ctrl()
873 w83793_read_value(client, W83793_REG_TEMP_TOL(i)); in store_sf_ctrl()
877 w83793_write_value(client, W83793_REG_TEMP_TOL(i), in store_sf_ctrl()
901 struct i2c_client *client = to_i2c_client(dev); in store_sf2_pwm() local
902 struct w83793_data *data = i2c_get_clientdata(client); in store_sf2_pwm()
917 w83793_read_value(client, W83793_REG_SF2_PWM(index, nr)) & 0xc0; in store_sf2_pwm()
919 w83793_write_value(client, W83793_REG_SF2_PWM(index, nr), in store_sf2_pwm()
942 struct i2c_client *client = to_i2c_client(dev); in store_sf2_temp() local
943 struct w83793_data *data = i2c_get_clientdata(client); in store_sf2_temp()
958 w83793_read_value(client, W83793_REG_SF2_TEMP(index, nr)) & 0x80; in store_sf2_temp()
960 w83793_write_value(client, W83793_REG_SF2_TEMP(index, nr), in store_sf2_temp()
994 struct i2c_client *client = to_i2c_client(dev); in store_in() local
995 struct w83793_data *data = i2c_get_clientdata(client); in store_in()
1013 w83793_read_value(client, W83793_REG_IN_LOW_BITS[nr]); in store_in()
1016 w83793_write_value(client, W83793_REG_IN_LOW_BITS[nr], in store_in()
1021 w83793_write_value(client, W83793_REG_IN[index][nr], in store_in()
1189 static void w83793_init_client(struct i2c_client *client) in w83793_init_client() argument
1192 w83793_write_value(client, W83793_REG_CONFIG, 0x80); in w83793_init_client()
1195 w83793_write_value(client, W83793_REG_CONFIG, in w83793_init_client()
1196 w83793_read_value(client, W83793_REG_CONFIG) | 0x01); in w83793_init_client()
1214 if (!data->client) { in watchdog_set_timeout()
1222 w83793_write_value(data->client, W83793_REG_WDT_TIMEOUT, in watchdog_set_timeout()
1248 if (!data->client) { in watchdog_trigger()
1254 w83793_write_value(data->client, W83793_REG_WDT_TIMEOUT, in watchdog_trigger()
1267 if (!data->client) { in watchdog_enable()
1273 w83793_write_value(data->client, W83793_REG_WDT_TIMEOUT, in watchdog_enable()
1277 w83793_write_value(data->client, W83793_REG_WDT_LOCK, 0x55); in watchdog_enable()
1289 if (!data->client) { in watchdog_disable()
1295 w83793_write_value(data->client, W83793_REG_WDT_LOCK, 0xAA); in watchdog_disable()
1356 dev_crit(&data->client->dev, in watchdog_close()
1512 static int w83793_remove(struct i2c_client *client) in w83793_remove() argument
1514 struct w83793_data *data = i2c_get_clientdata(client); in w83793_remove()
1515 struct device *dev = &client->dev; in w83793_remove()
1523 dev_warn(&client->dev, in w83793_remove()
1535 data->client = NULL; in w83793_remove()
1540 tmp = w83793_read_value(client, W83793_REG_CONFIG); in w83793_remove()
1541 w83793_write_value(client, W83793_REG_CONFIG, tmp & ~0x04); in w83793_remove()
1581 w83793_detect_subclients(struct i2c_client *client) in w83793_detect_subclients() argument
1584 int address = client->addr; in w83793_detect_subclients()
1586 struct i2c_adapter *adapter = client->adapter; in w83793_detect_subclients()
1587 struct w83793_data *data = i2c_get_clientdata(client); in w83793_detect_subclients()
1594 dev_err(&client->dev, in w83793_detect_subclients()
1602 w83793_write_value(client, W83793_REG_I2C_SUBADDR, in w83793_detect_subclients()
1607 tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR); in w83793_detect_subclients()
1613 dev_err(&client->dev, in w83793_detect_subclients()
1635 static int w83793_detect(struct i2c_client *client, in w83793_detect() argument
1639 struct i2c_adapter *adapter = client->adapter; in w83793_detect()
1640 unsigned short address = client->addr; in w83793_detect()
1645 bank = i2c_smbus_read_byte_data(client, W83793_REG_BANKSEL); in w83793_detect()
1649 if (tmp != i2c_smbus_read_byte_data(client, W83793_REG_VENDORID)) { in w83793_detect()
1659 && i2c_smbus_read_byte_data(client, W83793_REG_I2C_ADDR) != in w83793_detect()
1666 chip_id = i2c_smbus_read_byte_data(client, W83793_REG_CHIPID); in w83793_detect()
1675 static int w83793_probe(struct i2c_client *client, in w83793_probe() argument
1678 struct device *dev = &client->dev; in w83793_probe()
1692 i2c_set_clientdata(client, data); in w83793_probe()
1693 data->bank = i2c_smbus_read_byte_data(client, W83793_REG_BANKSEL); in w83793_probe()
1704 data->client = client; in w83793_probe()
1706 err = w83793_detect_subclients(client); in w83793_probe()
1711 w83793_init_client(client); in w83793_probe()
1719 tmp = w83793_read_value(client, W83793_REG_MFC); in w83793_probe()
1720 val = w83793_read_value(client, W83793_REG_FANIN_CTRL); in w83793_probe()
1762 tmp = w83793_read_value(client, W83793_REG_FANIN_SEL); in w83793_probe()
1777 tmp = w83793_read_value(client, W83793_REG_TEMP_MODE[0]); in w83793_probe()
1787 tmp = w83793_read_value(client, W83793_REG_TEMP_MODE[1]); in w83793_probe()
1872 dev_err(&client->dev, in w83793_probe()
1882 tmp = w83793_read_value(client, W83793_REG_CONFIG); in w83793_probe()
1883 w83793_write_value(client, W83793_REG_CONFIG, tmp | 0x04); in w83793_probe()
1890 w83793_read_value(data->client, W83793_REG_WDT_STATUS) & 0x01; in w83793_probe()
1914 dev_err(&client->dev, in w83793_probe()
1921 dev_info(&client->dev, in w83793_probe()
1928 dev_warn(&client->dev, in w83793_probe()
1975 struct i2c_client *client = to_i2c_client(dev); in w83793_update_nonvolatile() local
1976 struct w83793_data *data = i2c_get_clientdata(client); in w83793_update_nonvolatile()
1990 w83793_read_value(client, W83793_REG_IN[j][i]); in w83793_update_nonvolatile()
1993 w83793_read_value(client, W83793_REG_IN_LOW_BITS[i]); in w83793_update_nonvolatile()
2001 w83793_read_value(client, W83793_REG_FAN_MIN(i)) << 8; in w83793_update_nonvolatile()
2003 w83793_read_value(client, W83793_REG_FAN_MIN(i) + 1); in w83793_update_nonvolatile()
2010 w83793_read_value(client, W83793_REG_TEMP_FAN_MAP(i)); in w83793_update_nonvolatile()
2013 w83793_read_value(client, W83793_REG_TEMP[i][j]); in w83793_update_nonvolatile()
2016 w83793_read_value(client, W83793_REG_TEMP_CRUISE(i)); in w83793_update_nonvolatile()
2019 w83793_read_value(client, W83793_REG_SF2_PWM(i, j)); in w83793_update_nonvolatile()
2021 w83793_read_value(client, in w83793_update_nonvolatile()
2028 w83793_read_value(client, W83793_REG_TEMP_MODE[i]); in w83793_update_nonvolatile()
2032 w83793_read_value(client, W83793_REG_TEMP_TOL(i)); in w83793_update_nonvolatile()
2039 w83793_read_value(client, W83793_REG_PWM(i, PWM_NONSTOP)); in w83793_update_nonvolatile()
2041 w83793_read_value(client, W83793_REG_PWM(i, PWM_START)); in w83793_update_nonvolatile()
2043 w83793_read_value(client, W83793_REG_PWM_STOP_TIME(i)); in w83793_update_nonvolatile()
2046 data->pwm_default = w83793_read_value(client, W83793_REG_PWM_DEFAULT); in w83793_update_nonvolatile()
2047 data->pwm_enable = w83793_read_value(client, W83793_REG_PWM_ENABLE); in w83793_update_nonvolatile()
2048 data->pwm_uptime = w83793_read_value(client, W83793_REG_PWM_UPTIME); in w83793_update_nonvolatile()
2049 data->pwm_downtime = w83793_read_value(client, W83793_REG_PWM_DOWNTIME); in w83793_update_nonvolatile()
2051 w83793_read_value(client, W83793_REG_TEMP_CRITICAL); in w83793_update_nonvolatile()
2052 data->beep_enable = w83793_read_value(client, W83793_REG_OVT_BEEP); in w83793_update_nonvolatile()
2055 data->beeps[i] = w83793_read_value(client, W83793_REG_BEEP(i)); in w83793_update_nonvolatile()
2062 struct i2c_client *client = to_i2c_client(dev); in w83793_update_device() local
2063 struct w83793_data *data = i2c_get_clientdata(client); in w83793_update_device()
2075 w83793_read_value(client, W83793_REG_IN[i][IN_READ]); in w83793_update_device()
2078 w83793_read_value(client, W83793_REG_IN_LOW_BITS[IN_READ]); in w83793_update_device()
2084 w83793_read_value(client, W83793_REG_FAN(i)) << 8; in w83793_update_device()
2086 w83793_read_value(client, W83793_REG_FAN(i) + 1); in w83793_update_device()
2093 w83793_read_value(client, W83793_REG_TEMP[i][TEMP_READ]); in w83793_update_device()
2097 w83793_read_value(client, W83793_REG_TEMP_LOW_BITS); in w83793_update_device()
2102 w83793_read_value(client, in w83793_update_device()
2108 w83793_read_value(client, W83793_REG_ALARM(i)); in w83793_update_device()
2110 data->vid[0] = w83793_read_value(client, W83793_REG_VID_INA); in w83793_update_device()
2112 data->vid[1] = w83793_read_value(client, W83793_REG_VID_INB); in w83793_update_device()
2126 static u8 w83793_read_value(struct i2c_client *client, u16 reg) in w83793_read_value() argument
2128 struct w83793_data *data = i2c_get_clientdata(client); in w83793_read_value()
2135 (client, W83793_REG_BANKSEL, new_bank) >= 0) in w83793_read_value()
2138 dev_err(&client->dev, in w83793_read_value()
2146 res = i2c_smbus_read_byte_data(client, reg & 0xff); in w83793_read_value()
2152 static int w83793_write_value(struct i2c_client *client, u16 reg, u8 value) in w83793_write_value() argument
2154 struct w83793_data *data = i2c_get_clientdata(client); in w83793_write_value()
2160 res = i2c_smbus_write_byte_data(client, W83793_REG_BANKSEL, in w83793_write_value()
2163 dev_err(&client->dev, in w83793_write_value()
2172 res = i2c_smbus_write_byte_data(client, reg & 0xff, value); in w83793_write_value()