Skip to content

Commit da56e2a

Browse files
aailletpdgendt
authored andcommitted
drivers: clock: rcar: r8a7795 driver cleanup
Remove old unused defines from header Use clang-format to apply coding guideline to r8a7795 driver Signed-off-by: Aymeric Aillet <[email protected]>
1 parent caf4e48 commit da56e2a

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

drivers/clock_control/clock_control_r8a7795_cpg_mssr.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
LOG_MODULE_DECLARE(clock_control_rcar);
2121

22-
#define R8A7795_CLK_SD_STOP_BIT 8
23-
#define R8A7795_CLK_SD_DIV_MASK 0x3
22+
#define R8A7795_CLK_SD_STOP_BIT 8
23+
#define R8A7795_CLK_SD_DIV_MASK 0x3
2424
#define R8A7795_CLK_SD_DIV_SHIFT 0
2525

26-
#define R8A7795_CLK_SDH_STOP_BIT 9
27-
#define R8A7795_CLK_SDH_DIV_MASK 0x7
26+
#define R8A7795_CLK_SDH_STOP_BIT 9
27+
#define R8A7795_CLK_SDH_DIV_MASK 0x7
2828
#define R8A7795_CLK_SDH_DIV_SHIFT 2
2929

3030
#define R8A7795_CLK_CANFD_STOP_BIT 8
@@ -40,8 +40,8 @@ struct r8a7795_cpg_mssr_data {
4040

4141
/* NOTE: the array MUST be sorted by module field */
4242
static struct cpg_clk_info_table core_props[] = {
43-
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_S3D4, RCAR_CPG_NONE,
44-
RCAR_CPG_NONE, RCAR_CPG_KHZ(66600)),
43+
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_S3D4, RCAR_CPG_NONE, RCAR_CPG_NONE,
44+
RCAR_CPG_KHZ(66600)),
4545

4646
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_SD0H, 0x0074, RCAR_CPG_NONE, RCAR_CPG_MHZ(800)),
4747
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_SD0, 0x0074, R8A7795_CLK_SD0H, RCAR_CPG_MHZ(800)),
@@ -57,8 +57,8 @@ static struct cpg_clk_info_table core_props[] = {
5757

5858
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_CANFD, 0x0244, RCAR_CPG_NONE, RCAR_CPG_MHZ(800)),
5959

60-
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_S0D12, RCAR_CPG_NONE,
61-
RCAR_CPG_NONE, RCAR_CPG_KHZ(66600)),
60+
RCAR_CORE_CLK_INFO_ITEM(R8A7795_CLK_S0D12, RCAR_CPG_NONE, RCAR_CPG_NONE,
61+
RCAR_CPG_KHZ(66600)),
6262
};
6363

6464
/* NOTE: the array MUST be sorted by module field */
@@ -72,8 +72,7 @@ static struct cpg_clk_info_table mod_props[] = {
7272
};
7373

7474
static int r8a7795_cpg_enable_disable_core(const struct device *dev,
75-
struct cpg_clk_info_table *clk_info,
76-
uint32_t enable)
75+
struct cpg_clk_info_table *clk_info, uint32_t enable)
7776
{
7877
int ret = 0;
7978
uint32_t reg;
@@ -113,8 +112,7 @@ static int r8a7795_cpg_enable_disable_core(const struct device *dev,
113112
return ret;
114113
}
115114

116-
static int r8a7795_cpg_core_clock_endisable(const struct device *dev,
117-
struct rcar_cpg_clk *clk,
115+
static int r8a7795_cpg_core_clock_endisable(const struct device *dev, struct rcar_cpg_clk *clk,
118116
bool enable)
119117
{
120118
struct cpg_clk_info_table *clk_info;
@@ -132,7 +130,7 @@ static int r8a7795_cpg_core_clock_endisable(const struct device *dev,
132130
uintptr_t rate = clk->rate;
133131

134132
ret = rcar_cpg_set_rate(dev, (clock_control_subsys_t)clk,
135-
(clock_control_subsys_rate_t)rate);
133+
(clock_control_subsys_rate_t)rate);
136134
if (ret < 0) {
137135
return ret;
138136
}
@@ -146,8 +144,7 @@ static int r8a7795_cpg_core_clock_endisable(const struct device *dev,
146144
return ret;
147145
}
148146

149-
static int r8a7795_cpg_mssr_start_stop(const struct device *dev,
150-
clock_control_subsys_t sys,
147+
static int r8a7795_cpg_mssr_start_stop(const struct device *dev, clock_control_subsys_t sys,
151148
bool enable)
152149
{
153150
struct rcar_cpg_clk *clk = (struct rcar_cpg_clk *)sys;
@@ -258,14 +255,12 @@ static int r8a7795_set_rate_helper(uint32_t module, uint32_t *divider, uint32_t
258255
return ret;
259256
}
260257

261-
static int r8a7795_cpg_mssr_start(const struct device *dev,
262-
clock_control_subsys_t sys)
258+
static int r8a7795_cpg_mssr_start(const struct device *dev, clock_control_subsys_t sys)
263259
{
264260
return r8a7795_cpg_mssr_start_stop(dev, sys, true);
265261
}
266262

267-
static int r8a7795_cpg_mssr_stop(const struct device *dev,
268-
clock_control_subsys_t sys)
263+
static int r8a7795_cpg_mssr_stop(const struct device *dev, clock_control_subsys_t sys)
269264
{
270265
return r8a7795_cpg_mssr_start_stop(dev, sys, false);
271266
}

drivers/clock_control/clock_control_renesas_cpg_mssr.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,6 @@ static const uint16_t srcr[] = {
9595
0x0BC, 0x0C4, 0x1C8, 0x1CC,
9696
0x920, 0x924, 0x928, 0x92C,
9797
};
98-
99-
/* CAN FD Clock Frequency Control Register */
100-
#define CANFDCKCR 0x244
101-
102-
/* Clock stop bit */
103-
#define CANFDCKCR_CKSTP BIT(8)
104-
105-
/* CANFD Clock */
106-
#define CANFDCKCR_PARENT_CLK_RATE 800000000
107-
#define CANFDCKCR_DIVIDER_MASK 0x1FF
108-
109-
/* Peripherals Clocks */
110-
#define S3D4_CLK_RATE 66600000 /* SCIF */
111-
#define S0D12_CLK_RATE 66600000 /* PWM */
11298
#elif defined(CONFIG_SOC_SERIES_RCAR_GEN4)
11399
/* Software Reset Clearing Register offsets */
114100
#define SRSTCLR(i) (0x2C80 + (i) * 4)

0 commit comments

Comments
 (0)