linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs
@ 2023-01-11 13:22 Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2023-01-11 13:22 UTC (permalink / raw)
  To: arm, soc
  Cc: linux-arm-kernel, Linus Walleij, Nikita Shubin,
	Alexander Sverdlin, Hartley Sweeten, Lukasz Majewski

This converts the EP93xx to use GPIO descriptors for the
LEDs.

Cc: Nikita Shubin <nikita.shubin@maquefel.me>
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lukasz Majewski <lukma@denx.de>
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v3->v4:
- Rebased on v6.2-rc1
- SoC folks: please apply this patch directly for suitable branch.
ChangeLog v2->v3:
- Collected Alexander's Tested-by
ChangeLog v1->v2:
- Fix syntax error (doubled left parens)
---
 arch/arm/mach-ep93xx/core.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 95e731676cea..71b113976420 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -426,10 +426,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
 static const struct gpio_led ep93xx_led_pins[] __initconst = {
 	{
 		.name	= "platform:grled",
-		.gpio	= EP93XX_GPIO_LINE_GRLED,
 	}, {
 		.name	= "platform:rdled",
-		.gpio	= EP93XX_GPIO_LINE_RDLED,
 	},
 };
 
@@ -438,6 +436,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
 	.leds		= ep93xx_led_pins,
 };
 
+static struct gpiod_lookup_table ep93xx_leds_gpio_table = {
+	.dev_id = "leds-gpio",
+	.table = {
+		/* Use local offsets on gpiochip/port "E" */
+		GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("E", 1,	NULL, 1, GPIO_ACTIVE_HIGH),
+		{ }
+	},
+};
+
 /*************************************************************************
  * EP93xx pwm peripheral handling
  *************************************************************************/
@@ -990,6 +998,7 @@ struct device __init *ep93xx_init_devices(void)
 	platform_device_register(&ep93xx_ohci_device);
 	platform_device_register(&ep93xx_wdt_device);
 
+	gpiod_add_lookup_table(&ep93xx_leds_gpio_table);
 	gpio_led_register_device(-1, &ep93xx_led_data);
 
 	return parent;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs
  2022-08-30 20:43 Linus Walleij
@ 2022-09-01 17:37 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-09-01 17:37 UTC (permalink / raw)
  To: Linus Walleij, H Hartley Sweeten, Alexander Sverdlin
  Cc: llvm, kbuild-all, linux-arm-kernel, linux-gpio, Linus Walleij,
	Nikita Shubin, Lukasz Majewski

Hi Linus,

I love your patch! Yet something to improve:

[auto build test ERROR on soc/for-next]
[also build test ERROR on linus/master v6.0-rc3 next-20220901]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Linus-Walleij/ARM-ep93xx-Convert-to-use-descriptors-for-GPIO-LEDs/20220831-044651
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: arm-ep93xx_defconfig (https://download.01.org/0day-ci/archive/20220902/202209020143.4bgj9GIh-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c55b41d5199d2394dd6cdb8f52180d8b81d809d4)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/intel-lab-lkp/linux/commit/198889a7fb8ce93e00c3b801161bca6f76efdf3d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Linus-Walleij/ARM-ep93xx-Convert-to-use-descriptors-for-GPIO-LEDs/20220831-044651
        git checkout 198889a7fb8ce93e00c3b801161bca6f76efdf3d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/arm/mach-ep93xx/core.c:1000:50: error: expected ')'
           gpiod_add_lookup_table((&ep93xx_leds_gpio_table);
                                                           ^
   arch/arm/mach-ep93xx/core.c:1000:24: note: to match this '('
           gpiod_add_lookup_table((&ep93xx_leds_gpio_table);
                                 ^
   1 error generated.


vim +1000 arch/arm/mach-ep93xx/core.c

   972	
   973	struct device __init *ep93xx_init_devices(void)
   974	{
   975		struct device *parent;
   976	
   977		/* Disallow access to MaverickCrunch initially */
   978		ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_CPENA);
   979	
   980		/* Default all ports to GPIO */
   981		ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_KEYS |
   982				       EP93XX_SYSCON_DEVCFG_GONK |
   983				       EP93XX_SYSCON_DEVCFG_EONIDE |
   984				       EP93XX_SYSCON_DEVCFG_GONIDE |
   985				       EP93XX_SYSCON_DEVCFG_HONIDE);
   986	
   987		parent = ep93xx_init_soc();
   988	
   989		/* Get the GPIO working early, other devices need it */
   990		platform_device_register(&ep93xx_gpio_device);
   991	
   992		amba_device_register(&uart1_device, &iomem_resource);
   993		amba_device_register(&uart2_device, &iomem_resource);
   994		amba_device_register(&uart3_device, &iomem_resource);
   995	
   996		platform_device_register(&ep93xx_rtc_device);
   997		platform_device_register(&ep93xx_ohci_device);
   998		platform_device_register(&ep93xx_wdt_device);
   999	
> 1000		gpiod_add_lookup_table((&ep93xx_leds_gpio_table);
  1001		gpio_led_register_device(-1, &ep93xx_led_data);
  1002	
  1003		return parent;
  1004	}
  1005	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs
@ 2022-08-30 20:43 Linus Walleij
  2022-09-01 17:37 ` kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2022-08-30 20:43 UTC (permalink / raw)
  To: H Hartley Sweeten, Alexander Sverdlin
  Cc: linux-arm-kernel, linux-gpio, Linus Walleij, Nikita Shubin,
	Lukasz Majewski

This converts the EP93xx to use GPIO descriptors for the
LEDs.

Cc: Nikita Shubin <nikita.shubin@maquefel.me>
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ep93xx/core.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 2d58e273c96d..1abd93b8a084 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -425,10 +425,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
 static const struct gpio_led ep93xx_led_pins[] __initconst = {
 	{
 		.name	= "platform:grled",
-		.gpio	= EP93XX_GPIO_LINE_GRLED,
 	}, {
 		.name	= "platform:rdled",
-		.gpio	= EP93XX_GPIO_LINE_RDLED,
 	},
 };
 
@@ -437,6 +435,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
 	.leds		= ep93xx_led_pins,
 };
 
+static struct gpiod_lookup_table ep93xx_leds_gpio_table = {
+	.dev_id = "leds-gpio",
+	.table = {
+		/* Use local offsets on gpiochip/port "E" */
+		GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP_IDX("E", 1,	NULL, 1, GPIO_ACTIVE_HIGH),
+		{ }
+	},
+};
+
 /*************************************************************************
  * EP93xx pwm peripheral handling
  *************************************************************************/
@@ -989,6 +997,7 @@ struct device __init *ep93xx_init_devices(void)
 	platform_device_register(&ep93xx_ohci_device);
 	platform_device_register(&ep93xx_wdt_device);
 
+	gpiod_add_lookup_table((&ep93xx_leds_gpio_table);
 	gpio_led_register_device(-1, &ep93xx_led_data);
 
 	return parent;
-- 
2.37.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-11 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 13:22 [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2022-08-30 20:43 Linus Walleij
2022-09-01 17:37 ` kernel test robot

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).