0001 /*
0002 * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
0003 *
0004 * This file is dual-licensed: you can use it either under the terms
0005 * of the GPL or the X11 license, at your option. Note that this dual
0006 * licensing only applies to this file, and not this project as a
0007 * whole.
0008 *
0009 * a) This file is free software; you can redistribute it and/or
0010 * modify it under the terms of the GNU General Public License as
0011 * published by the Free Software Foundation; either version 2 of the
0012 * License, or (at your option) any later version.
0013 *
0014 * This file is distributed in the hope that it will be useful,
0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 * GNU General Public License for more details.
0018 *
0019 * Or, alternatively,
0020 *
0021 * b) Permission is hereby granted, free of charge, to any person
0022 * obtaining a copy of this software and associated documentation
0023 * files (the "Software"), to deal in the Software without
0024 * restriction, including without limitation the rights to use,
0025 * copy, modify, merge, publish, distribute, sublicense, and/or
0026 * sell copies of the Software, and to permit persons to whom the
0027 * Software is furnished to do so, subject to the following
0028 * conditions:
0029 *
0030 * The above copyright notice and this permission notice shall be
0031 * included in all copies or substantial portions of the Software.
0032 *
0033 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0034 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0035 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0036 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0037 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0038 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0039 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0040 * OTHER DEALINGS IN THE SOFTWARE.
0041 */
0042 #include "sunxi-reference-design-tablet.dtsi"
0043
0044 #include <dt-bindings/pwm/pwm.h>
0045
0046 / {
0047 aliases {
0048 serial0 = &r_uart;
0049 };
0050
0051 backlight: backlight {
0052 compatible = "pwm-backlight";
0053 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
0054 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
0055 default-brightness-level = <8>;
0056 enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
0057 power-supply = <®_dc1sw>;
0058 };
0059
0060 chosen {
0061 stdout-path = "serial0:115200n8";
0062 };
0063 };
0064
0065 &i2c0 {
0066 /*
0067 * The gsl1680 is rated at 400KHz and it will not work reliable at
0068 * 100KHz, this has been confirmed on multiple different q8 tablets.
0069 * The gsl1680 is the only device on this bus.
0070 */
0071 clock-frequency = <400000>;
0072
0073 touchscreen: touchscreen@40 {
0074 reg = <0x40>;
0075 interrupt-parent = <&pio>;
0076 interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5 */
0077 power-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
0078 /* Tablet dts must provide reg and compatible */
0079 status = "disabled";
0080 };
0081 };
0082
0083 &mmc0 {
0084 vmmc-supply = <®_dcdc1>;
0085 bus-width = <4>;
0086 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
0087 status = "okay";
0088 };
0089
0090 &r_rsb {
0091 status = "okay";
0092
0093 axp22x: pmic@3a3 {
0094 compatible = "x-powers,axp223";
0095 reg = <0x3a3>;
0096 interrupt-parent = <&r_intc>;
0097 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0098 eldoin-supply = <®_dcdc1>;
0099 drivevbus-supply = <®_vcc5v0>;
0100 x-powers,drive-vbus-en;
0101 };
0102 };
0103
0104 #include "axp223.dtsi"
0105
0106 &ac_power_supply {
0107 status = "okay";
0108 };
0109
0110 &battery_power_supply {
0111 status = "okay";
0112 };
0113
0114 ®_aldo1 {
0115 regulator-always-on;
0116 regulator-min-microvolt = <3000000>;
0117 regulator-max-microvolt = <3000000>;
0118 regulator-name = "vcc-io";
0119 };
0120
0121 ®_aldo2 {
0122 regulator-always-on;
0123 regulator-min-microvolt = <2350000>;
0124 regulator-max-microvolt = <2650000>;
0125 regulator-name = "vdd-dll";
0126 };
0127
0128 ®_aldo3 {
0129 regulator-always-on;
0130 regulator-min-microvolt = <2700000>;
0131 regulator-max-microvolt = <3300000>;
0132 regulator-name = "vcc-pll-avcc";
0133 };
0134
0135 ®_dc1sw {
0136 regulator-name = "vcc-lcd";
0137 };
0138
0139 ®_dc5ldo {
0140 regulator-always-on;
0141 regulator-min-microvolt = <900000>;
0142 regulator-max-microvolt = <1400000>;
0143 regulator-name = "vdd-cpus";
0144 };
0145
0146 ®_dcdc1 {
0147 regulator-always-on;
0148 regulator-min-microvolt = <3000000>;
0149 regulator-max-microvolt = <3000000>;
0150 regulator-name = "vcc-3v0";
0151 };
0152
0153 ®_dcdc2 {
0154 regulator-always-on;
0155 regulator-min-microvolt = <900000>;
0156 regulator-max-microvolt = <1400000>;
0157 regulator-name = "vdd-sys";
0158 };
0159
0160 ®_dcdc3 {
0161 regulator-always-on;
0162 regulator-min-microvolt = <900000>;
0163 regulator-max-microvolt = <1400000>;
0164 regulator-name = "vdd-cpu";
0165 };
0166
0167 ®_dcdc5 {
0168 regulator-always-on;
0169 regulator-min-microvolt = <1500000>;
0170 regulator-max-microvolt = <1500000>;
0171 regulator-name = "vcc-dram";
0172 };
0173
0174 ®_dldo1 {
0175 regulator-min-microvolt = <3300000>;
0176 regulator-max-microvolt = <3300000>;
0177 regulator-name = "vcc-wifi";
0178 };
0179
0180 ®_drivevbus {
0181 regulator-name = "usb0-vbus";
0182 status = "okay";
0183 };
0184
0185 ®_ldo_io1 {
0186 regulator-min-microvolt = <3300000>;
0187 regulator-max-microvolt = <3300000>;
0188 regulator-name = "vcc-touchscreen";
0189 status = "okay";
0190 };
0191
0192 ®_rtc_ldo {
0193 regulator-name = "vcc-rtc";
0194 };
0195
0196 &cpu0 {
0197 cpu-supply = <®_dcdc2>;
0198 };
0199
0200 &r_uart {
0201 pinctrl-names = "default";
0202 pinctrl-0 = <&r_uart_pins_a>;
0203 status = "okay";
0204 };
0205
0206 &simplefb_lcd {
0207 vcc-lcd-supply = <®_dc1sw>;
0208 };
0209
0210 &usb_otg {
0211 dr_mode = "otg";
0212 status = "okay";
0213 };
0214
0215 &usb_power_supply {
0216 status = "okay";
0217 };
0218
0219 &usbphy {
0220 usb0_id_det-gpios = <&pio 7 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH8 */
0221 usb0_vbus_power-supply = <&usb_power_supply>;
0222 usb0_vbus-supply = <®_drivevbus>;
0223 status = "okay";
0224 };