1*84943d6fSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2*84943d6fSEmmanuel Vadot 3*84943d6fSEmmanuel Vadot/dts-v1/; 4*84943d6fSEmmanuel Vadot 5*84943d6fSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 6*84943d6fSEmmanuel Vadot#include <dt-bindings/input/linux-event-codes.h> 7*84943d6fSEmmanuel Vadot#include <dt-bindings/pinctrl/rockchip.h> 8*84943d6fSEmmanuel Vadot#include "rk3566-anbernic-rg353x.dtsi" 9*84943d6fSEmmanuel Vadot 10*84943d6fSEmmanuel Vadot/ { 11*84943d6fSEmmanuel Vadot model = "RGB30"; 12*84943d6fSEmmanuel Vadot compatible = "powkiddy,rgb30", "rockchip,rk3566"; 13*84943d6fSEmmanuel Vadot 14*84943d6fSEmmanuel Vadot aliases { 15*84943d6fSEmmanuel Vadot mmc1 = &sdmmc0; 16*84943d6fSEmmanuel Vadot mmc2 = &sdmmc1; 17*84943d6fSEmmanuel Vadot mmc3 = &sdmmc2; 18*84943d6fSEmmanuel Vadot }; 19*84943d6fSEmmanuel Vadot 20*84943d6fSEmmanuel Vadot battery: battery { 21*84943d6fSEmmanuel Vadot compatible = "simple-battery"; 22*84943d6fSEmmanuel Vadot charge-full-design-microamp-hours = <3151000>; 23*84943d6fSEmmanuel Vadot charge-term-current-microamp = <300000>; 24*84943d6fSEmmanuel Vadot constant-charge-current-max-microamp = <2000000>; 25*84943d6fSEmmanuel Vadot constant-charge-voltage-max-microvolt = <4250000>; 26*84943d6fSEmmanuel Vadot factory-internal-resistance-micro-ohms = <117000>; 27*84943d6fSEmmanuel Vadot voltage-max-design-microvolt = <4172000>; 28*84943d6fSEmmanuel Vadot voltage-min-design-microvolt = <3400000>; 29*84943d6fSEmmanuel Vadot 30*84943d6fSEmmanuel Vadot ocv-capacity-celsius = <20>; 31*84943d6fSEmmanuel Vadot ocv-capacity-table-0 = <4172000 100>, <4092000 95>, <4035000 90>, <3990000 85>, 32*84943d6fSEmmanuel Vadot <3939000 80>, <3895000 75>, <3852000 70>, <3807000 65>, 33*84943d6fSEmmanuel Vadot <3762000 60>, <3713000 55>, <3672000 50>, <3647000 45>, 34*84943d6fSEmmanuel Vadot <3629000 40>, <3613000 35>, <3598000 30>, <3578000 25>, 35*84943d6fSEmmanuel Vadot <3550000 20>, <3519000 15>, <3479000 10>, <3438000 5>, 36*84943d6fSEmmanuel Vadot <3400000 0>; 37*84943d6fSEmmanuel Vadot }; 38*84943d6fSEmmanuel Vadot 39*84943d6fSEmmanuel Vadot /* 40*84943d6fSEmmanuel Vadot * Channels reversed for speakers. Headphones automatically switch via hardware when 41*84943d6fSEmmanuel Vadot * detected with no ability to control output in software. Headphones appear to be mono 42*84943d6fSEmmanuel Vadot * (each output channel receives all audio). No microphone support on 3.5mm jack. 43*84943d6fSEmmanuel Vadot */ 44*84943d6fSEmmanuel Vadot sound { 45*84943d6fSEmmanuel Vadot compatible = "simple-audio-card"; 46*84943d6fSEmmanuel Vadot simple-audio-card,name = "rk817_ext"; 47*84943d6fSEmmanuel Vadot simple-audio-card,format = "i2s"; 48*84943d6fSEmmanuel Vadot simple-audio-card,mclk-fs = <256>; 49*84943d6fSEmmanuel Vadot simple-audio-card,widgets = 50*84943d6fSEmmanuel Vadot "Headphone", "Headphones"; 51*84943d6fSEmmanuel Vadot simple-audio-card,routing = 52*84943d6fSEmmanuel Vadot "Headphones", "HPOL", 53*84943d6fSEmmanuel Vadot "Headphones", "HPOR"; 54*84943d6fSEmmanuel Vadot 55*84943d6fSEmmanuel Vadot simple-audio-card,codec { 56*84943d6fSEmmanuel Vadot sound-dai = <&rk817>; 57*84943d6fSEmmanuel Vadot }; 58*84943d6fSEmmanuel Vadot 59*84943d6fSEmmanuel Vadot simple-audio-card,cpu { 60*84943d6fSEmmanuel Vadot sound-dai = <&i2s1_8ch>; 61*84943d6fSEmmanuel Vadot }; 62*84943d6fSEmmanuel Vadot }; 63*84943d6fSEmmanuel Vadot}; 64*84943d6fSEmmanuel Vadot 65*84943d6fSEmmanuel Vadot/delete-node/ &adc_keys; 66*84943d6fSEmmanuel Vadot 67*84943d6fSEmmanuel Vadot&chosen { 68*84943d6fSEmmanuel Vadot /delete-property/ stdout-path; 69*84943d6fSEmmanuel Vadot}; 70*84943d6fSEmmanuel Vadot 71*84943d6fSEmmanuel Vadot&cru { 72*84943d6fSEmmanuel Vadot assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>, 73*84943d6fSEmmanuel Vadot <&pmucru PLL_PPLL>, <&cru PLL_VPLL>; 74*84943d6fSEmmanuel Vadot assigned-clock-rates = <32768>, <1200000000>, 75*84943d6fSEmmanuel Vadot <200000000>, <292500000>; 76*84943d6fSEmmanuel Vadot}; 77*84943d6fSEmmanuel Vadot 78*84943d6fSEmmanuel Vadot&gpio_keys_control { 79*84943d6fSEmmanuel Vadot button-r1 { 80*84943d6fSEmmanuel Vadot gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; 81*84943d6fSEmmanuel Vadot label = "TR"; 82*84943d6fSEmmanuel Vadot linux,code = <BTN_TR>; 83*84943d6fSEmmanuel Vadot }; 84*84943d6fSEmmanuel Vadot 85*84943d6fSEmmanuel Vadot button-r2 { 86*84943d6fSEmmanuel Vadot gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; 87*84943d6fSEmmanuel Vadot label = "TR2"; 88*84943d6fSEmmanuel Vadot linux,code = <BTN_TR2>; 89*84943d6fSEmmanuel Vadot }; 90*84943d6fSEmmanuel Vadot}; 91*84943d6fSEmmanuel Vadot 92*84943d6fSEmmanuel Vadot/delete-node/ &{/i2c@fdd40000/regulator@40}; 93*84943d6fSEmmanuel Vadot 94*84943d6fSEmmanuel Vadot&i2c0 { 95*84943d6fSEmmanuel Vadot vdd_cpu: regulator@1c { 96*84943d6fSEmmanuel Vadot compatible = "tcs,tcs4525"; 97*84943d6fSEmmanuel Vadot reg = <0x1c>; 98*84943d6fSEmmanuel Vadot fcs,suspend-voltage-selector = <1>; 99*84943d6fSEmmanuel Vadot regulator-always-on; 100*84943d6fSEmmanuel Vadot regulator-boot-on; 101*84943d6fSEmmanuel Vadot regulator-min-microvolt = <712500>; 102*84943d6fSEmmanuel Vadot regulator-max-microvolt = <1390000>; 103*84943d6fSEmmanuel Vadot regulator-name = "vdd_cpu"; 104*84943d6fSEmmanuel Vadot regulator-ramp-delay = <2300>; 105*84943d6fSEmmanuel Vadot vin-supply = <&vcc_sys>; 106*84943d6fSEmmanuel Vadot regulator-state-mem { 107*84943d6fSEmmanuel Vadot regulator-off-in-suspend; 108*84943d6fSEmmanuel Vadot }; 109*84943d6fSEmmanuel Vadot }; 110*84943d6fSEmmanuel Vadot}; 111*84943d6fSEmmanuel Vadot 112*84943d6fSEmmanuel Vadot/* 113*84943d6fSEmmanuel Vadot * Device has 2 red LEDs instead of an amber and a red. Relabel LEDs as 114*84943d6fSEmmanuel Vadot * red_led0 and red_led1. 115*84943d6fSEmmanuel Vadot */ 116*84943d6fSEmmanuel Vadot/delete-node/ &{/pwm-leds/led-1}; 117*84943d6fSEmmanuel Vadot/delete-node/ &{/pwm-leds/led-2}; 118*84943d6fSEmmanuel Vadot 119*84943d6fSEmmanuel Vadot&leds { 120*84943d6fSEmmanuel Vadot red_led0: led-1 { 121*84943d6fSEmmanuel Vadot color = <LED_COLOR_ID_RED>; 122*84943d6fSEmmanuel Vadot function = LED_FUNCTION_CHARGING; 123*84943d6fSEmmanuel Vadot max-brightness = <255>; 124*84943d6fSEmmanuel Vadot pwms = <&pwm7 0 25000 0>; 125*84943d6fSEmmanuel Vadot }; 126*84943d6fSEmmanuel Vadot 127*84943d6fSEmmanuel Vadot red_led1: led-2 { 128*84943d6fSEmmanuel Vadot color = <LED_COLOR_ID_RED>; 129*84943d6fSEmmanuel Vadot default-state = "off"; 130*84943d6fSEmmanuel Vadot function = LED_FUNCTION_STATUS; 131*84943d6fSEmmanuel Vadot max-brightness = <255>; 132*84943d6fSEmmanuel Vadot pwms = <&pwm0 0 25000 0>; 133*84943d6fSEmmanuel Vadot }; 134*84943d6fSEmmanuel Vadot}; 135*84943d6fSEmmanuel Vadot 136*84943d6fSEmmanuel Vadot&panel { 137*84943d6fSEmmanuel Vadot compatible = "powkiddy,rgb30-panel"; 138*84943d6fSEmmanuel Vadot vcc-supply = <&vcc3v3_lcd0_n>; 139*84943d6fSEmmanuel Vadot iovcc-supply = <&vcc3v3_lcd0_n>; 140*84943d6fSEmmanuel Vadot /delete-property/ vdd-supply; 141*84943d6fSEmmanuel Vadot}; 142*84943d6fSEmmanuel Vadot 143*84943d6fSEmmanuel Vadot&pwm5 { 144*84943d6fSEmmanuel Vadot status = "disabled"; 145*84943d6fSEmmanuel Vadot}; 146*84943d6fSEmmanuel Vadot 147*84943d6fSEmmanuel Vadot&rk817 { 148*84943d6fSEmmanuel Vadot rk817_charger: charger { 149*84943d6fSEmmanuel Vadot monitored-battery = <&battery>; 150*84943d6fSEmmanuel Vadot rockchip,resistor-sense-micro-ohms = <10000>; 151*84943d6fSEmmanuel Vadot rockchip,sleep-enter-current-microamp = <300000>; 152*84943d6fSEmmanuel Vadot rockchip,sleep-filter-current-microamp = <100000>; 153*84943d6fSEmmanuel Vadot }; 154*84943d6fSEmmanuel Vadot}; 155*84943d6fSEmmanuel Vadot 156*84943d6fSEmmanuel Vadot/* There is no UART header visible on the board for this device. */ 157*84943d6fSEmmanuel Vadot&uart2 { 158*84943d6fSEmmanuel Vadot status = "disabled"; 159*84943d6fSEmmanuel Vadot}; 160*84943d6fSEmmanuel Vadot 161*84943d6fSEmmanuel Vadot/delete-node/ &vibrator; 162