mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9 0/7] Add Renesas RZ/G3E GPT support
@ 2026-10-29 18:58 Biju Das
  2026-10-29 18:58 ` [PATCH v9 1/7] pwm: rzg2l-gpt: Update macro used for period/duty cycle conversion Biju Das
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Biju Das @ 2026-10-29 18:58 UTC (permalink / raw)
  To: Uwe Kleine-König, Geert Uytterhoeven, Magnus Damm,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-pwm, linux-kernel, linux-renesas-soc, devicetree, Biju Das,
	Tommaso Merciai

This series extends the RZ/G2L GPT PWM driver with RZ/G3E SoC support.

The RZ/G3E GPT has a number of hardware differences compared to RZ/G2L:
it exposes 16 channels (across two GPT instances of 8 channels each),
uses a 4-bit GTCR prescaler field (versus 3-bit on RZ/G2L), and has a
discontinuous prescale sequence with powers-of-2 scaling rather than the
continuous powers-of-4 sequence on RZ/G2L. It also has additional clocks
and resets (bus clock and rst_s).

POEG support is dropped from this series and will be added later.

v8->v9:
 * Updated commit header for patch#1
 * Dropped fixes tag from patch#1 as there is no functional change.
 * The prescale always initialised (reuse cache only if the sibling is
   running)
 * The round_waveform_tohw() no longer writes the prescale cache.
 * Disabling an idle channel no longer touches the shared registers/
   counter in rzg2l_gpt_write_waveform()
 * The shared registers are only written (and the counter only stopped/
   restarted) when no sibling is running -> no glitch on a running
   sibling in rzg2l_gpt_write_waveform().
 * The rzg2l_gpt_write_waveform() re-validates, under the lock, that the
   sibling still uses the same prescale/period (returns -EBUSY otherwise)
 * Redundant "enable &&" removed in rzg2l_gpt_write_waveform().
 * The rzg2l_gpt_is_ch_enabled() fills *gtcr before the early return.
 * Updated commit description in bindings channel->channels and
   '8channels' to '8 channels'
 * Retain the tag as the change is trivial.
 * Updated a comment in limitation section '8 Channels'->'8 channels'.
- Link v8: https://lore.kernel.org/all/20260825154847.197947-1-biju.das.jz@bp.renesas.com/
v7->v8:
 * Cached prescale value.
 * Updated rzg2l_gpt_write_waveform() for caching the period, If the
   channel is already enabled and the user changes its period.
 * Updated rzg3e_gpt_calculate_prescale() with >= 64.
v6->v7:
 * Reordered the patched moving POEG support to last.
 * Replaced USEC_PER_SEC->NSEC_PER_MSEC for period/duty cycle
   conversion.
 * Avoided recalculation of prescale, if is_small_second_period == true.
 * Moved `wfhw->gtccr = 0` into the if block in rzg2l_gpt_config().
 * Added rzg2l_gpt_poeg_link_channels() and used __free for deallocating
   device node pointer.
 * Replaced dev_err()->dev_err_probe() in rzg2l_gpt_poeg_link_channels().
 * Replaced local variable cells with num_poeg_pairs in
   rzg2l_gpt_poeg_init().
v5->v6:
 * Added patch for fixing period_ticks overflow.
 * Added patch to add missing newlines to dev_err_probe() messages.
 * Dropped extra space in poegs variable assignment in
   rzg2l_gpt_poeg_init().
 * Updated the comment sections of rzg2l_gpt_poeg_init() with POEG and GPT
   in upper-case and replaced configure->configures.
 * Format specifiers in dev_err() changed from %d to %u in
   rzg2l_gpt_poeg_init().
 * Dropped local variables pv and dc from rzg2l_gpt_round_waveform_tohw().
 * Dropped blank line in rzg2l_gpt_round_waveform_tohw().
 * Moved assignment of rzg2l_gpt->period_ticks[ch] to *_write_waveform().
 * Restored clamping of duty_ticks with period_ticks in
   rzg2l_gpt_round_waveform_tohw().
 * Simplified rzg2l_gpt_write_waveform() using else if statement.
 * Dropped local variable gptr in rzg2l_gpt_write_waveform().
 * Moved mutex after early return in rzg2l_gpt_round_waveform_tohw().
 * Dropped extra parameter rzg2l_gpt from rzg2l_gpt_calculate_prescale()
   in rzg2l_gpt_round_waveform_tohw().
 * Updated comment in rzg2l_gpt_calculate_period_or_duty().
 * Updated rzg3e_gpt_calculate_prescale().
v4->v5:
 * Merged GPT linking POEG patch series here.
 * Dropped suspend/resume patch; will be added later.
 * Updated commit description for patches #2, #4, #5, and #6.
 * Replaced return type of rzg2l_gpt_poeg_init() from void to int and
   probe() check this return value.
 * Added more error checks in rzg2l_gpt_poeg_init().
 * Added a patch to drop the unused rzg2l_gpt_chip parameter from
   rzg2l_gpt_calculate_prescale().
 * Updated rzg2l_gpt_round_waveform_tohw() to initialize gtccr when the
   period of the second channel is smaller.
 * Replaced period_ticks with RZG2L_MAX_TICKS for the duty_ticks maximum
   value check in rzg2l_gpt_round_waveform_tohw().
v3->v4:
 * Added wave form callback conversion back to this patch series.
 * Updated rzg2l_gpt_is_ch_enabled() fit into 80-character limit for
   consistency with other functions.
 * Dropped field_{get,prep} as mainline now support it.
 * Updated commit description for patch#3
 * Retained RZG2L_GTCR_TPCS bit definitons
 * Replaced gtcr_tpcs_mask->gtcr_tpcs
 * Updated commit header and description for patch#4
 * Renamed prescale_pow_of_two_mult_factor->prescale_mult
 * Added RZG3E_GTCR_TPCS bit definition for RZ/G3E and added to
   rzg3e_data.
 * Added error checks on suspend() and device set to operational state
   on failure().
 * Added Rb tag from Geert for SoC dtsi.
 * Added SW_GPIO9_CAN1_STB check to gpt0 node.
v2->v3:
 * Added Rb tag from Rob for bindings patch
 * Dropped wave form callback conversion from this patch series as
   it is covered in another series[1]
 * Added suspend/resume support.
v1->v2:
 * Created separate document for RZ/G3E GPT.
 * Updated commit header and description for binding patch.
 * Added waveform callback conversion to this series.
 * Collected tag.
 * Added link to hardware manual
 * Updated limitation section in driver patch.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Biju Das (7):
      pwm: rzg2l-gpt: Update macro used for period/duty cycle conversion
      pwm: rzg2l-gpt: Convert to waveform callbacks
      pwm: rzg2l-gpt: Add info variable to struct rzg2l_gpt_chip
      pwm: rzg2l-gpt: Add prescale_mult variable to struct rzg2l_gpt_info
      pwm: rzg2l-gpt: Add calculate_prescale() callback to struct rzg2l_gpt_info
      dt-bindings: pwm: Document RZ/G3E GPT support
      pwm: rzg2l-gpt: Add RZ/G3E support

 .../devicetree/bindings/pwm/renesas,rzg3e-gpt.yaml | 323 +++++++++++++++++++
 drivers/pwm/pwm-rzg2l-gpt.c                        | 354 ++++++++++++++-------
 2 files changed, 565 insertions(+), 112 deletions(-)
---
base-commit: 4e7443d29aa19bc779a2a485622cf92f1c7145e5
change-id: 20261029-gpt_rzg3e-6a896e1dcb7f

Best regards,
-- 
Biju Das <biju.das.jz@bp.renesas.com>


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

end of thread, other threads:[~2026-12-01 17:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 18:58 [PATCH v9 0/7] Add Renesas RZ/G3E GPT support Biju Das
2026-10-29 18:58 ` [PATCH v9 1/7] pwm: rzg2l-gpt: Update macro used for period/duty cycle conversion Biju Das
2026-10-29 18:58 ` [PATCH v9 2/7] pwm: rzg2l-gpt: Convert to waveform callbacks Biju Das
2026-10-29 18:58 ` [PATCH v9 3/7] pwm: rzg2l-gpt: Add info variable to struct rzg2l_gpt_chip Biju Das
2026-10-29 18:58 ` [PATCH v9 4/7] pwm: rzg2l-gpt: Add prescale_mult variable to struct rzg2l_gpt_info Biju Das
2026-10-29 18:58 ` [PATCH v9 5/7] pwm: rzg2l-gpt: Add calculate_prescale() callback " Biju Das
2026-10-29 18:58 ` [PATCH v9 6/7] dt-bindings: pwm: Document RZ/G3E GPT support Biju Das
2026-10-29 18:58 ` [PATCH v9 7/7] pwm: rzg2l-gpt: Add RZ/G3E support Biju Das
2026-11-11 12:43 ` [PATCH v9 0/7] Add Renesas RZ/G3E GPT support Biju Das
2026-12-01 17:30   ` Biju Das

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®