Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2017 Touchless Biometric Systems AG
0003  * Tomas Novotny <tomas@novotny.cz>
0004  *
0005  * This file is dual-licensed: you can use it either under the terms
0006  * of the GPL or the X11 license, at your option. Note that this dual
0007  * licensing only applies to this file, and not this project as a
0008  * whole.
0009  *
0010  *  a) This file is free software; you can redistribute it and/or
0011  *     modify it under the terms of the GNU General Public License as
0012  *     published by the Free Software Foundation; either version 2 of the
0013  *     License, or (at your option) any later version.
0014  *
0015  *     This file is distributed in the hope that it will be useful,
0016  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0018  *     GNU General Public License for more details.
0019  *
0020  * Or, alternatively,
0021  *
0022  *  b) Permission is hereby granted, free of charge, to any person
0023  *     obtaining a copy of this software and associated documentation
0024  *     files (the "Software"), to deal in the Software without
0025  *     restriction, including without limitation the rights to use,
0026  *     copy, modify, merge, publish, distribute, sublicense, and/or
0027  *     sell copies of the Software, and to permit persons to whom the
0028  *     Software is furnished to do so, subject to the following
0029  *     conditions:
0030  *
0031  *     The above copyright notice and this permission notice shall be
0032  *     included in all copies or substantial portions of the Software.
0033  *
0034  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0035  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0036  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0037  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0038  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0039  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0040  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0041  *     OTHER DEALINGS IN THE SOFTWARE.
0042  */
0043 
0044 /dts-v1/;
0045 #include "sun8i-a83t.dtsi"
0046 
0047 #include <dt-bindings/gpio/gpio.h>
0048 #include <dt-bindings/pwm/pwm.h>
0049 #include <dt-bindings/input/input.h>
0050 
0051 / {
0052         model = "TBS A711 Tablet";
0053         compatible = "tbs-biometrics,a711", "allwinner,sun8i-a83t";
0054 
0055         aliases {
0056                 serial0 = &uart0;
0057                 serial1 = &uart1;
0058         };
0059 
0060         chosen {
0061                 stdout-path = "serial0:115200n8";
0062         };
0063 
0064         backlight: backlight {
0065                 compatible = "pwm-backlight";
0066                 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
0067                 enable-gpios = <&pio 3 29 GPIO_ACTIVE_HIGH>;
0068                 power-supply = <&reg_sw>;
0069                 brightness-levels = <0 1 2 4 8 16 32 64 128 255>;
0070                 default-brightness-level = <9>;
0071         };
0072 
0073         panel {
0074                 compatible = "tbs,a711-panel", "panel-lvds";
0075                 backlight = <&backlight>;
0076                 power-supply = <&reg_sw>;
0077 
0078                 width-mm = <153>;
0079                 height-mm = <90>;
0080                 data-mapping = "vesa-24";
0081 
0082                 panel-timing {
0083                         /* 1024x600 @60Hz */
0084                         clock-frequency = <52000000>;
0085                         hactive = <1024>;
0086                         vactive = <600>;
0087                         hsync-len = <20>;
0088                         hfront-porch = <180>;
0089                         hback-porch = <160>;
0090                         vfront-porch = <12>;
0091                         vback-porch = <23>;
0092                         vsync-len = <5>;
0093                 };
0094 
0095                 port {
0096                         panel_input: endpoint {
0097                                 remote-endpoint = <&tcon0_out_lcd>;
0098                         };
0099                 };
0100         };
0101 
0102         reg_gps: reg-gps {
0103                 compatible = "regulator-fixed";
0104                 regulator-name = "gps";
0105                 regulator-min-microvolt = <3000000>;
0106                 regulator-max-microvolt = <3000000>;
0107         };
0108 
0109         reg_vbat: reg-vbat {
0110                 compatible = "regulator-fixed";
0111                 regulator-name = "vbat";
0112                 regulator-min-microvolt = <3700000>;
0113                 regulator-max-microvolt = <3700000>;
0114         };
0115 
0116         reg_vmain: reg-vmain {
0117                 compatible = "regulator-fixed";
0118                 regulator-name = "vmain";
0119                 regulator-min-microvolt = <5000000>;
0120                 regulator-max-microvolt = <5000000>;
0121                 gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>;
0122                 enable-active-high;
0123                 vin-supply = <&reg_vbat>;
0124         };
0125 
0126         wifi_pwrseq: wifi_pwrseq {
0127                 compatible = "mmc-pwrseq-simple";
0128                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
0129 
0130                 /*
0131                  * This is actually Bluetooth's clock, but we have to
0132                  * hook it up somewheere
0133                  */
0134                 clocks = <&ac100_rtc 1>;
0135                 clock-names = "ext_clock";
0136         };
0137 };
0138 
0139 &cpu0 {
0140         cpu-supply = <&reg_dcdc2>;
0141 };
0142 
0143 &cpu100 {
0144         cpu-supply = <&reg_dcdc3>;
0145 };
0146 
0147 &de {
0148         status = "okay";
0149 };
0150 
0151 /*
0152  * An USB-2 hub is connected here, which also means we don't need to
0153  * enable the OHCI controller.
0154  */
0155 &ehci0 {
0156         status = "okay";
0157 };
0158 
0159 /*
0160  * There's a modem connected here that needs to be initialised before
0161  * being able to be enumerated.
0162  */
0163 &ehci1 {
0164         status = "okay";
0165 };
0166 
0167 &i2c0 {
0168         clock-frequency = <400000>;
0169         status = "okay";
0170 
0171         touchscreen@38 {
0172                 compatible = "edt,edt-ft5206";
0173                 reg = <0x38>;
0174                 interrupt-parent = <&r_pio>;
0175                 interrupts = <0 7 IRQ_TYPE_EDGE_FALLING>; /* PL7 */
0176                 reset-gpios = <&pio 3 5 GPIO_ACTIVE_LOW>; /* PD5 */
0177                 vcc-supply = <&reg_ldo_io0>;
0178                 touchscreen-size-x = <1024>;
0179                 touchscreen-size-y = <600>;
0180         };
0181 };
0182 
0183 &i2c1 {
0184         clock-frequency = <400000>;
0185         status = "okay";
0186 
0187         accelerometer@18 {
0188                 compatible = "bosch,bma250";
0189                 reg = <0x18>;
0190                 interrupt-parent = <&pio>;
0191                 interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
0192         };
0193 };
0194 
0195 &mmc0 {
0196         vmmc-supply = <&reg_dcdc1>;
0197         pinctrl-names = "default";
0198         pinctrl-0 = <&mmc0_pins>;
0199         bus-width = <4>;
0200         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
0201         status = "okay";
0202 };
0203 
0204 &mmc1 {
0205         mmc-pwrseq = <&wifi_pwrseq>;
0206         bus-width = <4>;
0207         vmmc-supply = <&reg_dldo1>;
0208         vqmmc-supply = <&reg_dldo1>;
0209         non-removable;
0210         wakeup-source;
0211         keep-power-in-suspend;
0212         status = "okay";
0213 
0214         brcmf: wifi@1 {
0215                 reg = <1>;
0216                 compatible = "brcm,bcm4329-fmac";
0217                 interrupt-parent = <&r_pio>;
0218                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 WL_WAKE_UP */
0219                 interrupt-names = "host-wake";
0220         };
0221 };
0222 
0223 &mmc2 {
0224         pinctrl-0 = <&mmc2_8bit_emmc_pins>;
0225         pinctrl-names = "default";
0226         vmmc-supply = <&reg_dcdc1>;
0227         vqmmc-supply = <&reg_dcdc1>;
0228         bus-width = <8>;
0229         non-removable;
0230         cap-mmc-hw-reset;
0231         status = "okay";
0232 };
0233 
0234 &pwm {
0235         pinctrl-names = "default";
0236         pinctrl-0 = <&pwm_pin>;
0237         status = "okay";
0238 };
0239 
0240 &r_lradc {
0241         vref-supply = <&reg_aldo2>;
0242         status = "okay";
0243 
0244         button-210 {
0245                 label = "Volume Up";
0246                 linux,code = <KEY_VOLUMEUP>;
0247                 channel = <0>;
0248                 voltage = <210000>;
0249         };
0250 
0251         button-410 {
0252                 label = "Volume Down";
0253                 linux,code = <KEY_VOLUMEDOWN>;
0254                 channel = <0>;
0255                 voltage = <410000>;
0256         };
0257 };
0258 
0259 &r_rsb {
0260         status = "okay";
0261 
0262         axp81x: pmic@3a3 {
0263                 compatible = "x-powers,axp813";
0264                 reg = <0x3a3>;
0265                 interrupt-parent = <&r_intc>;
0266                 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0267                 swin-supply = <&reg_dcdc1>;
0268                 x-powers,drive-vbus-en;
0269         };
0270 
0271         ac100: codec@e89 {
0272                 compatible = "x-powers,ac100";
0273                 reg = <0xe89>;
0274 
0275                 ac100_codec: codec {
0276                         compatible = "x-powers,ac100-codec";
0277                         interrupt-parent = <&r_pio>;
0278                         interrupts = <0 12 IRQ_TYPE_LEVEL_LOW>; /* PL12 */
0279                         #clock-cells = <0>;
0280                         clock-output-names = "4M_adda";
0281                 };
0282 
0283                 ac100_rtc: rtc {
0284                         compatible = "x-powers,ac100-rtc";
0285                         interrupt-parent = <&r_intc>;
0286                         interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0287                         clocks = <&ac100_codec>;
0288                         #clock-cells = <1>;
0289                         clock-output-names = "cko1_rtc",
0290                                              "cko2_rtc",
0291                                              "cko3_rtc";
0292                 };
0293         };
0294 
0295 };
0296 
0297 #include "axp81x.dtsi"
0298 
0299 &battery_power_supply {
0300         status = "okay";
0301 };
0302 
0303 &reg_aldo1 {
0304         regulator-min-microvolt = <1800000>;
0305         regulator-max-microvolt = <1800000>;
0306         regulator-name = "vcc-1.8";
0307 };
0308 
0309 &reg_aldo2 {
0310         regulator-min-microvolt = <1800000>;
0311         regulator-max-microvolt = <1800000>;
0312         regulator-always-on;
0313         regulator-name = "vdd-drampll";
0314 };
0315 
0316 &reg_aldo3 {
0317         regulator-min-microvolt = <3000000>;
0318         regulator-max-microvolt = <3000000>;
0319         regulator-always-on;
0320         regulator-name = "avcc";
0321 };
0322 
0323 &reg_dcdc1 {
0324         regulator-min-microvolt = <3100000>;
0325         regulator-max-microvolt = <3100000>;
0326         regulator-always-on;
0327         regulator-name = "vcc-io";
0328 };
0329 
0330 &reg_dcdc2 {
0331         regulator-min-microvolt = <700000>;
0332         regulator-max-microvolt = <1100000>;
0333         regulator-always-on;
0334         regulator-name = "vdd-cpu-A";
0335 };
0336 
0337 &reg_dcdc3 {
0338         regulator-min-microvolt = <700000>;
0339         regulator-max-microvolt = <1100000>;
0340         regulator-always-on;
0341         regulator-name = "vdd-cpu-B";
0342 };
0343 
0344 &reg_dcdc4 {
0345         regulator-min-microvolt = <700000>;
0346         regulator-max-microvolt = <1100000>;
0347         regulator-name = "vdd-gpu";
0348 };
0349 
0350 &reg_dcdc5 {
0351         regulator-min-microvolt = <1200000>;
0352         regulator-max-microvolt = <1500000>;
0353         regulator-always-on;
0354         regulator-name = "vcc-dram";
0355 };
0356 
0357 &reg_dcdc6 {
0358         regulator-min-microvolt = <900000>;
0359         regulator-max-microvolt = <900000>;
0360         regulator-always-on;
0361         regulator-name = "vdd-sys";
0362 };
0363 
0364 &reg_dldo1 {
0365         regulator-min-microvolt = <3100000>;
0366         regulator-max-microvolt = <3100000>;
0367         regulator-name = "vcc-wifi-io";
0368 };
0369 
0370 &reg_dldo2 {
0371         regulator-min-microvolt = <2800000>;
0372         regulator-max-microvolt = <4200000>;
0373         regulator-name = "vcc-mipi";
0374 };
0375 
0376 &reg_dldo3 {
0377         regulator-min-microvolt = <1800000>;
0378         regulator-max-microvolt = <1800000>;
0379         regulator-name = "vdd-csi";
0380 };
0381 
0382 &reg_dldo4 {
0383         regulator-min-microvolt = <2800000>;
0384         regulator-max-microvolt = <2800000>;
0385         regulator-name = "avdd-csi";
0386 };
0387 
0388 &reg_drivevbus {
0389         regulator-name = "usb0-vbus";
0390         status = "okay";
0391 };
0392 
0393 &reg_eldo1 {
0394         regulator-min-microvolt = <1200000>;
0395         regulator-max-microvolt = <1800000>;
0396         regulator-name = "dvdd-csi-r";
0397 };
0398 
0399 &reg_eldo2 {
0400         regulator-min-microvolt = <1800000>;
0401         regulator-max-microvolt = <1800000>;
0402         regulator-name = "vcc-dsi";
0403 };
0404 
0405 &reg_eldo3 {
0406         regulator-min-microvolt = <1200000>;
0407         regulator-max-microvolt = <1800000>;
0408         regulator-name = "dvdd-csi-f";
0409 };
0410 
0411 &reg_fldo1 {
0412         regulator-min-microvolt = <1200000>;
0413         regulator-max-microvolt = <1200000>;
0414         regulator-name = "vcc-hsic";
0415 };
0416 
0417 &reg_fldo2 {
0418         regulator-min-microvolt = <700000>;
0419         regulator-max-microvolt = <1100000>;
0420         regulator-always-on;
0421         regulator-name = "vdd-cpus";
0422 };
0423 
0424 &reg_ldo_io0 {
0425         regulator-min-microvolt = <3100000>;
0426         regulator-max-microvolt = <3100000>;
0427         regulator-name = "vcc-ctp";
0428         status = "okay";
0429 };
0430 
0431 &reg_ldo_io1 {
0432         regulator-min-microvolt = <3100000>;
0433         regulator-max-microvolt = <3100000>;
0434         regulator-name = "vcc-vb";
0435         status = "okay";
0436 };
0437 
0438 &reg_sw {
0439         regulator-min-microvolt = <3100000>;
0440         regulator-max-microvolt = <3100000>;
0441         regulator-name = "vcc-lcd";
0442 };
0443 
0444 &tcon0 {
0445         pinctrl-names = "default";
0446         pinctrl-0 = <&lcd_lvds_pins>;
0447 };
0448 
0449 &tcon0_out {
0450         tcon0_out_lcd: endpoint {
0451                 remote-endpoint = <&panel_input>;
0452         };
0453 };
0454 
0455 &uart0 {
0456         pinctrl-names = "default";
0457         pinctrl-0 = <&uart0_pb_pins>;
0458         status = "okay";
0459 };
0460 
0461 /* There's the BT part of the AP6210 connected to that UART */
0462 &uart1 {
0463         pinctrl-names = "default";
0464         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
0465         uart-has-rtscts;
0466         status = "okay";
0467 
0468         bluetooth {
0469                 compatible = "brcm,bcm20702a1";
0470                 clocks = <&ac100_rtc 1>;
0471                 clock-names = "lpo";
0472                 vbat-supply = <&reg_vbat>;
0473                 vddio-supply = <&reg_dldo1>;
0474                 device-wakeup-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
0475                 host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
0476                 shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
0477                 max-speed = <1500000>;
0478         };
0479 };
0480 
0481 &uart2 {
0482         pinctrl-names = "default";
0483         pinctrl-0 = <&uart2_pb_pins>;
0484         status = "okay";
0485 
0486         gnss {
0487                 compatible = "u-blox,neo-6m";
0488 
0489                 v-bckp-supply = <&reg_rtc_ldo>;
0490                 vcc-supply = <&reg_gps>;
0491                 current-speed = <9600>;
0492         };
0493 };
0494 
0495 &usb_otg {
0496         status = "okay";
0497 };
0498 
0499 &usbphy {
0500         usb0_id_det-gpios = <&pio 7 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH11 */
0501         usb0_vbus_power-supply = <&usb_power_supply>;
0502         usb0_vbus-supply = <&reg_drivevbus>;
0503         usb1_vbus-supply = <&reg_vmain>;
0504         usb2_vbus-supply = <&reg_vmain>;
0505         status = "okay";
0506 };