Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363043
b: refs/heads/master
c: 8e9285b
h: refs/heads/master
i:
  363041: 964130d
  363039: 6599a4d
v: v3
  • Loading branch information
Guenter Roeck committed Apr 8, 2013
1 parent 2ad4e09 commit a9ad39f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbd8decd4123648ddeba2be485bc7e1a3117bfe4
refs/heads/master: 8e9285b0bb2ab48924032147baa29699c0bbee7c
33 changes: 33 additions & 0 deletions trunk/drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -3364,6 +3364,32 @@ nct6775_check_fan_inputs(const struct nct6775_sio_data *sio_data,
return 0;
}

static void add_temp_sensors(struct nct6775_data *data, const u16 *regp,
int *available, int *mask)
{
int i;
u8 src;

for (i = 0; i < data->pwm_num && *available; i++) {
int index;

if (!regp[i])
continue;
src = nct6775_read_value(data, regp[i]);
src &= 0x1f;
if (!src || (*mask & (1 << src)))
continue;
if (src >= data->temp_label_num ||
!strlen(data->temp_label[src]))
continue;

index = __ffs(*available);
nct6775_write_value(data, data->REG_TEMP_SOURCE[index], src);
*available &= ~(1 << index);
*mask |= 1 << src;
}
}

static int nct6775_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand Down Expand Up @@ -3614,6 +3640,13 @@ static int nct6775_probe(struct platform_device *pdev)
mask |= 1 << src;
}

/*
* Now find unmonitored temperature registers and enable monitoring
* if additional monitoring registers are available.
*/
add_temp_sensors(data, data->REG_TEMP_SEL, &available, &mask);
add_temp_sensors(data, data->REG_WEIGHT_TEMP_SEL, &available, &mask);

mask = 0;
s = NUM_TEMP_FIXED; /* First dynamic temperature attribute */
for (i = 0; i < num_reg_temp; i++) {
Expand Down

0 comments on commit a9ad39f

Please sign in to comment.