mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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 <ckeepax@opensource.cirrus.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
b429ebc86f
commit
c43a113ca2
1 changed files with 8 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue