Re: FW: Writing to I2C device during Barebox boot

2013-10-10 Thread Jan Lübbe
On Wed, 2013-10-09 at 18:59 -0700, Ivor Kruger wrote:
 But this is where my linux knowledge is letting me down.
 
 How do I get a handle to the device in order to call the write_reg
 function?
 
 Your pointers and help is much appreciated.

Could you show us your code? That would make helping you much easier.
Please see 'man git-send-email' on how to send patches with git.

Regards,
Jan
-- 
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- |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


FW: Writing to I2C device during Barebox boot

2013-10-09 Thread Ivor Kruger
I can hardly believe it myself but I have succeeded (i think) in writing a
new driver for a I2C chip I use.
I probe the driver/device during boot and all seems well.
The device shows up in the device tree.
So before the init process for the board ends, I would like to write a few
values to the device (it controls the PSU, thus the reason for doing it in
barebox).

I want to do this in the board.c file at the end of the
pcm049_devices_init function. Is this the right place?

But this is where my linux knowledge is letting me down.

How do I get a handle to the device in order to call the write_reg
function?

Your pointers and help is much appreciated.




___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox