Writing to I2C device during Barebox boot

Sascha Hauer s.hauer at pengutronix.de
Mon Oct 14 04:27:01 EDT 2013


Hi Ivor,

On Thu, Oct 10, 2013 at 06:10:42AM -0700, Ivor Kruger wrote:
> Jan, thanks for the reply, I will look into using git-send-email a bit
> later since I am going to travel this morning fro a few hours.
> 
> My question was however a little bit more generic. Take for example the
> PCM049 board.c file. One of the I2C components it loads is the TWL6030. If
> I wish to write to a register on this device, how would I go about it.

When the driver is probed you should see a /dev/twl6030. You can read
the registers doing:

md -s /dev/twl6030

And you can write registers like this:

mw -d /dev/twl6030 <offset> <value>

If you wish to read/write registers from code grep the code for
twl6030_get.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list