提交 c43a113c 编写于 作者: C Charles Keepax 提交者: Guenter Roeck

hwmon: Add convience macro to define simple static sensors

It takes a fair amount of boiler plate code to add new sensors, add a
macro that can be used to specify simple static sensors.
Signed-off-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 b429ebc8
......@@ -365,6 +365,14 @@ struct hwmon_channel_info {
const u32 *config;
};
#define HWMON_CHANNEL_INFO(stype, ...) \
(&(struct hwmon_channel_info) { \
.type = hwmon_##stype, \
.config = (u32 []) { \
__VA_ARGS__, 0 \
} \
})
/**
* Chip configuration
* @ops: Pointer to hwmon operations.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册