File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 28
28
#define EMC2305_TACH_RANGE_MIN 480
29
29
#define EMC2305_DEFAULT_OUTPUT 0x0
30
30
#define EMC2305_DEFAULT_POLARITY 0x0
31
+ #define EMC2305_REG_POLARITY 0x2a
32
+ #define EMC2305_REG_DRIVE_PWM_OUT 0x2b
33
+ #define EMC2305_OPEN_DRAIN 0x0
34
+ #define EMC2305_PUSH_PULL 0x1
31
35
32
36
#define EMC2305_PWM_DUTY2STATE (duty , max_state , pwm_max ) \
33
37
DIV_ROUND_CLOSEST((duty) * (max_state), (pwm_max))
@@ -686,6 +690,16 @@ static int emc2305_probe(struct i2c_client *client)
686
690
}
687
691
}
688
692
693
+ ret = i2c_smbus_write_byte_data (client , EMC2305_REG_DRIVE_PWM_OUT ,
694
+ data -> pwm_output_mask );
695
+ if (ret < 0 )
696
+ dev_err (dev , "Failed to configure pwm output, using default\n" );
697
+
698
+ ret = i2c_smbus_write_byte_data (client , EMC2305_REG_POLARITY ,
699
+ data -> pwm_polarity_mask );
700
+ if (ret < 0 )
701
+ dev_err (dev , "Failed to configure pwm polarity, using default\n" );
702
+
689
703
for (i = 0 ; i < data -> pwm_num ; i ++ ) {
690
704
ret = i2c_smbus_write_byte_data (client , EMC2305_REG_FAN_MIN_DRIVE (i ),
691
705
data -> pwm_min [i ]);
You can’t perform that action at this time.
0 commit comments