diff mbox

[1/9] ARM: dt: add header to define GPIO flags

Message ID 1360791198-29462-2-git-send-email-swarren@wwwdotorg.org
State Superseded, archived
Headers show

Commit Message

Stephen Warren Feb. 13, 2013, 9:33 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Many GPIO device tree bindings use the same flags. Create a header to
define those.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/boot/dts/gpio.h |   10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 arch/arm/boot/dts/gpio.h

Comments

Hiroshi Doyu Feb. 14, 2013, 8:48 p.m. UTC | #1
Stephen Warren <swarren@wwwdotorg.org> wrote @ Wed, 13 Feb 2013 22:33:10 +0100:

> From: Stephen Warren <swarren@nvidia.com>
> 
> Many GPIO device tree bindings use the same flags. Create a header to
> define those.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  arch/arm/boot/dts/gpio.h |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>  create mode 100644 arch/arm/boot/dts/gpio.h
> 
> diff --git a/arch/arm/boot/dts/gpio.h b/arch/arm/boot/dts/gpio.h
> new file mode 100644
> index 0000000..4c9da69
> --- /dev/null
> +++ b/arch/arm/boot/dts/gpio.h
> @@ -0,0 +1,10 @@
> +/*
> + * This header provides constants for most GPIO bindings.
> + *
> + * Most GPIO bindings include a flags cell as part of the GPIO specifier.
> + * In most cases, the format of the flags cell uses the standard values
> + * defined in this header.
> + */

#ifdef _DTS_GPIO_H
#define _DTS_GPIO_H

> +
> +#define GPIO_ACTIVE_HIGH 0
> +#define GPIO_ACTIVE_LOW 1

#endif /* _DTS_GPIO_H */

To avoid multple inclusion problems, do we want the above
ifdef/define/endif for other DT header files as well?
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren Feb. 14, 2013, 11:29 p.m. UTC | #2
On 02/14/2013 01:48 PM, Hiroshi Doyu wrote:
> Stephen Warren <swarren@wwwdotorg.org> wrote @ Wed, 13 Feb 2013 22:33:10 +0100:
>> Many GPIO device tree bindings use the same flags. Create a header to
>> define those.
... [discussion about adding include guards]
> To avoid multple inclusion problems, do we want the above
> ifdef/define/endif for other DT header files as well?

Yes, we should probably add include guards to all the files. I'll update
my patch series.

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Grant Likely March 4, 2013, 8:34 a.m. UTC | #3
On Wed, 13 Feb 2013 14:33:10 -0700, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Many GPIO device tree bindings use the same flags. Create a header to
> define those.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  arch/arm/boot/dts/gpio.h |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>  create mode 100644 arch/arm/boot/dts/gpio.h
> 
> diff --git a/arch/arm/boot/dts/gpio.h b/arch/arm/boot/dts/gpio.h
> new file mode 100644
> index 0000000..4c9da69
> --- /dev/null
> +++ b/arch/arm/boot/dts/gpio.h

Stephen, you know better than this. This is common code. Don't put it
under arch/arm.

g.

> @@ -0,0 +1,10 @@
> +/*
> + * This header provides constants for most GPIO bindings.
> + *
> + * Most GPIO bindings include a flags cell as part of the GPIO specifier.
> + * In most cases, the format of the flags cell uses the standard values
> + * defined in this header.
> + */
> +
> +#define GPIO_ACTIVE_HIGH 0
> +#define GPIO_ACTIVE_LOW 1
> -- 
> 1.7.10.4
>
Stephen Warren March 4, 2013, 5:13 p.m. UTC | #4
On 03/04/2013 01:34 AM, Grant Likely wrote:
> On Wed, 13 Feb 2013 14:33:10 -0700, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Many GPIO device tree bindings use the same flags. Create a header to
>> define those.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>>  arch/arm/boot/dts/gpio.h |   10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>  create mode 100644 arch/arm/boot/dts/gpio.h
>>
>> diff --git a/arch/arm/boot/dts/gpio.h b/arch/arm/boot/dts/gpio.h
>> new file mode 100644
>> index 0000000..4c9da69
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/gpio.h
> 
> Stephen, you know better than this. This is common code. Don't put it
> under arch/arm.

In V2 of the patch which modifies the dtc+cpp include path:

https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-February/028591.html

... I have moved the common headers to top-level include/dt-bindings, so
it is shared across all arch. I didn't repost all the changes to the *.h
and *.dts* files yet; I was waiting for any comments on the patch above.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/gpio.h b/arch/arm/boot/dts/gpio.h
new file mode 100644
index 0000000..4c9da69
--- /dev/null
+++ b/arch/arm/boot/dts/gpio.h
@@ -0,0 +1,10 @@ 
+/*
+ * This header provides constants for most GPIO bindings.
+ *
+ * Most GPIO bindings include a flags cell as part of the GPIO specifier.
+ * In most cases, the format of the flags cell uses the standard values
+ * defined in this header.
+ */
+
+#define GPIO_ACTIVE_HIGH 0
+#define GPIO_ACTIVE_LOW 1