From patchwork Wed Oct 11 13:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Duje_Mihanovi=C4=87?= X-Patchwork-Id: 13417415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8F76CD6E69 for ; Wed, 11 Oct 2023 13:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i28YXok0xwv9Ehetait0kueVJyADYzLcQa9AzTdRNSk=; b=Ip5kNvtRYMVzaS DZKAhnV09Sm81K8G5oVU22ppspqYd8HXV9Zj+p9mUHfakqPxIm+n0ZZ7a+oKDjEJaeG1QawYar76K ToYSv+z9tCHz2Uj1ECkRkQ+yoFUgnWH3KW6PcSXKjqfQ6IEz3trof+QG6bxRDEv9aeMbCegzQNBCg ds3fhCN7wOB+XksdWQ/Xv5t9XHjjxNMTGaFI3Kb6kVmJbJ7RCpxHVQezNefF/D2QLiIL/4d9O69h9 ssLaqPgTYEy5g8Scn9/KY6n6fifulFBvqdAcRfOsY3eXFwbOyrV2YHmOMp0f7QvuDFoSCmnUj9IRg Ind5dS8F9kgolOuo6a4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqZI5-00FykG-1t; Wed, 11 Oct 2023 13:30:21 +0000 Received: from mx1.hosting.skole.hr ([161.53.165.185] helo=mx.skole.hr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqZHz-00Fyhj-0h for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 13:30:17 +0000 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?= 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 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 , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Dmitry Torokhov , Mark Brown 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_Mih?= =?utf-8?q?anovi=C4=87?= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_063015_407453_C644FBD9 X-CRM114-Status: GOOD ( 13.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Duje Mihanović Reviewed-by: Bartosz Golaszewski --- 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