soc: mediatek: mtk-svs: Subtract offset from regs_v2 to avoid conflict
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 21 Nov 2023 12:50:26 +0000 (13:50 +0100)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 11 Dec 2023 10:36:12 +0000 (11:36 +0100)
commit40d59dc92e6fa5ef9a140d1de6977e733afb3fc0
tree072b7ad06f9677a0424aea7f8751ae8725d3e88d
parent27222a779d0404d6faab8aeaf028db4ac4de9b1f
soc: mediatek: mtk-svs: Subtract offset from regs_v2 to avoid conflict

The svs_regs_v2 array of registers was offsetted by 0xc00 because the
SVS node was supposed to have the same iostart as the thermal sensors.
That's wrong for two reasons:
 1. Two different devices cannot have the same iostart in devicetree,
    as those would technically be the same device otherwise; and
 2. SVS and Thermal Sensor (be it LVTS or AUXADC thermal) are not the
    same IP, and those two do obviously have a different iospace.

Even though there already are users of this register array, the only
one that declares a devicetree node for SVS is MT8183 - but it never
actually worked because the "tzts1" thermal zone missed thermal trips,
hence this driver's probe always failed on that SoC.

Knowing this - it is safe to say that keeping compatibility with older
device trees is pointless, hence simply subtract the 0xc00 offset from
the register offset array.

Link: https://lore.kernel.org/r/20231121125044.78642-3-angelogioacchino.delregno@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drivers/soc/mediatek/mtk-svs.c