summaryrefslogtreecommitdiff
path: root/bsp/rockchip/dm/clk/clk-rk-muxgrf.h
blob: 5b7b388d0b9d3ce5a8c0dba80acad28fb0a41480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-3-08      GuEe-GUI     the first version
 */

#ifndef __CLK_RK_MUXGRF_H__
#define __CLK_RK_MUXGRF_H__

#include "clk-rk.h"

#define MUXGRF(_id, cname, pnames, f, o, s, w, mf) \
(void *)&(struct rockchip_clk_cell)             \
{                                               \
    .cell.name = cname,                         \
    .cell.ops = &rockchip_muxgrf_clk_ops,       \
    .cell.parent_names = pnames,                \
    .cell.parents_nr = RT_ARRAY_SIZE(pnames),   \
    .cell.flags = f,                            \
    .id = _id,                                  \
    .muxdiv_offset = o,                         \
    .mux_shift = s,                             \
    .mux_width = w,                             \
    .mux_flags = mf,                            \
    .gate_offset = -1,                          \
}

#define MUXPMUGRF(_id, cname, pnames, f, o, s, w, mf) \
(void *)&(struct rockchip_clk_cell)             \
{                                               \
    .cell.name = cname,                         \
    .cell.ops = &rockchip_muxpmugrf_clk_ops,    \
    .cell.parent_names = pnames,                \
    .cell.parents_nr = RT_ARRAY_SIZE(pnames),   \
    .cell.flags = f,                            \
    .id = _id,                                  \
    .muxdiv_offset = o,                         \
    .mux_shift = s,                             \
    .mux_width = w,                             \
    .mux_flags = mf,                            \
    .gate_offset = -1,                          \
}

extern const struct rt_clk_ops rockchip_muxgrf_clk_ops, rockchip_muxpmugrf_clk_ops;

#endif /* __CLK_RK_MUXGRF_H__ */