Skip to contentSkip to conversation

iio: accel: add the new entry in driver for FXLS8967AF

PATCH Superseded Han Xu 4 participants 7 messages Dec 7, 2022 – Dec 12, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Han Xu

author
#0 lore raw

PATCH 1/2 iio: accel: add the new entry in driver for FXLS8967AF

Add this new device entry in the driver id table.

---
 drivers/iio/accel/fxls8962af-core.c | 7 +++++++
 drivers/iio/accel/fxls8962af-i2c.c  | 2 ++
 drivers/iio/accel/fxls8962af.h      | 1 +
 3 files changed, 10 insertions(+)
drivers/iio/accel/fxls8962af-core.c +7 -0
index 17a6f4f4e06c..ddeb1b153499 100644
@@ -127,6 +127,7 @@
 #define FXLS8962AF_DEVICE_ID			0x62
 #define FXLS8964AF_DEVICE_ID			0x84
 #define FXLS8974CF_DEVICE_ID			0x86
+#define FXLS8967AF_DEVICE_ID			0x87
 
 /* Raw temp channel offset */
 #define FXLS8962AF_TEMP_CENTER_VAL		25
@@ -772,6 +773,12 @@ static const struct fxls8962af_chip_info fxls_chip_info_table[] = {
 		.channels = fxls8962af_channels,
 		.num_channels = ARRAY_SIZE(fxls8962af_channels),
 	},
+	[fxls8967af] = {
+		.chip_id = FXLS8967AF_DEVICE_ID,
+		.name = "fxls8967af",
+		.channels = fxls8962af_channels,
+		.num_channels = ARRAY_SIZE(fxls8962af_channels),
+	},
 };
 
 static const struct iio_info fxls8962af_info = {
drivers/iio/accel/fxls8962af-i2c.c +2 -0
index 4a755a39d702..fd21f524e04f 100644
@@ -31,6 +31,7 @@ static const struct i2c_device_id fxls8962af_id[] = {
 	{ "fxls8962af", fxls8962af },
 	{ "fxls8964af", fxls8964af },
 	{ "fxls8974cf", fxls8974cf },
+	{ "fxls8967af", fxls8967af },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, fxls8962af_id);
@@ -39,6 +40,7 @@ static const struct of_device_id fxls8962af_of_match[] = {
 	{ .compatible = "nxp,fxls8962af" },
 	{ .compatible = "nxp,fxls8964af" },
 	{ .compatible = "nxp,fxls8974cf" },
+	{ .compatible = "nxp,fxls8967af" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, fxls8962af_of_match);
drivers/iio/accel/fxls8962af.h +1 -0
index 45c7e57412e0..7de924d15694 100644
@@ -12,6 +12,7 @@ enum {
 	fxls8962af,
 	fxls8964af,
 	fxls8974cf,
+	fxls8967af,
 };
 
 int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq);
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 dt-bindings: iio: accel: fxls8962af: add new compatible string

add new compatible string for the NXP FXLS8967AF accelerometer sensor.

---
 Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml +2 -0
index 65ce8ea14b52..400eff3ff315 100644
@@ -14,12 +14,14 @@ description: |
   SPI and I2C interface.
     https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
     https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
+    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
 
 properties:
   compatible:
     enum:
       - nxp,fxls8962af
       - nxp,fxls8964af
+      - nxp,fxls8967af
 
   reg:
     maxItems: 1
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] dt-bindings: iio: accel: fxls8962af: add new compatible string

In reply to Han Xu

Quoting Han Xu <[email protected]>:

Quoted 3 lines

add new compatible string for the NXP FXLS8967AF accelerometer sensor.

Quoted 25 lines
---
 Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml +2 -1
index 65ce8ea14b52..400eff3ff315 100644
@@ -14,12 +14,14 @@ description: |
   SPI and I2C interface.
     https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
     https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
+    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
 
 properties:
   compatible:
     enum:
       - nxp,fxls8962af
       - nxp,fxls8964af
+      - nxp,fxls8967af
 
   reg:
     maxItems: 1
--

2.25.1

Reviewed-by on v1 1/2
#4 lore raw
In reply to Han Xu

Quoting Han Xu <[email protected]>:

Quoted 3 lines

Add this new device entry in the driver id table.

Quoted 67 lines
---
 drivers/iio/accel/fxls8962af-core.c | 7 +++++++
 drivers/iio/accel/fxls8962af-i2c.c  | 2 ++
 drivers/iio/accel/fxls8962af.h      | 1 +
 3 files changed, 10 insertions(+)
drivers/iio/accel/fxls8962af-core.c +7 -0
index 17a6f4f4e06c..ddeb1b153499 100644
@@ -127,6 +127,7 @@
 #define FXLS8962AF_DEVICE_ID			0x62
 #define FXLS8964AF_DEVICE_ID			0x84
 #define FXLS8974CF_DEVICE_ID			0x86
