From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx8-out.webonline.biz ([41.86.105.118] helo=assp01.webonline.biz) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VU5YL-0007HZ-S7 for barebox@lists.infradead.org; Thu, 10 Oct 2013 02:00:38 +0000 Received: from ASSP.nospam (localhost.localdomain [127.0.0.1]) by assp01.webonline.biz (Postfix) with ESMTP id 39DD46A6CF for ; Thu, 10 Oct 2013 04:00:08 +0200 (SAST) Date: Wed, 09 Oct 2013 18:59:54 -0700 From: Ivor Kruger Message-ID: In-Reply-To: Mime-version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: FW: Writing to I2C device during Barebox boot To: barebox@lists.infradead.org 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