diff mbox

[1/4] ARM: dts: sun5i: Enable otg on the auxtex t004

Message ID 1467226022-10525-1-git-send-email-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede June 29, 2016, 6:46 p.m. UTC
The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case
people use it to power the board instead of the dedicated power micro
usb connector), it does have an id pin, so it allows full otg
functionality.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Maxime Ripard June 29, 2016, 8:38 p.m. UTC | #1
Hi,

On Wed, Jun 29, 2016 at 08:46:59PM +0200, Hans de Goede wrote:
> The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case
> people use it to power the board instead of the dedicated power micro
> usb connector), it does have an id pin, so it allows full otg
> functionality.

I don't really get what you're saying here. Is the VBUS hardcoded to
5V, without any way to switch it, or it is not wired at all?

In the former case, how can one of the PMIC output be related to the
board power input?

Thanks,
Maxime
Hans de Goede June 30, 2016, 9:45 a.m. UTC | #2
Hi,

On 29-06-16 22:38, Maxime Ripard wrote:
> Hi,
>
> On Wed, Jun 29, 2016 at 08:46:59PM +0200, Hans de Goede wrote:
>> The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case
>> people use it to power the board instead of the dedicated power micro
>> usb connector), it does have an id pin, so it allows full otg
>> functionality.
>
> I don't really get what you're saying here. Is the VBUS hardcoded to
> 5V, without any way to switch it, or it is not wired at all?

It is hardwired to 5v, quoting from my commit msg
"has its otg usb vbus hardwired to 5v"

> In the former case, how can one of the PMIC output be related to the
> board power input?

I believe it is not wired to the pmic output, but to the pmic 5v input.

Regards,

Hans
Maxime Ripard July 5, 2016, 6:54 a.m. UTC | #3
On Thu, Jun 30, 2016 at 11:45:00AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 29-06-16 22:38, Maxime Ripard wrote:
> >Hi,
> >
> >On Wed, Jun 29, 2016 at 08:46:59PM +0200, Hans de Goede wrote:
> >>The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case
> >>people use it to power the board instead of the dedicated power micro
> >>usb connector), it does have an id pin, so it allows full otg
> >>functionality.
> >
> >I don't really get what you're saying here. Is the VBUS hardcoded to
> >5V, without any way to switch it, or it is not wired at all?
> 
> It is hardwired to 5v, quoting from my commit msg
> "has its otg usb vbus hardwired to 5v"
> 
> >In the former case, how can one of the PMIC output be related to the
> >board power input?
> 
> I believe it is not wired to the pmic output, but to the pmic 5v input.

Weird. Ok, I just applied it.

Thanks
Maxime
Hans de Goede July 5, 2016, 7:24 a.m. UTC | #4
Hi,

On 05-07-16 08:54, Maxime Ripard wrote:
> On Thu, Jun 30, 2016 at 11:45:00AM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 29-06-16 22:38, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Wed, Jun 29, 2016 at 08:46:59PM +0200, Hans de Goede wrote:
>>>> The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case
>>>> people use it to power the board instead of the dedicated power micro
>>>> usb connector), it does have an id pin, so it allows full otg
>>>> functionality.
>>>
>>> I don't really get what you're saying here. Is the VBUS hardcoded to
>>> 5V, without any way to switch it, or it is not wired at all?
>>
>> It is hardwired to 5v, quoting from my commit msg
>> "has its otg usb vbus hardwired to 5v"
>>
>>> In the former case, how can one of the PMIC output be related to the
>>> board power input?
>>
>> I believe it is not wired to the pmic output, but to the pmic 5v input.
>
> Weird.

This is an a10s based hdmi stick, with a axp152 pmic, which does
not have separate ac-in / vbus-in and the matching ips out and
selection logic. So I guess that when using this pmic boards just
wire all the dcdc vin-s to 5v. As said this hdmi dongle has 2 micro-usb
connectors one for power only and one for otg. I believe that also
want to be able to power the dongle from just the otg (e.g. when
connected to a pc), at which point wiring its 5v to the 5v of
the micro-usb power connector aka THE 5v line is pretty much the
only thing they can do. Note this is all based on observation,
no schematics available.

> Ok, I just applied it.

Thanks.

Regards,

Hans
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts b/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
index e15d1ef..7ddebce 100644
--- a/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
@@ -130,7 +130,18 @@ 
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+		allwinner,pins = "PG12";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
 	mmc0_cd_pin_t004: mmc0_cd_pin@0 {
 		allwinner,pins = "PG1";
 		allwinner,function = "gpio_in";
@@ -164,11 +175,19 @@ 
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
 &usb1_vbus_pin_a {
 	allwinner,pins = "PG13";
 };
 
 &usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
 	usb1_vbus-supply = <&reg_usb1_vbus>;
 	status = "okay";
 };