From c43a113ca2c807c3e66a5de0ec57d69803b8bc10 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Wed, 20 Mar 2019 14:58:17 +0000 Subject: 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: Charles Keepax Signed-off-by: Guenter Roeck --- include/linux/hwmon.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/hwmon.h') diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 99e0c1b0b5fb..7a8cc06a0d61 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -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. -- cgit v1.2.3-59-g8ed1b