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
parent
33349dd8ad
commit
558bc91d93
|
@ -147,6 +147,8 @@ static int fxas2100x_device_init(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
struct device_node *np = client->dev.of_node;
|
||||||
|
|
||||||
struct fxas2100x_data *pdata = i2c_get_clientdata(client);
|
struct fxas2100x_data *pdata = i2c_get_clientdata(client);
|
||||||
if (pdata->chip_id == FXAS21000_CHIP_ID)
|
if (pdata->chip_id == FXAS21000_CHIP_ID)
|
||||||
val = (0x01 << 2); /* fxas21000 dr 200HZ */
|
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);
|
result = i2c_smbus_write_byte_data(client, FXAS2100X_CTRL_REG1, val);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
goto out;
|
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);
|
atomic_set(&pdata->active, STANDBY);
|
||||||
return 0;
|
return 0;
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in New Issue