Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2662582rdb; Wed, 4 Oct 2023 07:57:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9WySbjvI43Ohsgv0fhwx8/LG2ojWx5IkmJjPDq4sfjWKqeO/O59wY9gQ64rwfMluKEH40 X-Received: by 2002:aca:2808:0:b0:3a3:9df9:1918 with SMTP id 8-20020aca2808000000b003a39df91918mr2346116oix.20.1696431437935; Wed, 04 Oct 2023 07:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696431437; cv=none; d=google.com; s=arc-20160816; b=aUKfEfJrpuhcGz3rSy1Zmht9GTfEtexd2S9thymoYlHYwCVmOMtL2GswmQWlYSXOlU yZjBpEpzJ6ktmhz7Vu/h79Yp37hdSnBCNFFg4I7lnF16y3MzRbKqaWplheqLHrvJXqNy 8qYjcbvRkg3wyQXXafQtq/7IsnqH5shXS9lPGS2a6AFCQhUgYItJ1PYKml9pz0GfTzem KZgFgGsS8odtwVCiZzYAS/dSHTqAh2JdHMJuvvIGvbgdFfnkNs7M5Cro3u3KiqzFSUpa Hxb3TXUtkU8xV/RYm05jMemeFNlP/7NXkgcsgtAg8/AySGZr2hgg/b40rdpSnVnC4nbx bjkw== 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=2ajdespr5EcQmbouvIgbLyBl3EbieKEwEQxcdffH85A=; fh=H4D8raVEE9ToK4xcGS9/Pnvmhs2QUzCYuQTuaKubzik=; b=CtNNskw+/FQC+NlHbIztLw+nRegs+iaQrIrzRBeqe4VJRjbluxvE6Zs4FhGcLFjP8U BnFtRc2v9JUFa2QZZn9aSjfKETj9157KVr8pVuIUwa+eVYC8rlf0kszbYXcsIBvy/IN0 eBBsKPZH+GQRhCirqtH3m5JAw9iSjm011I7hl/Xa9X0xu9S9XcYCLogjnJ/CSswQ9dDu ErPAtQq954c+U4P9eIv5YCwR1m+b5KrUe+Dq5ONJ7wYXdjZ3CMDV4c92U3gDSNKoCgvR 7/XMIQjAvuJFZRcPc5kmvSkKDWeNdUP2QuYRTRpTuLQsqnHqb47aaLc2EjX21n+eXRID 49kw== 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:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 37-20020a631465000000b0057c9e0c7bb7si3718098pgu.77.2023.10.04.07.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 5900E836E5CD; Wed, 4 Oct 2023 07:57:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243138AbjJDO5M (ORCPT + 99 others); Wed, 4 Oct 2023 10:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243118AbjJDO4v (ORCPT ); Wed, 4 Oct 2023 10:56:51 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFB3112; Wed, 4 Oct 2023 07:56:46 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 8504C84CA0; Wed, 4 Oct 2023 16:56:44 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Wed, 04 Oct 2023 16:56:26 +0200 Subject: [PATCH RFC v5 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: <20231004-pxa-gpio-v5-2-d99ae6fceea8@skole.hr> References: <20231004-pxa-gpio-v5-0-d99ae6fceea8@skole.hr> In-Reply-To: <20231004-pxa-gpio-v5-0-d99ae6fceea8@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_Mihanovi=C4=87?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1871; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=DE2PEskLXScJBG6OV6aN0l1pySPm6nNQ06il8QEoR7s=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlHX0kALPHlN4oJn6kZo3KSvCEzLz38DVYdz/Ba cdGlUtMoGCJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZR19JAAKCRCaEZ6wQi2W 4WtUEACCiGTLN1AbQqVrfDK7Y56hTkXDQVt4zLo7s/AxU5qOIFFW9Rk9uL1rx6av9foW4enZRUC /AN2ZqEM2pS9l3ZIHH2CmIJD7i68hB1oW/W2C++qIoTQfreneKfudMBMH4Km9wYhTZDjIPbJ9I6 pe/osql79J6vMKdOcReaQ3ZxMOUxtyTYNZMdRuwSmk7ZeNiJP1VssDlANf2N1LYg+caJ3NwB+cp NVsFa5ma1n/Z3jaFyBSxcAFXmdc0zn/QjRUxpCyYToikVRPax3QXd1aMdlJEKFtGeg82P/EqmU6 WO+tKEqsdlLc+QsEyr1/qhkGWKmIHh63sNuSeke62Huofiier20EVS8GWa68VvqW79zJ9+xlLrn OAN37lpWzMIGw6C1z75RJUM82VXYe6ab/wP4i88mtebKkdlJIKungAtsUIAzXXtpU15Jd5y2VLB 0tAt0aUgFfXEVO8a/W0XTcerFNpR32EQCFz32uT6k6gUkrYSm5FM5Dbpg2NqzOzBcKO7bUnzYA5 og84IkURN4x910DHcL8P2gdaCYf4XEVyjYO8dVHkLCGp4elHUlMUlzB+tNUHTZZs9lGNmVGAdFz IamCDlLQBCwmjSizLCo77nnqiipo+DSAzwSs/TqLfhd032qT6lzX7uPandRdFfz/nGHmVmB2dqV O74X1KQos5QWDzw== 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 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:57:16 -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. Reviewed-by: Linus Walleij 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..b6a4085e9fb0 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,7 +489,12 @@ 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); + 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); } #else static inline void spitz_leds_init(void) {} -- 2.42.0