Linux-Aspeed Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [v6 0/4] Support pwm/tach driver for aspeed ast26xx
@ 2023-06-08  2:18 Billy Tsai
  2023-06-08  2:18 ` [v6 1/4] dt-bindings: pwm: Add ASPEED PWM Control documentation Billy Tsai
                   ` (4 more replies)
  0 siblings, 5 replies; 41+ messages in thread
From: Billy Tsai @ 2023-06-08  2:18 UTC (permalink / raw)
  To: linux-aspeed

Unlike the old design that the register setting of the TACH should based
on the configure of the PWM. In ast26xx, the dependency between pwm and
tach controller is eliminated and becomes a separate hardware block. One
is used to provide pwm output and another is used to monitor the frequency
of the input. Therefore, this patch serials implements them by writing the
two driver "pwm-aspeed-ast2600.c" and "tach-aspeed-ast2600.c". The former
is following the pwm subsystem which can apply the existed driver to
controller the fan(pwm-fan.c), beeper(pwm-beeper.c) and so on. The latter
is following the sysfs interface of hwmon to creat the node for fan
monitor.

Changes since v5:
- pwm/tach:
  - Remove the utilization of common resources from the parent node.
  - Change the concept to 16 PWM/TACH controllers, each with one channel,
  instead of 1 PWM/TACH controller with 16 channels.
- dt-binding:
  - Eliminate the usage of simple-mfd.

Changes since v4:
- pwm:
  - Fix the return type of get_status function.
- tach:
  - read clk source once and re-use it
  - Remove the constants variables
  - Allocate tach_channel as array
  - Use dev->parent
- dt-binding:
  - Fix the order of the patches
  - Add example and description for tach child node
  - Remove pwm extension property

Changes since v3:
- pwm:
  - Remove unnecessary include header
  - Fix warning Prefer "GPL" over "GPL v2"
- tach:
  - Remove the paremeter min_rpm and max_rpm and return the tach value 
  directly without any polling or delay.
  - Fix warning Prefer "GPL" over "GPL v2"
- dt-binding:
  - Replace underscore in node names with dashes
  - Split per subsystem

Changes since v2:
- pwm:
  - Use devm_* api to simplify the error cleanup
  - Fix the multi-line alignment problem
- tach:
  - Add tach-aspeed-ast2600 to index.rst
  - Fix the multi-line alignment problem
  - Remove the tach enable/disable when read the rpm
  - Fix some coding format issue

Changes since v1:
- tach:
  - Add the document tach-aspeed-ast2600.rst
  - Use devm_* api to simplify the error cleanup.
  - Change hwmon register api to devm_hwmon_device_register_with_info

Billy Tsai (4):
  dt-bindings: pwm: Add ASPEED PWM Control documentation
  dt-bindings: hwmon: Add ASPEED TACH Control documentation
  pwm: Add Aspeed ast2600 PWM support
  hwmon: Add Aspeed ast2600 TACH support

 .../bindings/hwmon/aspeed,ast2600-tach.yaml   |  32 ++
 .../bindings/pwm/aspeed,ast2600-pwm.yaml      |  38 +++
 Documentation/hwmon/index.rst                 |   1 +
 Documentation/hwmon/tach-aspeed-ast2600.rst   |  25 ++
 drivers/hwmon/Kconfig                         |  10 +
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/tach-aspeed-ast2600.c           | 305 +++++++++++++++++
 drivers/pwm/Kconfig                           |  10 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-aspeed-ast2600.c              | 309 ++++++++++++++++++
 10 files changed, 732 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/aspeed,ast2600-tach.yaml
 create mode 100644 Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml
 create mode 100644 Documentation/hwmon/tach-aspeed-ast2600.rst
 create mode 100644 drivers/hwmon/tach-aspeed-ast2600.c
 create mode 100644 drivers/pwm/pwm-aspeed-ast2600.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 41+ messages in thread
* [v6 2/4] dt-bindings: hwmon: Add ASPEED TACH Control documentation
@ 2023-07-14  7:04 蔡承達
  2023-07-14  7:13 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 41+ messages in thread
