[PATCH v4 2/5] clk: rockchip: Support MMC clocks in GRF region

Yao Zi ziyao at disroot.org
Mon May 5 19:21:48 PDT 2025


On Mon, May 05, 2025 at 11:39:05PM +0200, Heiko Stübner wrote:
> Hi,
> 
> Am Donnerstag, 17. April 2025, 16:36:44 Mitteleuropäische Sommerzeit schrieb Yao Zi:
> > Registers of MMC drive/sample clocks in Rockchip RV1106 and RK3528
> > locate in GRF regions. Adjust MMC clock code to support register
> > operations through regmap. Also add a helper to ease registration of GRF
> > clocks.
> > 
> > Signed-off-by: Yao Zi <ziyao at disroot.org>
> 
> > diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
> > index cbf93ea119a9..ce2f3323d84e 100644
> > --- a/drivers/clk/rockchip/clk.c
> > +++ b/drivers/clk/rockchip/clk.c
> > @@ -590,6 +590,7 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
> >  				list->name,
> >  				list->parent_names, list->num_parents,
> >  				ctx->reg_base + list->muxdiv_offset,
> > +				NULL, 0,
> >  				list->div_shift
> >  			);
> >  			break;
> > @@ -619,6 +620,11 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
> >  			break;
> >  		case branch_linked_gate:
> >  			/* must be registered late, fall-through for error message */
> > +		case branch_mmc_grf:
> > +			/*
> > +			 * must be registered through rockchip_clk_register_grf_branches,
> > +			 * fall-through for error message
> > +			 */
> >  			break;
> 
> please don't create separate structures for specific clock-types.
> Being able to "just define" clock branches is helpful and starting
> to require separate blocks just causes issues down the road.
> 
> For handling multiple GRF sources, I just merged Nicolas' patches for
> handling auxiliary GRFs [0] and GRF-gate clock type [1] .

Thanks for the hint, it does look like a better style which I'll adapt
in the next version.

> So ideally, please base off from there.
> 
> Thanks a lot
> Heiko
> 

Regards,
Yao Zi

> [0] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?id=70a114daf2077472e58b3cac23ba8998e35352f4
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?id=e277168cabe9fd99e647f5dad0bc846d5d6b0093
> 
> 



More information about the linux-arm-kernel mailing list