From patchwork Tue Apr 23 13:54:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13640133 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 9610EC04FFE for ; Tue, 23 Apr 2024 13:54:49 +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=jDFZ1RNUus0Ek70toimpmBlln6JecOtyogYQvwKl2kU=; b=Be04BtFhsDRQ/U 8VInEFe7ALJJ51x+K3TgnaCPrHQCb4BpvhV17VFY+RU3OGJatj2sBNbI4BQBvasuuzeApWRVF2Zr6 aiXo15d73jV7U0ouevWTBpCzEBl+7p096TuZztDYSlrIuw/MFecrPsl3YqrvJqrp3H43nnCVo8FHE ACkC+8DiPZxszn7bmqTQEb+sDswoRaSClhNBsJ23fYsIaI1SF/WtMraTTHrGvopraHSGPjkb0FrbS 5hoi8zS/9U1asEfydeOtAjn6yMUtm9BsGjJHIonHbSHlLaL8cOTZ8omyrw8FwrF0ot/Wz7ngnmwC/ byEQsxLo35PvilzoZkeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzGbT-00000000AnC-04DL; Tue, 23 Apr 2024 13:54:35 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzGaz-00000000AbI-1dlr for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2024 13:54:06 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-518a3e0d2ecso8550006e87.3 for ; Tue, 23 Apr 2024 06:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713880442; x=1714485242; 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=wEjTI295LgCVV5ERwS4DZP1yxmv81nEiKm3GiKi945M=; b=o3TkgYCH7/FI9c5OK8FPao0EvFq2CgLsxscA+74sfpsZe5Kvs6rY8/++z4PMqBLCGv ksRdH7P0p6kS2GdLRVxdCiBhQFrrnq+QAobdpTrwyCTO7X5ID/nnR4CqptHKJse7wCwe w2XNjaamZ/+A2LotK8bpl76s6qI99scamtUbhlhPi8vfQoSse2Gbno8ogkrJUgA3xjhO aRMlmPkQhFx22gmhLTvGAdsBh4/LJTqcOlmx8rtfoM1Tdi5RrEJlaH5owJ5hcp6ih5nv EKBrIfSqrzj1pU44kL0cG5UItYKGXeghJkhwRbbJUJqO0JmDEUgCLu1qSYw8QJTxgxjl GPWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713880442; x=1714485242; 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=wEjTI295LgCVV5ERwS4DZP1yxmv81nEiKm3GiKi945M=; b=JJDM5WzfJQFo/fETjamvT47ZJfyyPNBHm+4q98deVKxt1you6DNQ87VYXBL86C7zYb dnfO2rhu6HOa8g+n1srTS0k1WZEbKH3yMU5s36GrkoVw3FqnXu1ilDx+QxM+aWJ1wdyG 8WJUo2U1cwL6bBqxD/so0R2o5C4V6v+FWntDwjtv2uX/QCCQE4a5WLUhF/Ev3XzK6Rxf 6ME6S4ZeFANgHXPoV8h8UDi7qIN5xTyuRcJaoH4tS7P9XieUUEEC0r05sWDLDZOF1VbC KCP48dNE22pBeL0ltXQqui3w+e3aJ8oEB+i8NBdPTc+aNhqlymFO/vK+mQYu+CoAl7DA LlYA== X-Gm-Message-State: AOJu0YxzZ+kqSPgKaAuTOJ3dtbhlnewtM1lgo70Lz9BTlPC8lXuJ1ZF+ 71yiPkmTZESiOxDPpfs8sKJbAie+xDk3OMivpbeoE1ryGD9yWZaaWtTGmUqvUk5M4eAGvVgB66c 5 X-Google-Smtp-Source: AGHT+IH1+21GmNgWo02XyqGVWT6stfzMs6P+xDchhUAi6mGeLDA4OOkHSmQk2cCYv1GfQn1MhOL7Aw== X-Received: by 2002:ac2:4bd0:0:b0:516:9f03:6a92 with SMTP id o16-20020ac24bd0000000b005169f036a92mr13267766lfq.43.1713880442576; Tue, 23 Apr 2024 06:54:02 -0700 (PDT) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id b18-20020ac24112000000b0051a61f2d251sm1875997lfi.290.2024.04.23.06.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 06:54:02 -0700 (PDT) From: Linus Walleij Date: Tue, 23 Apr 2024 15:54:00 +0200 Subject: [PATCH 4/5] ARM: orion5x: Convert Net2big board to GPIO descriptors for LEDs MIME-Version: 1.0 Message-Id: <20240423-gpio-leds-v1-4-799c2f6bc61c@linaro.org> References: <20240423-gpio-leds-v1-0-799c2f6bc61c@linaro.org> In-Reply-To: <20240423-gpio-leds-v1-0-799c2f6bc61c@linaro.org> To: Andrew Lunn , Sebastian Hesselbarth , Gregory Clement Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@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-20240423_065405_592563_C64BCC2D X-CRM114-Status: GOOD ( 13.81 ) 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 Net2big Orion5x board use GPIO descriptors instead of hardcoded GPIOs from the global numberspace. Signed-off-by: Linus Walleij --- arch/arm/mach-orion5x/net2big-setup.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c index 695cc683cd83..6ad9740b426b 100644 --- a/arch/arm/mach-orion5x/net2big-setup.c +++ b/arch/arm/mach-orion5x/net2big-setup.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -214,19 +215,30 @@ static void __init net2big_sata_power_init(void) static struct gpio_led net2big_leds[] = { { .name = "net2big:red:power", - .gpio = NET2BIG_GPIO_PWR_RED_LED, }, { .name = "net2big:blue:power", - .gpio = NET2BIG_GPIO_PWR_BLUE_LED, }, { .name = "net2big:red:sata0", - .gpio = NET2BIG_GPIO_SATA0_RED_LED, }, { .name = "net2big:red:sata1", - .gpio = NET2BIG_GPIO_SATA1_RED_LED, + }, +}; + +static struct gpiod_lookup_table net2big_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_RED_LED, NULL, + 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_BLUE_LED, NULL, + 1, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA0_RED_LED, NULL, + 2, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA1_RED_LED, NULL, + 3, GPIO_ACTIVE_HIGH), + { }, }, }; @@ -282,6 +294,7 @@ static void __init net2big_gpio_leds_init(void) if (err) pr_err("net2big: failed to setup SATA1 blue LED GPIO\n"); + gpiod_add_lookup_table(&net2big_leds_gpio_table); platform_device_register(&net2big_gpio_leds); }