Commit 03a1ee1d authored by Michał Mirosław's avatar Michał Mirosław Committed by Stephen Boyd
Browse files

clk: at91: allow setting all PMC clock parents via DT



We need to have clocks accessible via phandle to select them
as peripheral clock parent using assigned-clock-parents in DT.
Add support for PLLACK/PLLBCK/AUDIOPLLCK clocks where available.

Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lkml.kernel.org/r/fa39cc10dab8341ea4bc2b7152be9217b2cd34a5.1588630999.git.mirq-linux@rere.qmqm.pl


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 99767cd4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
	if (IS_ERR(regmap))
		return;

	at91rm9200_pmc = pmc_data_allocate(PMC_MAIN + 1,
	at91rm9200_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
					    nck(at91rm9200_systemck),
					    nck(at91rm9200_periphck), 0, 4);
	if (!at91rm9200_pmc)
@@ -123,12 +123,16 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
	if (IS_ERR(hw))
		goto err_free;

	at91rm9200_pmc->chws[PMC_PLLACK] = hw;

	hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
				   &at91rm9200_pll_layout,
				   &rm9200_pll_characteristics);
	if (IS_ERR(hw))
		goto err_free;

	at91rm9200_pmc->chws[PMC_PLLBCK] = hw;

	parent_names[0] = slowxtal_name;
	parent_names[1] = "mainck";
	parent_names[2] = "pllack";
+5 −1
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
	if (IS_ERR(regmap))
		return;

	at91sam9260_pmc = pmc_data_allocate(PMC_MAIN + 1,
	at91sam9260_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
					    ndck(data->sck, data->num_sck),
					    ndck(data->pck, data->num_pck),
					    0, data->num_progck);
@@ -399,12 +399,16 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
	if (IS_ERR(hw))
		goto err_free;

	at91sam9260_pmc->chws[PMC_PLLACK] = hw;

	hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
				   data->pllb_layout,
				   data->pllb_characteristics);
	if (IS_ERR(hw))
		goto err_free;

	at91sam9260_pmc->chws[PMC_PLLBCK] = hw;

	parent_names[0] = slck_name;
	parent_names[1] = "mainck";
	parent_names[2] = "pllack";
+3 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
	if (IS_ERR(regmap))
		return;

	at91sam9g45_pmc = pmc_data_allocate(PMC_MAIN + 1,
	at91sam9g45_pmc = pmc_data_allocate(PMC_PLLACK + 1,
					    nck(at91sam9g45_systemck),
					    nck(at91sam9g45_periphck), 0, 2);
	if (!at91sam9g45_pmc)
@@ -143,6 +143,8 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
	if (IS_ERR(hw))
		goto err_free;

	at91sam9g45_pmc->chws[PMC_PLLACK] = hw;

	hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
	if (IS_ERR(hw))
		goto err_free;
+5 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
	if (IS_ERR(regmap))
		return;

	at91sam9n12_pmc = pmc_data_allocate(PMC_MAIN + 1,
	at91sam9n12_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
					   nck(at91sam9n12_systemck), 31, 0, 2);
	if (!at91sam9n12_pmc)
		return;
@@ -162,11 +162,15 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
	if (IS_ERR(hw))
		goto err_free;

	at91sam9n12_pmc->chws[PMC_PLLACK] = hw;

	hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
				   &at91rm9200_pll_layout, &pllb_characteristics);
	if (IS_ERR(hw))
		goto err_free;

	at91sam9n12_pmc->chws[PMC_PLLBCK] = hw;

	parent_names[0] = slck_name;
	parent_names[1] = "mainck";
	parent_names[2] = "plladivck";
+3 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
	if (IS_ERR(regmap))
		return;

	at91sam9rl_pmc = pmc_data_allocate(PMC_MAIN + 1,
	at91sam9rl_pmc = pmc_data_allocate(PMC_PLLACK + 1,
					   nck(at91sam9rl_systemck),
					   nck(at91sam9rl_periphck), 0, 2);
	if (!at91sam9rl_pmc)
@@ -105,6 +105,8 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
	if (IS_ERR(hw))
		goto err_free;

	at91sam9rl_pmc->chws[PMC_PLLACK] = hw;

	hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
	if (IS_ERR(hw))
		goto err_free;
Loading