I have a I2C/SMBus device that requires PEC and I'm writing a kernelspace driver for it.
On Linux 2.6.37 I use i2c_board_info to instantiate the client and set the flag there, but now the driver is being ported to 3.14 and I could not find the device tree binding for the PEC flag.
Actually I don't think there is such a binding because the I2C core is not getting any property from device tree other than reg
and wakeup-source
.
So shall I just do i2c_client->flags |= I2C_CLIENT_PEC
in my device driver?
In current mainline kernel(4.5) code, at least three i2c client drivers enable I2C_CLIENT_PEC flag in the driver (ipmi_ssif, lm90 and pmbus_core), and one of them (lm90) exposes it to sysfs.
I believe it's safe to do i2c_client->flags |= I2C_CLIENT_PEC
in the client driver.