Lines Matching refs:client
266 struct i2c_client *client; member
290 static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf, in rohm_i2c_burst_read() argument
293 struct i2c_adapter *adap = client->adapter; in rohm_i2c_burst_read()
297 msg[0].addr = client->addr; in rohm_i2c_burst_read()
302 msg[1].addr = client->addr; in rohm_i2c_burst_read()
323 struct i2c_client *client = ts->client; in rohm_ts_manual_calibration() local
324 struct device *dev = &client->dev; in rohm_ts_manual_calibration()
343 reg1_orig = i2c_smbus_read_byte_data(client, CALIBRATION_REG1); in rohm_ts_manual_calibration()
347 reg2_orig = i2c_smbus_read_byte_data(client, CALIBRATION_REG2); in rohm_ts_manual_calibration()
351 reg3_orig = i2c_smbus_read_byte_data(client, CALIBRATION_REG3); in rohm_ts_manual_calibration()
355 error = i2c_smbus_write_byte_data(client, INT_MASK, in rohm_ts_manual_calibration()
361 error = i2c_smbus_write_byte_data(client, TEST1, in rohm_ts_manual_calibration()
372 error = rohm_i2c_burst_read(client, PRM1_X_H, buf, sizeof(buf)); in rohm_ts_manual_calibration()
386 error = i2c_smbus_write_byte_data(client, TEST1, in rohm_ts_manual_calibration()
421 error = i2c_smbus_write_byte_data(client, in rohm_ts_manual_calibration()
426 error = i2c_smbus_write_byte_data(client, in rohm_ts_manual_calibration()
431 error = i2c_smbus_write_byte_data(client, in rohm_ts_manual_calibration()
439 error = i2c_smbus_write_byte_data(client, FORCE_CALIBRATION, in rohm_ts_manual_calibration()
444 error = i2c_smbus_write_byte_data(client, FORCE_CALIBRATION, in rohm_ts_manual_calibration()
450 error = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_manual_calibration()
462 val = i2c_smbus_read_byte_data(client, TOUCH_GESTURE); in rohm_ts_manual_calibration()
473 val = i2c_smbus_read_byte_data(client, INT_STATUS); in rohm_ts_manual_calibration()
487 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG1, in rohm_ts_manual_calibration()
492 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG2, in rohm_ts_manual_calibration()
497 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG3, in rohm_ts_manual_calibration()
503 error = i2c_smbus_write_byte_data(client, TEST1, in rohm_ts_manual_calibration()
516 error2 = i2c_smbus_write_byte_data(client, INT_MASK, INT_ALL); in rohm_ts_manual_calibration()
519 error2 = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_manual_calibration()
531 struct i2c_client *client = ts->client; in rohm_ts_soft_irq() local
533 struct device *dev = &client->dev; in rohm_ts_soft_irq()
547 error = i2c_smbus_write_byte_data(client, INT_MASK, INT_ALL); in rohm_ts_soft_irq()
552 error = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_soft_irq()
558 error = rohm_i2c_burst_read(client, POS_X1_H, buf, sizeof(buf)); in rohm_ts_soft_irq()
643 i2c_smbus_write_byte_data(client, INT_MASK, in rohm_ts_soft_irq()
650 static int rohm_ts_load_firmware(struct i2c_client *client, in rohm_ts_load_firmware() argument
653 struct device *dev = &client->dev; in rohm_ts_load_firmware()
667 error = i2c_smbus_write_byte_data(client, INT_MASK, in rohm_ts_load_firmware()
678 error = i2c_smbus_write_byte_data(client, EX_WDAT, 0); in rohm_ts_load_firmware()
683 error = i2c_smbus_write_byte_data(client, EX_ADDR_H, 0); in rohm_ts_load_firmware()
687 error = i2c_smbus_write_byte_data(client, EX_ADDR_L, 0); in rohm_ts_load_firmware()
691 error = i2c_smbus_write_byte_data(client, COMMON_SETUP1, in rohm_ts_load_firmware()
703 error = i2c_smbus_write_i2c_block_data(client, EX_WDAT, in rohm_ts_load_firmware()
713 status = i2c_smbus_read_byte_data(client, INT_STATUS); in rohm_ts_load_firmware()
720 error = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_load_firmware()
731 error2 = i2c_smbus_write_byte_data(client, INT_MASK, INT_ALL); in rohm_ts_load_firmware()
741 struct i2c_client *client = to_i2c_client(dev); in swap_xy_show() local
742 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_show()
750 struct i2c_client *client = to_i2c_client(dev); in swap_xy_store() local
751 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_store()
769 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in swap_xy_store()
780 struct i2c_client *client = to_i2c_client(dev); in inv_x_show() local
781 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_show()
789 struct i2c_client *client = to_i2c_client(dev); in inv_x_store() local
790 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_store()
808 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in inv_x_store()
819 struct i2c_client *client = to_i2c_client(dev); in inv_y_show() local
820 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_show()
828 struct i2c_client *client = to_i2c_client(dev); in inv_y_store() local
829 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_store()
847 error = i2c_smbus_write_byte_data(client, COMMON_SETUP2, in inv_y_store()
870 static int rohm_ts_device_init(struct i2c_client *client, u8 setup2) in rohm_ts_device_init() argument
872 struct device *dev = &client->dev; in rohm_ts_device_init()
875 disable_irq(client->irq); in rohm_ts_device_init()
883 error = i2c_smbus_write_byte_data(client, SYSTEM, in rohm_ts_device_init()
892 error = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_device_init()
896 error = i2c_smbus_write_byte_data(client, EX_WDAT, 0); in rohm_ts_device_init()
900 error = i2c_smbus_write_byte_data(client, COMMON_SETUP1, 0); in rohm_ts_device_init()
904 error = i2c_smbus_write_byte_data(client, COMMON_SETUP2, setup2); in rohm_ts_device_init()
908 error = i2c_smbus_write_byte_data(client, COMMON_SETUP3, in rohm_ts_device_init()
913 error = i2c_smbus_write_byte_data(client, THRESHOLD_GESTURE, in rohm_ts_device_init()
918 error = i2c_smbus_write_byte_data(client, INTERVAL_TIME, in rohm_ts_device_init()
923 error = i2c_smbus_write_byte_data(client, CPU_FREQ, CPU_FREQ_10MHZ); in rohm_ts_device_init()
927 error = i2c_smbus_write_byte_data(client, PRM_SWOFF_TIME, in rohm_ts_device_init()
932 error = i2c_smbus_write_byte_data(client, ADC_CTRL, ADC_DIV_DEFAULT); in rohm_ts_device_init()
936 error = i2c_smbus_write_byte_data(client, ADC_WAIT, ADC_WAIT_DEFAULT); in rohm_ts_device_init()
943 error = i2c_smbus_write_byte_data(client, STEP_X, STEP_X_DEFAULT); in rohm_ts_device_init()
947 error = i2c_smbus_write_byte_data(client, STEP_Y, STEP_Y_DEFAULT); in rohm_ts_device_init()
951 error = i2c_smbus_write_byte_data(client, OFFSET_X, OFFSET_X_DEFAULT); in rohm_ts_device_init()
955 error = i2c_smbus_write_byte_data(client, OFFSET_Y, OFFSET_Y_DEFAULT); in rohm_ts_device_init()
959 error = i2c_smbus_write_byte_data(client, THRESHOLD_TOUCH, in rohm_ts_device_init()
964 error = i2c_smbus_write_byte_data(client, EVR_XY, EVR_XY_DEFAULT); in rohm_ts_device_init()
968 error = i2c_smbus_write_byte_data(client, EVR_X, EVR_X_DEFAULT); in rohm_ts_device_init()
972 error = i2c_smbus_write_byte_data(client, EVR_Y, EVR_Y_DEFAULT); in rohm_ts_device_init()
977 error = i2c_smbus_write_byte_data(client, CALIBRATION_ADJUST, in rohm_ts_device_init()
982 error = i2c_smbus_write_byte_data(client, SWCONT, SWCONT_DEFAULT); in rohm_ts_device_init()
986 error = i2c_smbus_write_byte_data(client, TEST1, in rohm_ts_device_init()
992 error = rohm_ts_load_firmware(client, BU21023_FIRMWARE_NAME); in rohm_ts_device_init()
1004 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG1, in rohm_ts_device_init()
1009 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG2, in rohm_ts_device_init()
1014 error = i2c_smbus_write_byte_data(client, CALIBRATION_REG3, in rohm_ts_device_init()
1019 error = i2c_smbus_write_byte_data(client, FORCE_CALIBRATION, in rohm_ts_device_init()
1024 error = i2c_smbus_write_byte_data(client, FORCE_CALIBRATION, in rohm_ts_device_init()
1030 error = i2c_smbus_write_byte_data(client, INT_CLEAR, 0xff); in rohm_ts_device_init()
1035 error = i2c_smbus_write_byte_data(client, INT_MASK, in rohm_ts_device_init()
1041 error = i2c_smbus_write_byte_data(client, ERR_MASK, in rohm_ts_device_init()
1048 error = i2c_smbus_write_byte_data(client, SYSTEM, in rohm_ts_device_init()
1051 enable_irq(client->irq); in rohm_ts_device_init()
1056 static int rohm_ts_power_off(struct i2c_client *client) in rohm_ts_power_off() argument
1060 error = i2c_smbus_write_byte_data(client, SYSTEM, in rohm_ts_power_off()
1063 dev_err(&client->dev, in rohm_ts_power_off()
1068 error = i2c_smbus_write_byte_data(client, SYSTEM, in rohm_ts_power_off()
1071 dev_err(&client->dev, in rohm_ts_power_off()
1080 struct i2c_client *client = ts->client; in rohm_ts_open() local
1084 error = rohm_ts_device_init(client, ts->setup2); in rohm_ts_open()
1086 dev_err(&client->dev, in rohm_ts_open()
1101 rohm_ts_power_off(ts->client); in rohm_ts_close()
1113 static int rohm_bu21023_i2c_probe(struct i2c_client *client, in rohm_bu21023_i2c_probe() argument
1116 struct device *dev = &client->dev; in rohm_bu21023_i2c_probe()
1121 if (!client->irq) { in rohm_bu21023_i2c_probe()
1126 if (!client->adapter->algo->master_xfer) { in rohm_bu21023_i2c_probe()
1132 error = rohm_ts_power_off(client); in rohm_bu21023_i2c_probe()
1140 ts->client = client; in rohm_bu21023_i2c_probe()
1142 i2c_set_clientdata(client, ts); in rohm_bu21023_i2c_probe()
1169 error = devm_request_threaded_irq(dev, client->irq, in rohm_bu21023_i2c_probe()
1171 IRQF_ONESHOT, client->name, ts); in rohm_bu21023_i2c_probe()
1192 dev_err(&client->dev, in rohm_bu21023_i2c_probe()