mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Junyi Zhao <junyi.zhao@amlogic.com>
To: "Jerome Brunet" <jbrunet@baylibre.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org, linux-pwm@vger.kernel.org,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v4 1/6] dt-bindings: pwm: amlogic: fix s4 bindings
Date: Tue, 23 Jan 2024 16:28:34 +0800	[thread overview]
Message-ID: <66299b86-311a-43ff-a06e-9698dec5e804@amlogic.com> (raw)
In-Reply-To: <1jbk9kxm52.fsf@starbuckisacylon.baylibre.com>



On 2024/1/17 18:30, Jerome Brunet wrote:
> [ EXTERNAL EMAIL ]
> 
> On Wed 17 Jan 2024 at 11:03, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> 
>> [[PGP Signed Part:Undecided]]
>> On Fri, Dec 22, 2023 at 12:16:49PM +0100, Jerome Brunet wrote:
>>> s4 has been added to the compatible list while converting the Amlogic PWM
>>> binding documentation from txt to yaml.
>>>
>>> However, on the s4, the clock bindings have different meaning compared to
>>> the previous SoCs.
>>>
>>> On the previous SoCs the clock bindings used to describe which input the
>>> PWM channel multiplexer should pick among its possible parents.
>>>
>>> This is very much tied to the driver implementation, instead of describing
>>> the HW for what it is. When support for the Amlogic PWM was first added,
>>> how to deal with clocks through DT was not as clear as it nowadays.
>>> The Linux driver now ignores this DT setting, but still relies on the
>>> hard-coded list of clock sources.
>>>
>>> On the s4, the input multiplexer is gone. The clock bindings actually
>>> describe the clock as it exists, not a setting. The property has a
>>> different meaning, even if it is still 2 clocks and it would pass the check
>>> when support is actually added.
>>>
>>> Also the s4 cannot work if the clocks are not provided, so the property no
>>> longer optional.
>>
>> s/no/is no/
>>
>>> Finally, for once it makes sense to see the input as being numbered
>>> somehow. No need to bother with clock-names on the s4 type of PWM.
>>>
>>> Fixes: 43a1c4ff3977 ("dt-bindings: pwm: Convert Amlogic Meson PWM binding")
>>> Reviewed-by: Rob Herring <robh@kernel.org>
>>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>>> ---
>>>   .../devicetree/bindings/pwm/pwm-amlogic.yaml  | 67 ++++++++++++++++---
>>>   1 file changed, 58 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>>> index 527864a4d855..a1d382aacb82 100644
>>> --- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>>> +++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>>> @@ -9,9 +9,6 @@ title: Amlogic PWM
>>>   maintainers:
>>>     - Heiner Kallweit <hkallweit1@gmail.com>
>>>
>>> -allOf:
>>> -  - $ref: pwm.yaml#
>>> -
>>>   properties:
>>>     compatible:
>>>       oneOf:
>>> @@ -43,12 +40,8 @@ properties:
>>>       maxItems: 2
>>>
>>>     clock-names:
>>> -    oneOf:
>>> -      - items:
>>> -          - enum: [clkin0, clkin1]
>>> -      - items:
>>> -          - const: clkin0
>>> -          - const: clkin1
>>> +    minItems: 1
>>> +    maxItems: 2
>>>
>>>     "#pwm-cells":
>>>       const: 3
>>> @@ -57,6 +50,55 @@ required:
>>>     - compatible
>>>     - reg
>>>
>>> +allOf:
>>> +  - $ref: pwm.yaml#
>>> +
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - amlogic,meson8-pwm
>>> +              - amlogic,meson8b-pwm
>>> +              - amlogic,meson-gxbb-pwm
>>> +              - amlogic,meson-gxbb-ao-pwm
>>> +              - amlogic,meson-axg-ee-pwm
>>> +              - amlogic,meson-axg-ao-pwm
>>> +              - amlogic,meson-g12a-ee-pwm
>>> +              - amlogic,meson-g12a-ao-pwm-ab
>>> +              - amlogic,meson-g12a-ao-pwm-cd
>>> +    then:
>>> +      # Historic bindings tied to the driver implementation
>>> +      # The clocks provided here are meant to be matched with the input
>>> +      # known (hard-coded) in the driver and used to select pwm clock
>>> +      # source. Currently, the linux driver ignores this.
>>
>> I admit I didn't understand the relevant difference between the old and
>> the new binding yet.
> 
> Let's try to explain differently then:
> * So far each AML PWM IP has 2 pwm.
> * Up to G12, 4 input PLL/clocks are wired to the HW IP and there
>    mux/div/gate to select which input to take.
>    - The historic bindings just described how to setup each of the 2
>      internal muxes - 2 optionnal clocks.
>      The actual 4 inputs names from CCF are hard coded in
>      the driver. This is a pretty bad description. The driver has been
>      updated since then to use CCF to figure out the best parent
>      according to pwm rate so this setting is ignored now.
>    - The 'new' bindings (introduced in patch #2) fixes the problem above
>      but the meaning of the clock binding is different. It describes the
>      actual HW parents - 4 clocks, optionnal since some are not wired on
>      some PWM blocks. To avoid breaking the ABI, a new compatible for
>      these SoC is introduced.
> 
>> (The driver currently doesn't support the s4, right?)
> 
> Indeed. I know Amlogic is preparing the support. I could do it in this
> series but I prefer to encourage them to contribute. It should come
> shortly after this series is merged.
Yes. Amlogic is waiting these patches of Jerome. after these merge, we 
will start to rebase and submit s4 code.
-
Best Regards Junyi

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2024-01-23  8:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 11:16 [PATCH v4 0/6] pwm: meson: dt-bindings fixup Jerome Brunet
2023-12-22 11:16 ` [PATCH v4 1/6] dt-bindings: pwm: amlogic: fix s4 bindings Jerome Brunet
2024-01-17 10:03   ` Uwe Kleine-König
2024-01-17 10:30     ` Jerome Brunet
2024-01-23  8:28       ` Junyi Zhao [this message]
2023-12-22 11:16 ` [PATCH v4 2/6] dt-bindings: pwm: amlogic: add new compatible for meson8 pwm type Jerome Brunet
2023-12-23 14:02   ` Krzysztof Kozlowski
2024-01-17  9:58   ` Uwe Kleine-König
2024-01-17 10:16     ` Jerome Brunet
2024-01-17 10:51       ` Uwe Kleine-König
2024-01-17 17:29     ` Krzysztof Kozlowski
2023-12-22 11:16 ` [PATCH v4 3/6] pwm: meson: generalize 4 inputs clock on " Jerome Brunet
2024-01-24  9:08   ` Uwe Kleine-König
2024-01-24  9:11     ` Jerome Brunet
2024-01-24  9:42       ` Uwe Kleine-König
2023-12-22 11:16 ` [PATCH v4 4/6] pwm: meson: use device data to carry information around Jerome Brunet
2024-02-05 17:12   ` Uwe Kleine-König
2024-02-20 17:10     ` Jerome Brunet
2023-12-22 11:16 ` [PATCH v4 5/6] pwm: meson: don't carry internal clock elements around Jerome Brunet
2024-01-24  9:02   ` Uwe Kleine-König
2024-01-24  9:16     ` Jerome Brunet
2024-01-24  9:48       ` Uwe Kleine-König
2024-01-24  9:59         ` Jerome Brunet
2024-01-25  6:53           ` Junyi Zhao
2023-12-22 11:16 ` [PATCH v4 6/6] pwm: meson: add generic compatible for meson8 to sm1 Jerome Brunet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66299b86-311a-43ff-a06e-9698dec5e804@amlogic.com \
    --to=junyi.zhao@amlogic.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®