Linux-Aspeed Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: linux-aspeed@lists.ozlabs.org
Subject: [v6 2/4] dt-bindings: hwmon: Add ASPEED TACH Control documentation
Date: Tue, 18 Jul 2023 08:04:24 +0200	[thread overview]
Message-ID: <3756dffd-1407-d656-485a-9cf1eefd9ae1@linaro.org> (raw)
In-Reply-To: <CAGUgbhDmXnyxYCL9h9C0P4ByDSTstWnGqW=uFoDVVHeK3BerHA@mail.gmail.com>

On 18/07/2023 06:01, ??? wrote:
>>
>> On 17/07/2023 11:01, ??? wrote:
>>> Guenter Roeck <linux@roeck-us.net> ? 2023?7?17? ?? ??1:00???
>>>>
>>>> On 7/16/23 09:08, Krzysztof Kozlowski wrote:
>>>>
>>>> [ ... ]
>>>>
>>>>>>
>>>>>> This patch serial doesn't use to binding the fan control h/w. It is
>>>>>> used to binding the two independent h/w blocks.
>>>>>> One is used to provide pwm output and another is used to monitor the
>>>>>> speed of the input.
>>>>>> My patch is used to point out that the pwm and the tach is the
>>>>>> different function and don't need to
>>>>>> bind together. You can not only combine them as the fan usage but also
>>>>>> treat them as the individual module for
>>>>>> use. For example: the pwm can use to be the beeper (pwm-beeper.c), the
>>>>>> tach can be used to monitor the heart beat signal.
>>>>>
>>>>> Isn't this exactly the same as in every other SoC? PWMs can be used in
>>>>> different ways?
>>>>>
>>>>
>>>> ... and in every fan controller. Not that it really makes sense because
>>>> normally the pwm controller part of such chips is tied to the fan input,
>>>> to enable automatic fan control, but it is technically possible.
>>>> In many cases this is also the case in SoCs, for example, in ast2500.
>>>> Apparently this was redesigned in ast2600 where they two blocks are
>>>> only lightly coupled (there are two pwm status bits in the fan status
>>>> register, but I have no idea what those mean). If the blocks are tightly
>>>> coupled, separate drivers don't really make sense.
>>>>
>>>> There are multiple ways to separate the pwm controller part from the
>>>> fan inputs if that is really necessary. One would be to provide a
>>>> sequence of address mappings, the other would be to pass the memory
>>>> region from an mfd driver. It is not necessary to have N instances
>>>> of the fan controller, even if the address space is not continuous.
>>>>
>>>
>>> Hi Guenter,
>>>
>>> May I ask about the meaning of the sequence of address mappings? It appears
>>> to consist of multiple tuples within the 'reg' property, indicating
>>> the usage of PWM/Tach
>>> registers within a single instance. After that I can use the dts like following:
>>>
>>> pwm: pwm at 1e610000 {
>>> ...
>>> reg = <0x1e610000 0x8
>>> 0x1e610010 0x8
>>> 0x1e610020 0x8
>>> 0x1e610030 0x8
>>> 0x1e610040 0x8
>>> 0x1e610050 0x8
>>> 0x1e610060 0x8
>>> 0x1e610070 0x8
>>> 0x1e610080 0x8
>>> 0x1e610090 0x8
>>> 0x1e6100A0 0x8
>>> 0x1e6100B0 0x8
>>> 0x1e6100C0 0x8
>>> 0x1e6100D0 0x8
>>> 0x1e6100E0 0x8
>>> 0x1e6100F0 0x8>;
>>
>>
>> Uh, no... I mean, why? We keep pointing out that this should not be done
>> differently than any other SoC. Open any other SoC PWM controller and
>> tell me why this is different? Why this cannot be one address space?
> 
> Hi Krzysztof,
> 
> This is because the register layout for PWM and Tach is not continuous.
> Each PWM/Tach instance has its own set of controller registers, and they
> are independent of each other.

Register layout is not continuous in many other devices, so again - why
this must be different?

> 
> For example:
> PWM0 uses registers 0x0 and 0x4, while Tach0 uses registers 0x8 and 0xc.
> PWM1 uses registers 0x10 and 0x14, while Tach1 uses registers 0x18 and 0x1c.
> ...
> 
> To separate the PWM controller part from the fan inputs, Guenter has
> provided two methods.
> The first method involves passing the memory region from an MFD
> driver, which was the

I have no clue how can you pass memory region
(Documentation/devicetree/bindings/reserved-memory/) from MFD and why
does it make sense here.

> initial method I intended to use. However, it seems that this method
> does not make sense to you.
> 
> Therefore, I would like to explore the second method suggested by
> Guenter, which involves providing
> a sequence of address mappings.

Best regards,
Krzysztof


  reply	other threads:[~2023-07-18  6:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  7:04 [v6 2/4] dt-bindings: hwmon: Add ASPEED TACH Control documentation 蔡承達
2023-07-14  7:13 ` Krzysztof Kozlowski
2023-07-14  9:59   ` Guenter Roeck
2023-07-14 10:18     ` 蔡承達
2023-07-14 10:26       ` Guenter Roeck
2023-07-14 11:17         ` 蔡承達
2023-07-16 16:08           ` Krzysztof Kozlowski
2023-07-16 17:00             ` Guenter Roeck
2023-07-17  9:01               ` 蔡承達
2023-07-17  9:39                 ` Krzysztof Kozlowski
2023-07-18  4:01                   ` 蔡承達
2023-07-18  6:04                     ` Krzysztof Kozlowski [this message]
2023-07-18  6:39                       ` Thierry Reding
2023-07-18  6:54                         ` Guenter Roeck
2023-07-18  7:14                           ` Thierry Reding
2023-08-15  6:32                             ` 蔡承達
2023-07-18  6:45                       ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2023-06-08  2:18 [v6 0/4] Support pwm/tach driver for aspeed ast26xx Billy Tsai
2023-06-08  2:18 ` [v6 2/4] dt-bindings: hwmon: Add ASPEED TACH Control documentation Billy Tsai
2023-06-08  4:58   ` Guenter Roeck
2023-06-08  6:21     ` Billy Tsai
2023-06-08 13:18       ` Guenter Roeck
2023-06-28  5:30         ` Billy Tsai
2023-06-08  6:40   ` Krzysztof Kozlowski

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=3756dffd-1407-d656-485a-9cf1eefd9ae1@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    /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