[{"id":1772880,"web_url":"http://patchwork.ozlabs.org/comment/1772880/","msgid":"<20170921154621.0000328d@huawei.com>","list_archive_url":null,"date":"2017-09-21T14:46:21","subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","submitter":{"id":71988,"url":"http://patchwork.ozlabs.org/api/people/71988/","name":"Jonathan Cameron","email":"Jonathan.Cameron@huawei.com"},"content":"On Wed, 20 Sep 2017 23:18:07 +0800\nIcenowy Zheng <icenowy@aosc.io> wrote:\n\n> The AXP803 PMIC, used by most Allwinner A64 boards, features 3 power inputs:\n> AC, USB and Battery.\n> \n> This patchset adds support for the AC and Battery supplies, which is useful\n> for the boards from Pine64 (Pine64, SoPine w/ baseboard model A, Pinebook).\n> \n> The USB supply is not yet supported in this patchset because it's not\n> present on Pine series boards.\n> \n> In order to enable battery monitoring the ADC for battery is also enabled\n> for AXs.\n> \n> In order to enable battery monitoring the ADC for battery is also enabled\n> for AXP803.\n\nI'll go with the obvious question...\n\nWhy an RFC rather than a standard patch submission? I'm not immediately\nseeing what is controversial!\n\nJonathan\n\n> \n> Icenowy Zheng (7):\n>   dt-bindings: add compatibles for AXP803 Battery/USB power supplies\n>   iio: adc: axp20x-adc: allow to skip ADC rate setup now\n>   iio: adc: axp20x-adc: add support for AXP803\n>   power: supply: axp20x-battery: support AXP803\n>   mfd: axp20x: add cells for AXP803 ADC/AC Power/Battery\n>   arm64: allwinner: a64: add power supply nodes in AXP803 DTSI\n>   arm64: allwinner: a64: enable AC and Battery for Pine64\n> \n>  .../bindings/power/supply/axp20x_battery.txt       |   1 +\n>  .../bindings/power/supply/axp20x_usb_power.txt     |   1 +\n>  arch/arm64/boot/dts/allwinner/axp803.dtsi          |  15 +++\n>  .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |   8 ++\n>  drivers/iio/adc/axp20x_adc.c                       | 114 ++++++++++++++++++++-\n>  drivers/mfd/axp20x.c                               |  11 ++\n>  drivers/power/supply/axp20x_battery.c              |  88 ++++++++++++++--\n>  7 files changed, 226 insertions(+), 12 deletions(-)\n> \n\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyfZn1mlGz9sP1\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 00:46:57 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751629AbdIUOqz (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tThu, 21 Sep 2017 10:46:55 -0400","from szxga05-in.huawei.com ([45.249.212.191]:6538 \"EHLO\n\tszxga05-in.huawei.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751387AbdIUOqy (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Thu, 21 Sep 2017 10:46:54 -0400","from 172.30.72.60 (EHLO DGGEMS412-HUB.china.huawei.com)\n\t([172.30.72.60])\n\tby dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued)\n\twith ESMTP id DHT69867; Thu, 21 Sep 2017 22:46:41 +0800 (CST)","from localhost (10.206.48.115) by DGGEMS412-HUB.china.huawei.com\n\t(10.3.19.212) with Microsoft SMTP Server (TLS) id 14.3.301.0;\n\tThu, 21 Sep 2017 22:46:35 +0800"],"Date":"Thu, 21 Sep 2017 15:46:21 +0100","From":"Jonathan Cameron <Jonathan.Cameron@huawei.com>","To":"Icenowy Zheng <icenowy@aosc.io>","CC":"Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, \"Lee Jones\" <lee.jones@linaro.org>, \n\tQuentin Schulz <quentin.schulz@free-electrons.com>,\n\t<devicetree@vger.kernel.org>, <linux-pm@vger.kernel.org>,\n\t<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\t<linux-sunxi@googlegroups.com>, <linux-arm-kernel@lists.infradead.org>","Subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","Message-ID":"<20170921154621.0000328d@huawei.com>","In-Reply-To":"<20170920151814.22461-1-icenowy@aosc.io>","References":"<20170920151814.22461-1-icenowy@aosc.io>","Organization":"Huawei","X-Mailer":"Claws Mail 3.15.0 (GTK+ 2.24.31; x86_64-w64-mingw32)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","Content-Transfer-Encoding":"7bit","X-Originating-IP":"[10.206.48.115]","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A020201.59C3D0D3.0058, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"45ae5d313cc1ccfada3cb2743d239cd3","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1772914,"web_url":"http://patchwork.ozlabs.org/comment/1772914/","msgid":"<CF74A2A9-B9F4-4413-975B-A0F4B24686A3@aosc.io>","list_archive_url":null,"date":"2017-09-21T15:20:11","subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","submitter":{"id":71295,"url":"http://patchwork.ozlabs.org/api/people/71295/","name":"Icenowy Zheng","email":"icenowy@aosc.io"},"content":"于 2017年9月21日 GMT+08:00 下午10:46:21, Jonathan Cameron <Jonathan.Cameron@huawei.com> 写到:\n>On Wed, 20 Sep 2017 23:18:07 +0800\n>Icenowy Zheng <icenowy@aosc.io> wrote:\n>\n>> The AXP803 PMIC, used by most Allwinner A64 boards, features 3 power\n>inputs:\n>> AC, USB and Battery.\n>> \n>> This patchset adds support for the AC and Battery supplies, which is\n>useful\n>> for the boards from Pine64 (Pine64, SoPine w/ baseboard model A,\n>Pinebook).\n>> \n>> The USB supply is not yet supported in this patchset because it's not\n>> present on Pine series boards.\n>> \n>> In order to enable battery monitoring the ADC for battery is also\n>enabled\n>> for AXs.\n>> \n>> In order to enable battery monitoring the ADC for battery is also\n>enabled\n>> for AXP803.\n>\n>I'll go with the obvious question...\n>\n>Why an RFC rather than a standard patch submission? I'm not immediately\n>seeing what is controversial!\n\nOh I am just not confident about this patchset,\nespecially the IIO part.\n\n>\n>Jonathan\n>\n>> \n>> Icenowy Zheng (7):\n>>   dt-bindings: add compatibles for AXP803 Battery/USB power supplies\n>>   iio: adc: axp20x-adc: allow to skip ADC rate setup now\n>>   iio: adc: axp20x-adc: add support for AXP803\n>>   power: supply: axp20x-battery: support AXP803\n>>   mfd: axp20x: add cells for AXP803 ADC/AC Power/Battery\n>>   arm64: allwinner: a64: add power supply nodes in AXP803 DTSI\n>>   arm64: allwinner: a64: enable AC and Battery for Pine64\n>> \n>>  .../bindings/power/supply/axp20x_battery.txt       |   1 +\n>>  .../bindings/power/supply/axp20x_usb_power.txt     |   1 +\n>>  arch/arm64/boot/dts/allwinner/axp803.dtsi          |  15 +++\n>>  .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |   8 ++\n>>  drivers/iio/adc/axp20x_adc.c                       | 114\n>++++++++++++++++++++-\n>>  drivers/mfd/axp20x.c                               |  11 ++\n>>  drivers/power/supply/axp20x_battery.c              |  88\n>++++++++++++++--\n>>  7 files changed, 226 insertions(+), 12 deletions(-)\n>> \n>\n>\n>_______________________________________________\n>linux-arm-kernel mailing list\n>linux-arm-kernel@lists.infradead.org\n>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xygKg1pxlz9t4B\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 01:20:39 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751629AbdIUPUh convert rfc822-to-8bit (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tThu, 21 Sep 2017 11:20:37 -0400","from hermes.aosc.io ([199.195.250.187]:56936 \"EHLO hermes.aosc.io\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751387AbdIUPUg (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tThu, 21 Sep 2017 11:20:36 -0400","from localhost (localhost [127.0.0.1]) (Authenticated sender:\n\ticenowy@aosc.io)\n\tby hermes.aosc.io (Postfix) with ESMTPSA id 2E2E74787D;\n\tThu, 21 Sep 2017 15:20:22 +0000 (UTC)"],"Date":"Thu, 21 Sep 2017 23:20:11 +0800","In-Reply-To":"<20170921154621.0000328d@huawei.com>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170921154621.0000328d@huawei.com>","MIME-Version":"1.0","Content-Type":"text/plain;\n charset=utf-8","Content-Transfer-Encoding":"8BIT","Subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","To":"linux-arm-kernel@lists.infradead.org,\n\tJonathan Cameron <Jonathan.Cameron@huawei.com>","CC":"devicetree@vger.kernel.org, linux-pm@vger.kernel.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com,\n\tlinux-kernel@vger.kernel.org,\n\tQuentin Schulz <quentin.schulz@free-electrons.com>,\n\tChen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tLee Jones <lee.jones@linaro.org>, Jonathan Cameron <jic23@kernel.org>","From":"Icenowy Zheng <icenowy@aosc.io>","Message-ID":"<CF74A2A9-B9F4-4413-975B-A0F4B24686A3@aosc.io>","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774215,"web_url":"http://patchwork.ozlabs.org/comment/1774215/","msgid":"<20170924153233.14eb8964@archlinux>","list_archive_url":null,"date":"2017-09-24T14:32:33","subject":"Re: [RFC PATCH 3/7] iio: adc: axp20x-adc: add support for AXP803","submitter":{"id":10151,"url":"http://patchwork.ozlabs.org/api/people/10151/","name":"Jonathan Cameron","email":"jic23@kernel.org"},"content":"On Wed, 20 Sep 2017 23:18:10 +0800\nIcenowy Zheng <icenowy@aosc.io> wrote:\n\n> AXP803 SoC features an ADC part including these channels: GPADC (GPIO0)\n> and TS pins, PMIC internal temperature sensor, battery voltage, battery\n> charge/discharge current.\n> \n> Add support for the battery-related channels and internal temperature\n> channel in order to allow battery monitoring. The TS and GPADC channels\n> are complex and will be support after more investigation.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n\nA few comments inline but this looks good to me.\n\nI will want to leave plenty of time for others to comment however, particularly\nQuentin.\n\nThanks,\n\nJonathan\n\n> ---\n>  drivers/iio/adc/axp20x_adc.c | 108 +++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 108 insertions(+)\n> \n> diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c\n> index 93dd6b80059e..4f0cd98cf6ea 100644\n> --- a/drivers/iio/adc/axp20x_adc.c\n> +++ b/drivers/iio/adc/axp20x_adc.c\n> @@ -28,6 +28,8 @@\n>  \n>  #define AXP20X_ADC_EN2_MASK\t\t\t(GENMASK(3, 2) | BIT(7))\n>  #define AXP22X_ADC_EN1_MASK\t\t\t(GENMASK(7, 5) | BIT(0))\n> +/* TODO: Enable TS and GPADC when supporting them */\n> +#define AXP803_ADC_EN1_MASK\t\t\tGENMASK(7, 5)\n>  \n>  #define AXP20X_GPIO10_IN_RANGE_GPIO0\t\tBIT(0)\n>  #define AXP20X_GPIO10_IN_RANGE_GPIO1\t\tBIT(1)\n> @@ -95,6 +97,17 @@ enum axp22x_adc_channel_i {\n>  \tAXP22X_BATT_DISCHRG_I,\n>  };\n>  \n> +enum axp803_adc_channel_v {\n> +\tAXP803_TS_IN = 0,\n> +\tAXP803_GPADC_IN,\n> +\tAXP803_BATT_V,\n> +};\n> +\n> +enum axp803_adc_channel_i {\n> +\tAXP803_BATT_CHRG_I = 2,\n> +\tAXP803_BATT_DISCHRG_I,\n> +};\n> +\n>  static struct iio_map axp20x_maps[] = {\n>  \t{\n>  \t\t.consumer_dev_name = \"axp20x-usb-power-supply\",\n> @@ -144,6 +157,11 @@ static struct iio_map axp22x_maps[] = {\n>  };\n>  \n>  /*\n> + * AXP803 shares the same consumer map with AXP22x, as it has no ADC for\n> + * VBUS and ACIN inputs either.\n> + */\n> +\n> +/*\n>   * Channels are mapped by physical system. Their channels share the same index.\n>   * i.e. acin_i is in_current0_raw and acin_v is in_voltage0_raw.\n>   * The only exception is for the battery. batt_v will be in_voltage6_raw and\n> @@ -197,6 +215,23 @@ static const struct iio_chan_spec axp22x_adc_channels[] = {\n>  \t\t\t   AXP20X_BATT_DISCHRG_I_H),\n>  };\n>  \n> +static const struct iio_chan_spec axp803_adc_channels[] = {\n> +\t{\n> +\t\t.type = IIO_TEMP,\n> +\t\t.address = AXP288_PMIC_ADC_H,\n> +\t\t.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |\n> +\t\t\t\t      BIT(IIO_CHAN_INFO_SCALE) |\n> +\t\t\t\t      BIT(IIO_CHAN_INFO_OFFSET),\n> +\t\t.datasheet_name = \"pmic_temp\",\n> +\t},\n> +\tAXP20X_ADC_CHANNEL(AXP803_BATT_V, \"batt_v\", IIO_VOLTAGE,\n> +\t\t\t   AXP20X_BATT_V_H),\n> +\tAXP20X_ADC_CHANNEL(AXP803_BATT_CHRG_I, \"batt_chrg_i\", IIO_CURRENT,\n> +\t\t\t   AXP20X_BATT_CHRG_I_H),\n> +\tAXP20X_ADC_CHANNEL(AXP803_BATT_DISCHRG_I, \"batt_dischrg_i\", IIO_CURRENT,\n> +\t\t\t   AXP20X_BATT_DISCHRG_I_H),\n> +};\n> +\n>  static int axp20x_adc_raw(struct iio_dev *indio_dev,\n>  \t\t\t  struct iio_chan_spec const *chan, int *val)\n>  {\n> @@ -243,6 +278,19 @@ static int axp22x_adc_raw(struct iio_dev *indio_dev,\n>  \treturn IIO_VAL_INT;\n>  }\n>  \n> +static int axp803_adc_raw(struct iio_dev *indio_dev,\n> +\t\t\t  struct iio_chan_spec const *chan, int *val)\n> +{\n> +\tstruct axp20x_adc_iio *info = iio_priv(indio_dev);\n> +\n> +\t/* All channels on AXP803 are stored on 12 bits. */\n> +\t*val = axp20x_read_variable_width(info->regmap, chan->address, 12);\n> +\tif (*val < 0)\n> +\t\treturn *val;\n> +\n> +\treturn IIO_VAL_INT;\n> +}\n> +\n>  static int axp20x_adc_scale_voltage(int channel, int *val, int *val2)\n>  {\n>  \tswitch (channel) {\n> @@ -342,6 +390,31 @@ static int axp22x_adc_scale(struct iio_chan_spec const *chan, int *val,\n>  \t}\n>  }\n>  \n> +static int axp803_adc_scale(struct iio_chan_spec const *chan, int *val,\n> +\t\t\t    int *val2)\n> +{\n> +\tswitch (chan->type) {\n> +\tcase IIO_VOLTAGE:\n> +\t\tif (chan->channel != AXP803_BATT_V)\n> +\t\t\treturn -EINVAL;\n> +\n> +\t\t*val = 1;\n> +\t\t*val2 = 100000;\n> +\t\treturn IIO_VAL_INT_PLUS_MICRO;\n> +\n> +\tcase IIO_CURRENT:\n> +\t\t*val = 1;\n\nA scale of 1 is assumed so you could drop providing this attribute.\nHowever, given there are scales for all other channels I guess that\nwould feel weird.  There is nothing in our ABI saying you can't\nspecify things that are the default so it makes sense to me to keep\nthis here.\n\n> +\t\treturn IIO_VAL_INT;\n> +\n> +\tcase IIO_TEMP:\n> +\t\t*val = 106;\n> +\t\treturn IIO_VAL_INT;\n> +\n> +\tdefault:\n> +\t\treturn -EINVAL;\n> +\t}\n> +}\n> +\n>  static int axp20x_adc_offset_voltage(struct iio_dev *indio_dev, int channel,\n>  \t\t\t\t     int *val)\n>  {\n> @@ -425,6 +498,26 @@ static int axp22x_read_raw(struct iio_dev *indio_dev,\n>  \t}\n>  }\n>  \n> +static int axp803_read_raw(struct iio_dev *indio_dev,\n> +\t\t\t   struct iio_chan_spec const *chan, int *val,\n> +\t\t\t   int *val2, long mask)\n> +{\n> +\tswitch (mask) {\n> +\tcase IIO_CHAN_INFO_OFFSET:\n\nI know it is impossible to get here unless we have a temperature channel,\nbut it still feels like this should be made apparent here.\n\nPerhaps a comment rather than an explicit check in the code?\n\n> +\t\t*val = -2525;\n> +\t\treturn IIO_VAL_INT;\n> +\n> +\tcase IIO_CHAN_INFO_SCALE:\n> +\t\treturn axp803_adc_scale(chan, val, val2);\n> +\n> +\tcase IIO_CHAN_INFO_RAW:\n> +\t\treturn axp803_adc_raw(indio_dev, chan, val);\n> +\n> +\tdefault:\n> +\t\treturn -EINVAL;\n> +\t}\n> +}\n> +\n>  static int axp20x_write_raw(struct iio_dev *indio_dev,\n>  \t\t\t    struct iio_chan_spec const *chan, int val, int val2,\n>  \t\t\t    long mask)\n> @@ -472,6 +565,11 @@ static const struct iio_info axp22x_adc_iio_info = {\n>  \t.driver_module = THIS_MODULE,\n>  };\n>  \n> +static const struct iio_info axp803_adc_iio_info = {\n> +\t.read_raw = axp803_read_raw,\n> +\t.driver_module = THIS_MODULE,\n\n.driver_module is now gone from this structure, but as it hasn't gone\nupstream from my tree yet I'll clean these up if they are still there\nonce we get to the point of applying this patch.\n\n> +};\n> +\n>  static int axp20x_adc_rate(int rate)\n>  {\n>  \treturn AXP20X_ADC_RATE_HZ(rate);\n> @@ -512,9 +610,19 @@ static const struct axp_data axp22x_data = {\n>  \t.maps = axp22x_maps,\n>  };\n>  \n> +static const struct axp_data axp803_data = {\n> +\t.iio_info = &axp803_adc_iio_info,\n> +\t.num_channels = ARRAY_SIZE(axp803_adc_channels),\n> +\t.channels = axp803_adc_channels,\n> +\t.adc_en1_mask = AXP803_ADC_EN1_MASK,\n> +\t.adc_en2 = false,\n> +\t.maps = axp22x_maps,\n> +};\n> +\n>  static const struct platform_device_id axp20x_adc_id_match[] = {\n>  \t{ .name = \"axp20x-adc\", .driver_data = (kernel_ulong_t)&axp20x_data, },\n>  \t{ .name = \"axp22x-adc\", .driver_data = (kernel_ulong_t)&axp22x_data, },\n> +\t{ .name = \"axp803-adc\", .driver_data = (kernel_ulong_t)&axp803_data, },\n>  \t{ /* sentinel */ },\n>  };\n>  MODULE_DEVICE_TABLE(platform, axp20x_adc_id_match);\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","mail.kernel.org;\n\tdmarc=none (p=none dis=none) header.from=kernel.org","mail.kernel.org;\n\tspf=none smtp.mailfrom=jic23@kernel.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0V6y3xK4z9sRV\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:32:42 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752505AbdIXOcj (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tSun, 24 Sep 2017 10:32:39 -0400","from mail.kernel.org ([198.145.29.99]:33262 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752206AbdIXOci (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tSun, 24 Sep 2017 10:32:38 -0400","from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net\n\t[81.96.234.148])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.kernel.org (Postfix) with ESMTPSA id B52CF2170C;\n\tSun, 24 Sep 2017 14:32:35 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mail.kernel.org B52CF2170C","Date":"Sun, 24 Sep 2017 15:32:33 +0100","From":"Jonathan Cameron <jic23@kernel.org>","To":"Icenowy Zheng <icenowy@aosc.io>","Cc":"Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tLee Jones <lee.jones@linaro.org>,\n\tQuentin Schulz <quentin.schulz@free-electrons.com>,\n\tlinux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","Subject":"Re: [RFC PATCH 3/7] iio: adc: axp20x-adc: add support for AXP803","Message-ID":"<20170924153233.14eb8964@archlinux>","In-Reply-To":"<20170920151814.22461-4-icenowy@aosc.io>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-4-icenowy@aosc.io>","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774217,"web_url":"http://patchwork.ozlabs.org/comment/1774217/","msgid":"<20170924153436.570b60ea@archlinux>","list_archive_url":null,"date":"2017-09-24T14:34:36","subject":"Re: [RFC PATCH 4/7] power: supply: axp20x-battery: support AXP803","submitter":{"id":10151,"url":"http://patchwork.ozlabs.org/api/people/10151/","name":"Jonathan Cameron","email":"jic23@kernel.org"},"content":"On Wed, 20 Sep 2017 23:18:11 +0800\nIcenowy Zheng <icenowy@aosc.io> wrote:\n\n> The AXP803 PMIC has battery support like other AXP PMICs, but with\n> different definition of max target charging voltage and constant\n> charging current.\n> \n> Add support for AXP803 battery in axp20x-battery driver.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n\nThis looks fine to me, but I haven't dived into the precise values\netc.\n\nJonathan\n\n> ---\n>  drivers/power/supply/axp20x_battery.c | 88 +++++++++++++++++++++++++++++++----\n>  1 file changed, 78 insertions(+), 10 deletions(-)\n> \n> diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c\n> index 7494f0f0eadb..c9a9fb320c92 100644\n> --- a/drivers/power/supply/axp20x_battery.c\n> +++ b/drivers/power/supply/axp20x_battery.c\n> @@ -49,6 +49,8 @@\n>  #define AXP22X_CHRG_CTRL1_TGT_4_22V\t(1 << 5)\n>  #define AXP22X_CHRG_CTRL1_TGT_4_24V\t(3 << 5)\n>  \n> +#define AXP803_CHRG_CTRL1_TGT_4_35V\t(3 << 5)\n> +\n>  #define AXP20X_CHRG_CTRL1_TGT_CURR\tGENMASK(3, 0)\n>  \n>  #define AXP20X_V_OFF_MASK\t\tGENMASK(2, 0)\n> @@ -123,20 +125,71 @@ static int axp22x_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt,\n>  \treturn 0;\n>  }\n>  \n> +static int axp803_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt,\n> +\t\t\t\t\t  int *val)\n> +{\n> +\tint ret, reg;\n> +\n> +\tret = regmap_read(axp20x_batt->regmap, AXP20X_CHRG_CTRL1, &reg);\n> +\tif (ret)\n> +\t\treturn ret;\n> +\n> +\tswitch (reg & AXP20X_CHRG_CTRL1_TGT_VOLT) {\n> +\tcase AXP20X_CHRG_CTRL1_TGT_4_1V:\n> +\t\t*val = 4100000;\n> +\t\tbreak;\n> +\tcase AXP20X_CHRG_CTRL1_TGT_4_15V:\n> +\t\t*val = 4150000;\n> +\t\tbreak;\n> +\tcase AXP20X_CHRG_CTRL1_TGT_4_2V:\n> +\t\t*val = 4200000;\n> +\t\tbreak;\n> +\tcase AXP803_CHRG_CTRL1_TGT_4_35V:\n> +\t\t*val = 4350000;\n> +\t\tbreak;\n> +\tdefault:\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\treturn 0;\n> +}\n> +\n>  static void raw_to_constant_charge_current(struct axp20x_batt_ps *axp, int *val)\n>  {\n> -\tif (axp->axp_id == AXP209_ID)\n> +\tswitch (axp->axp_id) {\n> +\tcase AXP209_ID:\n>  \t\t*val = *val * 100000 + 300000;\n> -\telse\n> +\t\tbreak;\n> +\tcase AXP221_ID:\n>  \t\t*val = *val * 150000 + 300000;\n> +\t\tbreak;\n> +\tcase AXP803_ID:\n> +\t\t*val = *val * 200000 + 200000;\n> +\t\tbreak;\n> +\t}\n>  }\n>  \n>  static void constant_charge_current_to_raw(struct axp20x_batt_ps *axp, int *val)\n>  {\n> -\tif (axp->axp_id == AXP209_ID)\n> +\tswitch (axp->axp_id) {\n> +\tcase AXP209_ID:\n>  \t\t*val = (*val - 300000) / 100000;\n> -\telse\n> +\t\tbreak;\n> +\tcase AXP221_ID:\n>  \t\t*val = (*val - 300000) / 150000;\n> +\t\tbreak;\n> +\tcase AXP803_ID:\n> +\t\t*val = (*val - 200000) / 200000;\n> +\t\t/*\n> +\t\t * The maximum charge current on AXP803 is 2.8A, and the\n> +\t\t * datasheet says \"1110-1111 reserved\" in this part.\n> +\t\t * So we return an invalid value -1 in this situation,\n> +\t\t * which will be dealed by the caller of this function,\n> +\t\t */\n> +\t\tif (*val > 13)\n> +\t\t\t*val = -1;\n> +\t\tbreak;\n> +\t}\n>  }\n>  \n>  static int axp20x_get_constant_charge_current(struct axp20x_batt_ps *axp,\n> @@ -269,9 +322,13 @@ static int axp20x_battery_get_prop(struct power_supply *psy,\n>  \t\tif (ret)\n>  \t\t\treturn ret;\n>  \n> -\t\tif (axp20x_batt->axp_id == AXP221_ID &&\n> -\t\t    !(reg & AXP22X_FG_VALID))\n> -\t\t\treturn -EINVAL;\n> +\t\tswitch (axp20x_batt->axp_id) {\n> +\t\tcase AXP221_ID:\n> +\t\tcase AXP803_ID:\n> +\t\t\tif (!(reg & AXP22X_FG_VALID))\n> +\t\t\t\treturn -EINVAL;\n> +\t\t\tbreak;\n> +\t\t};\n>  \n>  \t\t/*\n>  \t\t * Fuel Gauge data takes 7 bits but the stored value seems to be\n> @@ -281,11 +338,19 @@ static int axp20x_battery_get_prop(struct power_supply *psy,\n>  \t\tbreak;\n>  \n>  \tcase POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:\n> -\t\tif (axp20x_batt->axp_id == AXP209_ID)\n> +\t\tswitch (axp20x_batt->axp_id) {\n> +\t\tcase AXP209_ID:\n>  \t\t\treturn axp20x_battery_get_max_voltage(axp20x_batt,\n>  \t\t\t\t\t\t\t      &val->intval);\n> -\t\treturn axp22x_battery_get_max_voltage(axp20x_batt,\n> -\t\t\t\t\t\t      &val->intval);\n> +\t\tcase AXP221_ID:\n> +\t\t\treturn axp22x_battery_get_max_voltage(axp20x_batt,\n> +\t\t\t\t\t\t\t      &val->intval);\n> +\t\tcase AXP803_ID:\n> +\t\t\treturn axp803_battery_get_max_voltage(axp20x_batt,\n> +\t\t\t\t\t\t\t      &val->intval);\n> +\t\tdefault:\n> +\t\t\treturn -EINVAL;\n> +\t\t}\n>  \n>  \tcase POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:\n>  \t\tret = regmap_read(axp20x_batt->regmap, AXP20X_V_OFF, &reg);\n> @@ -467,6 +532,9 @@ static const struct of_device_id axp20x_battery_ps_id[] = {\n>  \t}, {\n>  \t\t.compatible = \"x-powers,axp221-battery-power-supply\",\n>  \t\t.data = (void *)AXP221_ID,\n> +\t}, {\n> +\t\t.compatible = \"x-powers,axp803-battery-power-supply\",\n> +\t\t.data = (void *)AXP803_ID,\n>  \t}, { /* sentinel */ },\n>  };\n>  MODULE_DEVICE_TABLE(of, axp20x_battery_ps_id);\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","mail.kernel.org;\n\tdmarc=none (p=none dis=none) header.from=kernel.org","mail.kernel.org;\n\tspf=none smtp.mailfrom=jic23@kernel.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0V9X34VRz9sPs\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:34:56 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752489AbdIXOem (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tSun, 24 Sep 2017 10:34:42 -0400","from mail.kernel.org ([198.145.29.99]:33548 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752421AbdIXOel (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tSun, 24 Sep 2017 10:34:41 -0400","from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net\n\t[81.96.234.148])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.kernel.org (Postfix) with ESMTPSA id 5E2532148C;\n\tSun, 24 Sep 2017 14:34:39 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mail.kernel.org 5E2532148C","Date":"Sun, 24 Sep 2017 15:34:36 +0100","From":"Jonathan Cameron <jic23@kernel.org>","To":"Icenowy Zheng <icenowy@aosc.io>","Cc":"Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tLee Jones <lee.jones@linaro.org>,\n\tQuentin Schulz <quentin.schulz@free-electrons.com>,\n\tlinux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","Subject":"Re: [RFC PATCH 4/7] power: supply: axp20x-battery: support AXP803","Message-ID":"<20170924153436.570b60ea@archlinux>","In-Reply-To":"<20170920151814.22461-5-icenowy@aosc.io>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-5-icenowy@aosc.io>","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774219,"web_url":"http://patchwork.ozlabs.org/comment/1774219/","msgid":"<20170924153647.1d82e83c@archlinux>","list_archive_url":null,"date":"2017-09-24T14:36:47","subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","submitter":{"id":10151,"url":"http://patchwork.ozlabs.org/api/people/10151/","name":"Jonathan Cameron","email":"jic23@kernel.org"},"content":"On Thu, 21 Sep 2017 23:20:11 +0800\nIcenowy Zheng <icenowy@aosc.io> wrote:\n\n> 于 2017年9月21日 GMT+08:00 下午10:46:21, Jonathan Cameron <Jonathan.Cameron@huawei.com> 写到:\n> >On Wed, 20 Sep 2017 23:18:07 +0800\n> >Icenowy Zheng <icenowy@aosc.io> wrote:\n> >  \n> >> The AXP803 PMIC, used by most Allwinner A64 boards, features 3 power  \n> >inputs:  \n> >> AC, USB and Battery.\n> >> \n> >> This patchset adds support for the AC and Battery supplies, which is  \n> >useful  \n> >> for the boards from Pine64 (Pine64, SoPine w/ baseboard model A,  \n> >Pinebook).  \n> >> \n> >> The USB supply is not yet supported in this patchset because it's not\n> >> present on Pine series boards.\n> >> \n> >> In order to enable battery monitoring the ADC for battery is also  \n> >enabled  \n> >> for AXs.\n> >> \n> >> In order to enable battery monitoring the ADC for battery is also  \n> >enabled  \n> >> for AXP803.  \n> >\n> >I'll go with the obvious question...\n> >\n> >Why an RFC rather than a standard patch submission? I'm not immediately\n> >seeing what is controversial!  \n> \n> Oh I am just not confident about this patchset,\n> especially the IIO part.\n\nIt all looks fine to me.  I would imagine that, once everyone is\nhappy, this will go through the mfd tree, but Lee may have other ideas!\n\nJonathan\n> \n> >\n> >Jonathan\n> >  \n> >> \n> >> Icenowy Zheng (7):\n> >>   dt-bindings: add compatibles for AXP803 Battery/USB power supplies\n> >>   iio: adc: axp20x-adc: allow to skip ADC rate setup now\n> >>   iio: adc: axp20x-adc: add support for AXP803\n> >>   power: supply: axp20x-battery: support AXP803\n> >>   mfd: axp20x: add cells for AXP803 ADC/AC Power/Battery\n> >>   arm64: allwinner: a64: add power supply nodes in AXP803 DTSI\n> >>   arm64: allwinner: a64: enable AC and Battery for Pine64\n> >> \n> >>  .../bindings/power/supply/axp20x_battery.txt       |   1 +\n> >>  .../bindings/power/supply/axp20x_usb_power.txt     |   1 +\n> >>  arch/arm64/boot/dts/allwinner/axp803.dtsi          |  15 +++\n> >>  .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |   8 ++\n> >>  drivers/iio/adc/axp20x_adc.c                       | 114  \n> >++++++++++++++++++++-  \n> >>  drivers/mfd/axp20x.c                               |  11 ++\n> >>  drivers/power/supply/axp20x_battery.c              |  88  \n> >++++++++++++++--  \n> >>  7 files changed, 226 insertions(+), 12 deletions(-)\n> >>   \n> >\n> >\n> >_______________________________________________\n> >linux-arm-kernel mailing list\n> >linux-arm-kernel@lists.infradead.org\n> >http://lists.infradead.org/mailman/listinfo/linux-arm-kernel  \n> --\n> To unsubscribe from this list: send the line \"unsubscribe linux-iio\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","mail.kernel.org;\n\tdmarc=none (p=none dis=none) header.from=kernel.org","mail.kernel.org;\n\tspf=none smtp.mailfrom=jic23@kernel.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0VD26tM5z9sPs\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:37:06 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752437AbdIXOgx convert rfc822-to-8bit (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tSun, 24 Sep 2017 10:36:53 -0400","from mail.kernel.org ([198.145.29.99]:33806 \"EHLO mail.kernel.org\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752244AbdIXOgw (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tSun, 24 Sep 2017 10:36:52 -0400","from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net\n\t[81.96.234.148])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.kernel.org (Postfix) with ESMTPSA id E964D2148C;\n\tSun, 24 Sep 2017 14:36:49 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mail.kernel.org E964D2148C","Date":"Sun, 24 Sep 2017 15:36:47 +0100","From":"Jonathan Cameron <jic23@kernel.org>","To":"Icenowy Zheng <icenowy@aosc.io>","Cc":"linux-arm-kernel@lists.infradead.org,\n\tJonathan Cameron <Jonathan.Cameron@huawei.com>,\n\tdevicetree@vger.kernel.org, linux-pm@vger.kernel.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com,\n\tlinux-kernel@vger.kernel.org,\n\tQuentin Schulz <quentin.schulz@free-electrons.com>,\n\tChen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tLee Jones <lee.jones@linaro.org>","Subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","Message-ID":"<20170924153647.1d82e83c@archlinux>","In-Reply-To":"<CF74A2A9-B9F4-4413-975B-A0F4B24686A3@aosc.io>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170921154621.0000328d@huawei.com>\n\t<CF74A2A9-B9F4-4413-975B-A0F4B24686A3@aosc.io>","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8BIT","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774464,"web_url":"http://patchwork.ozlabs.org/comment/1774464/","msgid":"<300803eb-4526-52c4-e74b-92625602a6da@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T07:20:02","subject":"Re: [RFC PATCH 2/7] iio: adc: axp20x-adc: allow to skip ADC rate\n\tsetup now","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 20/09/2017 17:18, Icenowy Zheng wrote:\n> The ADC rate setup on AXP803 is more complex than AXP20x/22x.\n> \n\nCan you elaborate?\n\nI can see two rate settings in register 0x85.\n\nBits 7-6 => TS/GPIO ADC speed setting (25, 50, 100, 200 Hz) ((ilog2(x) /\n25) << 6, same as AXP20X).\nBits 5-4 => Vol/Cur ADC speed setting (100, 200, 400, 800 Hz) ((ilog2(x)\n/ 100) << 4, same as AXP22X except the bit shift).\n\nJust set both to 100 or 200 by default (common rate). If someone wants\nto add a more specific rate setting, he could do it in the future.\n\nSetting a default is safer as we don't know if anything before the\nkernel does anything to this register.\n\nThanks,\nQuentin\n\n> As it's not a necessary setup, allow it to be skipped, to allow simpler\n> AXP803 support now.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> ---\n>  drivers/iio/adc/axp20x_adc.c | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c\n> index 11e177180ea0..93dd6b80059e 100644\n> --- a/drivers/iio/adc/axp20x_adc.c\n> +++ b/drivers/iio/adc/axp20x_adc.c\n> @@ -556,8 +556,10 @@ static int axp20x_probe(struct platform_device *pdev)\n>  \t\t\t\t   AXP20X_ADC_EN2_MASK, AXP20X_ADC_EN2_MASK);\n>  \n>  \t/* Configure ADCs rate */\n> -\tregmap_update_bits(info->regmap, AXP20X_ADC_RATE, AXP20X_ADC_RATE_MASK,\n> -\t\t\t   info->data->adc_rate(100));\n> +\tif (info->data->adc_rate)\n> +\t\tregmap_update_bits(info->regmap, AXP20X_ADC_RATE,\n> +\t\t\t\t   AXP20X_ADC_RATE_MASK,\n> +\t\t\t\t   info->data->adc_rate(100));\n>  \n>  \tret = iio_map_array_register(indio_dev, info->data->maps);\n>  \tif (ret < 0) {\n>","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0wTx3qk4z9tXG\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 17:20:37 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933181AbdIYHUP (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 03:20:15 -0400","from mail.free-electrons.com ([62.4.15.54]:59792 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932385AbdIYHUO (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 03:20:14 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 03AEA20878; Mon, 25 Sep 2017 09:20:12 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id A88B22085B;\n\tMon, 25 Sep 2017 09:20:01 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 2/7] iio: adc: axp20x-adc: allow to skip ADC rate\n\tsetup now","To":"Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","Cc":"linux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-3-icenowy@aosc.io>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<300803eb-4526-52c4-e74b-92625602a6da@free-electrons.com>","Date":"Mon, 25 Sep 2017 09:20:02 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920151814.22461-3-icenowy@aosc.io>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774525,"web_url":"http://patchwork.ozlabs.org/comment/1774525/","msgid":"<1ba65180-9f13-0ef4-9213-1b20f15b5bdb@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T08:48:54","subject":"Re: [RFC PATCH 3/7] iio: adc: axp20x-adc: add support for AXP803","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 20/09/2017 17:18, Icenowy Zheng wrote:\n> AXP803 SoC features an ADC part including these channels: GPADC (GPIO0)\n> and TS pins, PMIC internal temperature sensor, battery voltage, battery\n> charge/discharge current.\n> \n> Add support for the battery-related channels and internal temperature\n> channel in order to allow battery monitoring. The TS and GPADC channels\n> are complex and will be support after more investigation.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> ---\n>  drivers/iio/adc/axp20x_adc.c | 108 +++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 108 insertions(+)\n> \n> diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c\n> index 93dd6b80059e..4f0cd98cf6ea 100644\n> --- a/drivers/iio/adc/axp20x_adc.c\n> +++ b/drivers/iio/adc/axp20x_adc.c\n> @@ -28,6 +28,8 @@\n[...]>  /*\n> + * AXP803 shares the same consumer map with AXP22x, as it has no ADC for\n> + * VBUS and ACIN inputs either.\n> + */\n> +\n> +/*\n\nPut that in the commit log?\nIf we add a comment for each newly supported PMIC we will end up with\nmore comments than code :)\n\n[...]>\n> +static const struct axp_data axp803_data = {\n> +\t.iio_info = &axp803_adc_iio_info,\n> +\t.num_channels = ARRAY_SIZE(axp803_adc_channels),\n> +\t.channels = axp803_adc_channels,\n> +\t.adc_en1_mask = AXP803_ADC_EN1_MASK,\n> +\t.adc_en2 = false,\n\nNot required I guess, by default it is false.\n\nThanks,\nQuentin","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0ySP73YWz9s76\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 18:49:25 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933537AbdIYItN (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 04:49:13 -0400","from mail.free-electrons.com ([62.4.15.54]:35055 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S933009AbdIYItH (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 04:49:07 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 193F9208C5; Mon, 25 Sep 2017 10:49:04 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id B9ECA208E3;\n\tMon, 25 Sep 2017 10:48:53 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 3/7] iio: adc: axp20x-adc: add support for AXP803","To":"Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","Cc":"devicetree@vger.kernel.org, linux-pm@vger.kernel.org,\n\tlinux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-4-icenowy@aosc.io>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<1ba65180-9f13-0ef4-9213-1b20f15b5bdb@free-electrons.com>","Date":"Mon, 25 Sep 2017 10:48:54 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920151814.22461-4-icenowy@aosc.io>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774537,"web_url":"http://patchwork.ozlabs.org/comment/1774537/","msgid":"<9b72b982-85b2-22e0-076a-15c066619006@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T08:58:46","subject":"Re: [RFC PATCH 4/7] power: supply: axp20x-battery: support AXP803","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 20/09/2017 17:18, Icenowy Zheng wrote:\n> The AXP803 PMIC has battery support like other AXP PMICs, but with\n> different definition of max target charging voltage and constant\n> charging current.\n> \n> Add support for AXP803 battery in axp20x-battery driver.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> ---\n>  drivers/power/supply/axp20x_battery.c | 88 +++++++++++++++++++++++++++++++----\n>  1 file changed, 78 insertions(+), 10 deletions(-)\n> \n> diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c\n> index 7494f0f0eadb..c9a9fb320c92 100644\n> --- a/drivers/power/supply/axp20x_battery.c\n> +++ b/drivers/power/supply/axp20x_battery.c\n> @@ -49,6 +49,8 @@\n[...]\n>  static void constant_charge_current_to_raw(struct axp20x_batt_ps *axp, int *val)\n>  {\n> -\tif (axp->axp_id == AXP209_ID)\n> +\tswitch (axp->axp_id) {\n> +\tcase AXP209_ID:\n>  \t\t*val = (*val - 300000) / 100000;\n> -\telse\n> +\t\tbreak;\n> +\tcase AXP221_ID:\n>  \t\t*val = (*val - 300000) / 150000;\n> +\t\tbreak;\n> +\tcase AXP803_ID:\n> +\t\t*val = (*val - 200000) / 200000;\n> +\t\t/*\n> +\t\t * The maximum charge current on AXP803 is 2.8A, and the\n> +\t\t * datasheet says \"1110-1111 reserved\" in this part.\n> +\t\t * So we return an invalid value -1 in this situation,\n> +\t\t * which will be dealed by the caller of this function,\n> +\t\t */\n\nGood, we could do that for the two others compatible as well. They are\nnot explicitly marked as reserved but it stops at 1100 for AXP223/AXP221\nfor example.\n\n> +\t\tif (*val > 13)\n> +\t\t\t*val = -1;\n> +\t\tbreak;\n> +\t}\n>  }\n>  \n>  static int axp20x_get_constant_charge_current(struct axp20x_batt_ps *axp,\n> @@ -269,9 +322,13 @@ static int axp20x_battery_get_prop(struct power_supply *psy,\n>  \t\tif (ret)\n>  \t\t\treturn ret;\n>  \n> -\t\tif (axp20x_batt->axp_id == AXP221_ID &&\n> -\t\t    !(reg & AXP22X_FG_VALID))\n> -\t\t\treturn -EINVAL;\n> +\t\tswitch (axp20x_batt->axp_id) {\n> +\t\tcase AXP221_ID:\n> +\t\tcase AXP803_ID:\n> +\t\t\tif (!(reg & AXP22X_FG_VALID))\n> +\t\t\t\treturn -EINVAL;\n> +\t\t\tbreak;\n> +\t\t};\n\nLooks weird to me.\n\nif (axp20x_batt->axp_id != AXP209_ID && !(reg & AXP22X_FG_VALID))\n\nwould be a better match?\n[...]\n\nThanks,\nQuentin","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0ygk2Ymyz9tXK\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 18:59:14 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933995AbdIYI7A (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 04:59:00 -0400","from mail.free-electrons.com ([62.4.15.54]:35420 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S933513AbdIYI66 (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 04:58:58 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 97FB5208A2; Mon, 25 Sep 2017 10:58:56 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 0E85220832;\n\tMon, 25 Sep 2017 10:58:46 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 4/7] power: supply: axp20x-battery: support AXP803","To":"Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","Cc":"linux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-5-icenowy@aosc.io>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<9b72b982-85b2-22e0-076a-15c066619006@free-electrons.com>","Date":"Mon, 25 Sep 2017 10:58:46 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920151814.22461-5-icenowy@aosc.io>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774553,"web_url":"http://patchwork.ozlabs.org/comment/1774553/","msgid":"<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T09:11:57","subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 20/09/2017 17:18, Icenowy Zheng wrote:\n> AXP803 PMIC features AC/USB/Battery power supplies.\n> \n> As we have now the device tree bindings for them, add device tree\n> nodes for them.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> ---\n>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n> \n> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n> index ff8af52743ff..3a8615231b7c 100644\n> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n> @@ -49,6 +49,16 @@\n>  \tinterrupt-controller;\n>  \t#interrupt-cells = <1>;\n>  \n> +\tac_power_supply: ac-power-supply {\n> +\t\tcompatible = \"x-powers,axp221-ac-power-supply\";\n> +\t\tstatus = \"disabled\";\n> +\t};\n> +\n> +\tbattery_power_supply: battery-power-supply {\n> +\t\tcompatible = \"x-powers,axp803-battery-power-supply\";\n> +\t\tstatus = \"disabled\";\n> +\t};\n> +\n>  \tregulators {\n>  \t\t/* Default work frequency for buck regulators */\n>  \t\tx-powers,dcdc-freq = <3000>;\n> @@ -147,4 +157,9 @@\n>  \t\t\tregulator-name = \"rtc-ldo\";\n>  \t\t};\n>  \t};\n> +\n> +\tusb_power_supply: usb_power_supply {\n> +\t\tcompatible = \"x-powers,axp803-usb-power-supply\";\n> +\t\tstatus = \"disabled\";\n> +\t};\n\nNo. You have added support for the AC and battery power supply drivers\nin this patchset, not for USB.\n\nQuentin","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0yyv4J2wz9t30\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 19:12:23 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S934081AbdIYJML (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 05:12:11 -0400","from mail.free-electrons.com ([62.4.15.54]:36299 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S934076AbdIYJMJ (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 05:12:09 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 6823A209C8; Mon, 25 Sep 2017 11:12:07 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id C42D920884;\n\tMon, 25 Sep 2017 11:11:56 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","To":"Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","Cc":"linux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-7-icenowy@aosc.io>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>","Date":"Mon, 25 Sep 2017 11:11:57 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920151814.22461-7-icenowy@aosc.io>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774558,"web_url":"http://patchwork.ozlabs.org/comment/1774558/","msgid":"<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","list_archive_url":null,"date":"2017-09-25T09:14:34","subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","submitter":{"id":71295,"url":"http://patchwork.ozlabs.org/api/people/71295/","name":"Icenowy Zheng","email":"icenowy@aosc.io"},"content":"于 2017年9月25日 GMT+08:00 下午5:11:57, Quentin Schulz <quentin.schulz@free-electrons.com> 写到:\n>Hi Icenowy,\n>\n>On 20/09/2017 17:18, Icenowy Zheng wrote:\n>> AXP803 PMIC features AC/USB/Battery power supplies.\n>> \n>> As we have now the device tree bindings for them, add device tree\n>> nodes for them.\n>> \n>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n>> ---\n>>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 15 +++++++++++++++\n>>  1 file changed, 15 insertions(+)\n>> \n>> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>> index ff8af52743ff..3a8615231b7c 100644\n>> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>> @@ -49,6 +49,16 @@\n>>  \tinterrupt-controller;\n>>  \t#interrupt-cells = <1>;\n>>  \n>> +\tac_power_supply: ac-power-supply {\n>> +\t\tcompatible = \"x-powers,axp221-ac-power-supply\";\n>> +\t\tstatus = \"disabled\";\n>> +\t};\n>> +\n>> +\tbattery_power_supply: battery-power-supply {\n>> +\t\tcompatible = \"x-powers,axp803-battery-power-supply\";\n>> +\t\tstatus = \"disabled\";\n>> +\t};\n>> +\n>>  \tregulators {\n>>  \t\t/* Default work frequency for buck regulators */\n>>  \t\tx-powers,dcdc-freq = <3000>;\n>> @@ -147,4 +157,9 @@\n>>  \t\t\tregulator-name = \"rtc-ldo\";\n>>  \t\t};\n>>  \t};\n>> +\n>> +\tusb_power_supply: usb_power_supply {\n>> +\t\tcompatible = \"x-powers,axp803-usb-power-supply\";\n>> +\t\tstatus = \"disabled\";\n>> +\t};\n>\n>No. You have added support for the AC and battery power supply drivers\n>in this patchset, not for USB.\n\nBut I added its device tree binding.\n\n>\n>Quentin\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0z3B3Ctfz9t30\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 19:16:06 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S934153AbdIYJQF convert rfc822-to-8bit (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 05:16:05 -0400","from hermes.aosc.io ([199.195.250.187]:51686 \"EHLO hermes.aosc.io\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S934071AbdIYJQE (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tMon, 25 Sep 2017 05:16:04 -0400","from localhost (localhost [127.0.0.1]) (Authenticated sender:\n\ticenowy@aosc.io)\n\tby hermes.aosc.io (Postfix) with ESMTPSA id 8C12048103;\n\tMon, 25 Sep 2017 09:15:56 +0000 (UTC)"],"Date":"Mon, 25 Sep 2017 17:14:34 +0800","In-Reply-To":"<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-7-icenowy@aosc.io>\n\t<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>","MIME-Version":"1.0","Content-Type":"text/plain;\n charset=utf-8","Content-Transfer-Encoding":"8BIT","Subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","To":"Quentin Schulz <quentin.schulz@free-electrons.com>,\n\tChen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","CC":"linux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","From":"Icenowy Zheng <icenowy@aosc.io>","Message-ID":"<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774561,"web_url":"http://patchwork.ozlabs.org/comment/1774561/","msgid":"<CAGb2v64rBQ33aqhPSksBB88GGQTJsPyeebD0ixT=ehBYA5tSEA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-25T09:19:07","subject":"Re: [linux-sunxi] Re: [RFC PATCH 6/7] arm64: allwinner: a64: add\n\tpower supply nodes in AXP803 DTSI","submitter":{"id":47154,"url":"http://patchwork.ozlabs.org/api/people/47154/","name":"Chen-Yu Tsai","email":"wens@csie.org"},"content":"On Mon, Sep 25, 2017 at 5:14 PM, Icenowy Zheng <icenowy@aosc.io> wrote:\n>\n>\n> 于 2017年9月25日 GMT+08:00 下午5:11:57, Quentin Schulz <quentin.schulz@free-electrons.com> 写到:\n>>Hi Icenowy,\n>>\n>>On 20/09/2017 17:18, Icenowy Zheng wrote:\n>>> AXP803 PMIC features AC/USB/Battery power supplies.\n>>>\n>>> As we have now the device tree bindings for them, add device tree\n>>> nodes for them.\n>>>\n>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n>>> ---\n>>>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 15 +++++++++++++++\n>>>  1 file changed, 15 insertions(+)\n>>>\n>>> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> index ff8af52743ff..3a8615231b7c 100644\n>>> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> @@ -49,6 +49,16 @@\n>>>      interrupt-controller;\n>>>      #interrupt-cells = <1>;\n>>>\n>>> +    ac_power_supply: ac-power-supply {\n>>> +            compatible = \"x-powers,axp221-ac-power-supply\";\n>>> +            status = \"disabled\";\n>>> +    };\n>>> +\n>>> +    battery_power_supply: battery-power-supply {\n>>> +            compatible = \"x-powers,axp803-battery-power-supply\";\n>>> +            status = \"disabled\";\n>>> +    };\n>>> +\n>>>      regulators {\n>>>              /* Default work frequency for buck regulators */\n>>>              x-powers,dcdc-freq = <3000>;\n>>> @@ -147,4 +157,9 @@\n>>>                      regulator-name = \"rtc-ldo\";\n>>>              };\n>>>      };\n>>> +\n>>> +    usb_power_supply: usb_power_supply {\n>>> +            compatible = \"x-powers,axp803-usb-power-supply\";\n>>> +            status = \"disabled\";\n>>> +    };\n>>\n>>No. You have added support for the AC and battery power supply drivers\n>>in this patchset, not for USB.\n>\n> But I added its device tree binding.\n\nPlease do both at the same time. If you only add the binding without\nthe driver, how can you be sure the binding would be a proper fit?\nMoreover, no one can actually test it.\n\nChenYu\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0z7W2M3vz9s7F\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 19:19:51 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933267AbdIYJTi convert rfc822-to-8bit (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 05:19:38 -0400","from smtp.csie.ntu.edu.tw ([140.112.30.61]:56408 \"EHLO\n\tsmtp.csie.ntu.edu.tw\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932627AbdIYJTh (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 05:19:37 -0400","from mail-wr0-f172.google.com (mail-wr0-f172.google.com\n\t[209.85.128.172])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: b93043)\n\tby smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id 8457B20401;\n\tMon, 25 Sep 2017 17:19:31 +0800 (CST)","by mail-wr0-f172.google.com with SMTP id a43so6592477wrc.0;\n\tMon, 25 Sep 2017 02:19:31 -0700 (PDT)","by 10.223.196.226 with HTTP; Mon, 25 Sep 2017 02:19:07 -0700 (PDT)"],"X-Gm-Message-State":"AHPjjUiSV/JnNfYQy5GP6yyydFHD+E9CGdr/aRalWGWXOEU/xmFEUqY1\n\tQzsFfPCWz7ms7/Qyt97hptKetuIIZDMPaaXon9o=","X-Google-Smtp-Source":"AOwi7QDUTFyy2L6YO/Du2yps2VwOGwZZcqayiPs8pYWv3Lf4f0HDMWgiCbDHy4hewEUulZ91ZuepY+3eFKgcsOCpafw=","X-Received":"by 10.223.187.129 with SMTP id q1mr5960279wrg.239.1506331168125; \n\tMon, 25 Sep 2017 02:19:28 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-7-icenowy@aosc.io>\n\t<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>\n\t<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","From":"Chen-Yu Tsai <wens@csie.org>","Date":"Mon, 25 Sep 2017 17:19:07 +0800","X-Gmail-Original-Message-ID":"<CAGb2v64rBQ33aqhPSksBB88GGQTJsPyeebD0ixT=ehBYA5tSEA@mail.gmail.com>","Message-ID":"<CAGb2v64rBQ33aqhPSksBB88GGQTJsPyeebD0ixT=ehBYA5tSEA@mail.gmail.com>","Subject":"Re: [linux-sunxi] Re: [RFC PATCH 6/7] arm64: allwinner: a64: add\n\tpower supply nodes in AXP803 DTSI","To":"Icenowy Zheng <icenowy@aosc.io>","Cc":"Quentin Schulz <quentin.schulz@free-electrons.com>,\n\tChen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>,\n\t\"open list:THERMAL\" <linux-pm@vger.kernel.org>,\n\tdevicetree <devicetree@vger.kernel.org>,\n\tlinux-kernel <linux-kernel@vger.kernel.org>,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tlinux-iio@vger.kernel.org, linux-sunxi <linux-sunxi@googlegroups.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"8BIT","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774564,"web_url":"http://patchwork.ozlabs.org/comment/1774564/","msgid":"<b23aafe5-411f-1b83-48f0-6f67b25666cc@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T09:22:16","subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 24/09/2017 16:36, Jonathan Cameron wrote:\n> On Thu, 21 Sep 2017 23:20:11 +0800\n> Icenowy Zheng <icenowy@aosc.io> wrote:\n> \n>> 于 2017年9月21日 GMT+08:00 下午10:46:21, Jonathan Cameron <Jonathan.Cameron@huawei.com> 写到:\n>>> On Wed, 20 Sep 2017 23:18:07 +0800\n>>> Icenowy Zheng <icenowy@aosc.io> wrote:\n>>>  \n>>>> The AXP803 PMIC, used by most Allwinner A64 boards, features 3 power  \n>>> inputs:  \n>>>> AC, USB and Battery.\n>>>>\n>>>> This patchset adds support for the AC and Battery supplies, which is  \n>>> useful  \n>>>> for the boards from Pine64 (Pine64, SoPine w/ baseboard model A,  \n>>> Pinebook).  \n>>>>\n>>>> The USB supply is not yet supported in this patchset because it's not\n>>>> present on Pine series boards.\n>>>>\n>>>> In order to enable battery monitoring the ADC for battery is also  \n>>> enabled  \n>>>> for AXs.\n>>>>\n>>>> In order to enable battery monitoring the ADC for battery is also  \n>>> enabled  \n>>>> for AXP803.  \n>>>\n>>> I'll go with the obvious question...\n>>>\n>>> Why an RFC rather than a standard patch submission? I'm not immediately\n>>> seeing what is controversial!  \n>>\n>> Oh I am just not confident about this patchset,\n>> especially the IIO part.\n> \n> It all looks fine to me.  I would imagine that, once everyone is\n> happy, this will go through the mfd tree, but Lee may have other ideas!\n> \n\nSmall modifications to make but I definitely agree with Jonathan that\nyou did not need to send an RFC.\n\nQuentin\n\n> Jonathan\n>>\n>>>\n>>> Jonathan\n>>>  \n>>>>\n>>>> Icenowy Zheng (7):\n>>>>   dt-bindings: add compatibles for AXP803 Battery/USB power supplies\n>>>>   iio: adc: axp20x-adc: allow to skip ADC rate setup now\n>>>>   iio: adc: axp20x-adc: add support for AXP803\n>>>>   power: supply: axp20x-battery: support AXP803\n>>>>   mfd: axp20x: add cells for AXP803 ADC/AC Power/Battery\n>>>>   arm64: allwinner: a64: add power supply nodes in AXP803 DTSI\n>>>>   arm64: allwinner: a64: enable AC and Battery for Pine64\n>>>>\n>>>>  .../bindings/power/supply/axp20x_battery.txt       |   1 +\n>>>>  .../bindings/power/supply/axp20x_usb_power.txt     |   1 +\n>>>>  arch/arm64/boot/dts/allwinner/axp803.dtsi          |  15 +++\n>>>>  .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |   8 ++\n>>>>  drivers/iio/adc/axp20x_adc.c                       | 114  \n>>> ++++++++++++++++++++-  \n>>>>  drivers/mfd/axp20x.c                               |  11 ++\n>>>>  drivers/power/supply/axp20x_battery.c              |  88  \n>>> ++++++++++++++--  \n>>>>  7 files changed, 226 insertions(+), 12 deletions(-)\n>>>>   \n>>>\n>>>\n>>> _______________________________________________\n>>> linux-arm-kernel mailing list\n>>> linux-arm-kernel@lists.infradead.org\n>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel  \n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe linux-iio\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n> \n> _______________________________________________\n> linux-arm-kernel mailing list\n> linux-arm-kernel@lists.infradead.org\n> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel\n>","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0zBm4dfwz9s7F\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 19:22:40 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S934306AbdIYJWa (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 05:22:30 -0400","from mail.free-electrons.com ([62.4.15.54]:36777 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S933212AbdIYJW2 (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 05:22:28 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 256D320851; Mon, 25 Sep 2017 11:22:26 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 9F22020848;\n\tMon, 25 Sep 2017 11:22:15 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 0/7] AXP803 AC/Battery support","To":"Jonathan Cameron <jic23@kernel.org>, Icenowy Zheng <icenowy@aosc.io>","Cc":"devicetree@vger.kernel.org, linux-pm@vger.kernel.org,\n\tlinux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-sunxi@googlegroups.com,\n\tJonathan Cameron <Jonathan.Cameron@huawei.com>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tChen-Yu Tsai <wens@csie.org>, Lee Jones <lee.jones@linaro.org>,\n\tlinux-arm-kernel@lists.infradead.org","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170921154621.0000328d@huawei.com>\n\t<CF74A2A9-B9F4-4413-975B-A0F4B24686A3@aosc.io>\n\t<20170924153647.1d82e83c@archlinux>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<b23aafe5-411f-1b83-48f0-6f67b25666cc@free-electrons.com>","Date":"Mon, 25 Sep 2017 11:22:16 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170924153647.1d82e83c@archlinux>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1774567,"web_url":"http://patchwork.ozlabs.org/comment/1774567/","msgid":"<39833379-66a4-4657-3d12-26bc51c88815@free-electrons.com>","list_archive_url":null,"date":"2017-09-25T09:24:43","subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","submitter":{"id":69366,"url":"http://patchwork.ozlabs.org/api/people/69366/","name":"Quentin Schulz","email":"quentin.schulz@free-electrons.com"},"content":"Hi Icenowy,\n\nOn 25/09/2017 11:14, Icenowy Zheng wrote:\n> \n> \n> 于 2017年9月25日 GMT+08:00 下午5:11:57, Quentin Schulz <quentin.schulz@free-electrons.com> 写到:\n>> Hi Icenowy,\n>>\n>> On 20/09/2017 17:18, Icenowy Zheng wrote:\n>>> AXP803 PMIC features AC/USB/Battery power supplies.\n>>>\n>>> As we have now the device tree bindings for them, add device tree\n>>> nodes for them.\n>>>\n>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n>>> ---\n>>>  arch/arm64/boot/dts/allwinner/axp803.dtsi | 15 +++++++++++++++\n>>>  1 file changed, 15 insertions(+)\n>>>\n>>> diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>> b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> index ff8af52743ff..3a8615231b7c 100644\n>>> --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi\n>>> @@ -49,6 +49,16 @@\n>>>  \tinterrupt-controller;\n>>>  \t#interrupt-cells = <1>;\n>>>  \n>>> +\tac_power_supply: ac-power-supply {\n>>> +\t\tcompatible = \"x-powers,axp221-ac-power-supply\";\n>>> +\t\tstatus = \"disabled\";\n>>> +\t};\n>>> +\n>>> +\tbattery_power_supply: battery-power-supply {\n>>> +\t\tcompatible = \"x-powers,axp803-battery-power-supply\";\n>>> +\t\tstatus = \"disabled\";\n>>> +\t};\n>>> +\n>>>  \tregulators {\n>>>  \t\t/* Default work frequency for buck regulators */\n>>>  \t\tx-powers,dcdc-freq = <3000>;\n>>> @@ -147,4 +157,9 @@\n>>>  \t\t\tregulator-name = \"rtc-ldo\";\n>>>  \t\t};\n>>>  \t};\n>>> +\n>>> +\tusb_power_supply: usb_power_supply {\n>>> +\t\tcompatible = \"x-powers,axp803-usb-power-supply\";\n>>> +\t\tstatus = \"disabled\";\n>>> +\t};\n>>\n>> No. You have added support for the AC and battery power supply drivers\n>> in this patchset, not for USB.\n> \n> But I added its device tree binding.\n\nYes and that is wrong. That would mislead users into thinking the usb\npower supply is supported (since the dt binding is here) while it's not.\n\nI would add the dt binding and the DT node only once it is supported.\n\nQuentin","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0zFQ4tYvz9sNr\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 19:24:58 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933186AbdIYJY5 (ORCPT <rfc822; incoming-dt@patchwork.ozlabs.org>);\n\tMon, 25 Sep 2017 05:24:57 -0400","from mail.free-electrons.com ([62.4.15.54]:36919 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932404AbdIYJY4 (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Mon, 25 Sep 2017 05:24:56 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 9F7B420848; Mon, 25 Sep 2017 11:24:53 +0200 (CEST)","from [192.168.0.13] (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 5085A207FD;\n\tMon, 25 Sep 2017 11:24:43 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Subject":"Re: [RFC PATCH 6/7] arm64: allwinner: a64: add power supply nodes in\n\tAXP803 DTSI","To":"Icenowy Zheng <icenowy@aosc.io>, Chen-Yu Tsai <wens@csie.org>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tJonathan Cameron <jic23@kernel.org>, Lee Jones <lee.jones@linaro.org>","Cc":"linux-pm@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-iio@vger.kernel.org, linux-sunxi@googlegroups.com","References":"<20170920151814.22461-1-icenowy@aosc.io>\n\t<20170920151814.22461-7-icenowy@aosc.io>\n\t<7ce5c53e-70ba-456e-ecf7-5132ef2c2c64@free-electrons.com>\n\t<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","From":"Quentin Schulz <quentin.schulz@free-electrons.com>","Message-ID":"<39833379-66a4-4657-3d12-26bc51c88815@free-electrons.com>","Date":"Mon, 25 Sep 2017 11:24:43 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<D7CAB179-F2AF-434F-82F7-07F146842FCF@aosc.io>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}}]