Lines Matching refs:ts

313 static int rohm_ts_manual_calibration(struct rohm_ts_data *ts)  in rohm_ts_manual_calibration()  argument
315 struct i2c_client *client = ts->client; in rohm_ts_manual_calibration()
522 struct rohm_ts_data *ts = dev_id; in rohm_ts_soft_irq() local
523 struct i2c_client *client = ts->client; in rohm_ts_soft_irq()
524 struct input_dev *input_dev = ts->input; in rohm_ts_soft_irq()
534 int prev_finger_count = ts->finger_count; in rohm_ts_soft_irq()
570 if (++ts->contact_count[0] >= threshold) in rohm_ts_soft_irq()
576 if (++ts->contact_count[1] >= threshold) in rohm_ts_soft_irq()
591 if (++ts->contact_count[2] >= threshold) in rohm_ts_soft_irq()
603 count = ts->contact_count[finger_count]; in rohm_ts_soft_irq()
604 memset(ts->contact_count, 0, sizeof(ts->contact_count)); in rohm_ts_soft_irq()
605 ts->contact_count[finger_count] = count; in rohm_ts_soft_irq()
625 ts->finger_count = finger_count; in rohm_ts_soft_irq()
629 error = rohm_ts_manual_calibration(ts); in rohm_ts_soft_irq()
734 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_show() local
736 return sprintf(buf, "%d\n", !!(ts->setup2 & SWAP_XY)); in swap_xy_show()
743 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_store() local
751 error = mutex_lock_interruptible(&ts->input->mutex); in swap_xy_store()
756 ts->setup2 |= SWAP_XY; in swap_xy_store()
758 ts->setup2 &= ~SWAP_XY; in swap_xy_store()
760 if (ts->initialized) in swap_xy_store()
761 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in swap_xy_store()
762 ts->setup2); in swap_xy_store()
764 mutex_unlock(&ts->input->mutex); in swap_xy_store()
773 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_show() local
775 return sprintf(buf, "%d\n", !!(ts->setup2 & INV_X)); in inv_x_show()
782 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_store() local
790 error = mutex_lock_interruptible(&ts->input->mutex); in inv_x_store()
795 ts->setup2 |= INV_X; in inv_x_store()
797 ts->setup2 &= ~INV_X; in inv_x_store()
799 if (ts->initialized) in inv_x_store()
800 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in inv_x_store()
801 ts->setup2); in inv_x_store()
803 mutex_unlock(&ts->input->mutex); in inv_x_store()
812 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_show() local
814 return sprintf(buf, "%d\n", !!(ts->setup2 & INV_Y)); in inv_y_show()
821 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_store() local
829 error = mutex_lock_interruptible(&ts->input->mutex); in inv_y_store()
834 ts->setup2 |= INV_Y; in inv_y_store()
836 ts->setup2 &= ~INV_Y; in inv_y_store()
838 if (ts->initialized) in inv_y_store()
840 ts->setup2); in inv_y_store()
842 mutex_unlock(&ts->input->mutex); in inv_y_store()
1071 struct rohm_ts_data *ts = input_get_drvdata(input_dev); in rohm_ts_open() local
1072 struct i2c_client *client = ts->client; in rohm_ts_open()
1075 if (!ts->initialized) { in rohm_ts_open()
1076 error = rohm_ts_device_init(client, ts->setup2); in rohm_ts_open()
1083 ts->initialized = true; in rohm_ts_open()
1091 struct rohm_ts_data *ts = input_get_drvdata(input_dev); in rohm_ts_close() local
1093 rohm_ts_power_off(ts->client); in rohm_ts_close()
1095 ts->initialized = false; in rohm_ts_close()
1101 struct rohm_ts_data *ts; in rohm_bu21023_i2c_probe() local
1120 ts = devm_kzalloc(dev, sizeof(struct rohm_ts_data), GFP_KERNEL); in rohm_bu21023_i2c_probe()
1121 if (!ts) in rohm_bu21023_i2c_probe()
1124 ts->client = client; in rohm_bu21023_i2c_probe()
1125 ts->setup2 = MAF_1SAMPLE; in rohm_bu21023_i2c_probe()
1126 i2c_set_clientdata(client, ts); in rohm_bu21023_i2c_probe()
1137 ts->input = input; in rohm_bu21023_i2c_probe()
1138 input_set_drvdata(input, ts); in rohm_bu21023_i2c_probe()
1155 IRQF_ONESHOT, client->name, ts); in rohm_bu21023_i2c_probe()