From b46272cb2a960530e369f6037f92eac5a67c17f7 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 30 Apr 2004 16:57:14 +0000 Subject: [PATCH] Add some temporary PWM debugging stuff. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2495 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/pc87360.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/chips/pc87360.c b/kernel/chips/pc87360.c index 9fca4791..5e38a469 100644 --- a/kernel/chips/pc87360.c +++ b/kernel/chips/pc87360.c @@ -117,9 +117,8 @@ static inline void superio_exit(void) #define FAN_CONFIG_INVERT(val,nr) (((val) >> (4 + nr * 3)) & 1) #define PWM_FROM_REG(val) (val) -#define PWM_TO_REG(val) (((val) < 0) ? 0 : \ - ((val) > 255) ? 255 : \ - (val)) +#define PWM_TO_REG(val) ((val) < 0 ? 0 : \ + (val) > 255 ? 255 : (val)) /* * Voltage registers and conversions @@ -823,7 +822,17 @@ void pc87360_pwm(struct i2c_client *client, int operation, int ctl_name, else if (operation == SENSORS_PROC_REAL_WRITE) { if (*nrels_mag >= 1) { +#ifdef DEBUG + printk(KERN_DEBUG "pc87360.o: Old PWM%u register: %u\n", + nr+1, data->pwm[nr]); + printk(KERN_DEBUG "pc87360.o: Wanted PWM%u value: %ld\n", + nr+1, results[0]); +#endif data->pwm[nr] = PWM_TO_REG(results[0]); +#ifdef DEBUG + printk(KERN_DEBUG "pc87360.o: Writing %u to register %u\n", + data->pwm[nr], PC87360_REG_PWM(nr)); +#endif pc87360_write_value(data, LD_FAN, NO_BANK, PC87360_REG_PWM(nr), data->pwm[nr]);