Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609533 > unrolled thread

[PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver

Started byNandor Han <nandor.han@ge.com>
First post2017-03-27 09:50 +0200
Last post2017-04-05 15:00 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver Nandor Han <nandor.han@ge.com> - 2017-03-27 09:50 +0200
    [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation Nandor Han <nandor.han@ge.com> - 2017-03-27 10:10 +0200
      Re: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 04:10 +0200
      Re: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation Rob Herring <robh@kernel.org> - 2017-03-31 21:00 +0200
    Re: [PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver Linus Walleij <linus.walleij@linaro.org> - 2017-03-29 04:00 +0200
      [PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver "Han, Nandor (GE Healthcare)" <nandor.han@ge.com> - 2017-04-05 15:00 +0200

#1609533 — [PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver

FromNandor Han <nandor.han@ge.com>
Date2017-03-27 09:50 +0200
Subject[PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver
Message-ID<tpx6y-4iG-5@gated-at.bofh.it>
The patchset will add a driver to support basic functionality for
XRA1403 device. Features supported:
	- configure gpin as input/out
	- get/set gpio status

Documentation: A gpio-xra1403.txt file was added to document the DTS
	bindings related to driver.

Testing:

1. XRA1403 connected to iMX53 MCU
2. Export gpio from userspace
3. Verify that corresponding gpio directories are created
   in `/sys/class/gpio/gpioXX`
4. Export gpios from first and second bank as output
5. Set the output gpio pin to high/low and verify with the 
   oscilloscope that gpio status is according with the configured
   value.

Nandor Han (3):
  gpio - Add EXAR XRA1403 SPI GPIO expander driver
  doc,dts - add XRA1403 DTS binding documentation
  Add XRA1403 support to MAINTAINERS file

 .../devicetree/bindings/gpio/gpio-xra1403.txt      |  37 +++
 .../devicetree/bindings/vendor-prefixes.txt        |   1 +
 MAINTAINERS                                        |   8 +
 drivers/gpio/Kconfig                               |   5 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-xra1403.c                        | 252 +++++++++++++++++++++
 6 files changed, 304 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
 create mode 100644 drivers/gpio/gpio-xra1403.c

-- 
2.10.1

[toc] | [next] | [standalone]


#1609560 — [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation

FromNandor Han <nandor.han@ge.com>
Date2017-03-27 10:10 +0200
Subject[PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation
Message-ID<tpxSW-4Xx-25@gated-at.bofh.it>
In reply to#1609533
Add the XRA1403 DTS binding documentation.

Signed-off-by: Nandor Han <nandor.han@ge.com>
---
 .../devicetree/bindings/gpio/gpio-xra1403.txt      | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xra1403.txt

diff --git a/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt b/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
new file mode 100644
index 0000000..ccf5337
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
@@ -0,0 +1,37 @@
+GPIO Driver for XRA1403 16-BIT GPIO Expander With Reset Input from EXAR
+
+The XRA1403 is an 16-bit GPIO expander with an SPI interface. Features available:
+	- Individually programmable inputs:
+		- Internal pull-up resistors
+		- Polarity inversion
+		- Individual interrupt enable
+		- Rising edge and/or Falling edge interrupt
+		- Input filter
+	- Individually programmable outputs
+		- Output Level Control
+		- Output Three-State Control
+
+Properties
+----------
+Check documentation for SPI and GPIO controllers regarding properties needed to configure the node.
+
+	- compatible = "exar,xra1403".
+	- reg = SPI id of the device.
+	- gpio-controller: mark the node as gpio.
+
+Optional properties:
+-------------------
+	- reset-gpios: in case available used to control the device reset line.
+
+Example
+--------
+
+	gpioxra0: gpio@2 {
+		compatible = "exar,xra1403";
+		reg = <2>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		reset-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
+		spi-max-frequency = <1000000>;
+		status = "okay";
+	};
-- 
2.10.1

[toc] | [prev] | [next] | [standalone]


#1611496 — Re: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-03-29 04:10 +0200
SubjectRe: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation
Message-ID<tqbdD-8tJ-5@gated-at.bofh.it>
In reply to#1609560
On Mon, Mar 27, 2017 at 8:23 AM, Nandor Han <nandor.han@ge.com> wrote:

> Add the XRA1403 DTS binding documentation.
>
> Signed-off-by: Nandor Han <nandor.han@ge.com>

There is no big problem with this but:

> +The XRA1403 is an 16-bit GPIO expander with an SPI interface. Features available:
> +       - Individually programmable inputs:
> +               - Internal pull-up resistors
> +               - Polarity inversion
> +               - Individual interrupt enable
> +               - Rising edge and/or Falling edge interrupt
> +               - Input filter

Since you mention that it has interrupts maybe you want to add bindings
for the cascaded interrupt and the interrupt-controller; keyword etc
already now.

We just document what the hardware can do, we don't have to do all
of it in the first Linux driver submission.

Yours,
Linus Walleij

[toc] | [prev] | [next] | [standalone]


#1614254 — Re: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation

FromRob Herring <robh@kernel.org>
Date2017-03-31 21:00 +0200
SubjectRe: [PATCH 2/3] doc,dts - add XRA1403 DTS binding documentation
Message-ID<tr9Wa-8nY-17@gated-at.bofh.it>
In reply to#1609560
On Mon, Mar 27, 2017 at 09:23:01AM +0300, Nandor Han wrote:
> Add the XRA1403 DTS binding documentation.

"dt-bindings: gpio: ..." for the subject prefix please.

> 
> Signed-off-by: Nandor Han <nandor.han@ge.com>
> ---
>  .../devicetree/bindings/gpio/gpio-xra1403.txt      | 37 ++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt b/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
> new file mode 100644
> index 0000000..ccf5337
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
> @@ -0,0 +1,37 @@
> +GPIO Driver for XRA1403 16-BIT GPIO Expander With Reset Input from EXAR
> +
> +The XRA1403 is an 16-bit GPIO expander with an SPI interface. Features available:
> +	- Individually programmable inputs:
> +		- Internal pull-up resistors
> +		- Polarity inversion
> +		- Individual interrupt enable
> +		- Rising edge and/or Falling edge interrupt
> +		- Input filter
> +	- Individually programmable outputs
> +		- Output Level Control
> +		- Output Three-State Control
> +
> +Properties
> +----------
> +Check documentation for SPI and GPIO controllers regarding properties needed to configure the node.
> +
> +	- compatible = "exar,xra1403".
> +	- reg = SPI id of the device.
> +	- gpio-controller: mark the node as gpio.

#gpio-cells?

> +
> +Optional properties:
> +-------------------
> +	- reset-gpios: in case available used to control the device reset line.
> +
> +Example
> +--------
> +
> +	gpioxra0: gpio@2 {
> +		compatible = "exar,xra1403";
> +		reg = <2>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		reset-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
> +		spi-max-frequency = <1000000>;
> +		status = "okay";

Don't show status in examples.

> +	};
> -- 
> 2.10.1
> 

[toc] | [prev] | [next] | [standalone]


#1611492

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-03-29 04:00 +0200
Message-ID<tqb3Y-8bm-25@gated-at.bofh.it>
In reply to#1609533
On Mon, Mar 27, 2017 at 8:22 AM, Nandor Han <nandor.han@ge.com> wrote:

> Testing:
>
> 1. XRA1403 connected to iMX53 MCU
> 2. Export gpio from userspace
> 3. Verify that corresponding gpio directories are created
>    in `/sys/class/gpio/gpioXX`
> 4. Export gpios from first and second bank as output
> 5. Set the output gpio pin to high/low and verify with the
>    oscilloscope that gpio status is according with the configured
>    value.

Do *NOT* use the sysfs for testing GPIO.
This is being phased out.

Use the tools in tools/gpio/* so that you exercise the
character device instead of the old deprecated ABI.

Yours,
Linus Walleij

[toc] | [prev] | [next] | [standalone]


#1616905

From"Han, Nandor (GE Healthcare)" <nandor.han@ge.com>
Date2017-04-05 15:00 +0200
Message-ID<tsSHv-2II-9@gated-at.bofh.it>
In reply to#1611492

> -----Original Message-----
> From: Linus Walleij [mailto:linus.walleij@linaro.org]
> Sent: 29 March 2017 04:51
> To: Han, Nandor (GE Healthcare) <nandor.han@ge.com>
> Cc: Alexandre Courbot <gnurou@gmail.com>; Rob Herring <robh+dt@kernel.org>; Mark Rutland
> <mark.rutland@arm.com>; linux-gpio@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: EXT: Re: [PATCH 0/3] XRA1403,gpio - add XRA1403 gpio expander driver
> 

<snip>

> Do *NOT* use the sysfs for testing GPIO.
> This is being phased out.
> 
> Use the tools in tools/gpio/* so that you exercise the
> character device instead of the old deprecated ABI.
> 

Thanks Linus, really good and  helpful comments.
I agree that make more sense to test with tools/gpio/*.

> Yours,
> Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web