Skip to content

Commit dabedfe

Browse files
committed
Merge branches 'clk-gpio-flags', 'clk-tegra', 'clk-rockchip', 'clk-sprd' and 'clk-pxa' into clk-next
- Make gpio gate clks propagate rate setting up to parent * clk-gpio-flags: clk: clk-gpio: propagate rate change to parent * clk-tegra: (23 commits) clk: tegra: Use match_string() helper to simplify the code clk: tegra: Fix build error without CONFIG_PM_SLEEP clk: tegra: Add missing stubs for the case of !CONFIG_PM_SLEEP clk: tegra: Optimize PLLX restore on Tegra20/30 clk: tegra: Add suspend and resume support on Tegra210 clk: tegra: Share clk and rst register defines with Tegra clock driver clk: tegra: Use fence_udelay() during PLLU init clk: tegra: clk-dfll: Add suspend and resume support clk: tegra: clk-super: Add restore-context support clk: tegra: clk-super: Fix to enable PLLP branches to CPU clk: tegra: periph: Add restore_context support clk: tegra: Support for OSC context save and restore clk: tegra: pll: Save and restore pll context clk: tegra: pllout: Save and restore pllout context clk: tegra: divider: Save and restore divider rate clk: tegra: Reimplement SOR clocks on Tegra210 clk: tegra: Reimplement SOR clock on Tegra124 clk: tegra: Rename sor0_lvds to sor0_out clk: tegra: Move SOR0 implementation to Tegra124 clk: tegra: Remove last remains of TEGRA210_CLK_SOR1_SRC ... * clk-rockchip: clk: rockchip: protect the pclk_usb_grf as critical on px30 clk: rockchip: add video-related niu clocks as critical on px30 clk: rockchip: move px30 critical clocks to correct clock controller clk: rockchip: Add div50 clocks for px30 sdmmc, emmc, sdio and nandc clk: rockchip: Add div50 clock-ids for sdmmc on px30 and nandc clk: rockchip: make clk_half_divider_ops static * clk-sprd: clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap_lookup_by_phandle() * clk-pxa: clk: pxa: fix one of the pxa RTC clocks
6 parents 6df24d0 + fc59462 + a31414e + 9320c7d + 9629dbd + 46acbcb commit dabedfe

33 files changed

+1063
-214
lines changed

drivers/clk/clk-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
280280
else
281281
clk = clk_register_gpio_gate(&pdev->dev, node->name,
282282
parent_names ? parent_names[0] : NULL, gpiod,
283-
0);
283+
CLK_SET_RATE_PARENT);
284284
if (IS_ERR(clk))
285285
return PTR_ERR(clk);
286286

drivers/clk/clk.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,24 @@ static int clk_fetch_parent_index(struct clk_core *core,
16741674
return i;
16751675
}
16761676

1677+
/**
1678+
* clk_hw_get_parent_index - return the index of the parent clock
1679+
* @hw: clk_hw associated with the clk being consumed
1680+
*
1681+
* Fetches and returns the index of parent clock. Returns -EINVAL if the given
1682+
* clock does not have a current parent.
1683+
*/
1684+
int clk_hw_get_parent_index(struct clk_hw *hw)
1685+
{
1686+
struct clk_hw *parent = clk_hw_get_parent(hw);
1687+
1688+
if (WARN_ON(parent == NULL))
1689+
return -EINVAL;
1690+
1691+
return clk_fetch_parent_index(hw->core, parent->core);
1692+
}
1693+
EXPORT_SYMBOL_GPL(clk_hw_get_parent_index);
1694+
16771695
/*
16781696
* Update the orphan status of @core and all its children.
16791697
*/

drivers/clk/pxa/clk-pxa27x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ struct dummy_clk {
459459
};
460460
static struct dummy_clk dummy_clks[] __initdata = {
461461
DUMMY_CLK(NULL, "pxa27x-gpio", "osc_32_768khz"),
462+
DUMMY_CLK(NULL, "pxa-rtc", "osc_32_768khz"),
462463
DUMMY_CLK(NULL, "sa1100-rtc", "osc_32_768khz"),
463464
DUMMY_CLK("UARTCLK", "pxa2xx-ir", "STUART"),
464465
};

drivers/clk/rockchip/clk-half-divider.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,11 @@ static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
139139
return 0;
140140
}
141141

