pwm: meson: make full use of common clock framework
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest6 patches 1 replyApplied
- v44 patches 22 repliesSuperseded
- v34 patches 8 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 7 replies | Superseded | |
| v1 | 2 patches | 4 replies | Superseded |
Changes in v5 from the cover letter
- add pending standalone patches 1-3 to the series
- remove ex-patch 3
- ex-patch 4 (now patch 6):
- add clk_en_shift
- use div_u64 when dividing by NSEC_PER_SEC
- use div64_ul in meson_pwm_cnt_to_ns
- remove check for __clk_is_enabled(channel->clk) from meson_pwm_get_state() because this is always true once the PWM is requested
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | pwm: meson: modify and simplify calculation in meson_pwm_get_statedrivers/ | +2 | 0 replies | |
| 2/6 | pwm: meson: fix handling of period/duty if greater than UINT_MAXdrivers/ | +7 | 0 replies | |
| 3/6 | pwm: meson: remove not needed check in meson_pwm_calcdrivers/ | +0 | 0 replies | |
| 4/6 | pwm: meson: switch to using struct clk_parent_data for mux parentsdrivers/ | +9 | 0 replies | |
| 5/6 | pwm: meson: don't use hdmi/video clock as mux parentdrivers/ | +3 | 0 replies | |
| 6/6 | pwm: meson: make full use of common clock frameworkdrivers/ | +90 | 0 replies |
Reviews trailers per patch
4 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Uwe Kleine-König | Dmitry Rokosov | Martin Blumenstingl |
|---|---|---|---|
| 1/6 | R-b | R-b | A-b |
| 2/6 | R-b | ||
| 3/6 | |||
| 4/6 | R-b T-b | ||
| 5/6 | R-b | ||
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v5 0/6] pwm: meson: make full use of common clock framework
Newer versions of the PWM block use a core clock with external mux, divider, and gate. These components either don't exist any longer in the PWM block, or they are bypassed.
To minimize needed changes for supporting the new version, the internal divider and gate should be handled by CCF too.
I didn't see a good way to split the patch, therefore it's somewhat bigger. What it does:
- The internal mux is handled by CCF already. Register also internal divider and gate with CCF, so that we have one representation of the input clock: [mux] parent of [divider] parent of [gate]
- Now that CCF selects an appropriate mux parent, we don't need the DT-provided default parent any longer. Accordingly we can also omit setting the mux parent directly in the driver.
- Instead of manually handling the pre-div divider value, let CCF set the input clock. Targeted input clock frequency is 0xffff * 1/period for best precision.
- For the "inverted pwm disabled" scenario target an input clock frequency of ULONG_MAX. This ensures that the remaining low pulses have minimum length.
I don't have hw with the old PWM block, therefore I couldn't test this patch. With the not yet included extension for the new PWM block (channel->clock directly coming from get_clk(external_clk)) I didn't notice any problem. My system uses PWM for the CPU voltage regulator and for the SDIO 32kHz clock.
Note: The clock gate in the old PWM block is permanently disabled. This seems to indicate that it's not used by the new PWM block.
Changes to RFT/RFC version:
- use parent_hws instead of parent_names for div/gate clock
- use devm_clk_hw_register where the struct clk * returned by devm_clk_register isn't needed
v2:
- add patch 1
- add patch 3
- switch to using clk_parent_data in all relevant places
v3:
- patch 1: move setting mux parent data out of the loop
- patch 4: add flag CLK_IGNORE_UNUSED
v4:
- patch 2: improve commit message
- patch 4: remove variable tmp in meson_pwm_get_state
- patch 4: don't use deprecated function devm_clk_register
v5:
- add pending standalone patches 1-3 to the series
- remove ex-patch 3
- ex-patch 4 (now patch 6):
- add clk_en_shift
- use div_u64 when dividing by NSEC_PER_SEC
- use div64_ul in meson_pwm_cnt_to_ns
- remove check for __clk_is_enabled(channel->clk) from meson_pwm_get_state() because this is always true once the PWM is requested
Heiner Kallweit (6):
pwm: meson: modify and simplify calculation in meson_pwm_get_state
pwm: meson: fix handling of period/duty if greater than UINT_MAX
pwm: meson: remove not needed check in meson_pwm_calc
pwm: meson: switch to using struct clk_parent_data for mux parents
pwm: meson: don't use hdmi/video clock as mux parent
pwm: meson: make full use of common clock framework
drivers/pwm/pwm-meson.c | 212 ++++++++++++++++++++-------------------- 1 file changed, 104 insertions(+), 108 deletions(-)
Signature · 1 line
2.40.1