Lines Matching +full:disable +full:- +full:report +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0-or-later
30 da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 0, on); in da9052_ts_adc_toggle()
31 tsi->adc_on = on; in da9052_ts_adc_toggle()
38 if (!tsi->stopped) { in da9052_ts_pendwn_irq()
39 /* Mask PEN_DOWN event and unmask TSI_READY event */ in da9052_ts_pendwn_irq()
40 da9052_disable_irq_nosync(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_pendwn_irq()
41 da9052_enable_irq(tsi->da9052, DA9052_IRQ_TSIREADY); in da9052_ts_pendwn_irq()
45 schedule_delayed_work(&tsi->ts_pen_work, HZ / 50); in da9052_ts_pendwn_irq()
53 struct input_dev *input = tsi->dev; in da9052_ts_read()
58 ret = da9052_reg_read(tsi->da9052, DA9052_TSI_X_MSB_REG); in da9052_ts_read()
64 ret = da9052_reg_read(tsi->da9052, DA9052_TSI_Y_MSB_REG); in da9052_ts_read()
70 ret = da9052_reg_read(tsi->da9052, DA9052_TSI_Z_MSB_REG); in da9052_ts_read()
76 ret = da9052_reg_read(tsi->da9052, DA9052_TSI_LSB_REG); in da9052_ts_read()
106 if (!tsi->stopped) { in da9052_ts_pen_work()
107 int ret = da9052_reg_read(tsi->da9052, DA9052_TSI_LSB_REG); in da9052_ts_pen_work()
110 schedule_delayed_work(&tsi->ts_pen_work, HZ / 50); in da9052_ts_pen_work()
112 struct input_dev *input = tsi->dev; in da9052_ts_pen_work()
117 /* Report Pen UP */ in da9052_ts_pen_work()
126 ret = da9052_reg_update(tsi->da9052, in da9052_ts_pen_work()
131 /* Mask TSI_READY event and unmask PEN_DOWN event */ in da9052_ts_pen_work()
132 da9052_disable_irq(tsi->da9052, DA9052_IRQ_TSIREADY); in da9052_ts_pen_work()
133 da9052_enable_irq(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_pen_work()
161 error = da9052_ts_configure_gpio(tsi->da9052); in da9052_configure_tsi()
166 error = da9052_reg_update(tsi->da9052, DA9052_ADC_CONT_REG, in da9052_configure_tsi()
172 error = da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 0xFC, 0xC0); in da9052_configure_tsi()
177 error = da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x59); in da9052_configure_tsi()
188 tsi->stopped = false; in da9052_ts_input_open()
192 da9052_enable_irq(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_input_open()
195 return da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, in da9052_ts_input_open()
203 tsi->stopped = true; in da9052_ts_input_close()
205 da9052_disable_irq(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_input_close()
206 cancel_delayed_work_sync(&tsi->ts_pen_work); in da9052_ts_input_close()
208 if (tsi->adc_on) { in da9052_ts_input_close()
209 da9052_disable_irq(tsi->da9052, DA9052_IRQ_TSIREADY); in da9052_ts_input_close()
214 * twice and we need to enable it to keep enable/disable in da9052_ts_input_close()
217 da9052_enable_irq(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_input_close()
220 /* Disable Pen Detect Circuit */ in da9052_ts_input_close()
221 da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0); in da9052_ts_input_close()
231 da9052 = dev_get_drvdata(pdev->dev.parent); in da9052_ts_probe()
233 return -EINVAL; in da9052_ts_probe()
238 error = -ENOMEM; in da9052_ts_probe()
242 tsi->da9052 = da9052; in da9052_ts_probe()
243 tsi->dev = input_dev; in da9052_ts_probe()
244 tsi->stopped = true; in da9052_ts_probe()
245 INIT_DELAYED_WORK(&tsi->ts_pen_work, da9052_ts_pen_work); in da9052_ts_probe()
247 input_dev->id.version = 0x0101; in da9052_ts_probe()
248 input_dev->id.vendor = 0x15B6; in da9052_ts_probe()
249 input_dev->id.product = 0x9052; in da9052_ts_probe()
250 input_dev->name = "Dialog DA9052 TouchScreen Driver"; in da9052_ts_probe()
251 input_dev->dev.parent = &pdev->dev; in da9052_ts_probe()
252 input_dev->open = da9052_ts_input_open; in da9052_ts_probe()
253 input_dev->close = da9052_ts_input_close; in da9052_ts_probe()
255 __set_bit(EV_ABS, input_dev->evbit); in da9052_ts_probe()
256 __set_bit(EV_KEY, input_dev->evbit); in da9052_ts_probe()
257 __set_bit(BTN_TOUCH, input_dev->keybit); in da9052_ts_probe()
265 /* Disable Pen Detect Circuit */ in da9052_ts_probe()
266 da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0); in da9052_ts_probe()
268 /* Disable ADC */ in da9052_ts_probe()
271 error = da9052_request_irq(tsi->da9052, DA9052_IRQ_PENDOWN, in da9052_ts_probe()
272 "pendown-irq", da9052_ts_pendwn_irq, tsi); in da9052_ts_probe()
274 dev_err(tsi->da9052->dev, in da9052_ts_probe()
279 error = da9052_request_irq(tsi->da9052, DA9052_IRQ_TSIREADY, in da9052_ts_probe()
280 "tsiready-irq", da9052_ts_datardy_irq, tsi); in da9052_ts_probe()
282 dev_err(tsi->da9052->dev, in da9052_ts_probe()
287 /* Mask PEN_DOWN and TSI_READY events */ in da9052_ts_probe()
288 da9052_disable_irq(tsi->da9052, DA9052_IRQ_PENDOWN); in da9052_ts_probe()
289 da9052_disable_irq(tsi->da9052, DA9052_IRQ_TSIREADY); in da9052_ts_probe()
295 error = input_register_device(tsi->dev); in da9052_ts_probe()
304 da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi); in da9052_ts_probe()
306 da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi); in da9052_ts_probe()
318 da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19); in da9052_ts_remove()
320 da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi); in da9052_ts_remove()
321 da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi); in da9052_ts_remove()
323 input_unregister_device(tsi->dev); in da9052_ts_remove()
331 .name = "da9052-tsi",
340 MODULE_ALIAS("platform:da9052-tsi");