diff mbox series

[v3,1/2] dt-bindings: gpio: Add Spreadtrum GPIO controller documentation

Message ID 2834309f69a1ec37b84a33f153a3d0b90336bcc6.1517795460.git.baolin.wang@linaro.org
State New
Headers show
Series [v3,1/2] dt-bindings: gpio: Add Spreadtrum GPIO controller documentation | expand

Commit Message

Baolin Wang Feb. 5, 2018, 1:55 a.m. UTC
This patch adds the device tree bindings for the Spreadtrum
GPIO controller. The gpios will be supported by the GPIO
generic library.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
Changes since v1:
 - No updates.
---
 .../devicetree/bindings/gpio/gpio-sprd.txt         |   28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-sprd.txt

Comments

Rob Herring Feb. 7, 2018, 9:19 p.m. UTC | #1
On Mon, Feb 05, 2018 at 09:55:10AM +0800, Baolin Wang wrote:
> This patch adds the device tree bindings for the Spreadtrum
> GPIO controller. The gpios will be supported by the GPIO
> generic library.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
> Changes since v1:
>  - No updates.
> ---
>  .../devicetree/bindings/gpio/gpio-sprd.txt         |   28 ++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-sprd.txt

Please add acks/reviews when posting new versions.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Baolin Wang Feb. 8, 2018, 6:07 a.m. UTC | #2
Hi Rob,

On 8 February 2018 at 05:19, Rob Herring <robh@kernel.org> wrote:
> On Mon, Feb 05, 2018 at 09:55:10AM +0800, Baolin Wang wrote:
>> This patch adds the device tree bindings for the Spreadtrum
>> GPIO controller. The gpios will be supported by the GPIO
>> generic library.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>> ---
>> Changes since v1:
>>  - No updates.
>> ---
>>  .../devicetree/bindings/gpio/gpio-sprd.txt         |   28 ++++++++++++++++++++
>>  1 file changed, 28 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-sprd.txt
>
> Please add acks/reviews when posting new versions.

Yes, I always do that. But you acked my V2 after I already send out
the V3. Anyway thanks for your reviewed-tag.
Linus Walleij Feb. 13, 2018, 7:36 a.m. UTC | #3
On Mon, Feb 5, 2018 at 2:55 AM, Baolin Wang <baolin.wang@linaro.org> wrote:

> This patch adds the device tree bindings for the Spreadtrum
> GPIO controller. The gpios will be supported by the GPIO
> generic library.
>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

Patch applied with Rob's ACK from v2.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Feb. 13, 2018, 9:20 a.m. UTC | #4
On Mon, Feb 5, 2018 at 2:55 AM, Baolin Wang <baolin.wang@linaro.org> wrote:

> This patch adds the device tree bindings for the Spreadtrum
> GPIO controller. The gpios will be supported by the GPIO
> generic library.
>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

I took this patch out again for now, as it turns out
that not all of the variants are really GPIO controllers,
but rather irqchips.

If they can't read nor write any GPIO lines, they should
not have the property gpio-controller at all. Then they are
just irqchips.

We need some extended discussion about this.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Baolin Wang Feb. 14, 2018, 2:51 a.m. UTC | #5
Hi Linus,

On 13 February 2018 at 17:20, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Feb 5, 2018 at 2:55 AM, Baolin Wang <baolin.wang@linaro.org> wrote:
>
>> This patch adds the device tree bindings for the Spreadtrum
>> GPIO controller. The gpios will be supported by the GPIO
>> generic library.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>
> I took this patch out again for now, as it turns out
> that not all of the variants are really GPIO controllers,
> but rather irqchips.
>
> If they can't read nor write any GPIO lines, they should
> not have the property gpio-controller at all. Then they are
> just irqchips.

I did not get you here. All GPIOs can be read or write for this GPIO controller.
Linus Walleij Feb. 22, 2018, 2:38 p.m. UTC | #6
On Wed, Feb 14, 2018 at 3:51 AM, Baolin Wang <baolin.wang@linaro.org> wrote:
> On 13 February 2018 at 17:20, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Mon, Feb 5, 2018 at 2:55 AM, Baolin Wang <baolin.wang@linaro.org> wrote:
>>
>>> This patch adds the device tree bindings for the Spreadtrum
>>> GPIO controller. The gpios will be supported by the GPIO
>>> generic library.
>>>
>>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>>
>> I took this patch out again for now, as it turns out
>> that not all of the variants are really GPIO controllers,
>> but rather irqchips.
>>
>> If they can't read nor write any GPIO lines, they should
>> not have the property gpio-controller at all. Then they are
>> just irqchips.
>
> I did not get you here. All GPIOs can be read or write for this GPIO controller.

Sorry I confused one of the drivers for the other.

I'm so clumsy sometimes :(

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-sprd.txt
new file mode 100644
index 0000000..eca97d4
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-sprd.txt
@@ -0,0 +1,28 @@ 
+Spreadtrum GPIO controller bindings
+
+The controller's registers are organized as sets of sixteen 16-bit
+registers with each set controlling a bank of up to 16 pins. A single
+interrupt is shared for all of the banks handled by the controller.
+
+Required properties:
+- compatible: Should be "sprd,sc9860-gpio".
+- reg: Define the base and range of the I/O address space containing
+the GPIO controller registers.
+- gpio-controller: Marks the device node as a GPIO controller.
+- #gpio-cells: Should be <2>. The first cell is the gpio number and
+the second cell is used to specify optional parameters.
+- interrupt-controller: Marks the device node as an interrupt controller.
+- #interrupt-cells: Should be <2>. Specifies the number of cells needed
+to encode interrupt source.
+- interrupts: Should be the port interrupt shared by all the gpios.
+
+Example:
+	ap_gpio: gpio@40280000 {
+		compatible = "sprd,sc9860-gpio";
+		reg = <0 0x40280000 0 0x1000>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+	};