+#define FXLS8967AF_DEVICE_ID			0x87
 
 /* Raw temp channel offset */
 #define FXLS8962AF_TEMP_CENTER_VAL		25
@@ -772,6 +773,12 @@ static const struct fxls8962af_chip_info  
 fxls_chip_info_table[] = {
 		.channels = fxls8962af_channels,
 		.num_channels = ARRAY_SIZE(fxls8962af_channels),
 	},
+	[fxls8967af] = {
+		.chip_id = FXLS8967AF_DEVICE_ID,
+		.name = "fxls8967af",
+		.channels = fxls8962af_channels,
+		.num_channels = ARRAY_SIZE(fxls8962af_channels),
+	},
 };
 

static const struct iio_info fxls8962af_info = {

drivers/iio/accel/fxls8962af-i2c.c +2 -0
index 4a755a39d702..fd21f524e04f 100644
@@ -31,6 +31,7 @@ static const struct i2c_device_id fxls8962af_id[] = {
 	{ "fxls8962af", fxls8962af },
 	{ "fxls8964af", fxls8964af },
 	{ "fxls8974cf", fxls8974cf },
+	{ "fxls8967af", fxls8967af },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, fxls8962af_id);
@@ -39,6 +40,7 @@ static const struct of_device_id fxls8962af_of_match[] = {
 	{ .compatible = "nxp,fxls8962af" },
 	{ .compatible = "nxp,fxls8964af" },
 	{ .compatible = "nxp,fxls8974cf" },
+	{ .compatible = "nxp,fxls8967af" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, fxls8962af_of_match);
drivers/iio/accel/fxls8962af.h +1 -0
index 45c7e57412e0..7de924d15694 100644
@@ -12,6 +12,7 @@ enum {
 	fxls8962af,
 	fxls8964af,
 	fxls8974cf,
+	fxls8967af,
 };
 
 int fxls8962af_core_probe(struct device *dev, struct regmap  

*regmap, int irq);
--
2.25.1

maintainer
#5 lore raw
In reply to Han Xu
Quoted 3 lines · On Wed, 7 Dec 2022 10:20:44 -0600 Han Xu <[email protected]> wrote:

Add this new device entry in the driver id table.

Hi Han,

I went to apply this and discovered the FXLs8974CF_DEVICE_ID etc isn't yet present in the upstream driver. Have a I missed a patch set somewhere?

One comment inline.

Quoted 11 lines
---
 drivers/iio/accel/fxls8962af-core.c | 7 +++++++
 drivers/iio/accel/fxls8962af-i2c.c  | 2 ++
 drivers/iio/accel/fxls8962af.h      | 1 +
 3 files changed, 10 insertions(+)
drivers/iio/accel/fxls8962af-core.c +0 -0
index 17a6f4f4e06c..ddeb1b153499 100644

drivers/iio/accel/fxls8962af-core.c line 130

Quoted 4 lines
drivers/iio/accel/fxls8962af-core.c +1 -0
@@ -127,6 +127,7 @@
 #define FXLS8962AF_DEVICE_ID			0x62
 #define FXLS8964AF_DEVICE_ID			0x84
 #define FXLS8974CF_DEVICE_ID			0x86
+#define FXLS8967AF_DEVICE_ID			0x87

Fine with these being in numeric value order...

drivers/iio/accel/fxls8962af-core.c static const struct fxls8962af_chip_info fxls_chip_info_table[] = { · line 776

Quoted 8 lines
drivers/iio/accel/fxls8962af-core.c +1 -0
 /* Raw temp channel offset */
 #define FXLS8962AF_TEMP_CENTER_VAL		25
@@ -772,6 +773,12 @@ static const struct fxls8962af_chip_info fxls_chip_info_table[] = {
 		.channels = fxls8962af_channels,
 		.num_channels = ARRAY_SIZE(fxls8962af_channels),
 	},
+	[fxls8967af] = {

I'd rather everything else was in 'alphabetical order as anyone looking down the lists will expect that ordering rather than one based on IDs that they probably won't have reason to know.

Quoted 40 lines
drivers/iio/accel/fxls8962af-core.c +5 -0
+		.chip_id = FXLS8967AF_DEVICE_ID,
+		.name = "fxls8967af",
+		.channels = fxls8962af_channels,
+		.num_channels = ARRAY_SIZE(fxls8962af_channels),
+	},
 };
 
 static const struct iio_info fxls8962af_info = {
drivers/iio/accel/fxls8962af-i2c.c +2 -0
index 4a755a39d702..fd21f524e04f 100644
@@ -31,6 +31,7 @@ static const struct i2c_device_id fxls8962af_id[] = {
 	{ "fxls8962af", fxls8962af },
 	{ "fxls8964af", fxls8964af },
 	{ "fxls8974cf", fxls8974cf },
+	{ "fxls8967af", fxls8967af },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, fxls8962af_id);
@@ -39,6 +40,7 @@ static const struct of_device_id fxls8962af_of_match[] = {
 	{ .compatible = "nxp,fxls8962af" },
 	{ .compatible = "nxp,fxls8964af" },
 	{ .compatible = "nxp,fxls8974cf" },
+	{ .compatible = "nxp,fxls8967af" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, fxls8962af_of_match);
drivers/iio/accel/fxls8962af.h +1 -0
index 45c7e57412e0..7de924d15694 100644
@@ -12,6 +12,7 @@ enum {
 	fxls8962af,
 	fxls8964af,
 	fxls8974cf,
+	fxls8967af,
 };
 
 int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq);
author
#6 lore raw
Quoted 5 lines · Jonathan Cameron
Quoted 2 lines · On Wed, 7 Dec 2022 10:20:44 -0600 Han Xu <[email protected]> wrote:

Add this new device entry in the driver id table.

Quoted 9 lines
Quoted 1 line

Hi Han,

I went to apply this and discovered the FXLs8974CF_DEVICE_ID etc isn't yet present in the upstream driver. Have a I missed a patch set somewhere?

One comment inline.

There is another local patch not upstreamed, just sent them out as a patch set.

Quoted 18 lines
Quoted 12 lines
---
 drivers/iio/accel/fxls8962af-core.c | 7 +++++++
 drivers/iio/accel/fxls8962af-i2c.c  | 2 ++
 drivers/iio/accel/fxls8962af.h      | 1 +
 3 files changed, 10 insertions(+)
drivers/iio/accel/fxls8962af-core.c +0 -0
index 17a6f4f4e06c..ddeb1b153499 100644

drivers/iio/accel/fxls8962af-core.c line 130

Quoted 4 lines
drivers/iio/accel/fxls8962af-core.c +1 -0
@@ -127,6 +127,7 @@
 #define FXLS8962AF_DEVICE_ID			0x62
 #define FXLS8964AF_DEVICE_ID			0x84
 #define FXLS8974CF_DEVICE_ID			0x86
+#define FXLS8967AF_DEVICE_ID			0x87

Fine with these being in numeric value order...

Quoted 1 line
Quoted 11 lines

drivers/iio/accel/fxls8962af-core.c static const struct fxls8962af_chip_info fxls_chip_info_table[] = { · line 776

Quoted 7 lines

/* Raw temp channel offset */
#define FXLS8962AF_TEMP_CENTER_VAL 25

drivers/iio/accel/fxls8962af-core.c +1 -0
@@ -772,6 +773,12 @@ static const struct fxls8962af_chip_info fxls_chip_info_table[] = {
 		.channels = fxls8962af_channels,
 		.num_channels = ARRAY_SIZE(fxls8962af_channels),
 	},
+	[fxls8967af] = {

I'd rather everything else was in 'alphabetical order as anyone looking down the lists will expect that ordering rather than one based on IDs that they probably won't have reason to know.

fixed in v2.

Quoted 42 lines
Quoted 41 lines
drivers/iio/accel/fxls8962af-core.c +5 -0
+		.chip_id = FXLS8967AF_DEVICE_ID,
+		.name = "fxls8967af",
+		.channels = fxls8962af_channels,
+		.num_channels = ARRAY_SIZE(fxls8962af_channels),
+	},
 };
 
 static const struct iio_info fxls8962af_info = {
drivers/iio/accel/fxls8962af-i2c.c +2 -0
index 4a755a39d702..fd21f524e04f 100644
@@ -31,6 +31,7 @@ static const struct i2c_device_id fxls8962af_id[] = {
 	{ "fxls8962af", fxls8962af },
 	{ "fxls8964af", fxls8964af },
 	{ "fxls8974cf", fxls8974cf },
+	{ "fxls8967af", fxls8967af },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, fxls8962af_id);
@@ -39,6 +40,7 @@ static const struct of_device_id fxls8962af_of_match[] = {
 	{ .compatible = "nxp,fxls8962af" },
 	{ .compatible = "nxp,fxls8964af" },
 	{ .compatible = "nxp,fxls8974cf" },
+	{ .compatible = "nxp,fxls8967af" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, fxls8962af_of_match);
drivers/iio/accel/fxls8962af.h +1 -0
index 45c7e57412e0..7de924d15694 100644
@@ -12,6 +12,7 @@ enum {
 	fxls8962af,
 	fxls8964af,
 	fxls8974cf,
+	fxls8967af,
 };
 
 int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq);