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: 331384 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4194004ejb; Tue, 24 Nov 2020 00:53:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq0OnepI9vtHnT3K+v/rSn6DHEi9Hox+Ub7nh8/C+S3px1G4V2nErOFSwduoHEM/iNIqoP X-Received: by 2002:a17:906:2e0f:: with SMTP id n15mr3176007eji.486.1606208030173; Tue, 24 Nov 2020 00:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606208030; cv=none; d=google.com; s=arc-20160816; b=Vh3iNeyKv1rbJAz5ZiNlzmJwOiQ3lMz58dlEjVjPIOWvy2QcXPUxdrulnV079Ado7x gKpy/AZVL2Xv9lFxIaDNXqBtVrXpwaAwN+hF1VMCd6f9DA4vnorJ93RIV5HATdKBGtgN O5A5RyhiEzIwXhUhq1p5EO7hQGu+DGrwv9pBv0Ogzhbbp61oKSQ/HuLAs+kdjNx4U0eL /x7fO+PC02IIuk1pqOhnqHncYSZgJehDVbg9SXduti2VX8PuxvKdX09kGqg6yxGW+GJd pbKVY/J5sO9D6FGgP0UZGP1KcBlj2NnfohI5LMhvQaCLGqKPecpXbUwb2ESfgGkEfXod /Cgw== 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=I2EmMJdusVtGBiOPmuBxSa/yxYa7w9wcih2XFbyqoVY=; b=BD9ZiDHQAMTMmfQm8PPlp9x5RlvvkZBko7JeaC9/6WdwyEICRN028O501WssvD7XtQ +OwlMr9wECzOpHuc7KAq6cHCvp2XY/SUCPWDEB9xS1OkJfUG6IYa7CyrWd3etIzFcNzQ IrhdDcfAu9Hwad5khbWoHdmlvu8GOH7uKfvs8MjN8t2EIhkTZ7eJVf+IPkoocTiut8hU W0wuay/q6J9RfKf1qIH1bfpNuKoJFDXOEoScfvLMME/xJ2mttMYFf5rxHrZz8Nd2h1qq humFDhMtFPPb/dnd/oMErmIrFa5FwSohzth9Jejetbff/c2J2TQrMJ5g/n+zCTkgu0dM hN2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rOzJh8nP; 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 bi10si8834171edb.483.2020.11.24.00.53.49; Tue, 24 Nov 2020 00:53:50 -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=rOzJh8nP; 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 S1730828AbgKXIxt (ORCPT + 3 others); Tue, 24 Nov 2020 03:53:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbgKXIxt (ORCPT ); Tue, 24 Nov 2020 03:53:49 -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 D0E8EC0613CF for ; Tue, 24 Nov 2020 00:53:48 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id a9so27779066lfh.2 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=lL8CPD6Qs61u1XFprSbFrJrrGjSVoJbyE+eQKdNqECTrSn8+U50eI6hmmeg2trx/oM q4NtjQ1dsgt2+jCdEA7dGof89buSJxRtyXwq7avI8jujqzt39umNtIp0cUcghQm4oLeg QQ45QTB/oA6qhIxSnd4pT/WAcTizLFm3A7ac/dG+LdFvGNdknHvhQvS4zEWfyzzKD0lP x/VKicQZ2i7yE5DljCKawcyl9fcMFaHcyAiFENSOFB5H6REvKO6kkWAjQnA+l0G8W40E w7ZRUuHA5xQS7yo54yaOZzHMclTOkDikcdGMo0pKv0ZjJW4eTB49Y3MDA2B7OPCRnkX+ zMIg== X-Gm-Message-State: AOAM533VlvFk1+3x3AmrF4glLhr7tFzyfu4XmjvYwBtC0ILHQ8GEk0R3 mkvgxYj4yvoxY2JOghHWfLuaaA== 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: 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 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(-) -- 2.26.2 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: 331385 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4194028ejb; Tue, 24 Nov 2020 00:53:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+E018X/tl4YuCEYBWd2oLSvHdzgc63H4JSNsM2NY5taJSbtpq9gGj4Dh+9BG1HxVKGh/D X-Received: by 2002:a50:a6c9:: with SMTP id f9mr3017060edc.158.1606208032741; Tue, 24 Nov 2020 00:53:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606208032; cv=none; d=google.com; s=arc-20160816; b=yV5KbZAFjGsuqKwgmtRYX9hot9WqHSnU+REhCIIetjOAQAx5eVA2ZLXlJTDUEySR6t I/fY98vOLwFpqvLlV123wmIRjGT8ekXf1sBboVoBbha4ExQykfux59FbqR2IxTbwUln1 hD2YD0gM51j5TAcelrNvvXSJtCL6sesF8HgtEio0WBntHeQJWzmmKzs6K7sj+fkTiHkW PIsUjOhi4sa1asnpAVIgPrxMkxskJC0pLDAdHnbLszF5vHLhAO/a9ve4G9NE3kIjgDFc rtU2shjPdrqwW9b7aQ/X+VejVYMpFohPbquYI923rqyhRP2ahCX/H/Jn0+qQPQrMNyBP xqfg== 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=DeDKS22xxFRIc+6wUo2VF8v+jvsdd+gENbNOUYHzsn4=; b=gJ0T0EMvsGaS5qxO+QzQHYwYRHQfYd1kpUeiLxpl0jlgQcVkOKM/BwgUL9+r4RdzFp EHJrfoij82chDX99P4cSx7Yq2cjzxB3CtbOQeeW8nm88l5CDmrh8Ge9WZDO4dHxyx92R hBmiLX3Dz7NWQj0KWf01n2ZeiPll5yEDkmEKFUvWO6fsJ1egWuEdZXwyKjMNhHyYuzRQ MISSJWuSPbaT/Vvn+5FtytY5KMeZ2CI3DnN53x9VisKZQfDTafrZj9vZljKIi4NH5zIM qbwo9ZejKIz8qUqmcd1O5bDzK5x9zFOVBZSegkXX3bwtpyjMQljkczepdu5Q4weBwg81 f9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ML1KH1Nq; 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 bi10si8834171edb.483.2020.11.24.00.53.52; Tue, 24 Nov 2020 00:53:52 -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=ML1KH1Nq; 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 S1730909AbgKXIxw (ORCPT + 3 others); Tue, 24 Nov 2020 03:53:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730822AbgKXIxv (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 591C6C0613D6 for ; Tue, 24 Nov 2020 00:53:51 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id u18so27733600lfd.9 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=tjg8ClHJ0TdEv3vBOb0js+Z9x2KVut4z4DVsD2W/QkDZJWdvIAkbykf2ovO8SZ1Grt 3yETWcoWJIwj3oNcYuQ2gtP89Qrc3Ntef1Qv4Dxxok9jmmA4/4yKX+x1b6jmi9k3efWc PuTSM/Siqw7XUnc+xzkmGPxP0WgBkzXWiYZDP0VtFxg26AyMJM80uY/oqTjPtvGZnJm+ zeuwI5b0MKXbLx1BolPM9DJiO59k2g6eMXGP1WuxiQHggN6d9Udl2+eah7i9yJMB5GH1 H3YZhl/MWQSUIcPpjL6ziSA6HeRlK7DdYXty1ckkwXmQcwBWi9EwwwVTLkxzb0Ci+N9B g+Vg== X-Gm-Message-State: AOAM531eMMrqCwoq8DFSK9KyZCn8dEh50hrsqJV7xqDjeh2g6P1osHog tVpd+HybDxr+9RgoP3gHaErkPQ== 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: 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 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(-) -- 2.26.2 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: 331386 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4194051ejb; Tue, 24 Nov 2020 00:53:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwybDQ18TygBthE3ra2eUlCDGdjxtiVAzXDO9OurdtrHX0vbC9GaWLWGQS53TiwwD+KGAHA X-Received: by 2002:a05:6402:1813:: with SMTP id g19mr3021116edy.105.1606208035453; Tue, 24 Nov 2020 00:53:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606208035; cv=none; d=google.com; s=arc-20160816; b=AKF6LUns+3zGd6L6Fjww+z+pmgqaiABRWmyjl0L66BfuQ2FeRzDcAIjYfou8qnl3+Y VuMZ1CFufbq5nEhpw/IHlqGRrjqqVcHyjVB6bSocZFqlkMn9efEdAYXtGWf6WyjeCcW/ q+ZiryCx9LUewf8C588a/I9DuAjuUF+ZnkMeN3HX7zswDm3L2eWPB2WV7L10YAzcBKFh 5t5uJrsjpaxqEWLCbfNdl2oJqXC+fhgTN1QAPfoQuV/emOzW5A2hBHWmN7+7QdWta3Gq wjbIRpeLpY6DgSSOtPXy/kGRJN88h+34hDfF8ERuJlixQWKM8Rf/p3GCEuh4MKZcN8kL DkzQ== 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=22n1tuxoc8ewInV62YF8elTpS8+RAb/cOsUr87r7lFc=; b=H8kCCLZr6mZfeWL+YB56KqNExOPRj2xyWchRIgvFz2RhiODKgQZ+Qa1FAYx5tl3nye ThUA9z3miDkGPRGJQD9uXBJhF75wGXETHcN5P1NrrC+ATN+iliLtFp/MgmqbTAkmc6Aj b7QumcfPpeUWyaQ9lGZ38WR6HvZZWt3qG1yek3a/V5pfVrUPg0YKT5WoHDO0gZOPzFbo 8FvwY4fhg13QYem0fJtZC+JiQH/lQZOi5MERQqH5Jk+a3BG9rpVXo9jMgVSgW6Lj8Yk5 LrogbfgrmGK5AgY2w2ddUBWzt+vAQAUcfaIdrsag+RFzCZYSh1yc3Ly8cCF2ujHsfJNX I07Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0TN2YHa; 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 bi10si8834171edb.483.2020.11.24.00.53.55; Tue, 24 Nov 2020 00:53:55 -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=R0TN2YHa; 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 S1730911AbgKXIxy (ORCPT + 3 others); Tue, 24 Nov 2020 03:53:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbgKXIxy (ORCPT ); Tue, 24 Nov 2020 03:53:54 -0500 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FC36C0613CF for ; Tue, 24 Nov 2020 00:53:53 -0800 (PST) Received: by mail-lj1-x241.google.com with SMTP id t22so8726446ljk.0 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=mDVK8IAYMs4VXjK5JRDioQtOvPuCpFySJXfXIP9RUNuPS5aXRNYm0/Fb3L418lnVvQ nHeT5EAAoIq+Nr3N0Sn5pGcliika4U/Z2lZ6bW1/wccA2zplBbA5CfAMIcMErwuLAmzf E08ieqjUNOD788dMU3O/boU08Ie0lRkUb0TYGy9hfVIHhzfY7acz1ptF0Ef8d295+EmH mNAQnGIH/dBDktDjfzSnqTwU7/qRdiIfKbC4KtgJW0kUVbAZz0ByxzIHHIBWKB/WJTO4 7BYK5ZtUZ3cgZAJoqTX+9MNfBRi24/Wmp2wyMjt8ZNEw8nTbAuU1zzEkw0UgsEclkVvd Vl9w== X-Gm-Message-State: AOAM533sr4n9Qoh3ZnIotyxGn34bmSci9a5l76V9onbcsDVBSgmymK/J vDXOB50lB9wTvTaflpxUpQWCIA== 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: 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 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(-) -- 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)); }