如何在设备树中将 PEC 标志设置为 SM 总线?

How to set PEC flag to SM bus in device tree?

我有一个 I2C/SMBus 设备需要 PEC,我正在为它编写一个内核空间驱动程序。

在 Linux 2.6.37 我使用 i2c_board_info 实例化客户端并在那里设置标志,但现在驱动程序正在移植到 3.14,我找不到设备树绑定PEC 标志。

其实我不认为有这样的绑定因为the I2C core is not getting any property from device tree other than reg and wakeup-source.

那么我应该在我的设备驱动程序中做 i2c_client->flags |= I2C_CLIENT_PEC 吗?

在当前的主线内核 (4.5) 代码中,至少三个 i2c 客户端驱动程序在驱动程序 (ipmi_ssif, lm90 and pmbus_core), and one of them (lm90) 中启用 I2C_CLIENT_PEC 标志并将其暴露给 sysfs。

我相信在客户端驱动程序中执行 i2c_client->flags |= I2C_CLIENT_PEC 是安全的。