sama5d3.c (153bc1c66a8814e621ca0483098ac722be860aaf) sama5d3.c (b4c115c76184f2c56a295579161652fd5eb2dcc1)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/clk-provider.h>
3#include <linux/mfd/syscon.h>
4#include <linux/slab.h>
5
6#include <dt-bindings/clock/at91.h>
7
8#include "pmc.h"

--- 209 unchanged lines hidden (view full) ---

218 }
219
220 for (i = 0; i < ARRAY_SIZE(sama5d3_periphck); i++) {
221 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
222 &sama5d3_pcr_layout,
223 sama5d3_periphck[i].n,
224 "masterck",
225 sama5d3_periphck[i].id,
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/clk-provider.h>
3#include <linux/mfd/syscon.h>
4#include <linux/slab.h>
5
6#include <dt-bindings/clock/at91.h>
7
8#include "pmc.h"

--- 209 unchanged lines hidden (view full) ---

218 }
219
220 for (i = 0; i < ARRAY_SIZE(sama5d3_periphck); i++) {
221 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
222 &sama5d3_pcr_layout,
223 sama5d3_periphck[i].n,
224 "masterck",
225 sama5d3_periphck[i].id,
226 &sama5d3_periphck[i].r);
226 &sama5d3_periphck[i].r,
227 INT_MIN);
227 if (IS_ERR(hw))
228 goto err_free;
229
230 sama5d3_pmc->phws[sama5d3_periphck[i].id] = hw;
231 }
232
233 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sama5d3_pmc);
234
235 return;
236
237err_free:
238 kfree(sama5d3_pmc);
239}
240/*
241 * The TCB is used as the clocksource so its clock is needed early. This means
242 * this can't be a platform driver.
243 */
244CLK_OF_DECLARE_DRIVER(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);
228 if (IS_ERR(hw))
229 goto err_free;
230
231 sama5d3_pmc->phws[sama5d3_periphck[i].id] = hw;
232 }
233
234 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sama5d3_pmc);
235
236 return;
237
238err_free:
239 kfree(sama5d3_pmc);
240}
241/*
242 * The TCB is used as the clocksource so its clock is needed early. This means
243 * this can't be a platform driver.
244 */
245CLK_OF_DECLARE_DRIVER(sama5d3_pmc, "atmel,sama5d3-pmc", sama5d3_pmc_setup);