mfd: iqs62x: Do not poll during ATI
authorJeff LaBundy <jeff@labundy.com>
Mon, 18 Jan 2021 03:57:07 +0000 (21:57 -0600)
committerLee Jones <lee.jones@linaro.org>
Mon, 8 Feb 2021 13:54:36 +0000 (13:54 +0000)
commit02e550d5b706f034d24e7e46234eb1982f05a137
treeb37411feeec0cd745281782f29516fa909e155b1
parenta3a06ea17437814f47691282d9d6f6bcf62a8a9e
mfd: iqs62x: Do not poll during ATI

After loading firmware, the driver triggers ATI (calibration) with
the newly loaded register configuration in place. Next, the driver
polls a register field to ensure ATI completed in a timely fashion
and that the device is ready to sense.

However, communicating with the device over I2C while ATI is under-
way may induce noise in the device and cause ATI to fail. As such,
the vendor recommends not to poll the device during ATI.

To solve this problem, let the device naturally signal to the host
that ATI is complete by way of an interrupt. A completion prevents
the sub-devices from being registered until this happens.

The former logic that scaled ATI timeout and filter settling delay
is not carried forward with the new implementation, as it produces
overly conservative delays at lower clock rates. Instead, a single
pair of delays that covers all cases is used.

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/iqs62x.c
include/linux/mfd/iqs62x.h