From patchwork Thu Aug 27 08:08:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 248430 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp211175ils; Thu, 27 Aug 2020 01:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpjCH5mvNQgV9WhkXmpDhY3f04rAMSeNz1SS4UhozQbWOcZZjK/WUso2ZG+7Uft5FAviRF X-Received: by 2002:a17:906:4cc4:: with SMTP id q4mr3020321ejt.133.1598515848714; Thu, 27 Aug 2020 01:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598515848; cv=none; d=google.com; s=arc-20160816; b=IfVKZ1K+SPuXAJWvwjNGPyZ8iMPZsHIbgebeJlr7gyCJknGwH7hxq79NY6Wjz+3DC4 d4n/crcEhFJGPzPhmSQw44DBi6LZugLoqPX7QL00cy4s2OIZR2qOD5ZrUMBYJkZq8T8c t10BNpnODp5GKcAHOJBZzPtut0xcBe9ixaAZL4Bc/qy9Sd6f+vagOdjwiowLROOezx9S V5vlIh5YtMrCwCBlOqDsOFPV2e8hMN5eU2kXO+HpADr25MY6e5MYeVadmYZQlD/C8ZvL 1u+zf2GRUqlobchDAoE4ejpAwt6/XjMLeMTMmdShYZQkL1zbK7WaOQdUzRmNXhVbecMT KT8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/IvkEhSqhxEbpj6suoWdTB0OV6oN/odC8QEW4Vw3wp0=; b=TfjT7L8LAPOz0BMQDAfC9zpis8TeLWC4U0cRrREnyTXJtexh3Z9bF1OILcZ2A06e3h /dNlaPg0rFjox0lcyDpCNjTUpOXtXAR3CJ680vo0nqm5DD8RGF+49VzJJMMZw5mb0Jy2 Z+Vum1WvaROG+V1iug606MmNPv7txTaDOdvOzBWIv7bmSYY6coAmbz/SqnvbbCzs1DAY QcjPeMHfDzrDyuG5S/HZ/3YDkbavUdgSX+4weFfVnVr6jP4mQYtKUxfxHDrh5D440VEg SJIT8Vs1RyxdF6+D6g9HrFNWDyClslCMXtXORpF0kTrsRE3+EQbDQmA0wkRUUasQrMYo rTcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dpai1au3; 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 qn20si843792ejb.727.2020.08.27.01.10.48; Thu, 27 Aug 2020 01:10:48 -0700 (PDT) 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=dpai1au3; 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 S1727897AbgH0IKs (ORCPT + 6 others); Thu, 27 Aug 2020 04:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbgH0IKp (ORCPT ); Thu, 27 Aug 2020 04:10:45 -0400 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 CAEF9C061264 for ; Thu, 27 Aug 2020 01:10:44 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id i10so5426550ljn.2 for ; Thu, 27 Aug 2020 01:10:44 -0700 (PDT) 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=/IvkEhSqhxEbpj6suoWdTB0OV6oN/odC8QEW4Vw3wp0=; b=dpai1au3V4Hm+LYGEv/RFyzLIIO+aVTJISIykAoCNGq8wlw+t/ecDDuKjAOtx/tWLL MEvM2P+C4vkH+QsnlirYxT/eoeEG+/WTl+TyjOTSzbFTZB5Ud+0LENXIQbuydJ0FseQW xPwmicnmGX1yu0Fl877NpHkYG3idL3prBtsTpFsBkQkX/IYLFrxzim5nC51cEjEk7VuA REkPOIqs0X2yX/jM6Z/bhQEHW8H7T9I6ubdmN0eRnYlMyVoSPmG84Hrx8s9S6kj//GIc 8+8SeDg8kOFzZApeTn4Rf5IJayYiUlDFKzEG7k7tqJPy99nJf/EzEg2hr8JbVVq+Rn/Y NJ9w== 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=/IvkEhSqhxEbpj6suoWdTB0OV6oN/odC8QEW4Vw3wp0=; b=oVE0oLOK29d02pRXbnOle5XjWcp/rDY67KkHIbQzbuprkj3JDOygpYl1f/ehRZ0bHR 2hUyk8OqIm9iXIlO72XyohMD3B6byrPuLD/pZFurevjJDDhrVKYQv6lk8cbWRyNCvX7I 8Rua1iWmQ0uTYSKPAOGwTUj6gZQaEOVm2uFxrr7Ko0dfkFLgfh2JuTxsx4zhM34kE5JA C/xYe8M/+Eu8YVWBdVOIA56Vcm8G2FpgbOjKA18yZiwrTTHn7l0IssoX+uynqVWIh0pC 5PUL8H5Faq1vyJFd4jtsIgluuNcazicX1wbA2D3av9tNoJVItrGkFgavxdG90l6IufRE 88YQ== X-Gm-Message-State: AOAM530EY28ODxS/mo34RPninQMmwUJ7T+K45Vl5400S/Jvd9IQOwKYP pULqSdDU2HE+n0CHg0fj6PuBOg== X-Received: by 2002:a2e:7817:: with SMTP id t23mr9087087ljc.161.1598515843263; Thu, 27 Aug 2020 01:10:43 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id k9sm331399lfm.29.2020.08.27.01.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 01:10:42 -0700 (PDT) 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 v2] x86/platform/geode: Convert net5501 LED to GPIO machine descriptor Date: Thu, 27 Aug 2020 10:08:24 +0200 Message-Id: <20200827080826.186024-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org 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 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 Thu Aug 27 08:08:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 248431 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp211347ils; Thu, 27 Aug 2020 01:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoZboYU7z7LEdmx30Vn7p5n5HKTt6cpWWFsYSB65ONv5QByyybDNMoirJHBiWQF/xQ4XN3 X-Received: by 2002:a17:906:d181:: with SMTP id c1mr19206228ejz.181.1598515870860; Thu, 27 Aug 2020 01:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598515870; cv=none; d=google.com; s=arc-20160816; b=ShGyK1nn0a3kaEB4U6VkVSNyfS/UEJvQq+PE32y0m7+p0/QuqbFIeuDk7n0IDU5FKE 416BPatFf9H8r9FBYw3FY/vLPqd9d9Fet9ZVuLbsot+lf3zX+1KKoViNMXWy1kclqRkl mZJfK6nTZ21Bdv+gbd5A852xwcjsCtDqeqd3+LRXojcO3gGwxPhVlzmiMWr5lWZF1m6n GbGUZlyhlO7/zaJsbxWT1VvJbpOUUhHQt/KU4qCvW9JiFXGT4g2p5SxcZpOTIr2leguC 9d+b1fsYDoaujV7k6C7vsdbCt3R7oMz+TLIkcvCcEzNGnbBv2sQuJmwo4PsuIf/xc+04 SWbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R0qr0wEHYkyK/CJaNJ4Tz6g9aeydokX3kWn6WhBTMLA=; b=IbzlsOwq+b6KwjzQUwRfcTDtlGP50f+os5bf2L3nyGwSBWTdvVMxFSLjcszeQDCWlW HH+mDPKIS4t/DBc9Bp6h6VFU2aPPKGr+fNqBm0X9PtcMpiNM933Mzzg2RGl3PcDNH1Ws om08q7PA080wrDt6yiyIwpGptgzCW+tiic3iSY+VYCqw7hK7VboTiNwD5GXDqwXWGTZU EQ2vDY5sOydlxsDQ5NYzza0wdxrFAK6Py6avS3r9dz02Nkc2TuwyR0mwCgAj4Hsicv7v fMHdGz61E0HB3qncsQa7OuXm03Q06gvkUP6JGnPVINBgcZamtxX6KOdo9AeffbM2J50Q VnRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VA7jgQtK; 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 ox14si1034456ejb.516.2020.08.27.01.11.10; Thu, 27 Aug 2020 01:11:10 -0700 (PDT) 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=VA7jgQtK; 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 S1727115AbgH0ILJ (ORCPT + 6 others); Thu, 27 Aug 2020 04:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbgH0ILI (ORCPT ); Thu, 27 Aug 2020 04:11:08 -0400 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 8B22EC061264 for ; Thu, 27 Aug 2020 01:11:07 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id w14so5416813ljj.4 for ; Thu, 27 Aug 2020 01:11:07 -0700 (PDT) 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=R0qr0wEHYkyK/CJaNJ4Tz6g9aeydokX3kWn6WhBTMLA=; b=VA7jgQtKWZJhZ2JFzhFdsiJNA4AKnPIqqpH9TU2P4Tz41Ev5s3DCcAsK5ZRxFo/w+L vHMHgpznokGU+52tjv9EXgfji7mUVxDeEmokG05GFmF3zpdwpXzplmtfLlgHa8NVj+N6 DRPbgsEnfpDNhRjby4uITLcoxivx1M9q//E9pJGqNYyuWm2ABu4laPaM3H/ZmJdF1AXy tt3o00I2vCgbEhmwe/biUKl6BmaqbtkXJ4sYKDfbzQsP2lVAou/9qtyDOlkOmKLX1EQx QZzQzEStzGZiFJueZNoCRoVRsvp109BnaRTGr5hcfpn9p4gP29gW0v1cKpnjB3Z9SHBH N9YA== 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=R0qr0wEHYkyK/CJaNJ4Tz6g9aeydokX3kWn6WhBTMLA=; b=uSzuLhVBT9ZuS24j2glxj7vu18aIXnTTJkeq/E5mAbcuNNohVut2dooRcW1AJy3Tm+ IK69+NFZ5OJsL4Kg6tM6o+I/P938wy62vmH/4poSb1UZx9nBmMRpYE+tk1qhn5AdyL0D eALvsLIs/WrjvwpPMnJ/nw4rTEcs4qM/nO659jcDH37i8pQduzdoZqfAVTXcbyx5b3nC jhFqKhxfv3M5B6aQnGiVy63mdP5nUvO0d68GeBb0ucjq/ouGqrK5Z0nvqeAcWdv0w5QJ HjiUW8sK1JumqZtvtJIzp+pKz0LOKDYCHlVnXl1pcLXxxnQ2TOm51b6oNc3CUSmwiZOz FYPQ== X-Gm-Message-State: AOAM531FDlge+beIlKz6ExXcNRHcIdB8uc0eaAcNPg6c+OjXzohg2OZa UgaJE6tsWwTZFitmnzuy8WoyBztYweqQaA== X-Received: by 2002:a2e:b892:: with SMTP id r18mr8524065ljp.249.1598515866001; Thu, 27 Aug 2020 01:11:06 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id k9sm331399lfm.29.2020.08.27.01.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 01:11:05 -0700 (PDT) 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 v2] x86/platform/geode: Convert geos LED to GPIO machine descriptor Date: Thu, 27 Aug 2020 10:08:25 +0200 Message-Id: <20200827080826.186024-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200827080826.186024-1-linus.walleij@linaro.org> References: <20200827080826.186024-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org 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 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 Thu Aug 27 08:08:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 248432 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp211352ils; Thu, 27 Aug 2020 01:11:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9r3SxQl42Ll32Rqn7hRLjUgsADQ2hzXoLszRpD20wOx6w8cpM0IrdwsHxATeHRPDj8uGY X-Received: by 2002:a17:907:9487:: with SMTP id dm7mr5550969ejc.114.1598515871404; Thu, 27 Aug 2020 01:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598515871; cv=none; d=google.com; s=arc-20160816; b=01jyPvzT3xuv8vh9G88GpekdvPuPRu+TR/0qaD83+XYKnTL4+HJmBRV0P4uwZZjp0l i2bN7EVlUMNIUzE2s4XuJqpFCvkhklPQH7qyEqurbBSfLcYrim6w2AoUXAMP2AkEwHZ7 T8v2EGfqEPiayqEzZspahFsYEiAbU9aIbqUFW+NZlwU6u/pIw3fzU3hWBplsJcMsRISS utNq3VIf8rKo2dpaR9kKBqHVbqWECwQ/M9GNyH15/cKaJzG9XTl8NlUlueUBKM1/RKvc kT4tXQPvAAVFmvtxjKMzmp9M8cf7GAytcnx8znmsyeQTZSzjfWn/jnX1OjRA8OkFN8P5 Mh/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mTDjea0nrnc/oUf1mH0xhxoad77z5EY9HZKwtaJ59yw=; b=esG6X6gXl6noJXfgfCIdjAKLd6t7gdCbBByoML5/DGyN2FJmOCCc9KXGBDZrEMpQIS A42kLh0VJDlB/dJnQG5vH/enDAuanqAXA0qIRLIzYJlKRGrmSKpQHnZxSV0adet40tYz wvJ0I5OngrzM8tiaPXgT15mUZzISFWOtGiNqex+Zg0RKTrx6+7TE1EyEqtH79tVt80IB Ck6cBQ1m7fQ671gDViHg/o5vRUe3e5EGH6BXmRaHl4Bf/jtgP9pBVVT4RCZerNbnikiW LESrG5JcL9D2bcgj9DCV4ez5qqxt0uLqYMy3aV7v2tBaMT+RbvoNw6taO93ZqqZa22TD TYIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uirdamO7; 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 ox14si1034456ejb.516.2020.08.27.01.11.11; Thu, 27 Aug 2020 01:11:11 -0700 (PDT) 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=uirdamO7; 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 S1727963AbgH0ILK (ORCPT + 6 others); Thu, 27 Aug 2020 04:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbgH0ILK (ORCPT ); Thu, 27 Aug 2020 04:11:10 -0400 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 C034CC061264 for ; Thu, 27 Aug 2020 01:11:09 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id g6so5379405ljn.11 for ; Thu, 27 Aug 2020 01:11:09 -0700 (PDT) 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=mTDjea0nrnc/oUf1mH0xhxoad77z5EY9HZKwtaJ59yw=; b=uirdamO7+rR5SAWOIOIS1iNHhmUE9SNEGnKOpzsy3KEjjxJYTzUq4iKDX6lnKYaM/c uit2YGPT2391mXTRCqyZ5aVSIyKxAP/3jdviEIJ6Ngh4tTWeAIZvFrNwlC0K04/YFtA+ XvF/Ywee2+tTtwMN3lVngnu7ilm1nXloqJ6W+EPTYEUouwKrBDsyxkF5AhK1/LCCHz/R uUoNt8xK1BA1OZdUzfhFdcNKKy7xcE/VeeUroiHLuxIgkA1Nl4h6i7BQjgHHtMyXMX5S dBhKU0ivZWVg6guh22ilnYztwna081mQpDbWh/eM1KTgzeYk0F/JOTHci0Zmx6gI5gV/ 0+8w== 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=mTDjea0nrnc/oUf1mH0xhxoad77z5EY9HZKwtaJ59yw=; b=Qgb0Nc4QTcLq+ufc6Gh+VAp/RSyao3QtG5rFi0iA4tE42u/r3sxNmb60+NVVPtS9lt Flk5QZbAEDryERVduuAGFlw+PoTKnk/eEpGUe3xH4Knesy3I29MrrVfQLiV8O6WLs7oQ LP2CWps1zQ/ZZo+jcTR3BdpbRx6hjhegXX+bpCyeS226nWfl+IXVkxtyhrlMeKp2oT3J p8sLfcsHFD8yQJRfhdV8RVGDnJ0vbJvB4bV1LNUYXFnjrHQimz7PrphnRASk046Y61lx s2LF/NKA3d9TWKRMs04SWyDVNUudPTnRWu1/JZR9Tu57h0/lpK56CCtQIUT+67Zv6Ndb S+9A== X-Gm-Message-State: AOAM531B5uDk6F0Fh544nx4cHnwPIwTdGJtrDX9/L2mylkaXWcIkvkyj mj3EX5kh3Q58O6k0evBT+QPVgQ== X-Received: by 2002:a2e:9ac5:: with SMTP id p5mr9639088ljj.253.1598515868229; Thu, 27 Aug 2020 01:11:08 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id k9sm331399lfm.29.2020.08.27.01.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 01:11:07 -0700 (PDT) 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 v2] x86/platform/geode: Convert alix LED to GPIO machine descriptor Date: Thu, 27 Aug 2020 10:08:26 +0200 Message-Id: <20200827080826.186024-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200827080826.186024-1-linus.walleij@linaro.org> References: <20200827080826.186024-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org 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 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)); }