@@ -51,8 +51,6 @@ struct mpfs_msspll_hw_clock {
51
51
52
52
struct mpfs_cfg_clock {
53
53
const struct clk_div_table * table ;
54
- unsigned int id ;
55
- u32 reg_offset ;
56
54
u8 shift ;
57
55
u8 width ;
58
56
u8 flags ;
@@ -63,19 +61,21 @@ struct mpfs_cfg_hw_clock {
63
61
void __iomem * sys_base ;
64
62
struct clk_hw hw ;
65
63
struct clk_init_data init ;
64
+ unsigned int id ;
65
+ u32 reg_offset ;
66
66
};
67
67
68
68
#define to_mpfs_cfg_clk (_hw ) container_of(_hw, struct mpfs_cfg_hw_clock, hw)
69
69
70
70
struct mpfs_periph_clock {
71
- unsigned int id ;
72
71
u8 shift ;
73
72
};
74
73
75
74
struct mpfs_periph_hw_clock {
76
75
struct mpfs_periph_clock periph ;
77
76
void __iomem * sys_base ;
78
77
struct clk_hw hw ;
78
+ unsigned int id ;
79
79
};
80
80
81
81
#define to_mpfs_periph_clk (_hw ) container_of(_hw, struct mpfs_periph_hw_clock, hw)
@@ -241,7 +241,7 @@ static unsigned long mpfs_cfg_clk_recalc_rate(struct clk_hw *hw, unsigned long p
241
241
void __iomem * base_addr = cfg_hw -> sys_base ;
242
242
u32 val ;
243
243
244
- val = readl_relaxed (base_addr + cfg -> reg_offset ) >> cfg -> shift ;
244
+ val = readl_relaxed (base_addr + cfg_hw -> reg_offset ) >> cfg -> shift ;
245
245
val &= clk_div_mask (cfg -> width );
246
246
247
247
return divider_recalc_rate (hw , prate , val , cfg -> table , cfg -> flags , cfg -> width );
@@ -270,10 +270,10 @@ static int mpfs_cfg_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned
270
270
return divider_setting ;
271
271
272
272
spin_lock_irqsave (& mpfs_clk_lock , flags );
273
- val = readl_relaxed (base_addr + cfg -> reg_offset );
273
+ val = readl_relaxed (base_addr + cfg_hw -> reg_offset );
274
274
val &= ~(clk_div_mask (cfg -> width ) << cfg_hw -> cfg .shift );
275
275
val |= divider_setting << cfg -> shift ;
276
- writel_relaxed (val , base_addr + cfg -> reg_offset );
276
+ writel_relaxed (val , base_addr + cfg_hw -> reg_offset );
277
277
278
278
spin_unlock_irqrestore (& mpfs_clk_lock , flags );
279
279
@@ -287,11 +287,11 @@ static const struct clk_ops mpfs_clk_cfg_ops = {
287
287
};
288
288
289
289
#define CLK_CFG (_id , _name , _parent , _shift , _width , _table , _flags , _offset ) { \
290
- .cfg. id = _id, \
290
+ .id = _id, \
291
291
.cfg.shift = _shift, \
292
292
.cfg.width = _width, \
293
293
.cfg.table = _table, \
294
- .cfg. reg_offset = _offset, \
294
+ .reg_offset = _offset, \
295
295
.cfg.flags = _flags, \
296
296
.hw.init = CLK_HW_INIT(_name, _parent, &mpfs_clk_cfg_ops, 0), \
297
297
}
@@ -309,11 +309,11 @@ static struct mpfs_cfg_hw_clock mpfs_cfg_clks[] = {
309
309
CLK_CFG (CLK_AHB , "clk_ahb" , "clk_msspll" , 4 , 2 , mpfs_div_ahb_table , 0 ,
310
310
REG_CLOCK_CONFIG_CR ),
311
311
{
312
- .cfg . id = CLK_RTCREF ,
312
+ .id = CLK_RTCREF ,
313
313
.cfg .shift = 0 ,
314
314
.cfg .width = 12 ,
315
315
.cfg .table = mpfs_div_rtcref_table ,
316
- .cfg . reg_offset = REG_RTC_CLOCK_CR ,
316
+ .reg_offset = REG_RTC_CLOCK_CR ,
317
317
.cfg .flags = CLK_DIVIDER_ONE_BASED ,
318
318
.hw .init =
319
319
CLK_HW_INIT_PARENTS_DATA ("clk_rtcref" , mpfs_ext_ref , & mpfs_clk_cfg_ops , 0 ),
@@ -341,9 +341,9 @@ static int mpfs_clk_register_cfgs(struct device *dev, struct mpfs_cfg_hw_clock *
341
341
ret = mpfs_clk_register_cfg (dev , cfg_hw , sys_base );
342
342
if (ret )
343
343
return dev_err_probe (dev , ret , "failed to register clock id: %d\n" ,
344
- cfg_hw -> cfg . id );
344
+ cfg_hw -> id );
345
345
346
- id = cfg_hw -> cfg . id ;
346
+ id = cfg_hw -> id ;
347
347
data -> hw_data .hws [id ] = & cfg_hw -> hw ;
348
348
}
349
349
@@ -411,7 +411,7 @@ static const struct clk_ops mpfs_periph_clk_ops = {
411
411
};
412
412
413
413
#define CLK_PERIPH (_id , _name , _parent , _shift , _flags ) { \
414
- .periph. id = _id, \
414
+ .id = _id, \
415
415
.periph.shift = _shift, \
416
416
.hw.init = CLK_HW_INIT_HW(_name, _parent, &mpfs_periph_clk_ops, \
417
417
_flags), \
@@ -486,9 +486,9 @@ static int mpfs_clk_register_periphs(struct device *dev, struct mpfs_periph_hw_c
486
486
ret = mpfs_clk_register_periph (dev , periph_hw , sys_base );
487
487
if (ret )
488
488
return dev_err_probe (dev , ret , "failed to register clock id: %d\n" ,
489
- periph_hw -> periph . id );
489
+ periph_hw -> id );
490
490
491
- id = periph_hws [i ].periph . id ;
491
+ id = periph_hws [i ].id ;
492
492
data -> hw_data .hws [id ] = & periph_hw -> hw ;
493
493
}
494
494
0 commit comments