Skip to content

Commit a31cf51

Browse files
Wolfram Sanggeertu
authored andcommitted
clk: renesas: rcar-gen3: Add dummy SDnH clock
Currently, SDnH is handled together with SDn. This caused lots of problems, so we want SDnH as a separate clock. Introduce a dummy SDnH type here which creates a fixed-factor clock with factor 1. That allows us to convert the per-SoC CPG drivers while keeping the old behaviour for now. A later patch then will add the proper functionality. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20211110191610.5664-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 1614501 commit a31cf51

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

drivers/clk/renesas/rcar-cpg-lib.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
6565
/*
6666
* SDn Clock
6767
*/
68+
69+
struct clk * __init cpg_sdh_clk_register(const char *name,
70+
void __iomem *sdnckcr, const char *parent_name,
71+
struct raw_notifier_head *notifiers)
72+
{
73+
/* placeholder during transition */
74+
return clk_register_fixed_factor(NULL, name, parent_name, 0, 1, 1);
75+
}
76+
6877
#define CPG_SD_STP_HCK BIT(9)
6978
#define CPG_SD_STP_CK BIT(8)
7079

drivers/clk/renesas/rcar-cpg-lib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
2626

2727
void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set);
2828

29+
struct clk * __init cpg_sdh_clk_register(const char *name,
30+
void __iomem *sdnckcr, const char *parent_name,
31+
struct raw_notifier_head *notifiers);
32+
2933
struct clk * __init cpg_sd_clk_register(const char *name,
3034
void __iomem *base, unsigned int offset, const char *parent_name,
3135
struct raw_notifier_head *notifiers, bool skip_first);

drivers/clk/renesas/rcar-gen3-cpg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
401401
mult *= 2;
402402
break;
403403

404+
case CLK_TYPE_GEN3_SDH:
405+
return cpg_sdh_clk_register(core->name, base + core->offset,
406+
__clk_get_name(parent), notifiers);
407+
404408
case CLK_TYPE_GEN3_SD:
405409
return cpg_sd_clk_register(core->name, base, core->offset,
406410
__clk_get_name(parent), notifiers,

drivers/clk/renesas/rcar-gen3-cpg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ enum rcar_gen3_clk_types {
1717
CLK_TYPE_GEN3_PLL2,
1818
CLK_TYPE_GEN3_PLL3,
1919
CLK_TYPE_GEN3_PLL4,
20+
CLK_TYPE_GEN3_SDH,
2021
CLK_TYPE_GEN3_SD,
2122
CLK_TYPE_GEN3_R,
2223
CLK_TYPE_GEN3_MDSEL, /* Select parent/divider using mode pin */
@@ -32,6 +33,9 @@ enum rcar_gen3_clk_types {
3233
CLK_TYPE_GEN3_SOC_BASE,
3334
};
3435

36+
#define DEF_GEN3_SDH(_name, _id, _parent, _offset) \
37+
DEF_BASE(_name, _id, CLK_TYPE_GEN3_SDH, _parent, .offset = _offset)
38+
3539
#define DEF_GEN3_SD(_name, _id, _parent, _offset) \
3640
DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
3741

0 commit comments

Comments
 (0)