1643ad899SSimon Glass/* 2643ad899SSimon Glass * sunxi boards common regulator (ahci target power supply, usb-vbus) code 3643ad899SSimon Glass * 4643ad899SSimon Glass * Copyright 2014 - Hans de Goede <hdegoede@redhat.com> 5643ad899SSimon Glass * 653ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms 753ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual 853ab4af3SHans de Goede * licensing only applies to this file, and not this project as a 953ab4af3SHans de Goede * whole. 10643ad899SSimon Glass * 1153ab4af3SHans de Goede * a) This file is free software; you can redistribute it and/or 1253ab4af3SHans de Goede * modify it under the terms of the GNU General Public License as 1353ab4af3SHans de Goede * published by the Free Software Foundation; either version 2 of the 1453ab4af3SHans de Goede * License, or (at your option) any later version. 1553ab4af3SHans de Goede * 1653ab4af3SHans de Goede * This file is distributed in the hope that it will be useful, 1753ab4af3SHans de Goede * but WITHOUT ANY WARRANTY; without even the implied warranty of 1853ab4af3SHans de Goede * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1953ab4af3SHans de Goede * GNU General Public License for more details. 2053ab4af3SHans de Goede * 2153ab4af3SHans de Goede * Or, alternatively, 2253ab4af3SHans de Goede * 2353ab4af3SHans de Goede * b) Permission is hereby granted, free of charge, to any person 2453ab4af3SHans de Goede * obtaining a copy of this software and associated documentation 2553ab4af3SHans de Goede * files (the "Software"), to deal in the Software without 2653ab4af3SHans de Goede * restriction, including without limitation the rights to use, 2753ab4af3SHans de Goede * copy, modify, merge, publish, distribute, sublicense, and/or 2853ab4af3SHans de Goede * sell copies of the Software, and to permit persons to whom the 2953ab4af3SHans de Goede * Software is furnished to do so, subject to the following 3053ab4af3SHans de Goede * conditions: 3153ab4af3SHans de Goede * 3253ab4af3SHans de Goede * The above copyright notice and this permission notice shall be 3353ab4af3SHans de Goede * included in all copies or substantial portions of the Software. 3453ab4af3SHans de Goede * 3553ab4af3SHans de Goede * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 3653ab4af3SHans de Goede * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 3753ab4af3SHans de Goede * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 3853ab4af3SHans de Goede * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 3953ab4af3SHans de Goede * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 4053ab4af3SHans de Goede * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 4153ab4af3SHans de Goede * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 4253ab4af3SHans de Goede * OTHER DEALINGS IN THE SOFTWARE. 43643ad899SSimon Glass */ 44643ad899SSimon Glass 4553ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h> 4653ab4af3SHans de Goede#include <dt-bindings/pinctrl/sun4i-a10.h> 4753ab4af3SHans de Goede 4853ab4af3SHans de Goede&pio { 49643ad899SSimon Glass ahci_pwr_pin_a: ahci_pwr_pin@0 { 50643ad899SSimon Glass allwinner,pins = "PB8"; 51643ad899SSimon Glass allwinner,function = "gpio_out"; 5253ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 5353ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 5453ab4af3SHans de Goede }; 5553ab4af3SHans de Goede 5653ab4af3SHans de Goede usb0_vbus_pin_a: usb0_vbus_pin@0 { 5753ab4af3SHans de Goede allwinner,pins = "PB9"; 5853ab4af3SHans de Goede allwinner,function = "gpio_out"; 5953ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 6053ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 61643ad899SSimon Glass }; 62643ad899SSimon Glass 63643ad899SSimon Glass usb1_vbus_pin_a: usb1_vbus_pin@0 { 64643ad899SSimon Glass allwinner,pins = "PH6"; 65643ad899SSimon Glass allwinner,function = "gpio_out"; 6653ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 6753ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 68643ad899SSimon Glass }; 69643ad899SSimon Glass 70643ad899SSimon Glass usb2_vbus_pin_a: usb2_vbus_pin@0 { 71643ad899SSimon Glass allwinner,pins = "PH3"; 72643ad899SSimon Glass allwinner,function = "gpio_out"; 7353ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 7453ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 75643ad899SSimon Glass }; 76643ad899SSimon Glass}; 77643ad899SSimon Glass 7853ab4af3SHans de Goede/ { 79643ad899SSimon Glass reg_ahci_5v: ahci-5v { 80643ad899SSimon Glass compatible = "regulator-fixed"; 81643ad899SSimon Glass pinctrl-names = "default"; 82643ad899SSimon Glass pinctrl-0 = <&ahci_pwr_pin_a>; 83643ad899SSimon Glass regulator-name = "ahci-5v"; 84643ad899SSimon Glass regulator-min-microvolt = <5000000>; 85643ad899SSimon Glass regulator-max-microvolt = <5000000>; 8653ab4af3SHans de Goede regulator-boot-on; 87643ad899SSimon Glass enable-active-high; 8853ab4af3SHans de Goede gpio = <&pio 1 8 GPIO_ACTIVE_HIGH>; 8953ab4af3SHans de Goede status = "disabled"; 9053ab4af3SHans de Goede }; 9153ab4af3SHans de Goede 9253ab4af3SHans de Goede reg_usb0_vbus: usb0-vbus { 9353ab4af3SHans de Goede compatible = "regulator-fixed"; 9453ab4af3SHans de Goede pinctrl-names = "default"; 9553ab4af3SHans de Goede pinctrl-0 = <&usb0_vbus_pin_a>; 9653ab4af3SHans de Goede regulator-name = "usb0-vbus"; 9753ab4af3SHans de Goede regulator-min-microvolt = <5000000>; 9853ab4af3SHans de Goede regulator-max-microvolt = <5000000>; 9953ab4af3SHans de Goede enable-active-high; 10053ab4af3SHans de Goede gpio = <&pio 1 9 GPIO_ACTIVE_HIGH>; 101643ad899SSimon Glass status = "disabled"; 102643ad899SSimon Glass }; 103643ad899SSimon Glass 104643ad899SSimon Glass reg_usb1_vbus: usb1-vbus { 105643ad899SSimon Glass compatible = "regulator-fixed"; 106643ad899SSimon Glass pinctrl-names = "default"; 107643ad899SSimon Glass pinctrl-0 = <&usb1_vbus_pin_a>; 108643ad899SSimon Glass regulator-name = "usb1-vbus"; 109643ad899SSimon Glass regulator-min-microvolt = <5000000>; 110643ad899SSimon Glass regulator-max-microvolt = <5000000>; 111*da52a4a3SHans de Goede regulator-boot-on; 112643ad899SSimon Glass enable-active-high; 11353ab4af3SHans de Goede gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; 114643ad899SSimon Glass status = "disabled"; 115643ad899SSimon Glass }; 116643ad899SSimon Glass 117643ad899SSimon Glass reg_usb2_vbus: usb2-vbus { 118643ad899SSimon Glass compatible = "regulator-fixed"; 119643ad899SSimon Glass pinctrl-names = "default"; 120643ad899SSimon Glass pinctrl-0 = <&usb2_vbus_pin_a>; 121643ad899SSimon Glass regulator-name = "usb2-vbus"; 122643ad899SSimon Glass regulator-min-microvolt = <5000000>; 123643ad899SSimon Glass regulator-max-microvolt = <5000000>; 124*da52a4a3SHans de Goede regulator-boot-on; 125643ad899SSimon Glass enable-active-high; 12653ab4af3SHans de Goede gpio = <&pio 7 3 GPIO_ACTIVE_HIGH>; 127643ad899SSimon Glass status = "disabled"; 128643ad899SSimon Glass }; 129643ad899SSimon Glass 130643ad899SSimon Glass reg_vcc3v0: vcc3v0 { 131643ad899SSimon Glass compatible = "regulator-fixed"; 132643ad899SSimon Glass regulator-name = "vcc3v0"; 133643ad899SSimon Glass regulator-min-microvolt = <3000000>; 134643ad899SSimon Glass regulator-max-microvolt = <3000000>; 135643ad899SSimon Glass }; 136643ad899SSimon Glass 137643ad899SSimon Glass reg_vcc3v3: vcc3v3 { 138643ad899SSimon Glass compatible = "regulator-fixed"; 139643ad899SSimon Glass regulator-name = "vcc3v3"; 140643ad899SSimon Glass regulator-min-microvolt = <3300000>; 141643ad899SSimon Glass regulator-max-microvolt = <3300000>; 142643ad899SSimon Glass }; 14353ab4af3SHans de Goede 14453ab4af3SHans de Goede reg_vcc5v0: vcc5v0 { 14553ab4af3SHans de Goede compatible = "regulator-fixed"; 14653ab4af3SHans de Goede regulator-name = "vcc5v0"; 14753ab4af3SHans de Goede regulator-min-microvolt = <5000000>; 14853ab4af3SHans de Goede regulator-max-microvolt = <5000000>; 14953ab4af3SHans de Goede }; 150643ad899SSimon Glass}; 151