Skip to content

Commit 6a8fac0

Browse files
jlabundyLee Jones
authored andcommitted
mfd: iqs62x: Do not change clock frequency during ATI
After a reset event, the device automatically triggers ATI at the default core clock frequency (16 MHz). Soon afterward, the driver loads firmware which may attempt to lower the frequency. If this initial ATI cycle is still in progress when the frequency is changed, however, the device incorrectly reports channels 0, 1 and 2 to be in a state of touch once ATI finally completes. To solve this problem, wait until ATI is complete before lowering the frequency. Because this particular ATI cycle occurs following a reset event, its duration is predictable and a simple delay can suffice. Signed-off-by: Jeff LaBundy <jeff@labundy.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 02e550d commit 6a8fac0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/mfd/iqs62x.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#define IQS62X_FW_REC_TYPE_MASK 3
8282
#define IQS62X_FW_REC_TYPE_DATA 4
8383

84+
#define IQS62X_ATI_STARTUP_MS 350
8485
#define IQS62X_FILT_SETTLE_MS 250
8586

8687
struct iqs62x_fw_rec {
@@ -111,6 +112,14 @@ static int iqs62x_dev_init(struct iqs62x_core *iqs62x)
111112
int ret;
112113

113114
list_for_each_entry(fw_blk, &iqs62x->fw_blk_head, list) {
115+
/*
116+
* In case ATI is in progress, wait for it to complete before
117+
* lowering the core clock frequency.
118+
*/
119+
if (fw_blk->addr == IQS62X_SYS_SETTINGS &&
120+
*fw_blk->data & IQS62X_SYS_SETTINGS_CLK_DIV)
121+
msleep(IQS62X_ATI_STARTUP_MS);
122+
114123
if (fw_blk->mask)
115124
ret = regmap_update_bits(iqs62x->regmap, fw_blk->addr,
116125
fw_blk->mask, *fw_blk->data);

0 commit comments

Comments
 (0)