1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2014 Marvell Technology Group Ltd.
5 * Alexandre Belloni <alexandre.belloni@free-electrons.com>
6 * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
8 #ifndef __BERLIN2_DIV_H
9 #define __BERLIN2_DIV_H
13 #define BERLIN2_DIV_HAS_GATE BIT(0)
14 #define BERLIN2_DIV_HAS_MUX BIT(1)
16 #define BERLIN2_PLL_SELECT(_off, _sh) \
17 .pll_select_offs = _off, \
18 .pll_select_shift = _sh
20 #define BERLIN2_PLL_SWITCH(_off, _sh) \
21 .pll_switch_offs = _off, \
22 .pll_switch_shift = _sh
24 #define BERLIN2_DIV_SELECT(_off, _sh) \
25 .div_select_offs = _off, \
26 .div_select_shift = _sh
28 #define BERLIN2_DIV_SWITCH(_off, _sh) \
29 .div_switch_offs = _off, \
30 .div_switch_shift = _sh
32 #define BERLIN2_DIV_D3SWITCH(_off, _sh) \
33 .div3_switch_offs = _off, \
34 .div3_switch_shift = _sh
36 #define BERLIN2_DIV_GATE(_off, _sh) \
40 #define BERLIN2_SINGLE_DIV(_off) \
41 BERLIN2_DIV_GATE(_off, 0), \
42 BERLIN2_PLL_SELECT(_off, 1), \
43 BERLIN2_PLL_SWITCH(_off, 4), \
44 BERLIN2_DIV_SWITCH(_off, 5), \
45 BERLIN2_DIV_D3SWITCH(_off, 6), \
46 BERLIN2_DIV_SELECT(_off, 7)
48 struct berlin2_div_map
{
63 struct berlin2_div_data
{
68 struct berlin2_div_map map
;
73 berlin2_div_register(const struct berlin2_div_map
*map
,
74 void __iomem
*base
, const char *name
, u8 div_flags
,
75 const char **parent_names
, int num_parents
,
76 unsigned long flags
, spinlock_t
*lock
);
78 #endif /* __BERLIN2_DIV_H */