PMIC device driver
Marc Reilly
marc at cpdesign.com.au
Wed Feb 16 15:34:34 EST 2011
Hi,
> > indicate the register within the PMIC to read/write. On the other hand,
> > the standard read and write functions only take 3 parameters (device,
> > buffer, buffersize). How do I pass that offset to these functions ? How
> > do I use the PMIC device driver ?
> > (Maybe this is a general Linux device driver question, but I'm not that
> > familiar with device drivers, so...)
I'd be using the pmic_read_reg and pmic_write_reg functions (they should be
renamed and exported first though.)
Have a look at the mc13892 driver ..
> >
> > Is it the best way to do it like this (open, read, write), or do I better
> > call those functions directly ? (I have to set the PMIC registers in the
> > "late_init" function of the barebox startup sequence)
... and the freescale-mx35-3stack for example.
>
> [Filip] Think I found how it works. I have to use the normal read, write
> and lseek functions to read/write PMIC registers.
As I said above, I reckon your board code will be cleaner if you skip the file
I/O and use the _read_reg and _write_reg functions directly.
> The 'offset' and 'flag'
> parameters in read and write functions are for internal use only. Correct.
> When reading, an internal index is incremented. A following read starts
> where the previous ended. With lseek, one can move that index to address
> the correct register. Right ?
In general, yes.
HTH,
Cheers
Marc
>
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
More information about the barebox
mailing list