Skip to content

Commit

Permalink
Input: bma150 - extend chip detection for bma180
Browse files Browse the repository at this point in the history
This driver has been used while on the OpenPhoenux GTA04 with a BMA180.

Signed-off-by: H. Nikolaus Schaller <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
goldelico authored and dtor committed Apr 25, 2014
1 parent 3d725ca commit ef3714f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/misc/bma150.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#define BMA150_CFG_5_REG 0x11

#define BMA150_CHIP_ID 2
#define BMA180_CHIP_ID 3
#define BMA150_CHIP_ID_REG BMA150_DATA_0_REG

#define BMA150_ACC_X_LSB_REG BMA150_DATA_2_REG
Expand Down Expand Up @@ -539,7 +540,7 @@ static int bma150_probe(struct i2c_client *client,
}

chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG);
if (chip_id != BMA150_CHIP_ID) {
if (chip_id != BMA150_CHIP_ID && chip_id != BMA180_CHIP_ID) {
dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id);
return -EINVAL;
}
Expand Down Expand Up @@ -643,6 +644,7 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);

static const struct i2c_device_id bma150_id[] = {
{ "bma150", 0 },
{ "bma180", 0 },
{ "smb380", 0 },
{ "bma023", 0 },
{ }
Expand Down

0 comments on commit ef3714f

Please sign in to comment.