If there is real need for this, like a hw bug, I would recommend
to use the opportunity to play building a small usb->gpio + relay
between the barrel jack and the laptop. You can then used powerd
to control the charging of the battery. Is there something like
the MCP221A sopported by netbsd? There are really cheap boards in
aliexpress. But this smells like a cheap or defective (old?) battery.
Batteries come with overcharging protections, the hardware inside
the batteries is more sofisticated than what people usually think.
adr.
Yes. umcpmio(4) and umcpmioctl(4) works with the MCP2221A. I use it
for the I2C functions and sometimes the clock output, but simple GPIO
will work. No GPIO interrupt support and you can't attach through it,
so no gpioow(4) and the like is possible. I got mine from Adafruit, but
you can roll your own breakout boards if you can do SMD soldering. It
requires very little in terms of additional components. Adafruit
publishes the schemetics to their breakout.
https://mail-index.netbsd.org/source-changes/2024/12/16/msg154864.html