0001 // SPDX-License-Identifier: GPL-2.0 OR MIT
0002 /*
0003 * Copyright 2019 Ondrej Jirman <megous@megous.com>
0004 */
0005
0006 /dts-v1/;
0007 #include "sun5i-a13.dtsi"
0008 #include "sunxi-common-regulators.dtsi"
0009 #include <dt-bindings/gpio/gpio.h>
0010 #include <dt-bindings/input/input.h>
0011 #include <dt-bindings/interrupt-controller/irq.h>
0012 #include <dt-bindings/pwm/pwm.h>
0013
0014 / {
0015 model = "PocketBook Touch Lux 3";
0016 compatible = "pocketbook,touch-lux-3", "allwinner,sun5i-a13";
0017
0018 aliases {
0019 serial0 = &uart1;
0020 i2c0 = &i2c0;
0021 i2c1 = &i2c1;
0022 i2c2 = &i2c2;
0023 };
0024
0025 backlight {
0026 compatible = "pwm-backlight";
0027 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
0028 enable-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
0029 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
0030 default-brightness-level = <8>;
0031 power-supply = <®_vcc3v3>;
0032 };
0033
0034 chosen {
0035 stdout-path = "serial0:115200n8";
0036 };
0037
0038 leds {
0039 compatible = "gpio-leds";
0040
0041 led {
0042 gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */
0043 default-state = "on";
0044 };
0045 };
0046
0047 gpio-keys {
0048 compatible = "gpio-keys";
0049 autorepeat;
0050 label = "GPIO Keys";
0051
0052 key-right {
0053 label = "Right";
0054 linux,code = <KEY_RIGHT>;
0055 gpios = <&pio 6 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG9 */
0056 };
0057
0058 key-left {
0059 label = "Left";
0060 linux,code = <KEY_LEFT>;
0061 gpios = <&pio 6 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG10 */
0062 };
0063 };
0064
0065 reg_1v8: regulator-1v8 {
0066 compatible = "regulator-fixed";
0067 regulator-name = "vdd-1v8-nor-ctp";
0068 regulator-min-microvolt = <1800000>;
0069 regulator-max-microvolt = <1800000>;
0070 gpio = <&pio 2 15 GPIO_ACTIVE_HIGH>;
0071 enable-active-high;
0072 };
0073
0074 reg_1v8_nor: regulator-nor {
0075 compatible = "regulator-fixed";
0076 regulator-name = "vdd-nor";
0077 regulator-min-microvolt = <1800000>;
0078 regulator-max-microvolt = <1800000>;
0079 gpio = <&pio 2 14 GPIO_ACTIVE_HIGH>;
0080 enable-active-high;
0081 vin-supply = <®_1v8>;
0082 regulator-always-on;
0083 };
0084
0085 reg_1v8_ctp: regulator-ctp {
0086 compatible = "regulator-fixed";
0087 regulator-name = "vdd-ctp";
0088 regulator-min-microvolt = <1800000>;
0089 regulator-max-microvolt = <1800000>;
0090 gpio = <&pio 2 13 GPIO_ACTIVE_HIGH>;
0091 enable-active-high;
0092 vin-supply = <®_1v8>;
0093 };
0094
0095 reg_3v3_mmc0: regulator-mmc0 {
0096 compatible = "regulator-fixed";
0097 regulator-name = "vdd-mmc0";
0098 regulator-min-microvolt = <3300000>;
0099 regulator-max-microvolt = <3300000>;
0100 gpio = <&pio 4 4 GPIO_ACTIVE_LOW>; /* PE4 */
0101 vin-supply = <®_vcc3v3>;
0102 };
0103 };
0104
0105 &cpu0 {
0106 cpu-supply = <®_dcdc2>;
0107 };
0108
0109 &ehci0 {
0110 status = "okay";
0111 };
0112
0113 &i2c0 {
0114 status = "okay";
0115
0116 axp209: pmic@34 {
0117 reg = <0x34>;
0118 interrupts = <0>;
0119 };
0120 };
0121
0122 #include "axp209.dtsi"
0123
0124 &i2c1 {
0125 status = "okay";
0126
0127 pcf8563: rtc@51 {
0128 compatible = "nxp,pcf8563";
0129 reg = <0x51>;
0130 };
0131 };
0132
0133 &i2c2 {
0134 status = "okay";
0135
0136 /* Touchpanel is connected here. */
0137 };
0138
0139 &lradc {
0140 vref-supply = <®_ldo2>;
0141 status = "okay";
0142
0143 button-200 {
0144 label = "Home";
0145 linux,code = <KEY_HOME>;
0146 channel = <0>;
0147 voltage = <200000>;
0148 };
0149
0150 button-400 {
0151 label = "Menu";
0152 linux,code = <KEY_MENU>;
0153 channel = <0>;
0154 voltage = <400000>;
0155 };
0156 };
0157
0158 &mmc0 {
0159 vmmc-supply = <®_3v3_mmc0>;
0160 bus-width = <4>;
0161 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
0162 status = "okay";
0163 };
0164
0165 &mmc2 {
0166 pinctrl-names = "default";
0167 pinctrl-0 = <&mmc2_4bit_pc_pins>;
0168 vmmc-supply = <®_vcc3v3>;
0169 bus-width = <4>;
0170 non-removable;
0171 status = "okay";
0172 };
0173
0174 &ohci0 {
0175 status = "okay";
0176 };
0177
0178 &otg_sram {
0179 status = "okay";
0180 };
0181
0182 &pwm {
0183 pinctrl-names = "default";
0184 pinctrl-0 = <&pwm0_pin>;
0185 status = "okay";
0186 };
0187
0188 ®_dcdc2 {
0189 regulator-always-on;
0190 regulator-min-microvolt = <1000000>;
0191 regulator-max-microvolt = <1400000>;
0192 regulator-name = "vdd-cpu";
0193 };
0194
0195 ®_dcdc3 {
0196 regulator-always-on;
0197 regulator-min-microvolt = <1200000>;
0198 regulator-max-microvolt = <1200000>;
0199 regulator-name = "vdd-int-pll";
0200 };
0201
0202 ®_ldo1 {
0203 regulator-name = "vdd-rtc";
0204 };
0205
0206 ®_ldo2 {
0207 regulator-always-on;
0208 regulator-min-microvolt = <3000000>;
0209 regulator-max-microvolt = <3000000>;
0210 regulator-name = "avcc";
0211 };
0212
0213 ®_ldo3 {
0214 regulator-min-microvolt = <3300000>;
0215 regulator-max-microvolt = <3300000>;
0216 regulator-name = "vcc-wifi";
0217 /* We need this otherwise the LDO3 would overload */
0218 regulator-soft-start;
0219 regulator-ramp-delay = <1600>;
0220 };
0221
0222 &spi2 {
0223 pinctrl-names = "default";
0224 pinctrl-0 = <&spi2_pe_pins>, <&spi2_cs0_pe_pin>;
0225 status = "okay";
0226
0227 epd_flash: flash@0 {
0228 #address-cells = <1>;
0229 #size-cells = <1>;
0230 compatible = "macronix,mx25u4033", "jedec,spi-nor";
0231 reg = <0>;
0232 spi-max-frequency = <4000000>;
0233 };
0234 };
0235
0236 &uart1 {
0237 pinctrl-names = "default";
0238 pinctrl-0 = <&uart1_pg_pins>;
0239 status = "okay";
0240 };
0241
0242 &usb_otg {
0243 dr_mode = "peripheral";
0244 status = "okay";
0245 };
0246
0247 &battery_power_supply {
0248 status = "okay";
0249 };
0250
0251 &usb_power_supply {
0252 status = "okay";
0253 };
0254
0255 &usbphy {
0256 usb1_vbus-supply = <®_ldo3>;
0257 status = "okay";
0258 };