Skip to content

Commit 59c6fce

Browse files
digetxthierryreding
authored andcommitted
soc/tegra: fuse: Enable fuse clock on suspend for Tegra124
The FUSE clock should be enabled during suspend on Tegra124. Currently clk driver enables it on all SoCs, but FUSE may require a higher core voltage on Tegra30 while enabled. Move the quirk into the FUSE driver and make it specific to Tegra124. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 24a1525 commit 59c6fce

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

drivers/soc/tegra/fuse/fuse-tegra.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,38 @@ static int __maybe_unused tegra_fuse_runtime_suspend(struct device *dev)
275275
return 0;
276276
}
277277

278+
static int __maybe_unused tegra_fuse_suspend(struct device *dev)
279+
{
280+
int ret;
281+
282+
/*
283+
* Critical for RAM re-repair operation, which must occur on resume
284+
* from LP1 system suspend and as part of CCPLEX cluster switching.
285+
*/
286+
if (fuse->soc->clk_suspend_on)
287+
ret = pm_runtime_resume_and_get(dev);
288+
else
289+
ret = pm_runtime_force_suspend(dev);
290+
291+
return ret;
292+
}
293+
294+
static int __maybe_unused tegra_fuse_resume(struct device *dev)
295+
{
296+
int ret = 0;
297+
298+
if (fuse->soc->clk_suspend_on)
299+
pm_runtime_put(dev);
300+
else
301+
ret = pm_runtime_force_resume(dev);
302+
303+
return ret;
304+
}
305+
278306
static const struct dev_pm_ops tegra_fuse_pm = {
279307
SET_RUNTIME_PM_OPS(tegra_fuse_runtime_suspend, tegra_fuse_runtime_resume,
280308
NULL)
309+
SET_SYSTEM_SLEEP_PM_OPS(tegra_fuse_suspend, tegra_fuse_resume)
281310
};
282311

283312
static struct platform_driver tegra_fuse_driver = {

drivers/soc/tegra/fuse/fuse-tegra20.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,5 @@ const struct tegra_fuse_soc tegra20_fuse_soc = {
167167
.probe = tegra20_fuse_probe,
168168
.info = &tegra20_fuse_info,
169169
.soc_attr_group = &tegra_soc_attr_group,
170+
.clk_suspend_on = false,
170171
};

drivers/soc/tegra/fuse/fuse-tegra30.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ const struct tegra_fuse_soc tegra30_fuse_soc = {
112112
.speedo_init = tegra30_init_speedo_data,
113113
.info = &tegra30_fuse_info,
114114
.soc_attr_group = &tegra_soc_attr_group,
115+
.clk_suspend_on = false,
115116
};
116117
#endif
117118

@@ -127,6 +128,7 @@ const struct tegra_fuse_soc tegra114_fuse_soc = {
127128
.speedo_init = tegra114_init_speedo_data,
128129
.info = &tegra114_fuse_info,
129130
.soc_attr_group = &tegra_soc_attr_group,
131+
.clk_suspend_on = false,
130132
};
131133
#endif
132134

@@ -208,6 +210,7 @@ const struct tegra_fuse_soc tegra124_fuse_soc = {
208210
.lookups = tegra124_fuse_lookups,
209211
.num_lookups = ARRAY_SIZE(tegra124_fuse_lookups),
210212
.soc_attr_group = &tegra_soc_attr_group,
213+
.clk_suspend_on = true,
211214
};
212215
#endif
213216

@@ -294,6 +297,7 @@ const struct tegra_fuse_soc tegra210_fuse_soc = {
294297
.lookups = tegra210_fuse_lookups,
295298
.num_lookups = ARRAY_SIZE(tegra210_fuse_lookups),
296299
.soc_attr_group = &tegra_soc_attr_group,
300+
.clk_suspend_on = false,
297301
};
298302
#endif
299303

@@ -324,6 +328,7 @@ const struct tegra_fuse_soc tegra186_fuse_soc = {
324328
.lookups = tegra186_fuse_lookups,
325329
.num_lookups = ARRAY_SIZE(tegra186_fuse_lookups),
326330
.soc_attr_group = &tegra_soc_attr_group,
331+
.clk_suspend_on = false,
327332
};
328333
#endif
329334

@@ -354,6 +359,7 @@ const struct tegra_fuse_soc tegra194_fuse_soc = {
354359
.lookups = tegra194_fuse_lookups,
355360
.num_lookups = ARRAY_SIZE(tegra194_fuse_lookups),
356361
.soc_attr_group = &tegra194_soc_attr_group,
362+
.clk_suspend_on = false,
357363
};
358364
#endif
359365

@@ -384,5 +390,6 @@ const struct tegra_fuse_soc tegra234_fuse_soc = {
384390
.lookups = tegra234_fuse_lookups,
385391
.num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),
386392
.soc_attr_group = &tegra194_soc_attr_group,
393+
.clk_suspend_on = false,
387394
};
388395
#endif

drivers/soc/tegra/fuse/fuse.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ struct tegra_fuse_soc {
3434
unsigned int num_lookups;
3535

3636
const struct attribute_group *soc_attr_group;
37+
38+
bool clk_suspend_on;
3739
};
3840

3941
struct tegra_fuse {

0 commit comments

Comments
 (0)