本文整理汇总了C++中pm_runtime_suspended函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_suspended函数的具体用法?C++ pm_runtime_suspended怎么用?C++ pm_runtime_suspended使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_suspended函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xhci_msm_pm_resume
static int xhci_msm_pm_resume(struct device *dev)
{
dev_dbg(dev, "xhci-msm PM resume\n");
if (pm_runtime_suspended(dev))
return 0;
if (phy)
return usb_phy_set_suspend(phy, 0);
return 0;
}
示例2: zynq_gpio_resume
static int __maybe_unused zynq_gpio_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct zynq_gpio *gpio = platform_get_drvdata(pdev);
if (!device_may_wakeup(dev)) {
if (!pm_runtime_suspended(dev))
return clk_enable(gpio->clk);
}
return 0;
}
示例3: exnos_usb_switch_worker
static void exnos_usb_switch_worker(struct work_struct *work)
{
struct exynos_usb_switch *usb_switch =
container_of(work, struct exynos_usb_switch, switch_work);
int cnt = 0;
mutex_lock(&usb_switch->mutex);
/* If already device detached or host_detected, */
if (!is_device_detect(usb_switch) || is_host_detect(usb_switch))
goto done;
if (!usb_switch->ehci_dev || !usb_switch->ohci_dev)
goto detect;
while (!pm_runtime_suspended(usb_switch->ehci_dev) ||
!pm_runtime_suspended(usb_switch->ohci_dev)) {
mutex_unlock(&usb_switch->mutex);
msleep(SWITCH_WAIT_TIME);
mutex_lock(&usb_switch->mutex);
/* If already device detached or host_detected, */
if (!is_device_detect(usb_switch) || is_host_detect(usb_switch))
goto done;
if (cnt++ > WAIT_TIMES) {
printk(KERN_ERR "%s:device not attached by host\n",
__func__);
goto done;
}
}
if (cnt > 1)
printk(KERN_INFO "Device wait host power during %d\n", (cnt-1));
detect:
/* Check Device, VBUS PIN high active */
exynos_change_usb_mode(usb_switch, USB_DEVICE_ATTACHED);
done:
mutex_unlock(&usb_switch->mutex);
}
示例4: escore_system_suspend
static int escore_system_suspend(struct device *dev)
{
struct escore_priv *escore = &escore_priv;
int ret = 0;
pr_info("%s(): @@@@@@ Entry #####\n", __func__);
dev_dbg(dev, "%s()\n", __func__);
if (escore->dev != dev) {
dev_dbg(dev, "%s() Invalid device\n", __func__);
return 0;
}
/* if (!es_ready_to_suspend(escore)) {
dev_dbg(dev, "%s() - Not ready for suspend\n", __func__);
return -EBUSY;
}
if (escore->disable_codec_irq) {
ret = escore->disable_codec_irq(escore);
if (ret < 0) {
dev_err(dev, "%s(): Disable irq failed\n",
__func__);
return -EBUSY;
}
pr_info("%s(): @@@@@@ disable_codec_irq #####\n", __func__);
}*/
if (!pm_runtime_suspended(dev)) {
dev_dbg(dev, "%s() system suspend\n", __func__);
mutex_lock(&escore->access_lock);
ret = escore_runtime_suspend(dev);
/*
* If runtime-PM still thinks it's active, then make sure its
* status is in sync with HW status.
* If runtime suspend is not executed yet, RPM status is
* RPM_ACTIVE. System suspend changes chip status to suspend
* and hence RPM status needs to be updated manually to match
* actual chip status. This can be done by disabling RPM,
* changing RPM status and enabling RPM again.
*/
if (!ret) {
pm_runtime_disable(dev);
pm_runtime_set_suspended(dev);
pm_runtime_enable(dev);
}
mutex_unlock(&escore->access_lock);
}
dev_dbg(dev, "%s() complete %d\n", __func__, ret);
pr_info("%s(): @@@@@@ Exit #####\n", __func__);
return ret;
}
示例5: omap_usb3_remove
static int omap_usb3_remove(struct platform_device *pdev)
{
struct omap_usb *phy = platform_get_drvdata(pdev);
clk_unprepare(phy->wkupclk);
clk_unprepare(phy->optclk);
usb_remove_phy(&phy->phy);
if (!pm_runtime_suspended(&pdev->dev))
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0;
}
示例6: apds990x_prox_show
static ssize_t apds990x_prox_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
ssize_t ret;
struct apds990x_chip *chip = dev_get_drvdata(dev);
if (pm_runtime_suspended(dev) || !chip->prox_en)
return -EIO;
mutex_lock(&chip->mutex);
ret = sprintf(buf, "%d\n", chip->prox_data);
mutex_unlock(&chip->mutex);
return ret;
}
示例7: xgpiops_suspend
static int xgpiops_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct xgpiops *gpio = platform_get_drvdata(pdev);
if (!device_may_wakeup(dev)) {
if (!pm_runtime_suspended(dev))
clk_disable(gpio->clk);
return 0;
}
return 0;
}
示例8: lm3561_resume_sleep
static int lm3561_resume_sleep(struct device *dev)
{
int rc;
struct lm3561_platform_data *pdata = dev->platform_data;
if (!pm_runtime_suspended(dev)) {
pm_runtime_put(dev);
rc = lm3561_resume(dev);
} else
rc = pdata->power ? pdata->power(dev, true) : 0;
dev_dbg(dev, "%s: resumed (%d)\n", __func__, rc);
return rc;
}
示例9: sirf_resume
static int __maybe_unused sirf_resume(struct device *dev)
{
struct sirf_data *data = dev_get_drvdata(dev);
int ret = 0;
if (data->wakeup)
enable_irq(data->irq);
if (!pm_runtime_suspended(dev))
ret = sirf_runtime_resume(dev);
return ret;
}
示例10: apds990x_refresh_athres
/* Called always with mutex locked */
static int apds990x_refresh_athres(struct apds990x_chip *chip)
{
int ret;
/* If the chip is not in use, don't try to access it */
if (pm_runtime_suspended(&chip->client->dev))
return 0;
ret = apds990x_write_word(chip, APDS990X_AILTL,
apds990x_lux_to_threshold(chip, chip->lux_thres_lo));
ret |= apds990x_write_word(chip, APDS990X_AIHTL,
apds990x_lux_to_threshold(chip, chip->lux_thres_hi));
return ret;
}
示例11: atmel_hlcdc_dc_drm_resume
static int atmel_hlcdc_dc_drm_resume(struct device *dev)
{
struct drm_device *drm_dev = dev_get_drvdata(dev);
struct drm_crtc *crtc;
if (pm_runtime_suspended(dev))
return 0;
drm_modeset_lock_all(drm_dev);
list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head)
atmel_hlcdc_crtc_resume(crtc);
drm_modeset_unlock_all(drm_dev);
return 0;
}
示例12: exynos_drd_switch_is_host_off
/**
* exynos_drd_switch_is_host_off - check host's PM status.
*
* @otg: Pointer to the usb_otg structure.
*
* Before peripheral can start two conditions must be met:
* 1. Host's completely resumed after system sleep.
* 2. Host is runtime suspended.
*/
static bool exynos_drd_switch_is_host_off(struct usb_otg *otg)
{
struct usb_hcd *hcd;
struct device *dev;
if (!otg->host)
/* REVISIT: what should we return here? */
return true;
hcd = bus_to_hcd(otg->host);
dev = hcd->self.controller;
return pm_runtime_suspended(dev);
}
示例13: bh1770_prox_result_show
static ssize_t bh1770_prox_result_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct bh1770_chip *chip = dev_get_drvdata(dev);
ssize_t ret;
mutex_lock(&chip->mutex);
if (chip->prox_enable_count && !pm_runtime_suspended(dev))
ret = sprintf(buf, "%d\n", chip->prox_data);
else
ret = -EIO;
mutex_unlock(&chip->mutex);
return ret;
}
示例14: bh1770_prox_set_threshold
/*
* Following two functions converts raw lux values from HW to normalized
* values. Purpose is to compensate differences between different sensor
* versions and variants so that result means about the same between
* versions. Chip->mutex is kept when this is called.
*/
static int bh1770_prox_set_threshold(struct bh1770_chip *chip)
{
u8 tmp = 0;
/* sysfs may call this when the chip is powered off */
if (pm_runtime_suspended(&chip->client->dev))
return 0;
tmp = bh1770_psadjusted_to_raw(chip, chip->prox_threshold);
chip->prox_threshold_hw = tmp;
return i2c_smbus_write_byte_data(chip->client, BH1770_PS_TH_LED1,
tmp);
}
示例15: bh1770_lux_rate
/* chip->mutex is always kept here */
static int bh1770_lux_rate(struct bh1770_chip *chip, int rate_index)
{
/* sysfs may call this when the chip is powered off */
if (pm_runtime_suspended(&chip->client->dev))
return 0;
/* Proper proximity response needs fastest lux rate (100ms) */
if (chip->prox_enable_count)
rate_index = 0;
return i2c_smbus_write_byte_data(chip->client,
BH1770_ALS_MEAS_RATE,
rate_index);
}