Lines Matching refs:client
87 static void pcf8591_init_client(struct i2c_client *client);
118 struct i2c_client *client = to_i2c_client(dev); in set_out0_output() local
119 struct pcf8591_data *data = i2c_get_clientdata(client); in set_out0_output()
131 i2c_smbus_write_byte_data(client, data->control, data->aout); in set_out0_output()
149 struct i2c_client *client = to_i2c_client(dev); in set_out0_enable() local
150 struct pcf8591_data *data = i2c_get_clientdata(client); in set_out0_enable()
163 i2c_smbus_write_byte(client, data->control); in set_out0_enable()
197 static int pcf8591_probe(struct i2c_client *client, in pcf8591_probe() argument
203 data = devm_kzalloc(&client->dev, sizeof(struct pcf8591_data), in pcf8591_probe()
208 i2c_set_clientdata(client, data); in pcf8591_probe()
212 pcf8591_init_client(client); in pcf8591_probe()
215 err = sysfs_create_group(&client->dev.kobj, &pcf8591_attr_group); in pcf8591_probe()
221 err = device_create_file(&client->dev, &dev_attr_in2_input); in pcf8591_probe()
228 err = device_create_file(&client->dev, &dev_attr_in3_input); in pcf8591_probe()
233 data->hwmon_dev = hwmon_device_register(&client->dev); in pcf8591_probe()
242 sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group_opt); in pcf8591_probe()
243 sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group); in pcf8591_probe()
247 static int pcf8591_remove(struct i2c_client *client) in pcf8591_remove() argument
249 struct pcf8591_data *data = i2c_get_clientdata(client); in pcf8591_remove()
252 sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group_opt); in pcf8591_remove()
253 sysfs_remove_group(&client->dev.kobj, &pcf8591_attr_group); in pcf8591_remove()
258 static void pcf8591_init_client(struct i2c_client *client) in pcf8591_init_client() argument
260 struct pcf8591_data *data = i2c_get_clientdata(client); in pcf8591_init_client()
264 i2c_smbus_write_byte_data(client, data->control, data->aout); in pcf8591_init_client()
270 i2c_smbus_read_byte(client); in pcf8591_init_client()
276 struct i2c_client *client = to_i2c_client(dev); in pcf8591_read_channel() local
277 struct pcf8591_data *data = i2c_get_clientdata(client); in pcf8591_read_channel()
284 i2c_smbus_write_byte(client, data->control); in pcf8591_read_channel()
290 i2c_smbus_read_byte(client); in pcf8591_read_channel()
292 value = i2c_smbus_read_byte(client); in pcf8591_read_channel()