Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] leds: pca9532: Assign gpio base dynamically
@ 2021-04-14 11:51 Stefan Riedmueller
  2021-04-25 22:00 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Riedmueller @ 2021-04-14 11:51 UTC (permalink / raw)
  To: Riku Voipio, Pavel Machek; +Cc: linux-leds, linux-kernel, Stefan Riedmueller

When using devicetree, gpio_base holds its initial zero value which can
lead to a rejection if another gpio controller already occupies this
base. To prevent that collision let the gpio base be assigned dynamically.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
---
 drivers/leds/leds-pca9532.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 27d027165472..017794bb87ae 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -480,6 +480,8 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
 	if (!pdata)
 		return ERR_PTR(-ENOMEM);
 
+	pdata->gpio_base = -1;
+
 	of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0],
 				  ARRAY_SIZE(pdata->pwm));
 	of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0],
-- 
2.25.1


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

* Re: [PATCH] leds: pca9532: Assign gpio base dynamically
  2021-04-14 11:51 [PATCH] leds: pca9532: Assign gpio base dynamically Stefan Riedmueller
@ 2021-04-25 22:00 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2021-04-25 22:00 UTC (permalink / raw)
  To: Stefan Riedmueller; +Cc: Riku Voipio, linux-leds, linux-kernel


[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

Hi!

> When using devicetree, gpio_base holds its initial zero value which can
> lead to a rejection if another gpio controller already occupies this
> base. To prevent that collision let the gpio base be assigned dynamically.
> 
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>

Thanks, applied.
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 11:51 [PATCH] leds: pca9532: Assign gpio base dynamically Stefan Riedmueller
2021-04-25 22:00 ` Pavel Machek

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git