Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1977757rdh; Tue, 26 Sep 2023 08:47:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS/rlPOgh8FKc46JxLvQoNlu+zzRoWvx+11ENKNm9mwLlLWystbzQqKYqBERWe6Kk7H1hD X-Received: by 2002:a05:6a21:33a7:b0:134:2b31:e2a9 with SMTP id yy39-20020a056a2133a700b001342b31e2a9mr10291313pzb.0.1695743269191; Tue, 26 Sep 2023 08:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695743269; cv=none; d=google.com; s=arc-20160816; b=yxYWdZN4jSIZ0IyL3QEpM+BLXZfcrOBCMFvfyw5C04IJYX2YFk3cZSFbfsQj8WUlo6 0olP+Nhur1GC7wyaAASuGXoqQjCDqpl58xqKagHp/9NAVaOSisBpOLntTPG5z1cj5A52 +zXcgfjZyUvUp0sVWe3tVD5IAo9msM+2sDbRglwfjDv/6u5KlU4tlv2RN/A0qqOnzT5G ZSaeGTSGHxpHRlEc6Egdix83F/u4coAWfhwIML7U8CO3R6BlevcFqFOyoKcbtenSNFRt XK4e2MItKk6u78sF7HGLBNOl6osaicsevtmixxEw/2wkHsWcC3zOpfCEPuNfaoKep07e YVhw== 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=cOV4mE1/Zn2BZ8zG7meOL/2AAuwFOofljcMRuQv9XJs=; fh=UU0GqEaQ9Xnukct86UJbX2/ZB3UfIgAdTfbf6iYszSw=; b=Bvr0OUkVXj0K7iLPD7vfdGIlsCXlU2+8/XXmwEVEGY/IB5NV3Qx7qdYDZMlscgT6MV TPPRZLz/Bd2JOuNYO8LuHDV8pjAlzDLDbl3Vmpah+oBBifo9oil283OG2ivKLsTJK99I MLy74Z+8pNiqcwhWJuuL1mTc8w163SSP+o/3pAsXe42jcW9NDu8AOMjfRmGKyKqPg6q4 +Qh3jZ0Bz3IFQETgrlqvOiPVjI6WiIx36VfiBf5xcFTAZ7wXQ/OEjghhNJrahs/s6sy8 oMWIeLxMWXDr1EwDkZZmi1RJj/H3tgDshPmgl/iYwIGpvwV8d1sJN9sHeWHCj8Bj4H3h 6a+w== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cx3-20020a17090afd8300b002768ab837bfsi14624564pjb.48.2023.09.26.08.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 08:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 CBD1C806315C; Tue, 26 Sep 2023 08:47:05 -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 S235131AbjIZPq4 (ORCPT + 99 others); Tue, 26 Sep 2023 11:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235089AbjIZPqy (ORCPT ); Tue, 26 Sep 2023 11:46:54 -0400 Received: from mx.skole.hr (mx2.hosting.skole.hr [161.53.165.186]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A9110A; Tue, 26 Sep 2023 08:46:46 -0700 (PDT) Received: from mx2.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 2DF96836CB; Tue, 26 Sep 2023 17:46:34 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Tue, 26 Sep 2023 17:46:23 +0200 Subject: [PATCH RFC v2 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: <20230926-pxa-gpio-v2-2-984464d165dd@skole.hr> References: <20230926-pxa-gpio-v2-0-984464d165dd@skole.hr> In-Reply-To: <20230926-pxa-gpio-v2-0-984464d165dd@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=1768; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=02fLXHNo6SZtYq4sldyjzMDb6JVfWPhjgCG5UTkdTdY=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlEvzW18VE2EpVyIF0E+Le+lT4YztgGaTeIG9e5 XYpdqeQTKKJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZRL81gAKCRCaEZ6wQi2W 4eyzD/4xj3nCTSW4fc2jM0QoHwNCTTdpBf+wYw23yFkTfriAQuKwDb+yf+S/7VnH9+nPUllfkE2 aR3bYa66FDYKIjn96yijEv76WCzw7WnOPanQmSeM/9zWQqVroR+S0+jFXVfygRmTeW9bxusuy/v 3AWGOz8EWBP8etp2pcvDUHTseRNZNiD2lsKEcWPyRVfs8xn+UtgejBQUVNHIVdhO5do4rA+KK9b uZUg+SfbcvrEHqLgAUY+Jfp35wNCIP8qQIhsqVAqMpQYZt32sRvfL7uY+bf1qO7vrqFQKrp++4A M508QZlkki3Wp2t69uKNiXKMxdNWSt220cHv/pLKOqGbg+bcL4Hg6Ry+EODxN0Wxz6qnTxgd+jg QTPcymSR5N2xjJCDLLsEq9J/asHAZ0C0YQDascD+Z4Ze8qqZbG317GzNvKOhIcCL2FEm1KMpEFP l4NZV/skn71OwWOc7Fs9iYCwXjCS0CFl232XWzYCmQOfSRQk6npNPFaRboP0k9BF6NpLKDwBBc0 rRemoKn9Ld/zFuR5hA/C24fYmXAjik4/nDQCXOJvFA49vza08zZs+BWr8ss3E1E5plOv5y/ZYp1 2+hblsfHVEeLXdnopzs1F3PPhGjkgw4vFH/TXeIRpLZkkkGO4UiY3JIam0SH4rkZKHMuGyuafhH /WVNz3KWoyMz54w== X-Developer-Key: i=duje.mihanovic@skole.hr; a=openpgp; fpr=53DF9D4D9C3FE110FB362D789A119EB0422D96E1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: 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]); Tue, 26 Sep 2023 08:47:06 -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..91c4b208973c 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("pxa-gpio", SPITZ_GPIO_LED_ORANGE, "led_orange", + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("pxa-gpio", SPITZ_GPIO_LED_GREEN, "led_green", + 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(&spitz_led_device.dev, + "led_orange", GPIOD_ASIS); + spitz_gpio_leds[1].gpiod = gpiod_get(&spitz_led_device.dev, + "led_green", GPIOD_ASIS); platform_device_register(&spitz_led_device); } #else -- 2.42.0