From: Wolfram Sang Date: Sat, 9 Jan 2021 12:43:09 +0000 (+0100) Subject: i2c: uapi: add macro to describe support for all SMBus transfers X-Git-Tag: accepted/tizen/unified/20230118.172025~7822^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21500aa84024b3fc541197b2041d80538539740d;p=platform%2Fkernel%2Flinux-rpi.git i2c: uapi: add macro to describe support for all SMBus transfers Some I2C bus master drivers which support I2C_M_RECV_LEN do not set the functionality bits of the now supported SMBus transfers. Add a convenience macro to make this very simple. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang --- diff --git a/include/uapi/linux/i2c.h b/include/uapi/linux/i2c.h index 7786551..92326eb 100644 --- a/include/uapi/linux/i2c.h +++ b/include/uapi/linux/i2c.h @@ -129,6 +129,11 @@ struct i2c_msg { I2C_FUNC_SMBUS_I2C_BLOCK | \ I2C_FUNC_SMBUS_PEC) +/* if I2C_M_RECV_LEN is also supported */ +#define I2C_FUNC_SMBUS_EMUL_ALL (I2C_FUNC_SMBUS_EMUL | \ + I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ + I2C_FUNC_SMBUS_BLOCK_PROC_CALL) + /* * Data for SMBus Messages */