Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp754870rdh; Sun, 24 Sep 2023 10:12:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFME1adtHRzcanMfiLMotWHOr0PTD7Xb243neRS7XSbn7XLv65n0vllr7UJbdAqjjSkHIX1 X-Received: by 2002:a05:6808:1312:b0:3ae:296e:cfb3 with SMTP id y18-20020a056808131200b003ae296ecfb3mr7593967oiv.5.1695575531791; Sun, 24 Sep 2023 10:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695575531; cv=none; d=google.com; s=arc-20160816; b=I6EPBMmI4ihhsCgcZ5nmysXLyTLvTDau5pW7r+1fhIPCAYEAv47ENkxksGfFclLkke tab9QNOvt7gWGyjFrARiIumTi4oqc94OMFE3k6VC1cCnENs0Sd0eIlm7HsqhSpD8T4UQ KBtkRb+JClga9foc5+7+m5Uy0HOgUhW9Rkqxf+dBXDMZe75uKtUT2m4Vl3EoHjA4l4Cs WKTrfiygwgZ1GBoTeGLCTiF3rZURob4zMxDHoPDoVJG50/bgtnver2r21cFuLEQmBpkw U55hohgh7pKWadlzUUl1IJEx/nY9cbkaX4xrfW+RaphxfHazV6MX3qoWJlLUPcGF7fnY DZ9g== 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=m7dt2BguCDQz7uBU0+GODYi/qIG1B3UkTQE+tdwk9Sl55caBAS9gnovGR3MGNLF7h0 a+DsaNpp2mGdzC8RHo/iIGZJAqsqbbTF9Olftx24WkDhaY0d2n65JdTCpSgYs/4pMEfi Izfl2bHK+91eulBCQLt4pFiyQasKyTOWSzsp+K0WtmMjcIPDUEiKINAKxjURWxmKnNad VRvlJ6a6hBKDSbNXpCjq+hGuqNAm7I/yQQnZLLxhXyEvvSSrblO+KnbDOrPWGP15m6WV YUwg/gKfU73FIUNh3s+WpkOIzMQm+w8+0lzLjlsdTuKp3q/uWIV48nWv3d98F5jgsMch vPWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id my18-20020a17090b4c9200b00274274bf0ecsi9156216pjb.61.2023.09.24.10.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 10:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id DBB29802376A; Sun, 24 Sep 2023 10:11:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbjIXRLp (ORCPT + 99 others); Sun, 24 Sep 2023 13:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbjIXRLi (ORCPT ); Sun, 24 Sep 2023 13:11:38 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B05FE for ; Sun, 24 Sep 2023 10:11:30 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 9ED6481FF1; Sun, 24 Sep 2023 19:11:28 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Sun, 24 Sep 2023 18:42:55 +0200 Subject: [PATCH RFC 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: <20230924-pxa-gpio-v1-2-2805b87d8894@skole.hr> References: <20230924-pxa-gpio-v1-0-2805b87d8894@skole.hr> In-Reply-To: <20230924-pxa-gpio-v1-0-2805b87d8894@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/ZANAwAIAZoRnrBCLZbhAcsmYgBlEG274zYOOseY07wrIpLw55JpPY81b1O+DhHDw c1vQQZ2XxSJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZRBtuwAKCRCaEZ6wQi2W 4TqnD/4uQ6H9fKBhLDhKBRQmqOzNMF4vOaBCehGJ48w/HQ7SfRvR3zHESYgomDYWFePuKZ3gXlT Q7GErR6GxXh4Elgj4CqfwXfxS8mbYTfDagbLfH9zbfMIMN2Idz6GABC3NvPx3ikHb1F22tx+Cnd tek2dvcJAGVkWIFm983EQbkoFvgVrv5Qnf5ZdOPWLx7sinqxDLuVAzKxiY1nnOQNlgrECI+OEbm sqIOTGDa5VEu1/VzR7P8QcnzOz66Tu7+WU5iGgBHpeBXIKq/vMT9UCIerfMOadQMRUs1kjRrVOU NRV+DlpabQB+BXEN6+3a5AGHf9u87eevHHcNGDvUnOtf69mSg/pY+c+LtT2IPJfBjHBNPmWbfat LaasG70IQ+84KcMaTo0YGouUTutjCIvEn5Na/JewpnceClczrDLJtVk22jzDIrzVdQHKQL2f0t0 AfyGggn27642yT943m+oLOCoSAxbAFhxV1+o532IS/Wktb01NpdrC4T3+3EhwAYOBMbFAy5K91P TOI5waIYQyOFnYBEyFrjL+51Ins5LjZz2VrPlsalW6+Ace1OLZ2kV/o9MiEXzeuP1EuFAicVPsS Ylt23QHqnv2Xyjj/XEMzWt1DrkXLIKUXnteuH96bBXwHRsvxXruvJgv5z/3RTt2+zavpIVsmnch eCX3yZVlysu31Gw== 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 pete.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 (pete.vger.email [0.0.0.0]); Sun, 24 Sep 2023 10:11:54 -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