linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] leds: pca963x: Add support for PCA962x chips
@ 2022-08-22  6:18 Mike Looijmans
  2022-08-22  6:18 ` [PATCH 2/2] dt-bindings: " Mike Looijmans
       [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.eea759f5-b343-44ae-b225-1c6c559cf756.15e0f4b6-2201-4a5d-b92c-9ec71e7ae8fa@emailsignatures365.codetwo.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Looijmans @ 2022-08-22  6:18 UTC (permalink / raw)
  To: linux-leds; +Cc: Mike Looijmans, Pavel Machek, linux-kernel, p.meerwald

The PCA962x family shares the same I2C register layout and functionality.
This adds support for the following chips:
PCA9623 4-channel
PCA9624 8-channel
PCA9622 16-channel
PCA9626 24-channel

Tested only the PCA9624. Other devices based on datasheet information.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---

 drivers/leds/Kconfig        |  8 ++++----
 drivers/leds/leds-pca963x.c | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 499d0f215a8b..9a99190c13af 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -497,13 +497,13 @@ config LEDS_PCA955X_GPIO
 
 
 config LEDS_PCA963X
-	tristate "LED support for PCA963x I2C chip"
+	tristate "LED support for PCA962x and PCA963x I2C chips"
 	depends on LEDS_CLASS
 	depends on I2C
 	help
-	  This option enables support for LEDs connected to the PCA963x
-	  LED driver chip accessed via the I2C bus. Supported
-	  devices include PCA9633 and PCA9634
+	  This option enables support for LEDs connected to the PCA96xx
+	  LED driver chip accessed via the I2C bus. Supported devices:
+	  PCA9622, PCA9623, PCA9624, PCA9626, PCA9633, PCA9634, PCA9635.
 
 config LEDS_WM831X_STATUS
 	tristate "LED support for status LEDs on WM831x PMICs"
diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c
index 00aecd67e348..4d589624d192 100644
--- a/drivers/leds/leds-pca963x.c
+++ b/drivers/leds/leds-pca963x.c
@@ -48,6 +48,10 @@
 #define PCA963X_PWM_BASE	0x02
 
 enum pca963x_type {
+	pca9622,
+	pca9623,
+	pca9624,
+	pca9626,
 	pca9633,
 	pca9634,
 	pca9635,
@@ -62,6 +66,30 @@ struct pca963x_chipdef {
 };
 
 static struct pca963x_chipdef pca963x_chipdefs[] = {
+	[pca9622] = {
+		.grppwm		= 0x12,
+		.grpfreq	= 0x13,
+		.ledout_base	= 0x14,
+		.n_leds		= 16,
+	},
+	[pca9623] = {
+		.grppwm		= 0x6,
+		.grpfreq	= 0x7,
+		.ledout_base	= 0x8,
+		.n_leds		= 4,
+	},
+	[pca9624] = {
+		.grppwm		= 0xa,
+		.grpfreq	= 0xb,
+		.ledout_base	= 0xc,
+		.n_leds		= 8,
+	},
+	[pca9626] = {
+		.grppwm		= 0x1a,
+		.grpfreq	= 0x1b,
+		.ledout_base	= 0x1d,
+		.n_leds		= 24,
+	},
 	[pca9633] = {
 		.grppwm		= 0x6,
 		.grpfreq	= 0x7,
@@ -87,6 +115,10 @@ static struct pca963x_chipdef pca963x_chipdefs[] = {
 #define PCA963X_BLINK_PERIOD_MAX	10667
 
 static const struct i2c_device_id pca963x_id[] = {
+	{ "pca9622", pca9622 },
+	{ "pca9623", pca9623 },
+	{ "pca9624", pca9624 },
+	{ "pca9626", pca9626 },
 	{ "pca9632", pca9633 },
 	{ "pca9633", pca9633 },
 	{ "pca9634", pca9634 },
@@ -363,6 +395,10 @@ static int pca963x_register_leds(struct i2c_client *client,
 }
 
 static const struct of_device_id of_pca963x_match[] = {
+	{ .compatible = "nxp,pca9622", },
+	{ .compatible = "nxp,pca9623", },
+	{ .compatible = "nxp,pca9624", },
+	{ .compatible = "nxp,pca9626", },
 	{ .compatible = "nxp,pca9632", },
 	{ .compatible = "nxp,pca9633", },
 	{ .compatible = "nxp,pca9634", },
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] dt-bindings: leds: pca963x: Add support for PCA962x chips
  2022-08-22  6:18 [PATCH 1/2] leds: pca963x: Add support for PCA962x chips Mike Looijmans
@ 2022-08-22  6:18 ` Mike Looijmans
  2022-08-22 21:37   ` Rob Herring
       [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.eea759f5-b343-44ae-b225-1c6c559cf756.15e0f4b6-2201-4a5d-b92c-9ec71e7ae8fa@emailsignatures365.codetwo.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Looijmans @ 2022-08-22  6:18 UTC (permalink / raw)
  To: linux-leds
  Cc: Mike Looijmans, Krzysztof Kozlowski, Pavel Machek, Rob Herring,
	devicetree, linux-kernel, p.meerwald

The PCA962x family shares the same I2C register layout and functionality.
This adds support for the following chips:
PCA9623 4-channel
PCA9624 8-channel
PCA9622 16-channel
PCA9626 24-channel

Tested only the PCA9624. Other devices based on datasheet information.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>

---

 Documentation/devicetree/bindings/leds/leds-pca9532.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
index f769c52e3643..50a340cbbb49 100644
--- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt
+++ b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
@@ -5,6 +5,10 @@ The PWM support 256 steps.
 
 Required properties:
 	- compatible:
+		"nxp,pca9522"
+		"nxp,pca9523"
+		"nxp,pca9524"
+		"nxp,pca9526"
 		"nxp,pca9530"
 		"nxp,pca9531"
 		"nxp,pca9532"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] dt-bindings: leds: pca963x: Add support for PCA962x chips
  2022-08-22  6:18 ` [PATCH 2/2] dt-bindings: " Mike Looijmans
