On 08/08/2017 08:57 PM, Liam Breck wrote:
On Tue, Aug 8, 2017 at 2:00 AM, Hans de Goede <hdego...@redhat.com> wrote:
On 08-08-17 10:39, Liam Breck wrote:
On Sun, Aug 6, 2017 at 5:35 AM, Hans de Goede <hdego...@redhat.com> wrote:
Register the 5V boost converter as a regulator named
"regulator-bq24190-usb-vbus". Note the name includes "bq24190" because
the bq24190 family is also used on ACPI devices where there are no
device-tree phandles, so regulator_get will fallback to the name and thus
it must be unique on the system.
What we're enabling here is 5V boost for otg host mode, not vbus
generally, so maybe the name should indicate that...
I picked vbus because that gets used a lot already in similar cases,
but I agree that we should probably come up with a better name.
I like "regulator-bq24190-usb-otg-5v", shall I use that for v2?
There is this upstream, with "otg-vbus":
I don't think it needs a "regulator-" prefix, and maybe the driver
name is a suffix. We could also recommend the "regulator-name" value
for OTG here:
a. Make the above patch wrong :-)
b. Follow a weak precedent
Looking at dts files under arch/arm/boot/dts the most used name seems to be
usb_otg_vbus (with underscores) so I will use that for v2 of this patch.
As for making the name more specific, as Mark Brown has correctly pointed
out the right thing to do on x86 is to add a mapping for the consumer of the
regulator using regulator_init_data, which can be passed through platform_data
(and I do control the i2c_client instantiation on x86, so adding that is easy),
which means that we can keep the name generic, which is a much better solution
then relying on the name. This means that we can keep the name generic as
one normally does for a regulator-name.