Commit 5dd4ff270dc387111f5feb85e4020adf2d60a32f
1 parent
21bb8ec6a9
Exists in
smarc_8mm-imx_v2019.04_4.19.35_1.1.0
and in
1 other branch
MLK-21850-1 dm: device: Check driver flag before setting default clocks
Add a new driver FLAG (DM_FLAG_IGNORE_DEFAULT_CLKS). If any driver is set with this flag, then when probing the device, we will skip setting the default clocks. This is useful when clock driver can't work with some device driver. Signed-off-by: Ye Li <ye.li@nxp.com>
Showing 2 changed files with 9 additions and 3 deletions Side-by-side Diff
drivers/core/device.c
... | ... | @@ -409,10 +409,13 @@ |
409 | 409 | goto fail; |
410 | 410 | } |
411 | 411 | |
412 | + | |
412 | 413 | /* Process 'assigned-{clocks/clock-parents/clock-rates}' properties */ |
413 | - ret = clk_set_defaults(dev); | |
414 | - if (ret) | |
415 | - goto fail; | |
414 | + if (!(dev->driver->flags & DM_FLAG_IGNORE_DEFAULT_CLKS)) { | |
415 | + ret = clk_set_defaults(dev); | |
416 | + if (ret) | |
417 | + goto fail; | |
418 | + } | |
416 | 419 | |
417 | 420 | if (drv->probe) { |
418 | 421 | ret = drv->probe(dev); |
include/dm/device.h
... | ... | @@ -61,6 +61,9 @@ |
61 | 61 | */ |
62 | 62 | #define DM_FLAG_OS_PREPARE (1 << 10) |
63 | 63 | |
64 | +/* DM should ignore the assign default clocks for this driver */ | |
65 | +#define DM_FLAG_IGNORE_DEFAULT_CLKS (1 << 12) | |
66 | + | |
64 | 67 | /* |
65 | 68 | * One or multiple of these flags are passed to device_remove() so that |
66 | 69 | * a selective device removal as specified by the remove-stage and the |
-
mentioned in commit 944d04
-
mentioned in commit 944d04
-
mentioned in commit 944d04
-
mentioned in commit 944d04
-
mentioned in commit 7b5950
-
mentioned in commit 7b5950
-
mentioned in commit 944d04
-
mentioned in commit 7b5950
-
mentioned in commit 7b5950
-
mentioned in commit 7b5950
-
mentioned in commit 7b5950
-
mentioned in commit 54849b