12-05-2020, 01:19 AM
(This post was last modified: 12-05-2020, 02:43 AM by dsimic.
Edit Reason: Clarified the issue
)
Even better news!
No changes to the RK808 kernel driver are required, simply do the following as root and (un)plugging the charger will no longer wake up a suspended PineBook Pro:
You may also create a sysctl rule and place it in /etc/sysctl.d, to have this configured automatically upon every boot.
Here are more details about the whole ordeal with charger (un)plugging detection. As already described earlier in this thread, the RK808 PMIC has a very nice built-in feature that senses the charger voltage and generates interrupts upon the charger plug in and plug out events. However, as visible on page 12 in the PineBook Pro schematicc, there's pretty much no way that anything reaches the RK808's pin #34 (VDC input). Why would anyone connect capacitors in series with a stabilized DC input?
The ugly fix we're dealing with is that one of the RK3399's GPIO inputs is used for sensing the presence of charger, which makes no sense whatsoever. That's the "dc-charger" device/node from above, which is just a charger present/absent flag. This is clearly a bug in the PineBook Pro schematic, and I suppose that it could (and should) be fixed by using a pair of isolation diodes instead of the capacitors.
The proper way, however, is to use the RK808's functionality, instead of abusing a RK3399's GPIO line. Furthermore, should we start a list of bugs to be fixed in the next PineBook Pro PCB revision?
No changes to the RK808 kernel driver are required, simply do the following as root and (un)plugging the charger will no longer wake up a suspended PineBook Pro:
Code:
echo disabled > /sys/devices/platform/dc-charger/power/wakeup
You may also create a sysctl rule and place it in /etc/sysctl.d, to have this configured automatically upon every boot.
Here are more details about the whole ordeal with charger (un)plugging detection. As already described earlier in this thread, the RK808 PMIC has a very nice built-in feature that senses the charger voltage and generates interrupts upon the charger plug in and plug out events. However, as visible on page 12 in the PineBook Pro schematicc, there's pretty much no way that anything reaches the RK808's pin #34 (VDC input). Why would anyone connect capacitors in series with a stabilized DC input?
The ugly fix we're dealing with is that one of the RK3399's GPIO inputs is used for sensing the presence of charger, which makes no sense whatsoever. That's the "dc-charger" device/node from above, which is just a charger present/absent flag. This is clearly a bug in the PineBook Pro schematic, and I suppose that it could (and should) be fixed by using a pair of isolation diodes instead of the capacitors.
The proper way, however, is to use the RK808's functionality, instead of abusing a RK3399's GPIO line. Furthermore, should we start a list of bugs to be fixed in the next PineBook Pro PCB revision?