Lines Matching refs:bu21029

165 static void bu21029_touch_report(struct bu21029_ts_data *bu21029, const u8 *buf)  in bu21029_touch_report()  argument
169 s32 max_pressure = input_abs_get_max(bu21029->in_dev, ABS_PRESSURE); in bu21029_touch_report()
196 rz *= bu21029->x_plate_ohms; in bu21029_touch_report()
200 touchscreen_report_pos(bu21029->in_dev, &bu21029->prop, in bu21029_touch_report()
202 input_report_abs(bu21029->in_dev, ABS_PRESSURE, in bu21029_touch_report()
204 input_report_key(bu21029->in_dev, BTN_TOUCH, 1); in bu21029_touch_report()
205 input_sync(bu21029->in_dev); in bu21029_touch_report()
212 struct bu21029_ts_data *bu21029 = from_timer(bu21029, t, timer); in bu21029_touch_release() local
214 input_report_abs(bu21029->in_dev, ABS_PRESSURE, 0); in bu21029_touch_release()
215 input_report_key(bu21029->in_dev, BTN_TOUCH, 0); in bu21029_touch_release()
216 input_sync(bu21029->in_dev); in bu21029_touch_release()
221 struct bu21029_ts_data *bu21029 = data; in bu21029_touch_soft_irq() local
229 error = i2c_smbus_read_i2c_block_data(bu21029->client, BU21029_AUTOSCAN, in bu21029_touch_soft_irq()
234 bu21029_touch_report(bu21029, buf); in bu21029_touch_soft_irq()
237 mod_timer(&bu21029->timer, in bu21029_touch_soft_irq()
244 static void bu21029_put_chip_in_reset(struct bu21029_ts_data *bu21029) in bu21029_put_chip_in_reset() argument
246 if (bu21029->reset_gpios) { in bu21029_put_chip_in_reset()
247 gpiod_set_value_cansleep(bu21029->reset_gpios, 1); in bu21029_put_chip_in_reset()
254 struct bu21029_ts_data *bu21029 = input_get_drvdata(dev); in bu21029_start_chip() local
255 struct i2c_client *i2c = bu21029->client; in bu21029_start_chip()
269 error = regulator_enable(bu21029->vdd); in bu21029_start_chip()
276 if (bu21029->reset_gpios) { in bu21029_start_chip()
277 gpiod_set_value_cansleep(bu21029->reset_gpios, 0); in bu21029_start_chip()
314 enable_irq(bu21029->client->irq); in bu21029_start_chip()
318 bu21029_put_chip_in_reset(bu21029); in bu21029_start_chip()
319 regulator_disable(bu21029->vdd); in bu21029_start_chip()
325 struct bu21029_ts_data *bu21029 = input_get_drvdata(dev); in bu21029_stop_chip() local
327 disable_irq(bu21029->client->irq); in bu21029_stop_chip()
328 del_timer_sync(&bu21029->timer); in bu21029_stop_chip()
330 bu21029_put_chip_in_reset(bu21029); in bu21029_stop_chip()
331 regulator_disable(bu21029->vdd); in bu21029_stop_chip()
337 struct bu21029_ts_data *bu21029; in bu21029_probe() local
350 bu21029 = devm_kzalloc(&client->dev, sizeof(*bu21029), GFP_KERNEL); in bu21029_probe()
351 if (!bu21029) in bu21029_probe()
355 &bu21029->x_plate_ohms); in bu21029_probe()
362 bu21029->vdd = devm_regulator_get(&client->dev, "vdd"); in bu21029_probe()
363 if (IS_ERR(bu21029->vdd)) { in bu21029_probe()
364 error = PTR_ERR(bu21029->vdd); in bu21029_probe()
371 bu21029->reset_gpios = devm_gpiod_get_optional(&client->dev, in bu21029_probe()
373 if (IS_ERR(bu21029->reset_gpios)) { in bu21029_probe()
374 error = PTR_ERR(bu21029->reset_gpios); in bu21029_probe()
387 bu21029->client = client; in bu21029_probe()
388 bu21029->in_dev = in_dev; in bu21029_probe()
389 timer_setup(&bu21029->timer, bu21029_touch_release, 0); in bu21029_probe()
400 touchscreen_parse_properties(in_dev, false, &bu21029->prop); in bu21029_probe()
402 input_set_drvdata(in_dev, bu21029); in bu21029_probe()
407 DRIVER_NAME, bu21029); in bu21029_probe()
421 i2c_set_clientdata(client, bu21029); in bu21029_probe()
429 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); in bu21029_suspend() local
432 mutex_lock(&bu21029->in_dev->mutex); in bu21029_suspend()
433 if (input_device_enabled(bu21029->in_dev)) in bu21029_suspend()
434 bu21029_stop_chip(bu21029->in_dev); in bu21029_suspend()
435 mutex_unlock(&bu21029->in_dev->mutex); in bu21029_suspend()
444 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); in bu21029_resume() local
447 mutex_lock(&bu21029->in_dev->mutex); in bu21029_resume()
448 if (input_device_enabled(bu21029->in_dev)) in bu21029_resume()
449 bu21029_start_chip(bu21029->in_dev); in bu21029_resume()
450 mutex_unlock(&bu21029->in_dev->mutex); in bu21029_resume()