Skip to content
Snippets Groups Projects
Commit b5006e3e authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

driver:wm9705: Check and re-set dig2 config register

Due to an unknown reason, the dig2 config register resets randomly. This
disables the generation of pen-down interrupts. Without the interrupt, doesn't
sample further touches.
As a first workaround, we check the dig2 config register before exiting the
sample function and re-set the config value, if it was reset.

BCS 746-001452
BCS 746-001447
parent 9553e8e3
No related branches found
No related tags found
2 merge requests!455CI: Update gitlab-ci,!364driver:wm9705: Check and re-set dig2 config register
Pipeline #79678 passed with stage
in 10 seconds
...@@ -232,6 +232,7 @@ static int wm9705_poll_sample(struct wm97xx *wm, int adcsel, int *sample) ...@@ -232,6 +232,7 @@ static int wm9705_poll_sample(struct wm97xx *wm, int adcsel, int *sample)
int valid_samples = 0; int valid_samples = 0;
int flags = 0; int flags = 0;
int ret; int ret;
u16 dig2 = 0;
if (wants_pen && !wm->pen_probably_down) { if (wants_pen && !wm->pen_probably_down) {
u16 data = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); u16 data = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD);
...@@ -276,6 +277,10 @@ static int wm9705_poll_sample(struct wm97xx *wm, int adcsel, int *sample) ...@@ -276,6 +277,10 @@ static int wm9705_poll_sample(struct wm97xx *wm, int adcsel, int *sample)
wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER1, 0); wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER1, 0);
dig2 = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER2);
if (dig2 == 0)
wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER2, wm->dig[2]);
flags = *sample & 0xF000; flags = *sample & 0xF000;
dev_dbg(wm->dev, "u(%u): %04u %04u %04u %04u %04u %04u %04u %04u %04u %04u => %04u", adcsel, dev_dbg(wm->dev, "u(%u): %04u %04u %04u %04u %04u %04u %04u %04u %04u %04u => %04u", adcsel,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment