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 2ff7fc5130
commit 33349dd8ad
1 changed files with 8 additions and 0 deletions

View File

@ -283,8 +283,16 @@ static int fxos8700_set_odr(struct i2c_client *client, int type, int delay)
static int fxos8700_device_init(struct i2c_client *client)
{
int result;
struct device_node *np = client->dev.of_node;
struct fxos8700_data *pdata = i2c_get_clientdata(client);
/* set interrupt pin as open-drain */
if (of_get_property(np, "interrupt-open-drain", NULL)) {
result = i2c_smbus_write_byte_data(client, FXOS8700_CTRL_REG3, 0x01);
if (result < 0)
goto out;
}
/* standby mode */
result = i2c_smbus_write_byte_data(client, FXOS8700_CTRL_REG1, 0x00);
if (result < 0)