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
|
/*
* 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_MMC_PHASE_H__
#define __CLK_RK_MMC_PHASE_H__
#include "clk-rk.h"
struct rockchip_mmc_clk_cell
{
struct rockchip_clk_cell rk_cell;
int cached_phase;
struct rt_clk_notifier notifier;
};
#define MMC(_id, cname, pname, offset, shift) \
(void *)&(struct rockchip_mmc_clk_cell) \
{ \
.rk_cell.cell.name = cname, \
.rk_cell.cell.ops = &rockchip_mmc_clk_ops, \
.rk_cell.cell.parent_name = pname, \
.rk_cell.cell.parents_nr = 1, \
.rk_cell.id = _id, \
.rk_cell.muxdiv_offset = offset, \
.rk_cell.div_shift = shift, \
.rk_cell.setup = rockchip_mmc_clk_cell_setup, \
}
extern const struct rt_clk_ops rockchip_mmc_clk_ops;
rt_inline struct rockchip_mmc_clk_cell *cell_to_rockchip_mmc_clk_cell(struct rt_clk_cell *cell)
{
struct rockchip_clk_cell *rk_cell = cell_to_rockchip_clk_cell(cell);
return rt_container_of(rk_cell, struct rockchip_mmc_clk_cell, rk_cell);
}
void rockchip_mmc_clk_cell_setup(struct rockchip_clk_cell *rk_cell);
#endif /* __CLK_RK_MMC_PHASE_H__ */
|