When a battery is connected to a beaglebone black, how does the software know to issue a shutdown when power is no longer coming in ? More specifically I'm interested in which file / script performs this action, and what mechanism triggers this behavior.
My intentions are to modify / customize what actually happens when power to the board is battery only.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/F27E94CA-369F-4E5D-8555-EEAD3B034C28%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqNNeWN9uW_WDsTQC%2BNuArTq%2BtjGMVO5a%2Be-S6cyDk21w%40mail.gmail.com.
Enable input for DCDC1, 2, 3 converters and LDO1, 2, 3, 4. Pull this pin high to start the
power-up sequence.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/D02D2BC4-66ED-434B-B7D9-66154797FDB7%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORpC%3DDMupx5%2B57geCv20kHM3xO7DduTRkcbAg2f-RoXK0Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/8D1C78E9-A070-4BEF-8BF5-D274B18EC1C0%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/AF28B73F-B1CF-436A-988A-C9B0F685B39A%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORpC%3DDMupx5%2B57geCv20kHM3xO7DduTRkcbAg2f-RoXK0Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORq8%2Bn5s4vs_0ZUVJ0qaf-4puQWowGWYRTHfO7yi%3DM2V9g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORq8%2Bn5s4vs_0ZUVJ0qaf-4puQWowGWYRTHfO7yi%3DM2V9g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2A3CC1B5-64A5-4449-8BB2-3874E479ED8E%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORo4zqCvJf9zpyx91-PuppqKDDXxLQEymp0MTcLZdFG9%2Bw%40mail.gmail.com.
| + input_report_key(tps->pwr_but, KEY_POWER, | |
| + ~status_reg & TPS65217_STATUS_ACPWR); |
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORo4zqCvJf9zpyx91-PuppqKDDXxLQEymp0MTcLZdFG9%2Bw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORo4zqCvJf9zpyx91-PuppqKDDXxLQEymp0MTcLZdFG9%2Bw%40mail.gmail.com.
Yep, it is in the BB kernel:
So again, on line 164 is the Interrupt routing. It is this line:
+ input_report_key(tps->pwr_but, KEY_POWER,
+ ~status_reg & TPS65217_STATUS_ACPWR); that send a power button pressed as an input key when the AC 5V power is removed.
Regards,John
On Apr 17, 2016, at 4:52 PM, William Hermans <yyr...@gmail.com> wrote:
The real reason why our source trees do not match up. My source tree is based on 4.1.x, and yours seems to be 3.8.x. The patch you showed above would probably botch up my source tree . . .
On Sun, Apr 17, 2016 at 4:33 PM, William Hermans <yyr...@gmail.com> wrote:
Yeah I recognize that code from source code not written by TI employees. The file is called tps65217_charger.c, and is written by an employee of another company.
Anyway, I think we're going to blow this off. The idea was to wait around without power for 5 minutes, to see if power comes back up. Before issuing a shutdown. Then, on the power up end, using a simple R/C circuit to ramp up voltage to 5v over a specific time period.
| Virus-free. www.avast.com |
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/571443FC.6020505%40gmail.com.
On Apr 17, 2016, at 7:18 PM, evilwulfie <evilw...@gmail.com> wrote:
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/571443FC.6020505%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2CC5F218-6933-45E8-8B84-2CEE08263AF5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/57146FB7.5000301%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/57146FB7.5000301%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqGgChYUiW8na9wJqDQNW3_tOXn4YW4Rrhqe0UyCzDGWg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqGgChYUiW8na9wJqDQNW3_tOXn4YW4Rrhqe0UyCzDGWg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/8482E576-E05F-4B45-8F30-87B0AFA8D211%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORqf9j0x91u0XAM1KJLBrc9zMwk_-yzvLMhT3LGagnahyQ%40mail.gmail.com.
That is OK if this doesn’t work for you, but there are other BBB users who might find this helpful. Currently the powerfail uses the same key function as the pwr button, so the first place to start would be changing the key function to something else. Also, the interrupt routine does not report power good, so that would have to be added. After that, a systemd service could take care of the rest.
Regards,John
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/053B71E7-CF39-4B7C-A7A5-615C9EB197E7%40gmail.com.
I have an interest in this. It's way above my pay grade from a programming perspective...
Mike
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/5715510F.8000408%40gmail.com.
To view this discussion on the web visithttps://groups.google.com/d/msgid/beagleboard/CALHSORqGgChYUiW8na9wJqDQNW3_tOXn4YW4Rrhqe0UyCzDGWg%40mail.gmail.com.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORr_TRRtZSnUmo-xQFmh%2B8u_RcDXU5zEJjw7ONpg4eOZ5w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/3FE12548-00AA-458C-9CB2-A47F0C8AB5A9%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORogR8Ahz1hmp0NAohsLGCO3XqTUowDPmAiPE0azY2AgdQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/D0317723-FE78-4873-87FD-1DE8C5FAE57B%40gmail.com.
On Apr 19, 2016, at 9:28 PM, William Hermans <yyr...@gmail.com> wrote:FYI I could do this entirely in userspace, really easily. Except I would have to poll, instead of using an interrupt, and I pretty much be writing duplicate code, or code that does a duplicate job. But passed that I really do not have to time for this, or to read through, and understand all the required Linux kernel, and LKMs to do this "properly". It's a lot of work for someone who really doesn't know what they're doing.Second, a kernel module should not require a specific init daemon. That goes against the whole point of Linux.That's not what I was saying at all. I'm saying if all this is that easy for you, then you should add this functionality, and be the community hero.This sort of thing is definitely not above my pay grade, but I am not a kernel hacker, and I do not know the file structure all that well. So it would take me a while to to figure out everything I need to know, about everything I'd need. So if this thing is really that easy for you, why don't you make a new LKM, something that takes an argument, or two. LIke g_multi where you pass in a path for the g_mass_storage bit of the driver. Except of course, you want to be able to set a time out for a shutdown.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORrfjv%3DQcrLP%3DpbphSJAFe%2Bf%2B2seAQd%2Bpuq7gGomdM1UuQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/E4F48D04-8F9A-4B26-8439-10E878DE2767%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORoHsyHaqMnzK1C_E2Rt2zQcWE1PMASS0S6vgDxDiOxCGw%40mail.gmail.com.
I just don’t understand what you are asking for. The code is self explanatory and with a little effort, you can make it work. My guess is you want me to add the include headers and create the Makefile and Kconfig files. If that is what you want, I can do it for you, but I thought you would know how to do this yourself. Take a book and read about sigaction. I’m sure you will find examples just like the ones I sent you. I’ve pulled code like this together for year to understand how comms works between the kernel and user space.
Regards,
JohnDont do it for me, because I do not need it. Do it for all those interested people you mentioned before.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/C3044AEC-BE7C-4510-B7D7-CF5B97E47806%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORq1byP6i%2Bq8%3D_4H6REasjJDjGzcqZho5pHD8x2xaGN1Mg%40mail.gmail.com.
What a shitty attitude. I don’t mind helping people out who appreciate the help, but why would anyone help you when you all you do is complain about the help.
Regards,
JohnIt's not just anyone who gets this special treatment. Just you. I dont like you, have told you this repeatedly and yet you feel compelled to inject yourself into discussions I start, or participate in. I even told you I would have nothing further to say to you ever. And you again felt compelled to inject yourself into this discussion.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/147FA705-1647-42E1-9828-3B868F69E8D2%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORq9pTR%2By4_gcj6eZk7DvQZyZHUUZ6b5E640JP7QDs5ShQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/E03BE0ED-DD71-4472-B174-3B00B5CC2AB7%40gmail.com.
He seems like a smart person who knows hows to copy / paste text. Ignore him.
Hello John,
I've read through this thread and am very interested in solving this problem (with your help) and posting the solution if successful. My goal is to switch to battery power without a shut down when AC power is removed. Currently, the kernel treats the removal of AC power as if the power button is pressed and a clean shut-down is issued. I'm using Mentorel's Beaglebone uSomIQ v4 which is a ruggedized version of the BBB and have installed the 3.8.18-bone79 kernel and running Debian 11.
Where can I find the code you posted that needs to be modified? Specifically:if (int_reg & TPS65217_INT_ACI) {/* Handle AC power status change */dev_dbg(tps->dev, "AC power status change\n");/* Press KEY_POWER when AC not present */input_report_key(tps->pwr_but, KEY_POWER,~status_reg & TPS65217_STATUS_ACPWR);input_sync(tps->pwr_but);}
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYheMTtCe4Hc4iEOu_49%3DHKsEGM1ROg2P5p0bMqtB80C8Q%40mail.gmail.com.
On Aug 10, 2016, at 1:08 PM, Bolek Mellerowicz <bmel...@gmail.com> wrote:Hi John,I posted a message on the BBB Battery shutdown thread but am not sure if my post got through. After searching for a while and reading the thread I see no one has actually solved this issue where removal of AC power is interpreted by the kernel as a power button press which causes a clean shut-down. My goal is have the BBB continue to run on BAT power when AC is removed AND at the same time teach myself a bit more about the kernel and embedded linux in general. In return, I promise to contribute to your thread which hopefully leads to a solution.
The kernel I installed is 3.8.13-bone79 with Debian 11 running. I am using a ruggedized version of the BBB board: Mentorel Beaglebone uSomIQ.
In your thread, you pointed to the following code which would need to be modified:
if (int_reg & TPS65217_INT_ACI) { /* Handle AC power status change */ dev_dbg(tps->dev, "AC power status change\n"); /* Press KEY_POWER when AC not present */ input_report_key(tps->pwr_but, KEY_POWER, ~status_reg & TPS65217_STATUS_ACPWR); input_sync(tps->pwr_but); }
Where can I find this source code? A find -name *tps65217* on my Beagle returns:
root@beaglebone:/# find -name *tps65217*
./usr/src/linux-headers-3.8.13-bone79/include/linux/mfd/tps65217.h
./usr/src/linux-headers-3.8.13-bone79/include/config/backlight/tps65217.h
./usr/src/linux-headers-3.8.13-bone79/include/config/mfd/tps65217.h
./usr/src/linux-headers-3.8.13-bone79/include/config/regulator/tps65217.h
./sys/bus/i2c/drivers/tps65217
./sys/bus/platform/devices/tps65217-pmic
./sys/bus/platform/devices/tps65217-bl
./sys/bus/platform/drivers/tps65217-pmic
./sys/bus/platform/drivers/tps65217-pmic/tps65217-pmic
./sys/bus/platform/drivers/tps65217-bl
./sys/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/tps65217-pmic
./sys/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/tps65217-bl
./proc/irq/7/tps65217
./root/boneDeviceTree/DTSource3.8.12/tps65217.dtsi
./root/boneDeviceTree/DTSource3.8.13/tps65217.dtsi
./root/boneDeviceTree/DTSource3.8.11/tps65217.dtsi
Kind regards,Bolek