procedure to add new i2c platform driver

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

procedure to add new i2c platform driver

跳至解决方案
4,277 次查看
lavakumars
Contributor IV

hi ,

i am working on imx6qp sabre AI board . and yocto build with krenel version :4.1.15.

Now i integrated a new i2c device on i2c-2 bus. and also the device is detected (used i2cdetect tool) on bus "1" and address found to be 11.

And now i have written a i2c platform driver which can probe and communicate with the user space with "ioctl" call.

Please let me know how to register the device with its address. and build the driver code on board. please help.

Note: i tried to add device using "i2c_register_board_info()" in /arch/arm/mach-imx/mach-cpuimx35.c but did not work.

i.e : Driver did not probe device. and did load. can only see it at /sys/bus/i2c/drivers/"registered name" :smileysad:

Regards,

Lavakumar S

标记 (3)
1 解答
2,576 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Lavakumar

for developing new i2c device driver one can use example

in sect.7.3 Using the I2C Interface attached Porting Guide.

For building image please use Yocto Guide.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

4 回复数
2,577 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Lavakumar

for developing new i2c device driver one can use example

in sect.7.3 Using the I2C Interface attached Porting Guide.

For building image please use Yocto Guide.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,576 次查看
lavakumars
Contributor IV

hi igorpadykov,

Can you please tell me which source should i use to "register my i2c device board info".? in imx6qp sabreauto board yocto build

using "i2c_register_board_info"

Regards,

Lavakumar

0 项奖励
2,576 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Lavakumar

please check common linux documentation like

https://www.kernel.org/doc/Documentation/i2c/instantiating-devices 

Best regards
igor

0 项奖励
2,576 次查看
lavakumars
Contributor IV

hi igorpadykov,

thanks for your reply.

Actually the issue is with device acknowledgement it gives ack from 2 or third request for the first time.:smileysad: .

Regards,

Lavakumar S

0 项奖励