Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
This is a skeleton of joypad with 2 sticks and FN (MODE) button.
Fits devices with 1 stick and 2 extra face buttons too.
By including this ans setting I/O properties only,
devices should get consistent controller id and mapping
thus reusing non-game configs:
* SDL gamecontrollerdb.txt
* ES es_input.cfg
* Retroarch gamepad
*/

/ {
joypad: retrogame_joypad_s2_f1 {
/* These drivers emit the same button set which makes this skeleton ADC-agnostic */
/* compatible = "rocknix-joypad"; */
/* compatible = "rocknix-singleadc-joypad"; */

/* These are constants making Joystick Guid the same */
joypad-name = "retrogame_joypad_s2_f1";
joypad-vendor = <0x484B>;
joypad-product = <0x1121>; /* 11 inherited, 2 for number of sticks, 1 for number of FN */
joypad-revision = <0x0100>;

/* require explicit status = "okay"; */
status = "disabled";

/* adc calculate scale */
button-adc-scale = <2>;

/* adc deadzone range */
button-adc-deadzone = <64>;

/*
specifies fuzz value that is used to filter noise from
the event stream.
*/
button-adc-fuzz = <32>;
button-adc-flat = <32>;

/* poll device interval (ms), adc read interval */
poll-interval = <10>;

/* gpio button auto repeat set value : default disable */
/*
autorepeat;
*/

/* meaningful node names for easier use */
up {
label = "GPIO DPAD-UP";
linux,code = <BTN_DPAD_UP>;
};
down {
label = "GPIO DPAD-DOWN";
linux,code = <BTN_DPAD_DOWN>;
};
left {
label = "GPIO DPAD-LEFT";
linux,code = <BTN_DPAD_LEFT>;
};
right {
label = "GPIO DPAD-RIGHT";
linux,code = <BTN_DPAD_RIGHT>;
};

a {
label = "GPIO BTN-A";
linux,code = <BTN_EAST>;
};
b {
label = "GPIO BTN-B";
linux,code = <BTN_SOUTH>;
};
x {
label = "GPIO BTN-X";
linux,code = <BTN_NORTH>;
};
y {
label = "GPIO BTN-Y";
linux,code = <BTN_WEST>;
};

select {
label = "GPIO BTN_SELECT";
linux,code = <BTN_SELECT>;
};
start {
label = "GPIO BTN_START";
linux,code = <BTN_START>;
};
mode {
label = "GPIO BTN_F";
linux,code = <BTN_MODE>;
};

tl {
label = "GPIO BTN_TL";
linux,code = <BTN_TL>;
};
tr {
label = "GPIO BTN_TR";
linux,code = <BTN_TR>;
};
tl2 {
label = "GPIO BTN_TL2";
linux,code = <BTN_TL2>;
};
tr2 {
label = "GPIO BTN_TR2";
linux,code = <BTN_TR2>;
};

thumbl {
label = "GPIO BTN_THUMBL";
linux,code = <BTN_THUMBL>;
};
thumbr {
label = "GPIO BTN_THUMBR";
linux,code = <BTN_THUMBR>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2019 Hardkernel Co., Ltd
* Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH
* Copyright (c) 2022 Maya Matuszczyk <[email protected]>
*/

/dts-v1/;
#include "rk3326-odroid-go.dtsi"

/ {
model = "Anbernic RG351M";
compatible = "anbernic,rg351m", "rockchip,rk3326";

battery: battery {
compatible = "simple-battery";
charge-full-design-microamp-hours = <3500000>;
charge-term-current-microamp = <350000>;
constant-charge-current-max-microamp = <2000000>;
constant-charge-voltage-max-microvolt = <4200000>;
factory-internal-resistance-micro-ohms = <180000>;
voltage-max-design-microvolt = <4100000>;
voltage-min-design-microvolt = <3500000>;

ocv-capacity-celsius = <20>;
ocv-capacity-table-0 = <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>,
<3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>,
<3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>,
<3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>,
<3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>,
<3574170 0>;
};

vibrator {
compatible = "pwm-vibrator";
pwms = <&pwm0 0 1000000 0>;
pwm-names = "enable";
};
};

/delete-node/ &vcc_host; /* conflicts with pwm vibration motor */

#include "rk3326-panel-elida-kd35t133.dtsi"
&internal_display {
iovcc-supply = <&vcc_lcd>;
vdd-supply = <&vcc_lcd>;
rotation = <270>;
};

&pwm0 {
status = "okay";
};

&rk817_charger {
/* This device does not have a current sense resistor */
//rockchip,resistor-sense-micro-ohms = <0>;
monitored-battery = <&battery>;
};
Loading