at91sam9g45.c (171e502c6a1fee63ab6f3fc685d38960398ce6d5) at91sam9g45.c (c2f2ca0be8a62ce61a6878cd3dddd8fc6d622999)
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"

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

209 goto err_free;
210
211 at91sam9g45_pmc->shws[at91sam9g45_systemck[i].id] = hw;
212 }
213
214 for (i = 0; i < ARRAY_SIZE(at91sam9g45_periphck); i++) {
215 hw = at91_clk_register_peripheral(regmap,
216 at91sam9g45_periphck[i].n,
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"

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

209 goto err_free;
210
211 at91sam9g45_pmc->shws[at91sam9g45_systemck[i].id] = hw;
212 }
213
214 for (i = 0; i < ARRAY_SIZE(at91sam9g45_periphck); i++) {
215 hw = at91_clk_register_peripheral(regmap,
216 at91sam9g45_periphck[i].n,
217 "masterck_div",
217 "masterck_div", NULL,
218 at91sam9g45_periphck[i].id);
219 if (IS_ERR(hw))
220 goto err_free;
221
222 at91sam9g45_pmc->phws[at91sam9g45_periphck[i].id] = hw;
223 }
224
225 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, at91sam9g45_pmc);
226
227 return;
228
229err_free:
230 kfree(at91sam9g45_pmc);
231}
232/*
233 * The TCB is used as the clocksource so its clock is needed early. This means
234 * this can't be a platform driver.
235 */
236CLK_OF_DECLARE(at91sam9g45_pmc, "atmel,at91sam9g45-pmc", at91sam9g45_pmc_setup);
218 at91sam9g45_periphck[i].id);
219 if (IS_ERR(hw))
220 goto err_free;
221
222 at91sam9g45_pmc->phws[at91sam9g45_periphck[i].id] = hw;
223 }
224
225 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, at91sam9g45_pmc);
226
227 return;
228
229err_free:
230 kfree(at91sam9g45_pmc);
231}
232/*
233 * The TCB is used as the clocksource so its clock is needed early. This means
234 * this can't be a platform driver.
235 */
236CLK_OF_DECLARE(at91sam9g45_pmc, "atmel,at91sam9g45-pmc", at91sam9g45_pmc_setup);