Re: [Regulator] Request for clarification - GPIO controlled regulator, USB VBUS,

From: Åukasz Majewski
Date: Wed Oct 04 2017 - 07:02:41 EST


Hi Mark,

Thank you for your reply.

On Tue, Oct 03, 2017 at 06:58:00PM +0200, Åukasz Majewski wrote:

Have I overlooked something? Maybe there is any other mainline code, which I
could reuse?

No, we don't support randomly toggling power for devices without their
cooperation - it's not generally going to end well. The reason it's
difficult to do this is that it's a bad idea.

I do understand the rationale. No issues with this.

Perhaps this is something
that could be implemented generically for USB as it's a hotpluggable bus

In this case we use VBUS as a power supply voltage. The problem with regulator API used in this case is that we enable it on boot-up, but then we cannot "symulate hotplug" anymore.

but I'm not convinced.


Maybe, I can look into USB driver and see if the VBUS is manageable from there (so I could add some sysfs entry to control it if needed).


--
Best regards.

Åukasz Majewski