Skip to content

Commit 7114b74

Browse files
Florin Leotescugroeck
authored andcommitted
hwmon: (emc2305) Add support for PWM frequency, polarity and output
Add three new attributes to the driver data structures to support configuration of PWM frequency, PWM polarity and PWM output config. Signed-off-by: Florin Leotescu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 90cf254 commit 7114b74

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/hwmon/emc2305.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,23 @@ struct emc2305_cdev_data {
8989
* @hwmon_dev: hwmon device
9090
* @max_state: maximum cooling state of the cooling device
9191
* @pwm_num: number of PWM channels
92+
* @pwm_output_mask: PWM output mask
93+
* @pwm_polarity_mask: PWM polarity mask
9294
* @pwm_separate: separate PWM settings for every channel
9395
* @pwm_min: array of minimum PWM per channel
96+
* @pwm_freq: array of PWM frequency per channel
9497
* @cdev_data: array of cooling devices data
9598
*/
9699
struct emc2305_data {
97100
struct i2c_client *client;
98101
struct device *hwmon_dev;
99102
u8 max_state;
100103
u8 pwm_num;
104+
u8 pwm_output_mask;
105+
u8 pwm_polarity_mask;
101106
bool pwm_separate;
102107
u8 pwm_min[EMC2305_PWM_MAX];
108+
u16 pwm_freq[EMC2305_PWM_MAX];
103109
struct emc2305_cdev_data cdev_data[EMC2305_PWM_MAX];
104110
};
105111

include/linux/platform_data/emc2305.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
* struct emc2305_platform_data - EMC2305 driver platform data
1010
* @max_state: maximum cooling state of the cooling device;
1111
* @pwm_num: number of active channels;
12+
* @pwm_output_mask: PWM output mask
13+
* @pwm_polarity_mask: PWM polarity mask
1214
* @pwm_separate: separate PWM settings for every channel;
1315
* @pwm_min: array of minimum PWM per channel;
16+
* @pwm_freq: array of PWM frequency per channel
1417
*/
1518
struct emc2305_platform_data {
1619
u8 max_state;
1720
u8 pwm_num;
21+
u8 pwm_output_mask;
22+
u8 pwm_polarity_mask;
1823
bool pwm_separate;
1924
u8 pwm_min[EMC2305_PWM_MAX];
25+
u16 pwm_freq[EMC2305_PWM_MAX];
2026
};
2127

2228
#endif

0 commit comments

Comments
 (0)