mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
Input: iqs7222 - set all ULP entry masks by default
Some devices expose an ultra-low-power (ULP) mode entry mask for
each channel. If the mask is set, the device cannot enter ULP so
long as the corresponding channel remains in an active state.
The vendor has advised setting the mask for any disabled channel.
To accommodate this suggestion, initially set all masks and then
clear them only if specified in the device tree.
Fixes: e505edaedc
("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220908131548.48120-8-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
514c13b1fa
commit
d56111ed58
1 changed files with 6 additions and 5 deletions
|
@ -1771,11 +1771,9 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, int chan_index)
|
||||||
if (!chan_node)
|
if (!chan_node)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (dev_desc->allow_offset) {
|
if (dev_desc->allow_offset &&
|
||||||
sys_setup[dev_desc->allow_offset] |= BIT(chan_index);
|
fwnode_property_present(chan_node, "azoteq,ulp-allow"))
|
||||||
if (fwnode_property_present(chan_node, "azoteq,ulp-allow"))
|
|
||||||
sys_setup[dev_desc->allow_offset] &= ~BIT(chan_index);
|
sys_setup[dev_desc->allow_offset] &= ~BIT(chan_index);
|
||||||
}
|
|
||||||
|
|
||||||
chan_setup[0] |= IQS7222_CHAN_SETUP_0_CHAN_EN;
|
chan_setup[0] |= IQS7222_CHAN_SETUP_0_CHAN_EN;
|
||||||
|
|
||||||
|
@ -2206,6 +2204,9 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222)
|
||||||
u16 *sys_setup = iqs7222->sys_setup;
|
u16 *sys_setup = iqs7222->sys_setup;
|
||||||
int error, i;
|
int error, i;
|
||||||
|
|
||||||
|
if (dev_desc->allow_offset)
|
||||||
|
sys_setup[dev_desc->allow_offset] = U16_MAX;
|
||||||
|
|
||||||
if (dev_desc->event_offset)
|
if (dev_desc->event_offset)
|
||||||
sys_setup[dev_desc->event_offset] = IQS7222_EVENT_MASK_ATI;
|
sys_setup[dev_desc->event_offset] = IQS7222_EVENT_MASK_ATI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue