devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: Rob Herring <robh@kernel.org>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Jonathan Cameron <jic23@kernel.org>,
	"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
Date: Wed, 4 Nov 2020 12:53:38 +0800	[thread overview]
Message-ID: <a6685d81-d09a-1372-cc17-96f66c87ffbe@electromag.com.au> (raw)
In-Reply-To: <CAL_JsqLAtMQhsUDG=amAG7i9mMzYq9UTDLMFRrGKOHr5rb3L+A@mail.gmail.com>

On 4/11/2020 11:12, Rob Herring wrote:
> On Tue, Nov 3, 2020 at 6:39 PM Phil Reid <preid@electromag.com.au> wrote:
>>
>> On 4/11/2020 01:28, Jonathan Cameron wrote:
>>> On Tue, 3 Nov 2020 10:10:39 -0600
>>> Rob Herring <robh@kernel.org> wrote:
>>>
>>>> On Sat, Oct 31, 2020 at 06:48:10PM +0000, Jonathan Cameron wrote:
>>>>> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>>
>>>>> Simple direct conversion from txt to yaml as part of a general aim of
>>>>> converting all IIO bindings to this machine readable format.
>>>>>
>>>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>>>> Cc: Phil Reid <preid@electromag.com.au>
>>>>> ---
>>>>>    .../bindings/iio/potentiometer/ad5272.txt     | 27 ----------
>>>>>    .../iio/potentiometer/adi,ad5272.yaml         | 50 +++++++++++++++++++
>>>>>    2 files changed, 50 insertions(+), 27 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt b/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>> deleted file mode 100644
>>>>> index f9b2eef946aa..000000000000
>>>>> --- a/Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
>>>>> +++ /dev/null
>>>>> @@ -1,27 +0,0 @@
>>>>> -* Analog Devices AD5272 digital potentiometer
>>>>> -
>>>>> -The node for this device must be a child node of a I2C controller, hence
>>>>> -all mandatory properties for your controller must be specified. See directory:
>>>>> -
>>>>> -        Documentation/devicetree/bindings/i2c
>>>>> -
>>>>> -for more details.
>>>>> -
>>>>> -Required properties:
>>>>> -   - compatible:   Must be one of the following, depending on the model:
>>>>> -                   adi,ad5272-020
>>>>> -                   adi,ad5272-050
>>>>> -                   adi,ad5272-100
>>>>> -                   adi,ad5274-020
>>>>> -                   adi,ad5274-100
>>>>> -
>>>>> -Optional properties:
>>>>> - - reset-gpios: GPIO specification for the RESET input. This is an
>>>>> -           active low signal to the AD5272.
>>>>> -
>>>>> -Example:
>>>>> -ad5272: potentiometer@2f {
>>>>> -   reg = <0x2F>;
>>>>> -   compatible = "adi,ad5272-020";
>>>>> -   reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>> -};
>>>>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>> new file mode 100644
>>>>> index 000000000000..b9b7d383bff1
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
>>>>> @@ -0,0 +1,50 @@
>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>>> +%YAML 1.2
>>>>> +---
>>>>> +$id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml#
>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>> +
>>>>> +title: Analog Devices AD5272 digital potentiometer
>>>>> +
>>>>> +maintainers:
>>>>> +  - Phil Reid <preid@electromag.com.au>
>>>>> +
>>>>> +description: |
>>>>> +  Datasheet: https://www.analog.com/en/products/ad5272.html
>>>>> +
>>>>> +properties:
>>>>> +  compatible:
>>>>> +    enum:
>>>>> +      - adi,ad5272-020
>>>>> +      - adi,ad5272-050
>>>>> +      - adi,ad5272-100
>>>>> +      - adi,ad5274-020
>>>>> +      - adi,ad5274-100
>>>>> +
>>>>> +  reg:
>>>>> +    maxItems: 1
>>>>> +
>>>>> +  reset-gpios:
>>>>> +    description:
>>>>> +      Active low signal to the AD5272 RESET input.
>>>>
>>>> Not a new problem, but active low or...
>>>>
>>>>> +
>>>>> +additionalProperties: false
>>>>> +
>>>>> +required:
>>>>> +  - compatible
>>>>> +  - reg
>>>>> +
>>>>> +examples:
>>>>> +  - |
>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>> +    i2c {
>>>>> +        #address-cells = <1>;
>>>>> +        #size-cells = <0>;
>>>>> +
>>>>> +        potentiometer@2f {
>>>>> +            compatible = "adi,ad5272-020";
>>>>> +            reg = <0x2F>;
>>>>> +            reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
>>>>
>>>> active high?
>>>
>>> Good spot!  @Phil.  Looks like the driver is setting the reset line to
>>> 0 and then to 1 to come out of reset.   So effectively inverting the logic.
>>> I'm tempted to be cynical and suggest we just drop the comment above and leave
>>> it vague but is there a better way we can clarify this?
>>
>> Had a look at a few other iio drivers in regards how they handle the same thing.
>> A few do the same thing, ie: the drivers are written to set gpio low to assert reset.
>> So they need the device tree gpio config to be active high to work correctly.
>> Not sure if this prevents users setting things up as open collector.
> 
> The driver is wrong. 'gpiod_set_value(reset_gpio, 1);' should assert
> reset as '1' here is set to (reset) active state as defined in the DT.
> 
> Given no upstream users, maybe it can be fixed...
> 
> We need to make 'reset-gpios' implemented by a reset controller and
> stop letting drivers get it wrong.
> 

Yes I agree, the driver is wrong, think I just copied one of the other drivers for the pattern.
I'd be happy to change it, there's probably few (if any) users.

Having a software interface to assert the reset would be nice.


-- 
Regards
Phil Reid


  reply	other threads:[~2020-11-04  4:53 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
2020-11-02  4:48   ` Phil Reid
2020-11-03 16:10   ` Rob Herring
2020-11-03 17:28     ` Jonathan Cameron
2020-11-04  0:39       ` Phil Reid
2020-11-04  3:12         ` Rob Herring
2020-11-04  4:53           ` Phil Reid [this message]
2020-11-09  2:56             ` Phil Reid
2020-11-22 16:35               ` Jonathan Cameron
2020-11-23 23:33                 ` Phil Reid
2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
2020-11-02 16:19   ` Slawomir Stepien
2020-11-03 16:11   ` Rob Herring
2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
2020-11-22 16:43   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
2020-11-22 17:32   ` Jonathan Cameron
2020-11-28 16:15     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
2020-11-28 16:24   ` Jonathan Cameron
2020-12-18 19:42   ` Rob Herring
2020-12-30 12:21     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
2020-10-31 21:41   ` Matt Ranostay
2020-11-22 16:58     ` Jonathan Cameron
2020-11-22 17:24       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
2020-10-31 21:38   ` Matt Ranostay
2020-11-22 17:29     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
2020-10-31 21:33   ` Matt Ranostay
2020-10-31 21:35     ` Matt Ranostay
2020-11-01 14:57       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
2020-11-22 17:42   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
2020-11-03 16:18   ` Rob Herring
2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
2020-11-22 17:52   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
2020-11-01 15:26   ` Manivannan Sadhasivam
2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
2020-11-04 14:47   ` Linus Walleij
2020-11-08 15:55     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
2020-11-22 18:07   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
2020-11-13  9:22   ` Alexandre Belloni
2020-11-14 15:37     ` Jonathan Cameron
2020-11-22 18:09       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
2020-11-03 16:26   ` Rob Herring
2020-11-27  8:14   ` Geert Uytterhoeven
2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
2020-11-22 18:15   ` Jonathan Cameron
2020-11-23  3:02     ` Chen-Yu Tsai
2020-11-23 20:36       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:20   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
2020-11-04 14:51   ` Linus Walleij
2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:25   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
2020-11-02 12:49   ` Dan Murphy
2020-11-08 16:59     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
2020-11-03 16:31   ` Rob Herring
2020-11-22 18:38     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
2020-11-03 16:32   ` Rob Herring
2020-11-22 18:40     ` Jonathan Cameron
2021-02-21 16:33       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
2020-11-22 18:44   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
2020-11-03 16:34   ` Rob Herring
2020-11-22 18:50     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
2020-11-02 16:16   ` Denis CIOCCA
2020-10-31 18:48 ` [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
2020-11-03 17:24   ` Jonathan Cameron
2020-11-22 18:59     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6685d81-d09a-1372-cc17-96f66c87ffbe@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).