* [PATCH 2/3 v3] x86/platform/geode: Convert geode LED to GPIO machine descriptor
2020-11-03 0:04 [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Linus Walleij
@ 2020-11-03 0:04 ` Linus Walleij
2020-11-03 0:04 ` [PATCH 3/3 v3] x86/platform/geode: Convert alix " Linus Walleij
2020-11-03 10:22 ` [PATCH 1/3 v3] x86/platform/geode: Convert net5501 " Hans de Goede
2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-11-03 0:04 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko
Cc: platform-driver-x86, Linus Walleij, linux-gpio, linux-geode
This makes the machine look up the LED from a GPIO machine
descriptor table. The Geode LEDs should be on the CS5535
companion chip.
Cc: linux-gpio@vger.kernel.org
Cc: linux-geode@lists.infradead.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Rebase on v5.10-rc1
- Resend
ChangeLog v1->v2:
- Drop excess comma after terminator { }
- Collect Andy's Reviewed-by
---
arch/x86/platform/geode/geos.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
index 73a3f49b4eb6..d263528c90bb 100644
--- a/arch/x86/platform/geode/geos.c
+++ b/arch/x86/platform/geode/geos.c
@@ -20,6 +20,7 @@
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
+#include <linux/gpio/machine.h>
#include <linux/dmi.h>
#include <asm/geode.h>
@@ -53,21 +54,15 @@ static struct platform_device geos_buttons_dev = {
static struct gpio_led geos_leds[] = {
{
.name = "geos:1",
- .gpio = 6,
.default_trigger = "default-on",
- .active_low = 1,
},
{
.name = "geos:2",
- .gpio = 25,
.default_trigger = "default-off",
- .active_low = 1,
},
{
.name = "geos:3",
- .gpio = 27,
.default_trigger = "default-off",
- .active_low = 1,
},
};
@@ -76,6 +71,17 @@ static struct gpio_led_platform_data geos_leds_data = {
.leds = geos_leds,
};
+static struct gpiod_lookup_table geos_leds_gpio_table = {
+ .dev_id = "leds-gpio",
+ .table = {
+ /* The Geode GPIOs should be on the CS5535 companion chip */
+ GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 25, NULL, 1, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 27, NULL, 2, GPIO_ACTIVE_LOW),
+ { }
+ },
+};
+
static struct platform_device geos_leds_dev = {
.name = "leds-gpio",
.id = -1,
@@ -90,6 +96,7 @@ static struct platform_device *geos_devs[] __initdata = {
static void __init register_geos(void)
{
/* Setup LED control through leds-gpio driver */
+ gpiod_add_lookup_table(&geos_leds_gpio_table);
platform_add_devices(geos_devs, ARRAY_SIZE(geos_devs));
}
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3 v3] x86/platform/geode: Convert alix LED to GPIO machine descriptor
2020-11-03 0:04 [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Linus Walleij
2020-11-03 0:04 ` [PATCH 2/3 v3] x86/platform/geode: Convert geode " Linus Walleij
@ 2020-11-03 0:04 ` Linus Walleij
2020-11-03 10:22 ` [PATCH 1/3 v3] x86/platform/geode: Convert net5501 " Hans de Goede
2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-11-03 0:04 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko
Cc: platform-driver-x86, Linus Walleij, linux-gpio, linux-geode,
Andy Shevchenko
This makes the machine look up the LED from a GPIO machine
descriptor table. The Geode LEDs should be on the CS5535
companion chip.
Cc: linux-gpio@vger.kernel.org
Cc: linux-geode@lists.infradead.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Rebase on v5.10-rc1
- Resend
ChangeLog v1->v2:
- Drop excess comma after terminator { }
- Collect Andy's Reviewed-by
---
arch/x86/platform/geode/alix.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/x86/platform/geode/alix.c b/arch/x86/platform/geode/alix.c
index c33f744b5388..b39bf3b5e108 100644
--- a/arch/x86/platform/geode/alix.c
+++ b/arch/x86/platform/geode/alix.c
@@ -22,6 +22,7 @@
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
+#include <linux/gpio/machine.h>
#include <linux/dmi.h>
#include <asm/geode.h>
@@ -69,21 +70,15 @@ static struct platform_device alix_buttons_dev = {
static struct gpio_led alix_leds[] = {
{
.name = "alix:1",
- .gpio = 6,
.default_trigger = "default-on",
- .active_low = 1,
},
{
.name = "alix:2",
- .gpio = 25,
.default_trigger = "default-off",
- .active_low = 1,
},
{
.name = "alix:3",
- .gpio = 27,
.default_trigger = "default-off",
- .active_low = 1,
},
};
@@ -92,6 +87,17 @@ static struct gpio_led_platform_data alix_leds_data = {
.leds = alix_leds,
};
+static struct gpiod_lookup_table alix_leds_gpio_table = {
+ .dev_id = "leds-gpio",
+ .table = {
+ /* The Geode GPIOs should be on the CS5535 companion chip */
+ GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 25, NULL, 1, GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP_IDX("cs5535-gpio", 27, NULL, 2, GPIO_ACTIVE_LOW),
+ { }
+ },
+};
+
static struct platform_device alix_leds_dev = {
.name = "leds-gpio",
.id = -1,
@@ -106,6 +112,7 @@ static struct platform_device *alix_devs[] __initdata = {
static void __init register_alix(void)
{
/* Setup LED control through leds-gpio driver */
+ gpiod_add_lookup_table(&alix_leds_gpio_table);
platform_add_devices(alix_devs, ARRAY_SIZE(alix_devs));
}
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor
2020-11-03 0:04 [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Linus Walleij
2020-11-03 0:04 ` [PATCH 2/3 v3] x86/platform/geode: Convert geode " Linus Walleij
2020-11-03 0:04 ` [PATCH 3/3 v3] x86/platform/geode: Convert alix " Linus Walleij
@ 2020-11-03 10:22 ` Hans de Goede
2020-11-03 10:39 ` Andy Shevchenko
2 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2020-11-03 10:22 UTC (permalink / raw)
To: Linus Walleij, Darren Hart, Andy Shevchenko
Cc: platform-driver-x86, linux-gpio, Andres Salomon, linux-geode,
Andy Shevchenko
Hi,
On 11/3/20 1:04 AM, Linus Walleij wrote:
> This makes the machine look up the LED from a GPIO machine
> descriptor table. The Geode LEDs should be on the CS5535
> companion chip.
>
> Cc: linux-gpio@vger.kernel.org
> Cc: Andres Salomon <dilinger@queued.net>
> Cc: linux-geode@lists.infradead.org
> Cc: Darren Hart <dvhart@infradead.org>
> Cc: platform-driver-x86@vger.kernel.org
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus, in case you did not know yet, I have take over
drivers/platform/x86 maintainership from Andy.
Andy, the MAINTAINERS entry for arch/x86/platform says:
X86 PLATFORM DRIVERS - ARCH
R: Darren Hart <dvhart@infradead.org>
R: Andy Shevchenko <andy@infradead.org>
L: platform-driver-x86@vger.kernel.org
L: x86@kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
F: arch/x86/platform
Andy, so I guess that with your Reviewed-by added, these are expected to
get picked up by the tip tree people ?
Linus, it seems that you did not "Cc: x86@kernel.org" which is
listed in MAINTAINERS for these, and is probably necessary to
get these merged through the tip tree.
Note I'm happy to pick these up through:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/
I actually had them in my local review-hans branch before noticing that
that they went to arch/x86/platform. But I've dropped them now as I'm
not sure if merging them through the pdx86 tree is the right thing to do,
the MAINTAINERS file at least suggests things should be done differently.
Linus, if a v4 with "Cc: x86@kernel.org" is necessary you may add my:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
To the entire series.
Regards,
Hans
> ---
> ChangeLog v2->v3:
> - Rebase on v5.10-rc1
> - Resend
> ChangeLog v1->v2:
> - Drop excess comma after terminator { }
> - Collect Andy's Reviewed-by
> ---
> arch/x86/platform/geode/net5501.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
> index 163e1b545517..558384acd777 100644
> --- a/arch/x86/platform/geode/net5501.c
> +++ b/arch/x86/platform/geode/net5501.c
> @@ -20,6 +20,7 @@
> #include <linux/platform_device.h>
> #include <linux/input.h>
> #include <linux/gpio_keys.h>
> +#include <linux/gpio/machine.h>
>
> #include <asm/geode.h>
>
> @@ -55,9 +56,7 @@ static struct platform_device net5501_buttons_dev = {
> static struct gpio_led net5501_leds[] = {
> {
> .name = "net5501:1",
> - .gpio = 6,
> .default_trigger = "default-on",
> - .active_low = 0,
> },
> };
>
> @@ -66,6 +65,15 @@ static struct gpio_led_platform_data net5501_leds_data = {
> .leds = net5501_leds,
> };
>
> +static struct gpiod_lookup_table net5501_leds_gpio_table = {
> + .dev_id = "leds-gpio",
> + .table = {
> + /* The Geode GPIOs should be on the CS5535 companion chip */
> + GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_HIGH),
> + { }
> + },
> +};
> +
> static struct platform_device net5501_leds_dev = {
> .name = "leds-gpio",
> .id = -1,
> @@ -80,6 +88,7 @@ static struct platform_device *net5501_devs[] __initdata = {
> static void __init register_net5501(void)
> {
> /* Setup LED control through leds-gpio driver */
> + gpiod_add_lookup_table(&net5501_leds_gpio_table);
> platform_add_devices(net5501_devs, ARRAY_SIZE(net5501_devs));
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor
2020-11-03 10:22 ` [PATCH 1/3 v3] x86/platform/geode: Convert net5501 " Hans de Goede
@ 2020-11-03 10:39 ` Andy Shevchenko
2020-11-03 11:03 ` Hans de Goede
0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2020-11-03 10:39 UTC (permalink / raw)
To: Hans de Goede
Cc: Linus Walleij, Darren Hart, Andy Shevchenko, Platform Driver,
open list:GPIO SUBSYSTEM, Andres Salomon, linux-geode
On Tue, Nov 3, 2020 at 12:22 PM Hans de Goede <hdegoede@redhat.com> wrote:
> On 11/3/20 1:04 AM, Linus Walleij wrote:
> > This makes the machine look up the LED from a GPIO machine
> > descriptor table. The Geode LEDs should be on the CS5535
> > companion chip.
> >
> > Cc: linux-gpio@vger.kernel.org
> > Cc: Andres Salomon <dilinger@queued.net>
> > Cc: linux-geode@lists.infradead.org
> > Cc: Darren Hart <dvhart@infradead.org>
> > Cc: platform-driver-x86@vger.kernel.org
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Linus, in case you did not know yet, I have take over
> drivers/platform/x86 maintainership from Andy.
>
> Andy, the MAINTAINERS entry for arch/x86/platform says:
Yes, it's a bit orthogonal to PDx86, but it makes sense to have the
below list of reviewers to be in sync with PDx86 maintainers. I'm
happy to give my place in the below to you.
> X86 PLATFORM DRIVERS - ARCH
> R: Darren Hart <dvhart@infradead.org>
> R: Andy Shevchenko <andy@infradead.org>
> L: platform-driver-x86@vger.kernel.org
> L: x86@kernel.org
> S: Maintained
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
> F: arch/x86/platform
>
> Andy, so I guess that with your Reviewed-by added, these are expected to
> get picked up by the tip tree people ?
That's correct.
> Linus, it seems that you did not "Cc: x86@kernel.org" which is
> listed in MAINTAINERS for these, and is probably necessary to
> get these merged through the tip tree.
>
> Note I'm happy to pick these up through:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/
>
> I actually had them in my local review-hans branch before noticing that
> that they went to arch/x86/platform. But I've dropped them now as I'm
> not sure if merging them through the pdx86 tree is the right thing to do,
> the MAINTAINERS file at least suggests things should be done differently.
arch/x86 should go via TIP tree, except cases confirmed by TIP maintainers.
> Linus, if a v4 with "Cc: x86@kernel.org" is necessary you may add my:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> To the entire series.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor
2020-11-03 10:39 ` Andy Shevchenko
@ 2020-11-03 11:03 ` Hans de Goede
0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2020-11-03 11:03 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Linus Walleij, Darren Hart, Andy Shevchenko, Platform Driver,
open list:GPIO SUBSYSTEM, Andres Salomon, linux-geode
Hi,
On 11/3/20 11:39 AM, Andy Shevchenko wrote:
> On Tue, Nov 3, 2020 at 12:22 PM Hans de Goede <hdegoede@redhat.com> wrote:
>> On 11/3/20 1:04 AM, Linus Walleij wrote:
>>> This makes the machine look up the LED from a GPIO machine
>>> descriptor table. The Geode LEDs should be on the CS5535
>>> companion chip.
>>>
>>> Cc: linux-gpio@vger.kernel.org
>>> Cc: Andres Salomon <dilinger@queued.net>
>>> Cc: linux-geode@lists.infradead.org
>>> Cc: Darren Hart <dvhart@infradead.org>
>>> Cc: platform-driver-x86@vger.kernel.org
>>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> Linus, in case you did not know yet, I have take over
>> drivers/platform/x86 maintainership from Andy.
>>
>> Andy, the MAINTAINERS entry for arch/x86/platform says:
>
> Yes, it's a bit orthogonal to PDx86, but it makes sense to have the
> below list of reviewers to be in sync with PDx86 maintainers. I'm
> happy to give my place in the below to you.
I'm not familiar with most of the code there, so how about
adding me while keeping you there too ?
And maybe drop Darren I guess ? Darren if you are reading
along, please let us know what you want.
>> X86 PLATFORM DRIVERS - ARCH
>> R: Darren Hart <dvhart@infradead.org>
>> R: Andy Shevchenko <andy@infradead.org>
>> L: platform-driver-x86@vger.kernel.org
>> L: x86@kernel.org
>> S: Maintained
>> T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
>> F: arch/x86/platform
>>
>> Andy, so I guess that with your Reviewed-by added, these are expected to
>> get picked up by the tip tree people ?
>
> That's correct.
>
>> Linus, it seems that you did not "Cc: x86@kernel.org" which is
>> listed in MAINTAINERS for these, and is probably necessary to
>> get these merged through the tip tree.
>>
>> Note I'm happy to pick these up through:
>> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/
>>
>> I actually had them in my local review-hans branch before noticing that
>> that they went to arch/x86/platform. But I've dropped them now as I'm
>> not sure if merging them through the pdx86 tree is the right thing to do,
>> the MAINTAINERS file at least suggests things should be done differently.
>
> arch/x86 should go via TIP tree, except cases confirmed by TIP maintainers.
Ok, then I think a v4 with the TIP maintainers actually in the addressing
list is necessary.
>> Linus, if a v4 with "Cc: x86@kernel.org" is necessary you may add my:
>>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>
>> To the entire series.
And this still applies.
Regards,
Hans
^ permalink raw reply [flat|nested] 6+ messages in thread