Commit 53d7848
pwm: sifive: Ensure the clk is enabled exactly once per running PWM
[ Upstream commit ace41d7 ]
.apply() assumes the clk to be for a given PWM iff the PWM is enabled.
So make sure this is the case when .probe() completes. And in .remove()
disable the according number of times.
This fixes a clk enable/disable imbalance, if some PWMs are already running
at probe time.
Fixes: 9e37a53 (pwm: sifive: Add a driver for SiFive SoC PWM)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 5c86cf4 commit 53d7848
1 file changed
Lines changed: 37 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
258 | 287 | | |
259 | 288 | | |
260 | 289 | | |
| |||
277 | 306 | | |
278 | 307 | | |
279 | 308 | | |
280 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
281 | 314 | | |
282 | 315 | | |
283 | 316 | | |
284 | 317 | | |
285 | 318 | | |
286 | 319 | | |
287 | 320 | | |
288 | | - | |
289 | 321 | | |
290 | 322 | | |
291 | 323 | | |
292 | 324 | | |
293 | 325 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 326 | + | |
| 327 | + | |
298 | 328 | | |
299 | | - | |
300 | | - | |
301 | 329 | | |
302 | | - | |
| 330 | + | |
303 | 331 | | |
304 | 332 | | |
305 | 333 | | |
| |||
0 commit comments