diff mbox series

[V2,1/2] dt-bindings: gpio: Add a header file for Amlogic C3 SoCs

Message ID 20230710042812.2007928-2-huqiang.qin@amlogic.com (mailing list archive)
State New, archived
Headers show
Series Add pinctrl driver support for Amlogic C3 SoCs | expand

Commit Message

Huqiang Qin July 10, 2023, 4:28 a.m. UTC
Add dt-binding and related header file for Amlogic C3 GPIO.

Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
---
 .../pinctrl/amlogic,meson-pinctrl-a1.yaml     |  1 +
 include/dt-bindings/gpio/amlogic-c3-gpio.h    | 72 +++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 include/dt-bindings/gpio/amlogic-c3-gpio.h

Comments

Bartosz Golaszewski July 10, 2023, 9:04 a.m. UTC | #1
On Mon, Jul 10, 2023 at 6:28 AM Huqiang Qin <huqiang.qin@amlogic.com> wrote:
>
> Add dt-binding and related header file for Amlogic C3 GPIO.
>

The subject of this patch is describing the new model, not only adding
the header, so make the commit message say that, e.g.: dt-bindings:
...: describe xyz

Bart

> Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
> ---
>  .../pinctrl/amlogic,meson-pinctrl-a1.yaml     |  1 +
>  include/dt-bindings/gpio/amlogic-c3-gpio.h    | 72 +++++++++++++++++++
>  2 files changed, 73 insertions(+)
>  create mode 100644 include/dt-bindings/gpio/amlogic-c3-gpio.h
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> index 99080c9eaac3..e019b6aa6ca3 100644
> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> @@ -17,6 +17,7 @@ properties:
>      enum:
>        - amlogic,meson-a1-periphs-pinctrl
>        - amlogic,meson-s4-periphs-pinctrl
> +      - amlogic,c3-periphs-pinctrl
>
>  required:
>    - compatible
> diff --git a/include/dt-bindings/gpio/amlogic-c3-gpio.h b/include/dt-bindings/gpio/amlogic-c3-gpio.h
> new file mode 100644
> index 000000000000..75c8da6f505f
> --- /dev/null
> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
> @@ -0,0 +1,72 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> +/*
> + * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
> + * Author: Huqiang Qin <huqiang.qin@amlogic.com>
> + */
> +
> +#ifndef _DT_BINDINGS_AMLOGIC_C3_GPIO_H
> +#define _DT_BINDINGS_AMLOGIC_C3_GPIO_H
> +
> +#define        GPIOE_0         0
> +#define        GPIOE_1         1
> +#define        GPIOE_2         2
> +#define        GPIOE_3         3
> +#define        GPIOE_4         4
> +
> +#define        GPIOB_0         5
> +#define        GPIOB_1         6
> +#define        GPIOB_2         7
> +#define        GPIOB_3         8
> +#define        GPIOB_4         9
> +#define        GPIOB_5         10
> +#define        GPIOB_6         11
> +#define        GPIOB_7         12
> +#define        GPIOB_8         13
> +#define        GPIOB_9         14
> +#define        GPIOB_10        15
> +#define        GPIOB_11        16
> +#define        GPIOB_12        17
> +#define        GPIOB_13        18
> +#define        GPIOB_14        19
> +
> +#define        GPIOC_0         20
> +#define        GPIOC_1         21
> +#define        GPIOC_2         22
> +#define        GPIOC_3         23
> +#define        GPIOC_4         24
> +#define        GPIOC_5         25
> +#define        GPIOC_6         26
> +
> +#define        GPIOX_0         27
> +#define        GPIOX_1         28
> +#define        GPIOX_2         29
> +#define        GPIOX_3         30
> +#define        GPIOX_4         31
> +#define        GPIOX_5         32
> +#define        GPIOX_6         33
> +#define        GPIOX_7         34
> +#define        GPIOX_8         35
> +#define        GPIOX_9         36
> +#define        GPIOX_10        37
> +#define        GPIOX_11        38
> +#define        GPIOX_12        39
> +#define        GPIOX_13        40
> +
> +#define        GPIOD_0         41
> +#define        GPIOD_1         42
> +#define        GPIOD_2         43
> +#define        GPIOD_3         44
> +#define        GPIOD_4         45
> +#define        GPIOD_5         46
> +#define        GPIOD_6         47
> +
> +#define        GPIOA_0         48
> +#define        GPIOA_1         49
> +#define        GPIOA_2         50
> +#define        GPIOA_3         51
> +#define        GPIOA_4         52
> +#define        GPIOA_5         53
> +
> +#define        GPIO_TEST_N     54
> +
> +#endif /* _DT_BINDINGS_AMLOGIC_C3_GPIO_H */
> --
> 2.37.1
>
Conor Dooley July 10, 2023, 4:38 p.m. UTC | #2
On Mon, Jul 10, 2023 at 12:28:11PM +0800, Huqiang Qin wrote:
> Add dt-binding and related header file for Amlogic C3 GPIO.
> 
> Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
> ---
>  .../pinctrl/amlogic,meson-pinctrl-a1.yaml     |  1 +
>  include/dt-bindings/gpio/amlogic-c3-gpio.h    | 72 +++++++++++++++++++
>  2 files changed, 73 insertions(+)
>  create mode 100644 include/dt-bindings/gpio/amlogic-c3-gpio.h
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> index 99080c9eaac3..e019b6aa6ca3 100644
> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> @@ -17,6 +17,7 @@ properties:
>      enum:
>        - amlogic,meson-a1-periphs-pinctrl
>        - amlogic,meson-s4-periphs-pinctrl
> +      - amlogic,c3-periphs-pinctrl

