sunxi: driver refresh for 3.13
[openwrt.git] / target / linux / sunxi / patches-3.13 / 181-1-dt-sun4i-add-vbus-reg-dtsi.patch
1 From c3593cc95c240663bd9c191c1029237e467575af Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Fri, 7 Feb 2014 18:08:03 +0100
4 Subject: [PATCH] ARM: sun4i: dt: Add sun4i-a10-usb-vbus-reg dts include file
5
6 Almost all sun4i and sun7i boards have a gpio controlled vbus for usb1 and
7 usb2, using gpio pin PH6 and PH3 as in the reference design. This commit adds
8 an include file for this, avoiding the need to copy and paste the exact same
9 dts code to almost all sun4i and sun7i dts files.
10
11 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
12 ---
13  arch/arm/boot/dts/sun4i-a10-usb-vbus-reg.dtsi | 54 +++++++++++++++++++++++++++
14  1 file changed, 54 insertions(+)
15  create mode 100644 arch/arm/boot/dts/sun4i-a10-usb-vbus-reg.dtsi
16
17 diff --git a/arch/arm/boot/dts/sun4i-a10-usb-vbus-reg.dtsi b/arch/arm/boot/dts/sun4i-a10-usb-vbus-reg.dtsi
18 new file mode 100644
19 index 0000000..803be0c
20 --- /dev/null
21 +++ b/arch/arm/boot/dts/sun4i-a10-usb-vbus-reg.dtsi
22 @@ -0,0 +1,54 @@
23 +/*
24 + * sun4i boards usb vbus supply common code
25 + *
26 + * Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
27 + *
28 + * The code contained herein is licensed under the GNU General Public
29 + * License. You may obtain a copy of the GNU General Public License
30 + * Version 2 or later at the following locations:
31 + *
32 + * http://www.opensource.org/licenses/gpl-license.html
33 + * http://www.gnu.org/copyleft/gpl.html
34 + */
35 +
36 +/ {
37 +       soc@01c00000 {
38 +               pio: pinctrl@01c20800 {
39 +                       usb1_vbus_pin_a: usb1_vbus_pin@0 {
40 +                               allwinner,pins = "PH6";
41 +                               allwinner,function = "gpio_out";
42 +                               allwinner,drive = <0>;
43 +                               allwinner,pull = <0>;
44 +                       };
45 +
46 +                       usb2_vbus_pin_a: usb2_vbus_pin@0 {
47 +                               allwinner,pins = "PH3";
48 +                               allwinner,function = "gpio_out";
49 +                               allwinner,drive = <0>;
50 +                               allwinner,pull = <0>;
51 +                       };
52 +               };
53 +       };
54 +
55 +       reg_usb1_vbus: usb1-vbus {
56 +               compatible = "regulator-fixed";
57 +               pinctrl-names = "default";
58 +               pinctrl-0 = <&usb1_vbus_pin_a>;
59 +               regulator-name = "usb1-vbus";
60 +               regulator-min-microvolt = <5000000>;
61 +               regulator-max-microvolt = <5000000>;
62 +               enable-active-high;
63 +               gpio = <&pio 7 6 0>;
64 +       };
65 +
66 +       reg_usb2_vbus: usb2-vbus {
67 +               compatible = "regulator-fixed";
68 +               pinctrl-names = "default";
69 +               pinctrl-0 = <&usb2_vbus_pin_a>;
70 +               regulator-name = "usb2-vbus";
71 +               regulator-min-microvolt = <5000000>;
72 +               regulator-max-microvolt = <5000000>;
73 +               enable-active-high;
74 +               gpio = <&pio 7 3 0>;
75 +       };
76 +};
77 -- 
78 1.8.5.5
79