Skip to contentSkip to conversation

leds: pca955x: Add IBM software implemenation of the PCA9552 chip

PATCH In review Eddie James 4 participants 8 messages Aug 3, 2020 – Aug 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover leds: pca955x: Add IBM software implemenation of the PCA9552 chip

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. The I2C device addresses are different from the hardware PCA9552, so add a new compatible string and associated platform data to be able to probe this device, and document the new string.

Changes since v1:
- Switch the vendor part of the compatible string to ibm
- Change the enum in the driver to be ibm_<part no>

Eddie James (2):
dt-bindings: leds: pca955x: Add IBM implementation compatible string
leds: pca955x: Add an IBM software implementation of the PCA9552 chip

 Documentation/devicetree/bindings/leds/leds-pca955x.txt | 1 +
 drivers/leds/leds-pca955x.c                             | 8 ++++++++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.24.0
#1 lore raw

PATCH v2 1/2 dt-bindings: leds: pca955x: Add IBM implementation compatible string

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. Document the new compatible string for this device.

---
 Documentation/devicetree/bindings/leds/leds-pca955x.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/leds-pca955x.txt +1 -0
index 7a5830f8d5ab..817f460f3a72 100644
@@ -9,6 +9,7 @@ Required properties:
 	"nxp,pca9550"
 	"nxp,pca9551"
 	"nxp,pca9552"
+	"ibm,pca9552"
 	"nxp,pca9553"
 - #address-cells: must be 1
 - #size-cells: must be 0
Signature · 1 line
2.24.0
maintainer Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: leds: pca955x: Add IBM implementation compatible string

Quoted 8 lines · Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. Document the new compatible string for this device.

---
 Documentation/devicetree/bindings/leds/leds-pca955x.txt | 1 +
 1 file changed, 1 insertion(+)
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: leds: pca955x: Add IBM implementation compatible string

Quoted 10 lines · Rob Herring
Quoted 7 lines · Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. Document the new compatible string for this device.

---
 Documentation/devicetree/bindings/leds/leds-pca955x.txt | 1 +
 1 file changed, 1 insertion(+)

Thanks, I applied the series.

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

PATCH v2 2/2 leds: pca955x: Add an IBM software implementation of the PCA9552 chip

In reply to Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. The I2C device addresses are different from the hardware PCA9552, so add a new compatible string and associated platform data to be able to probe this device.

---
 drivers/leds/leds-pca955x.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/leds/leds-pca955x.c +8 -0
index 131f8e922ade..7087ca4592fc 100644
@@ -65,6 +65,7 @@ enum pca955x_type {
 	pca9550,
 	pca9551,
 	pca9552,
+	ibm_pca9552,
 	pca9553,
 };
 
@@ -90,6 +91,11 @@ static struct pca955x_chipdef pca955x_chipdefs[] = {
 		.slv_addr	= /* 1100xxx */ 0x60,
 		.slv_addr_shift	= 3,
 	},
+	[ibm_pca9552] = {
+		.bits		= 16,
+		.slv_addr	= /* 0110xxx */ 0x30,
+		.slv_addr_shift	= 3,
+	},
 	[pca9553] = {
 		.bits		= 4,
 		.slv_addr	= /* 110001x */ 0x62,
@@ -101,6 +107,7 @@ static const struct i2c_device_id pca955x_id[] = {
 	{ "pca9550", pca9550 },
 	{ "pca9551", pca9551 },
 	{ "pca9552", pca9552 },
+	{ "ibm-pca9552", ibm_pca9552 },
 	{ "pca9553", pca9553 },
 	{ }
 };
@@ -412,6 +419,7 @@ static const struct of_device_id of_pca955x_match[] = {
 	{ .compatible = "nxp,pca9550", .data = (void *)pca9550 },
 	{ .compatible = "nxp,pca9551", .data = (void *)pca9551 },
 	{ .compatible = "nxp,pca9552", .data = (void *)pca9552 },
+	{ .compatible = "ibm,pca9552", .data = (void *)ibm_pca9552 },
 	{ .compatible = "nxp,pca9553", .data = (void *)pca9553 },
 	{},
 };
Signature · 1 line
2.24.0
#5 lore raw

Re: [PATCH v2 2/2] leds: pca955x: Add an IBM software implementation of the PCA9552 chip

Quoted 5 lines · Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. The I2C device addresses are different from the hardware PCA9552, so add a new compatible string and associated platform data to be able to probe this device.

...

Quoted 5 lines
        pca9550,
        pca9551,
        pca9552,
+       ibm_pca9552,
        pca9553,

I would rather not mix like this, but use alpha order, for example. It's better to read and see which devices are supported by vendor.

...

drivers/leds/leds-pca955x.c static struct pca955x_chipdef pca955x_chipdefs[] = { · line 99

Quoted 6 lines
        },
drivers/leds/leds-pca955x.c +2 -0
+       [ibm_pca9552] = {
 
+       },
        [pca9553] = {

Ditto.

...

Quoted 5 lines
        { "pca9550", pca9550 },
        { "pca9551", pca9551 },
        { "pca9552", pca9552 },
+       { "ibm-pca9552", ibm_pca9552 },
        { "pca9553", pca9553 },

Ditto.

...

Quoted 5 lines
        { .compatible = "nxp,pca9550", .data = (void *)pca9550 },
        { .compatible = "nxp,pca9551", .data = (void *)pca9551 },
        { .compatible = "nxp,pca9552", .data = (void *)pca9552 },
+       { .compatible = "ibm,pca9552", .data = (void *)ibm_pca9552 },
        { .compatible = "nxp,pca9553", .data = (void *)pca9553 },

Ditto.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Re: [PATCH v2 2/2] leds: pca955x: Add an IBM software implementation of the PCA9552 chip

Quoted 9 lines · Andy Shevchenko
Quoted 5 lines · Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. The I2C device addresses are different from the hardware PCA9552, so add a new compatible string and associated platform data to be able to probe this device.

...

Quoted 8 lines
Quoted 5 lines
        pca9550,
        pca9551,
        pca9552,
+       ibm_pca9552,
        pca9553,

I would rather not mix like this, but use alpha order, for example. It's better to read and see which devices are supported by vendor.

Actually I see no huge reason to change that. pca9552 and ibm_pca9552 should be very similar, so it makes sense to keep them close together.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Acked-by on v2 2/2
#7 lore raw

Re: [PATCH v2 2/2] leds: pca955x: Add an IBM software implementation of the PCA9552 chip

In reply to Eddie James
Quoted 7 lines · Eddie James

IBM created an implementation of the PCA9552 on a PIC16F microcontroller. The I2C device addresses are different from the hardware PCA9552, so add a new compatible string and associated platform data to be able to probe this device.

This can be applied when Rob ack's the device tree change.

I'll ask you to do new patch version when that happens.

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html