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/interrupt-controller/irq.h>
0045 #include <dt-bindings/pwm/pwm.h>
0046
0047 / {
0048 aliases {
0049 serial0 = &uart1;
0050 };
0051
0052 backlight: backlight {
0053 compatible = "pwm-backlight";
0054 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
0055 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
0056 default-brightness-level = <8>;
0057 enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>; /* AXP GPIO1 */
0058 power-supply = <®_vcc3v0>;
0059 };
0060
0061 chosen {
0062 stdout-path = "serial0:115200n8";
0063 };
0064 };
0065
0066 &codec {
0067 allwinner,pa-gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
0068 status = "okay";
0069 };
0070
0071 &cpu0 {
0072 cpu-supply = <®_dcdc2>;
0073 };
0074
0075 &ehci0 {
0076 status = "okay";
0077 };
0078
0079 &i2c0 {
0080 axp209: pmic@34 {
0081 reg = <0x34>;
0082 interrupts = <0>;
0083 };
0084 };
0085
0086 &i2c1 {
0087 /*
0088 * The gsl1680 is rated at 400KHz and it will not work reliable at
0089 * 100KHz, this has been confirmed on multiple different q8 tablets.
0090 * All other devices on this bus are also rated for 400KHz.
0091 */
0092 clock-frequency = <400000>;
0093
0094 touchscreen: touchscreen@40 {
0095 reg = <0x40>;
0096 interrupt-parent = <&pio>;
0097 interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; /* EINT11 (PG11) */
0098 power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
0099 /* Tablet dts must provide reg and compatible */
0100 status = "disabled";
0101 };
0102
0103 pcf8563: rtc@51 {
0104 compatible = "nxp,pcf8563";
0105 reg = <0x51>;
0106 };
0107 };
0108
0109 #include "axp209.dtsi"
0110
0111 &ac_power_supply {
0112 status = "okay";
0113 };
0114
0115 &battery_power_supply {
0116 status = "okay";
0117 };
0118
0119 &lradc {
0120 vref-supply = <®_ldo2>;
0121 };
0122
0123 &mmc0 {
0124 pinctrl-names = "default";
0125 pinctrl-0 = <&mmc0_pins>;
0126 vmmc-supply = <®_vcc3v0>;
0127 bus-width = <4>;
0128 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
0129 status = "okay";
0130 };
0131
0132 &otg_sram {
0133 status = "okay";
0134 };
0135
0136 ®_dcdc2 {
0137 regulator-always-on;
0138 regulator-min-microvolt = <1000000>;
0139 regulator-max-microvolt = <1500000>;
0140 regulator-name = "vdd-cpu";
0141 };
0142
0143 ®_dcdc3 {
0144 regulator-always-on;
0145 regulator-min-microvolt = <1000000>;
0146 regulator-max-microvolt = <1400000>;
0147 regulator-name = "vdd-int-pll";
0148 };
0149
0150 ®_ldo1 {
0151 regulator-name = "vdd-rtc";
0152 };
0153
0154 ®_ldo2 {
0155 regulator-always-on;
0156 regulator-min-microvolt = <3000000>;
0157 regulator-max-microvolt = <3000000>;
0158 regulator-name = "avcc";
0159 };
0160
0161 ®_ldo3 {
0162 regulator-min-microvolt = <3300000>;
0163 regulator-max-microvolt = <3300000>;
0164 regulator-name = "vcc-wifi";
0165 };
0166
0167 ®_usb0_vbus {
0168 gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
0169 status = "okay";
0170 };
0171
0172 &uart1 {
0173 pinctrl-names = "default";
0174 pinctrl-0 = <&uart1_pg_pins>;
0175 status = "okay";
0176 };
0177
0178 &usb_otg {
0179 dr_mode = "otg";
0180 status = "okay";
0181 };
0182
0183 &usb_power_supply {
0184 status = "okay";
0185 };
0186
0187 &usbphy {
0188 usb0_id_det-gpios = <&pio 6 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PG2 */
0189 usb0_vbus_det-gpios = <&pio 6 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PG1 */
0190 usb0_vbus_power-supply = <&usb_power_supply>;
0191 usb0_vbus-supply = <®_usb0_vbus>;
0192 usb1_vbus-supply = <®_ldo3>;
0193 status = "okay";
0194 };