From patchwork Tue Apr 30 07:03:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13648365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AF61C25B10 for ; Tue, 30 Apr 2024 07:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Fur6CFDPb9H4Yz5TFx278nE81UdbiGf79zcAWjhXEhM=; b=kHNOa9K+Ww6WF0 sESyUU7KS6uFsMSFPnhJsnXghKNxCXP84JUIZb9bKp3xWxdWgFFo4jh2m4SKMtOPViXQypYbO/UCv v+SfiC80HwDKOCejzZCvjH7sUNxWbbIr/nnKVMorEFyxrpSOuG2RNwNRTzfyNlB/kjWGFmJnH/t7N fkamKUO32gDoNZFcgEI+N4TEDAHi0S8XEsPz7Y/4AJwfHY46HUIUT2bqPa/gayUT9KyGIoaAlvHnN +3fm/qkrHVhXmwYaULxnqKcmNNICrdgtZmUDR7rsNJ+z2T/Ognq27C2gnr9t2Ecm9YS/0jKEL5m7P GDd82IZP64H91jwt8Jrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hX6-00000005N0t-14D6; Tue, 30 Apr 2024 07:04:08 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hWu-00000005MwM-26Pa for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:03:57 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-61500da846fso35726727b3.1 for ; Tue, 30 Apr 2024 00:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714460634; x=1715065434; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=h0ixy7fv19ExAcreEswXg94DycLU86SeU2ojNLlxijk=; b=QtH8bCGMtetFSUMb+v6YtqQlHuamOuxVtMTalN4cq93ugNqiW5Exaxcb5MgrB6wkQu mEWg2wV8l7OmwKpkwpHzD6E0WfBFxrgjMEMV7O8EUsrr2vkDxQ+xof5L8catN59Vf0Rc kQHMA5izb5RwZ7pRKo1HzDK8Uz1ozu7ZFL9xtMv+qNrXbT92W0neJZzw2UAeuZQ/IWbZ cMSDOCB+objRIgQ2ly91BjupH6wMq5GuMK7xYEppT5Tl2MtEhNICgalY4Ubtc/TokIEd UJcpJX70X3ZcA1Qr1RSa4ldl3/+yAdrZ39ZQIQUG3qPrce+GM1j3kcNwrsAuIqUg/B4o 54SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714460634; x=1715065434; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h0ixy7fv19ExAcreEswXg94DycLU86SeU2ojNLlxijk=; b=nUApqs4qq+Z4Vx4B6NBPQdvhefuUtJAHxq+Q3QERb+OOGerTB/YAWr+eFqFnHBkimy hn+KxeNNoghY1Uh2OgqrHJLNsjAIT4nmE0Acv+F0CnwsE55QL10SlOfrmluGY3VuJQgM Q0oMRj8mZZl/XA+Ob6bYPT7/F4mLgmCRe+2V60Lx3gUlmSUVCaqxu3jIVM79vyk6JdU5 TE1LAt37bHRhnGMt75hNCFFTuscNMzryMPZytlfMIn65bcXIyueGbb542k+mglIW3AY3 sMrs9PmCtqL+QLRmIXcE1QgXigCMCVnIzPPIf8PJnAfG4vM8C9QtLsZ1C+4hR6dW9vy7 cOhw== X-Gm-Message-State: AOJu0YzpntcigqxMMHf5Y9biEBdxunUsRIrLHknWAGcCXdkXgCHFd+/M np+6hTnI3YjNVVkp53WP+18PDsNPt2gIh/w6oPQDVF6G2zzIYiq6NGHvsBVRvFM= X-Google-Smtp-Source: AGHT+IFhrTYVyGAxSgGpphlVFdD7358nVt142kj/csynXWwvRVabPFRJKNRP1Kglb24GmrH2zD4MsQ== X-Received: by 2002:a05:690c:e:b0:61a:d2a0:5497 with SMTP id bc14-20020a05690c000e00b0061ad2a05497mr14316415ywb.8.1714460634450; Tue, 30 Apr 2024 00:03:54 -0700 (PDT) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id z11-20020a05622a124b00b00437b4048972sm10610674qtx.18.2024.04.30.00.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 00:03:53 -0700 (PDT) From: Linus Walleij Date: Tue, 30 Apr 2024 09:03:47 +0200 Subject: [PATCH 1/3] ARM: spitz: Convert Spitz board to GPIO descriptors for LEDs MIME-Version: 1.0 Message-Id: <20240430-gpio-leds-miscarm-v1-1-9c94d7711f6c@linaro.org> References: <20240430-gpio-leds-miscarm-v1-0-9c94d7711f6c@linaro.org> In-Reply-To: <20240430-gpio-leds-miscarm-v1-0-9c94d7711f6c@linaro.org> To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-spi@vger.kernel.org, Linus Walleij X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_000356_574541_EEEF5BDD X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This makes the LEDs on the PXA Spitz board use GPIO descriptors instead of hardcoded GPIOs from the global numberspace. Signed-off-by: Linus Walleij --- arch/arm/mach-pxa/spitz.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index cc691b199429..36aec5ea7218 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -456,12 +456,21 @@ 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, + }, +}; + +static struct gpiod_lookup_table spitz_gpio_leds_table = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LED_ORANGE, NULL, + 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LED_GREEN, NULL, + 1, GPIO_ACTIVE_HIGH), + { }, }, }; @@ -480,6 +489,7 @@ static struct platform_device spitz_led_device = { static void __init spitz_leds_init(void) { + gpiod_add_lookup_table(&spitz_gpio_leds_table); platform_device_register(&spitz_led_device); } #else