Skip to contentSkip to conversation

iio: accel: mxc6255 add support for the mxc6225

PATCH In review Hans de Goede 3 participants 4 messages Sep 4, 2016 – Sep 6, 2016 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: accel: mxc6255 add support for the mxc6225

The mxc6225 is fully compatible with the existing mxc6255 driver, add support for it.

---
 drivers/iio/accel/mxc6255.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/accel/mxc6255.c +8 -1
index 97ccde7..50343a7 100644
@@ -26,6 +26,7 @@
 #define MXC6255_REG_YOUT		0x01
 #define MXC6255_REG_CHIP_ID		0x08
 
+#define MXC6225_CHIP_ID			0xe5
 #define MXC6255_CHIP_ID			0x05
 
 /*
@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (chip_id != MXC6255_CHIP_ID) {
+	switch (chip_id) {
+	case MXC6225_CHIP_ID:
+	case MXC6255_CHIP_ID:
+		break;
+	default:
 		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
 		return -ENODEV;
 	}
@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
 }
 
 static const struct acpi_device_id mxc6255_acpi_match[] = {
+	{"MXC6225",	0},
 	{"MXC6255",	0},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
 
 static const struct i2c_device_id mxc6255_id[] = {
+	{"mxc6225",	0},
 	{"mxc6255",	0},
 	{ }
 };
Signature · 1 line
2.9.3
maintainer
#1 lore raw
Quoted 4 lines · Hans de Goede

The mxc6225 is fully compatible with the existing mxc6255 driver, add support for it.

Ah well. Can't find any docs on this on via google so I'll take your word for it :)

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 45 lines
---
 drivers/iio/accel/mxc6255.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/accel/mxc6255.c +8 -1
index 97ccde7..50343a7 100644
@@ -26,6 +26,7 @@
 #define MXC6255_REG_YOUT		0x01
 #define MXC6255_REG_CHIP_ID		0x08
 
+#define MXC6225_CHIP_ID			0xe5
 #define MXC6255_CHIP_ID			0x05
 
 /*
@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (chip_id != MXC6255_CHIP_ID) {
+	switch (chip_id) {
+	case MXC6225_CHIP_ID:
+	case MXC6255_CHIP_ID:
+		break;
+	default:
 		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
 		return -ENODEV;
 	}
@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
 }
 
 static const struct acpi_device_id mxc6255_acpi_match[] = {
+	{"MXC6225",	0},
 	{"MXC6255",	0},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
 
 static const struct i2c_device_id mxc6255_id[] = {
+	{"mxc6225",	0},
 	{"mxc6255",	0},
 	{ }
 };
#2 lore raw

Hi,

Quoted 7 lines · Jonathan Cameron
Quoted 4 lines · Hans de Goede

The mxc6225 is fully compatible with the existing mxc6255 driver, add support for it.

Ah well. Can't find any docs on this on via google so I'll take your word for it :)

I don't have docs either, but the android driver uses the same registers and in the same way as the existing mxc6255 driver; and I've also confirmed that this works on actual hardware.

Should I put something to this extend in the commit msg next time ?

Regards,

Hans

Quoted 53 lines

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 45 lines
---
 drivers/iio/accel/mxc6255.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/accel/mxc6255.c +8 -1
index 97ccde7..50343a7 100644
@@ -26,6 +26,7 @@
 #define MXC6255_REG_YOUT		0x01
 #define MXC6255_REG_CHIP_ID		0x08
 
+#define MXC6225_CHIP_ID			0xe5
 #define MXC6255_CHIP_ID			0x05
 
 /*
@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (chip_id != MXC6255_CHIP_ID) {
+	switch (chip_id) {
+	case MXC6225_CHIP_ID:
+	case MXC6255_CHIP_ID:
+		break;
+	default:
 		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
 		return -ENODEV;
 	}
@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
 }
 
 static const struct acpi_device_id mxc6255_acpi_match[] = {
+	{"MXC6225",	0},
 	{"MXC6255",	0},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
 
 static const struct i2c_device_id mxc6255_id[] = {
+	{"mxc6225",	0},
 	{"mxc6255",	0},
 	{ }
 };
#3 lore raw
Quoted 11 lines · Hans de Goede

Hi,

Quoted 7 lines · Jonathan Cameron
Quoted 4 lines · Hans de Goede

The mxc6225 is fully compatible with the existing mxc6255 driver, add support for it.

Ah well. Can't find any docs on this on via google so I'll take your word for it :)

Quoted 6 lines

I don't have docs either, but the android driver uses the same registers and in the same way as the existing mxc6255 driver; and I've also confirmed that this works on actual hardware.

Should I put something to this extend in the commit msg next time ?

Info like this is always helpful. So please do.

Quoted 61 lines

Regards,

Hans

Quoted 55 lines

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 47 lines
---
 drivers/iio/accel/mxc6255.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/accel/mxc6255.c +6 -1
index 97ccde7..50343a7 100644
@@ -26,6 +26,7 @@
 #define MXC6255_REG_YOUT		0x01
 #define MXC6255_REG_CHIP_ID		0x08
 
+#define MXC6225_CHIP_ID			0xe5
 #define MXC6255_CHIP_ID			0x05
 
 /*
@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client 
 *client,
 		return ret;
 	}
 
-	if (chip_id != MXC6255_CHIP_ID) {
+	switch (chip_id) {
+	case MXC6225_CHIP_ID:
+	case MXC6255_CHIP_ID:
+		break;
+	default:
 		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
 		return -ENODEV;
drivers/iio/accel/mxc6255.c +2 -0
 	}
@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client 
 *client,
 }
 
 static const struct acpi_device_id mxc6255_acpi_match[] = {
+	{"MXC6225",	0},
 	{"MXC6255",	0},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
 
 static const struct i2c_device_id mxc6255_id[] = {
+	{"mxc6225",	0},
 	{"mxc6255",	0},
 	{ }

};