Skip to content

Commit e897e86

Browse files
clamor-sthierryreding
authored andcommitted
clk: tegra30: Add CSI pad clock gates
Tegra30 has CSI pad bits in both PLLD and PLLD2 clocks that are required for the correct work of the CSI block. Add CSI pad A and pad B clock gates with PLLD/PLLD2 parents, respectively. Add a plld2 spinlock, like one plld uses, to prevent simultaneous access since both the PLLDx and CSIx_PAD clocks use the same registers Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20, parallel camera Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent a6d8abf commit e897e86

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/clk/tegra/clk-tegra30.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static unsigned long input_freq;
154154

155155
static DEFINE_SPINLOCK(cml_lock);
156156
static DEFINE_SPINLOCK(pll_d_lock);
157+
static DEFINE_SPINLOCK(pll_d2_lock);
157158

158159
#define TEGRA_INIT_DATA_MUX(_name, _parents, _offset, \
159160
_clk_num, _gate_flags, _clk_id) \
@@ -859,7 +860,7 @@ static void __init tegra30_pll_init(void)
859860

860861
/* PLLD2 */
861862
clk = tegra_clk_register_pll("pll_d2", "pll_ref", clk_base, pmc_base, 0,
862-
&pll_d2_params, NULL);
863+
&pll_d2_params, &pll_d2_lock);
863864
clks[TEGRA30_CLK_PLL_D2] = clk;
864865

865866
/* PLLD2_OUT0 */
@@ -1008,6 +1009,16 @@ static void __init tegra30_periph_clk_init(void)
10081009
0, 48, periph_clk_enb_refcnt);
10091010
clks[TEGRA30_CLK_DSIA] = clk;
10101011

1012+
/* csia_pad */
1013+
clk = clk_register_gate(NULL, "csia_pad", "pll_d", CLK_SET_RATE_PARENT,
1014+
clk_base + PLLD_BASE, 26, 0, &pll_d_lock);
1015+
clks[TEGRA30_CLK_CSIA_PAD] = clk;
1016+
1017+
/* csib_pad */
1018+
clk = clk_register_gate(NULL, "csib_pad", "pll_d2", CLK_SET_RATE_PARENT,
1019+
clk_base + PLLD2_BASE, 26, 0, &pll_d2_lock);
1020+
clks[TEGRA30_CLK_CSIB_PAD] = clk;
1021+
10111022
/* csus */
10121023
clk = tegra_clk_register_periph_gate("csus", "vi_sensor", 0,
10131024
clk_base, 0, TEGRA30_CLK_CSUS,

0 commit comments

Comments
 (0)