Documentation_i2c_i2c-stub

Chinese translated version of Documentation_i2c_i2c-stub


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Chinese maintainer: 朱锋志 605509916@qq.com
---------------------------------------------------------------------
Documentation_i2c_i2c-stub的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者:朱锋志 605509916@qq.com
中文版翻译者: 朱锋志 605509916@qq.com


以下为正文


---------------------------------------------------------------------




MODULE: i2c-stub




DESCRIPTION:




介绍:




This module is a very simple fake I2C/SMBus driver.  It implements five
types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w)
word data, and (r/w) I2C block data.


此模块是一个非常简单的假的I2C/SMBus驱动。它实现了五个SMBus命令类型:快速写
(R / W)字节,字节的数据(R / W),(R / W)字数据,I2C数据块(R / W)。








You need to provide chip addresses as a module parameter when loading this
driver, which will then only react to SMBus commands to these addresses.




加载时,您需要提供的芯片地址作为一个模块参数驱动程序,然后才反应过来SMBus命令到这些地址。




No hardware is needed nor associated with this module.  It will accept write
quick commands to the specified addresses; it will respond to the other
commands (also to the specified addresses) by reading from or writing to
arrays in memory.  It will also spam the kernel logs for every command it
handles.


没有硬件需要,也与此模块关联。它将接受写它会回应其他快速命令到指定地址;
通过读取或写入的命令(还指定地址)在内存中的数组。每一个命令它,它也将垃
圾邮件的内核日志处理。




A pointer register with auto-increment is implemented for all byte
operations.  This allows for continuous byte reads like those supported by
EEPROMs, among others.




实现自动递增的所有字节的指针寄存器操作。这使得连续的字节读取所支持的
EEPROM的。




The typical use-case is like this:
1. load this module
2. use i2cset (from the i2c-tools project) to pre-load some data
3. load the target chip driver module
4. observe its behavior in the kernel log


典型的使用情况是这样的:
1。加载此模块
2。使用预加载一些数据i2cset(从I2C工具项目)
3。加载目标驱动模块芯片
4。观察其行为的内核日志




There's a script named i2c-stub-from-dump in the i2c-tools package which
can load register values automatically from a chip dump.


有一个脚本名为I2C-存根i2c的工具包转储
可以加载寄存器值自动从芯片转储。


PARAMETERS:
参数:


int chip_addr[10]:
The SMBus addresses to emulate chips at.




unsigned long functionality:
Functionality override, to disable some commands. See I2C_FUNC_*
constants in <linux/i2c.h> for the suitable values. For example,
value 0x1f0000 would only enable the quick, byte and byte data
commands.




CAVEATS:




If your target driver polls some byte or word waiting for it to change, the
stub could lock it up.  Use i2cset to unlock it.




注意事项:
如果您的目标驱动程序轮询等待它改变某些字节或字,
存根可以把它锁起来。使用解锁i2cset。


If the hardware for your driver has banked registers (e.g. Winbond sensors
chips) this module will not work well - although it could be extended to
support that pretty easily.




如果您的驱动程序的硬件寄存器这个模块将无法很好地工作 - 虽然它可以扩展到
支持,很容易地。


If you spam it hard enough, printk can be lossy.  This module really wants
something like relayfs.


如果您的垃圾邮件中printk可以够硬,有损。此模块真的想像relayfs。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值