LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-24-2011, 12:30 PM   #1
saichaitanya
LQ Newbie
 
Registered: Sep 2011
Posts: 4

Rep: Reputation: Disabled
How are devices addressed in a custom embedded board


Lets say there is a ARM application processor based custom board and it has three I2C interfaces and i were porting linux kernel to it. If i were to connect a I2C device like a digital thermometer from "I2C interface 1" then how does the linux kernel know through which pins it is connected to the system. where should the pin multiplexing and addressing be set. Is it done by editing I/O and memory registers in the device drivers? if yes then does that mean if i connect it via other pins then the same driver wouldn't work? or am i missing something? I worked with PIC microcontrollers before but in it all of the code is just written into JUST 1 single FILE, so i just write the pin addressing in it. In a linux kernel how is this done? where should i edit the code? is it in the device driver or somewhere else like a separate configuration file?
 
Old 09-25-2011, 10:00 AM   #2
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
GPIO support in the kernel should controll it.
The driver (LKM) should support the connected device.
A driver don't have to know at which pin the device is connected to.
 
1 members found this post helpful.
Old 09-26-2011, 07:28 AM   #3
saichaitanya
LQ Newbie
 
Registered: Sep 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bastl View Post
GPIO support in the kernel should controll it.
The driver (LKM) should support the connected device.
A driver don't have to know at which pin the device is connected to.
Thanks. searching in that direction led me to this and i found what i was looking for in the board's .c file and pin multiplexing in mux.h header file. the pins are defined as
#define pin_name <pin_number>
in the board.c file. So my new question is are the pins defined in the above mentioned file used to develop the drivers? like
if (pin_name == 1){....code};
else{..code};
is that how drivers work irrespective of how the device is connected?
 
Old 09-26-2011, 10:30 AM   #4
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
No, drivers should use an interface (file) to talk to the device.
If the kernel needs a special device file (block, char) in /dev it can be created with mknod.
Have a look to Linux Device Drivers, Third Edition.
 
  


Reply



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
power down on an embedded board knobby67 Debian 2 09-05-2018 11:27 PM
Kernel Testing using LTP on Beagle board (ARM based Embedded Dev Board) Rajender.G Linux - Newbie 0 07-27-2011 05:19 AM
WIFI embedded board Suraj Swami Linux - Networking 1 03-29-2010 12:05 AM
gigabit embedded board taltman Linux - Embedded & Single-board computer 2 02-23-2008 10:06 PM
SuSE on an Embedded Soekris Board? jantman Linux - Hardware 3 01-01-2007 06:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration