1
0
Fork 0

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)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
5.4-rM2-2.2.x-imx-squashed
Gao Pan 2017-12-04 13:27:00 +08:00 committed by Dong Aisheng
parent 33349dd8ad
commit 558bc91d93
1 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,8 @@ static int fxas2100x_device_init(struct i2c_client *client)
{
int result;
u8 val;
struct device_node *np = client->dev.of_node;
struct fxas2100x_data *pdata = i2c_get_clientdata(client);
if (pdata->chip_id == FXAS21000_CHIP_ID)
val = (0x01 << 2); /* fxas21000 dr 200HZ */
@ -155,6 +157,14 @@ static int fxas2100x_device_init(struct i2c_client *client)
result = i2c_smbus_write_byte_data(client, FXAS2100X_CTRL_REG1, val);
if (result < 0)
goto out;
/* set interrupt pin as open-drain */
if (of_get_property(np, "interrupt-open-drain", NULL)) {
result = i2c_smbus_write_byte_data(client, FXAS2100X_CTRL_REG2, 0x01);
if (result < 0)
goto out;
}
atomic_set(&pdata->active, STANDBY);
return 0;
out: