Commit 7cf0324
clk: samsung: gs101: propagate PERIC1 USI SPI clock rate
When SPI transfer is being prepared, the spi-s3c64xx driver will call
clk_set_rate() to change the rate of SPI source clock (IPCLK). But IPCLK
is a gate (leaf) clock, so it must propagate the rate change up the
clock tree, so that corresponding MUX/DIV clocks can actually change
their values. Add CLK_SET_RATE_PARENT flag to corresponding clocks for
all USI instances in GS101 PERIC1: USI{0, 9, 10, 11, 12, 13}. This change
involves the following clocks:
PERIC1 USI*:
Clock Div range MUX Selection
-------------------------------------------------------------------
gout_peric1_peric1_top0_ipclk_* - -
dout_peric1_usi*_usi /1..16 -
mout_peric1_usi*_usi_user - {24.5 MHz, 400 MHz}
With input clock of 400 MHz this scheme provides the following IPCLK
rate range, for each USI block:
PERIC1 USI*: 1.5 MHz ... 400 MHz
Accounting for internal /4 divider in SPI blocks, and because the max
SPI frequency is limited at 50 MHz, it gives us next SPI SCK rates:
PERIC1 USI_SPI*: 384 KHz ... 49.9 MHz
Which shall be fine for the applications of the SPI bus.
Note that with this we allow the reparenting of the MUX_USIx clocks to
OSCCLK. Each instance of the USI IP has its own MUX_USI clock, thus the
reparenting of a MUX_USI clock corresponds to a single instance of the
USI IP. The datasheet mentions OSCCLK just in the low-power mode
context, but the downstream driver reparents too the MUX_USI clocks to
OSCCLK. Follow the downstream driver and do the same.
Fixes: 2999e78 ("clk: samsung: gs101: add support for cmu_peric1")
Reviewed-by: Peter Griffin <[email protected]>
Acked-by: André Draszik <[email protected]>
Signed-off-by: Tudor Ambarus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>1 parent 7b54d91 commit 7cf0324
1 file changed
+48
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3239 | 3239 | | |
3240 | 3240 | | |
3241 | 3241 | | |
3242 | | - | |
3243 | | - | |
3244 | | - | |
3245 | | - | |
3246 | | - | |
3247 | | - | |
3248 | | - | |
3249 | | - | |
3250 | | - | |
3251 | | - | |
3252 | | - | |
3253 | | - | |
3254 | | - | |
3255 | | - | |
3256 | | - | |
3257 | | - | |
3258 | | - | |
3259 | | - | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
3260 | 3260 | | |
3261 | 3261 | | |
3262 | 3262 | | |
3263 | 3263 | | |
3264 | 3264 | | |
3265 | | - | |
3266 | | - | |
3267 | | - | |
3268 | | - | |
3269 | | - | |
3270 | | - | |
3271 | | - | |
3272 | | - | |
3273 | | - | |
3274 | | - | |
3275 | | - | |
3276 | | - | |
3277 | | - | |
3278 | | - | |
3279 | | - | |
3280 | | - | |
3281 | | - | |
3282 | | - | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
3283 | 3289 | | |
3284 | 3290 | | |
3285 | 3291 | | |
| |||
3314 | 3320 | | |
3315 | 3321 | | |
3316 | 3322 | | |
3317 | | - | |
| 3323 | + | |
3318 | 3324 | | |
3319 | 3325 | | |
3320 | 3326 | | |
3321 | | - | |
| 3327 | + | |
3322 | 3328 | | |
3323 | 3329 | | |
3324 | 3330 | | |
3325 | | - | |
| 3331 | + | |
3326 | 3332 | | |
3327 | 3333 | | |
3328 | 3334 | | |
3329 | | - | |
| 3335 | + | |
3330 | 3336 | | |
3331 | 3337 | | |
3332 | 3338 | | |
3333 | | - | |
| 3339 | + | |
3334 | 3340 | | |
3335 | 3341 | | |
3336 | 3342 | | |
3337 | | - | |
| 3343 | + | |
3338 | 3344 | | |
3339 | 3345 | | |
3340 | 3346 | | |
| |||
0 commit comments