static int pwm_beeper_resume(struct device *dev) { struct pwm_beeper *beeper = dev_get_drvdata(dev); if 2, beeper->period); pwm_enable(beeper->pwm); } return 0; } static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops, pwm_beeper_suspend, pwm_beeper_resume); #define #else #define #endif ...
SIMPLE_DEV_PM_OPS宏位于pm.h,它将会定义一个dev_pm_ops结构体,用来被pm子系统调用,实现休眠唤醒 4.2 首先来看probe函数 如下图所示,probe函数为gpio_keys_probe() gpio_keys_probe()函数定义如下所示: staticintgpio_keys_probe(structplatform_device *pdev) {structdevice *dev = &pdev->dev;//获取平台...
staticintgpio_keys_resume(struct device*dev); 唤醒函数,唤醒之前被调用 代码语言:javascript 代码运行次数:0 运行 AI代码解释 staticSIMPLE_DEV_PM_OPS(gpio_keys_pm_ops,gpio_keys_suspend,gpio_keys_resume); SIMPLE_DEV_PM_OPS宏位于pm.h,它将会定义一个dev_pm_ops结构体,用来被pm子系统调用,实现休眠唤...
static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume); 1. SIMPLE_DEV_PM_OPS宏位于pm.h,它将会定义一个dev_pm_ops结构体,用来被pm子系统调用,实现休眠唤醒 4.2 首先来看probe函数 如下图所示,probe函数为gpio_keys_probe() gpio_keys_probe()函数定义如下所示: static int...
staticSIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops, pwm_beeper_suspend, pwm_beeper_resume); #definePWM_BEEPER_PM_OPS (&pwm_beeper_pm_ops) #else #definePWM_BEEPER_PM_OPS NULL #endif //创建平台驱动,此处name与上面我们在mach-smdk2440.c添加的名字相同,用于匹配 ...
staticstruct platform_driver dm9000_driver={.driver={.name="dm9000",.owner=THIS_MODULE,.pm=&dm9000_drv_pm_ops,},.probe=dm9000_probe,.remove=__devexit_p(dm9000_drv_remove),};staticint __initdm9000_init(void){/* disable buzzer */s3c_gpio_setpull(S5PV210_GPD0(2),S3C_GPIO_PULL_UP);s...
(*online)(struct device *dev); int (*offline)(struct device *dev); int (*suspend)(struct device *dev, pm_message_t state); int (*resume)(struct device *dev); const struct dev_pm_ops *pm; struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; }...
Ubuntu is the modern, open source operating system on Linux for the enterprise server, desktop, cloud, and IoT.
***/staticstructbus_typemmc_bus_type={.name="mmc",.dev_groups=mmc_dev_groups,.match=mmc_bus_match,.uevent=mmc_bus_uevent,.probe=mmc_bus_probe,.remove=mmc_bus_remove,.shutdown=mmc_bus_shutdown,.pm=&mmc_bus_pm_ops,};intmmc_register_bus(void){returnbus_register(&mmc_bus_type);...
* EXPORT_SIMPLE_DEV_PM_OPS() or EXPORT_GPL_SIMPLE_DEV_PM_OPS() instead. */ #define DEFINE_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL) #define EXPORT_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) ...