Skip to content

Commit

Permalink
hwmon: Add convience macro to define simple static sensors
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
charleskeepax authored and groeck committed Apr 16, 2019
1 parent b429ebc commit c43a113
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/linux/hwmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c43a113

Please sign in to comment.