LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 07-25-2008, 08:01 AM   #1
Gnu2Linux2
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Rep: Reputation: 0
Question on start up and initialization


Another noob question here.

I have a need to do some one time initialization of a device over i2c after a reset. I am curious as to how the best way to handle this in embedded linux (or linux for that matter).

It has to be done before USB and ethernet come up, but obviously after the i2c driver is loaded.

1)How are these types of things typically handled in embedded linux systems?
2)Do you write a little application that is called at some point, or what? 3)If so, how would have it get called?
4)How do control the order of driver loading for the requirement above?


Thanks In Advance.
 
Old 08-07-2008, 03:43 AM   #2
belcor
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Here are some answers from my recent experiences

I needed a camera driver. The camera driver uses an I2C interface, and camera interface. Before any camera functions are done the first thing is to identify the device. ( camera). This is done via the i2c.
On booting when the kernel is loaded it will search for drivers you have installed/created. ie. camera_driver. It will register the driver and 'probe' automatically. During the __init the probing of the device is done, at this time you can reset/send commands via the i2c.
See /linux/drivers/media/video/monahans/mt9d111_hw.c for an example.
it's not that apparent, so you'll have to follow the code through.
also read /linux/documentation/driver-model.txt. See http://lwn.net/Kernel/LDD3/
So the short answer to your question is on kernel boot-up the drivers are loaded, and devices are initialized.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
General Question About C Pointer Initialization trashbird1240 Programming 2 01-14-2008 11:03 AM
Initialization of a pointer in C-a question xailer Programming 4 01-02-2004 12:57 PM
start up question Pharquah Linux - General 3 03-11-2003 03:06 AM
Initialization Question. Crossfire Linux - Newbie 3 07-27-2002 01:37 PM
sendmail initialization islandkid Linux - Software 2 03-03-2002 11:37 PM


All times are GMT -5. The time now is 08:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration