Lines Matching refs:cdev_idx

156 	int cdev_idx;  in emc2305_get_cur_state()  local
159 cdev_idx = emc2305_get_cdev_idx(cdev); in emc2305_get_cur_state()
160 if (cdev_idx < 0) in emc2305_get_cur_state()
161 return cdev_idx; in emc2305_get_cur_state()
163 *state = data->cdev_data[cdev_idx].cur_state; in emc2305_get_cur_state()
174 static int __emc2305_set_cur_state(struct emc2305_data *data, int cdev_idx, unsigned long state) in __emc2305_set_cur_state() argument
180 state = max_t(unsigned long, state, data->cdev_data[cdev_idx].last_hwmon_state); in __emc2305_set_cur_state()
184 data->cdev_data[cdev_idx].cur_state = state; in __emc2305_set_cur_state()
186 ret = i2c_smbus_write_byte_data(client, EMC2305_REG_FAN_DRIVE(cdev_idx), val); in __emc2305_set_cur_state()
206 int cdev_idx, ret; in emc2305_set_cur_state() local
212 cdev_idx = emc2305_get_cdev_idx(cdev); in emc2305_set_cur_state()
213 if (cdev_idx < 0) in emc2305_set_cur_state()
214 return cdev_idx; in emc2305_set_cur_state()
217 data->cdev_data[cdev_idx].last_thermal_state = state; in emc2305_set_cur_state()
218 ret = __emc2305_set_cur_state(data, cdev_idx, state); in emc2305_set_cur_state()
291 int i, cdev_idx, ret; in emc2305_set_single_tz() local
293 cdev_idx = (idx) ? idx - 1 : 0; in emc2305_set_single_tz()
294 pwm = data->pwm_min[cdev_idx]; in emc2305_set_single_tz()
296 data->cdev_data[cdev_idx].cdev = in emc2305_set_single_tz()
300 if (IS_ERR(data->cdev_data[cdev_idx].cdev)) { in emc2305_set_single_tz()
302 return PTR_ERR(data->cdev_data[cdev_idx].cdev); in emc2305_set_single_tz()
306 ret = emc2305_set_pwm(dev, pwm, cdev_idx); in emc2305_set_single_tz()
316 data->cdev_data[cdev_idx].cur_state = in emc2305_set_single_tz()
317 EMC2305_PWM_DUTY2STATE(data->pwm_min[cdev_idx], data->max_state, in emc2305_set_single_tz()
319 data->cdev_data[cdev_idx].last_hwmon_state = in emc2305_set_single_tz()
320 EMC2305_PWM_DUTY2STATE(data->pwm_min[cdev_idx], data->max_state, in emc2305_set_single_tz()
394 int cdev_idx; in emc2305_write() local
403 cdev_idx = channel; in emc2305_write()
405 cdev_idx = 0; in emc2305_write()
406 data->cdev_data[cdev_idx].last_hwmon_state = in emc2305_write()
413 if (data->cdev_data[cdev_idx].last_hwmon_state >= in emc2305_write()
414 data->cdev_data[cdev_idx].last_thermal_state) in emc2305_write()
415 return __emc2305_set_cur_state(data, cdev_idx, in emc2305_write()
416 data->cdev_data[cdev_idx].last_hwmon_state); in emc2305_write()