Skip to content

Commit 1724ae8

Browse files
DhruvaG2000vireshk
authored andcommitted
cpufreq: ti-cpufreq: Allow backward compatibility for efuse syscon
The AM625 syscon for efuse was being taken earlier from the wkup_conf node where the entire wkup_conf was marked as "syscon". This is wrong and will be fixed in the devicetree. However, whenever that does happen will end up breaking this driver for that device because of the change in efuse offset. Hence, to avoid breaking any sort of backward compatibility of devicetrees use a quirk to distinguish and accordingly use 0x0 offset for the new syscon node. Suggested-by: Nishanth Menon <[email protected]> Signed-off-by: Dhruva Gole <[email protected]> Reviewed-by: Nishanth Menon <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent ea1829d commit 1724ae8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/cpufreq/ti-cpufreq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ struct ti_cpufreq_soc_data {
9393
bool multi_regulator;
9494
/* Backward compatibility hack: Might have missing syscon */
9595
#define TI_QUIRK_SYSCON_MAY_BE_MISSING 0x1
96+
/* Backward compatibility hack: new syscon size is 1 register wide */
97+
#define TI_QUIRK_SYSCON_IS_SINGLE_REG 0x2
9698
u8 quirks;
9799
};
98100

@@ -318,6 +320,7 @@ static struct ti_cpufreq_soc_data am625_soc_data = {
318320
.efuse_shift = 0x6,
319321
.rev_offset = 0x0014,
320322
.multi_regulator = false,
323+
.quirks = TI_QUIRK_SYSCON_IS_SINGLE_REG,
321324
};
322325

323326
static struct ti_cpufreq_soc_data am62a7_soc_data = {
@@ -354,6 +357,10 @@ static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data,
354357

355358
ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset,
356359
&efuse);
360+
361+
if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_IS_SINGLE_REG && ret == -EIO)
362+
ret = regmap_read(opp_data->syscon, 0x0, &efuse);
363+
357364
if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) {
358365
/* not a syscon register! */
359366
void __iomem *regs = ioremap(OMAP3_SYSCON_BASE +

0 commit comments

Comments
 (0)