1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Purna Chandra Mandal,<purna.mandal@microchip.com>
4 * Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
6 #ifndef __MICROCHIP_CLK_PIC32_H_
7 #define __MICROCHIP_CLK_PIC32_H_
9 #include <linux/clk-provider.h>
11 /* PIC32 clock data */
12 struct pic32_clk_common
{
15 spinlock_t reg_lock
; /* clock lock */
18 /* System PLL clock */
19 struct pic32_sys_pll_data
{
20 struct clk_init_data init_data
;
27 struct pic32_sys_clk_data
{
28 struct clk_init_data init_data
;
31 const u32
*parent_map
;
35 /* Reference Oscillator clock */
36 struct pic32_ref_osc_data
{
37 struct clk_init_data init_data
;
39 const u32
*parent_map
;
42 /* Peripheral Bus clock */
43 struct pic32_periph_clk_data
{
44 struct clk_init_data init_data
;
48 /* External Secondary Oscillator clock */
49 struct pic32_sec_osc_data
{
50 struct clk_init_data init_data
;
53 const u32 enable_mask
;
54 const u32 status_mask
;
55 const unsigned long fixed_rate
;
58 extern const struct clk_ops pic32_pbclk_ops
;
59 extern const struct clk_ops pic32_sclk_ops
;
60 extern const struct clk_ops pic32_sclk_no_div_ops
;
61 extern const struct clk_ops pic32_spll_ops
;
62 extern const struct clk_ops pic32_roclk_ops
;
63 extern const struct clk_ops pic32_sosc_ops
;
65 struct clk
*pic32_periph_clk_register(const struct pic32_periph_clk_data
*data
,
66 struct pic32_clk_common
*core
);
67 struct clk
*pic32_refo_clk_register(const struct pic32_ref_osc_data
*data
,
68 struct pic32_clk_common
*core
);
69 struct clk
*pic32_sys_clk_register(const struct pic32_sys_clk_data
*data
,
70 struct pic32_clk_common
*core
);
71 struct clk
*pic32_spll_clk_register(const struct pic32_sys_pll_data
*data
,
72 struct pic32_clk_common
*core
);
73 struct clk
*pic32_sosc_clk_register(const struct pic32_sec_osc_data
*data
,
74 struct pic32_clk_common
*core
);
76 #endif /* __MICROCHIP_CLK_PIC32_H_*/