at91sam9n12.c (153bc1c66a8814e621ca0483098ac722be860aaf) at91sam9n12.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"

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

217 }
218
219 for (i = 0; i < ARRAY_SIZE(at91sam9n12_periphck); i++) {
220 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
221 &at91sam9n12_pcr_layout,
222 at91sam9n12_periphck[i].n,
223 "masterck",
224 at91sam9n12_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"

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

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