diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2014-10-10 23:33:26 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-11-16 15:19:20 -0500 |
commit | 5af6b30788d4f745e62e5cb53850f80222571d3a (patch) | |
tree | c6888ba7332d5bdcb37715f7bc6652de74fd806f | |
parent | 10bef28973071266e85fe7ea50e08ce8f46dc1ca (diff) |
iio: gyro: bmg160: Don't let interrupt mode to be open drain
Change the mode to push/pull type instead of open drain as some
platforms fails to drive the GPIO pin with open drain.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/gyro/bmg160.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c index 22bf9db538b3..fa2e3766d4a7 100644 --- a/drivers/iio/gyro/bmg160.c +++ b/drivers/iio/gyro/bmg160.c | |||
@@ -67,6 +67,9 @@ | |||
67 | #define BMG160_REG_INT_EN_0 0x15 | 67 | #define BMG160_REG_INT_EN_0 0x15 |
68 | #define BMG160_DATA_ENABLE_INT BIT(7) | 68 | #define BMG160_DATA_ENABLE_INT BIT(7) |
69 | 69 | ||
70 | #define BMG160_REG_INT_EN_1 0x16 | ||
71 | #define BMG160_INT1_BIT_OD BIT(1) | ||
72 | |||
70 | #define BMG160_REG_XOUT_L 0x02 | 73 | #define BMG160_REG_XOUT_L 0x02 |
71 | #define BMG160_AXIS_TO_REG(axis) (BMG160_REG_XOUT_L + (axis * 2)) | 74 | #define BMG160_AXIS_TO_REG(axis) (BMG160_REG_XOUT_L + (axis * 2)) |
72 | 75 | ||
@@ -222,6 +225,19 @@ static int bmg160_chip_init(struct bmg160_data *data) | |||
222 | data->slope_thres = ret; | 225 | data->slope_thres = ret; |
223 | 226 | ||
224 | /* Set default interrupt mode */ | 227 | /* Set default interrupt mode */ |
228 | ret = i2c_smbus_read_byte_data(data->client, BMG160_REG_INT_EN_1); | ||
229 | if (ret < 0) { | ||
230 | dev_err(&data->client->dev, "Error reading reg_int_en_1\n"); | ||
231 | return ret; | ||
232 | } | ||
233 | ret &= ~BMG160_INT1_BIT_OD; | ||
234 | ret = i2c_smbus_write_byte_data(data->client, | ||
235 | BMG160_REG_INT_EN_1, ret); | ||
236 | if (ret < 0) { | ||
237 | dev_err(&data->client->dev, "Error writing reg_int_en_1\n"); | ||
238 | return ret; | ||
239 | } | ||
240 | |||
225 | ret = i2c_smbus_write_byte_data(data->client, | 241 | ret = i2c_smbus_write_byte_data(data->client, |
226 | BMG160_REG_INT_RST_LATCH, | 242 | BMG160_REG_INT_RST_LATCH, |
227 | BMG160_INT_MODE_LATCH_INT | | 243 | BMG160_INT_MODE_LATCH_INT | |