Message ID | 20231011-pxa-gpio-v8-2-eed08a0fcac8@skole.hr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp537384vqb; Wed, 11 Oct 2023 06:24:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGusM5t3gxA0TqJ86TS4RCpvgToEM/eJY/7kBxJDfDsq/B7NImHv5wlPBVYRk3q80WyKyvJ X-Received: by 2002:a17:90a:3da1:b0:274:60c7:e15a with SMTP id i30-20020a17090a3da100b0027460c7e15amr18703710pjc.4.1697030685105; Wed, 11 Oct 2023 06:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697030685; cv=none; d=google.com; s=arc-20160816; b=Q1FWuX48L4CFMPkklkK/dJqQSP41/C0ttALXEiAWuzRZsYroxTzdw14lsmk6/pQH7c W8U6QnhboL9dujqgs/iJT7ixrHzADc8CjSe0N9lui9b8PtVQrcryEFQ32h3hmOjgWKUL lS4/4uxmZBgT5ZeJGPQJUUTloaF+jtkYH1wnJX+dalnvNtoMgdcInvs9+bW3Y+PCaUWc eXCedPOKDN23pppa1tJ9gqQV+OcaE7PDYAXU44khE89xCgNGCA+iMCmwTao4TVBBwuaq K16imptu5yYIIKna1LcXxmhahiJyTq46q1OzfMeomLs1098/iHSgpgCJ6NWhWZuFYIbQ ARsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=yU0fR9hDMJNIb75UhFnJEsg9Os6Op8nKY2ilFK9nsqA=; fh=H4D8raVEE9ToK4xcGS9/Pnvmhs2QUzCYuQTuaKubzik=; b=ftbtsjgMj+KYwrBdAhl6fkcfw/gEN6kXr22GQGfSUDsi1mj3nKUj2xHGxGR3pMze0t VpCQwHMFDosDPBBxhNhk3zETLYWKRsG6tt33kSmE279LhmNaFGUNYAbGfWRZWbGJXNek DkxAAa8zMYdBF30HPN2D4I20FGQjnig3ax6/6zkED2kOK6hWql5YdhHEbi/dJDbRAJyq jdaAo7e7RZ4zFdIqMAyxgglIlZ04s/G1cwrkoGJUZiJAez02/xX8d4jPruC6J3tPUZWe MeonftCOtcXWlRolDNovXg+OiPH3GosK1BsoP5/Gyde4CH5IO1tg/dpXF6FwVwegdSTe gAug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ot8-20020a17090b3b4800b0026b71fdd505si15923748pjb.177.2023.10.11.06.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 06:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CDF968135CFF; Wed, 11 Oct 2023 06:24:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346731AbjJKNYL (ORCPT <rfc822;kartikey406@gmail.com> + 18 others); Wed, 11 Oct 2023 09:24:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbjJKNYI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Oct 2023 09:24:08 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 027389E; Wed, 11 Oct 2023 06:24:05 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 27B6E83D9B; Wed, 11 Oct 2023 15:24:04 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= <duje.mihanovic@skole.hr> Date: Wed, 11 Oct 2023 15:23:46 +0200 Subject: [PATCH RFT v8 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231011-pxa-gpio-v8-2-eed08a0fcac8@skole.hr> References: <20231011-pxa-gpio-v8-0-eed08a0fcac8@skole.hr> In-Reply-To: <20231011-pxa-gpio-v8-0-eed08a0fcac8@skole.hr> To: Daniel Mack <daniel@zonque.org>, Haojian Zhuang <haojian.zhuang@gmail.com>, Robert Jarzmik <robert.jarzmik@free.fr>, Russell King <linux@armlinux.org.uk>, Alan Stern <stern@rowland.harvard.edu>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl>, Andy Shevchenko <andy@kernel.org>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Mark Brown <broonie@kernel.org> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org, =?utf-8?q?Duje_Miha?= =?utf-8?q?novi=C4=87?= <duje.mihanovic@skole.hr> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1628; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=2i2mzqzeK5dKls1oQllrI2VaEq4mqrMjUDr4Yj1khYo=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlJqHoeXC5/SuJUFyiywTo7tDbkBQsYucN+zAMe ts4o/BsUE6JAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZSah6AAKCRCaEZ6wQi2W 4UYHD/49wIrHmeNOmaf6udOGaV3KZpISkBwOENe5AldQXqVIw5VAGUWTUGSvzElbHdFFoXvX5u2 vPNhfGKDzjEkzNoJ24IxCAF4J8Q5TtgISR1s+/pYB3EQ1+jUJswQy7bDv9oQlQT+ZvL8RgPV2Jc 56GQ7LFh4or+WvAVp4RLgs085tF35aR0g75QT6Ovq1+RaUKzbUUyhbcL4WwFPpB5GYXsKl3lVr4 xhVsnFtSicfeieZTFr6jAe8Jr1O2jZnVU1u6WCSO8rnHLG3FZXVDBnrNtqAQyONwXvQtqaTikW6 aqfaQxJ5PM0eAZFfsGhCg1GIBzccUrjwzt7doP9F4YhFaE7cRUgsqTU6a22/s/RQtjFRaAgSm0d +hFe9aaQutooNStUV3WriC/LXSmddJq7y8IybNfZnyHHhiHkgR9K+pJyQqzYyVcQLjk+tThMx3e tGEl2hzV3/V1nkihQWTGFoUrE0HoYyJockIehjpv1IkS2K9CxN7up8UEEtUaPVYCVcwdt5WQL8o r2UNgVMJDHfPumDZNjiEu5Wnjehga0jJH+sN/oob1cPK2DfSpkE1k+PiU3txzGUyR1qELKTqEAs II5/plNTxcCtsbBi79QsaqjJ7bCFfeo54Q3bUJONdo5pXoJR6lMXLJyOnQnhCW2nqlC4vvjAA5S iCno2CxAKmDTxdA== X-Developer-Key: i=duje.mihanovic@skole.hr; a=openpgp; fpr=53DF9D4D9C3FE110FB362D789A119EB0422D96E1 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 06:24:24 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779465647548438595 X-GMAIL-MSGID: 1779465647548438595 |
Series |
ARM: pxa: GPIO descriptor conversions
|
|
Commit Message
Duje Mihanović
Oct. 11, 2023, 1:23 p.m. UTC
Sharp's Spitz board still uses the legacy GPIO interface for configuring its two onboard LEDs. Convert them to use the GPIO descriptor interface. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr> --- arch/arm/mach-pxa/spitz.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
Comments
On Wed, Oct 11, 2023 at 3:24 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote: > > Sharp's Spitz board still uses the legacy GPIO interface for configuring > its two onboard LEDs. > > Convert them to use the GPIO descriptor interface. > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr> > --- > arch/arm/mach-pxa/spitz.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c > index 535e2b2e997b..9efd603c715a 100644 > --- a/arch/arm/mach-pxa/spitz.c > +++ b/arch/arm/mach-pxa/spitz.c > @@ -452,16 +452,25 @@ static inline void spitz_keys_init(void) {} > * LEDs > ******************************************************************************/ > #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) > +static struct gpiod_lookup_table spitz_led_gpio_table = { > + .dev_id = "leds-gpio", > + .table = { > + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, 0, > + GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, 1, > + GPIO_ACTIVE_HIGH), > + { } > + } > +}; > + > static struct gpio_led spitz_gpio_leds[] = { > { > .name = "spitz:amber:charge", > .default_trigger = "sharpsl-charge", > - .gpio = SPITZ_GPIO_LED_ORANGE, > }, > { > .name = "spitz:green:hddactivity", > .default_trigger = "disk-activity", > - .gpio = SPITZ_GPIO_LED_GREEN, > }, > }; > > @@ -480,6 +489,7 @@ static struct platform_device spitz_led_device = { > > static void __init spitz_leds_init(void) > { > + gpiod_add_lookup_table(&spitz_led_gpio_table); > platform_device_register(&spitz_led_device); > } > #else > > -- > 2.42.0 > > Which driver consumes these GPIOs? Doesn't it need any conversion? Bart
On Wednesday, October 11, 2023 4:21:39 PM CEST Bartosz Golaszewski wrote:
> Which driver consumes these GPIOs? Doesn't it need any conversion?
That is drivers/leds/leds-gpio.c which has already been converted to the
descriptor API way back in 5c51277a9aba ("leds: leds-gpio: Add support for
GPIO descriptors").
Regards,
Duje
On Wed, Oct 11, 2023 at 5:17 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote: > > On Wednesday, October 11, 2023 4:21:39 PM CEST Bartosz Golaszewski wrote: > > Which driver consumes these GPIOs? Doesn't it need any conversion? > > That is drivers/leds/leds-gpio.c which has already been converted to the > descriptor API way back in 5c51277a9aba ("leds: leds-gpio: Add support for > GPIO descriptors"). > > Regards, > Duje > > > Perfect. In that case: Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 535e2b2e997b..9efd603c715a 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -452,16 +452,25 @@ static inline void spitz_keys_init(void) {} * LEDs ******************************************************************************/ #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +static struct gpiod_lookup_table spitz_led_gpio_table = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, 0, + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, 1, + GPIO_ACTIVE_HIGH), + { } + } +}; + static struct gpio_led spitz_gpio_leds[] = { { .name = "spitz:amber:charge", .default_trigger = "sharpsl-charge", - .gpio = SPITZ_GPIO_LED_ORANGE, }, { .name = "spitz:green:hddactivity", .default_trigger = "disk-activity", - .gpio = SPITZ_GPIO_LED_GREEN, }, }; @@ -480,6 +489,7 @@ static struct platform_device spitz_led_device = { static void __init spitz_leds_init(void) { + gpiod_add_lookup_table(&spitz_led_gpio_table); platform_device_register(&spitz_led_device); } #else