From patchwork Wed Jan 11 13:22:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13096672 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 F1BA5C46467 for ; Wed, 11 Jan 2023 13:23:14 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Dc8a7hjtB9i7k5zPEb6oROexuFlsd+kbqyTqYm6w2YY=; b=HgQvYKR+SSCkZz dMosC5mTJdx+28BpL9yCCI6hysaZ+A/2ygL5lp1euWZ88SIYTO9yt81F27nNzww2xJ9rG9/n/DM2H WCQRG4D+t4tgPTeE9VzIdkv1y28fBRm5CX3FIkBVoWlBTtEGn6dqQuMgIgPBwnOttPFpN4zdPUalZ T16UVbf9Vgg2OyRb2vjo8ufZC+1vStXREbTRv4Hczy+Urs+vwmtdFzA05SjhDMWmjYMRp0lOEdPkM IKaLT5nTMgQI+rUzD4C2RvjBrjuVm6m3Kj85uyKZ8joInBU7EiLa7bHhPhmAO/ZqoGngLZjx4Jtfp PAhPwivxljIBghYbwvtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFb3e-00BWPV-AM; Wed, 11 Jan 2023 13:22:22 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFb3Y-00BWMr-PR for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2023 13:22:19 +0000 Received: by mail-lj1-x22a.google.com with SMTP id x37so15996555ljq.1 for ; Wed, 11 Jan 2023 05:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=441mvFLohqxOuYmmdP8E+VY0LDXePT3i/GiYn1UFXPs=; b=BSgt/eyuXFtObCcbqqRzpZxA/3ZMZeOXLsuv82PTiZ7eW1R/wmBYpAGmToAepKqlUz tD0W21MteRm7V9LzwD7C4wiZTnFXSF1X/pAUDSGdXHluVitM4rPhwRNqrYIxZI8iVXPe 1HfR5ytvlY7lP2r9Uo23z7pcxa5nj7Lq9s9O0DWOzncu3e2AkeYbIEdWEoPd33Qlis5m o13OIxY8Eyd1iR9cG1Ge6ygmtv4sN6j1d4mx8h0DUAtg5VVRKpnJq6CmUjr6K9IhgBYM e2Sl2+U83/KRlLmO0FdRYy3yVdFvKXQWNG3/FaeTaBOkoFTwFD799EcShdtOn9yj2tzE GX1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=441mvFLohqxOuYmmdP8E+VY0LDXePT3i/GiYn1UFXPs=; b=4gySORIm4DPYfYglbwEifZeIOp2idsvyJA1SQ5BnCIBolDWz0x00B92TNt33f5z717 UvrbggoLT+FjrUzfPzWNwazH9+HmW3dCvDImSkEvREEIru9Qk65jIdOQldpsJakiYgi6 1u3Ss71CqQllhZQD1EpxW4rm8eQYa3S3Eji5fkTCWpzLAi4408d5HRy1mDoDFApQFnXj 4k02eBUfm0W3gaioh/BrUNJp/xliUC9j/uagA4zPn30wGApuPAsHwYCAajoub0qvvtNP lc8HSUGr8k2h5Vhic64WvE5SreDhT/EXVmJf/WxgCddInAI5YxEmc/ffKjRLwMM1bmn7 aysQ== X-Gm-Message-State: AFqh2kqB5FtHinJmsigtvRnlqCCESSokMENykFMtGjLxU/1A+FDG4Sda 9g9u8Pis8qp+9spCfPvKHlowHQ== X-Google-Smtp-Source: AMrXdXuo3dYnKUctk03bL1xgUnZsSzLlulfB93CvttVRFeynVrAJ96k8feGjDXqg2a11XLRvmtWDMg== X-Received: by 2002:a2e:be06:0:b0:26f:db35:d205 with SMTP id z6-20020a2ebe06000000b0026fdb35d205mr25481400ljq.17.1673443333765; Wed, 11 Jan 2023 05:22:13 -0800 (PST) Received: from fedora.. ([85.235.10.72]) by smtp.gmail.com with ESMTPSA id f21-20020a2e6a15000000b00284126dbea2sm1353545ljc.55.2023.01.11.05.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 05:22:13 -0800 (PST) From: Linus Walleij To: arm@kernel.org, soc@kernel.org Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , Nikita Shubin , Alexander Sverdlin , Hartley Sweeten , Lukasz Majewski Subject: [PATCH] ARM: ep93xx: Convert to use descriptors for GPIO LEDs Date: Wed, 11 Jan 2023 14:22:10 +0100 Message-Id: <20230111132210.134478-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230111_052216_868701_94CC5CE8 X-CRM114-Status: GOOD ( 15.07 ) 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 converts the EP93xx to use GPIO descriptors for the LEDs. Cc: Nikita Shubin Cc: Alexander Sverdlin Cc: Hartley Sweeten Cc: Lukasz Majewski Tested-by: Alexander Sverdlin Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Rebased on v6.2-rc1 - SoC folks: please apply this patch directly for suitable branch. ChangeLog v2->v3: - Collected Alexander's Tested-by ChangeLog v1->v2: - Fix syntax error (doubled left parens) --- arch/arm/mach-ep93xx/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 95e731676cea..71b113976420 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -426,10 +426,8 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info, static const struct gpio_led ep93xx_led_pins[] __initconst = { { .name = "platform:grled", - .gpio = EP93XX_GPIO_LINE_GRLED, }, { .name = "platform:rdled", - .gpio = EP93XX_GPIO_LINE_RDLED, }, }; @@ -438,6 +436,16 @@ static const struct gpio_led_platform_data ep93xx_led_data __initconst = { .leds = ep93xx_led_pins, }; +static struct gpiod_lookup_table ep93xx_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* Use local offsets on gpiochip/port "E" */ + GPIO_LOOKUP_IDX("E", 0, NULL, 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("E", 1, NULL, 1, GPIO_ACTIVE_HIGH), + { } + }, +}; + /************************************************************************* * EP93xx pwm peripheral handling *************************************************************************/ @@ -990,6 +998,7 @@ struct device __init *ep93xx_init_devices(void) platform_device_register(&ep93xx_ohci_device); platform_device_register(&ep93xx_wdt_device); + gpiod_add_lookup_table(&ep93xx_leds_gpio_table); gpio_led_register_device(-1, &ep93xx_led_data); return parent;