Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3922703rdh; Fri, 29 Sep 2023 06:27:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGv+g37aqKed/qU9dV6H9QTiur0oxAy8d1UeLkI8ozfL6MUuLY21t/G4WzK8Yn5uMeb+w/J X-Received: by 2002:a05:6a21:a58e:b0:13e:7d3:61d1 with SMTP id gd14-20020a056a21a58e00b0013e07d361d1mr5532978pzc.12.1695994039403; Fri, 29 Sep 2023 06:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695994039; cv=none; d=google.com; s=arc-20160816; b=Gzv7cmwXnCW1kjtESIbAILAw9z6VGYdOUwB9eP7vskpCsy91/+JFCMHG9D1FtqYZ07 rYmvl+/RYA8/W+gRBCQAVKxaemQdrKwVzzrEaA36f1IzjX8RNkaIzb+0WJCQy1Cnkhm8 TV1BeKgl4j+45ygw5o/7chggWpWydV9B6XukX4mLlsuwPT8Nyyql8nfLT+KKZpIJ2rhl nduTD3/+9/iqfslQF4g3nvaZMtKAn5SqQAMCdSYYzKJlssQ/DGUHQEJXRG9Daowhh/Uj PDH0FDtm/kpBKry6OSR6GSEGchV5RUDmuEnHSxF0ScAvMUfGiOlKik5JpfWq45bnvo1f 3hrg== 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=Ezfw1f4LZtr96j/52TrYv7S1un4VbIvrKNn/Nze4NtQ=; fh=UU0GqEaQ9Xnukct86UJbX2/ZB3UfIgAdTfbf6iYszSw=; b=f95qokeSVFxMtpOK4D4WFf6Zb0OKHXRmiUIVDFmn0h0YYIDtXbXRUV6nT53RNQDXGZ EMVWy5Kookd1q0AfFAbu6fp3+ZJsvsZ8bt8yGJQ+Du5MJpgvABR7mungENrhvIyOA9ls KUDFPGQNUTwHkZ4mhhoNBA/a+5D0M3CJIEZE84keHyfSRYVWbrlCpF0QnNA935t4LQpI MrHOVOtpvKKEQEKgRSzFkpRw+d9Z1z/DE4ASykyk/1991B0cda4lZS1x9qYQOxLinnFO t6Bml6c6kWUMKdG0B2vIdAiyGAQ0c/MwzV8mzhYXHLWqGC6CLqU3iXNH/RPw8IeDujYN QjEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fz14-20020a17090b024e00b00268a8e0cab3si1457446pjb.178.2023.09.29.06.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id AF355809871E; Fri, 29 Sep 2023 06:15:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233330AbjI2NPR (ORCPT + 99 others); Fri, 29 Sep 2023 09:15:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233280AbjI2NPN (ORCPT ); Fri, 29 Sep 2023 09:15:13 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE8611AE; Fri, 29 Sep 2023 06:15:09 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 1860A8347F; Fri, 29 Sep 2023 15:15:07 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Fri, 29 Sep 2023 15:14:00 +0200 Subject: [PATCH RFC v3 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: <20230929-pxa-gpio-v3-2-af8d5e5d1f34@skole.hr> References: <20230929-pxa-gpio-v3-0-af8d5e5d1f34@skole.hr> In-Reply-To: <20230929-pxa-gpio-v3-0-af8d5e5d1f34@skole.hr> To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, =?utf-8?q?Duje_Mihanovi=C4=87?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1770; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=YWNiyCxNsU8MmTyH6WiBM69WsGVSRGwp1wU7bY9Kw6M=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlFs3X304DDyKC0uR3vS5VnlJD0Kr4pUR83cnSQ +onNw+6IouJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZRbN1wAKCRCaEZ6wQi2W 4cz7D/9dlWMHeVtBJISPMPBb2V0Fewc86D8PHtoymudyxNY/zXJorP8gXwAeLzFO5Wq98rmVydH JoJK5cRb80YmAYzv2bpZgngOTq35c0C9NsMMRHADjSdGJRuK2533R9i8vUkeAUnyMPD9FGWagpm b3iAMl5681X2j4N+ViX3U7yiFixVGh0nZ+vIlwr496uZnzORKwmyYHxtlmZQwhKSFeJw206QBny wp1LdI9yrKxUL1WG8Tm2hThodNRRetvVwpPJty3Ws0XrbeeKhKlre3tpES+9ZCSmRSMn3FZT/F1 IPRcKg21Dya5uVmHGy1zMI6LuXgoP/SAJFmwByIQKnX7UMXm4NAQEhsXRdCYJFOHhk9yMwYGkW7 R92Qo+TwviwPxdRrIf3KrUSWcr5BeoE2uQCakkb7y1scyQ1Jdm4yvrgVd/A7tiNMa7n/j9P4uU4 n/wKY3RQbFC3qwQPhZcmc0PGJRUSNBtMBIzY3wzHP4639HvE+sFfDMb8/Eedp+wrhkZndOvTVLd 6k8TGYR5k8OwX5YbVr+fnpp/ldpv/7bwwxeRFVMm2359yd1ycnhtnT5O6//qWw4Tg9EbOXysQdg qcbhwoIrhwWH/+xaIxvRyWdfNUKAK/8DSQG06tv0gtDgnT+D3zVMUP6EwEgzxiDvo4NLgqAULXO Ph/GeU0YokOlDVA== X-Developer-Key: i=duje.mihanovic@skole.hr; a=openpgp; fpr=53DF9D4D9C3FE110FB362D789A119EB0422D96E1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 06:15:23 -0700 (PDT) Sharp's Spitz board still uses the legacy GPIO interface for configuring its two onboard LEDs. Convert them to use the GPIO descriptor interface. Signed-off-by: Duje Mihanović --- arch/arm/mach-pxa/spitz.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 535e2b2e997b..6aa4a3a9f7aa 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,11 @@ static struct platform_device spitz_led_device = { static void __init spitz_leds_init(void) { + gpiod_add_lookup_table(&spitz_led_gpio_table); + spitz_gpio_leds[0].gpiod = gpiod_get_index(&spitz_led_device.dev, + NULL, 0, GPIOD_ASIS); + spitz_gpio_leds[1].gpiod = gpiod_get_index(&spitz_led_device.dev, + NULL, 1, GPIOD_ASIS); platform_device_register(&spitz_led_device); } #else -- 2.42.0