142-
const struct clk_ops clk_half_divider_ops = {
142+
static const struct clk_ops clk_half_divider_ops = {
143143
.recalc_rate = clk_half_divider_recalc_rate,
144144
.round_rate = clk_half_divider_round_rate,
145145
.set_rate = clk_half_divider_set_rate,
146146
};
147-
EXPORT_SYMBOL_GPL(clk_half_divider_ops);
148147

149148
/**
150149
* Register a clock branch.

drivers/clk/rockchip/clk-px30.c

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ PNAME(mux_uart5_p) = { "clk_uart5_src", "clk_uart5_np5", "clk_uart5_frac" };
167167
PNAME(mux_cif_out_p) = { "xin24m", "dummy_cpll", "npll", "usb480m" };
168168
PNAME(mux_dclk_vopb_p) = { "dclk_vopb_src", "dclk_vopb_frac", "xin24m" };
169169
PNAME(mux_dclk_vopl_p) = { "dclk_vopl_src", "dclk_vopl_frac", "xin24m" };
170+
PNAME(mux_nandc_p) = { "clk_nandc_div", "clk_nandc_div50" };
171+
PNAME(mux_sdio_p) = { "clk_sdio_div", "clk_sdio_div50" };
172+
PNAME(mux_emmc_p) = { "clk_emmc_div", "clk_emmc_div50" };
173+
PNAME(mux_sdmmc_p) = { "clk_sdmmc_div", "clk_sdmmc_div50" };
170174
PNAME(mux_gmac_p) = { "clk_gmac_src", "gmac_clkin" };
171175
PNAME(mux_gmac_rmii_sel_p) = { "clk_gmac_rx_tx_div20", "clk_gmac_rx_tx_div2" };
172176
PNAME(mux_rtc32k_pmu_p) = { "xin32k", "pmu_pvtm_32k", "clk_rtc32k_frac", };
@@ -460,16 +464,40 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
460464
/* PD_MMC_NAND */
461465
GATE(HCLK_MMC_NAND, "hclk_mmc_nand", "hclk_peri_pre", 0,
462466
PX30_CLKGATE_CON(6), 0, GFLAGS),
463-
COMPOSITE(SCLK_NANDC, "clk_nandc", mux_gpll_cpll_npll_p, 0,
467+
COMPOSITE(SCLK_NANDC_DIV, "clk_nandc_div", mux_gpll_cpll_npll_p, 0,
464468
PX30_CLKSEL_CON(15), 6, 2, MFLAGS, 0, 5, DFLAGS,
469+
PX30_CLKGATE_CON(5), 11, GFLAGS),
470+
COMPOSITE(SCLK_NANDC_DIV50, "clk_nandc_div50", mux_gpll_cpll_npll_p, 0,
471+
PX30_CLKSEL_CON(15), 6, 2, MFLAGS, 8, 5, DFLAGS,
472+
PX30_CLKGATE_CON(5), 12, GFLAGS),
473+
COMPOSITE_NODIV(SCLK_NANDC, "clk_nandc", mux_nandc_p,
474+
CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
475+
PX30_CLKSEL_CON(15), 15, 1, MFLAGS,
465476
PX30_CLKGATE_CON(5), 13, GFLAGS),
466477

467-
COMPOSITE(SCLK_SDIO, "clk_sdio", mux_gpll_cpll_npll_xin24m_p, 0,
478+
COMPOSITE(SCLK_SDIO_DIV, "clk_sdio_div", mux_gpll_cpll_npll_xin24m_p, 0,
468479
PX30_CLKSEL_CON(18), 14, 2, MFLAGS, 0, 8, DFLAGS,
480+
PX30_CLKGATE_CON(6), 1, GFLAGS),
481+
COMPOSITE_DIV_OFFSET(SCLK_SDIO_DIV50, "clk_sdio_div50",
482+
mux_gpll_cpll_npll_xin24m_p, 0,
483+
PX30_CLKSEL_CON(18), 14, 2, MFLAGS,
484+
PX30_CLKSEL_CON(19), 0, 8, DFLAGS,
485+
PX30_CLKGATE_CON(6), 2, GFLAGS),
486+
COMPOSITE_NODIV(SCLK_SDIO, "clk_sdio", mux_sdio_p,
487+
CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
488+
PX30_CLKSEL_CON(19), 15, 1, MFLAGS,
469489
PX30_CLKGATE_CON(6), 3, GFLAGS),
470490

471-
COMPOSITE(SCLK_EMMC, "clk_emmc", mux_gpll_cpll_npll_xin24m_p, 0,
491+
COMPOSITE(SCLK_EMMC_DIV, "clk_emmc_div", mux_gpll_cpll_npll_xin24m_p, 0,
472492
PX30_CLKSEL_CON(20), 14, 2, MFLAGS, 0, 8, DFLAGS,
493+
PX30_CLKGATE_CON(6), 4, GFLAGS),
494+
COMPOSITE_DIV_OFFSET(SCLK_EMMC_DIV50, "clk_emmc_div50", mux_gpll_cpll_npll_xin24m_p, 0,
495+
PX30_CLKSEL_CON(20), 14, 2, MFLAGS,
496+
PX30_CLKSEL_CON(21), 0, 8, DFLAGS,
497+
PX30_CLKGATE_CON(6), 5, GFLAGS),
498+
COMPOSITE_NODIV(SCLK_EMMC, "clk_emmc", mux_emmc_p,
499+
CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
500+
PX30_CLKSEL_CON(21), 15, 1, MFLAGS,
473501
PX30_CLKGATE_CON(6), 6, GFLAGS),
474502

475503
COMPOSITE(SCLK_SFC, "clk_sfc", mux_gpll_cpll_p, 0,
@@ -494,8 +522,16 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
494522
/* PD_SDCARD */
495523
GATE(0, "hclk_sdmmc_pre", "hclk_peri_pre", 0,
496524
PX30_CLKGATE_CON(6), 12, GFLAGS),
497-
COMPOSITE(SCLK_SDMMC, "clk_sdmmc", mux_gpll_cpll_npll_xin24m_p, 0,
525+
COMPOSITE(SCLK_SDMMC_DIV, "clk_sdmmc_div", mux_gpll_cpll_npll_xin24m_p, 0,
498526
PX30_CLKSEL_CON(16), 14, 2, MFLAGS, 0, 8, DFLAGS,
527+
PX30_CLKGATE_CON(6), 13, GFLAGS),
528+
COMPOSITE_DIV_OFFSET(SCLK_SDMMC_DIV50, "clk_sdmmc_div50", mux_gpll_cpll_npll_xin24m_p, 0,
529+
PX30_CLKSEL_CON(16), 14, 2, MFLAGS,
530+
PX30_CLKSEL_CON(17), 0, 8, DFLAGS,
531+
PX30_CLKGATE_CON(6), 14, GFLAGS),
532+
COMPOSITE_NODIV(SCLK_SDMMC, "clk_sdmmc", mux_sdmmc_p,
533+
CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
534+
PX30_CLKSEL_CON(17), 15, 1, MFLAGS,
499535
PX30_CLKGATE_CON(6), 15, GFLAGS),
500536

501537
/* PD_USB */
@@ -763,29 +799,29 @@ static struct rockchip_clk_branch px30_clk_branches[] __initdata = {
763799
GATE(0, "pclk_ddrphy", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 3, GFLAGS),
764800
GATE(PCLK_MIPIDSIPHY, "pclk_mipidsiphy", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 4, GFLAGS),
765801
GATE(PCLK_MIPICSIPHY, "pclk_mipicsiphy", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 5, GFLAGS),
766-
GATE(PCLK_USB_GRF, "pclk_usb_grf", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 6, GFLAGS),
802+
GATE(PCLK_USB_GRF, "pclk_usb_grf", "pclk_top_pre", 0, PX30_CLKGATE_CON(16), 6, GFLAGS),
767803
GATE(0, "pclk_cpu_hoost", "pclk_top_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(16), 7, GFLAGS),
768804

769805
/* PD_VI */
770-
GATE(0, "aclk_vi_niu", "aclk_vi_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(4), 15, GFLAGS),
806+
GATE(0, "aclk_vi_niu", "aclk_vi_pre", 0, PX30_CLKGATE_CON(4), 15, GFLAGS),
771807
GATE(ACLK_CIF, "aclk_cif", "aclk_vi_pre", 0, PX30_CLKGATE_CON(5), 1, GFLAGS),
772808
GATE(ACLK_ISP, "aclk_isp", "aclk_vi_pre", 0, PX30_CLKGATE_CON(5), 3, GFLAGS),
773-
GATE(0, "hclk_vi_niu", "hclk_vi_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(5), 0, GFLAGS),
809+
GATE(0, "hclk_vi_niu", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 0, GFLAGS),
774810
GATE(HCLK_CIF, "hclk_cif", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 2, GFLAGS),
775811
GATE(HCLK_ISP, "hclk_isp", "hclk_vi_pre", 0, PX30_CLKGATE_CON(5), 4, GFLAGS),
776812

777813
/* PD_VO */
778-
GATE(0, "aclk_vo_niu", "aclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 0, GFLAGS),
814+
GATE(0, "aclk_vo_niu", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 0, GFLAGS),
779815
GATE(ACLK_VOPB, "aclk_vopb", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 3, GFLAGS),
780816
GATE(ACLK_RGA, "aclk_rga", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 7, GFLAGS),
781817
GATE(ACLK_VOPL, "aclk_vopl", "aclk_vo_pre", 0, PX30_CLKGATE_CON(3), 5, GFLAGS),
782818

783-
GATE(0, "hclk_vo_niu", "hclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 1, GFLAGS),
819+
GATE(0, "hclk_vo_niu", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 1, GFLAGS),
784820
GATE(HCLK_VOPB, "hclk_vopb", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 4, GFLAGS),
785821
GATE(HCLK_RGA, "hclk_rga", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 8, GFLAGS),
786822
GATE(HCLK_VOPL, "hclk_vopl", "hclk_vo_pre", 0, PX30_CLKGATE_CON(3), 6, GFLAGS),
787823

788-
GATE(0, "pclk_vo_niu", "pclk_vo_pre", CLK_IGNORE_UNUSED, PX30_CLKGATE_CON(3), 2, GFLAGS),
824+
GATE(0, "pclk_vo_niu", "pclk_vo_pre", 0, PX30_CLKGATE_CON(3), 2, GFLAGS),
789825
GATE(PCLK_MIPI_DSI, "pclk_mipi_dsi", "pclk_vo_pre", 0, PX30_CLKGATE_CON(3), 9, GFLAGS),
790826

791827
/* PD_BUS */
@@ -940,7 +976,7 @@ static struct rockchip_clk_branch px30_clk_pmu_branches[] __initdata = {
940976
GATE(0, "pclk_cru_pmu", "pclk_pmu_pre", CLK_IGNORE_UNUSED, PX30_PMU_CLKGATE_CON(0), 8, GFLAGS),
941977
};
942978

943-
static const char *const px30_pmucru_critical_clocks[] __initconst = {
979+
static const char *const px30_cru_critical_clocks[] __initconst = {
944980
"aclk_bus_pre",
945981
"pclk_bus_pre",
946982
"hclk_bus_pre",
@@ -950,10 +986,16 @@ static const char *const px30_pmucru_critical_clocks[] __initconst = {
950986
"pclk_top_pre",
951987
"pclk_pmu_pre",
952988
"hclk_usb_niu",
989+
"pclk_vo_niu",
990+
"aclk_vo_niu",
991+
"hclk_vo_niu",
992+
"aclk_vi_niu",
993+
"hclk_vi_niu",
953994
"pll_npll",
954995
"usb480m",
955996
"clk_uart2",
956997
"pclk_uart2",
998+
"pclk_usb_grf",
957999
};
9581000

9591001
static void __init px30_clk_init(struct device_node *np)
@@ -985,6 +1027,9 @@ static void __init px30_clk_init(struct device_node *np)
9851027
&px30_cpuclk_data, px30_cpuclk_rates,
9861028
ARRAY_SIZE(px30_cpuclk_rates));
9871029

1030+
rockchip_clk_protect_critical(px30_cru_critical_clocks,
1031+
ARRAY_SIZE(px30_cru_critical_clocks));
1032+
9881033
rockchip_register_softrst(np, 12, reg_base + PX30_SOFTRST_CON(0),
9891034
ROCKCHIP_SOFTRST_HIWORD_MASK);
9901035

@@ -1017,9 +1062,6 @@ static void __init px30_pmu_clk_init(struct device_node *np)
10171062
rockchip_clk_register_branches(ctx, px30_clk_pmu_branches,
10181063
ARRAY_SIZE(px30_clk_pmu_branches));
10191064

1020-
rockchip_clk_protect_critical(px30_pmucru_critical_clocks,
1021-
ARRAY_SIZE(px30_pmucru_critical_clocks));
1022-
10231065
rockchip_clk_of_add_provider(np, ctx);
10241066
}
10251067
CLK_OF_DECLARE(px30_cru_pmu, "rockchip,px30-pmucru", px30_pmu_clk_init);

drivers/clk/sprd/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
4545

4646
if (of_find_property(node, "sprd,syscon", NULL)) {
4747
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
48-
if (IS_ERR_OR_NULL(regmap)) {
48+
if (IS_ERR(regmap)) {
4949
pr_err("%s: failed to get syscon regmap\n", __func__);
5050
return PTR_ERR(regmap);
5151
}

drivers/clk/tegra/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ obj-y += clk-tegra-fixed.o
1717
obj-y += clk-tegra-super-gen4.o
1818
obj-$(CONFIG_TEGRA_CLK_EMC) += clk-emc.o
1919
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
20+
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20-emc.o
2021
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
22+
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra20-emc.o
2123
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
2224
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124.o
2325
obj-$(CONFIG_TEGRA_CLK_DFLL) += clk-tegra124-dfll-fcpu.o

drivers/clk/tegra/clk-dfll.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ static int dfll_init(struct tegra_dfll *td)
14871487
td->last_unrounded_rate = 0;
14881488

14891489
pm_runtime_enable(td->dev);
1490+
pm_runtime_irq_safe(td->dev);
14901491
pm_runtime_get_sync(td->dev);
14911492

14921493
dfll_set_mode(td, DFLL_DISABLED);
@@ -1513,6 +1514,61 @@ static int dfll_init(struct tegra_dfll *td)
15131514
return ret;
15141515
}
15151516

1517+
/**
1518+
* tegra_dfll_suspend - check DFLL is disabled
1519+
* @dev: DFLL device *
1520+
*
1521+
* DFLL clock should be disabled by the CPUFreq driver. So, make
1522+
* sure it is disabled and disable all clocks needed by the DFLL.
1523+
*/
1524+
int tegra_dfll_suspend(struct device *dev)
1525+
{
1526+
struct tegra_dfll *td = dev_get_drvdata(dev);
1527+
1528+
if (dfll_is_running(td)) {
1529+
dev_err(td->dev, "DFLL still enabled while suspending\n");
1530+
return -EBUSY;
1531+
}
1532+
1533+
reset_control_assert(td->dvco_rst);
1534+
1535+
return 0;
1536+
}
1537+
EXPORT_SYMBOL(tegra_dfll_suspend);
1538+
1539+
/**
1540+
* tegra_dfll_resume - reinitialize DFLL on resume
1541+
* @dev: DFLL instance
1542+
*
1543+
* DFLL is disabled and reset during suspend and resume.
1544+
* So, reinitialize the DFLL IP block back for use.
1545+
* DFLL clock is enabled later in closed loop mode by CPUFreq
1546+
* driver before switching its clock source to DFLL output.
1547+
*/
1548+
int tegra_dfll_resume(struct device *dev)
1549+
{
1550+
struct tegra_dfll *td = dev_get_drvdata(dev);
1551+
1552+
reset_control_deassert(td->dvco_rst);
1553+
1554+
pm_runtime_get_sync(td->dev);
1555+
1556+
dfll_set_mode(td, DFLL_DISABLED);
1557+
dfll_set_default_params(td);
1558+
1559+
if (td->soc->init_clock_trimmers)
1560+
td->soc->init_clock_trimmers();
1561+
1562+
dfll_set_open_loop_config(td);
1563+
1564+
dfll_init_out_if(td);
1565+
1566+
pm_runtime_put_sync(td->dev);
1567+
1568+
return 0;
1569+
}
1570+
EXPORT_SYMBOL(tegra_dfll_resume);
1571+
15161572
/*
15171573
* DT data fetch
15181574
*/

drivers/clk/tegra/clk-dfll.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ int tegra_dfll_register(struct platform_device *pdev,
4242
struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev);
4343
int tegra_dfll_runtime_suspend(struct device *dev);
4444
int tegra_dfll_runtime_resume(struct device *dev);
45+
int tegra_dfll_suspend(struct device *dev);
46+
int tegra_dfll_resume(struct device *dev);
4547

4648
#endif /* __DRIVERS_CLK_TEGRA_CLK_DFLL_H */

drivers/clk/tegra/clk-divider.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,21 @@ static int clk_frac_div_set_rate(struct clk_hw *hw, unsigned long rate,
109109
return 0;
110110
}
111111

112+
static void clk_divider_restore_context(struct clk_hw *hw)
113+
{
114+
struct clk_hw *parent = clk_hw_get_parent(hw);
115+
unsigned long parent_rate = clk_hw_get_rate(parent);
116+
unsigned long rate = clk_hw_get_rate(hw);
117+
118+
if (clk_frac_div_set_rate(hw, rate, parent_rate) < 0)
119+
WARN_ON(1);
120+
}
121+
112122
const struct clk_ops tegra_clk_frac_div_ops = {
113123
.recalc_rate = clk_frac_div_recalc_rate,
114124
.set_rate = clk_frac_div_set_rate,
115125
.round_rate = clk_frac_div_round_rate,
126+
.restore_context = clk_divider_restore_context,
116127
};
117128

118129
struct clk *tegra_clk_register_divider(const char *name,

0 commit comments

Comments
 (0)