regulator: mt6358: Merge VCN33_* regulators
authorChen-Yu Tsai <wenst@chromium.org>
Fri, 9 Jun 2023 08:30:00 +0000 (16:30 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jun 2023 13:25:45 +0000 (14:25 +0100)
commit65bae54e08c109ddbbf121bb00058cf3b3fb7b8e
treec2b4e019ff8135a1a52bf55df1ffcda0d0ab2f78
parent82f305b18eb0505444eab8ac86bfa134b67cb38e
regulator: mt6358: Merge VCN33_* regulators

The VCN33_BT and VCN33_WIFI regulators are actually the same regulator,
having the same voltage setting and output pin. There are simply two
enable bits that are ORed together to enable the regulator.

Having two regulators representing the same output pin is misleading
from a design matching standpoint, and also error-prone in driver
implementations. If consumers try to set different voltages on either
regulator, the one set later would override the one set before. There
are ways around this, such as chaining them together and having the
downstream one act as a switch. But given there's only one output pin,
such a workaround doesn't match reality.

Remove the VCN33_WIFI regulator. During the probe phase, have the driver
sync the enable status of VCN33_WIFI to VCN33_BT. Also drop the suffix
so that the regulator name matches the pin name in the datasheet.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230609083009.2822259-4-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/mt6358-regulator.c
include/linux/regulator/mt6358-regulator.h