Lines Matching refs:client

64 	struct i2c_client *client;  member
97 static int fts_read_byte(struct i2c_client *client, unsigned short reg) in fts_read_byte() argument
101 struct fts_data *data = dev_get_drvdata(&client->dev); in fts_read_byte()
105 dev_dbg(&client->dev, "page select - page: 0x%.02x\n", page); in fts_read_byte()
106 ret = i2c_smbus_write_byte_data(client, FTS_PAGE_SELECT_REG, page); in fts_read_byte()
111 ret = i2c_smbus_read_byte_data(client, reg); in fts_read_byte()
112 dev_dbg(&client->dev, "read - reg: 0x%.02x: val: 0x%.02x\n", reg, ret); in fts_read_byte()
119 static int fts_write_byte(struct i2c_client *client, unsigned short reg, in fts_write_byte() argument
124 struct fts_data *data = dev_get_drvdata(&client->dev); in fts_write_byte()
128 dev_dbg(&client->dev, "page select - page: 0x%.02x\n", page); in fts_write_byte()
129 ret = i2c_smbus_write_byte_data(client, FTS_PAGE_SELECT_REG, page); in fts_write_byte()
134 dev_dbg(&client->dev, in fts_write_byte()
136 ret = i2c_smbus_write_byte_data(client, reg, value); in fts_write_byte()
155 err = fts_read_byte(data->client, FTS_DEVICE_STATUS_REG); in fts_update_device()
165 err = fts_read_byte(data->client, FTS_FAN_PRESENT_REG); in fts_update_device()
170 err = fts_read_byte(data->client, FTS_FAN_EVENT_REG); in fts_update_device()
177 err = fts_read_byte(data->client, FTS_REG_FAN_INPUT(i)); in fts_update_device()
182 err = fts_read_byte(data->client, in fts_update_device()
193 err = fts_read_byte(data->client, FTS_SENSOR_EVENT_REG); in fts_update_device()
199 err = fts_read_byte(data->client, FTS_REG_TEMP_INPUT(i)); in fts_update_device()
206 err = fts_read_byte(data->client, FTS_REG_VOLT(i)); in fts_update_device()
229 ret = fts_read_byte(data->client, FTS_WATCHDOG_CONTROL); in fts_wd_set_resolution()
244 ret = fts_write_byte(data->client, FTS_WATCHDOG_CONTROL, ret); in fts_wd_set_resolution()
279 return fts_write_byte(data->client, FTS_WATCHDOG_TIME_PRESET, in fts_wd_start()
288 return fts_write_byte(data->client, FTS_WATCHDOG_TIME_PRESET, 0); in fts_wd_stop()
309 timeout = fts_read_byte(data->client, FTS_WATCHDOG_TIME_PRESET); in fts_watchdog_init()
320 ret = fts_read_byte(data->client, FTS_WATCHDOG_CONTROL); in fts_watchdog_init()
332 data->wdd.parent = &data->client->dev; in fts_watchdog_init()
338 return devm_watchdog_register_device(&data->client->dev, &data->wdd); in fts_watchdog_init()
471 ret = fts_read_byte(data->client, FTS_REG_TEMP_CONTROL(channel)); in fts_write()
473 ret = fts_write_byte(data->client, FTS_REG_TEMP_CONTROL(channel), in fts_write()
494 ret = fts_read_byte(data->client, FTS_REG_FAN_CONTROL(channel)); in fts_write()
496 ret = fts_write_byte(data->client, FTS_REG_FAN_CONTROL(channel), in fts_write()
580 static int fts_detect(struct i2c_client *client, in fts_detect() argument
586 val = i2c_smbus_read_byte_data(client, FTS_DEVICE_REVISION_REG); in fts_detect()
591 val = i2c_smbus_read_byte_data(client, FTS_DEVICE_DETECT_REG_1); in fts_detect()
595 val = i2c_smbus_read_byte_data(client, FTS_DEVICE_DETECT_REG_2); in fts_detect()
599 val = i2c_smbus_read_byte_data(client, FTS_DEVICE_DETECT_REG_3); in fts_detect()
607 val = i2c_smbus_read_byte_data(client, FTS_DEVICE_ID_REG); in fts_detect()
616 static int fts_probe(struct i2c_client *client) in fts_probe() argument
624 if (client->addr != 0x73) in fts_probe()
628 deviceid = i2c_smbus_read_byte_data(client, FTS_DEVICE_ID_REG); in fts_probe()
634 dev_dbg(&client->dev, in fts_probe()
639 dev_dbg(&client->dev, "No fujitsu board\n"); in fts_probe()
643 data = devm_kzalloc(&client->dev, sizeof(struct fts_data), in fts_probe()
650 data->client = client; in fts_probe()
651 dev_set_drvdata(&client->dev, data); in fts_probe()
653 err = i2c_smbus_read_byte_data(client, FTS_DEVICE_REVISION_REG); in fts_probe()
658 hwmon_dev = devm_hwmon_device_register_with_info(&client->dev, "ftsteutates", data, in fts_probe()
667 dev_info(&client->dev, "Detected FTS Teutates chip, revision: %d.%d\n", in fts_probe()