Lines Matching refs:ts

171 static int bu21013_read_block_data(struct bu21013_ts *ts, u8 *buf)
176 ret = i2c_smbus_read_i2c_block_data(ts->client,
186 static int bu21013_do_touch_report(struct bu21013_ts *ts)
188 struct input_dev *input = ts->in_dev;
196 if (bu21013_read_block_data(ts, buf) < 0)
213 &ts->props, x, y);
238 struct bu21013_ts *ts = device_data;
243 error = bu21013_do_touch_report(ts);
245 dev_err(&ts->client->dev, "%s failed\n", __func__);
249 if (unlikely(ts->touch_stopped))
252 keep_polling = ts->int_gpiod ?
253 gpiod_get_value(ts->int_gpiod) : false;
261 static int bu21013_init_chip(struct bu21013_ts *ts)
263 struct i2c_client *client = ts->client;
395 struct bu21013_ts *ts = _ts;
397 regulator_disable(ts->regulator);
402 struct bu21013_ts *ts = _ts;
404 gpiod_set_value(ts->cs_gpiod, 0);
409 struct bu21013_ts *ts;
427 ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
428 if (!ts)
431 ts->client = client;
433 ts->x_flip = device_property_read_bool(dev, "rohm,flip-x");
434 ts->y_flip = device_property_read_bool(dev, "rohm,flip-y");
441 ts->in_dev = in_dev;
442 input_set_drvdata(in_dev, ts);
454 touchscreen_parse_properties(in_dev, true, &ts->props);
457 if (!ts->props.invert_x &&
464 if (!ts->props.invert_y &&
479 ts->regulator = devm_regulator_get(dev, "avdd");
480 if (IS_ERR(ts->regulator)) {
482 return PTR_ERR(ts->regulator);
485 error = regulator_enable(ts->regulator);
491 error = devm_add_action_or_reset(dev, bu21013_power_off, ts);
498 ts->cs_gpiod = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
499 if (IS_ERR(ts->cs_gpiod))
500 return dev_err_probe(dev, PTR_ERR(ts->cs_gpiod), "failed to get CS GPIO\n");
502 gpiod_set_consumer_name(ts->cs_gpiod, "BU21013 CS");
504 error = devm_add_action_or_reset(dev, bu21013_disable_chip, ts);
511 ts->int_gpiod = devm_gpiod_get_optional(dev, "touch", GPIOD_IN);
512 error = PTR_ERR_OR_ZERO(ts->int_gpiod);
516 if (ts->int_gpiod)
517 gpiod_set_consumer_name(ts->int_gpiod, "BU21013 INT");
520 error = bu21013_init_chip(ts);
527 IRQF_ONESHOT, DRIVER_TP, ts);
539 i2c_set_clientdata(client, ts);
546 struct bu21013_ts *ts = i2c_get_clientdata(client);
549 ts->touch_stopped = true;
556 struct bu21013_ts *ts = i2c_get_clientdata(client);
558 ts->touch_stopped = true;
563 regulator_disable(ts->regulator);
571 struct bu21013_ts *ts = i2c_get_clientdata(client);
575 error = regulator_enable(ts->regulator);
582 error = bu21013_init_chip(ts);
590 ts->touch_stopped = false;