236 } else { |
236 } else { |
237 fsm->slave_states = 0x00; |
237 fsm->slave_states = 0x00; |
238 } |
238 } |
239 |
239 |
240 if (fsm->rescan_required) { |
240 if (fsm->rescan_required) { |
241 down(&master->scan_sem); |
241 ec_mutex_lock(&master->scan_mutex); |
242 if (!master->allow_scan) { |
242 if (!master->allow_scan) { |
243 up(&master->scan_sem); |
243 ec_mutex_unlock(&master->scan_mutex); |
244 } else { |
244 } else { |
245 master->scan_busy = 1; |
245 master->scan_busy = 1; |
246 up(&master->scan_sem); |
246 ec_mutex_unlock(&master->scan_mutex); |
247 |
247 |
248 // clear all slaves and scan the bus |
248 // clear all slaves and scan the bus |
249 fsm->rescan_required = 0; |
249 fsm->rescan_required = 0; |
250 fsm->idle = 0; |
250 fsm->idle = 0; |
251 fsm->scan_jiffies = jiffies; |
251 fsm->scan_jiffies = jiffies; |
568 // Does the slave have to be configured? |
568 // Does the slave have to be configured? |
569 if ((slave->current_state != slave->requested_state |
569 if ((slave->current_state != slave->requested_state |
570 || slave->force_config) && !slave->error_flag) { |
570 || slave->force_config) && !slave->error_flag) { |
571 |
571 |
572 // Start slave configuration, if it is allowed. |
572 // Start slave configuration, if it is allowed. |
573 down(&master->config_sem); |
573 ec_mutex_lock(&master->config_mutex); |
574 if (!master->allow_config) { |
574 if (!master->allow_config) { |
575 up(&master->config_sem); |
575 ec_mutex_unlock(&master->config_mutex); |
576 } else { |
576 } else { |
577 master->config_busy = 1; |
577 master->config_busy = 1; |
578 up(&master->config_sem); |
578 ec_mutex_unlock(&master->config_mutex); |
579 |
579 |
580 if (master->debug_level) { |
580 if (master->debug_level) { |
581 char old_state[EC_STATE_STRING_SIZE], |
581 char old_state[EC_STATE_STRING_SIZE], |
582 new_state[EC_STATE_STRING_SIZE]; |
582 new_state[EC_STATE_STRING_SIZE]; |
583 ec_state_string(slave->current_state, old_state, 0); |
583 ec_state_string(slave->current_state, old_state, 0); |