Lines Matching defs:bu21029

153 #define DRIVER_NAME		"bu21029"
165 static void bu21029_touch_report(struct bu21029_ts_data *bu21029, const u8 *buf)
169 s32 max_pressure = input_abs_get_max(bu21029->in_dev, ABS_PRESSURE);
196 rz *= bu21029->x_plate_ohms;
200 touchscreen_report_pos(bu21029->in_dev, &bu21029->prop,
202 input_report_abs(bu21029->in_dev, ABS_PRESSURE,
204 input_report_key(bu21029->in_dev, BTN_TOUCH, 1);
205 input_sync(bu21029->in_dev);
212 struct bu21029_ts_data *bu21029 = from_timer(bu21029, t, timer);
214 input_report_abs(bu21029->in_dev, ABS_PRESSURE, 0);
215 input_report_key(bu21029->in_dev, BTN_TOUCH, 0);
216 input_sync(bu21029->in_dev);
221 struct bu21029_ts_data *bu21029 = data;
229 error = i2c_smbus_read_i2c_block_data(bu21029->client, BU21029_AUTOSCAN,
234 bu21029_touch_report(bu21029, buf);
237 mod_timer(&bu21029->timer,
244 static void bu21029_put_chip_in_reset(struct bu21029_ts_data *bu21029)
246 if (bu21029->reset_gpios) {
247 gpiod_set_value_cansleep(bu21029->reset_gpios, 1);
254 struct bu21029_ts_data *bu21029 = input_get_drvdata(dev);
255 struct i2c_client *i2c = bu21029->client;
269 error = regulator_enable(bu21029->vdd);
276 if (bu21029->reset_gpios) {
277 gpiod_set_value_cansleep(bu21029->reset_gpios, 0);
314 enable_irq(bu21029->client->irq);
318 bu21029_put_chip_in_reset(bu21029);
319 regulator_disable(bu21029->vdd);
325 struct bu21029_ts_data *bu21029 = input_get_drvdata(dev);
327 disable_irq(bu21029->client->irq);
328 del_timer_sync(&bu21029->timer);
330 bu21029_put_chip_in_reset(bu21029);
331 regulator_disable(bu21029->vdd);
337 struct bu21029_ts_data *bu21029;
349 bu21029 = devm_kzalloc(dev, sizeof(*bu21029), GFP_KERNEL);
350 if (!bu21029)
353 error = device_property_read_u32(dev, "rohm,x-plate-ohms", &bu21029->x_plate_ohms);
359 bu21029->vdd = devm_regulator_get(dev, "vdd");
360 if (IS_ERR(bu21029->vdd))
361 return dev_err_probe(dev, PTR_ERR(bu21029->vdd),
364 bu21029->reset_gpios = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
365 if (IS_ERR(bu21029->reset_gpios))
366 return dev_err_probe(dev, PTR_ERR(bu21029->reset_gpios),
375 bu21029->client = client;
376 bu21029->in_dev = in_dev;
377 timer_setup(&bu21029->timer, bu21029_touch_release, 0);
388 touchscreen_parse_properties(in_dev, false, &bu21029->prop);
390 input_set_drvdata(in_dev, bu21029);
395 DRIVER_NAME, bu21029);
407 i2c_set_clientdata(client, bu21029);
415 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
418 mutex_lock(&bu21029->in_dev->mutex);
419 if (input_device_enabled(bu21029->in_dev))
420 bu21029_stop_chip(bu21029->in_dev);
421 mutex_unlock(&bu21029->in_dev->mutex);
430 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
433 mutex_lock(&bu21029->in_dev->mutex);
434 if (input_device_enabled(bu21029->in_dev))
435 bu21029_start_chip(bu21029->in_dev);
436 mutex_unlock(&bu21029->in_dev->mutex);
451 { .compatible = "rohm,bu21029" },