~mil/sxmo-user

4 2

PinePhone keyboard power management support?

Details
Message ID
<2312ca15af8628a6b65dc4184e669912@isnotmyreal.name>
DKIM signature
missing
Download raw message
Hello frens,

I had been trying IRC (with no answers so far), so maybe the mailing
list will be better.

Since reading some of Megi's log posts about power management in the
PinePhone keyboard[0], I tried poking around and following along with
some of his instructions, however:

1. I do not seem to have any kbpwr-* utilities.

2. I do not see any device at /sys/class/power_supply/ip5xx-* (only
axp20x-* which is chip in phone).

3. Watching dmesg while pressing button on keyboard (or plugging power
in to keyboard USB port) does not seem to do much of anything.

At this point, I was wondering if I may have fried the power
management chip in the keyboard, or maybe I simply have bad hardware.
Or maybe (if I am lucky) I may just be missing some software (kernel
patches, utilities, etc.).

Any tips would be appreciated.  I am on SXMO 1.9.0.

Cheers,
TRS-80

[0] In particular: https://xnux.eu/log/#065
Details
Message ID
<CM78HR0RQTG2.3L4W3JTVJEWRA@yellow-orcess>
In-Reply-To
<2312ca15af8628a6b65dc4184e669912@isnotmyreal.name> (view parent)
DKIM signature
missing
Download raw message
Megi's tree is megi's tree :) He doesnt speak about the mainlined tree
nor the tree used in your distro package. I think you just dont have the
driver patch he used for this.
Details
Message ID
<87pmgsguac.fsf@isnotmyreal.name>
In-Reply-To
<CM78HR0RQTG2.3L4W3JTVJEWRA@yellow-orcess> (view parent)
DKIM signature
missing
Download raw message
"Stacy Harper" <contact@stacyharper.net> writes:

> I think you just dont have the driver patch he used for this.

I think you are right.

Yesterday I attached keyboard to another PinePhone I have (which still
has Mobian on it) and booted it up.  Under Battery, I was able to see
the kb151 device, along with its own charge level (in addition to phone
battery).

So I guess this means my power management chip on the keyboard is not
fried after all, which is very relieving!

> Megi's tree is megi's tree :) He doesnt speak about the mainlined tree
> nor the tree used in your distro package.

Well I am also on Stable.  Because I use this phone as a daily driver.
So I guess I will have to keep being patient.

The main thing that got me digging into all this, was the fact that
(without the kernel patches) the phone battery will discharge faster
than the keyboard battery will power it[0].  Which leads to me not being
able to get through the day without my phone dying, even while plugged
in!

Apparently, these more recent (2022–04–02) kernel patches[1] (as
mentioned in OP) do fix the issue.  Just not available in SXMO yet (at
least on Stable).  I'm curious if anyone who is on Edge (and has a
keyboard) have seen them pop up?

There are two other work arounds I will share, in case anyone else is in
the same boat.

The first, is to change some setting on /the phone's/ power management
chip (the axp-20x), to allow more power to flow from keyboard battery
into the phone battery.  I remember reading this somewhere, but could
not find a reference to it just now, unfortunately.

The second (which I decided to try) was to plug my USB-C charger
directly into the phone (while keyboard is attached).  Now of course, we
have been warned repeatedly not to do this.  However, Megi wrote a more
recent article (2022–08–06)[2] where (assuming I am understanding him
correctly), he says that you can indeed plug your USB charger straight
into the phone, even while the keyboard is attached, without harming
anything.

Being somewhat desperate for a solution/workaround, I had tried this.
And that's why I thought I may have fried my power management chip (in
the keyboard).  However my power management chip still apears to work
where there is software support for it (i.e., in Mobian).

Therefore, in the interest of science, I guess I will continue to charge
my phone directly, even with the keyboard attached.  I will try to
remember to come back to this thread after some time and report on how
this experiment is going.

Cheers,
TRS-80


[0] https://xnux.eu/log/#057
[1] https://xnux.eu/log/#065
[2] https://xnux.eu/log/#072
Details
Message ID
<87o7tetumn.fsf@isnotmyreal.name>
In-Reply-To
<87pmgsguac.fsf@isnotmyreal.name> (view parent)
DKIM signature
missing
Download raw message
TRS-80 <lists.trs-80@isnotmyreal.name> writes:

> "Stacy Harper" <contact@stacyharper.net> writes:
>
>> I think you just dont have the driver patch he used for this.
>
> I think you are right.
>
>> Megi's tree is megi's tree :) He doesnt speak about the mainlined
>> tree nor the tree used in your distro package.

An update for interested parties.

I cam across this in PINE64's October monthly update[0] (bottom of
'PinePhone (Pro)' section).  If I am understanding this correctly, these
are the patches we have been waiting for?

More info in Phoronix article[1] and Megi's kernel commit log[2].


[0] https://www.pine64.org/2022/10/15/october-update-an-ox-no-bull/
[1] https://www.phoronix.com/news/PinePhone-Keyboard-Linux-6.1
[2] https://github.com/megous/linux/commit/b16232c6156de17e1dfdb63fdaea8e317baa07a7
Details
Message ID
<CO99907ZM064.10ECUGNIKAPT2@white-bird>
In-Reply-To
<87o7tetumn.fsf@isnotmyreal.name> (view parent)
DKIM signature
missing
Download raw message
> An update for interested parties.
>
> I cam across this in PINE64's October monthly update[0] (bottom of
> 'PinePhone (Pro)' section).  If I am understanding this correctly, these
> are the patches we have been waiting for?

Yes it looks like this !

Also notice there is open MR on pmaport to bump the kernel to 6.0.8 and
to make the keyboard to works under ppp.

There is still a lot of commits above 6.0.8 in the pine64 tree that
should be upstreamed with time [1].

This pine64 october update also bring good news about battery usage and
camera. Maybe we will be able to daily drive this ppp finaly :D

[1]: https://gitlab.com/pine64-org/linux/-/commits/ppp-6.0.8-ppkb
Reply to thread Export thread (mbox)