void mmc_host_deeper_disable(struct work_struct *work) { struct mmc_host *host = container_of(work, struct mmc_host, disable.work); /* If the host is claimed then we do not want to disable it anymore */ if (!mmc_try_claim_host(host)) return; mmc_host_do_disable(host, 1); mmc_do_release_host(host); }
void mmc_host_deeper_disable(struct work_struct *work) { struct mmc_host *host = container_of(work, struct mmc_host, disable.work); /* If the host is claimed then we do not want to disable it anymore */ if (!mmc_try_claim_host(host)) goto out; mmc_host_do_disable(host, 1); mmc_do_release_host(host); out: wake_unlock(&mmc_delayed_work_wake_lock); }
void mmc_host_deeper_disable(struct work_struct *work) { struct mmc_host *host = container_of(work, struct mmc_host, disable.work); /* If the host is claimed then we do not want to disable it anymore */ if (!mmc_try_claim_host(host)) goto out; mmc_host_do_disable(host, 1); mmc_do_release_host(host); out: #if 0 //Robert, 20101006, KB62_CR766 : Fix unexpectedly remove SD card issue wake_unlock(&mmc_delayed_work_wake_lock); #endif printk(KERN_ERR "mmc_try_claim_host(host) = 0\n"); }
/** * mmc_host_disable - disable a host. * @host: mmc host to disable * * Hosts that support power saving can use the 'enable' and 'disable' * methods to exit and enter power saving states. For more information * see comments for struct mmc_host_ops. */ int mmc_host_disable(struct mmc_host *host) { int err; if (!(host->caps & MMC_CAP_DISABLE)) return 0; if (host->en_dis_recurs) return 0; if (--host->nesting_cnt) return 0; if (!host->enabled) return 0; err = mmc_host_do_disable(host, 0); return err; }
/** * mmc_host_lazy_disable - lazily disable a host. * @host: mmc host to disable * * Hosts that support power saving can use the 'enable' and 'disable' * methods to exit and enter power saving states. For more information * see comments for struct mmc_host_ops. */ int mmc_host_lazy_disable(struct mmc_host *host) { if (!(host->caps & MMC_CAP_DISABLE)) return 0; if (host->en_dis_recurs) return 0; if (--host->nesting_cnt) return 0; if (!host->enabled) return 0; if (host->disable_delay) { return queue_delayed_work(workqueue, &host->disable, msecs_to_jiffies(host->disable_delay)); } else return mmc_host_do_disable(host, 1); }
/** * mmc_host_disable - disable a host. * @host: mmc host to disable * * Hosts that support power saving can use the 'enable' and 'disable' * methods to exit and enter power saving states. For more information * see comments for struct mmc_host_ops. */ int mmc_host_disable(struct mmc_host *host) { int err; if (!(host->caps & MMC_CAP_DISABLE)) { if(suspend_debug) printk("Disable MMC_CAP_DISABLE\n"); return 0; } if (host->en_dis_recurs) { if(suspend_debug) printk("Disable en_dis_recurs\n"); return 0; } if (--host->nesting_cnt) { if(suspend_debug) printk("disable NC %d\n",host->nesting_cnt); return 0; } if (!host->enabled) { if(suspend_debug) printk("disables enabled\n"); return 0; } err = mmc_host_do_disable(host, 0); return err; }