diff -Naur b/drivers/hwmon/w83792d.c c/drivers/hwmon/w83792d.c --- b/drivers/hwmon/w83792d.c 2005-07-15 12:56:55.018310250 +0200 +++ c/drivers/hwmon/w83792d.c 2005-07-15 13:17:57.829231000 +0200 @@ -111,7 +111,7 @@ 0xBD, /* FAN 6 Count Low Limit in DataSheet */ 0xBF /* FAN 7 Count Low Limit in DataSheet */ }; -#define W83792D_REG_FAN_CFG 0x84 /* FAN Configuration in DataSheet */ +#define W83792D_REG_FAN_CFG 0x84 /* FAN Configuration in DataSheet */ static const u8 W83792D_REG_FAN_DIV[4] = { 0x47, /* contains FAN2 and FAN1 Divisor */ 0x5B, /* contains FAN4 and FAN3 Divisor */ @@ -306,11 +306,11 @@ static int w83792d_read_value(struct i2c_client *client, u8 register); static int w83792d_write_value(struct i2c_client *client, u8 register, - u8 value); + u8 value); static struct w83792d_data *w83792d_update_device(struct device *dev); #ifdef DEBUG -static void w83792d_print_debug(struct w83792d_data *data); +static void w83792d_print_debug(struct w83792d_data *data, struct device *dev); #endif static void w83792d_init_client(struct i2c_client *client); @@ -368,7 +368,7 @@ } #define show_in_reg(reg) \ -static ssize_t show_##reg (struct device *dev, struct device_attribute *attr, \ +static ssize_t show_##reg(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \ @@ -381,8 +381,9 @@ show_in_reg(in_max); #define store_in_reg(REG, reg) \ -static ssize_t store_in_##reg (struct device *dev, struct device_attribute *attr, \ - const char *buf, size_t count) \ +static ssize_t store_in_##reg (struct device *dev, \ + struct device_attribute *attr, \ + const char *buf, size_t count) \ { \ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \ int nr = sensor_attr->index; \ @@ -429,10 +430,10 @@ char *buf) \ { \ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \ - int nr = sensor_attr->index; \ + int nr = sensor_attr->index - 1; \ struct w83792d_data *data = w83792d_update_device(dev); \ - return sprintf(buf,"%ld\n", \ - FAN_FROM_REG(data->reg[nr-1], (long)DIV_FROM_REG(data->fan_div[nr-1]))); \ + return sprintf(buf,"%d\n", \ + FAN_FROM_REG(data->reg[nr], DIV_FROM_REG(data->fan_div[nr]))); \ } show_fan_reg(fan); @@ -443,16 +444,15 @@ const char *buf, size_t count) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; val = simple_strtoul(buf, NULL, 10); - data->fan_min[nr - 1] = - FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr - 1])); - w83792d_write_value(client, W83792D_REG_FAN_MIN[nr - 1], - data->fan_min[nr - 1]); + data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); + w83792d_write_value(client, W83792D_REG_FAN_MIN[nr], + data->fan_min[nr]); return count; } @@ -464,8 +464,7 @@ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index; struct w83792d_data *data = w83792d_update_device(dev); - return sprintf(buf, "%ld\n", - (long) DIV_FROM_REG(data->fan_div[nr - 1])); + return sprintf(buf, "%u\n", DIV_FROM_REG(data->fan_div[nr - 1])); } /* Note: we save and restore the fan minimum here, because its value is @@ -507,11 +506,11 @@ #define sysfs_fan(offset) \ static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \ -offset); \ + offset); \ static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ -show_fan_div, store_fan_div, offset); \ + show_fan_div, store_fan_div, offset); \ static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ -show_fan_min, store_fan_min, offset); + show_fan_min, store_fan_min, offset); sysfs_fan(1); sysfs_fan(2); @@ -537,7 +536,7 @@ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index; struct w83792d_data *data = w83792d_update_device(dev); - return sprintf(buf,"%ld\n", (long)TEMP1_FROM_REG(data->temp1[nr])); + return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->temp1[nr])); } static ssize_t store_temp1(struct device *dev, struct device_attribute *attr, @@ -611,11 +610,11 @@ #define sysfs_temp23(name,idx) \ static SENSOR_DEVICE_ATTR_2(name##_input, S_IRUGO, show_temp23, NULL, \ -idx, 0); \ + idx, 0); \ static SENSOR_DEVICE_ATTR_2(name##_max, S_IRUGO | S_IWUSR, \ -show_temp23, store_temp23, idx, 2); \ + show_temp23, store_temp23, idx, 2); \ static SENSOR_DEVICE_ATTR_2(name##_max_hyst, S_IRUGO | S_IWUSR, \ -show_temp23, store_temp23, idx, 4); + show_temp23, store_temp23, idx, 4); sysfs_temp23(temp2,0) sysfs_temp23(temp3,1) @@ -659,16 +658,22 @@ char *buf) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + int nr = sensor_attr->index - 1; struct w83792d_data *data = w83792d_update_device(dev); long pwm_enable_tmp = 1; - if (data->pwmenable[nr-1] == 0) { + + switch (data->pwmenable[nr]) { + case 0: pwm_enable_tmp = 1; /* manual mode */ - } else if (data->pwmenable[nr-1] == 1) { - pwm_enable_tmp = 3; /* thermal cruise/Smart Fan I */ - } else if (data->pwmenable[nr-1] == 2) { - pwm_enable_tmp = 2; /* Smart Fan II */ + break; + case 1: + pwm_enable_tmp = 3; /*thermal cruise/Smart Fan I */ + break; + case 2: + pwm_enable_tmp = 2; /* Smart Fan II */ + break; } + return sprintf(buf, "%ld\n", pwm_enable_tmp); } @@ -677,15 +682,14 @@ const char *buf, size_t count) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; val = simple_strtoul(buf, NULL, 10); - - data->pwm[nr-1] = PWM_TO_REG(val); - w83792d_write_value(client, W83792D_REG_PWM[nr-1], data->pwm[nr-1]); + data->pwm[nr] = PWM_TO_REG(val); + w83792d_write_value(client, W83792D_REG_PWM[nr], data->pwm[nr]); return count; } @@ -695,23 +699,22 @@ const char *buf, size_t count) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 fan_cfg_tmp, cfg1_tmp, cfg2_tmp, cfg3_tmp, cfg4_tmp; val = simple_strtoul(buf, NULL, 10); - switch (val) { case 1: - data->pwmenable[nr-1] = 0; /* manual mode */ + data->pwmenable[nr] = 0; /* manual mode */ break; case 2: - data->pwmenable[nr-1] = 2; /* Smart Fan II */ + data->pwmenable[nr] = 2; /* Smart Fan II */ break; case 3: - data->pwmenable[nr-1] = 1; /* thermal cruise/Smart Fan I */ + data->pwmenable[nr] = 1; /* thermal cruise/Smart Fan I */ break; default: return -EINVAL; @@ -728,9 +731,9 @@ #define sysfs_pwm(offset) \ static SENSOR_DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ -show_pwm, store_pwm, offset); \ + show_pwm, store_pwm, offset); \ static SENSOR_DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, \ -show_pwmenable, store_pwmenable, offset); \ + show_pwmenable, store_pwmenable, offset); \ sysfs_pwm(1); sysfs_pwm(2); @@ -755,33 +758,33 @@ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index; struct w83792d_data *data = w83792d_update_device(dev); - return sprintf(buf, "%ld\n", (long)data->pwm_mode[nr-1]); + return sprintf(buf, "%d\n", data->pwm_mode[nr-1]); } static ssize_t store_pwm_mode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 pwm_mode_mask = 0; val = simple_strtoul(buf, NULL, 10); - data->pwm_mode[nr-1] = SENSORS_LIMIT(val, 0, 1); + data->pwm_mode[nr] = SENSORS_LIMIT(val, 0, 1); pwm_mode_mask = w83792d_read_value(client, - W83792D_REG_PWM[nr-1]) & 0x7f; - w83792d_write_value(client, W83792D_REG_PWM[nr-1], - ((data->pwm_mode[nr-1]) << 7) | pwm_mode_mask); + W83792D_REG_PWM[nr]) & 0x7f; + w83792d_write_value(client, W83792D_REG_PWM[nr], + ((data->pwm_mode[nr]) << 7) | pwm_mode_mask); return count; } #define sysfs_pwm_mode(offset) \ static SENSOR_DEVICE_ATTR(pwm##offset##_mode, S_IRUGO | S_IWUSR, \ -show_pwm_mode, store_pwm_mode, offset); + show_pwm_mode, store_pwm_mode, offset); sysfs_pwm_mode(1); sysfs_pwm_mode(2); @@ -798,7 +801,7 @@ char *buf) { struct w83792d_data *data = w83792d_update_device(dev); - return sprintf(buf, "%ld\n", (long)data->chassis); + return sprintf(buf, "%d\n", data->chassis); } static DEVICE_ATTR(chassis, S_IRUGO, show_regs_chassis, NULL); @@ -813,7 +816,7 @@ show_chassis_clear(struct device *dev, struct device_attribute *attr, char *buf) { struct w83792d_data *data = w83792d_update_device(dev); - return sprintf(buf, "%ld\n", (long)data->chassis_clear); + return sprintf(buf, "%d\n", data->chassis_clear); } static ssize_t @@ -861,28 +864,27 @@ store_thermal_cruise(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 target_tmp=0, target_mask=0; val = simple_strtoul(buf, NULL, 10); - target_tmp = val; target_tmp = target_tmp & 0x7f; - target_mask = w83792d_read_value(client, W83792D_REG_THERMAL[nr-1]) & 0x80; - data->thermal_cruise[nr-1] = SENSORS_LIMIT(target_tmp, 0, 255); - w83792d_write_value(client, W83792D_REG_THERMAL[nr-1], - (data->thermal_cruise[nr-1]) | target_mask); + target_mask = w83792d_read_value(client, W83792D_REG_THERMAL[nr]) & 0x80; + data->thermal_cruise[nr] = SENSORS_LIMIT(target_tmp, 0, 255); + w83792d_write_value(client, W83792D_REG_THERMAL[nr], + (data->thermal_cruise[nr]) | target_mask); return count; } #define sysfs_thermal_cruise(offset) \ static SENSOR_DEVICE_ATTR(thermal_cruise##offset, S_IRUGO | S_IWUSR, \ -show_thermal_cruise, store_thermal_cruise, offset); + show_thermal_cruise, store_thermal_cruise, offset); sysfs_thermal_cruise(1); sysfs_thermal_cruise(2); @@ -890,7 +892,8 @@ #define device_create_file_thermal_cruise(client, offset) \ do { \ -device_create_file(&client->dev, &sensor_dev_attr_thermal_cruise##offset.dev_attr); \ +device_create_file(&client->dev, \ +&sensor_dev_attr_thermal_cruise##offset.dev_attr); \ } while (0) @@ -909,24 +912,23 @@ store_tolerance(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); - int nr = sensor_attr->index; + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); + int nr = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 tol_tmp, tol_mask; val = simple_strtoul(buf, NULL, 10); - tol_mask = w83792d_read_value(client, - W83792D_REG_TOLERANCE[nr - 1]) & ((nr == 2) ? 0x0f : 0xf0); + W83792D_REG_TOLERANCE[nr]) & ((nr == 1) ? 0x0f : 0xf0); tol_tmp = SENSORS_LIMIT(val, 0, 15); tol_tmp &= 0x0f; - data->tolerance[nr - 1] = tol_tmp; - if (nr == 2) { + data->tolerance[nr] = tol_tmp; + if (nr == 1) { tol_tmp <<= 4; } - w83792d_write_value(client, W83792D_REG_TOLERANCE[nr - 1], + w83792d_write_value(client, W83792D_REG_TOLERANCE[nr], tol_mask | tol_tmp); return count; @@ -934,7 +936,7 @@ #define sysfs_tolerance(offset) \ static SENSOR_DEVICE_ATTR(tolerance##offset, S_IRUGO | S_IWUSR, \ -show_tolerance, store_tolerance, offset); + show_tolerance, store_tolerance, offset); sysfs_tolerance(1); sysfs_tolerance(2); @@ -963,27 +965,26 @@ const char *buf, size_t count) { struct sensor_device_attribute_2 *sensor_attr = to_sensor_dev_attr_2(attr); - int nr = sensor_attr->nr; - int index = sensor_attr->index; + int nr = sensor_attr->nr - 1; + int index = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 mask_tmp = 0; val = simple_strtoul(buf, NULL, 10); - - data->sf2_points[index-1][nr-1] = SENSORS_LIMIT(val, 0, 127); - mask_tmp = w83792d_read_value(client, - W83792D_REG_POINTS[index-1][nr-1]) & 0x80; - w83792d_write_value(client, W83792D_REG_POINTS[index-1][nr-1], - mask_tmp|data->sf2_points[index-1][nr-1]); + data->sf2_points[index][nr] = SENSORS_LIMIT(val, 0, 127); + mask_tmp = w83792d_read_value(client, + W83792D_REG_POINTS[index][nr]) & 0x80; + w83792d_write_value(client, W83792D_REG_POINTS[index][nr], + mask_tmp|data->sf2_points[index][nr]); return count; } #define sysfs_sf2_point(offset, index) \ static SENSOR_DEVICE_ATTR_2(sf2_point##offset##_fan##index, S_IRUGO | S_IWUSR, \ -show_sf2_point, store_sf2_point, offset, index); + show_sf2_point, store_sf2_point, offset, index); sysfs_sf2_point(1, 1); /* Fan1 */ sysfs_sf2_point(2, 1); /* Fan1 */ @@ -1023,31 +1024,29 @@ { struct sensor_device_attribute_2 *sensor_attr = to_sensor_dev_attr_2(attr); int nr = sensor_attr->nr; - int index = sensor_attr->index; + int index = sensor_attr->index - 1; struct i2c_client *client = to_i2c_client(dev); struct w83792d_data *data = i2c_get_clientdata(client); u32 val; u8 mask_tmp=0, level_tmp=0; val = simple_strtoul(buf, NULL, 10); - - data->sf2_levels[index - 1][nr] = - SENSORS_LIMIT((val * 15) / 100, 0, 15); - mask_tmp = w83792d_read_value(client, W83792D_REG_LEVELS[index - 1][nr]) + data->sf2_levels[index][nr] = SENSORS_LIMIT((val * 15) / 100, 0, 15); + mask_tmp = w83792d_read_value(client, W83792D_REG_LEVELS[index][nr]) & ((nr==3) ? 0xf0 : 0x0f); if (nr==3) { - level_tmp = data->sf2_levels[index-1][nr]; + level_tmp = data->sf2_levels[index][nr]; } else { - level_tmp = data->sf2_levels[index-1][nr] << 4; + level_tmp = data->sf2_levels[index][nr] << 4; } - w83792d_write_value(client, W83792D_REG_LEVELS[index-1][nr], level_tmp | mask_tmp); + w83792d_write_value(client, W83792D_REG_LEVELS[index][nr], level_tmp | mask_tmp); return count; } #define sysfs_sf2_level(offset, index) \ static SENSOR_DEVICE_ATTR_2(sf2_level##offset##_fan##index, S_IRUGO | S_IWUSR, \ -show_sf2_level, store_sf2_level, offset, index); + show_sf2_level, store_sf2_level, offset, index); sysfs_sf2_level(1, 1); /* Fan1 */ sysfs_sf2_level(2, 1); /* Fan1 */ @@ -1220,7 +1219,8 @@ } /* If Winbond chip, address of chip and W83792D_REG_I2C_ADDR should match */ - if (w83792d_read_value(new_client, W83792D_REG_I2C_ADDR) != address) { + if (w83792d_read_value(new_client, + W83792D_REG_I2C_ADDR) != address) { dev_warn(&new_client->dev, "Detection failed " "at step 5\n"); goto ERROR1; @@ -1246,10 +1246,11 @@ kind = w83792d; } else { if (kind == 0) - printk - (KERN_WARNING "w83792d: Ignoring 'force' parameter for unknown chip at" - "adapter %d, address 0x%02x\n", - i2c_adapter_id(adapter), address); + dev_warn(&new_client->dev, + "w83792d: Ignoring 'force' parameter for" + " unknown chip at adapter %d, address" + " 0x%02x\n", i2c_adapter_id(adapter), + address); goto ERROR1; } } @@ -1257,8 +1258,8 @@ if (kind == w83792d) { client_name = "w83792d"; } else { - dev_warn(&new_client->dev, "w83792d: Internal error: unknown kind (%d)?!?", - kind); + dev_err(&new_client->dev, "w83792d: Internal error: unknown" + " kind (%d)?!?", kind); goto ERROR1; } @@ -1374,7 +1375,7 @@ if ((err = i2c_detach_client(client))) { dev_err(&client->dev, - "Client deregistration failed, client not detached.\n"); + "Client deregistration failed, client not detached.\n"); return err; } @@ -1455,7 +1456,7 @@ if (time_after (jiffies - data->last_updated, (unsigned long) (HZ * 3)) || time_before(jiffies, data->last_updated) || !data->valid) { - dev_warn(dev, "Starting device update\n"); + dev_dbg(dev, "Starting device update\n"); /* Update the voltages measured value and limits */ for (i = 0; i < 9; i++) { @@ -1489,7 +1490,8 @@ data->pwmenable[2] = (reg_tmp>>4) & 0x03; for (i = 0; i < 3; i++) { - data->temp1[i] = w83792d_read_value(client, W83792D_REG_TEMP1[i]); + data->temp1[i] = w83792d_read_value(client, + W83792D_REG_TEMP1[i]); } for (i = 0; i < 2; i++) { for (j = 0; j < 6; j++) { @@ -1500,7 +1502,8 @@ /* Update the Fan Divisor */ for (i = 0; i < 4; i++) { - reg_array_tmp[i] = w83792d_read_value(client, W83792D_REG_FAN_DIV[i]); + reg_array_tmp[i] = w83792d_read_value(client, + W83792D_REG_FAN_DIV[i]); } data->fan_div[0] = reg_array_tmp[0] & 0x07; data->fan_div[1] = (reg_array_tmp[0] >> 4) & 0x07; @@ -1532,8 +1535,8 @@ reg_tmp = w83792d_read_value(client, W83792D_REG_TOLERANCE[0]); data->tolerance[0] = reg_tmp & 0x0f; data->tolerance[1] = (reg_tmp >> 4) & 0x0f; - data->tolerance[2] = - w83792d_read_value(client, W83792D_REG_TOLERANCE[2]) & 0x0f; + data->tolerance[2] = w83792d_read_value(client, + W83792D_REG_TOLERANCE[2]) & 0x0f; /* Update Smart Fan II temperature points */ for (i = 0; i < 3; i++) { @@ -1562,48 +1565,49 @@ up(&data->update_lock); #ifdef DEBUG - w83792d_print_debug(data); + w83792d_print_debug(data, dev); #endif return data; } #ifdef DEBUG -static void w83792d_print_debug(struct w83792d_data *data) +static void w83792d_print_debug(struct w83792d_data *data, struct device *dev) { int i=0, j=0; - printk(KERN_DEBUG "==========The following is the debug message...========\n"); - printk(KERN_DEBUG "9 set of Voltages: =====>\n"); - for (i=0; i<=8; i++) { - printk(KERN_DEBUG "vin[%d] is: 0x%x\n", i, data->in[i]); - printk(KERN_DEBUG "vin[%d] max is: 0x%x\n", i, data->in_max[i]); - printk(KERN_DEBUG "vin[%d] min is: 0x%x\n", i, data->in_min[i]); - } - printk(KERN_DEBUG "Low Bit1 is: 0x%x\n", data->low_bits[0]); - printk(KERN_DEBUG "Low Bit2 is: 0x%x\n", data->low_bits[1]); - printk(KERN_DEBUG "7 set of Fan Counts and Duty Cycles: =====>\n"); - for (i=0; i<=6; i++) { - printk(KERN_DEBUG "fan[%d] is: 0x%x\n", i, data->fan[i]); - printk(KERN_DEBUG "fan[%d] min is: 0x%x\n", i, data->fan_min[i]); - printk(KERN_DEBUG "pwm[%d] is: 0x%x\n", i, data->pwm[i]); - printk(KERN_DEBUG "pwm_mode[%d] is: 0x%x\n", i, data->pwm_mode[i]); - } - printk(KERN_DEBUG "3 set of Temperatures: =====>\n"); - for (i=0; i<=3; i++) { - printk(KERN_DEBUG "temp1[%d] is: 0x%x\n", i, data->temp1[i]); - } - - for (i=0; i<=2; i++) { - for (j=0; j<=6; j++) { - printk(KERN_DEBUG "temp_add[%d][%d] is: 0x%x\n", i, j, data->temp_add[i][j]); + dev_dbg(dev, "==========The following is the debug message...========\n"); + dev_dbg(dev, "9 set of Voltages: =====>\n"); + for (i=0; i<9; i++) { + dev_dbg(dev, "vin[%d] is: 0x%x\n", i, data->in[i]); + dev_dbg(dev, "vin[%d] max is: 0x%x\n", i, data->in_max[i]); + dev_dbg(dev, "vin[%d] min is: 0x%x\n", i, data->in_min[i]); + } + dev_dbg(dev, "Low Bit1 is: 0x%x\n", data->low_bits[0]); + dev_dbg(dev, "Low Bit2 is: 0x%x\n", data->low_bits[1]); + dev_dbg(dev, "7 set of Fan Counts and Duty Cycles: =====>\n"); + for (i=0; i<7; i++) { + dev_dbg(dev, "fan[%d] is: 0x%x\n", i, data->fan[i]); + dev_dbg(dev, "fan[%d] min is: 0x%x\n", i, data->fan_min[i]); + dev_dbg(dev, "pwm[%d] is: 0x%x\n", i, data->pwm[i]); + dev_dbg(dev, "pwm_mode[%d] is: 0x%x\n", i, data->pwm_mode[i]); + } + dev_dbg(dev, "3 set of Temperatures: =====>\n"); + for (i=0; i<3; i++) { + dev_dbg(dev, "temp1[%d] is: 0x%x\n", i, data->temp1[i]); + } + + for (i=0; i<2; i++) { + for (j=0; j<6; j++) { + dev_dbg(dev, "temp_add[%d][%d] is: 0x%x\n", i, j, + data->temp_add[i][j]); } } - for (i=0; i<=6; i++) { - printk(KERN_DEBUG "fan_div[%d] is: 0x%x\n", i, data->fan_div[i]); + for (i=0; i<7; i++) { + dev_dbg(dev, "fan_div[%d] is: 0x%x\n", i, data->fan_div[i]); } - printk(KERN_DEBUG "==========End of the debug message...==================\n"); - printk(KERN_DEBUG "\n"); + dev_dbg(dev, "==========End of the debug message...==================\n"); + dev_dbg(dev, "\n"); } #endif