@@ -65,11 +65,12 @@ struct raspberrypi_firmware_prop {
65
65
__le32 disable_turbo ;
66
66
} __packed ;
67
67
68
- static int raspberrypi_clock_property (struct rpi_firmware * firmware , u32 tag ,
69
- u32 clk , u32 * val )
68
+ static int raspberrypi_clock_property (struct rpi_firmware * firmware ,
69
+ const struct raspberrypi_clk_data * data ,
70
+ u32 tag , u32 * val )
70
71
{
71
72
struct raspberrypi_firmware_prop msg = {
72
- .id = cpu_to_le32 (clk ),
73
+ .id = cpu_to_le32 (data -> id ),
73
74
.val = cpu_to_le32 (* val ),
74
75
.disable_turbo = cpu_to_le32 (1 ),
75
76
};
@@ -92,9 +93,8 @@ static int raspberrypi_fw_pll_is_on(struct clk_hw *hw)
92
93
u32 val = 0 ;
93
94
int ret ;
94
95
95
- ret = raspberrypi_clock_property (rpi -> firmware ,
96
- RPI_FIRMWARE_GET_CLOCK_STATE ,
97
- data -> id , & val );
96
+ ret = raspberrypi_clock_property (rpi -> firmware , data ,
97
+ RPI_FIRMWARE_GET_CLOCK_STATE , & val );
98
98
if (ret )
99
99
return 0 ;
100
100
@@ -111,9 +111,8 @@ static unsigned long raspberrypi_fw_pll_get_rate(struct clk_hw *hw,
111
111
u32 val = 0 ;
112
112
int ret ;
113
113
114
- ret = raspberrypi_clock_property (rpi -> firmware ,
115
- RPI_FIRMWARE_GET_CLOCK_RATE ,
116
- data -> id , & val );
114
+ ret = raspberrypi_clock_property (rpi -> firmware , data ,
115
+ RPI_FIRMWARE_GET_CLOCK_RATE , & val );
117
116
if (ret )
118
117
return ret ;
119
118
@@ -129,9 +128,9 @@ static int raspberrypi_fw_pll_set_rate(struct clk_hw *hw, unsigned long rate,
129
128
u32 new_rate = rate / RPI_FIRMWARE_PLLB_ARM_DIV_RATE ;
130
129
int ret ;
131
130
132
- ret = raspberrypi_clock_property (rpi -> firmware ,
131
+ ret = raspberrypi_clock_property (rpi -> firmware , data ,
133
132
RPI_FIRMWARE_SET_CLOCK_RATE ,
134
- data -> id , & new_rate );
133
+ & new_rate );
135
134
if (ret )
136
135
dev_err_ratelimited (rpi -> dev , "Failed to change %s frequency: %d" ,
137
136
clk_hw_get_name (hw ), ret );
@@ -194,18 +193,18 @@ static int raspberrypi_register_pllb(struct raspberrypi_clk *rpi)
194
193
init .flags = CLK_GET_RATE_NOCACHE | CLK_IGNORE_UNUSED ;
195
194
196
195
/* Get min & max rates set by the firmware */
197
- ret = raspberrypi_clock_property (rpi -> firmware ,
196
+ ret = raspberrypi_clock_property (rpi -> firmware , data ,
198
197
RPI_FIRMWARE_GET_MIN_CLOCK_RATE ,
199
- data -> id , & min_rate );
198
+ & min_rate );
200
199
if (ret ) {
201
200
dev_err (rpi -> dev , "Failed to get %s min freq: %d\n" ,
202
201
init .name , ret );
203
202
return ret ;
204
203
}
205
204
206
- ret = raspberrypi_clock_property (rpi -> firmware ,
205
+ ret = raspberrypi_clock_property (rpi -> firmware , data ,
207
206
RPI_FIRMWARE_GET_MAX_CLOCK_RATE ,
208
- data -> id , & max_rate );
207
+ & max_rate );
209
208
if (ret ) {
210
209
dev_err (rpi -> dev , "Failed to get %s max freq: %d\n" ,
211
210
init .name , ret );
0 commit comments