Lines Matching refs:ts

321 static int rohm_ts_manual_calibration(struct rohm_ts_data *ts)  in rohm_ts_manual_calibration()  argument
323 struct i2c_client *client = ts->client; in rohm_ts_manual_calibration()
530 struct rohm_ts_data *ts = dev_id; in rohm_ts_soft_irq() local
531 struct i2c_client *client = ts->client; in rohm_ts_soft_irq()
532 struct input_dev *input_dev = ts->input; in rohm_ts_soft_irq()
542 int prev_finger_count = ts->finger_count; in rohm_ts_soft_irq()
578 if (++ts->contact_count[0] >= threshold) in rohm_ts_soft_irq()
584 if (++ts->contact_count[1] >= threshold) in rohm_ts_soft_irq()
599 if (++ts->contact_count[2] >= threshold) in rohm_ts_soft_irq()
611 count = ts->contact_count[finger_count]; in rohm_ts_soft_irq()
612 memset(ts->contact_count, 0, sizeof(ts->contact_count)); in rohm_ts_soft_irq()
613 ts->contact_count[finger_count] = count; in rohm_ts_soft_irq()
633 ts->finger_count = finger_count; in rohm_ts_soft_irq()
637 error = rohm_ts_manual_calibration(ts); in rohm_ts_soft_irq()
742 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_show() local
744 return sprintf(buf, "%d\n", !!(ts->setup2 & SWAP_XY)); in swap_xy_show()
751 struct rohm_ts_data *ts = i2c_get_clientdata(client); in swap_xy_store() local
759 error = mutex_lock_interruptible(&ts->input->mutex); in swap_xy_store()
764 ts->setup2 |= SWAP_XY; in swap_xy_store()
766 ts->setup2 &= ~SWAP_XY; in swap_xy_store()
768 if (ts->initialized) in swap_xy_store()
769 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in swap_xy_store()
770 ts->setup2); in swap_xy_store()
772 mutex_unlock(&ts->input->mutex); in swap_xy_store()
781 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_show() local
783 return sprintf(buf, "%d\n", !!(ts->setup2 & INV_X)); in inv_x_show()
790 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_x_store() local
798 error = mutex_lock_interruptible(&ts->input->mutex); in inv_x_store()
803 ts->setup2 |= INV_X; in inv_x_store()
805 ts->setup2 &= ~INV_X; in inv_x_store()
807 if (ts->initialized) in inv_x_store()
808 error = i2c_smbus_write_byte_data(ts->client, COMMON_SETUP2, in inv_x_store()
809 ts->setup2); in inv_x_store()
811 mutex_unlock(&ts->input->mutex); in inv_x_store()
820 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_show() local
822 return sprintf(buf, "%d\n", !!(ts->setup2 & INV_Y)); in inv_y_show()
829 struct rohm_ts_data *ts = i2c_get_clientdata(client); in inv_y_store() local
837 error = mutex_lock_interruptible(&ts->input->mutex); in inv_y_store()
842 ts->setup2 |= INV_Y; in inv_y_store()
844 ts->setup2 &= ~INV_Y; in inv_y_store()
846 if (ts->initialized) in inv_y_store()
848 ts->setup2); in inv_y_store()
850 mutex_unlock(&ts->input->mutex); in inv_y_store()
1079 struct rohm_ts_data *ts = input_get_drvdata(input_dev); in rohm_ts_open() local
1080 struct i2c_client *client = ts->client; in rohm_ts_open()
1083 if (!ts->initialized) { in rohm_ts_open()
1084 error = rohm_ts_device_init(client, ts->setup2); in rohm_ts_open()
1091 ts->initialized = true; in rohm_ts_open()
1099 struct rohm_ts_data *ts = input_get_drvdata(input_dev); in rohm_ts_close() local
1101 rohm_ts_power_off(ts->client); in rohm_ts_close()
1103 ts->initialized = false; in rohm_ts_close()
1117 struct rohm_ts_data *ts; in rohm_bu21023_i2c_probe() local
1136 ts = devm_kzalloc(dev, sizeof(struct rohm_ts_data), GFP_KERNEL); in rohm_bu21023_i2c_probe()
1137 if (!ts) in rohm_bu21023_i2c_probe()
1140 ts->client = client; in rohm_bu21023_i2c_probe()
1141 ts->setup2 = MAF_1SAMPLE; in rohm_bu21023_i2c_probe()
1142 i2c_set_clientdata(client, ts); in rohm_bu21023_i2c_probe()
1153 ts->input = input; in rohm_bu21023_i2c_probe()
1154 input_set_drvdata(input, ts); in rohm_bu21023_i2c_probe()
1171 IRQF_ONESHOT, client->name, ts); in rohm_bu21023_i2c_probe()