1212#include <linux/of_device.h>
1313#include <linux/of_address.h>
1414#include <linux/platform_device.h>
15+ #include <linux/pm_runtime.h>
1516#include <linux/random.h>
1617
1718#include <soc/tegra/fuse.h>
@@ -52,15 +53,13 @@ static u32 tegra30_fuse_read(struct tegra_fuse *fuse, unsigned int offset)
5253 u32 value ;
5354 int err ;
5455
55- err = clk_prepare_enable (fuse -> clk );
56- if (err < 0 ) {
57- dev_err (fuse -> dev , "failed to enable FUSE clock: %d\n" , err );
56+ err = pm_runtime_resume_and_get (fuse -> dev );
57+ if (err )
5858 return 0 ;
59- }
6059
6160 value = readl_relaxed (fuse -> base + FUSE_BEGIN + offset );
6261
63- clk_disable_unprepare (fuse -> clk );
62+ pm_runtime_put (fuse -> dev );
6463
6564 return value ;
6665}
@@ -113,6 +112,7 @@ const struct tegra_fuse_soc tegra30_fuse_soc = {
113112 .speedo_init = tegra30_init_speedo_data ,
114113 .info = & tegra30_fuse_info ,
115114 .soc_attr_group = & tegra_soc_attr_group ,
115+ .clk_suspend_on = false,
116116};
117117#endif
118118
@@ -128,6 +128,7 @@ const struct tegra_fuse_soc tegra114_fuse_soc = {
128128 .speedo_init = tegra114_init_speedo_data ,
129129 .info = & tegra114_fuse_info ,
130130 .soc_attr_group = & tegra_soc_attr_group ,
131+ .clk_suspend_on = false,
131132};
132133#endif
133134
@@ -209,6 +210,7 @@ const struct tegra_fuse_soc tegra124_fuse_soc = {
209210 .lookups = tegra124_fuse_lookups ,
210211 .num_lookups = ARRAY_SIZE (tegra124_fuse_lookups ),
211212 .soc_attr_group = & tegra_soc_attr_group ,
213+ .clk_suspend_on = true,
212214};
213215#endif
214216
@@ -295,6 +297,7 @@ const struct tegra_fuse_soc tegra210_fuse_soc = {
295297 .lookups = tegra210_fuse_lookups ,
296298 .num_lookups = ARRAY_SIZE (tegra210_fuse_lookups ),
297299 .soc_attr_group = & tegra_soc_attr_group ,
300+ .clk_suspend_on = false,
298301};
299302#endif
300303
@@ -325,6 +328,7 @@ const struct tegra_fuse_soc tegra186_fuse_soc = {
325328 .lookups = tegra186_fuse_lookups ,
326329 .num_lookups = ARRAY_SIZE (tegra186_fuse_lookups ),
327330 .soc_attr_group = & tegra_soc_attr_group ,
331+ .clk_suspend_on = false,
328332};
329333#endif
330334
@@ -355,6 +359,7 @@ const struct tegra_fuse_soc tegra194_fuse_soc = {
355359 .lookups = tegra194_fuse_lookups ,
356360 .num_lookups = ARRAY_SIZE (tegra194_fuse_lookups ),
357361 .soc_attr_group = & tegra194_soc_attr_group ,
362+ .clk_suspend_on = false,
358363};
359364#endif
360365
@@ -385,5 +390,6 @@ const struct tegra_fuse_soc tegra234_fuse_soc = {
385390 .lookups = tegra234_fuse_lookups ,
386391 .num_lookups = ARRAY_SIZE (tegra234_fuse_lookups ),
387392 .soc_attr_group = & tegra194_soc_attr_group ,
393+ .clk_suspend_on = false,
388394};
389395#endif
0 commit comments