Lines Matching refs:client

230 	struct i2c_client *client;  member
372 static int adp5589_read(struct i2c_client *client, u8 reg) in adp5589_read() argument
374 int ret = i2c_smbus_read_byte_data(client, reg); in adp5589_read()
377 dev_err(&client->dev, "Read Error\n"); in adp5589_read()
382 static int adp5589_write(struct i2c_client *client, u8 reg, u8 val) in adp5589_write() argument
384 return i2c_smbus_write_byte_data(client, reg, val); in adp5589_write()
394 return !!(adp5589_read(kpad->client, in adp5589_gpio_get_value()
413 adp5589_write(kpad->client, kpad->var->reg(ADP5589_GPO_DATA_OUT_A) + in adp5589_gpio_set_value()
429 ret = adp5589_write(kpad->client, in adp5589_gpio_direction_input()
455 ret = adp5589_write(kpad->client, kpad->var->reg(ADP5589_GPO_DATA_OUT_A) in adp5589_gpio_direction_output()
457 ret |= adp5589_write(kpad->client, in adp5589_gpio_direction_output()
500 struct device *dev = &kpad->client->dev; in adp5589_gpio_add()
523 kpad->gc.label = kpad->client->name; in adp5589_gpio_add()
535 kpad->dat_out[i] = adp5589_read(kpad->client, kpad->var->reg( in adp5589_gpio_add()
537 kpad->dir[i] = adp5589_read(kpad->client, kpad->var->reg( in adp5589_gpio_add()
542 error = gpio_data->setup(kpad->client, in adp5589_gpio_add()
554 struct device *dev = &kpad->client->dev; in adp5589_gpio_remove()
563 error = gpio_data->teardown(kpad->client, in adp5589_gpio_remove()
603 int key = adp5589_read(kpad->client, ADP5589_5_FIFO_1 + i); in adp5589_report_events()
620 struct i2c_client *client = kpad->client; in adp5589_irq() local
623 status = adp5589_read(client, ADP5589_5_INT_STATUS); in adp5589_irq()
626 dev_err(&client->dev, "Event Overflow Error\n"); in adp5589_irq()
629 ev_cnt = adp5589_read(client, ADP5589_5_STATUS) & KEC; in adp5589_irq()
636 adp5589_write(client, ADP5589_5_INT_STATUS, status); /* Status is W1C */ in adp5589_irq()
649 dev_err(&kpad->client->dev, "RESET/UNLOCK key not in keycode map\n"); in adp5589_get_evcode()
656 struct i2c_client *client = kpad->client; in adp5589_setup() local
658 dev_get_platdata(&client->dev); in adp5589_setup()
664 ret = adp5589_write(client, reg(ADP5589_PIN_CONFIG_A), in adp5589_setup()
666 ret |= adp5589_write(client, reg(ADP5589_PIN_CONFIG_B), in adp5589_setup()
671 ret |= adp5589_write(client, ADP5589_PIN_CONFIG_C, in adp5589_setup()
675 ret |= adp5589_write(client, ADP5589_UNLOCK1, in adp5589_setup()
677 ret |= adp5589_write(client, ADP5589_UNLOCK2, in adp5589_setup()
679 ret |= adp5589_write(client, ADP5589_UNLOCK_TIMERS, in adp5589_setup()
681 ret |= adp5589_write(client, ADP5589_LOCK_CFG, LOCK_EN); in adp5589_setup()
685 ret |= adp5589_read(client, ADP5589_5_FIFO_1 + i); in adp5589_setup()
702 ret |= adp5589_write(client, reg(ADP5589_GPI_EVENT_EN_A), in adp5589_setup()
704 ret |= adp5589_write(client, reg(ADP5589_GPI_EVENT_EN_B), in adp5589_setup()
707 ret |= adp5589_write(client, in adp5589_setup()
714 dev_warn(&client->dev, "Conflicting pull resistor config\n"); in adp5589_setup()
730 ret |= adp5589_write(client, reg(ADP5585_RPULL_CONFIG_A) in adp5589_setup()
750 ret |= adp5589_write(client, in adp5589_setup()
758 ret |= adp5589_write(client, reg(ADP5589_RESET1_EVENT_A), in adp5589_setup()
761 ret |= adp5589_write(client, reg(ADP5589_RESET1_EVENT_B), in adp5589_setup()
764 ret |= adp5589_write(client, reg(ADP5589_RESET1_EVENT_C), in adp5589_setup()
771 ret |= adp5589_write(client, reg(ADP5589_RESET2_EVENT_A), in adp5589_setup()
774 ret |= adp5589_write(client, reg(ADP5589_RESET2_EVENT_B), in adp5589_setup()
781 ret |= adp5589_write(client, reg(ADP5589_RESET_CFG), in adp5589_setup()
783 ret |= adp5589_write(client, reg(ADP5589_PIN_CONFIG_D), in adp5589_setup()
787 ret |= adp5589_write(client, reg(ADP5589_DEBOUNCE_DIS_A), in adp5589_setup()
790 ret |= adp5589_write(client, reg(ADP5589_DEBOUNCE_DIS_B), in adp5589_setup()
795 ret |= adp5589_write(client, reg(ADP5589_DEBOUNCE_DIS_C), in adp5589_setup()
798 ret |= adp5589_write(client, reg(ADP5589_POLL_PTIME_CFG), in adp5589_setup()
800 ret |= adp5589_write(client, ADP5589_5_INT_STATUS, in adp5589_setup()
806 ret |= adp5589_write(client, reg(ADP5589_GENERAL_CFG), in adp5589_setup()
808 ret |= adp5589_write(client, reg(ADP5589_INT_EN), in adp5589_setup()
812 dev_err(&client->dev, "Write Error\n"); in adp5589_setup()
823 int gpi_stat1 = adp5589_read(kpad->client, in adp5589_report_switch_state()
825 int gpi_stat2 = adp5589_read(kpad->client, in adp5589_report_switch_state()
828 adp5589_read(kpad->client, ADP5589_GPI_STATUS_C) : 0; in adp5589_report_switch_state()
845 dev_err(&kpad->client->dev, in adp5589_report_switch_state()
859 static int adp5589_probe(struct i2c_client *client, in adp5589_probe() argument
864 dev_get_platdata(&client->dev); in adp5589_probe()
870 if (!i2c_check_functionality(client->adapter, in adp5589_probe()
872 dev_err(&client->dev, "SMBUS Byte Data not Supported\n"); in adp5589_probe()
877 dev_err(&client->dev, "no platform data?\n"); in adp5589_probe()
900 dev_err(&client->dev, "no rows, cols or keymap from pdata\n"); in adp5589_probe()
906 dev_err(&client->dev, "invalid keymapsize\n"); in adp5589_probe()
912 dev_err(&client->dev, "invalid gpimap from pdata\n"); in adp5589_probe()
918 dev_err(&client->dev, "invalid gpimapsize\n"); in adp5589_probe()
928 dev_err(&client->dev, "invalid gpi pin data\n"); in adp5589_probe()
935 dev_err(&client->dev, "invalid gpi row/col data\n"); in adp5589_probe()
941 if (!client->irq) { in adp5589_probe()
942 dev_err(&client->dev, "no IRQ?\n"); in adp5589_probe()
953 kpad->client = client; in adp5589_probe()
956 ret = adp5589_read(client, ADP5589_5_ID); in adp5589_probe()
964 input->name = client->name; in adp5589_probe()
966 input->dev.parent = &client->dev; in adp5589_probe()
1003 dev_err(&client->dev, "unable to register input device\n"); in adp5589_probe()
1007 error = request_threaded_irq(client->irq, NULL, adp5589_irq, in adp5589_probe()
1009 client->dev.driver->name, kpad); in adp5589_probe()
1011 dev_err(&client->dev, "irq %d busy?\n", client->irq); in adp5589_probe()
1026 device_init_wakeup(&client->dev, 1); in adp5589_probe()
1027 i2c_set_clientdata(client, kpad); in adp5589_probe()
1029 dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq); in adp5589_probe()
1033 free_irq(client->irq, kpad); in adp5589_probe()
1045 static int adp5589_remove(struct i2c_client *client) in adp5589_remove() argument
1047 struct adp5589_kpad *kpad = i2c_get_clientdata(client); in adp5589_remove()
1049 adp5589_write(client, kpad->var->reg(ADP5589_GENERAL_CFG), 0); in adp5589_remove()
1050 free_irq(client->irq, kpad); in adp5589_remove()
1062 struct i2c_client *client = kpad->client; in adp5589_suspend() local
1064 disable_irq(client->irq); in adp5589_suspend()
1066 if (device_may_wakeup(&client->dev)) in adp5589_suspend()
1067 enable_irq_wake(client->irq); in adp5589_suspend()
1075 struct i2c_client *client = kpad->client; in adp5589_resume() local
1077 if (device_may_wakeup(&client->dev)) in adp5589_resume()
1078 disable_irq_wake(client->irq); in adp5589_resume()
1080 enable_irq(client->irq); in adp5589_resume()