Hello everyone,
After a very long time, I'm back to this topic.
During covid19's lockdown I had some spare time and I tried to make the PMP-V work again.
I still can't figure out what to do with debugfs, but I could compile uzImage.bin and I spent some time tinkering with the rs90.dts file.
At first, I tried different combination of gpio values for up and down keys. Everytime, I made a new uzImage.bin, flashed the device and tried if I got something, but to no avail.
Then, I figured that since the down key acted as the L key, I looked into the portion of the dts file which takes care of left shoulder button.
I now have a responsive down key with this code:
[email protected] {
compatible = "adc-keys";
io-channels = <&adc INGENIC_ADC_AUX>;
io-channel-names = "buttons";
keyup-threshold-microvolt = <1400000>;
poll-interval = <30>;
[email protected] {
label = "Select button";
linux,code = <KEY_ESC>;
press-threshold-microvolt = <1100000>;
};
[email protected] {
label = "Left shoulder button";
linux,code = <KEY_TAB>;
press-threshold-microvolt = <900000>;
};
[email protected] {
label = "D-pad down";
linux,code = <KEY_DOWN>;
press-threshold-microvolt = <100000>;
};
};
As I understand, the 3 keys are linked to an adc pin which measure different voltage when those keys are pressed.
It sometimes is buggy: the down key sometimes activates L or select keys, but I could play some games where up key is not too important.
After that, I tried other values to see if I could get a response from the up key.
I got something with this:
[email protected] {
label = "D-pad up";
linux,code = <KEY_UP>;
press-threshold-microvolt = <2900000>;
};
In fact, the up key seems not to respond at first. But when I press down, select or L, the device thinks the up key is always pressed after that. Then, if I push the nub up (yes, it's an analog nug and not a digital dpad), it acts like the up key is not pressed anymore.
Also, this react like this if keyup threshold value is lower than the up key press-threshold value.
I think that when the nub is centered, the voltage is around 1.5V. Pushing down lowers the voltage and pushing up makes it bigger (I didn't measure anything, it's just my guess)
The problem is that press-threshold-microvolt only detects a voltage going under the press threshold and I need to detect when it goes higher than that.
I tried inserting a dummy key between up and the rest (when the nub is centered, it should react to this dummy key and nothing should happen):
[email protected] {
label = "Dummy";
linux,code = <KEY_J>;
press-threshold-microvolt = <2500000>;
};
But it doesn't change anything even if I use a keyup threshold higher than the press threshold of the up key (as before, in that case, the always up phenomenon doesn't occur).
I will give a try with a part of pcerceui's gcw0 code:
joystick {
compatible = "adc-joystick";
io-channels = <&adc INGENIC_ADC_TOUCH_XP>,
<&adc INGENIC_ADC_TOUCH_YP>;
[email protected] {
linux,abs-code = <ABS_X>;
linux,abs-range = <3300 0>;
linux,abs-fuzz = <4>;
linux,abs-flat = <200>;
};
[email protected] {
linux,abs-code = <ABS_Y>;
linux,abs-range = <0 3300>;
linux,abs-fuzz = <4>;
linux,abs-flat = <200>;
};
};
This code seems more logical to manage an analog nub, but I'm not sure the RS90 is made to react to this.
Has anyone got any idea?
The left and right keys reacts to gpios, could they also be linked to and adc? Likewise, could up and down keys be linked to standard gpios (As of now, I tried gpc 0 to 31 and gpb 24 to 31)?
I'm from France and it's difficult to explain all the technical stuff in english, but i think some devs here speak french.
Thanks to those who already tried to help and to those who will.
Take care.