I2C0 and TPS65217C

Dear all,

I would like to see if my Beaglebone black is powered by USB cable or by an external power supply.
To do that I would like to read the "Status register " of the TPS65217C.
It should be done by using the I2C0. As far as I have understood, it cannot be done by userspace by using <linux/i2c-dev.h> and open it by /dev/i2c-0.

I tried both
i2cget 0 0x24 0x0A
i2cget -y 0 0x24 0x0A

but I obtain always: “Device or resource busy”.

Is there a way to check what is written in the status register?
Or is there another way to check how the Beaglebone black is powered?

Thanks.

Alberto

FYI:

root@arm:/dev# uname -a
Linux arm 3.8.13-bone28 #1 SMP Thu Sep 12 23:22:35 UTC 2013 armv7l GNU/Linux

Ok,

as usual, after one day searching around, I found the solution 2 minutes later I wrote the post.

Here the solution:
https://github.com/pehrtree/beaglebone_snippets/tree/master/power

Alberto

Alberto, Maybe, but at least you come bringing good information. Thanks :slight_smile: