本文整理汇总了C++中pm_runtime_suspended函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_suspended函数的具体用法?C++ pm_runtime_suspended怎么用?C++ pm_runtime_suspended使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_suspended函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:blackjack4it,项目名称:android_kernel_asus_padfone_s,代码行数:12,代码来源:xhci-plat.c
示例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;
}
开发者ID:DenisKuzovin,项目名称:linux-xlnx,代码行数:12,代码来源:gpio-zynq.c
示例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);
}
开发者ID:ARMP,项目名称:ARMP-i9300,代码行数:40,代码来源:exynos-usb-switch.c
示例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;
}
开发者ID:Toradex-Apalis-TK1-AndroidTV,项目名称:android_kernel_nvidia_mm,代码行数:52,代码来源:escore-pm.c
示例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;
}
开发者ID:AiWinters,项目名称:linux,代码行数:13,代码来源:omap-usb3.c
示例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;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:13,代码来源:apds990x.c
示例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;
}
开发者ID:bjayesh,项目名称:chandra,代码行数:13,代码来源:gpio-xilinxps.c
示例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;
}
开发者ID:Hadramos,项目名称:android_sony_xperiaz_kernel_sources,代码行数:13,代码来源:lm3561.c
示例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;
}
开发者ID:EMCAntimatter,项目名称:linux,代码行数:13,代码来源:sirf.c
示例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;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:15,代码来源:apds990x.c
示例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;
}
开发者ID:linux-next,项目名称:linux-next,代码行数:14,代码来源:atmel_hlcdc_dc.c
示例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);
}
开发者ID:halaszk,项目名称:android_kernel_samsung_lt03,代码行数:23,代码来源:exynos-drd-switch.c
示例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;
}
开发者ID:BORETS24,项目名称:common.git-android-4.4,代码行数:14,代码来源:bh1770glc.c
示例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);
}
开发者ID:BORETS24,项目名称:common.git-android-4.4,代码行数:20,代码来源:bh1770glc.c
示例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);
}
开发者ID:BORETS24,项目名称:common.git-android-4.4,代码行数:15,代码来源:bh1770glc.c
示例16: exynos_xhci_suspend
static int exynos_xhci_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_xhci_hcd *exynos_xhci;
struct usb_hcd *hcd;
struct xhci_hcd *xhci;
int retval = 0;
#ifdef CONFIG_PM_RUNTIME
dev_dbg(dev, "%s: usage_count = %d\n",
__func__, atomic_read(&dev->power.usage_count));
#endif
exynos_xhci = dev_get_drvdata(dev);
if (!exynos_xhci)
return -EINVAL;
hcd = exynos_xhci->hcd;
if (!hcd)
return -EINVAL;
/* Prevent any more root-hub status calls from the timer
* The HCD might still restart the timer (if a port status change
* interrupt occurs), but usb_hcd_poll_rh_status() won't invoke
* the hub_status_data() callback.
*/
hcd->rh_pollable = 0;
hcd->shared_hcd->rh_pollable = 0;
xhci = hcd_to_xhci(hcd);
if (hcd->state != HC_STATE_SUSPENDED ||
xhci->shared_hcd->state != HC_STATE_SUSPENDED)
dev_err(dev, "%s: HC state is not suspended!\n", __func__);
#ifdef CONFIG_USB_SUSPEND
if (pm_runtime_suspended(dev)) {
dev_dbg(dev, "xhci is runtime suspended\n");
return 0;
}
#endif
retval = xhci_suspend(xhci, 0);
if (retval < 0)
dev_err(dev, "%s: cannot stop xHC\n", __func__);
pm_runtime_put_sync(dev->parent);
exynos_drd_put(pdev);
return retval;
}
开发者ID:tamirda,项目名称:T805_PhoeniX_Kernel_Lollipop,代码行数:49,代码来源:xhci-exynos.c
示例17: ak89xx_resume
static int ak89xx_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct inv_ak89xx_state_s *st = iio_priv(indio_dev);
int rc;
dev_dbg(dev, "%s\n", __func__);
if (!pm_runtime_suspended(dev)) {
rc = ak89xx_power_supply(st, 1);
} else {
dev_info(dev, "%s: was runtime-suspended.\n", __func__);
rc = 0;
}
return rc ? -EAGAIN : 0;
}
开发者ID:Hadramos,项目名称:android_sony_xperiaz_kernel_sources,代码行数:15,代码来源:inv_ak89xx_core.c
示例18: hdmi_g_ctrl
int hdmi_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
{
struct hdmi_device *hdev = sd_to_hdmi_dev(sd);
struct device *dev = hdev->dev;
if (!pm_runtime_suspended(hdev->dev) && !hdev->hpd_user_checked)
ctrl->value = hdmi_hpd_status(hdev);
else
ctrl->value = atomic_read(&hdev->hpd_state);
dev_dbg(dev, "HDMI cable is %s\n", ctrl->value ?
"connected" : "disconnected");
return 0;
}
开发者ID:amuxtux,项目名称:exynos4210,代码行数:15,代码来源:hdmi_drv.c
示例19: acpi_power_on_device
/* Resume the device when all power resources in _PR0 are on */
static void acpi_power_on_device(struct acpi_power_managed_device *device)
{
struct acpi_device *acpi_dev;
acpi_handle handle = device->handle;
int state;
if (acpi_bus_get_device(handle, &acpi_dev))
return;
if(acpi_power_get_inferred_state(acpi_dev, &state))
return;
if (state == ACPI_STATE_D0 && pm_runtime_suspended(device->dev))
pm_request_resume(device->dev);
}
开发者ID:adis1313,项目名称:android_kernel_samsung_msm8974,代码行数:16,代码来源:power.c
示例20: st_tty_close
static void st_tty_close(struct tty_struct *tty)
{
unsigned char i = ST_MAX_CHANNELS;
unsigned long flags = 0;
struct st_data_s *st_gdata = tty->disc_data;
pr_info("%s ", __func__);
/* TODO:
* if a protocol has been registered & line discipline
* un-installed for some reason - what should be done ?
*/
spin_lock_irqsave(&st_gdata->lock, flags);
for (i = 0; i < ST_MAX_CHANNELS; i++) {
if (st_gdata->is_registered[i] == true)
pr_err("%d not un-registered", i);
st_gdata->list[i] = NULL;
st_gdata->is_registered[i] = false;
}
st_gdata->protos_registered = 0;
spin_unlock_irqrestore(&st_gdata->lock, flags);
/*
* signal to UIM via KIM that -
* N_TI_WL ldisc is un-installed
*/
st_kim_complete(st_gdata->kim_data);
st_gdata->tty = NULL;
/* Flush any pending characters in the driver and discipline. */
tty_ldisc_flush(tty);
tty_driver_flush_buffer(tty);
spin_lock_irqsave(&st_gdata->lock, flags);
/* empty out txq and tx_waitq */
skb_queue_purge(&st_gdata->txq);
skb_queue_purge(&st_gdata->tx_waitq);
/* reset the TTY Rx states of ST */
st_gdata->rx_count = 0;
st_gdata->rx_state = ST_W4_PACKET_TYPE;
kfree_skb(st_gdata->rx_skb);
st_gdata->rx_skb = NULL;
spin_unlock_irqrestore(&st_gdata->lock, flags);
pm_runtime_put_noidle(st_gdata->tty_dev);
if (!pm_runtime_suspended(st_gdata->tty_dev))
__pm_runtime_idle(st_gdata->tty_dev, 0);
pr_debug("%s: done ", __func__);
}
开发者ID:AnwariJr,项目名称:Zenfone-Kernel,代码行数:48,代码来源:st_core.c
注:本文中的pm_runtime_suspended函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论