@ 2022-08-22 21:37   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-08-22 21:37 UTC (permalink / raw)
  To: Mike Looijmans
  Cc: Krzysztof Kozlowski, Rob Herring, p.meerwald, devicetree,
	linux-kernel, linux-leds, Pavel Machek

On Mon, 22 Aug 2022 08:18:38 +0200, Mike Looijmans wrote:
> The PCA962x family shares the same I2C register layout and functionality.
> This adds support for the following chips:
> PCA9623 4-channel
> PCA9624 8-channel
> PCA9622 16-channel
> PCA9626 24-channel
> 
> Tested only the PCA9624. Other devices based on datasheet information.
> 
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> 
> ---
> 
>  Documentation/devicetree/bindings/leds/leds-pca9532.txt | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] leds: pca963x: Add support for PCA962x chips
       [not found]   ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.67ffd036-675b-48f2-93d0-58c455654605@emailsignatures365.codetwo.com>
@ 2022-10-11  6:20     ` Mike Looijmans
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Looijmans @ 2022-10-11  6:20 UTC (permalink / raw)
  To: linux-leds; +Cc: Pavel Machek, linux-kernel, p.meerwald

Just a gentle "ping", haven't seen any feedback for quite some time. Any 
issues, comments?


Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: mike.looijmans@topicproducts.com
W: www.topic.nl

Please consider the environment before printing this e-mail
On 22-08-2022 08:18, Mike Looijmans wrote:
> The PCA962x family shares the same I2C register layout and functionality.
> This adds support for the following chips:
> PCA9623 4-channel
> PCA9624 8-channel
> PCA9622 16-channel
> PCA9626 24-channel
>
> Tested only the PCA9624. Other devices based on datasheet information.
>
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> ---
>
>   drivers/leds/Kconfig        |  8 ++++----
>   drivers/leds/leds-pca963x.c | 36 ++++++++++++++++++++++++++++++++++++
>   2 files changed, 40 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 499d0f215a8b..9a99190c13af 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -497,13 +497,13 @@ config LEDS_PCA955X_GPIO
>   
>   
>   config LEDS_PCA963X
> -	tristate "LED support for PCA963x I2C chip"
> +	tristate "LED support for PCA962x and PCA963x I2C chips"
>   	depends on LEDS_CLASS
>   	depends on I2C
>   	help
> -	  This option enables support for LEDs connected to the PCA963x
> -	  LED driver chip accessed via the I2C bus. Supported
> -	  devices include PCA9633 and PCA9634
> +	  This option enables support for LEDs connected to the PCA96xx
> +	  LED driver chip accessed via the I2C bus. Supported devices:
> +	  PCA9622, PCA9623, PCA9624, PCA9626, PCA9633, PCA9634, PCA9635.
>   
>   config LEDS_WM831X_STATUS
>   	tristate "LED support for status LEDs on WM831x PMICs"
> diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c
> index 00aecd67e348..4d589624d192 100644
> --- a/drivers/leds/leds-pca963x.c
> +++ b/drivers/leds/leds-pca963x.c
> @@ -48,6 +48,10 @@
>   #define PCA963X_PWM_BASE	0x02
>   
>   enum pca963x_type {
> +	pca9622,
> +	pca9623,
> +	pca9624,
> +	pca9626,
>   	pca9633,
>   	pca9634,
>   	pca9635,
> @@ -62,6 +66,30 @@ struct pca963x_chipdef {
>   };
>   
>   static struct pca963x_chipdef pca963x_chipdefs[] = {
> +	[pca9622] = {
> +		.grppwm		= 0x12,
> +		.grpfreq	= 0x13,
> +		.ledout_base	= 0x14,
> +		.n_leds		= 16,
> +	},
> +	[pca9623] = {
> +		.grppwm		= 0x6,
> +		.grpfreq	= 0x7,
> +		.ledout_base	= 0x8,
> +		.n_leds		= 4,
> +	},
> +	[pca9624] = {
> +		.grppwm		= 0xa,
> +		.grpfreq	= 0xb,
> +		.ledout_base	= 0xc,
> +		.n_leds		= 8,
> +	},
> +	[pca9626] = {
> +		.grppwm		= 0x1a,
> +		.grpfreq	= 0x1b,
> +		.ledout_base	= 0x1d,
> +		.n_leds		= 24,
> +	},
>   	[pca9633] = {
>   		.grppwm		= 0x6,
>   		.grpfreq	= 0x7,
> @@ -87,6 +115,10 @@ static struct pca963x_chipdef pca963x_chipdefs[] = {
>   #define PCA963X_BLINK_PERIOD_MAX	10667
>   
>   static const struct i2c_device_id pca963x_id[] = {
> +	{ "pca9622", pca9622 },
> +	{ "pca9623", pca9623 },
> +	{ "pca9624", pca9624 },
> +	{ "pca9626", pca9626 },
>   	{ "pca9632", pca9633 },
>   	{ "pca9633", pca9633 },
>   	{ "pca9634", pca9634 },
> @@ -363,6 +395,10 @@ static int pca963x_register_leds(struct i2c_client *client,
>   }
>   
>   static const struct of_device_id of_pca963x_match[] = {
> +	{ .compatible = "nxp,pca9622", },
> +	{ .compatible = "nxp,pca9623", },
> +	{ .compatible = "nxp,pca9624", },
> +	{ .compatible = "nxp,pca9626", },
>   	{ .compatible = "nxp,pca9632", },
>   	{ .compatible = "nxp,pca9633", },
>   	{ .compatible = "nxp,pca9634", },


-- 
Mike Looijmans


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-11  6:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  6:18 [PATCH 1/2] leds: pca963x: Add support for PCA962x chips Mike Looijmans
2022-08-22  6:18 ` [PATCH 2/2] dt-bindings: " Mike Looijmans
2022-08-22 21:37   ` Rob Herring
     [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.eea759f5-b343-44ae-b225-1c6c559cf756.15e0f4b6-2201-4a5d-b92c-9ec71e7ae8fa@emailsignatures365.codetwo.com>
     [not found]   ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.67ffd036-675b-48f2-93d0-58c455654605@emailsignatures365.codetwo.com>
2022-10-11  6:20     ` [PATCH 1/2] " Mike Looijmans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).