Alphanumerical order here perhaps?

>  required:
>    - compatible
> diff --git a/include/dt-bindings/gpio/amlogic-c3-gpio.h b/include/dt-bindings/gpio/amlogic-c3-gpio.h
> new file mode 100644
> index 000000000000..75c8da6f505f
> --- /dev/null
> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
> @@ -0,0 +1,72 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */

Any reason to deviate from the usual license terms for bindings, which is
"GPL-2.0-only OR BSD-2-Clause"?

Cheers,
Conor.


> +/*
> + * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
> + * Author: Huqiang Qin <huqiang.qin@amlogic.com>
> + */
> +
> +#ifndef _DT_BINDINGS_AMLOGIC_C3_GPIO_H
> +#define _DT_BINDINGS_AMLOGIC_C3_GPIO_H
> +
> +#define	GPIOE_0		0
> +#define	GPIOE_1		1
> +#define	GPIOE_2		2
> +#define	GPIOE_3		3
> +#define	GPIOE_4		4
> +
> +#define	GPIOB_0		5
> +#define	GPIOB_1		6
> +#define	GPIOB_2		7
> +#define	GPIOB_3		8
> +#define	GPIOB_4		9
> +#define	GPIOB_5		10
> +#define	GPIOB_6		11
> +#define	GPIOB_7		12
> +#define	GPIOB_8		13
> +#define	GPIOB_9		14
> +#define	GPIOB_10	15
> +#define	GPIOB_11	16
> +#define	GPIOB_12	17
> +#define	GPIOB_13	18
> +#define	GPIOB_14	19
> +
> +#define	GPIOC_0		20
> +#define	GPIOC_1		21
> +#define	GPIOC_2		22
> +#define	GPIOC_3		23
> +#define	GPIOC_4		24
> +#define	GPIOC_5		25
> +#define	GPIOC_6		26
> +
> +#define	GPIOX_0		27
> +#define	GPIOX_1		28
> +#define	GPIOX_2		29
> +#define	GPIOX_3		30
> +#define	GPIOX_4		31
> +#define	GPIOX_5		32
> +#define	GPIOX_6		33
> +#define	GPIOX_7		34
> +#define	GPIOX_8		35
> +#define	GPIOX_9		36
> +#define	GPIOX_10	37
> +#define	GPIOX_11	38
> +#define	GPIOX_12	39
> +#define	GPIOX_13	40
> +
> +#define	GPIOD_0		41
> +#define	GPIOD_1		42
> +#define	GPIOD_2		43
> +#define	GPIOD_3		44
> +#define	GPIOD_4		45
> +#define	GPIOD_5		46
> +#define	GPIOD_6		47
> +
> +#define	GPIOA_0		48
> +#define	GPIOA_1		49
> +#define	GPIOA_2		50
> +#define	GPIOA_3		51
> +#define	GPIOA_4		52
> +#define	GPIOA_5		53
> +
> +#define	GPIO_TEST_N	54
> +
> +#endif /* _DT_BINDINGS_AMLOGIC_C3_GPIO_H */
> -- 
> 2.37.1
>
Huqiang Qin July 11, 2023, 2:55 a.m. UTC | #3
Hi Conor,

On 2023/7/11 0:38, Conor Dooley wrote:
>> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
>> index 99080c9eaac3..e019b6aa6ca3 100644
>> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
>> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
>> @@ -17,6 +17,7 @@ properties:
>>      enum:
>>        - amlogic,meson-a1-periphs-pinctrl
>>        - amlogic,meson-s4-periphs-pinctrl
>> +      - amlogic,c3-periphs-pinctrl
> Alphanumerical order here perhaps?

Okay

> 
>> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
>> @@ -0,0 +1,72 @@
>> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> Any reason to deviate from the usual license terms for bindings, which is
> "GPL-2.0-only OR BSD-2-Clause"?

I initially used the license commonly used by Amlogic (reference: meson-s4-gpio.h):
```
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
```

But when I checked the patch, some warnings appeared:
```
WARNING: DT binding headers should be licensed (GPL-2.0-only OR .*)
#37: FILE: include/dt-bindings/gpio/amlogic-c3-gpio.h:1:
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
```
So I followed the prompts and changed the license.

Can I ignore this warning and use the (GPL-2.0+ OR MIT) license?

---
Best Regards,
Huqiang Qin
Conor Dooley July 11, 2023, 6:05 p.m. UTC | #4
On Tue, Jul 11, 2023 at 10:55:40AM +0800, Huqiang Qin wrote:
> Hi Conor,
> 
> On 2023/7/11 0:38, Conor Dooley wrote:
> >> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> >> index 99080c9eaac3..e019b6aa6ca3 100644
> >> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> >> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
> >> @@ -17,6 +17,7 @@ properties:
> >>      enum:
> >>        - amlogic,meson-a1-periphs-pinctrl
> >>        - amlogic,meson-s4-periphs-pinctrl
> >> +      - amlogic,c3-periphs-pinctrl
> > Alphanumerical order here perhaps?
> 
> Okay
> 
> > 
> >> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
> >> @@ -0,0 +1,72 @@
> >> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> > Any reason to deviate from the usual license terms for bindings, which is
> > "GPL-2.0-only OR BSD-2-Clause"?
> 
> I initially used the license commonly used by Amlogic (reference: meson-s4-gpio.h):
> ```
> /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
> ```
> 
> But when I checked the patch, some warnings appeared:
> ```
> WARNING: DT binding headers should be licensed (GPL-2.0-only OR .*)
> #37: FILE: include/dt-bindings/gpio/amlogic-c3-gpio.h:1:
> +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
> ```
> So I followed the prompts and changed the license.
> 
> Can I ignore this warning and use the (GPL-2.0+ OR MIT) license?

If the tools are happy then I suppose you are okay.. I'll leave that to
Rob or Krzysztof, but if you have a reason for diverging that seems fine
to me.

Thanks,
Conor.
Krzysztof Kozlowski July 12, 2023, 5:56 a.m. UTC | #5
On 11/07/2023 20:05, Conor Dooley wrote:
>>>> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
>>>> @@ -0,0 +1,72 @@
>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
>>> Any reason to deviate from the usual license terms for bindings, which is
>>> "GPL-2.0-only OR BSD-2-Clause"?
>>
>> I initially used the license commonly used by Amlogic (reference: meson-s4-gpio.h):
>> ```
>> /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
>> ```
>>
>> But when I checked the patch, some warnings appeared:
>> ```
>> WARNING: DT binding headers should be licensed (GPL-2.0-only OR .*)
>> #37: FILE: include/dt-bindings/gpio/amlogic-c3-gpio.h:1:
>> +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
>> ```
>> So I followed the prompts and changed the license.
>>
>> Can I ignore this warning and use the (GPL-2.0+ OR MIT) license?
> 
> If the tools are happy then I suppose you are okay.. I'll leave that to
> Rob or Krzysztof, but if you have a reason for diverging that seems fine
> to me.

It is very weird that company wants GPLv3 and even weirder that it
agrees for GPLv4 and GPLv5 (GPLv5 might force Amlogic to do some
interesting things...). I am pretty sure company lawyers don't want it
and just do not understand licenses or someone forgot to actually check
it. Anyway, it's fine for Linux kernel, if you really need it.

However the argument was "meson-s4-gpio.h" has it, which is not really
correct argument or accurate. Is it derivative work that you need the
same license? If not, why presence of something causes you to do the
same without thinking?

If Amlogic requires GPLv3 or GPL4 or GPLv2000, please confirm it here
with your official email. Otherwise, if it is not a derivative work
confirm that. Otherwise just go with what checkpatch asks you.

Best regards,
Krzysztof
Kelvin Zhang July 14, 2023, 8:43 a.m. UTC | #6
On 2023/7/12 13:56, Krzysztof Kozlowski wrote:
> 
> On 11/07/2023 20:05, Conor Dooley wrote:
>>>>> +++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
>>>>> @@ -0,0 +1,72 @@
>>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
>>>> Any reason to deviate from the usual license terms for bindings, which is
>>>> "GPL-2.0-only OR BSD-2-Clause"?
>>>
>>> I initially used the license commonly used by Amlogic (reference: meson-s4-gpio.h):
>>> ```
>>> /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
>>> ```
>>>
>>> But when I checked the patch, some warnings appeared:
>>> ```
>>> WARNING: DT binding headers should be licensed (GPL-2.0-only OR .*)
>>> #37: FILE: include/dt-bindings/gpio/amlogic-c3-gpio.h:1:
>>> +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
>>> ```
>>> So I followed the prompts and changed the license.
>>>
>>> Can I ignore this warning and use the (GPL-2.0+ OR MIT) license?
>>
>> If the tools are happy then I suppose you are okay.. I'll leave that to
>> Rob or Krzysztof, but if you have a reason for diverging that seems fine
>> to me.
> 
> It is very weird that company wants GPLv3 and even weirder that it
> agrees for GPLv4 and GPLv5 (GPLv5 might force Amlogic to do some
> interesting things...). I am pretty sure company lawyers don't want it
> and just do not understand licenses or someone forgot to actually check
> it. Anyway, it's fine for Linux kernel, if you really need it.
> 

That's true.
We will follow the checkpatch suggestion.
Thanks!

> However the argument was "meson-s4-gpio.h" has it, which is not really
> correct argument or accurate. Is it derivative work that you need the
> same license? If not, why presence of something causes you to do the
> same without thinking?
> 
> If Amlogic requires GPLv3 or GPL4 or GPLv2000, please confirm it here
> with your official email. Otherwise, if it is not a derivative work
> confirm that. Otherwise just go with what checkpatch asks you.
> 
> Best regards,
> Krzysztof
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
index 99080c9eaac3..e019b6aa6ca3 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-a1.yaml
@@ -17,6 +17,7 @@  properties:
     enum:
       - amlogic,meson-a1-periphs-pinctrl
       - amlogic,meson-s4-periphs-pinctrl
+      - amlogic,c3-periphs-pinctrl
 
 required:
   - compatible
diff --git a/include/dt-bindings/gpio/amlogic-c3-gpio.h b/include/dt-bindings/gpio/amlogic-c3-gpio.h
new file mode 100644
index 000000000000..75c8da6f505f
--- /dev/null
+++ b/include/dt-bindings/gpio/amlogic-c3-gpio.h
@@ -0,0 +1,72 @@ 
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (c) 2021 Amlogic, Inc. All rights reserved.
+ * Author: Huqiang Qin <huqiang.qin@amlogic.com>
+ */
+
+#ifndef _DT_BINDINGS_AMLOGIC_C3_GPIO_H
+#define _DT_BINDINGS_AMLOGIC_C3_GPIO_H
+
+#define	GPIOE_0		0
+#define	GPIOE_1		1
+#define	GPIOE_2		2
+#define	GPIOE_3		3
+#define	GPIOE_4		4
+
+#define	GPIOB_0		5
+#define	GPIOB_1		6
+#define	GPIOB_2		7
+#define	GPIOB_3		8
+#define	GPIOB_4		9
+#define	GPIOB_5		10
+#define	GPIOB_6		11
+#define	GPIOB_7		12
+#define	GPIOB_8		13
+#define	GPIOB_9		14
+#define	GPIOB_10	15
+#define	GPIOB_11	16
+#define	GPIOB_12	17
+#define	GPIOB_13	18
+#define	GPIOB_14	19
+
+#define	GPIOC_0		20
+#define	GPIOC_1		21
+#define	GPIOC_2		22
+#define	GPIOC_3		23
+#define	GPIOC_4		24
+#define	GPIOC_5		25
+#define	GPIOC_6		26
+
+#define	GPIOX_0		27
+#define	GPIOX_1		28
+#define	GPIOX_2		29
+#define	GPIOX_3		30
+#define	GPIOX_4		31
+#define	GPIOX_5		32
+#define	GPIOX_6		33
+#define	GPIOX_7		34
+#define	GPIOX_8		35
+#define	GPIOX_9		36
+#define	GPIOX_10	37
+#define	GPIOX_11	38
+#define	GPIOX_12	39
+#define	GPIOX_13	40
+
+#define	GPIOD_0		41
+#define	GPIOD_1		42
+#define	GPIOD_2		43
+#define	GPIOD_3		44
+#define	GPIOD_4		45
+#define	GPIOD_5		46
+#define	GPIOD_6		47
+
+#define	GPIOA_0		48
+#define	GPIOA_1		49
+#define	GPIOA_2		50
+#define	GPIOA_3		51
+#define	GPIOA_4		52
+#define	GPIOA_5		53
+
+#define	GPIO_TEST_N	54
+
+#endif /* _DT_BINDINGS_AMLOGIC_C3_GPIO_H */