mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Vanalme Filip <F.Vanalme@TELEVIC.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: PMIC device driver
Date: Wed, 16 Feb 2011 09:37:53 +0100	[thread overview]
Message-ID: <6EE7D1502C48E44E92DCADF9DD3E0DB9017FF3B007AF@SRV-VS06.TELEVIC.COM> (raw)

Up till now, I could not start up the network on my i.mx27PDK board. After measuring on the device, I could see that power was missing for the PHY. Good reason, of course, for not starting up... 
To enable the missing power, I have to adjust some registers in the PMIC device (mc13783).
If I look into the mc13783.c file, I could see that this has similarities with Linux device drivers. So, to access the PMIC, I guess I have to do an open("/dev/pmic") and then a read or write. However, when I look to the pmic_read() and pmic_write() function, they have, besides the device pointer, buffer pointer and buffer size, an offset parameter that 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...)

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)

Filip Vanalme



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

             reply	other threads:[~2011-02-16  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16  8:37 Vanalme Filip [this message]
2011-02-16 12:20 Vanalme Filip
2011-02-16 20:34 ` Marc Reilly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6EE7D1502C48E44E92DCADF9DD3E0DB9017FF3B007AF@SRV-VS06.TELEVIC.COM \
    --to=f.vanalme@televic.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox