summaryrefslogtreecommitdiff
path: root/include/linux/mfd/iqs62x.h
diff options
context:
space:
mode:
authorJeff LaBundy <jeff@labundy.com>2021-01-17 21:57:07 -0600
committerLee Jones <lee.jones@linaro.org>2021-02-08 13:54:36 +0000
commit02e550d5b706f034d24e7e46234eb1982f05a137 (patch)
treeb37411feeec0cd745281782f29516fa909e155b1 /include/linux/mfd/iqs62x.h
parenta3a06ea17437814f47691282d9d6f6bcf62a8a9e (diff)
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>
Diffstat (limited to 'include/linux/mfd/iqs62x.h')
-rw-r--r--include/linux/mfd/iqs62x.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/mfd/iqs62x.h b/include/linux/mfd/iqs62x.h
index 043d3b6de9ec..5ced55eae11b 100644
--- a/include/linux/mfd/iqs62x.h
+++ b/include/linux/mfd/iqs62x.h
@@ -28,7 +28,7 @@
#define IQS620_GLBL_EVENT_MASK_PMU BIT(6)
#define IQS62X_NUM_KEYS 16
-#define IQS62X_NUM_EVENTS (IQS62X_NUM_KEYS + 5)
+#define IQS62X_NUM_EVENTS (IQS62X_NUM_KEYS + 6)
#define IQS62X_EVENT_SIZE 10
@@ -78,6 +78,7 @@ enum iqs62x_event_flag {
/* everything else */
IQS62X_EVENT_SYS_RESET,
+ IQS62X_EVENT_SYS_ATI,
};
struct iqs62x_event_data {
@@ -97,12 +98,10 @@ struct iqs62x_dev_desc {
const char *dev_name;
const struct mfd_cell *sub_devs;
int num_sub_devs;
-
u8 prod_num;
u8 sw_num;
const u8 *cal_regs;
int num_cal_regs;
-
u8 prox_mask;
u8 sar_mask;
u8 hall_mask;
@@ -110,16 +109,12 @@ struct iqs62x_dev_desc {
u8 temp_mask;
u8 als_mask;
u8 ir_mask;
-
u8 prox_settings;
u8 als_flags;
u8 hall_flags;
u8 hyst_shift;
-
u8 interval;
u8 interval_div;
-
- u8 clk_div;
const char *fw_name;
const enum iqs62x_event_reg (*event_regs)[IQS62X_EVENT_SIZE];
};
@@ -130,8 +125,10 @@ struct iqs62x_core {
struct regmap *regmap;
struct blocking_notifier_head nh;
struct list_head fw_blk_head;
+ struct completion ati_done;
struct completion fw_done;
enum iqs62x_ui_sel ui_sel;
+ unsigned long event_cache;
};
extern const struct iqs62x_event_desc iqs62x_events[IQS62X_NUM_EVENTS];