1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/input/linux-event-codes.h>
7#include <dt-bindings/pinctrl/rockchip.h>
8#include "rk3566-anbernic-rg353x.dtsi"
9
10/ {
11	model = "RG353VS";
12	compatible = "anbernic,rg353vs", "rockchip,rk3566";
13
14	aliases {
15		mmc0 = &sdmmc0;
16		mmc1 = &sdmmc1;
17		mmc2 = &sdmmc2;
18	};
19
20	battery: battery {
21		compatible = "simple-battery";
22		charge-full-design-microamp-hours = <3151000>;
23		charge-term-current-microamp = <300000>;
24		constant-charge-current-max-microamp = <2000000>;
25		constant-charge-voltage-max-microvolt = <4200000>;
26		factory-internal-resistance-micro-ohms = <117000>;
27		voltage-max-design-microvolt = <4172000>;
28		voltage-min-design-microvolt = <3400000>;
29
30		ocv-capacity-celsius = <20>;
31		ocv-capacity-table-0 =  <4172000 100>, <4054000 95>, <3984000 90>, <3926000 85>,
32					<3874000 80>, <3826000 75>, <3783000 70>, <3746000 65>,
33					<3714000 60>, <3683000 55>, <3650000 50>, <3628000 45>,
34					<3612000 40>, <3600000 35>, <3587000 30>, <3571000 25>,
35					<3552000 20>, <3525000 15>, <3492000 10>, <3446000 5>,
36					<3400000 0>;
37	};
38
39	/* Channels reversed for headphones. */
40	sound {
41		compatible = "simple-audio-card";
42		simple-audio-card,name = "rk817_int";
43		simple-audio-card,format = "i2s";
44		simple-audio-card,hp-det-gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
45		simple-audio-card,mclk-fs = <256>;
46		simple-audio-card,widgets =
47			"Microphone", "Mic Jack",
48			"Headphone", "Headphones",
49			"Speaker", "Internal Speakers";
50		simple-audio-card,routing =
51			"MICL", "Mic Jack",
52			"Headphones", "HPOL",
53			"Headphones", "HPOR",
54			"Internal Speakers", "SPKO";
55
56		simple-audio-card,codec {
57			sound-dai = <&rk817>;
58		};
59
60		simple-audio-card,cpu {
61			sound-dai = <&i2s1_8ch>;
62		};
63	};
64};
65
66&gpio_keys_control {
67	button-r1 {
68		gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
69		label = "TR";
70		linux,code = <BTN_TR>;
71	};
72
73	button-r2 {
74		gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
75		label = "TR2";
76		linux,code = <BTN_TR2>;
77	};
78};
79
80&rk817 {
81	rk817_charger: charger {
82		monitored-battery = <&battery>;
83		rockchip,resistor-sense-micro-ohms = <10000>;
84		rockchip,sleep-enter-current-microamp = <300000>;
85		rockchip,sleep-filter-current-microamp = <100000>;
86	};
87};
88