Lines Matching refs:client
89 struct i2c_client *client; member
96 int (*write)(struct i2c_client *client, unsigned data);
97 int (*read)(struct i2c_client *client);
104 static int i2c_write_le8(struct i2c_client *client, unsigned data) in i2c_write_le8() argument
106 return i2c_smbus_write_byte(client, data); in i2c_write_le8()
109 static int i2c_read_le8(struct i2c_client *client) in i2c_read_le8() argument
111 return (int)i2c_smbus_read_byte(client); in i2c_read_le8()
116 static int i2c_write_le16(struct i2c_client *client, unsigned word) in i2c_write_le16() argument
121 status = i2c_master_send(client, buf, 2); in i2c_write_le16()
125 static int i2c_read_le16(struct i2c_client *client) in i2c_read_le16() argument
130 status = i2c_master_recv(client, buf, 2); in i2c_read_le16()
145 status = gpio->write(gpio->client, gpio->out); in pcf857x_input()
156 value = gpio->read(gpio->client); in pcf857x_get()
171 status = gpio->write(gpio->client, gpio->out); in pcf857x_output()
189 status = gpio->read(gpio->client); in pcf857x_irq()
220 dev_dbg(&gpio->client->dev, in pcf857x_irq_set_wake()
271 static int pcf857x_probe(struct i2c_client *client, in pcf857x_probe() argument
274 struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev); in pcf857x_probe()
275 struct device_node *np = client->dev.of_node; in pcf857x_probe()
285 dev_dbg(&client->dev, "no platform data\n"); in pcf857x_probe()
288 gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); in pcf857x_probe()
296 gpio->chip.dev = &client->dev; in pcf857x_probe()
319 if (!i2c_check_functionality(client->adapter, in pcf857x_probe()
325 status = i2c_smbus_read_byte(client); in pcf857x_probe()
337 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) in pcf857x_probe()
342 status = i2c_read_le16(client); in pcf857x_probe()
345 dev_dbg(&client->dev, "unsupported number of gpios\n"); in pcf857x_probe()
352 gpio->chip.label = client->name; in pcf857x_probe()
354 gpio->client = client; in pcf857x_probe()
355 i2c_set_clientdata(client, gpio); in pcf857x_probe()
380 if (client->irq) { in pcf857x_probe()
385 dev_err(&client->dev, "cannot add irqchip\n"); in pcf857x_probe()
389 status = devm_request_threaded_irq(&client->dev, client->irq, in pcf857x_probe()
392 dev_name(&client->dev), gpio); in pcf857x_probe()
397 client->irq, NULL); in pcf857x_probe()
398 gpio->irq_parent = client->irq; in pcf857x_probe()
405 status = pdata->setup(client, in pcf857x_probe()
409 dev_warn(&client->dev, "setup --> %d\n", status); in pcf857x_probe()
412 dev_info(&client->dev, "probed\n"); in pcf857x_probe()
420 dev_dbg(&client->dev, "probe error %d for '%s'\n", status, in pcf857x_probe()
421 client->name); in pcf857x_probe()
426 static int pcf857x_remove(struct i2c_client *client) in pcf857x_remove() argument
428 struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev); in pcf857x_remove()
429 struct pcf857x *gpio = i2c_get_clientdata(client); in pcf857x_remove()
433 status = pdata->teardown(client, in pcf857x_remove()
437 dev_err(&client->dev, "%s --> %d\n", in pcf857x_remove()