From: 蔡承達 @ 2023-07-14  7:04 UTC (permalink / raw)
  To: linux-aspeed

        On 6/7/23 23:21, Billy Tsai wrote:

        > > >          > The code says:

        > > >

        > > >          > In Aspeed AST2600 SoC features 16 TACH
controllers, with each

        > > >

        > > >          > controller capable of supporting up to 1 input.

        > > >

        > > >          > which is a bit different. I guess there are no
examples anymore,

        > > >

        > > >          > but I'd really like to see how this looks like in
the devicetree file,

        > > >

        > > >          > and how the driver is supposed to
distinguish/select the 16 inputs.

        > > >

        > > > Hi Roeck,

        > > >

        > > > The node in the devicetree file will looks like following:

        > > >

        > > > tach0: tach0 at 1e610008 {

        > > >

        > > >          compatible = "aspeed,ast2600-tach";

        > > >

        > > >          reg = <0x1e610008 0x8>;

        > > >

        > > >          #address-cells = <1>;

        > > >

        > > >          #size-cells = <0>;

        > > >

        > > >          pinctrl-names = "default";

        > > >

        > > >          pinctrl-0 = <&pinctrl_tach0_default>;

        > > >

        > > >          clocks = <&syscon ASPEED_CLK_AHB>;

        > > >

        > > >          resets = <&syscon ASPEED_RESET_PWM>;

        > > >

        > > >          status = "disabled";

        > > >

        > > > };

        > > >



        > > Neither reg nor pinctrl is mentioned in the bindings. Maybe
that is not needed nowadays,

        > > but I find it confusing.



        > > Either case, it is highly unusual that there would be 16
instances of this device

        > > instead of one. Why is this done ? It doesn't really make sense
to me.



        > Having 16 instances of PWM and Tach is more compatible with our
hardware design.

        > This is because our register layout for PWM and Tach is not
continuous.

        > PWM0 used 0x0 0x4, Tach0 used 0x8 0xc

        > PWM1 used 0x10 0x14, Tach1 used 0x18 0x1c

        > ...

        > Each PWM/Tach instance has its own controller register and is not
dependent on others.



Hi Guenter,



Did you receive a response to my previous email?

I would like to inquire if you have any further concerns regarding the PWM
and Tach with 16 instances.



Thanks



Best Regards,

Billy Tsai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20230714/a77627bb/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2023-08-15  6:32 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-08  2:18 [v6 0/4] Support pwm/tach driver for aspeed ast26xx Billy Tsai
2023-06-08  2:18 ` [v6 1/4] dt-bindings: pwm: Add ASPEED PWM Control documentation Billy Tsai
2023-06-08  6:39   ` Krzysztof Kozlowski
2023-06-08  6:46   ` Krzysztof Kozlowski
2023-06-08  7:47     ` Billy Tsai
2023-06-08  7:54       ` Krzysztof Kozlowski
2023-06-08  8:21         ` Billy Tsai
2023-06-08  8:36           ` Krzysztof Kozlowski
2023-06-08  8:57             ` Billy Tsai
2023-06-08  9:26               ` Krzysztof Kozlowski
2023-06-08  8:39           ` Krzysztof Kozlowski
2023-06-08  9:15             ` Billy Tsai
2023-06-08  9:27               ` Krzysztof Kozlowski
2023-06-08  2:18 ` [v6 2/4] dt-bindings: hwmon: Add ASPEED TACH " 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
2023-06-08  2:18 ` [v6 3/4] pwm: Add Aspeed ast2600 PWM support Billy Tsai
2023-07-18  7:08   ` Thierry Reding
2023-06-08  2:18 ` [v6 4/4] hwmon: Add Aspeed ast2600 TACH support Billy Tsai
2023-06-08  5:01   ` Guenter Roeck
2023-06-08  6:37 ` [v6 0/4] Support pwm/tach driver for aspeed ast26xx Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox