2024-01-04 17:45:49

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID

From: Frank Wunderlich <[email protected]>

---
include/dt-bindings/reset/mediatek,mt7988-resets.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h
index 493301971367..3f1e4ec07ad5 100644
--- a/include/dt-bindings/reset/mediatek,mt7988-resets.h
+++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h
@@ -10,4 +10,8 @@
/* ETHWARP resets */
#define MT7988_ETHWARP_RST_SWITCH 0

+/* INFRA resets */
+#define MT7988_INFRA_RST0_THERM_CTRL_SWRST 9
+
#endif /* _DT_BINDINGS_RESET_CONTROLLER_MT7988 */
+
--
2.34.1



2024-01-04 18:15:20

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID

Hi Frank,

On Thu, Jan 04, 2024 at 06:39:29PM +0100, Frank Wunderlich wrote:
> From: Frank Wunderlich <[email protected]>
>
> ---
> include/dt-bindings/reset/mediatek,mt7988-resets.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h
> index 493301971367..3f1e4ec07ad5 100644
> --- a/include/dt-bindings/reset/mediatek,mt7988-resets.h
> +++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h
> @@ -10,4 +10,8 @@
> /* ETHWARP resets */
> #define MT7988_ETHWARP_RST_SWITCH 0
>
> +/* INFRA resets */
> +#define MT7988_INFRA_RST0_THERM_CTRL_SWRST 9

I suppose this argument applies here as well:

"IDs should start from 0 or 1 and increment by 1. If these are not IDs,
then you do not need them in the bindings."

https://lore.kernel.org/all/[email protected]/

As a consequence, as what you are describing there are hardware bits
rather than IDs used by the driver, you can just use a numeric constant
in device tree instead of adding dt-bindings header.
Or change the driver so RST0_THERM_CTRL_SWRST could be defined as 0.


2024-01-04 19:19:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID

On 04/01/2024 19:12, Daniel Golle wrote:
> Hi Frank,
>
> On Thu, Jan 04, 2024 at 06:39:29PM +0100, Frank Wunderlich wrote:
>> From: Frank Wunderlich <[email protected]>
>>
>> ---
>> include/dt-bindings/reset/mediatek,mt7988-resets.h | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h
>> index 493301971367..3f1e4ec07ad5 100644
>> --- a/include/dt-bindings/reset/mediatek,mt7988-resets.h
>> +++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h
>> @@ -10,4 +10,8 @@
>> /* ETHWARP resets */
>> #define MT7988_ETHWARP_RST_SWITCH 0
>>
>> +/* INFRA resets */
>> +#define MT7988_INFRA_RST0_THERM_CTRL_SWRST 9
>
> I suppose this argument applies here as well:
>
> "IDs should start from 0 or 1 and increment by 1. If these are not IDs,
> then you do not need them in the bindings."
>
> https://lore.kernel.org/all/[email protected]/
>
> As a consequence, as what you are describing there are hardware bits

If this is existing driver which already uses such pattern, then it is
fine. I usually comment this on new drivers which can be changed.

Best regards,
Krzysztof


2024-01-04 20:55:15

by Frank Wunderlich

[permalink] [raw]
Subject: Aw: Re: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID

Hi

> Gesendet: Donnerstag, 04. Januar 2024 um 20:19 Uhr
> Von: "Krzysztof Kozlowski" <[email protected]>
> Betreff: Re: [PATCH 1/2] dt-bindings: reset: mediatek: add MT7988 LVTS reset ID
>
> On 04/01/2024 19:12, Daniel Golle wrote:
> > Hi Frank,
> >
> > On Thu, Jan 04, 2024 at 06:39:29PM +0100, Frank Wunderlich wrote:
> >> From: Frank Wunderlich <[email protected]>
> >>
> >> ---
> >> include/dt-bindings/reset/mediatek,mt7988-resets.h | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h
> >> index 493301971367..3f1e4ec07ad5 100644
> >> --- a/include/dt-bindings/reset/mediatek,mt7988-resets.h
> >> +++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h
> >> @@ -10,4 +10,8 @@
> >> /* ETHWARP resets */
> >> #define MT7988_ETHWARP_RST_SWITCH 0
> >>
> >> +/* INFRA resets */
> >> +#define MT7988_INFRA_RST0_THERM_CTRL_SWRST 9
> >
> > I suppose this argument applies here as well:
> >
> > "IDs should start from 0 or 1 and increment by 1. If these are not IDs,
> > then you do not need them in the bindings."
> >
> > https://lore.kernel.org/all/[email protected]/
> >
> > As a consequence, as what you are describing there are hardware bits
>
> If this is existing driver which already uses such pattern, then it is
> fine. I usually comment this on new drivers which can be changed.

this is a new driver so i guess i should change this like daniel suggests.
As i want to use this constant in dts and driver i would like keep it as binding in the reset header,
but because i use it only as index in the infra_idx_map array its value does not need to have the value
needed in hardware. i kept it same to not have different values and for ordering purposes (when the other
possible resets are added).

so the way starting at 0 will be the preferred one for me, is this ok?

regards Frank