From patchwork Mon Jan 15 10:33:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124509 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp625673lje; Mon, 15 Jan 2018 02:41:33 -0800 (PST) X-Google-Smtp-Source: ACJfBov1gZpSD1mDDCCrqXxSltFcwsVbRa7YBshhwV814dIyu9S9+g1AxvDB18/IvZeXm6ZZqffC X-Received: by 10.84.210.195 with SMTP id a61mr871311pli.335.1516012893503; Mon, 15 Jan 2018 02:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012893; cv=none; d=google.com; s=arc-20160816; b=kwWKdRmdivIbH8JSsfCzWpzVQ+i+/UqzkrV/YZQnvkXnCnHM4lvedHCPxMtLl3k5z5 ISagghuKWbBLN79ICg4oTyqzUABBwqhBhAjN6BKeGsa+dDS4Kyra4m4WrE2foT13AJzc f94xSieM4TyG2qvrFNRUud1Dk3NtdlcSmx94DV56qZ5VA7/facHHz45GMOccPx0lJukU MkjW9k66JpQvZGrkDElaJb6cKlKEeosK/qTYLd/Ev96RS7XLOg3Om0Ulno+9FjveGLed XqfYlgMJlc0LerOW9v1fYk87BBuIm2LLEKikvxH7VIj+//rlmNu9BXJ5RKUwkU8hSDH4 kcfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wvdyATUbCt80FpogSGtUoUetveNhBeFhJSDTF0gffsA=; b=m2qUyhyNirFHVWTKz3BygGkZi8v3ajApNazZ3V5FyPiNBG+8MgqxUCZqbPQ1mMniOj r1pyw2w47XCv54cuTNJAzaYeJSSGwNZqmK4vA5BfE9dIuobc5XV1v272ovehXzTI1i4K AmoyFL6JohoWNS9KtvqhfVRMgD4pc+Dcy6khahVnqjJscw2rzqfQC5fukDgNk3Pi6JxK tdedObbujhCmo091w252RVRL85QjcoVKy6JbXwm64oks1sbbOxmq+5zwLipg8HVw1xB8 1eenfleHRC7U9MpalepixlVVv+Jq+Kd8MrFCbdK0Nl6l0/f+UBH1spR5nmFNTewU+yYI CnYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si21166936ple.790.2018.01.15.02.41.33; Mon, 15 Jan 2018 02:41:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbeAOKlb (ORCPT + 28 others); Mon, 15 Jan 2018 05:41:31 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43771 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754603AbeAOKfC (ORCPT ); Mon, 15 Jan 2018 05:35:02 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 7D657207A4; Mon, 15 Jan 2018 11:34:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 01CC92086D; Mon, 15 Jan 2018 11:34:48 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 03/16] iio: adc: axp20x_adc: make it possible to probe from DT Date: Mon, 15 Jan 2018 11:33:37 +0100 Message-Id: <063c68ec080a999e10bf33e417c974142ddaaf9a.1516012352.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To prepare for a future patch that will add a DT node for the ADC, make axp20x_adc able to probe from DT and get the per-variant data from of_device_id.data since platform_device_id.driver_data won't be set when probing by DT. Leave the ability to probe via platform for driver compatibility with old DTs. Signed-off-by: Quentin Schulz --- drivers/iio/adc/axp20x_adc.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) -- git-series 0.9.1 diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index 3fc1b06..3968053 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -515,6 +515,13 @@ static const struct axp_data axp22x_data = { .maps = axp22x_maps, }; +static const struct of_device_id axp20x_adc_of_match[] = { + { .compatible = "x-powers,axp209-adc", .data = (void *)&axp20x_data, }, + { .compatible = "x-powers,axp221-adc", .data = (void *)&axp22x_data, }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, axp20x_adc_of_match); + static const struct platform_device_id axp20x_adc_id_match[] = { { .name = "axp20x-adc", .driver_data = (kernel_ulong_t)&axp20x_data, }, { .name = "axp22x-adc", .driver_data = (kernel_ulong_t)&axp22x_data, }, @@ -543,7 +550,16 @@ static int axp20x_probe(struct platform_device *pdev) indio_dev->dev.of_node = pdev->dev.of_node; indio_dev->modes = INDIO_DIRECT_MODE; - info->data = (struct axp_data *)platform_get_device_id(pdev)->driver_data; + if (!pdev->dev.of_node) { + const struct platform_device_id *id; + + id = platform_get_device_id(pdev); + info->data = (struct axp_data *)id->driver_data; + } else { + struct device *dev = &pdev->dev; + + info->data = (struct axp_data *)of_device_get_match_data(dev); + } indio_dev->name = platform_get_device_id(pdev)->name; indio_dev->info = info->data->iio_info; @@ -606,6 +622,7 @@ static int axp20x_remove(struct platform_device *pdev) static struct platform_driver axp20x_adc_driver = { .driver = { .name = "axp20x-adc", + .of_match_table = of_match_ptr(axp20x_adc_of_match), }, .id_table = axp20x_adc_id_match, .probe = axp20x_probe, From patchwork Mon Jan 15 10:33:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124508 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp625579lje; Mon, 15 Jan 2018 02:41:16 -0800 (PST) X-Google-Smtp-Source: ACJfBovCegf3BP1SF5RCZ9l1JYm0LcSj/R6zQTWPni+lo4JmAjBvoi2kxVYLFe/NywkK9A/2Oy7g X-Received: by 10.159.218.151 with SMTP id w23mr26302096plp.100.1516012876256; Mon, 15 Jan 2018 02:41:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012876; cv=none; d=google.com; s=arc-20160816; b=uJhoVuAM0yaJ6pbOfzUl4VDEbDAhzlLLFCUhpenTmeryQvA+pbBGdyZTqhE/T1H5sG 7qeZtF034qvysVh3QnRNM5Cn1XEga2rBeA8LXAG06Ek8r4qNFECNq3LNRqwK8pddSHJ9 FdSAWQMHUNPkEV5EHM2a/iyWqqrWD5201ukEndDURCPUjn7MRBos9NXJR8Z4ACxONKyh R01YsIxu2yij68m+sg3SYAjGHlRGkhCp2Q5tUMbOpWth+Fh937F6EtzBb36WnCi7O+UE rFFkjXLuLAO7wN+V5DhctB8428aTWSVEAcyrclx9FoAjHCOojfRjluTDqFZVZbUkKms/ e+tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=43qA+ZUi6NdlDIn4xj5srUj+wAkRd9/Si61GUPgnvB8=; b=ANCtlMUR0dSOEvW5GTK3jLD5W7jiKYj8s65s8UQWRY/niGVUTv5zDyKXtbq68125k4 fYyl4Djiqw53VJi5dWFBMuQOOaAbvidc4B64s1tuSABMWGE/jNGGciJG9G7YikF/A6ba JD9V+H4t1huwHW7tP4t+oG8E8Cquw1THwdIkHnh8ekbPl8QxM4+uFrPTf3QyOp6pXRwm eGSvYVwHI/O98mWcTKDOzR5sKVz8YjHoWUqCA/ORYR8zOUYr04vTpsQ/Be5fjy4X0FEP xY5cGXWGGAmUvmghcpYu8Saza184ifnO+8UhxXx+a9Y2sVP0X1JWKhP/52zNV47vN6CH NJdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si20755026pld.592.2018.01.15.02.41.15; Mon, 15 Jan 2018 02:41:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932914AbeAOKlN (ORCPT + 28 others); Mon, 15 Jan 2018 05:41:13 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43787 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754708AbeAOKfC (ORCPT ); Mon, 15 Jan 2018 05:35:02 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id ECF842074E; Mon, 15 Jan 2018 11:34:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 71D9E20871; Mon, 15 Jan 2018 11:34:49 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 04/16] ARM: dtsi: axp209: add node for ADC Date: Mon, 15 Jan 2018 11:33:38 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a DT node for the ADC of the PMIC so that there can be consumers of its IIO channels declaring their consumptions via DT. Signed-off-by: Quentin Schulz --- arch/arm/boot/dts/axp209.dtsi | 5 +++++ 1 file changed, 5 insertions(+) -- git-series 0.9.1 Acked-by: Chen-Yu Tsai diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi index 897103e..0d9ff12 100644 --- a/arch/arm/boot/dts/axp209.dtsi +++ b/arch/arm/boot/dts/axp209.dtsi @@ -58,6 +58,11 @@ status = "disabled"; }; + axp_adc: adc { + compatible = "x-powers,axp209-adc"; + #io-channel-cells = <1>; + }; + axp_gpio: gpio { compatible = "x-powers,axp209-gpio"; gpio-controller; From patchwork Mon Jan 15 10:33:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124496 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp623979lje; Mon, 15 Jan 2018 02:35:21 -0800 (PST) X-Google-Smtp-Source: ACJfBosiyCS9g5rcixNP27KaotKPHLp4bjMk75jqXfy4IrL3OoRpcA2bc0DTgJjmZkxSZu4f/SkX X-Received: by 10.99.127.85 with SMTP id p21mr25244923pgn.137.1516012521346; Mon, 15 Jan 2018 02:35:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012521; cv=none; d=google.com; s=arc-20160816; b=F4COreGn5Z+jg0opgWTl1MBd8GbkQMm7BGYsn0wwk+ZsL8bywhEf5XI5DtYw5TWyuW tUAOxFTkBvwqLhgjTxGaFb8LMWF7HANJe1juyc3Jy3fVUEyMPy0TIxU1R1KxNvOhKJIp 4ZOToH79w+Hf09yV06gMxFpoqRF0fbXFdYVvbUmCZmE6l1zJt8R/H9jguMoRdw4Jf4z8 JBnO747KfB93zrRpFJscEr3mT2hIklF4s8p84MuAq6+BwafuxDvVcwvyAsNbJM5Z6RjH L7RMIpKGtkmLmmsZjvRzKp61Dxg1REKbnrJZl+jVSVCxt8h4J0I+TQZ6TOqIb5NL4aNh sUMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sIbymIZnbPF/OGkVEM4ZmY39K6O2251GY2iSt8VmUck=; b=net0PKrqZKFQOUD+Sl3SG0tbVHNXK8RuFRNC8C1I5tAFXmFFn2zqMV2SDizylXSilu yBF8hsWp4OGgJNhoklFiolLuq4kvGb+1kxBn0p5h3bJ5sM4mC8ayj1UHuKM1p8wPAMjO iOAa4xBEjxaAU5Yd+iQZUI4P7sEKyu3bYTHvwGFB7wYJeUFtyPK2WHV9IQa+pY/DGqlw //ozLX2uEThzbK0DQfZs7x12ztS/EtAQ4Eu5XDHHLoRX1U2bz7DXv8FCX6nXhufEktLz oiU/cfR++zUTVrgqp7gc4cobL/MtQYIzpaHBGVf9hu1gZFwIE2dunYM+i/flInqrR449 RVRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c134si11176851pga.329.2018.01.15.02.35.21; Mon, 15 Jan 2018 02:35:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382AbeAOKfT (ORCPT + 28 others); Mon, 15 Jan 2018 05:35:19 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43796 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754540AbeAOKfK (ORCPT ); Mon, 15 Jan 2018 05:35:10 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 35F55208A9; Mon, 15 Jan 2018 11:35:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id E44E520877; Mon, 15 Jan 2018 11:34:49 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 05/16] ARM: dtsi: axp22x: add node for ADC Date: Mon, 15 Jan 2018 11:33:39 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a DT node for the ADC of the PMIC so that there can be consumers of its IIO channels declaring their consumptions via DT. Signed-off-by: Quentin Schulz --- arch/arm/boot/dts/axp22x.dtsi | 5 +++++ 1 file changed, 5 insertions(+) -- git-series 0.9.1 diff --git a/arch/arm/boot/dts/axp22x.dtsi b/arch/arm/boot/dts/axp22x.dtsi index 87fb08e..65a07a6 100644 --- a/arch/arm/boot/dts/axp22x.dtsi +++ b/arch/arm/boot/dts/axp22x.dtsi @@ -57,6 +57,11 @@ status = "disabled"; }; + axp_adc: adc { + compatible = "x-powers,axp221-adc"; + #io-channel-cells = <1>; + }; + battery_power_supply: battery-power-supply { compatible = "x-powers,axp221-battery-power-supply"; status = "disabled"; From patchwork Mon Jan 15 10:33:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124498 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp624109lje; Mon, 15 Jan 2018 02:35:53 -0800 (PST) X-Google-Smtp-Source: ACJfBouLTCSP8lC9yB1VRDaCh6zD1k6Twj6xabzeZ1vI/Yjdqi3QnPaWfJBRUSBarGP9bknLKV5V X-Received: by 10.98.137.197 with SMTP id n66mr2066930pfk.70.1516012552860; Mon, 15 Jan 2018 02:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012552; cv=none; d=google.com; s=arc-20160816; b=VM5t8fWpG0mw+nMb39mNaZgnt02V2P8p9boXd8apmDfJW7bIfy1rWOtgOmwzb0h332 dPpfU/ylLmSwU760KZ7s3254KwhL0KByf7Su8E6KbG3OweaxwxQ5zjotyArjNmpnu+Js WVVxGi+rGGq89wuDFMWdtqHTbgvclvL3eQ0LFq7REKElcK/Y9s7LLDviFPoXVRFDhCRy MK+uWhB9cWw+BbEYDBIFKGze1uOG+tpjNkvtk3ZVeLpQOUGYOT98u/jh1Jh287J1Xt2J VgS1x9V/jJO6q/urti1XXn7//Nm+vAr/iknCUIkFqs9oUCfhFPw2OqIE8SbRIYouVBVX 9/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=X0DkNV3DsAUep7vKaHciXMgQRx/WQYmsWvPtvjiQUvI=; b=JvAl93W/mCEAVuPRqnFpzwkvvut0CpQ9+m/pp+4X+bqkYkmG5U7lLbF91g2bpgHeXR zng9v3ojlaTrdiAQWfjPkjjZhJUy9wpCiogK/r6mUH4AW5A4tEDb4X+3yLgLgbVsNrXw mexht71mA8TeJGycRleSe+H1fmXZDzdsNmtE7ehD4jQbe52qEswX3Et+1q6bIZO6zB17 AcDKydBJbJ00xIwgCwbe4IMP01T70bHN9RcSEjZNtbzvXkvGC3jsBZQlHbjZmqxaQiDk +EdyLMjRTTueVOpw+aLWYLD/QsglxrrTR/Phi3ZltzrIoXTHtSbWhkP7XNOM7T52NqZs b68g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v32si5940872plb.262.2018.01.15.02.35.52; Mon, 15 Jan 2018 02:35:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933913AbeAOKfS (ORCPT + 28 others); Mon, 15 Jan 2018 05:35:18 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43805 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754864AbeAOKfK (ORCPT ); Mon, 15 Jan 2018 05:35:10 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 376C620877; Mon, 15 Jan 2018 11:35:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5C52B2087F; Mon, 15 Jan 2018 11:34:50 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 06/16] mfd: axp20x: make AXP209/22x cells probe their ADC via DT Date: Mon, 15 Jan 2018 11:33:40 +0100 Message-Id: <8901f920fb8d84f8bf0cb2832f560c78bffc0392.1516012352.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes AXP209 and AXP22x ADCs probe first via DT and then by fallback via platform. Signed-off-by: Quentin Schulz --- drivers/mfd/axp20x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- git-series 0.9.1 diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index e94c72c..1977a03 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -660,6 +660,7 @@ static struct mfd_cell axp20x_cells[] = { .name = "axp20x-regulator", }, { .name = "axp20x-adc", + .of_compatible = "x-powers,axp209-adc", }, { .name = "axp20x-battery-power-supply", .of_compatible = "x-powers,axp209-battery-power-supply", @@ -684,7 +685,8 @@ static struct mfd_cell axp221_cells[] = { }, { .name = "axp20x-regulator", }, { - .name = "axp22x-adc" + .name = "axp22x-adc", + .of_compatible = "x-powers,axp221-adc", }, { .name = "axp20x-ac-power-supply", .of_compatible = "x-powers,axp221-ac-power-supply", @@ -708,6 +710,7 @@ static struct mfd_cell axp223_cells[] = { .resources = axp22x_pek_resources, }, { .name = "axp22x-adc", + .of_compatible = "x-powers,axp221-adc", }, { .name = "axp20x-battery-power-supply", .of_compatible = "x-powers,axp221-battery-power-supply", From patchwork Mon Jan 15 10:33:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124506 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp625098lje; Mon, 15 Jan 2018 02:39:47 -0800 (PST) X-Google-Smtp-Source: ACJfBotPGngjjA02wz7+/Xts8Jc2VE7yjeiNV7tRhfYRGxNiu1I4btVhBQMMwTtUbITmK3abq+Vi X-Received: by 10.98.82.68 with SMTP id g65mr16450130pfb.212.1516012787153; Mon, 15 Jan 2018 02:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012787; cv=none; d=google.com; s=arc-20160816; b=bTBAYZkDfEgrgCG7Q0zfjlmfsMYqUzhYnCBtqcnC5miymTvoTLOOXARfS52L+lE5Pj tOmwhWG2CezrrqCAgbJrwepXqSkcjNMJDfNymVsrmDi6AAMLI5SUU95KYb/x+LvTib5+ fVxihrDAbxpIw9N+UmVnamBCW/k/6MguW3Cjh55DGM38S7MO0/o7d9kpGQ7c1pAc+E75 ha7KYcJwvVBCSay4b5PgqaEO7varVpsi7sg9/Eh75jKIrYqAPxJ2NDgBawNs5AZ2OD6G DiY88z11dgylXjOXETi+/t/CVnObs39qcVaYTzZ1HvwqhSXhfynwc+IOxUMzaTzrZwpy EsGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dlAoGo1/ldNy54xWH18oyVnp45OPBfzY3UNIwbyAGcU=; b=n5ea6i+bQRi8wABJxvNQnirr81RezW5EDqSqx/BpCBmVVbB2asaa8uEuecz1M75Ic1 lp3cKJGOWmuOD/BCr+g5K7MYoCIxT9aV0P4mJtqrEzdB1mPtOI3E+b4iHSsnQ8YGkYna oEHVmUKmJ5o1Pp8hKJEbrVnI90KeG61J6hJTjW1H8ZSwxmUeJxdwGoJTTBdFmhh4JZxM BWkIm0xBtWsxB1P8UvkZ0nA9lvPVN9/lJkm9IoR772+VF4tlM11jEyKRHguZlOOKFVAD BYsTXk/54JteGSgqRb4EBvM0iJT9oeSpr8Fi1DFdn7XlQsLMlihbEIkYXRamTupWyI7S opSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si9865689pla.105.2018.01.15.02.39.46; Mon, 15 Jan 2018 02:39:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755251AbeAOKjo (ORCPT + 28 others); Mon, 15 Jan 2018 05:39:44 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43834 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755336AbeAOKfL (ORCPT ); Mon, 15 Jan 2018 05:35:11 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id B613E20885; Mon, 15 Jan 2018 11:35:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id CE98720884; Mon, 15 Jan 2018 11:34:50 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 07/16] iio: adc: axp20x_adc: add support for AXP813 ADC Date: Mon, 15 Jan 2018 11:33:41 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The X-Powers AXP813 PMIC is really close to what is already done for AXP20X/AXP22X. There are two pairs of bits to set the rate (one for Voltage and Current measurements and one for TS/GPIO0 voltage measurements) instead of one. The register to set the ADC rates is different from the one for AXP20X/AXP22X. GPIO0 can be used as an ADC (measuring Volts) unlike for AXP22X. The scales to apply to the different inputs are unlike the ones from AXP20X and AXP22X. Signed-off-by: Quentin Schulz Acked-by: Jonathan Cameron --- drivers/iio/adc/axp20x_adc.c | 123 ++++++++++++++++++++++++++++++++++++- include/linux/mfd/axp20x.h | 2 +- 2 files changed, 125 insertions(+) -- git-series 0.9.1 diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index 3968053..7cdb8bc 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -35,8 +35,13 @@ #define AXP20X_GPIO10_IN_RANGE_GPIO1_VAL(x) (((x) & BIT(0)) << 1) #define AXP20X_ADC_RATE_MASK GENMASK(7, 6) +#define AXP813_V_I_ADC_RATE_MASK GENMASK(5, 4) +#define AXP813_ADC_RATE_MASK (AXP20X_ADC_RATE_MASK | AXP813_V_I_ADC_RATE_MASK) #define AXP20X_ADC_RATE_HZ(x) ((ilog2((x) / 25) << 6) & AXP20X_ADC_RATE_MASK) #define AXP22X_ADC_RATE_HZ(x) ((ilog2((x) / 100) << 6) & AXP20X_ADC_RATE_MASK) +#define AXP813_TS_GPIO0_ADC_RATE_HZ(x) AXP20X_ADC_RATE_HZ(x) +#define AXP813_V_I_ADC_RATE_HZ(x) ((ilog2((x) / 100) << 4) & AXP813_V_I_ADC_RATE_MASK) +#define AXP813_ADC_RATE_HZ(x) (AXP20X_ADC_RATE_HZ(x) | AXP813_V_I_ADC_RATE_HZ(x)) #define AXP20X_ADC_CHANNEL(_channel, _name, _type, _reg) \ { \ @@ -95,6 +100,12 @@ enum axp22x_adc_channel_i { AXP22X_BATT_DISCHRG_I, }; +enum axp813_adc_channel_v { + AXP813_TS_IN = 0, + AXP813_GPIO0_V, + AXP813_BATT_V, +}; + static struct iio_map axp20x_maps[] = { { .consumer_dev_name = "axp20x-usb-power-supply", @@ -197,6 +208,25 @@ static const struct iio_chan_spec axp22x_adc_channels[] = { AXP20X_BATT_DISCHRG_I_H), }; +static const struct iio_chan_spec axp813_adc_channels[] = { + { + .type = IIO_TEMP, + .address = AXP22X_PMIC_TEMP_H, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE) | + BIT(IIO_CHAN_INFO_OFFSET), + .datasheet_name = "pmic_temp", + }, + AXP20X_ADC_CHANNEL(AXP813_GPIO0_V, "gpio0_v", IIO_VOLTAGE, + AXP288_GP_ADC_H), + AXP20X_ADC_CHANNEL(AXP813_BATT_V, "batt_v", IIO_VOLTAGE, + AXP20X_BATT_V_H), + AXP20X_ADC_CHANNEL(AXP22X_BATT_CHRG_I, "batt_chrg_i", IIO_CURRENT, + AXP20X_BATT_CHRG_I_H), + AXP20X_ADC_CHANNEL(AXP22X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT, + AXP20X_BATT_DISCHRG_I_H), +}; + static int axp20x_adc_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val) { @@ -243,6 +273,18 @@ static int axp22x_adc_raw(struct iio_dev *indio_dev, return IIO_VAL_INT; } +static int axp813_adc_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val) +{ + struct axp20x_adc_iio *info = iio_priv(indio_dev); + + *val = axp20x_read_variable_width(info->regmap, chan->address, 12); + if (*val < 0) + return *val; + + return IIO_VAL_INT; +} + static int axp20x_adc_scale_voltage(int channel, int *val, int *val2) { switch (channel) { @@ -273,6 +315,24 @@ static int axp20x_adc_scale_voltage(int channel, int *val, int *val2) } } +static int axp813_adc_scale_voltage(int channel, int *val, int *val2) +{ + switch (channel) { + case AXP813_GPIO0_V: + *val = 0; + *val2 = 800000; + return IIO_VAL_INT_PLUS_MICRO; + + case AXP813_BATT_V: + *val = 1; + *val2 = 100000; + return IIO_VAL_INT_PLUS_MICRO; + + default: + return -EINVAL; + } +} + static int axp20x_adc_scale_current(int channel, int *val, int *val2) { switch (channel) { @@ -342,6 +402,26 @@ static int axp22x_adc_scale(struct iio_chan_spec const *chan, int *val, } } +static int axp813_adc_scale(struct iio_chan_spec const *chan, int *val, + int *val2) +{ + switch (chan->type) { + case IIO_VOLTAGE: + return axp813_adc_scale_voltage(chan->channel, val, val2); + + case IIO_CURRENT: + *val = 1; + return IIO_VAL_INT; + + case IIO_TEMP: + *val = 100; + return IIO_VAL_INT; + + default: + return -EINVAL; + } +} + static int axp20x_adc_offset_voltage(struct iio_dev *indio_dev, int channel, int *val) { @@ -425,6 +505,26 @@ static int axp22x_read_raw(struct iio_dev *indio_dev, } } +static int axp813_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) +{ + switch (mask) { + case IIO_CHAN_INFO_OFFSET: + *val = -2667; + return IIO_VAL_INT; + + case IIO_CHAN_INFO_SCALE: + return axp813_adc_scale(chan, val, val2); + + case IIO_CHAN_INFO_RAW: + return axp813_adc_raw(indio_dev, chan, val); + + default: + return -EINVAL; + } +} + static int axp20x_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int val, int val2, long mask) @@ -470,6 +570,10 @@ static const struct iio_info axp22x_adc_iio_info = { .read_raw = axp22x_read_raw, }; +static const struct iio_info axp813_adc_iio_info = { + .read_raw = axp813_read_raw, +}; + static int axp20x_adc_rate(struct axp20x_adc_iio *info, int rate) { return regmap_update_bits(info->regmap, AXP20X_ADC_RATE, @@ -484,6 +588,13 @@ static int axp22x_adc_rate(struct axp20x_adc_iio *info, int rate) AXP22X_ADC_RATE_HZ(rate)); } +static int axp813_adc_rate(struct axp20x_adc_iio *info, int rate) +{ + return regmap_update_bits(info->regmap, AXP813_ADC_RATE, + AXP813_ADC_RATE_MASK, + AXP813_ADC_RATE_HZ(rate)); +} + struct axp_data { const struct iio_info *iio_info; int num_channels; @@ -515,9 +626,20 @@ static const struct axp_data axp22x_data = { .maps = axp22x_maps, }; +static const struct axp_data axp813_data = { + .iio_info = &axp813_adc_iio_info, + .num_channels = ARRAY_SIZE(axp813_adc_channels), + .channels = axp813_adc_channels, + .adc_en1_mask = AXP22X_ADC_EN1_MASK, + .adc_rate = axp813_adc_rate, + .adc_en2 = false, + .maps = axp22x_maps, +}; + static const struct of_device_id axp20x_adc_of_match[] = { { .compatible = "x-powers,axp209-adc", .data = (void *)&axp20x_data, }, { .compatible = "x-powers,axp221-adc", .data = (void *)&axp22x_data, }, + { .compatible = "x-powers,axp813-adc", .data = (void *)&axp813_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, axp20x_adc_of_match); @@ -525,6 +647,7 @@ MODULE_DEVICE_TABLE(of, axp20x_adc_of_match); static const struct platform_device_id axp20x_adc_id_match[] = { { .name = "axp20x-adc", .driver_data = (kernel_ulong_t)&axp20x_data, }, { .name = "axp22x-adc", .driver_data = (kernel_ulong_t)&axp22x_data, }, + { .name = "axp813-adc", .driver_data = (kernel_ulong_t)&axp813_data, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(platform, axp20x_adc_id_match); diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 080798f..82bf774 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -266,6 +266,8 @@ enum axp20x_variants { #define AXP288_RT_BATT_V_H 0xa0 #define AXP288_RT_BATT_V_L 0xa1 +#define AXP813_ADC_RATE 0x85 + /* Fuel Gauge */ #define AXP288_FG_RDC1_REG 0xba #define AXP288_FG_RDC0_REG 0xbb From patchwork Mon Jan 15 10:33:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124502 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp624698lje; Mon, 15 Jan 2018 02:38:09 -0800 (PST) X-Google-Smtp-Source: ACJfBovxomMnLF0zHhnGAweIRtxUi5KWMrQhzh407e0zmaIkIS6//YG5gLyR2NR4SDqQ1ePdqJfn X-Received: by 10.98.252.82 with SMTP id e79mr12298386pfh.159.1516012689594; Mon, 15 Jan 2018 02:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012689; cv=none; d=google.com; s=arc-20160816; b=L1ojQIT7b/WQ+bc9a1D871nXr9Ddcrew1XFyQ+gNzqLdGMnr8Y1ZrmBjKNeylPj6Kz 9dp0PkdP6vf8Sjpp5aK7GcIkswtuwehmpK+A+JQbDEzBxB/wTI/SK4tpsPmIvD3fspYL vqZGjAQZZu44TjUZkyJvJx/ts/JDBFSvqHE2M0AkOAp3eomswJjB1QbqtolMs/xeyRzb v7DizC95GQloMoVUsQT1LtgS6t4RbDjUClBhmIDph+ANOnToRvpFMhPcLz7DmSiCHrkG aVMp2fzpo3bEyg+cdgmYuwu89WQvlcdgUcfqpXKsLyEaFrYwX2BFIyrADP+b6oXJPX5W Ma9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QlEqDCr++M3GEVZnuUm730kDTz++/m22zQtVn6glbWc=; b=KtRuKDNb53N1jgnMJtDD5VC8RKxlog5KrglKJS9AiC1doU5nbBv9lNV1NCUXjKw/Xj y36fOEoNMI1mD/FCxLCXCGWezcPLcuR5LRf6CRlQq4kaVRq2RUK9UMB2YhQr4oncC+QT nBE86+WVSnsO+M0gO0PcoNEZsJ30T4gAW1Sdzt9HIOl7rJTd/RSIXIYXBnVIsCvsDa53 zmWtUeOaqCpJcAJOL8Xdy9C0hDk4Bw/+yJFjTW8+BgZZVnUAIWdn0LXRgN4E6SKvAhdR u61s/oYjlitl6wJG9ZylnPp7bq4tmxioRs4rARZ2cqCiz0CpQIfjOYIMDj0X79tRg4Ye jZ2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si13932899plz.285.2018.01.15.02.38.09; Mon, 15 Jan 2018 02:38:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbeAOKiG (ORCPT + 28 others); Mon, 15 Jan 2018 05:38:06 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43907 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755345AbeAOKfN (ORCPT ); Mon, 15 Jan 2018 05:35:13 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 32D1C20886; Mon, 15 Jan 2018 11:35:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 31D9420887; Mon, 15 Jan 2018 11:34:52 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 10/16] power: supply: axp20x_battery: use data structure instead of ID for Date: Mon, 15 Jan 2018 11:33:44 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org variant specific code We used to use IDs to select a function or a feature depending on the variant. It's easier to maintain the code by adding data structure storing the few differences between variants so that we don't add a pile of if conditions. Let's use this data structure and update the code to use it. Signed-off-by: Quentin Schulz --- drivers/power/supply/axp20x_battery.c | 100 +++++++++++++++++---------- 1 file changed, 66 insertions(+), 34 deletions(-) -- git-series 0.9.1 Reviewed-by: Chen-Yu Tsai diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c index 7494f0f..d73c78f 100644 --- a/drivers/power/supply/axp20x_battery.c +++ b/drivers/power/supply/axp20x_battery.c @@ -53,6 +53,16 @@ #define AXP20X_V_OFF_MASK GENMASK(2, 0) +struct axp20x_batt_ps; + +struct axp_data { + int ccc_scale; + int ccc_offset; + bool has_fg_valid; + int (*get_max_voltage)(struct axp20x_batt_ps *batt, int *val); + int (*set_max_voltage)(struct axp20x_batt_ps *batt, int val); +}; + struct axp20x_batt_ps { struct regmap *regmap; struct power_supply *batt; @@ -62,7 +72,7 @@ struct axp20x_batt_ps { struct iio_channel *batt_v; /* Maximum constant charge current */ unsigned int max_ccc; - u8 axp_id; + struct axp_data *data; }; static int axp20x_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt, @@ -123,22 +133,6 @@ static int axp22x_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt, return 0; } -static void raw_to_constant_charge_current(struct axp20x_batt_ps *axp, int *val) -{ - if (axp->axp_id == AXP209_ID) - *val = *val * 100000 + 300000; - else - *val = *val * 150000 + 300000; -} - -static void constant_charge_current_to_raw(struct axp20x_batt_ps *axp, int *val) -{ - if (axp->axp_id == AXP209_ID) - *val = (*val - 300000) / 100000; - else - *val = (*val - 300000) / 150000; -} - static int axp20x_get_constant_charge_current(struct axp20x_batt_ps *axp, int *val) { @@ -150,7 +144,7 @@ static int axp20x_get_constant_charge_current(struct axp20x_batt_ps *axp, *val &= AXP20X_CHRG_CTRL1_TGT_CURR; - raw_to_constant_charge_current(axp, val); + *val = *val * axp->data->ccc_scale + axp->data->ccc_offset; return 0; } @@ -269,8 +263,7 @@ static int axp20x_battery_get_prop(struct power_supply *psy, if (ret) return ret; - if (axp20x_batt->axp_id == AXP221_ID && - !(reg & AXP22X_FG_VALID)) + if (axp20x_batt->data->has_fg_valid && !(reg & AXP22X_FG_VALID)) return -EINVAL; /* @@ -281,11 +274,8 @@ static int axp20x_battery_get_prop(struct power_supply *psy, break; case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: - if (axp20x_batt->axp_id == AXP209_ID) - return axp20x_battery_get_max_voltage(axp20x_batt, - &val->intval); - return axp22x_battery_get_max_voltage(axp20x_batt, - &val->intval); + return axp20x_batt->data->get_max_voltage(axp20x_batt, + &val->intval); case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: ret = regmap_read(axp20x_batt->regmap, AXP20X_V_OFF, ®); @@ -312,6 +302,32 @@ static int axp20x_battery_get_prop(struct power_supply *psy, return 0; } +static int axp22x_battery_set_max_voltage(struct axp20x_batt_ps *axp20x_batt, + int val) +{ + switch (val) { + case 4100000: + val = AXP20X_CHRG_CTRL1_TGT_4_1V; + break; + + case 4200000: + val = AXP20X_CHRG_CTRL1_TGT_4_2V; + break; + + default: + /* + * AXP20x max voltage can be set to 4.36V and AXP22X max voltage + * can be set to 4.22V and 4.24V, but these voltages are too + * high for Lithium based batteries (AXP PMICs are supposed to + * be used with these kinds of battery). + */ + return -EINVAL; + } + + return regmap_update_bits(axp20x_batt->regmap, AXP20X_CHRG_CTRL1, + AXP20X_CHRG_CTRL1_TGT_VOLT, val); +} + static int axp20x_battery_set_max_voltage(struct axp20x_batt_ps *axp20x_batt, int val) { @@ -321,9 +337,6 @@ static int axp20x_battery_set_max_voltage(struct axp20x_batt_ps *axp20x_batt, break; case 4150000: - if (axp20x_batt->axp_id == AXP221_ID) - return -EINVAL; - val = AXP20X_CHRG_CTRL1_TGT_4_15V; break; @@ -351,7 +364,8 @@ static int axp20x_set_constant_charge_current(struct axp20x_batt_ps *axp_batt, if (charge_current > axp_batt->max_ccc) return -EINVAL; - constant_charge_current_to_raw(axp_batt, &charge_current); + charge_current = (charge_current - axp_batt->data->ccc_offset) / + axp_batt->data->ccc_scale; if (charge_current > AXP20X_CHRG_CTRL1_TGT_CURR || charge_current < 0) return -EINVAL; @@ -365,12 +379,14 @@ static int axp20x_set_max_constant_charge_current(struct axp20x_batt_ps *axp, { bool lower_max = false; - constant_charge_current_to_raw(axp, &charge_current); + charge_current = (charge_current - axp->data->ccc_offset) / + axp->data->ccc_scale; if (charge_current > AXP20X_CHRG_CTRL1_TGT_CURR || charge_current < 0) return -EINVAL; - raw_to_constant_charge_current(axp, &charge_current); + charge_current = charge_current * axp->data->ccc_scale + + axp->data->ccc_offset; if (charge_current > axp->max_ccc) dev_warn(axp->dev, @@ -460,13 +476,28 @@ static const struct power_supply_desc axp20x_batt_ps_desc = { .set_property = axp20x_battery_set_prop, }; +struct axp_data axp209_data = { + .ccc_scale = 100000, + .ccc_offset = 300000, + .get_max_voltage = axp20x_battery_get_max_voltage, + .set_max_voltage = axp20x_battery_set_max_voltage, +}; + +struct axp_data axp221_data = { + .ccc_scale = 150000, + .ccc_offset = 300000, + .has_fg_valid = true, + .get_max_voltage = axp22x_battery_get_max_voltage, + .set_max_voltage = axp22x_battery_set_max_voltage, +}; + static const struct of_device_id axp20x_battery_ps_id[] = { { .compatible = "x-powers,axp209-battery-power-supply", - .data = (void *)AXP209_ID, + .data = (void *)&axp209_data, }, { .compatible = "x-powers,axp221-battery-power-supply", - .data = (void *)AXP221_ID, + .data = (void *)&axp221_data, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, axp20x_battery_ps_id); @@ -476,6 +507,7 @@ static int axp20x_power_probe(struct platform_device *pdev) struct axp20x_batt_ps *axp20x_batt; struct power_supply_config psy_cfg = {}; struct power_supply_battery_info info; + struct device *dev = &pdev->dev; if (!of_device_is_available(pdev->dev.of_node)) return -ENODEV; @@ -516,7 +548,7 @@ static int axp20x_power_probe(struct platform_device *pdev) psy_cfg.drv_data = axp20x_batt; psy_cfg.of_node = pdev->dev.of_node; - axp20x_batt->axp_id = (uintptr_t)of_device_get_match_data(&pdev->dev); + axp20x_batt->data = (struct axp_data *)of_device_get_match_data(dev); axp20x_batt->batt = devm_power_supply_register(&pdev->dev, &axp20x_batt_ps_desc, From patchwork Mon Jan 15 10:33:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124503 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp624758lje; Mon, 15 Jan 2018 02:38:24 -0800 (PST) X-Google-Smtp-Source: ACJfBotWPRX2wjJnduzWJaaGpe3Y34fC8VooS/okZ15BLetgZF/jDBeMpId7Pov0lArxjzGxX3vd X-Received: by 10.98.228.5 with SMTP id r5mr6944734pfh.193.1516012704007; Mon, 15 Jan 2018 02:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012704; cv=none; d=google.com; s=arc-20160816; b=CcCxfLqYOgGD81ir4D1oltOZAyYbtTBtgf9XXZecdYnlndGwJ+dqJbdzMjCl01fELR 5xU6cWjgICSPmI0WPFaCRpQf8QQUIa9xoc5h1H+MvmxsAoegVahE23h6EZQiiVZo4e0d HIXWpBfBqGM3xnm/uIT1BJgMHYenU+NHIB4YxQgQ94UaEi72hwiunHjZWbOEfbsTALDX gQQ5CJjCq/B6zQrb9y7+5fZNfBD8qngo2TiWAH6Ve0oVaP9KN8FDVDl8Kn2wkMR8bu4P oPfj18AtNReMZto5Ba8+g0IgSQBQ2RquqAcy1e/FeZsSoInD38vPJmMump+vd8fehZro 23GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jdiDopYwEzskOFxjtgFntp+DT2uRFwy9HKgPZCt7vH0=; b=DC0LT7Lsps9ehPlBIvUTNV4tlUabkDuIfLY+wLjE7QbBUAF+oGDr+WbSHYydgZpd7l w4aZrIHCAXZiHRho66pbP9WLTKI9WpTEbGBpi7hg3I82rjM42s7/avAUt4W7Ye5+jl2D Nb7OCi+d7tQ4T8oTUgrrdt6+nzToIYChFbZOw6ChShb8V9zwx3onzjxtHrHc3XgBV9nr exRYhGCxP5WsSqnSKwVtZekUkVO4rZQNri/jeL7FRQPOnOdvFmy4/VJVFikaDf3Pdsm8 CJkOt7nYTy/Leh5JHxBv8a3KdK0H4Yi6Cee3vbKtxc3iL2t0u92YUVE82rqIubDj1/k2 RsIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w130si20467397pfd.95.2018.01.15.02.38.23; Mon, 15 Jan 2018 02:38:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754997AbeAOKiF (ORCPT + 28 others); Mon, 15 Jan 2018 05:38:05 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43908 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755346AbeAOKfN (ORCPT ); Mon, 15 Jan 2018 05:35:13 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 0BDBB208B0; Mon, 15 Jan 2018 11:35:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9672F2088B; Mon, 15 Jan 2018 11:34:53 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 13/16] mfd: axp20x: add battery power supply cell for AXP813 Date: Mon, 15 Jan 2018 11:33:47 +0100 Message-Id: <76855b0d3b9eb75e00eb6a058db5b4a33b0558c6.1516012352.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As axp20x-battery-power-supply now supports AXP813, add a cell for it. Signed-off-by: Quentin Schulz Acked-for-MFD-by: Lee Jones --- drivers/mfd/axp20x.c | 3 +++ 1 file changed, 3 insertions(+) -- git-series 0.9.1 Acked-by: Chen-Yu Tsai diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index e5516aa..aaf2acb 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -888,6 +888,9 @@ static struct mfd_cell axp813_cells[] = { }, { .name = "axp813-adc", .of_compatible = "x-powers,axp813-adc", + }, { + .name = "axp20x-battery-power-supply", + .of_compatible = "x-powers,axp813-battery-power-supply", }, }; From patchwork Mon Jan 15 10:33:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124500 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp624452lje; Mon, 15 Jan 2018 02:37:10 -0800 (PST) X-Google-Smtp-Source: ACJfBot2hKEd44h7vXFUaX0gUXb+xGHBEju4PMD5z+azZvxx4AGpSag0yuku5eqf5PZ204H38pdt X-Received: by 10.159.196.135 with SMTP id c7mr33733565plo.367.1516012630171; Mon, 15 Jan 2018 02:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012630; cv=none; d=google.com; s=arc-20160816; b=TCLBPVMqC7G+EZqr4r5Gs0OosR5iH9JrScE8rKCGnm5f4Olcnr70VRhNjmLXxA1T2N 8BUNU+6TMtbF7kMUXJPafFGszBn+X6dJB8JAA0kG1XEIBYTj5+Vpk4qnK1a61EeYWus4 HuRWucD+1XyniaR9mdCGn5DvqZbnttJT4/5a8GLMmJKalTa1WlAQTJk3duMRT8oGIvmY N1DiBcXG9BwKWbDjlOaq0dCeDM78FV7cF/o9s2hDC6AUAz14ko9jTPiRO7N0a/p1ir0C 444QjnML960n6dLaHkvSKpi0k4/7cWcmj1XaxuxdkKrErJW0hgTWDs6X6Qg4jIPK1BVy kJcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=a+ZYdTFGpQocYJoAKilYr+cBEU5ue2U8/inxJoOjB+0=; b=LlVKv+mFuKmg5IadN/oGT1YEMUgErjZTZtkn21/BJB1tiHlnGPKTAffJpMu8bMnHWi HlbvLl4bXzSpdX/ZBpr2PVX8EgT70UeeHxBvZSNiJEemafSOo3+fYYbinldBJ2dCXD+x hSh8nRIHsbiaxtiHsrkufyKiJE162bv/jKFIHagKr3FtS+tcP8B56SrUF/Frw0S0pvcp oxE6GYV7D3PQ5nA6m5Ch9C8aS3SzUaYyhAyfobun5zcoBw1mSiVOIpI8u6yFniu4g2jq Gw+k/lWeVSIw7Hs/iiziP7POSzfFPZvxMxUcsF49q03VR7b9qvneRbxux6giAwvvDuLY W7JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k127si12368467pgc.352.2018.01.15.02.37.09; Mon, 15 Jan 2018 02:37:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934236AbeAOKhI (ORCPT + 28 others); Mon, 15 Jan 2018 05:37:08 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43910 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755348AbeAOKfN (ORCPT ); Mon, 15 Jan 2018 05:35:13 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 131EA208AF; Mon, 15 Jan 2018 11:35:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 836572088D; Mon, 15 Jan 2018 11:34:54 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 15/16] ARM: dtsi: sun8i: a711: enable battery power supply subnode Date: Mon, 15 Jan 2018 11:33:49 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The TBS A711 has an AXP813 PMIC and a soldered battery, thus, we enable the battery power supply subnode in its Device Tree. Signed-off-by: Quentin Schulz --- arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++++ 1 file changed, 4 insertions(+) -- git-series 0.9.1 diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts index 511fca4..1de362f 100644 --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts @@ -231,6 +231,10 @@ #include "axp81x.dtsi" +&battery_power_supply { + status = "okay"; +}; + ®_aldo1 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; From patchwork Mon Jan 15 10:33:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 124497 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp624000lje; Mon, 15 Jan 2018 02:35:26 -0800 (PST) X-Google-Smtp-Source: ACJfBovmRo2tIvUSz7rC/glaqP8KM7zO/B5QQ6zP+m7opeDxGGgv4eEQy/zxlUClSMs5uSHxHVeB X-Received: by 10.101.66.193 with SMTP id l1mr9946596pgp.17.1516012525907; Mon, 15 Jan 2018 02:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516012525; cv=none; d=google.com; s=arc-20160816; b=A8fd7M066avHbLZCGfVWm6PjEcmPlcBdvjRfr2XVTOl9vNkLUS1huYye2Tp6XVi+S1 G9hwFOdsNoNts7pTZUmeiJTb0fglw99h88Tqh7pUR6sOLNtX2jNEbfJvooPooLdbOgUY Xd5a3RG3mmVUxG5/IBxQOVuNE8RGvMGYyWLwJkknnorwq0NpBShZpmDEQ8HeB/C9eBW1 FL5dd97JvRCxPpQgM+eETjTaj51Kt7zJa/DGN7PgI7rUkEiscF/S7akCyAHPnVWwSq5C eO7Cnd3mxJb0Dlu7sGVxuv1TORYgtR+OJBabZCuQwH5oZUCy4hCVKb2Dn24961QWwC89 +idw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hzZMcy4PChe1SBMAuXn1ACrxfTgEwDn/6iSZp+t8IzY=; b=bIRzFxO1jkOQI9A42mo8FFqDzu5DKi7N1TkEkC7BRxadEEwqv/ANj4QZK7uHMwnFH8 TAWoqBgQktWKB/6V8c+31dquz0p0MVtX9KImNB9AoXey8Hmc1XfLLK8qvTN+3o6BURa8 9HFe4nQxtDcx0dG16Rz9R+QhG8awjgaws8NEsc6tlovkSpsGKFJ26Iv06Lhp7DqG7rBR VHvfK0O+uSD1Mtlq5BJkqlTKXor3SFwfW+Z0HtCif5VeOpCjLfrkBU5TZxEIH93+rBVA jYqJAd+/tZGi+G2SAjuhGhIdu8MXVM8ig9dPsGh/MC2bVh8R88LjHMgmuwBEXeCp0Ogc IQeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c134si11176851pga.329.2018.01.15.02.35.25; Mon, 15 Jan 2018 02:35:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934028AbeAOKfX (ORCPT + 28 others); Mon, 15 Jan 2018 05:35:23 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43936 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754540AbeAOKfU (ORCPT ); Mon, 15 Jan 2018 05:35:20 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 4E67120890; Mon, 15 Jan 2018 11:35:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 023C82088E; Mon, 15 Jan 2018 11:34:54 +0100 (CET) From: Quentin Schulz To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, sre@kernel.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, julian.calaby@gmail.com, Quentin Schulz Subject: [PATCH v3 16/16] ARM: dtsi: axp81x: remove IP name from DT node name Date: Mon, 15 Jan 2018 11:33:50 +0100 Message-Id: <6e881951c43b8829cd509c3db06fa5520f71e779.1516012352.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DT node should be named after its functionality and not after the IP it's defining. Signed-off-by: Quentin Schulz --- arch/arm/boot/dts/axp81x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- git-series 0.9.1 Acked-by: Chen-Yu Tsai diff --git a/arch/arm/boot/dts/axp81x.dtsi b/arch/arm/boot/dts/axp81x.dtsi index 1b05c7f..043c717 100644 --- a/arch/arm/boot/dts/axp81x.dtsi +++ b/arch/arm/boot/dts/axp81x.dtsi @@ -53,7 +53,7 @@ #io-channel-cells = <1>; }; - axp_gpio: axp-gpio { + axp_gpio: gpio { compatible = "x-powers,axp813-gpio"; gpio-controller; #gpio-cells = <2>;