From patchwork Tue Nov 3 00:04: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: 320375 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp4149246ilc; Mon, 2 Nov 2020 16:06:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtRiN0lGKoxxoOXTmc9nqxcmcbGMa9+cQa9e4ji2mI3BdnE76F/0pAZeIJN5AbSQ507vKm X-Received: by 2002:a17:906:6d93:: with SMTP id h19mr3930898ejt.7.1604362004827; Mon, 02 Nov 2020 16:06:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604362004; cv=none; d=google.com; s=arc-20160816; b=NORrNxBZBuaQTdoj8d88DysIWhO593mK2E6junWMsZLYQBtdt4uH8m2OwCB03nvV4p svofc6Z3CzfiEEPeK6JCRzoPuhuoLtum3l1ITejNL53MviopuPYD3M5gHbIexSMpO9Hb LVr4ihCG30DzIqQeELrcKs4h+GVrODYOHDTtP317Umyz+meuL5CO0E+jSsfKVQ2Z/71e UQfcy7qsLd+JiPbqXZxqNPNU59W9SSZsZtuRk7XPpqj7IUHsS6faD++nOMpLJ0m9NzCj xrJAyU7yciqVwLBabZKRKe17nN/kWpQ4/YFh30p8oYw5pKO3zNEnampr557K6kleGXuR 01Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NbtrPIwXa4ml3XAJ7PZsRo1JBNLJTvmY3dKeu9GKgZo=; b=B/DbTF3MQRtmDioGg4/X1B1Qn+3+gXYBSQyW8Z2l7btm2Yr0s8+SJBQ7cV/cSFe5NI 8S4ZO2zsJvG8MB3YlCKR1So2SAWvI0lpBnPNV1DpHnm9Gy37XRHngDTZX+avJjclelAX onufOUx2qocvIoHT+DL4tDlcCxXbyclKjlY1Av6ARf/l92NyGcyHqDnF7ATRUMMyhmqh BM4AkXKHrbGKNikYHt6KGJ1P/1FclDijGQj4sDffnApNuc4TUSiFO7nIRXOYfi5G0r// kuL4OvGu1GfPaIY7bIj5bgDQRmZ3PK4Dy0ds69flEogEl7wa6CPXTzKmE2Q9XXkwUPSN tU0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NWk0aKsg; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si3075572eja.517.2020.11.02.16.06.44; Mon, 02 Nov 2020 16:06:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NWk0aKsg; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbgKCAGo (ORCPT + 4 others); Mon, 2 Nov 2020 19:06:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgKCAGn (ORCPT ); Mon, 2 Nov 2020 19:06:43 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850F6C0617A6 for ; Mon, 2 Nov 2020 16:06:43 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id p15so17078280ljj.8 for ; Mon, 02 Nov 2020 16:06:43 -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=NbtrPIwXa4ml3XAJ7PZsRo1JBNLJTvmY3dKeu9GKgZo=; b=NWk0aKsguLGsWq7m5XpcFMXzVvBD6YcJ0dd7bN55AQVBky7AQ4fkpKPGfWJ64XkQ1R 2TZDIePLk2OBwXYcmDcbxNtPbZ4zATHFPUV4+9gDbsyyOQNIoIj06uHjoe/b6vucuoNN iHzlsgnQIX+dqYBlzFSYYZBEUzaxtpBMhtcxLsLFZIbX8+OgZSDBg+ePs7FCc3jFf8hH vx8g86VKD+0+2YDLmVjVLAwxoN2ikBtDXMtGF8uoM3qRcuwMHZ2ZXECdRFCK6JPcjfCr 956QQVY8YWeq5akBpc8ly5e2W8MjRogoSnWTxuTA+4+hwOWWqkVnaIi453BjAmNvL0bg vn0g== 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=NbtrPIwXa4ml3XAJ7PZsRo1JBNLJTvmY3dKeu9GKgZo=; b=UsO2aC5Sp3+9GtnFbgrRG0o7DW7PETJfSKKAaMVanBzSYK9cgB3ndrzt041yKqw7/Q Unq9A7Z9RUvfrVrSyo1Pb5lsyHYINREukNb/rTvYiqnv292nUfo+/mLd/09B1WnQi2fE cAeBF9je9Xc1RoofL9U9ApiQCmSmmNS8hHyHGVzWKY34R5GqsvBaEVA5zgzkhszvs/Ai ZfB/MoDN6Jqk0ILdTPod71M+NlKs9OY3BPBee5ATWeKDZ85442mUww7FmM12RKdWNAl1 x+WVboGSCTvlPNINfVTSO9KwI+I20EX3oOmT7OYpAWwoJUl4Q8GnL0wrMek1hE7Nsu1W VrGg== X-Gm-Message-State: AOAM530i0PcjIhzaAmsqk+v9CO9yCbUZVmrEn38wik8H4W1daSUvPDdP DcK5GW64WM9JJmSdsm5fHvJ+Rg== X-Received: by 2002:a2e:9a89:: with SMTP id p9mr8123628lji.363.1604362002060; Mon, 02 Nov 2020 16:06:42 -0800 (PST) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id a14sm671492lfo.116.2020.11.02.16.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 16:06:41 -0800 (PST) From: Linus Walleij To: Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, Andres Salomon , linux-geode@lists.infradead.org, Andy Shevchenko Subject: [PATCH 1/3 v3] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Date: Tue, 3 Nov 2020 01:04:37 +0100 Message-Id: <20201103000439.325448-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij --- 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(-) -- 2.26.2 Reviewed-by: Hans de Goede 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 3 00:04: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: 314881 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 4956FC4742C for ; Tue, 3 Nov 2020 00:09:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2AF222268 for ; Tue, 3 Nov 2020 00:09:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uJWfcIh6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726533AbgKCAJs (ORCPT ); Mon, 2 Nov 2020 19:09:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgKCAJs (ORCPT ); Mon, 2 Nov 2020 19:09:48 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5159DC0617A6 for ; Mon, 2 Nov 2020 16:09:47 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id i6so19842569lfd.1 for ; Mon, 02 Nov 2020 16:09:47 -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=YAQ34Ve7cFnhSCwxnnPcw/n2Sk1h00H1WdG8OpLXBLc=; b=uJWfcIh6VqY8T6206mmY8Cib2uWSTpVi9sMj11vDOTICiwQTpmaMRDNFkemT69wE69 fieKU24EIRjIg57Cq3H97SRs19WQGbiyt2K2itDz2HCNSijThgHzFctU2/fJrRde9kmE jM5LXKeVWAVeG9X1+OorBvuwwLBZl8fO7WzGhcSXzoSR5oH+Hcst7c14levB5q4roCTJ 3PWlXbXc3qEVGmXGleZ4p8dhj5iKGOunvUQQZ8ZN3bCSe1wpJuOXYEPHpOpbdEEMOEy4 c9wCOuaOVii97XB/AVyr0hfr6PwG2Rl435LD/7+Z/eCIRBEYsB/eM60aUUc5bE8Zcu2c zMtQ== 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=YAQ34Ve7cFnhSCwxnnPcw/n2Sk1h00H1WdG8OpLXBLc=; b=PR62OfmK+aoxoxa4vCGOnqTAdNkUbQ2X2xGOHCULluFySSMVraWh9yjFFXTX5C4OzS sp92S6UKySOyh+BwFyh2LYEw6BKz7NzVj0t1Y2RXxreQd7SyVMuPreigdFH/YjOjKrUe zvLhkquOOPtEyVySIzYpfOz4YndC5BfYNzm4xqp87GKhu1dWxNJESkaYX3crYhsiZsLP 0AmGgxPWwx47ZJaYLjcN1jXZEgVrMxsEbfy8A5MZkwAxrfbuvpc5bvn/IkHqRxhiY3Np ALWmPJoYE/SKN9bIcuI6QgeK7Gyl64lkv2zWewwv788i4qZTA0Km8ChUvP7GC2EnGSlb sFdQ== X-Gm-Message-State: AOAM530Ars3c+NV3a5E53x/prFJja2SMPDcfAD1j0MT2mG3vNdHSyBQZ IYol+dUm9JiYs7iuCYUyLPxsbA== X-Google-Smtp-Source: ABdhPJwhc274siHZ60h5uEtKqOtW04MMzOlHlVDBlaMXc3fVRiuPf65UXs9E8tyt6O1dVnvga80ORg== X-Received: by 2002:a19:407:: with SMTP id 7mr6367120lfe.291.1604362185851; Mon, 02 Nov 2020 16:09:45 -0800 (PST) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id a14sm671492lfo.116.2020.11.02.16.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 16:09:45 -0800 (PST) From: Linus Walleij To: Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, linux-geode@lists.infradead.org Subject: [PATCH 2/3 v3] x86/platform/geode: Convert geode LED to GPIO machine descriptor Date: Tue, 3 Nov 2020 01:04:38 +0100 Message-Id: <20201103000439.325448-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103000439.325448-1-linus.walleij@linaro.org> References: <20201103000439.325448-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 Reviewed-by: Andy Shevchenko --- 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 3 00:04: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: 320377 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp4150943ilc; Mon, 2 Nov 2020 16:09:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0cslZHIMdDi0yCRE4WK6UcH19RY409vnI55gbnAxqzTURJWpw5au5wsDYrJcb9Aa6bSOj X-Received: by 2002:a17:906:60c8:: with SMTP id f8mr3886774ejk.14.1604362191715; Mon, 02 Nov 2020 16:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604362191; cv=none; d=google.com; s=arc-20160816; b=y92p3QfFwuQNyMny9ZFAez+m4nmJjASNqc9WdS0H3jydLaspHOUCvkvGsjfni+Qxmb u1rs5SQ2ztRdQ0nrGDZLotHbLAE/XraLEb4kkazmfZkq6o3m5CZiUTg/WWXBv2Meog4w oOhikAWpfRRgUllLZQVNolnDQKZIdX1d+xu/7BcMLwzV01/+fC0p5FOpAZ28rOeKT9s6 reZgd74unw7XcCaJz/w1ntMs1ouesBq7fTVMZURe1HMRXtHebPEyRU1/W9jdpMBoZdqH 5bsCtjAFG7u54l37m8WnGJsueektTroWPN/YfKjIkXSS2jw+aIJnPli3HM3CWpCykkw4 pJUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V8skaM7syXmbfJm4r1OgvU6gcYaHXE62TFQBSGlozhU=; b=tksh55ThmtFIu5itwDXxCLRtFRESWaHYqo6/SBKCy6n1yd8zg7Db8ym/72rOparcNg KWEJu/m0AoRtYgZEeMMpB06J0kM/22UgU8dX6jOCyuw7Q1puedapiGobhdv/74zAmp9R LnfrNqaW1NJy1LOVAZBzpNHZk3WGQffSfE21/5AiZ0icpvxviPqoQrwOCSXgSXjiGvQI QOGznnnk2q7IscFLeTkCYfZpCiWYwEHFWKVoM0zefKPtN1ZyppTLZ+e7Xa2827dAoxD3 BZfaBklYC7BE4x4Nb38Qn5KdQMzuoiOPo/5mhgzk2PdR5NylJXFe9BiHI3ZjN/m+5l9h nxUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VPnuisHS; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si3075572eja.517.2020.11.02.16.09.51; Mon, 02 Nov 2020 16:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VPnuisHS; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbgKCAJv (ORCPT + 4 others); Mon, 2 Nov 2020 19:09:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgKCAJv (ORCPT ); Mon, 2 Nov 2020 19:09:51 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F96AC0617A6 for ; Mon, 2 Nov 2020 16:09:49 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id l28so19773893lfp.10 for ; Mon, 02 Nov 2020 16:09:49 -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=V8skaM7syXmbfJm4r1OgvU6gcYaHXE62TFQBSGlozhU=; b=VPnuisHSt7KrX8al+dtlg++Qv7oCD8ZSQh9IGw0n1HPE37QSrZEJW44og/cG2KkNUM ZvZbGsifKj022dvdpqsGfbON1hQ1C2fhCkgu/oqfb+Pf3PY4dwaf/Wo0HFrwTKi5GjEI iklgVW6n49OGfnQp5fy87V5x620YoCiagJ6DMaL2Nrsb/TTrBvWBrucEAv7aFbS4nwFh Fly1f19IVkNOk63tHpr0AGR/93ZW6HhBND1zlxY05NLgDLrD5ms1bKzwfLjhLOxdkzca YcBwEirD+fk3m/uNC7ZoM9YlplfBBjMsGX/EwKCZlyiHxxoYZqNt13466NIDAgE0xhss 2iOA== 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=V8skaM7syXmbfJm4r1OgvU6gcYaHXE62TFQBSGlozhU=; b=Dn9c2mNODJnxUT/zAljLQiOYI1KzG9U/f2XKtMnq1dTs4o7llFScZany5VSo1j9Zpm xM2EUdnsx9Fjr5rOqSQK2frzsn+MBblW6b0qywHX4bKWsf8HQheOcSnZ+qmkmEOIyDui O3dyrl9LV7Dt61NUjNg73qqB+0skTk5QEwSn91WBVGdZgDA0RfjtZXiAVYZrliXV546x L2MrDtou0zrdOhoBKzUjpRzHoU8g18UbqoKTVpCd1dPBFpAt1W1rAf9JQqCb6jRST2jD hc851BZ+QeGcF2maBt3cMJA1YCy/Qj0dyxa0W+22T7eIvCc6P8l7CikKG15h6wNKEyvY KgOg== X-Gm-Message-State: AOAM531iB6HwmLLpsbLUZeDQJP0xyUR8QrPGmNRZ4uVLbG58mrwpe+6z X+Ue+YKdtE2nrHUKE/EOFGb05Q== X-Received: by 2002:ac2:5c4c:: with SMTP id s12mr6105789lfp.174.1604362187923; Mon, 02 Nov 2020 16:09:47 -0800 (PST) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id a14sm671492lfo.116.2020.11.02.16.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 16:09:47 -0800 (PST) From: Linus Walleij To: Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, linux-geode@lists.infradead.org, Andy Shevchenko Subject: [PATCH 3/3 v3] x86/platform/geode: Convert alix LED to GPIO machine descriptor Date: Tue, 3 Nov 2020 01:04:39 +0100 Message-Id: <20201103000439.325448-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103000439.325448-1-linus.walleij@linaro.org> References: <20201103000439.325448-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 Reviewed-by: Andy Shevchenko Signed-off-by: Linus Walleij --- 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(-) -- 2.26.2 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)); }