sama5d4.c (98817a84ff1c755c347ac633ff017a623a631fad) sama5d4.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"

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

241 }
242
243 for (i = 0; i < ARRAY_SIZE(sama5d4_periphck); i++) {
244 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
245 &sama5d4_pcr_layout,
246 sama5d4_periphck[i].n,
247 "masterck",
248 sama5d4_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"

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

241 }
242
243 for (i = 0; i < ARRAY_SIZE(sama5d4_periphck); i++) {
244 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
245 &sama5d4_pcr_layout,
246 sama5d4_periphck[i].n,
247 "masterck",
248 sama5d4_periphck[i].id,
249 &range);
249 &range, INT_MIN);
250 if (IS_ERR(hw))
251 goto err_free;
252
253 sama5d4_pmc->phws[sama5d4_periphck[i].id] = hw;
254 }
255
256 for (i = 0; i < ARRAY_SIZE(sama5d4_periph32ck); i++) {
257 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
258 &sama5d4_pcr_layout,
259 sama5d4_periph32ck[i].n,
260 "h32mxck",
261 sama5d4_periph32ck[i].id,
250 if (IS_ERR(hw))
251 goto err_free;
252
253 sama5d4_pmc->phws[sama5d4_periphck[i].id] = hw;
254 }
255
256 for (i = 0; i < ARRAY_SIZE(sama5d4_periph32ck); i++) {
257 hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
258 &sama5d4_pcr_layout,
259 sama5d4_periph32ck[i].n,
260 "h32mxck",
261 sama5d4_periph32ck[i].id,
262 &range);
262 &range, INT_MIN);
263 if (IS_ERR(hw))
264 goto err_free;
265
266 sama5d4_pmc->phws[sama5d4_periph32ck[i].id] = hw;
267 }
268
269 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sama5d4_pmc);
270
271 return;
272
273err_free:
274 kfree(sama5d4_pmc);
275}
276CLK_OF_DECLARE_DRIVER(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);
263 if (IS_ERR(hw))
264 goto err_free;
265
266 sama5d4_pmc->phws[sama5d4_periph32ck[i].id] = hw;
267 }
268
269 of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sama5d4_pmc);
270
271 return;
272
273err_free:
274 kfree(sama5d4_pmc);
275}
276CLK_OF_DECLARE_DRIVER(sama5d4_pmc, "atmel,sama5d4-pmc", sama5d4_pmc_setup);