[Gta04-owner] power control of devices connected to UART

Dr. H. Nikolaus Schaller hns at goldelico.com
Wed Nov 19 11:16:20 CET 2014

Hi Neil,
I just had an idea and would like to know your opinion before we go to LKML with a solution:

regulators are wide spread in use and “connect” different drivers.

What about adding an optional regulator node “interface-supply” that an uart driver can
control when the tty is opened/closed? Similar to “vmmc-supply”.

More or less the same thing as we do with the DTR gpio, but a regulator. And triggered
through open()/close() instead of DTR state.

Then, the w2sg (or the w2cbw) drivers present themselves as “regulators” and in fact it is their
only purpose to control the power of these chips. We simply model the LDO that is inside these

Form an uart perspective we would replace:

&uart2 { /* GPS /dev/ttyO1 */
	dtr-gpio = <&gps_en 0 GPIO_ACTIVE_HIGH>;	/* w2sg0004 GPS power control through virtual gpio */


&uart2 { /* GPS /dev/ttyO1 */
	interface-supply = <&gps_regulator>;	/* w2sg0004 GPS power regulator control */

And, the interface-supply could also have a very reasonable use case for different boards. Usually there
is aRS232 level shifter connected to the UART pins of the SoC. And that one can also be powered up/down
by some interface-supply regulator.

For UART3 this could control the “powerdown” mode of the TRS3386 by a standard gpio-regulator.

Finally, I think we can’t drop the dtr-gpio.

If you look at page 15, there is GPIO21 which also goes through the TRS3386 to the RS232 connector.
It is usually connected to the DTR line of this interface.

To control it we need (GTA04 only):

&uart3 {
	dtr-gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>;	/* DTR line on external RS232 interface */

And we need the DTR driver patch - independently of the GPS control. So it wasn’t good to drop it
from mainline before discussing in detail.


More information about the Gta04-owner mailing list