mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ivor Kruger <ivor@veriline.co.za>
To: barebox@lists.infradead.org
Subject: FW: Writing to I2C device during Barebox boot
Date: Wed, 09 Oct 2013 18:59:54 -0700	[thread overview]
Message-ID: <CE7B57F6.8D31%ivor@veriline.co.za> (raw)
In-Reply-To: <CE7B48EC.8D30%ivor@veriline.co.za>

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

       reply	other threads:[~2013-10-10  2:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CE7B48EC.8D30%ivor@veriline.co.za>
2013-10-10  1:59 ` Ivor Kruger [this message]
2013-10-10  7:42   ` Jan Lübbe
2013-10-10 13:10     ` Ivor Kruger
2013-10-14  8:27       ` Sascha Hauer

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=CE7B57F6.8D31%ivor@veriline.co.za \
    --to=ivor@veriline.co.za \
    --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