diff mbox series

[1/2] dt-bindings: gpio: Add Spreadtrum EIC controller documentation

Message ID e89b91042abbbcf04cb39a3350af000cc411eee1.1518076643.git.baolin.wang@linaro.org
State New
Headers show
Series [1/2] dt-bindings: gpio: Add Spreadtrum EIC controller documentation | expand

Commit Message

Baolin Wang Feb. 8, 2018, 8:01 a.m. UTC
This patch adds the device tree bindings for the Spreadtrum EIC
controller. The EIC can be recognized as one special type of GPIO,
which can only be used as input.

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

Comments

Linus Walleij Feb. 13, 2018, 8:28 a.m. UTC | #1
Hi Baolin!

Thank you for your patch.

On Thu, Feb 8, 2018 at 9:01 AM, Baolin Wang <baolin.wang@linaro.org> wrote:

> This patch adds the device tree bindings for the Spreadtrum EIC
> controller. The EIC can be recognized as one special type of GPIO,

s/recognized as one/seen as a/g

> which can only be used as input.
>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

> +The EIC is the abbreviation of external interrupt controller, which
> +is only can be used as input mode. The EIC controller includes 4

can be used only in input mode.

> +sub-modules: EIC-Debounce, EIC-Latch, EIC-Async, EIC-Sync.

Are they four sub-modules that are always synthesized into the
silicon at the same time, or do you mean that when producing the
hardware, the designer will choose one of these four types (it looks
like that from the example).

> +
> +The EIC-debounce sub-module provides up to 8 source input signal
> +connection.

connections.

> A debounce machanism is used to

mechanism

> capture input signal's

capture the input signals'

(note plural signals genitive)

> +stable status (ms grade)

is that millisecond resolution you mean?

> and a single-trigger mechanism is introduced
> +into this sub-module to enhance the input event detection reliability.
> +In addition, this sub-module's clock can be shut-off automatically to

no dash in "shut off"

> +reduce power dissipation. The debounce range is from 1ms to 4s with
> +the step of 1ms.

a step size of

> If the input signal is shorter than 1ms, it will be
> +omitted as this sub-module.

I don't understand the last part, do you mean the signal will be ignored
if it is asserted for less than 1 ms?

> +The EIC-latch sub-module is used to latch some special input signal

signals (plural)

What is special about them?

> +and send interrupts to MCU core, and it can provide up to 8 latch
> +source input signal connection.

connections (plural)

> +The EIC-async sub-module uses 32k clock

a 32kHz clock

> to capture short signal

to capture the short signal

> +(us grade)

Do you mean "microsecond granularity"?

> to generate interrupt to MCU by level or edge trigger.

What is MCU? I think you can just omit it, it could be integrated
elsewhere.

> +The EIC-sync is similar with GPIO's input function.

Do you mean that the EIC-sync module is a synchronized signal input
register? Please write that.

> +Required properties:
> +- compatible: Should be one of the following:
> +  "sprd,sc9860-eic-debounce",
> +  "sprd,sc9860-eic-latch",
> +  "sprd,sc9860-eic-async",
> +  "sprd,sc9860-eic-sync",
> +  "sprd,sc27xx-eic-debounce".

So it looks like there is one at the time, so in the SC9860
all four modules exist, but at different addresses?

(...)
> +Example:
> +       eic_debounce: eic@40210000 {
> +               compatible = "sprd,sc9860-eic-debounce";
> +               reg = <0 0x40210000 0 0x80>;

So does this mean that this is a debounced-only EIC?

There are latch, async and sync versions somewhere else in
memory? Or there could be? And they are never say debounce
and latch at the same time? Etc?

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
Rob Herring Feb. 13, 2018, 11:39 p.m. UTC | #2
On Thu, Feb 08, 2018 at 04:01:42PM +0800, Baolin Wang wrote:
> This patch adds the device tree bindings for the Spreadtrum EIC
> controller. The EIC can be recognized as one special type of GPIO,
> which can only be used as input.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
>  .../devicetree/bindings/gpio/gpio-eic-sprd.txt     |   51 ++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> new file mode 100644
> index 0000000..34f194f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> @@ -0,0 +1,51 @@
> +Spreadtrum EIC controller bindings
> +
> +The EIC is the abbreviation of external interrupt controller, which
> +is only can be used as input mode. The EIC controller includes 4
> +sub-modules: EIC-Debounce, EIC-Latch, EIC-Async, EIC-Sync.
> +
> +The EIC-debounce sub-module provides up to 8 source input signal
> +connection. A debounce machanism is used to capture input signal's
> +stable status (ms grade) and a single-trigger mechanism is introduced
> +into this sub-module to enhance the input event detection reliability.
> +In addition, this sub-module's clock can be shut-off automatically to
> +reduce power dissipation. The debounce range is from 1ms to 4s with
> +the step of 1ms. If the input signal is shorter than 1ms, it will be
> +omitted as this sub-module.
> +
> +The EIC-latch sub-module is used to latch some special input signal
> +and send interrupts to MCU core, and it can provide up to 8 latch
> +source input signal connection.
> +
> +The EIC-async sub-module uses 32k clock to capture short signal (us
> +grade) to generate interrupt to MCU by level or edge trigger.
> +
> +The EIC-sync is similar with GPIO's input function.
> +
> +Required properties:
> +- compatible: Should be one of the following:
> +  "sprd,sc9860-eic-debounce",
> +  "sprd,sc9860-eic-latch",
> +  "sprd,sc9860-eic-async",
> +  "sprd,sc9860-eic-sync",
> +  "sprd,sc27xx-eic-debounce".
> +- 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.

Why a gpio controller? Do you read the input pin state?

> +- #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:
> +	eic_debounce: eic@40210000 {

interrupt-controller@...

Or (if this remains a gpio controller)

gpio@...

> +		compatible = "sprd,sc9860-eic-debounce";
> +		reg = <0 0x40210000 0 0x80>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		interrupt-controller;
> +		#interrupt-cells = <2>;
> +		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;

The example doesn't seem to match your description of the block or 
blocks. You talk about a bunch of sub modules and then there's just this 
one node?

> +	};
> -- 
> 1.7.9.5
> 
--
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, 3:08 a.m. UTC | #3
Hi Linus,

On 13 February 2018 at 16:28, Linus Walleij <linus.walleij@linaro.org> wrote:
> Hi Baolin!
>
> Thank you for your patch.
>
> On Thu, Feb 8, 2018 at 9:01 AM, Baolin Wang <baolin.wang@linaro.org> wrote:
>
>> This patch adds the device tree bindings for the Spreadtrum EIC
>> controller. The EIC can be recognized as one special type of GPIO,
>
> s/recognized as one/seen as a/g

Sorry for the typos.

>
>> which can only be used as input.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>
>> +The EIC is the abbreviation of external interrupt controller, which
>> +is only can be used as input mode. The EIC controller includes 4
>
> can be used only in input mode.

OK.

>
>> +sub-modules: EIC-Debounce, EIC-Latch, EIC-Async, EIC-Sync.
>
> Are they four sub-modules that are always synthesized into the
> silicon at the same time, or do you mean that when producing the
> hardware, the designer will choose one of these four types (it looks
> like that from the example).

Usually they are all synthesized into the silicon, but not always. For
our PMIC EIC, we only have one debounce EIC.

>
>> +
>> +The EIC-debounce sub-module provides up to 8 source input signal
>> +connection.
>
> connections.
>
>> A debounce machanism is used to
>
> mechanism
>
>> capture input signal's
>
> capture the input signals'

Sure.

>
> (note plural signals genitive)
>
>> +stable status (ms grade)
>
> is that millisecond resolution you mean?

Yes.

>
>> and a single-trigger mechanism is introduced
>> +into this sub-module to enhance the input event detection reliability.
>> +In addition, this sub-module's clock can be shut-off automatically to
>
> no dash in "shut off"

OK.

>
>> +reduce power dissipation. The debounce range is from 1ms to 4s with
>> +the step of 1ms.
>
> a step size of

OK.

>
>> If the input signal is shorter than 1ms, it will be
>> +omitted as this sub-module.
>
> I don't understand the last part, do you mean the signal will be ignored
> if it is asserted for less than 1 ms?

Yes, sorry for confusing, and I will modify this part.

>
>> +The EIC-latch sub-module is used to latch some special input signal
>
> signals (plural)
>
> What is special about them?

Ah, I will describe them in next version after making sure with my colleagues.

>
>> +and send interrupts to MCU core, and it can provide up to 8 latch
>> +source input signal connection.
>
> connections (plural)
>
>> +The EIC-async sub-module uses 32k clock
>
> a 32kHz clock
>
>> to capture short signal
>
> to capture the short signal

OK.

>
>> +(us grade)
>
> Do you mean "microsecond granularity"?

Yes.

>
>> to generate interrupt to MCU by level or edge trigger.
>
> What is MCU? I think you can just omit it, it could be integrated
> elsewhere.

Sure, I will remove it.

>
>> +The EIC-sync is similar with GPIO's input function.
>
> Do you mean that the EIC-sync module is a synchronized signal input
> register? Please write that.

Yes. OK.

>
>> +Required properties:
>> +- compatible: Should be one of the following:
>> +  "sprd,sc9860-eic-debounce",
>> +  "sprd,sc9860-eic-latch",
>> +  "sprd,sc9860-eic-async",
>> +  "sprd,sc9860-eic-sync",
>> +  "sprd,sc27xx-eic-debounce".
>
> So it looks like there is one at the time, so in the SC9860
> all four modules exist, but at different addresses?

Yes.

>
> (...)
>> +Example:
>> +       eic_debounce: eic@40210000 {
>> +               compatible = "sprd,sc9860-eic-debounce";
>> +               reg = <0 0x40210000 0 0x80>;
>
> So does this mean that this is a debounced-only EIC?

Yes.

>
> There are latch, async and sync versions somewhere else in
> memory? Or there could be? And they are never say debounce
> and latch at the same time? Etc?

I did not list latch, async, and sync EIC. They are different
sub-modules and they can be listed at the same time. I will add other
device nodes in next version. Thanks for your comments.

>
> Yours,
> Linus Walleij
Baolin Wang Feb. 14, 2018, 3:15 a.m. UTC | #4
Hi Rob,

On 14 February 2018 at 07:39, Rob Herring <robh@kernel.org> wrote:
> On Thu, Feb 08, 2018 at 04:01:42PM +0800, Baolin Wang wrote:
>> This patch adds the device tree bindings for the Spreadtrum EIC
>> controller. The EIC can be recognized as one special type of GPIO,
>> which can only be used as input.
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>> ---
>>  .../devicetree/bindings/gpio/gpio-eic-sprd.txt     |   51 ++++++++++++++++++++
>>  1 file changed, 51 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
>> new file mode 100644
>> index 0000000..34f194f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
>> @@ -0,0 +1,51 @@
>> +Spreadtrum EIC controller bindings
>> +
>> +The EIC is the abbreviation of external interrupt controller, which
>> +is only can be used as input mode. The EIC controller includes 4
>> +sub-modules: EIC-Debounce, EIC-Latch, EIC-Async, EIC-Sync.
>> +
>> +The EIC-debounce sub-module provides up to 8 source input signal
>> +connection. A debounce machanism is used to capture input signal's
>> +stable status (ms grade) and a single-trigger mechanism is introduced
>> +into this sub-module to enhance the input event detection reliability.
>> +In addition, this sub-module's clock can be shut-off automatically to
>> +reduce power dissipation. The debounce range is from 1ms to 4s with
>> +the step of 1ms. If the input signal is shorter than 1ms, it will be
>> +omitted as this sub-module.
>> +
>> +The EIC-latch sub-module is used to latch some special input signal
>> +and send interrupts to MCU core, and it can provide up to 8 latch
>> +source input signal connection.
>> +
>> +The EIC-async sub-module uses 32k clock to capture short signal (us
>> +grade) to generate interrupt to MCU by level or edge trigger.
>> +
>> +The EIC-sync is similar with GPIO's input function.
>> +
>> +Required properties:
>> +- compatible: Should be one of the following:
>> +  "sprd,sc9860-eic-debounce",
>> +  "sprd,sc9860-eic-latch",
>> +  "sprd,sc9860-eic-async",
>> +  "sprd,sc9860-eic-sync",
>> +  "sprd,sc27xx-eic-debounce".
>> +- 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.
>
> Why a gpio controller? Do you read the input pin state?

We always regard it as GPIO except it only can be used as input mode.
Like debounce eic, we still need request it before using it.

>
>> +- #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:
>> +     eic_debounce: eic@40210000 {
>
> interrupt-controller@...
>
> Or (if this remains a gpio controller)
>
> gpio@...

OK.

>
>> +             compatible = "sprd,sc9860-eic-debounce";
>> +             reg = <0 0x40210000 0 0x80>;
>> +             gpio-controller;
>> +             #gpio-cells = <2>;
>> +             interrupt-controller;
>> +             #interrupt-cells = <2>;
>> +             interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
>
> The example doesn't seem to match your description of the block or
> blocks. You talk about a bunch of sub modules and then there's just this
> one node?

I just list one as one example, and I will list all of them in next
version. Thanks.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
new file mode 100644
index 0000000..34f194f
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
@@ -0,0 +1,51 @@ 
+Spreadtrum EIC controller bindings
+
+The EIC is the abbreviation of external interrupt controller, which
+is only can be used as input mode. The EIC controller includes 4
+sub-modules: EIC-Debounce, EIC-Latch, EIC-Async, EIC-Sync.
+
+The EIC-debounce sub-module provides up to 8 source input signal
+connection. A debounce machanism is used to capture input signal's
+stable status (ms grade) and a single-trigger mechanism is introduced
+into this sub-module to enhance the input event detection reliability.
+In addition, this sub-module's clock can be shut-off automatically to
+reduce power dissipation. The debounce range is from 1ms to 4s with
+the step of 1ms. If the input signal is shorter than 1ms, it will be
+omitted as this sub-module.
+
+The EIC-latch sub-module is used to latch some special input signal
+and send interrupts to MCU core, and it can provide up to 8 latch
+source input signal connection.
+
+The EIC-async sub-module uses 32k clock to capture short signal (us
+grade) to generate interrupt to MCU by level or edge trigger.
+
+The EIC-sync is similar with GPIO's input function.
+
+Required properties:
+- compatible: Should be one of the following:
+  "sprd,sc9860-eic-debounce",
+  "sprd,sc9860-eic-latch",
+  "sprd,sc9860-eic-async",
+  "sprd,sc9860-eic-sync",
+  "sprd,sc27xx-eic-debounce".
+- 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:
+	eic_debounce: eic@40210000 {
+		compatible = "sprd,sc9860-eic-debounce";
+		reg = <0 0x40210000 0 0x80>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+	};