这篇教程C++ ACPI_HANDLE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_HANDLE函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_HANDLE函数的具体用法?C++ ACPI_HANDLE怎么用?C++ ACPI_HANDLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_HANDLE函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: xgene_enet_resetstatic int xgene_enet_reset(struct xgene_enet_pdata *pdata){ struct device *dev = &pdata->pdev->dev; if (!xgene_ring_mgr_init(pdata)) return -ENODEV; if (dev->of_node) { clk_prepare_enable(pdata->clk); udelay(5); clk_disable_unprepare(pdata->clk); udelay(5); clk_prepare_enable(pdata->clk); udelay(5); } else {#ifdef CONFIG_ACPI if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) { acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev), "_RST", NULL, NULL); } else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_INI")) { acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev), "_INI", NULL, NULL); }#endif } xgene_enet_ecc_init(pdata); xgene_enet_config_ring_if_assoc(pdata); return 0;}
开发者ID:AK101111,项目名称:linux,代码行数:32,
示例2: intel_mid_gps_probestatic int intel_mid_gps_probe(struct platform_device *pdev){ struct intel_mid_gps_platform_data *pdata = NULL; int ret = 0; pr_info("%s probe called/n", dev_name(&pdev->dev)); if (ACPI_HANDLE(&pdev->dev)) { /* create a new platform data that will be populated with gpio data from ACPI table */ unsigned long long port; pdata = kzalloc(sizeof(struct intel_mid_gps_platform_data), GFP_KERNEL); if (!pdata) return -ENOMEM; pdata->gpio_reset = acpi_get_gpio_by_name(&pdev->dev,"RSET", NULL); pdata->gpio_enable = acpi_get_gpio_by_name(&pdev->dev,"ENAB", NULL); pdata->gpio_hostwake = acpi_get_gpio_by_name(&pdev->dev,"HSTW", NULL); pr_info("%s enable: %d, reset: %d, hostwake: %d/n", __func__, pdata->gpio_enable, pdata->gpio_reset, pdata->gpio_hostwake); if (ACPI_FAILURE(acpi_evaluate_integer((acpi_handle)ACPI_HANDLE(&pdev->dev), "UART", NULL, &port))) dev_err(&pdev->dev, "Error evaluating acpi table, no HSU port/n"); else { pdata->hsu_port = (unsigned int)port; pr_info("GPS HSU port read from ACPI = %d/n", pdata->hsu_port); } platform_set_drvdata(pdev, pdata); } else { platform_set_drvdata(pdev, pdev->dev.platform_data); } ret = intel_mid_gps_init(pdev); if (ret) { dev_err(&pdev->dev, "Failed to initalize %s/n", dev_name(&pdev->dev)); if (ACPI_HANDLE(&pdev->dev)) kfree(pdata); } return ret;}
开发者ID:matheusgcdj,项目名称:android_kernel_asus_T00F,代码行数:48,
示例3: acpi_processor_stopstatic int acpi_processor_stop(struct device *dev){ struct acpi_device *device; struct acpi_processor *pr; if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) return 0; acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, acpi_processor_notify); pr = acpi_driver_data(device); if (!pr) return 0; acpi_processor_power_exit(pr); if (pr->cdev) { sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); sysfs_remove_link(&pr->cdev->device.kobj, "device"); thermal_cooling_device_unregister(pr->cdev); pr->cdev = NULL; } return 0;}
开发者ID:bjayesh,项目名称:chandra,代码行数:25,
示例4: intel_vbtn_probestatic int intel_vbtn_probe(struct platform_device *device){ acpi_handle handle = ACPI_HANDLE(&device->dev); struct intel_vbtn_priv *priv; acpi_status status; int err; status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); if (ACPI_FAILURE(status)) { dev_warn(&device->dev, "failed to read Intel Virtual Button driver/n"); return -ENODEV; } priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; dev_set_drvdata(&device->dev, priv); err = intel_vbtn_input_setup(device); if (err) { pr_err("Failed to setup Intel Virtual Button/n"); return err; } status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler, device); if (ACPI_FAILURE(status)) return -EBUSY; return 0;}
开发者ID:kdave,项目名称:btrfs-devel,代码行数:33,
示例5: acpi_i2c_install_space_handlerint acpi_i2c_install_space_handler(struct i2c_adapter *adapter){ acpi_handle handle = ACPI_HANDLE(adapter->dev.parent); struct acpi_i2c_handler_data *data; acpi_status status; if (!handle) return -ENODEV; data = kzalloc(sizeof(struct acpi_i2c_handler_data), GFP_KERNEL); if (!data) return -ENOMEM; data->adapter = adapter; status = acpi_bus_attach_private_data(handle, (void *)data); if (ACPI_FAILURE(status)) { kfree(data); return -ENOMEM; } status = acpi_install_address_space_handler(handle, ACPI_ADR_SPACE_GSBUS, &acpi_i2c_space_handler, NULL, data); if (ACPI_FAILURE(status)) { dev_err(&adapter->dev, "Error installing i2c space handler/n"); acpi_bus_detach_private_data(handle); kfree(data); return -ENOMEM; } return 0;}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:35,
示例6: radeon_atpx_get_client_id/** * radeon_atpx_get_client_id - get the client id * * @pdev: pci device * * look up whether we are the integrated or discrete GPU (all asics). * Returns the client id. */static int radeon_atpx_get_client_id(struct pci_dev *pdev){ if (radeon_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev)) return VGA_SWITCHEROO_IGD; else return VGA_SWITCHEROO_DIS;}
开发者ID:McPrapor,项目名称:kernel_misu,代码行数:15,
示例7: ACPI_HANDLE/** * acpi_dev_pm_get_node - Get ACPI device node for the given physical device. * @dev: Device to get the ACPI node for. */struct acpi_device *acpi_dev_pm_get_node(struct device *dev){ acpi_handle handle = ACPI_HANDLE(dev); struct acpi_device *adev; return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;}
开发者ID:DecimalMan,项目名称:linux-misc,代码行数:11,
示例8: intel_dsm_pci_probestatic bool intel_dsm_pci_probe(struct pci_dev *pdev){ acpi_handle dhandle, intel_handle; acpi_status status; int ret; dhandle = ACPI_HANDLE(&pdev->dev); if (!dhandle) return false; status = acpi_get_handle(dhandle, "_DSM", &intel_handle); if (ACPI_FAILURE(status)) { DRM_DEBUG_KMS("no _DSM method for intel device/n"); return false; } ret = intel_dsm(dhandle, INTEL_DSM_FN_SUPPORTED_FUNCTIONS); if (ret < 0) { DRM_DEBUG_KMS("failed to get supported _DSM functions/n"); return false; } intel_dsm_priv.dhandle = dhandle; intel_dsm_platform_mux_info(); return true;}
开发者ID:electrikjesus,项目名称:kernel_intel-uefi,代码行数:27,
示例9: i2c_dw_probe_lock_supportint i2c_dw_probe_lock_support(struct dw_i2c_dev *dev){ acpi_status status; unsigned long long shared_host = 0; acpi_handle handle; if (!dev || !dev->dev) return 0; handle = ACPI_HANDLE(dev->dev); if (!handle) return 0; status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); if (ACPI_FAILURE(status)) return 0; if (!shared_host) return 0; if (!iosf_mbi_available()) return -EPROBE_DEFER; dev_info(dev->dev, "I2C bus managed by PUNIT/n"); dev->acquire_lock = baytrail_i2c_acquire; dev->release_lock = baytrail_i2c_release; dev->pm_disabled = true; pm_qos_add_request(&dev->pm_qos, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); return 0;}
开发者ID:Lyude,项目名称:linux,代码行数:33,
示例10: xgene_mdio_resetstatic int xgene_mdio_reset(struct xgene_mdio_pdata *pdata){ int ret; if (pdata->dev->of_node) { clk_prepare_enable(pdata->clk); udelay(5); clk_disable_unprepare(pdata->clk); udelay(5); clk_prepare_enable(pdata->clk); udelay(5); } else {#ifdef CONFIG_ACPI acpi_evaluate_object(ACPI_HANDLE(pdata->dev), "_RST", NULL, NULL);#endif } ret = xgene_enet_ecc_init(pdata); if (ret) { if (pdata->dev->of_node) clk_disable_unprepare(pdata->clk); return ret; } xgene_gmac_reset(pdata); return 0;}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:28,
示例11: cm3218_acpi_get_cpm_info/** * cm3218_acpi_get_cpm_info() - Get CPM object from ACPI * @client pointer of struct i2c_client. * @obj_name pointer of ACPI object name. * @count maximum size of return array. * @vals pointer of array for return elements. * * Convert ACPI CPM table to array. Special thanks to Srinivas Pandruvada * for his help implementing this routine. * * Return: -ENODEV for fail. Otherwise is number of elements. */static int cm3218_acpi_get_cpm_info(struct i2c_client *client, char *obj_name, int count, u64 *vals){ acpi_handle handle; struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; int i; acpi_status status; union acpi_object *cpm = NULL; handle = ACPI_HANDLE(&client->dev); if (!handle) return -ENODEV; status = acpi_evaluate_object(handle, obj_name, NULL, &buffer); if (ACPI_FAILURE(status)) { dev_err(&client->dev, "object %s not found/n", obj_name); return -ENODEV; } cpm = buffer.pointer; for (i = 0; i < cpm->package.count && i < count; ++i) { union acpi_object *elem; elem = &(cpm->package.elements[i]); vals[i] = elem->integer.value; } kfree(buffer.pointer); return i;}
开发者ID:hadess,项目名称:cm3218,代码行数:43,
示例12: intel_crc_pmic_opregion_probestatic int intel_crc_pmic_opregion_probe(struct platform_device *pdev){ struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); return intel_pmic_install_opregion_handler(&pdev->dev, ACPI_HANDLE(pdev->dev.parent), pmic->regmap, &intel_crc_pmic_opregion_data);}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:7,
示例13: meh_showstatic int meh_show(struct seq_file *seqfp, void *p) { struct pci_dev *pdev = NULL; while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_handle handle;#ifdef ACPI_HANDLE /* since Linux 3.8 */ handle = ACPI_HANDLE(&pdev->dev);#else /* removed since Linux 3.13 */ handle = DEVICE_ACPI_HANDLE(&pdev->dev);#endif seq_printf(seqfp, "%s ", dev_name(&pdev->dev)); seq_printf(seqfp, "%06x ", pdev->class); if (handle) { acpi_get_name(handle, ACPI_FULL_PATHNAME, &buf); seq_printf(seqfp, "%s/n", (char *)buf.pointer); } else { seq_printf(seqfp, "/n"); } } return 0;}
开发者ID:wmealing,项目名称:acpi-stuff,代码行数:25,
示例14: rfkill_gpio_probestatic int rfkill_gpio_probe(struct platform_device *pdev){ struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; struct rfkill_gpio_data *rfkill; struct gpio_desc *gpio; int ret; rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); if (!rfkill) return -ENOMEM; if (ACPI_HANDLE(&pdev->dev)) { ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill); if (ret) return ret; } else if (pdata) { rfkill->name = pdata->name; rfkill->type = pdata->type; } else { return -ENODEV; } rfkill->clk = devm_clk_get(&pdev->dev, NULL); gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpio)) return PTR_ERR(gpio); rfkill->reset_gpio = gpio; gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_OUT_LOW); if (IS_ERR(gpio)) return PTR_ERR(gpio); rfkill->shutdown_gpio = gpio; /* Make sure at-least one of the GPIO is defined and that * a name is specified for this instance */ if ((!rfkill->reset_gpio && !rfkill->shutdown_gpio) || !rfkill->name) { dev_err(&pdev->dev, "invalid platform data/n"); return -EINVAL; } rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, rfkill->type, &rfkill_gpio_ops, rfkill); if (!rfkill->rfkill_dev) return -ENOMEM; ret = rfkill_register(rfkill->rfkill_dev); if (ret < 0) return ret; platform_set_drvdata(pdev, rfkill); dev_info(&pdev->dev, "%s device registered./n", rfkill->name); return 0;}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:60,
示例15: detect_tablet_modestatic void detect_tablet_mode(struct platform_device *device){ const char *chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); acpi_handle handle = ACPI_HANDLE(&device->dev); struct acpi_buffer vgbs_output = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *obj; acpi_status status; int m; if (!(chassis_type && strcmp(chassis_type, "31") == 0)) goto out; status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output); if (ACPI_FAILURE(status)) goto out; obj = vgbs_output.pointer; if (!(obj && obj->type == ACPI_TYPE_INTEGER)) goto out; m = !(obj->integer.value & TABLET_MODE_FLAG); input_report_switch(priv->input_dev, SW_TABLET_MODE, m); m = (obj->integer.value & DOCK_MODE_FLAG) ? 1 : 0; input_report_switch(priv->input_dev, SW_DOCK, m);out: kfree(vgbs_output.pointer);}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:28,
示例16: set_dflt_pwr_limitstatic void set_dflt_pwr_limit(struct iwl_trans *trans, struct pci_dev *pdev){ acpi_handle pxsx_handle; acpi_handle handle; struct acpi_buffer splx = {ACPI_ALLOCATE_BUFFER, NULL}; acpi_status status; pxsx_handle = ACPI_HANDLE(&pdev->dev); if (!pxsx_handle) { IWL_ERR(trans, "Could not retrieve root port ACPI handle"); return; } /* Get the method's handle */ status = acpi_get_handle(pxsx_handle, (acpi_string)SPL_METHOD, &handle); if (ACPI_FAILURE(status)) { IWL_DEBUG_INFO(trans, "SPL method not found"); return; } /* Call SPLC with no arguments */ status = acpi_evaluate_object(handle, NULL, NULL, &splx); if (ACPI_FAILURE(status)) { IWL_ERR(trans, "SPLC invocation failed (0x%x)", status); return; } trans->dflt_pwr_limit = splx_get_pwr_limit(trans, splx.pointer); IWL_DEBUG_INFO(trans, "Default power limit set to %lld", trans->dflt_pwr_limit); kfree(splx.pointer);}
开发者ID:houlixin,项目名称:BBB-TISDK,代码行数:32,
示例17: dw_i2c_acpi_paramsstatic void dw_i2c_acpi_params(struct platform_device *pdev, char method[], u16 *hcnt, u16 *lcnt, u32 *sda_hold){ struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER }; acpi_handle handle = ACPI_HANDLE(&pdev->dev); union acpi_object *obj; if (dmi_check_system(dw_i2c_no_acpi_params)) return; if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf))) return; obj = (union acpi_object *)buf.pointer; if (obj->type == ACPI_TYPE_PACKAGE && obj->package.count == 3) { const union acpi_object *objs = obj->package.elements; *hcnt = (u16)objs[0].integer.value; *lcnt = (u16)objs[1].integer.value; if (sda_hold) *sda_hold = (u32)objs[2].integer.value; } kfree(buf.pointer);}
开发者ID:DenisLug,项目名称:mptcp,代码行数:25,
示例18: amdgpu_atpx_get_client_id/** * amdgpu_atpx_get_client_id - get the client id * * @pdev: pci device * * look up whether we are the integrated or discrete GPU (all asics). * Returns the client id. */static enum vga_switcheroo_client_id amdgpu_atpx_get_client_id(struct pci_dev *pdev){ if (amdgpu_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev)) return VGA_SWITCHEROO_IGD; else return VGA_SWITCHEROO_DIS;}
开发者ID:ryoon,项目名称:linux,代码行数:15,
示例19: ACPI_HANDLEstruct nhlt_acpi_table *skl_nhlt_init(struct device *dev){ acpi_handle handle; union acpi_object *obj; struct nhlt_resource_desc *nhlt_ptr = NULL; struct nhlt_acpi_table *nhlt_table = NULL; handle = ACPI_HANDLE(dev); if (!handle) { dev_err(dev, "Didn't find ACPI_HANDLE/n"); return NULL; } obj = acpi_evaluate_dsm(handle, &osc_guid, 1, 1, NULL); if (obj && obj->type == ACPI_TYPE_BUFFER) { nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer; nhlt_table = (struct nhlt_acpi_table *) memremap(nhlt_ptr->min_addr, nhlt_ptr->length, MEMREMAP_WB); ACPI_FREE(obj); if (nhlt_table && (strncmp(nhlt_table->header.signature, NHLT_ACPI_HEADER_SIG, strlen(NHLT_ACPI_HEADER_SIG)) != 0)) { memunmap(nhlt_table); dev_err(dev, "NHLT ACPI header signature incorrect/n"); return NULL; } return nhlt_table; } dev_err(dev, "device specific method to extract NHLT blob failed/n"); return NULL;}
开发者ID:val2k,项目名称:linux,代码行数:33,
示例20: i2c_dw_eval_lock_supportint i2c_dw_eval_lock_support(struct dw_i2c_dev *dev){ acpi_status status; unsigned long long shared_host = 0; acpi_handle handle; if (!dev || !dev->dev) return 0; handle = ACPI_HANDLE(dev->dev); if (!handle) return 0; status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); if (ACPI_FAILURE(status)) return 0; if (shared_host) { dev_info(dev->dev, "I2C bus managed by PUNIT/n"); dev->acquire_lock = baytrail_i2c_acquire; dev->release_lock = baytrail_i2c_release; dev->pm_runtime_disabled = true; } if (!iosf_mbi_available()) return -EPROBE_DEFER; return 0;}
开发者ID:krizhanovsky,项目名称:linux,代码行数:29,
示例21: wifi_plat_dev_drv_probe_acpistatic int wifi_plat_dev_drv_probe_acpi(struct platform_device *pdev){ wifi_adapter_info_t *adapter; acpi_handle handle; struct acpi_device *adev; int irq_num; /* Android style wifi platform data device ("bcmdhd_wlan" or "bcm4329_wlan") * is kept for backward compatibility and supports only 1 adapter */ ASSERT(dhd_wifi_platdata != NULL); ASSERT(dhd_wifi_platdata->num_adapters == 1); adapter = &dhd_wifi_platdata->adapters[0]; adapter->wifi_plat_data = (void *)&dhd_wlan_control; if (ACPI_HANDLE(&pdev->dev)) { handle = ACPI_HANDLE(&pdev->dev); /* Dont try to do acpi pm for the wifi module */ if (!handle || acpi_bus_get_device(handle, &adev)) DHD_ERROR(("%s: could not get acpi pointer!/n", __FUNCTION__)); else adev->flags.power_manageable = 0; irq_num = acpi_get_gpio_by_index(&pdev->dev, 0, NULL); DHD_INFO(("%s: Using ACPI table to get IRQ number: %d/n", __FUNCTION__, irq_num)); if (irq_num < 0) { if (INTEL_MID_BOARD(2, TABLET, BYT, BLB, PRO) || INTEL_MID_BOARD(2, TABLET, BYT, BLB, ENG)) { DHD_INFO(("%s: BYT-M hardcoding/n", __FUNCTION__)); irq_num = acpi_get_gpio("//_SB.GPO2", 17); } else { DHD_INFO(("%s: BYT-T hardcoding/n", __FUNCTION__)); irq_num = acpi_get_gpio("//_SB.GPO2", 15); } } } else { DHD_ERROR(("%s: Null ACPI_HANDLE, try legacy probe/n", __FUNCTION__)); return wifi_plat_dev_drv_probe(pdev); } adapter->irq_num = irq_num; adapter->intr_flags = IRQF_TRIGGER_FALLING; wifi_plat_dev_probe_ret = dhd_wifi_platform_load(); return wifi_plat_dev_probe_ret;}
开发者ID:TeamElevate,项目名称:edison,代码行数:47,
示例22: platform_get_irq/** * platform_get_irq - get an IRQ for a device * @dev: platform device * @num: IRQ number index */int platform_get_irq(struct platform_device *dev, unsigned int num){#ifdef CONFIG_SPARC /* sparc does not have irqs represented as IORESOURCE_IRQ resources */ if (!dev || num >= dev->archdata.num_irqs) return -ENXIO; return dev->archdata.irqs[num];#else struct resource *r; if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { int ret; ret = of_irq_get(dev->dev.of_node, num); if (ret > 0 || ret == -EPROBE_DEFER) return ret; } r = platform_get_resource(dev, IORESOURCE_IRQ, num); if (has_acpi_companion(&dev->dev)) { if (r && r->flags & IORESOURCE_DISABLED) { int ret; ret = acpi_irq_get(ACPI_HANDLE(&dev->dev), num, r); if (ret) return ret; } } /* * The resources may pass trigger flags to the irqs that need * to be set up. It so happens that the trigger flags for * IORESOURCE_BITS correspond 1-to-1 to the IRQF_TRIGGER* * settings. */ if (r && r->flags & IORESOURCE_BITS) { struct irq_data *irqd; irqd = irq_get_irq_data(r->start); if (!irqd) return -ENXIO; irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); } if (r) return r->start; /* * For the index 0 interrupt, allow falling back to GpioInt * resources. While a device could have both Interrupt and GpioInt * resources, making this fallback ambiguous, in many common cases * the device will only expose one IRQ, and this fallback * allows a common code path across either kind of resource. */ if (num == 0 && has_acpi_companion(&dev->dev)) return acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num); return -ENXIO;#endif}
开发者ID:avagin,项目名称:linux,代码行数:64,
示例23: xhci_pme_acpi_rtd3_enablestatic void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev){ static const u8 intel_dsm_uuid[] = { 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45, 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23, }; acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, NULL);}
开发者ID:c444b774,项目名称:linux,代码行数:8,
示例24: intel_hid_probestatic int intel_hid_probe(struct platform_device *device){ acpi_handle handle = ACPI_HANDLE(&device->dev); struct intel_hid_priv *priv; unsigned long long mode; acpi_status status; int err; status = acpi_evaluate_integer(handle, "HDMM", NULL, &mode); if (!ACPI_SUCCESS(status)) { dev_warn(&device->dev, "failed to read mode/n"); return -ENODEV; } if (mode != 0) { /* * This driver only implements "simple" mode. There appear * to be no other modes, but we should be paranoid and check * for compatibility. */ dev_info(&device->dev, "platform is not in simple mode/n"); return -ENODEV; } priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; dev_set_drvdata(&device->dev, priv); err = intel_hid_input_setup(device); if (err) { pr_err("Failed to setup Intel HID hotkeys/n"); return err; } status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler, device); if (ACPI_FAILURE(status)) { err = -EBUSY; goto err_remove_input; } err = intel_hid_set_enable(&device->dev, 1); if (err) goto err_remove_notify; return 0;err_remove_notify: acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);err_remove_input: intel_hid_input_destroy(device); return err;}
开发者ID:mansr,项目名称:linux-tangox,代码行数:58,
示例25: intel_mid_gps_removestatic int intel_mid_gps_remove(struct platform_device *pdev){ intel_mid_gps_deinit(pdev); if (ACPI_HANDLE(&pdev->dev)) kfree(dev_get_drvdata(&pdev->dev)); return 0;}
开发者ID:matheusgcdj,项目名称:android_kernel_asus_T00F,代码行数:9,
示例26: acpi_processor_startstatic int acpi_processor_start(struct device *dev){ struct acpi_device *device; if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) return -ENODEV; return __acpi_processor_start(device);}
开发者ID:bjayesh,项目名称:chandra,代码行数:9,
示例27: ucsi_acpi_probestatic int ucsi_acpi_probe(struct platform_device *pdev){ struct resource *res; acpi_status status; struct ucsi *ucsi; int ret; ucsi = devm_kzalloc(&pdev->dev, sizeof(*ucsi), GFP_KERNEL); if (!ucsi) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "missing memory resource/n"); return -ENODEV; } /* * NOTE: ACPI has claimed the memory region as it's also an Operation * Region. It's not possible to request it in the driver. */ ucsi->data = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!ucsi->data) return -ENOMEM; ucsi->dev = &pdev->dev; status = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_ALL_NOTIFY, ucsi_acpi_notify, ucsi); if (ACPI_FAILURE(status)) return -ENODEV; ret = ucsi_init(ucsi); if (ret) { acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_ALL_NOTIFY, ucsi_acpi_notify); return ret; } platform_set_drvdata(pdev, ucsi); return 0;}
开发者ID:513855417,项目名称:linux,代码行数:44,
示例28: acpi_pci_set_power_statestatic int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state){ acpi_handle handle = ACPI_HANDLE(&dev->dev); static const u8 state_conv[] = { [PCI_D0] = ACPI_STATE_D0, [PCI_D1] = ACPI_STATE_D1, [PCI_D2] = ACPI_STATE_D2, [PCI_D3hot] = ACPI_STATE_D3_COLD, [PCI_D3cold] = ACPI_STATE_D3_COLD, };
开发者ID:7799,项目名称:linux,代码行数:10,
注:本文中的ACPI_HANDLE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_IS_DEBUG_ENABLED函数代码示例 C++ ACPI_GET_OBJECT_TYPE函数代码示例 |