Lines Matching refs:client
219 struct i2c_client *client; member
242 static s32 synaptics_i2c_reg_get(struct i2c_client *client, u16 reg) in synaptics_i2c_reg_get() argument
246 ret = i2c_smbus_write_byte_data(client, PAGE_SEL_REG, reg >> 8); in synaptics_i2c_reg_get()
248 ret = i2c_smbus_read_byte_data(client, reg & 0xff); in synaptics_i2c_reg_get()
253 static s32 synaptics_i2c_reg_set(struct i2c_client *client, u16 reg, u8 val) in synaptics_i2c_reg_set() argument
257 ret = i2c_smbus_write_byte_data(client, PAGE_SEL_REG, reg >> 8); in synaptics_i2c_reg_set()
259 ret = i2c_smbus_write_byte_data(client, reg & 0xff, val); in synaptics_i2c_reg_set()
264 static s32 synaptics_i2c_word_get(struct i2c_client *client, u16 reg) in synaptics_i2c_word_get() argument
268 ret = i2c_smbus_write_byte_data(client, PAGE_SEL_REG, reg >> 8); in synaptics_i2c_word_get()
270 ret = i2c_smbus_read_word_data(client, reg & 0xff); in synaptics_i2c_word_get()
275 static int synaptics_i2c_config(struct i2c_client *client) in synaptics_i2c_config() argument
281 ret = synaptics_i2c_reg_set(client, DEV_CONTROL_REG, 0xc1); in synaptics_i2c_config()
287 ret = synaptics_i2c_reg_set(client, INTERRUPT_EN_REG, int_en); in synaptics_i2c_config()
291 control = synaptics_i2c_reg_get(client, GENERAL_2D_CONTROL_REG); in synaptics_i2c_config()
298 ret = synaptics_i2c_reg_set(client, GENERAL_2D_CONTROL_REG, control); in synaptics_i2c_config()
305 static int synaptics_i2c_reset_config(struct i2c_client *client) in synaptics_i2c_reset_config() argument
310 ret = synaptics_i2c_reg_set(client, DEV_COMMAND_REG, RESET_COMMAND); in synaptics_i2c_reset_config()
312 dev_err(&client->dev, "Unable to reset device\n"); in synaptics_i2c_reset_config()
315 ret = synaptics_i2c_config(client); in synaptics_i2c_reset_config()
317 dev_err(&client->dev, "Unable to config device\n"); in synaptics_i2c_reset_config()
323 static int synaptics_i2c_check_error(struct i2c_client *client) in synaptics_i2c_check_error() argument
327 status = i2c_smbus_read_byte_data(client, DEVICE_STATUS_REG) & in synaptics_i2c_check_error()
331 ret = synaptics_i2c_reset_config(client); in synaptics_i2c_check_error()
344 if (synaptics_i2c_check_error(touch->client)) in synaptics_i2c_get_input()
348 data = synaptics_i2c_reg_get(touch->client, DATA_REG0); in synaptics_i2c_get_input()
355 xy_delta = synaptics_i2c_word_get(touch->client, REL_X_REG) & 0xffff; in synaptics_i2c_get_input()
416 synaptics_i2c_reset_config(touch->client); in synaptics_i2c_check_params()
472 ret = synaptics_i2c_reset_config(touch->client); in synaptics_i2c_open()
488 synaptics_i2c_reg_set(touch->client, INTERRUPT_EN_REG, 0); in synaptics_i2c_close()
493 synaptics_i2c_reg_set(touch->client, DEV_CONTROL_REG, DEEP_SLEEP); in synaptics_i2c_close()
500 input->name = touch->client->name; in synaptics_i2c_set_input_params()
501 input->phys = touch->client->adapter->name; in synaptics_i2c_set_input_params()
503 input->id.version = synaptics_i2c_word_get(touch->client, in synaptics_i2c_set_input_params()
505 input->dev.parent = &touch->client->dev; in synaptics_i2c_set_input_params()
520 static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *client) in synaptics_i2c_touch_create() argument
528 touch->client = client; in synaptics_i2c_touch_create()
538 static int synaptics_i2c_probe(struct i2c_client *client, in synaptics_i2c_probe() argument
544 touch = synaptics_i2c_touch_create(client); in synaptics_i2c_probe()
548 ret = synaptics_i2c_reset_config(client); in synaptics_i2c_probe()
552 if (client->irq < 1) in synaptics_i2c_probe()
564 dev_dbg(&touch->client->dev, in synaptics_i2c_probe()
565 "Requesting IRQ: %d\n", touch->client->irq); in synaptics_i2c_probe()
567 ret = request_irq(touch->client->irq, synaptics_i2c_irq, in synaptics_i2c_probe()
571 dev_warn(&touch->client->dev, in synaptics_i2c_probe()
575 synaptics_i2c_reg_set(touch->client, in synaptics_i2c_probe()
581 dev_dbg(&touch->client->dev, in synaptics_i2c_probe()
587 dev_err(&client->dev, in synaptics_i2c_probe()
592 i2c_set_clientdata(client, touch); in synaptics_i2c_probe()
604 static int synaptics_i2c_remove(struct i2c_client *client) in synaptics_i2c_remove() argument
606 struct synaptics_i2c *touch = i2c_get_clientdata(client); in synaptics_i2c_remove()
609 free_irq(client->irq, touch); in synaptics_i2c_remove()
619 struct i2c_client *client = to_i2c_client(dev); in synaptics_i2c_suspend() local
620 struct synaptics_i2c *touch = i2c_get_clientdata(client); in synaptics_i2c_suspend()
625 synaptics_i2c_reg_set(touch->client, DEV_CONTROL_REG, DEEP_SLEEP); in synaptics_i2c_suspend()
633 struct i2c_client *client = to_i2c_client(dev); in synaptics_i2c_resume() local
634 struct synaptics_i2c *touch = i2c_get_clientdata(client); in synaptics_i2c_resume()
636 ret = synaptics_i2c_reset_config(client); in synaptics_i2c_resume()