From patchwork Tue Nov 24 08:53:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11927451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9583FC2D0E4 for ; Tue, 24 Nov 2020 08:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B9E82076B for ; Tue, 24 Nov 2020 08:53:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rOzJh8nP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730850AbgKXIxt (ORCPT ); Tue, 24 Nov 2020 03:53:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730822AbgKXIxt (ORCPT ); Tue, 24 Nov 2020 03:53:49 -0500 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6CEEC0613D6 for ; Tue, 24 Nov 2020 00:53:48 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id d20so11868323lfe.11 for ; Tue, 24 Nov 2020 00:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I2EmMJdusVtGBiOPmuBxSa/yxYa7w9wcih2XFbyqoVY=; b=rOzJh8nPd2bJlYYIp0tDoZzNyjPr5hO/eDo/Gh+AvBKrZrzR+183SDLWaAk0dJ7hFo 1XXVL6v2oqETnYO5PN08RGGTgBuO62/uhT5dul1SzQyaLnhG5AsbPr39C0BFzdtZVjZU 9BlFgQnPDjog6o3bsOyDz1jCv7tVFXBo6rH1r8DCcQpJ/U3C21DApr5nFtb5b4M8Gc2b dpgkzBgud5+0VcsQGQet0gxaydahKPy8LaKi+2Xe8yagBokZZGv3RCBdHInvPxvF2z1b 62aWqiOofiyEpQ/mjm6RKZ4gjDe7KzVNLYKPOUAmSVp/v89TFY3z1M90E0s3+4Gymvyw SvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I2EmMJdusVtGBiOPmuBxSa/yxYa7w9wcih2XFbyqoVY=; b=NtrhA9bVLmzzEYmZiBIUV6FvCzgEbPgGOjdM/mzuhltxj3HnHEV6r0uAebGcklgjM2 yPRoSpj1RHZ20/fZLu5Mb8+w091pxt+pmWCSKOgAcbqjaSVPiMFnaPY54IDT1F42LUu2 MOlyMRGzSCBazINsdbnBO6e+vEFbb5Dow0KgJP2BCjRWG97iwuOMBW3PnmSVOTPeaHvs Md4YPpglkFZC5i27nxlO4/Gmfq4SANC9lSOSDt/vIKU4P9pkctTGxzOZxBm70UoBpvjp sl1VwE2wJFs6pl4lS/+6dp33qjkAHuFPdBRfMzw1dMHuUTlK/BIkGgGo9E17UgSBjVsU M5gA== X-Gm-Message-State: AOAM530iwfl+EFHKEs3zyVfjx6GvkymX65ci2igsz5+SmW+Ib0HedV9n nBIAS3d2IQGCywWSpVoUiFlWR3SFULYeLQMH X-Google-Smtp-Source: ABdhPJxN36mZJwr2I4WhAVdmjPjYGdiZL3k+HSgPk49TyYEn2UM6QXQuYjWmX1ZrN+G7vHLl2JGrrQ== X-Received: by 2002:a19:6914:: with SMTP id e20mr1171533lfc.506.1606208027340; Tue, 24 Nov 2020 00:53:47 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u18sm746602lfq.145.2020.11.24.00.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 00:53:46 -0800 (PST) From: Linus Walleij To: Hans de Goede , Mark Gross Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, Andres Salomon , linux-geode@lists.infradead.org, Darren Hart , x86@kernel.org, Andy Shevchenko Subject: [PATCH 1/3 v4] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Date: Tue, 24 Nov 2020 09:53:37 +0100 Message-Id: <20201124085339.6181-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org This makes the machine look up the LED from a GPIO machine descriptor table. The Geode LEDs should be on the CS5535 companion chip. Cc: linux-gpio@vger.kernel.org Cc: Andres Salomon Cc: linux-geode@lists.infradead.org Cc: Darren Hart Cc: platform-driver-x86@vger.kernel.org Cc: x86@kernel.org Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Cc x86@kernel.org - Collect Hans' Review tag. ChangeLog v2->v3: - Rebase on v5.10-rc1 - Resend ChangeLog v1->v2: - Drop excess comma after terminator { } - Collect Andy's Reviewed-by --- arch/x86/platform/geode/net5501.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c index 163e1b545517..558384acd777 100644 --- a/arch/x86/platform/geode/net5501.c +++ b/arch/x86/platform/geode/net5501.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -55,9 +56,7 @@ static struct platform_device net5501_buttons_dev = { static struct gpio_led net5501_leds[] = { { .name = "net5501:1", - .gpio = 6, .default_trigger = "default-on", - .active_low = 0, }, }; @@ -66,6 +65,15 @@ static struct gpio_led_platform_data net5501_leds_data = { .leds = net5501_leds, }; +static struct gpiod_lookup_table net5501_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* The Geode GPIOs should be on the CS5535 companion chip */ + GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_HIGH), + { } + }, +}; + static struct platform_device net5501_leds_dev = { .name = "leds-gpio", .id = -1, @@ -80,6 +88,7 @@ static struct platform_device *net5501_devs[] __initdata = { static void __init register_net5501(void) { /* Setup LED control through leds-gpio driver */ + gpiod_add_lookup_table(&net5501_leds_gpio_table); platform_add_devices(net5501_devs, ARRAY_SIZE(net5501_devs)); } From patchwork Tue Nov 24 08:53:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11927453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB3EFC2D0E4 for ; Tue, 24 Nov 2020 08:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DACA2073C for ; Tue, 24 Nov 2020 08:53:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ML1KH1Nq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730910AbgKXIxw (ORCPT ); Tue, 24 Nov 2020 03:53:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbgKXIxv (ORCPT ); Tue, 24 Nov 2020 03:53:51 -0500 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BE3C0613CF for ; Tue, 24 Nov 2020 00:53:51 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id r24so11615799lfm.8 for ; Tue, 24 Nov 2020 00:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DeDKS22xxFRIc+6wUo2VF8v+jvsdd+gENbNOUYHzsn4=; b=ML1KH1Nqxbw1laEF6QOiRvnmnv5UV6BFToUc5zCa27vKNcvtgkJGo2WdNfKp77dxMr eruq3rz7K0z28AxgnLp9goEw7T8DkwctJvqD71gWc/+TjheBUj7G4UxhCLPWAtsMNBLO JWbH+bETiUFo/4mlgVMGHokgwjLh6BeyJw1Eq6dnT26aovo2TBv0xtFSZDR2F77x02NB +PFp9fHufg/ckI19XCOySwxT6pV7hGbitk97+La1VghwjRLrqI88fm8uK/n9NWq8w5vt 7r6T5fiKz1OYQ7YvxNdnTc+YIFj6Q015tnayETqLVrsHeBPXH6muvu52Kpipk9z32NFB h6+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DeDKS22xxFRIc+6wUo2VF8v+jvsdd+gENbNOUYHzsn4=; b=fdOm9RUT4FOSCwYU0KCIxQUyVr2CfFmw40bgPoxH2zkwLRTWygtQ5tk7z2sN5KhzAi MmxtMOM7NKjkiiHErFYPw53q6dxb7dgPuCmFnHW0jlWnE2wgv5PEPnS6Rrmt9KqXRgbN +sMfjsByJqUkrbTh6bhZN+nL/xIlASQ3+n7TvKCSRp2vpY5tnTrFS0ESZx27HyuvKoTj xpGX5W5bN0NKpZii9XRPSerzB3zRGz6oO4g2xKFJB9GEv0jPEoz4NYvzGdgRQm6siHyQ LfoOMtCpi5pbjRo00djqncSaMk73XqmIbZ/OhE+xbnsNqpc74DD9NP2pnZDmdWa1wkYr E70A== X-Gm-Message-State: AOAM531H/I1VUOrdWAUfiQl9uv2doYaVc98NYlpaahC+k8QBGRuXl0/X 3Bu+EopmWwYPOzaKjz2UH5Tj/g== X-Google-Smtp-Source: ABdhPJzdmcu3bb53zmcrUiO3ci4TLJy74ovaG3WLshcrBVGW/yt2pdGoG/nvZt0vd1MHGE3xmjmTkw== X-Received: by 2002:a19:bec6:: with SMTP id o189mr1588416lff.179.1606208029870; Tue, 24 Nov 2020 00:53:49 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u18sm746602lfq.145.2020.11.24.00.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 00:53:49 -0800 (PST) From: Linus Walleij To: Hans de Goede , Mark Gross Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, linux-geode@lists.infradead.org, Darren Hart , x86@kernel.org, Andy Shevchenko Subject: [PATCH 2/3 v4] x86/platform/geode: Convert geode LED to GPIO machine descriptor Date: Tue, 24 Nov 2020 09:53:38 +0100 Message-Id: <20201124085339.6181-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201124085339.6181-1-linus.walleij@linaro.org> References: <20201124085339.6181-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org This makes the machine look up the LED from a GPIO machine descriptor table. The Geode LEDs should be on the CS5535 companion chip. Cc: linux-gpio@vger.kernel.org Cc: linux-geode@lists.infradead.org Cc: Darren Hart Cc: platform-driver-x86@vger.kernel.org Cc: x86@kernel.org Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Cc x86@kernel.org - Collect Hans' Review tag. ChangeLog v2->v3: - Rebase on v5.10-rc1 - Resend ChangeLog v1->v2: - Drop excess comma after terminator { } - Collect Andy's Reviewed-by --- arch/x86/platform/geode/geos.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c index 73a3f49b4eb6..d263528c90bb 100644 --- a/arch/x86/platform/geode/geos.c +++ b/arch/x86/platform/geode/geos.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -53,21 +54,15 @@ static struct platform_device geos_buttons_dev = { static struct gpio_led geos_leds[] = { { .name = "geos:1", - .gpio = 6, .default_trigger = "default-on", - .active_low = 1, }, { .name = "geos:2", - .gpio = 25, .default_trigger = "default-off", - .active_low = 1, }, { .name = "geos:3", - .gpio = 27, .default_trigger = "default-off", - .active_low = 1, }, }; @@ -76,6 +71,17 @@ static struct gpio_led_platform_data geos_leds_data = { .leds = geos_leds, }; +static struct gpiod_lookup_table geos_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* The Geode GPIOs should be on the CS5535 companion chip */ + GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("cs5535-gpio", 25, NULL, 1, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("cs5535-gpio", 27, NULL, 2, GPIO_ACTIVE_LOW), + { } + }, +}; + static struct platform_device geos_leds_dev = { .name = "leds-gpio", .id = -1, @@ -90,6 +96,7 @@ static struct platform_device *geos_devs[] __initdata = { static void __init register_geos(void) { /* Setup LED control through leds-gpio driver */ + gpiod_add_lookup_table(&geos_leds_gpio_table); platform_add_devices(geos_devs, ARRAY_SIZE(geos_devs)); } From patchwork Tue Nov 24 08:53:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11927455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E84C63777 for ; Tue, 24 Nov 2020 08:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EA862073C for ; Tue, 24 Nov 2020 08:53:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="R0TN2YHa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730822AbgKXIxx (ORCPT ); Tue, 24 Nov 2020 03:53:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbgKXIxx (ORCPT ); Tue, 24 Nov 2020 03:53:53 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FDD3C0613D6 for ; Tue, 24 Nov 2020 00:53:53 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id f24so8235644ljk.13 for ; Tue, 24 Nov 2020 00:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=22n1tuxoc8ewInV62YF8elTpS8+RAb/cOsUr87r7lFc=; b=R0TN2YHa4Lxz1YQXWLIpaBFqn6Tr1js3nrn1b9PnSZFYiM/u9tyBdx9MdKTG6rwkvv OlVS5KC49tTDtrVoJML3lwuD2s3Wrt7tgeC5cKs1JrSLldtcKw4HeXhGFwfRYg/kIo2m D9rZT8rx6BNcRM1HHb12ZvfIIBMnLqyYsoomNOHKnZ+X+CVVlNV0GnMVq8J7x4Lfxz51 ieEJZLU/LDXGpjCVi0//mqek8d7wRtE2kDgwpIjT/G8YLg1yyiidiGIqxpuLAj7zs9ta 5R6r3kuzyCn0Qv0c8+NPVCQAEkYyhaMtKQmVm7UlIrWJXt04g6CknHfbCToXhQcYsYHl 7LlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=22n1tuxoc8ewInV62YF8elTpS8+RAb/cOsUr87r7lFc=; b=EttjMfUWJGZs9wA8AG965ykC9elkxBM0jDOHVAfjtIIBYNM9ysTvM4l2wZFGXEk8j+ pYuo+15b57MweS9cnRv6CIR+GnSgzmKE0QrsXKg6Ua6v9FaXMdOl6UX10bV+MBjOoSMA T4cN6rVbok5E34BLjSaH9vRWzmRt2i5qMljpxoHhGNuKMc9krd7gZ4wVJFNHePbHdX/5 hIu0xjW3IEfqYTG//Fh8xVebn5DTlkgkic/Lxiln7JPy9LHtYpT480VcVCFVtdyfgcxI cpHFu5FLm9zxxP9cwAW1Zwr33w0fePPZVEFES1EZz2TfICNneV4P680LxSRbQBsvUDtP GzbA== X-Gm-Message-State: AOAM533IdyLq21jr0Qi4kKx0vvmPUqbx53r0K/uFB4DF0OeG332fqRML aM4GdCq29v063ze0zj4aQzL9Eg== X-Google-Smtp-Source: ABdhPJyUZog8phaXDENjqXEdZuYfJAoi9Iy4ZWw0t3wuFafy5+Y0jSvb1jAVg/mopQh/ffIq/A02lw== X-Received: by 2002:a05:651c:2118:: with SMTP id a24mr1268879ljq.442.1606208031562; Tue, 24 Nov 2020 00:53:51 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u18sm746602lfq.145.2020.11.24.00.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 00:53:51 -0800 (PST) From: Linus Walleij To: Hans de Goede , Mark Gross Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, linux-geode@lists.infradead.org, Darren Hart , x86@kernel.org, Andy Shevchenko Subject: [PATCH 3/3 v4] x86/platform/geode: Convert alix LED to GPIO machine descriptor Date: Tue, 24 Nov 2020 09:53:39 +0100 Message-Id: <20201124085339.6181-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201124085339.6181-1-linus.walleij@linaro.org> References: <20201124085339.6181-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org This makes the machine look up the LED from a GPIO machine descriptor table. The Geode LEDs should be on the CS5535 companion chip. Cc: linux-gpio@vger.kernel.org Cc: linux-geode@lists.infradead.org Cc: Darren Hart Cc: platform-driver-x86@vger.kernel.org Cc: x86@kernel.org Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Cc x86@kernel.org - Collect Hans' Review tag. ChangeLog v2->v3: - Rebase on v5.10-rc1 - Resend ChangeLog v1->v2: - Drop excess comma after terminator { } - Collect Andy's Reviewed-by --- arch/x86/platform/geode/alix.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/x86/platform/geode/alix.c b/arch/x86/platform/geode/alix.c index c33f744b5388..b39bf3b5e108 100644 --- a/arch/x86/platform/geode/alix.c +++ b/arch/x86/platform/geode/alix.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -69,21 +70,15 @@ static struct platform_device alix_buttons_dev = { static struct gpio_led alix_leds[] = { { .name = "alix:1", - .gpio = 6, .default_trigger = "default-on", - .active_low = 1, }, { .name = "alix:2", - .gpio = 25, .default_trigger = "default-off", - .active_low = 1, }, { .name = "alix:3", - .gpio = 27, .default_trigger = "default-off", - .active_low = 1, }, }; @@ -92,6 +87,17 @@ static struct gpio_led_platform_data alix_leds_data = { .leds = alix_leds, }; +static struct gpiod_lookup_table alix_leds_gpio_table = { + .dev_id = "leds-gpio", + .table = { + /* The Geode GPIOs should be on the CS5535 companion chip */ + GPIO_LOOKUP_IDX("cs5535-gpio", 6, NULL, 0, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("cs5535-gpio", 25, NULL, 1, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("cs5535-gpio", 27, NULL, 2, GPIO_ACTIVE_LOW), + { } + }, +}; + static struct platform_device alix_leds_dev = { .name = "leds-gpio", .id = -1, @@ -106,6 +112,7 @@ static struct platform_device *alix_devs[] __initdata = { static void __init register_alix(void) { /* Setup LED control through leds-gpio driver */ + gpiod_add_lookup_table(&alix_leds_gpio_table); platform_add_devices(alix_devs, ARRAY_SIZE(alix_devs)); }