diff mbox series

ARM: ep93xx: Convert to use descriptors for GPIO LEDs

Message ID 20220830204327.368284-1-linus.walleij@linaro.org
State New
Headers show
Series ARM: ep93xx: Convert to use descriptors for GPIO LEDs | expand

Commit Message

Linus Walleij Aug. 30, 2022, 8:43 p.m. UTC
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(-)

Comments

kernel test robot Sept. 1, 2022, 5:37 p.m. UTC | #1
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
diff mbox series

Patch

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;