未调用i2c探针....不确定在哪里调用i2c_register_board_info [英] i2c probe not being called....not sure where to call i2c_register_board_info

查看:110
本文介绍了未调用i2c探针....不确定在哪里调用i2c_register_board_info的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Intel系统.我正在尝试加载at24.ko和i2c-mux-pca9541.ko. 这两个模块都具有未调用的探测功能. 根据文档,我需要在arch_init中调用i2c_registetr_board_info. 但是我不确定在哪里对Intel系统执行此操作(即哪些文件). 我在互联网上的任何地方都看不到任何示例. 有人可以提供指向我添加此调用的文件的指针. 如果这不是正确的方法,请告诉我.

I have an Intel systems. I am trying to load at24.ko and i2c-mux-pca9541.ko. both modules have probe functions which are not being called. according to the Documentation, i need to call i2c_registetr_board_info in the arch_init. but I am not sure where to do that for the Intel system (ie which files). I do not see any examples anywhere on the internet. can someone provide a pointer to the file that i add this call. if this is not the right approach, please let me know.

先谢谢您

推荐答案

未调用该探针,因为内核未找到可能与驱动程序关联的匹配"设备.有多种方法可以将设备信息提供给内核.讨论如下:

The probe is not called because a "matching" device is not found by the kernel that could be associated with the driver. There are different ways to provide the device information to the kernel. They are discussed as follows :

如果这是出于测试目的,则可以通过sysfs探测i2c设备:

If this is for testing purpose, you can probe the i2c devices through sysfs :

echo <device_name> <i2c_address> > /sys/bus/i2c/devices/i2c-0/new_device

device_name:i2c设备的名称.应该是驱动程序中使用的那个.

device_name : name of the i2c device. Should be the one used in the driver.

i2c_address:根据设备数据表的i2c设备地址

i2c_address : Address of the i2c device as per the device datasheet

以上命令假定i2c总线"0"是连接设备的总线.

The above command assumes that the i2c bus '0' is the one where the device is attached.

除此以外,还有其他一些方法可以探测您的设备.您可以通过设备树或调用i2c_register_board_info()来指定设备信息.您可以创建一个简单的模块,该模块创建i2c_board_info结构并使用i2c_register_board_info()注册它,然后插入该模块,以使设备对内核是已知的",并将该设备与其驱动程序绑定在一起.不必在板初始化代码中.

Apart from this, there are some other ways to probe your device. You might specify the device info through a device tree or by calling i2c_register_board_info(). You could create a simple module that creates the i2c_board_info structure and registers it using i2c_register_board_info(), and then insert the module such that the device would be "known" to the kernel and binds the device with its driver. It need not be in the board init codes.

我建议您阅读以下有关探测i2c设备的文档: http://lxr.free-electrons.com/source/Documentation/i2c/instantiating-devices

I recommend you to go through the following documentation on probing i2c devices : http://lxr.free-electrons.com/source/Documentation/i2c/instantiating-devices

这篇关于未调用i2c探针....不确定在哪里调用i2c_register_board_info的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