- 論壇徽章:
- 0
|
本帖最后由 npuazm 于 2011-11-23 12:32 編輯
在我剛剛開始學(xué)習(xí)linux 驅(qū)動(dòng)設(shè)備模型的時(shí)候,看的是I2C 設(shè)備模型,為什么選取這個(gè)linux device driver 呢?原因很簡(jiǎn)單,就是因?yàn)榫W(wǎng)絡(luò)上關(guān)于這方面的討論很多,有很多現(xiàn)成的資源。我對(duì)I2C 設(shè)備模型的總結(jié)如下:
Summary
HOST
When the I2C host probe , it will make one adapter and some clients those share the same adapter. The program will initiate the client->dev , and put the dev into the kernel, at same time the program will fill the client->name with the device info (from the __i2c_board_list) .
DEVICE
When use i2c_add_driver add I2C driver , the program will use the i2c_device_id name find the client (which has the same name ),and fill the client-driver with the I2C driver.
Host 指的是IC 芯片的 I2C host control(這已經(jīng)由大的IC 芯片公司做好了,不需要驅(qū)動(dòng)工程師來做。當(dāng)然你如果你在芯片公司做驅(qū)動(dòng),這塊就是你來做嘍~)
Device 指的是具體的具有I2C接口的功能芯片,比如 具有I2C 的EEROM等等。(這個(gè)一般由驅(qū)動(dòng)工程師,自己移植,注意是移植呀,不用從頭寫。linux 是開源的,一個(gè)芯片的驅(qū)動(dòng)很可能已經(jīng)在發(fā)布的版本中實(shí)現(xiàn)了,你只需要改改相應(yīng)的配置和初始化就ok了,即使你從linux 找不到一樣,但是完全可能找到類似的,再即使類似的找不到,你還可以從功能芯片的公司索取demo,總之驅(qū)動(dòng)工程師的工作主要是修改移植代碼。)
附件中是我學(xué)習(xí)的總結(jié),希望能夠?qū)Ω魑粁djm有點(diǎn)幫助~
目錄大概是
1 I2C protocol
2 Software I2C overview in linux kernel
3 How add I2C device driver in kernel ?
4 How make client ?
其中前兩項(xiàng)是我從網(wǎng)上找的資料,后兩項(xiàng)是我看代碼的總結(jié)~
有不對(duì)的地方請(qǐng)各位指出,謝謝
I2C_linux_device_driver.7z
(205.97 KB, 下載次數(shù): 844)
2011-11-23 10:22 上傳
點(diǎn)擊文件名下載附件
|
|