From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.9 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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED 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 8C04AC433E9 for ; Fri, 15 Jan 2021 18:04:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50DE2235F8 for ; Fri, 15 Jan 2021 18:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728975AbhAOSEN (ORCPT ); Fri, 15 Jan 2021 13:04:13 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:40674 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbhAOSEM (ORCPT ); Fri, 15 Jan 2021 13:04:12 -0500 Date: Fri, 15 Jan 2021 18:03:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1610733810; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4BPOc4S2sdSSWBpTWKb2Ju5xAfxfSnO2Ne2If1bszU=; b=mAUd+HR0k0RZrme1tjkSgTfgvUm428T1IHOQkCVBFftILzfVsJ1VZnVR8HVYX0zwJBSj8b /5QU1uEw3CDS+YHI+piO6oqG0lcwVUSqUy+dvgrnybIetaXDqn8ja2N7AaLnoscgBTT8pQ 0+wIAm2QNmcRiT0Nydv1IIHnKGPTy1wi8K7ZQWH76DyHUawOmjgxt9b4jsnIzXn8LefhOJ Jwn2cxvilwCJvogaIPh45uskAF720Wy8AkBU68l9oLOKg3OrNyDOhtyNDX0bG1ExhrRW2D D4OzJwhfs+eKCDcCzYyWdt0eY1b8HWh12hSt70WlpoaI4KBJfyT/owgoWaAZSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1610733810; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4BPOc4S2sdSSWBpTWKb2Ju5xAfxfSnO2Ne2If1bszU=; b=vJef5Vp/EjekYMZ4UGoSiv7dFKIjmfAa1jG1r5cuYNHcXym+6On5R0b+slQi+kuLMbDpbp E/wlvl01+zaqCoAg== From: "tip-bot2 for Linus Walleij" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/platform/geode: Convert alix LED to GPIO machine descriptor Cc: Linus Walleij , Borislav Petkov , Hans de Goede , Andy Shevchenko , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201124085339.6181-3-linus.walleij@linaro.org> References: <20201124085339.6181-3-linus.walleij@linaro.org> MIME-Version: 1.0 Message-ID: <161073380900.414.10975437601520958385.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/platform branch of tip: Commit-ID: 604303018221d00b58422e1d117ba29ce84295cb Gitweb: https://git.kernel.org/tip/604303018221d00b58422e1d117ba29ce84295cb Author: Linus Walleij AuthorDate: Tue, 24 Nov 2020 09:53:39 +01:00 Committer: Borislav Petkov CommitterDate: Fri, 15 Jan 2021 18:55:53 +01:00 x86/platform/geode: Convert alix LED to GPIO machine descriptor Look up the LED from a GPIO machine descriptor table. The Geode LEDs should be on the CS5535 companion chip. Signed-off-by: Linus Walleij Signed-off-by: Borislav Petkov Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lkml.kernel.org/r/20201124085339.6181-3-linus.walleij@linaro.org --- 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 c33f744..b39bf3b 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)); }