lk2nd: hw: gpio: pm8921: Add devicetree flag for GPIO polarity inversion#720
lk2nd: hw: gpio: pm8921: Add devicetree flag for GPIO polarity inversion#720ejona86 wants to merge 1 commit into
Conversation
Allow configuring PMIC GPIO interrupt/input polarity inversion dynamically via a custom devicetree flag `GPIO_PMIC_INVERTED`. On the Asus Nexus 7 (flo), the primary bootloader configures the volume keys with inversion enabled and Linux does not seem to reconfigure this. When lk2nd configured the buttons, it cleared the inversion causing Linux to believe the buttons were pressed.
|
I'm generally a bit concerned with this since you seem to say that linux is broken as it doens't properly initialize the hardware (or properly interpret the signal), yet instead of fixing linux, we're trying to hack stuff into lk2nd... I think it's worth spending a bit more time here to make sure everything is aligned and linux can stand on it's own. First of all, do you have access to schematics to know how the keys are wired? I.e. I'd assume they are in fact pulled up switches to ground, where active_low flag would make most sense. Given (I assume) lk2nd currently handles keys properly, maybe the right solution would be changing linux to reset the inversion flag and then fixing the DT to use correct polarity for gpios? Otherwise it sounds like mainline DT for flo is broken as the flag ACTIVE HIGH contradicts what happens IRL where key line is low when the key is pressed... |
Allow configuring PMIC GPIO interrupt/input polarity inversion dynamically via a custom devicetree flag
GPIO_PMIC_INVERTED.On the Asus Nexus 7 (flo), the primary bootloader configures the volume keys with inversion enabled and Linux does not seem to reconfigure this. When lk2nd configured the buttons, it cleared the inversion causing Linux to believe the buttons were pressed.
I'm not beholden to this particular strategy, but it was simple, shows what I'm trying to achieve, and won't break other devices. I played with trying to preserve the inversion flag, and wasn't happy with it. I don't know if we think this is just a linux bug and it should be fixed there instead. I've only seen upstream linux break; I haven't tried with android. I can try out things like that if it helps.