Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp829107rdb; Sun, 1 Oct 2023 07:16:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYoJGSN9qn2TSS2is7dPtqG/aTkGNz6X0KTDHOqrLcyBWdgqfMCmZOtIHg+wzcj+AuRbSl X-Received: by 2002:a05:6808:4d6:b0:3ae:84b6:1f6c with SMTP id a22-20020a05680804d600b003ae84b61f6cmr9158377oie.52.1696169799232; Sun, 01 Oct 2023 07:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696169799; cv=none; d=google.com; s=arc-20160816; b=j7JgoX+gQ54ZRGu2GvgFt3SKN+G+yAEyALWwbT3/5xjW7EnoTKHsB7csBcyAjO6niu cqdfqzc3MjacPxyXUGuE8lQBWiBFZxzze6Tl1uC4VC015Uh1Civ3MrSBtW4bWJFKlog1 SwG760Vpk5oAcPkt3OkakH+jPKHqmElUoF9cIaJgyPpiboAfxRNPlB7srNNBdn7NqxTB Q39p9n4xN1YpAAf/ieqpVTKQn24bMU+Wj1jwMnPZU0Iljl3tlEkXoBjnYFLmTP7uA0mk Wz4mMyJrgC6elMOVGQBw/Kdwpov9YrwnohhCQ7gOUkQQQdCrVjCbb4co23+iEYO/Y7Cn Cb+A== 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=rAD+g8mOt0h2o5zKcanFlKtYbN+oIyLlIriuABt6+8E=; fh=H4D8raVEE9ToK4xcGS9/Pnvmhs2QUzCYuQTuaKubzik=; b=p6oRuLiWkb/jykZs4PAr1tWwY+25Q8hPnO6jihfl5DSTLUFxSFGrSGxWCh3xnz5pm8 QIsnVfas/HbO+ZT2P7OxtAs50lw92ToN/424eRHuXWpfmlNUDCzv6iso3GKYA/TWY1Zv YIVM5QRy5jqJdqdrHG9jekv4I13GN4aHSdE85tWCBq7eqtn0DAOg+esqiPpO22y3iCKy eH5noa5vTaeM41HEUS/CRfqueWaO0DC5XWf5r6c8hit0fDrfEmTPs/AOqwHEh9UfGBAa ZMcmBvvx2J9o1YLg0ZBMZGk5kq3cDY1JYjHJi46kZZCDkbEim1mwNPsNgNRhw+KVKppr KnDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v10-20020a17090abb8a00b002743618d4bcsi5777069pjr.101.2023.10.01.07.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 07:16:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 3B43C80B12CE; Sun, 1 Oct 2023 07:13:27 -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 S235078AbjJAONI (ORCPT + 99 others); Sun, 1 Oct 2023 10:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235026AbjJAONG (ORCPT ); Sun, 1 Oct 2023 10:13:06 -0400 Received: from mx.skole.hr (mx1.hosting.skole.hr [161.53.165.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C44AFAB; Sun, 1 Oct 2023 07:13:03 -0700 (PDT) Received: from mx1.hosting.skole.hr (localhost.localdomain [127.0.0.1]) by mx.skole.hr (mx.skole.hr) with ESMTP id 5D829820F6; Sun, 1 Oct 2023 16:13:02 +0200 (CEST) From: =?utf-8?q?Duje_Mihanovi=C4=87?= Date: Sun, 01 Oct 2023 16:12:53 +0200 Subject: [PATCH RFC v4 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: <20231001-pxa-gpio-v4-2-0f3b975e6ed5@skole.hr> References: <20231001-pxa-gpio-v4-0-0f3b975e6ed5@skole.hr> In-Reply-To: <20231001-pxa-gpio-v4-0-0f3b975e6ed5@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=1816; i=duje.mihanovic@skole.hr; h=from:subject:message-id; bh=Kq4sitRUky6xb8wL9sBaMZGXvKR+7tYT75wjzOs1EKA=; b=owEBbQKS/ZANAwAIAZoRnrBCLZbhAcsmYgBlGX5oiTaZUpJDP7w5L7beBppkIPioNnA8+i8f/ 4vGwGpa92SJAjMEAAEIAB0WIQRT351NnD/hEPs2LXiaEZ6wQi2W4QUCZRl+aAAKCRCaEZ6wQi2W 4a3ID/9kD0IUxsNMJ0Kgzqs2+ecS+vsRfinQKLHtN09655zhXWVN9oGjz+yP46mVg5jX91D+uKN QkkD/scdTUAaVgsCKI01u6iKCfaZnzSUSJXcNkk0pSwwfwrtRP0LQxtdhJIoRDrXHL9Gn1NY3Dj Li2/9Hzonh+jdTrjFmoX/UmUIiEegu5ll7jDF60T1CwnQ8bDZn4Ulh1MptAymAhrbFD2wV0qsiu kcFP0SsgmqqxJ4Lde6pK32w5mjMgpgiLz/ayGUl0RBhhz3W1Pfeqif0tyLJsP0LTJMPKsEpPMUr L9lTRfHlL1t9krEVMB9YG9XWO3ZK+qAaVxMzFcdUqjgr0ihj5Nm10bg5vua/M+Ipvwf3x2t14qG rUOdQmp3Yc2TwCS2cTmrxsSY/EmScxUNKdlv62VSyids0AeWnYNyyXtuLX70TA1sRf7olJy8ZQz 9PG6hTSvqi4dnHIRnFhrUnGP1xcRuzzVvZ2xyWqskxy8Gpp5RXDOgULDTwZw69GOt3zXmiVqWQB qXC4h1XjT7fRatDR3J6UGAe4O1N4YD+usOx6TdFroler7JY0Lkp7RzzoyPttwmHc/Me+oVqKVHy KW1Azyyv0tUWmKkqxAwEN8O+HF4FCJQKj4JS5EXwwbAIygnsBJEY4KfrUK13FcEyciYOsskWcPU F+X4YO720TTYgDg== 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]); Sun, 01 Oct 2023 07:13:27 -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..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