summaryrefslogtreecommitdiff
path: root/drivers/input/misc/mpl3115.c
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2017-12-04 13:27:00 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitf481a7dad97533144ebf66ee16b63c4cb3cb96c0 (patch)
treee3e3f00161eaaea09da91dd244aaf891f7f4eafe /drivers/input/misc/mpl3115.c
parentd66a30591bddb78b5f7b0cafc2f8549a34f63ebd (diff)
MLK-17061-1 sensor: set sensor interrupt pins as open-drain
The sensors share an interrupt pin on imx8qm/imx8qxp mek. As a result, the interrupt signals will be interfered by each other in default push-pull status. This patch sets sensor interrupt pins as open-drain when necessary. Signed-off-by: Gao Pan <pandy.gao@nxp.com> (cherry-picked from 48bcb7aafa2a3ced923d1a1753bb19d89a9fc273)
Diffstat (limited to 'drivers/input/misc/mpl3115.c')
-rw-r--r--drivers/input/misc/mpl3115.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/misc/mpl3115.c b/drivers/input/misc/mpl3115.c
index b272cf38a645..4bd5420e4e93 100644
--- a/drivers/input/misc/mpl3115.c
+++ b/drivers/input/misc/mpl3115.c
@@ -157,6 +157,13 @@ static const struct attribute_group mpl3115_attr_group = {
static void mpl3115_device_init(struct i2c_client *client)
{
u8 val[8];
+ struct device_node *np = client->dev.of_node;
+
+ /* set interrupt pin as open-drain */
+ if (of_get_property(np, "interrupt-open-drain", NULL)) {
+ val[0] = 0x11;
+ mpl3115_i2c_write(client, MPL3115_CTRL_REG3, val, 1);
+ }
val[0] = 0x28;
mpl3115_i2c_write(client, MPL3115_CTRL_REG1, val, 1);
@@ -204,6 +211,7 @@ static int mpl3115_probe(struct i2c_client *client,
struct input_dev *idev;
struct i2c_adapter *adapter;
struct mpl3115_data *pdata;
+
adapter = to_i2c_adapter(client->dev.parent);
result = i2c_check_functionality(adapter,
I2C_FUNC_SMBUS_BYTE |