Browse Source

Set the fanspeed on bflsc to max if we don't know the temperature.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
e172c987f3
  1. 8
      driver-bflsc.c

8
driver-bflsc.c

@ -1905,17 +1905,19 @@ static int64_t bflsc_scanwork(struct thr_info *thr)
return ret; return ret;
} }
/* Set the fanspeed to auto for any valid value under 60, or max for any value
* above 60 or if we don't know the temperature. */
static void bflsc_set_fanspeed(struct cgpu_info *bflsc) static void bflsc_set_fanspeed(struct cgpu_info *bflsc)
{ {
struct bflsc_info *sc_info = (struct bflsc_info *)bflsc->device_data; struct bflsc_info *sc_info = (struct bflsc_info *)bflsc->device_data;
int amount, err; int amount, err;
if ((bflsc->temp <= 60 && sc_info->fanauto) || if ((bflsc->temp <= 60 && bflsc->temp > 0 && sc_info->fanauto) ||
(bflsc->temp > 60 && !sc_info->fanauto)) ((bflsc->temp > 60 || !bflsc->temp) && !sc_info->fanauto))
return; return;
mutex_lock(&bflsc->device_mutex); mutex_lock(&bflsc->device_mutex);
if (bflsc->temp > 60) { if (bflsc->temp > 60 || !bflsc->temp) {
write_to_dev(bflsc, 0, BFLSC_FAN4, BFLSC_FAN4_LEN, &amount, write_to_dev(bflsc, 0, BFLSC_FAN4, BFLSC_FAN4_LEN, &amount,
C_SETFAN); C_SETFAN);
sc_info->fanauto = false; sc_info->fanauto = false;

Loading…
Cancel
Save