Loading arch/x86/kernel/acpi/boot.c +1 −1 Original line number Diff line number Diff line Loading @@ -745,7 +745,7 @@ static int __init acpi_parse_sbf(struct acpi_table_header *table) #ifdef CONFIG_HPET_TIMER #include <asm/hpet.h> static struct __initdata resource *hpet_res; static struct resource *hpet_res __initdata; static int __init acpi_parse_hpet(struct acpi_table_header *table) { Loading drivers/acpi/ac.c +65 −191 Original line number Diff line number Diff line Loading @@ -30,10 +30,7 @@ #include <linux/types.h> #include <linux/dmi.h> #include <linux/delay.h> #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/seq_file.h> #endif #include <linux/platform_device.h> #include <linux/power_supply.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> Loading @@ -55,75 +52,30 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_LICENSE("GPL"); #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); static int acpi_ac_open_fs(struct inode *inode, struct file *file); #endif static int acpi_ac_add(struct acpi_device *device); static int acpi_ac_remove(struct acpi_device *device); static void acpi_ac_notify(struct acpi_device *device, u32 event); static const struct acpi_device_id ac_device_ids[] = { {"ACPI0003", 0}, {"", 0}, }; MODULE_DEVICE_TABLE(acpi, ac_device_ids); #ifdef CONFIG_PM_SLEEP static int acpi_ac_resume(struct device *dev); #endif static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); static int ac_sleep_before_get_state_ms; static struct acpi_driver acpi_ac_driver = { .name = "ac", .class = ACPI_AC_CLASS, .ids = ac_device_ids, .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, .ops = { .add = acpi_ac_add, .remove = acpi_ac_remove, .notify = acpi_ac_notify, }, .drv.pm = &acpi_ac_pm, }; struct acpi_ac { struct power_supply charger; struct acpi_device * device; struct acpi_device *adev; struct platform_device *pdev; unsigned long long state; }; #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger) #ifdef CONFIG_ACPI_PROCFS_POWER static const struct file_operations acpi_ac_fops = { .owner = THIS_MODULE, .open = acpi_ac_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; #endif /* -------------------------------------------------------------------------- AC Adapter Management -------------------------------------------------------------------------- */ static int acpi_ac_get_state(struct acpi_ac *ac) { acpi_status status = AE_OK; acpi_status status; if (!ac) return -EINVAL; status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); status = acpi_evaluate_integer(ac->adev->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ac->state = ACPI_AC_STATUS_UNKNOWN; return -ENODEV; } Loading Loading @@ -160,91 +112,13 @@ static enum power_supply_property ac_props[] = { POWER_SUPPLY_PROP_ONLINE, }; #ifdef CONFIG_ACPI_PROCFS_POWER /* -------------------------------------------------------------------------- FS Interface (/proc) -------------------------------------------------------------------------- */ static struct proc_dir_entry *acpi_ac_dir; static int acpi_ac_seq_show(struct seq_file *seq, void *offset) { struct acpi_ac *ac = seq->private; if (!ac) return 0; if (acpi_ac_get_state(ac)) { seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); return 0; } seq_puts(seq, "state: "); switch (ac->state) { case ACPI_AC_STATUS_OFFLINE: seq_puts(seq, "off-line\n"); break; case ACPI_AC_STATUS_ONLINE: seq_puts(seq, "on-line\n"); break; default: seq_puts(seq, "unknown\n"); break; } return 0; } static int acpi_ac_open_fs(struct inode *inode, struct file *file) { return single_open(file, acpi_ac_seq_show, PDE_DATA(inode)); } static int acpi_ac_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded," " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_ac_dir); if (!acpi_device_dir(device)) return -ENODEV; } /* 'state' [R] */ entry = proc_create_data(ACPI_AC_FILE_STATE, S_IRUGO, acpi_device_dir(device), &acpi_ac_fops, acpi_driver_data(device)); if (!entry) return -ENODEV; return 0; } static int acpi_ac_remove_fs(struct acpi_device *device) { if (acpi_device_dir(device)) { remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device)); remove_proc_entry(acpi_device_bid(device), acpi_ac_dir); acpi_device_dir(device) = NULL; } return 0; } #endif /* -------------------------------------------------------------------------- Driver Model -------------------------------------------------------------------------- */ static void acpi_ac_notify(struct acpi_device *device, u32 event) static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data) { struct acpi_ac *ac = acpi_driver_data(device); struct acpi_ac *ac = data; if (!ac) return; Loading @@ -267,10 +141,10 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event) msleep(ac_sleep_before_get_state_ms); acpi_ac_get_state(ac); acpi_bus_generate_netlink_event(device->pnp.device_class, dev_name(&device->dev), event, (u32) ac->state); acpi_notifier_call_chain(device, event, (u32) ac->state); acpi_bus_generate_netlink_event(ac->adev->pnp.device_class, dev_name(&ac->pdev->dev), event, (u32) ac->state); acpi_notifier_call_chain(ac->adev, event, (u32) ac->state); kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); } Loading @@ -295,53 +169,55 @@ static struct dmi_system_id ac_dmi_table[] = { {}, }; static int acpi_ac_add(struct acpi_device *device) static int acpi_ac_probe(struct platform_device *pdev) { int result = 0; struct acpi_ac *ac = NULL; struct acpi_device *adev; if (!device) if (!pdev) return -EINVAL; result = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev); if (result) return -ENODEV; ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL); if (!ac) return -ENOMEM; ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); device->driver_data = ac; strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(adev), ACPI_AC_CLASS); ac->adev = adev; ac->pdev = pdev; platform_set_drvdata(pdev, ac); result = acpi_ac_get_state(ac); if (result) goto end; #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_ac_add_fs(device); #endif if (result) goto end; ac->charger.name = acpi_device_bid(device); ac->charger.name = acpi_device_bid(adev); ac->charger.type = POWER_SUPPLY_TYPE_MAINS; ac->charger.properties = ac_props; ac->charger.num_properties = ARRAY_SIZE(ac_props); ac->charger.get_property = get_ac_property; result = power_supply_register(&ac->device->dev, &ac->charger); result = power_supply_register(&pdev->dev, &ac->charger); if (result) goto end; result = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler, ac); if (result) { power_supply_unregister(&ac->charger); goto end; } printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), acpi_device_bid(device), acpi_device_name(adev), acpi_device_bid(adev), ac->state ? "on-line" : "off-line"); end: if (result) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); #endif if (result) kfree(ac); } dmi_check_system(ac_dmi_table); return result; Loading @@ -356,7 +232,7 @@ static int acpi_ac_resume(struct device *dev) if (!dev) return -EINVAL; ac = acpi_driver_data(to_acpi_device(dev)); ac = platform_get_drvdata(to_platform_device(dev)); if (!ac) return -EINVAL; Loading @@ -368,28 +244,44 @@ static int acpi_ac_resume(struct device *dev) return 0; } #endif static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); static int acpi_ac_remove(struct acpi_device *device) static int acpi_ac_remove(struct platform_device *pdev) { struct acpi_ac *ac = NULL; struct acpi_ac *ac; if (!device || !acpi_driver_data(device)) if (!pdev) return -EINVAL; ac = acpi_driver_data(device); acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler); ac = platform_get_drvdata(pdev); if (ac->charger.dev) power_supply_unregister(&ac->charger); #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); #endif kfree(ac); return 0; } static const struct acpi_device_id acpi_ac_match[] = { { "ACPI0003", 0 }, { } }; MODULE_DEVICE_TABLE(acpi, acpi_ac_match); static struct platform_driver acpi_ac_driver = { .probe = acpi_ac_probe, .remove = acpi_ac_remove, .driver = { .name = "acpi-ac", .owner = THIS_MODULE, .pm = &acpi_ac_pm_ops, .acpi_match_table = ACPI_PTR(acpi_ac_match), }, }; static int __init acpi_ac_init(void) { int result; Loading @@ -397,34 +289,16 @@ static int __init acpi_ac_init(void) if (acpi_disabled) return -ENODEV; #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) return -ENODEV; #endif result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); #endif result = platform_driver_register(&acpi_ac_driver); if (result < 0) return -ENODEV; } return 0; } static void __exit acpi_ac_exit(void) { acpi_bus_unregister_driver(&acpi_ac_driver); #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); #endif return; platform_driver_unregister(&acpi_ac_driver); } module_init(acpi_ac_init); module_exit(acpi_ac_exit); drivers/acpi/acpi_lpss.c +9 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ ACPI_MODULE_NAME("acpi_lpss"); /* Offsets relative to LPSS_PRIVATE_OFFSET */ #define LPSS_GENERAL 0x08 #define LPSS_GENERAL_LTR_MODE_SW BIT(2) #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) #define LPSS_SW_LTR 0x10 #define LPSS_AUTO_LTR 0x14 #define LPSS_TX_INT 0x20 Loading Loading @@ -68,11 +69,16 @@ struct lpss_private_data { static void lpss_uart_setup(struct lpss_private_data *pdata) { unsigned int tx_int_offset = pdata->dev_desc->prv_offset + LPSS_TX_INT; unsigned int offset; u32 reg; reg = readl(pdata->mmio_base + tx_int_offset); writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + tx_int_offset); offset = pdata->dev_desc->prv_offset + LPSS_TX_INT; reg = readl(pdata->mmio_base + offset); writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + offset); offset = pdata->dev_desc->prv_offset + LPSS_GENERAL; reg = readl(pdata->mmio_base + offset); writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); } static struct lpss_device_desc lpt_dev_desc = { Loading drivers/acpi/acpi_platform.c +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,13 @@ ACPI_MODULE_NAME("platform"); static const struct acpi_device_id acpi_platform_device_ids[] = { { "PNP0D40" }, { "ACPI0003" }, { "VPC2004" }, { "BCM4752" }, /* Intel Smart Sound Technology */ { "INT33C8" }, { "80860F28" }, { } }; Loading drivers/acpi/button.c +3 −6 Original line number Diff line number Diff line Loading @@ -383,18 +383,15 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_POWER, input->keybit); input_set_capability(input, EV_KEY, KEY_POWER); break; case ACPI_BUTTON_TYPE_SLEEP: input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_SLEEP, input->keybit); input_set_capability(input, EV_KEY, KEY_SLEEP); break; case ACPI_BUTTON_TYPE_LID: input->evbit[0] = BIT_MASK(EV_SW); set_bit(SW_LID, input->swbit); input_set_capability(input, EV_SW, SW_LID); break; } Loading Loading
arch/x86/kernel/acpi/boot.c +1 −1 Original line number Diff line number Diff line Loading @@ -745,7 +745,7 @@ static int __init acpi_parse_sbf(struct acpi_table_header *table) #ifdef CONFIG_HPET_TIMER #include <asm/hpet.h> static struct __initdata resource *hpet_res; static struct resource *hpet_res __initdata; static int __init acpi_parse_hpet(struct acpi_table_header *table) { Loading
drivers/acpi/ac.c +65 −191 Original line number Diff line number Diff line Loading @@ -30,10 +30,7 @@ #include <linux/types.h> #include <linux/dmi.h> #include <linux/delay.h> #ifdef CONFIG_ACPI_PROCFS_POWER #include <linux/proc_fs.h> #include <linux/seq_file.h> #endif #include <linux/platform_device.h> #include <linux/power_supply.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> Loading @@ -55,75 +52,30 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI AC Adapter Driver"); MODULE_LICENSE("GPL"); #ifdef CONFIG_ACPI_PROCFS_POWER extern struct proc_dir_entry *acpi_lock_ac_dir(void); extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); static int acpi_ac_open_fs(struct inode *inode, struct file *file); #endif static int acpi_ac_add(struct acpi_device *device); static int acpi_ac_remove(struct acpi_device *device); static void acpi_ac_notify(struct acpi_device *device, u32 event); static const struct acpi_device_id ac_device_ids[] = { {"ACPI0003", 0}, {"", 0}, }; MODULE_DEVICE_TABLE(acpi, ac_device_ids); #ifdef CONFIG_PM_SLEEP static int acpi_ac_resume(struct device *dev); #endif static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); static int ac_sleep_before_get_state_ms; static struct acpi_driver acpi_ac_driver = { .name = "ac", .class = ACPI_AC_CLASS, .ids = ac_device_ids, .flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS, .ops = { .add = acpi_ac_add, .remove = acpi_ac_remove, .notify = acpi_ac_notify, }, .drv.pm = &acpi_ac_pm, }; struct acpi_ac { struct power_supply charger; struct acpi_device * device; struct acpi_device *adev; struct platform_device *pdev; unsigned long long state; }; #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger) #ifdef CONFIG_ACPI_PROCFS_POWER static const struct file_operations acpi_ac_fops = { .owner = THIS_MODULE, .open = acpi_ac_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; #endif /* -------------------------------------------------------------------------- AC Adapter Management -------------------------------------------------------------------------- */ static int acpi_ac_get_state(struct acpi_ac *ac) { acpi_status status = AE_OK; acpi_status status; if (!ac) return -EINVAL; status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state); status = acpi_evaluate_integer(ac->adev->handle, "_PSR", NULL, &ac->state); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ac->state = ACPI_AC_STATUS_UNKNOWN; return -ENODEV; } Loading Loading @@ -160,91 +112,13 @@ static enum power_supply_property ac_props[] = { POWER_SUPPLY_PROP_ONLINE, }; #ifdef CONFIG_ACPI_PROCFS_POWER /* -------------------------------------------------------------------------- FS Interface (/proc) -------------------------------------------------------------------------- */ static struct proc_dir_entry *acpi_ac_dir; static int acpi_ac_seq_show(struct seq_file *seq, void *offset) { struct acpi_ac *ac = seq->private; if (!ac) return 0; if (acpi_ac_get_state(ac)) { seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); return 0; } seq_puts(seq, "state: "); switch (ac->state) { case ACPI_AC_STATUS_OFFLINE: seq_puts(seq, "off-line\n"); break; case ACPI_AC_STATUS_ONLINE: seq_puts(seq, "on-line\n"); break; default: seq_puts(seq, "unknown\n"); break; } return 0; } static int acpi_ac_open_fs(struct inode *inode, struct file *file) { return single_open(file, acpi_ac_seq_show, PDE_DATA(inode)); } static int acpi_ac_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded," " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_ac_dir); if (!acpi_device_dir(device)) return -ENODEV; } /* 'state' [R] */ entry = proc_create_data(ACPI_AC_FILE_STATE, S_IRUGO, acpi_device_dir(device), &acpi_ac_fops, acpi_driver_data(device)); if (!entry) return -ENODEV; return 0; } static int acpi_ac_remove_fs(struct acpi_device *device) { if (acpi_device_dir(device)) { remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device)); remove_proc_entry(acpi_device_bid(device), acpi_ac_dir); acpi_device_dir(device) = NULL; } return 0; } #endif /* -------------------------------------------------------------------------- Driver Model -------------------------------------------------------------------------- */ static void acpi_ac_notify(struct acpi_device *device, u32 event) static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data) { struct acpi_ac *ac = acpi_driver_data(device); struct acpi_ac *ac = data; if (!ac) return; Loading @@ -267,10 +141,10 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event) msleep(ac_sleep_before_get_state_ms); acpi_ac_get_state(ac); acpi_bus_generate_netlink_event(device->pnp.device_class, dev_name(&device->dev), event, (u32) ac->state); acpi_notifier_call_chain(device, event, (u32) ac->state); acpi_bus_generate_netlink_event(ac->adev->pnp.device_class, dev_name(&ac->pdev->dev), event, (u32) ac->state); acpi_notifier_call_chain(ac->adev, event, (u32) ac->state); kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); } Loading @@ -295,53 +169,55 @@ static struct dmi_system_id ac_dmi_table[] = { {}, }; static int acpi_ac_add(struct acpi_device *device) static int acpi_ac_probe(struct platform_device *pdev) { int result = 0; struct acpi_ac *ac = NULL; struct acpi_device *adev; if (!device) if (!pdev) return -EINVAL; result = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev); if (result) return -ENODEV; ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL); if (!ac) return -ENOMEM; ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); device->driver_data = ac; strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(adev), ACPI_AC_CLASS); ac->adev = adev; ac->pdev = pdev; platform_set_drvdata(pdev, ac); result = acpi_ac_get_state(ac); if (result) goto end; #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_ac_add_fs(device); #endif if (result) goto end; ac->charger.name = acpi_device_bid(device); ac->charger.name = acpi_device_bid(adev); ac->charger.type = POWER_SUPPLY_TYPE_MAINS; ac->charger.properties = ac_props; ac->charger.num_properties = ARRAY_SIZE(ac_props); ac->charger.get_property = get_ac_property; result = power_supply_register(&ac->device->dev, &ac->charger); result = power_supply_register(&pdev->dev, &ac->charger); if (result) goto end; result = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler, ac); if (result) { power_supply_unregister(&ac->charger); goto end; } printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), acpi_device_bid(device), acpi_device_name(adev), acpi_device_bid(adev), ac->state ? "on-line" : "off-line"); end: if (result) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); #endif if (result) kfree(ac); } dmi_check_system(ac_dmi_table); return result; Loading @@ -356,7 +232,7 @@ static int acpi_ac_resume(struct device *dev) if (!dev) return -EINVAL; ac = acpi_driver_data(to_acpi_device(dev)); ac = platform_get_drvdata(to_platform_device(dev)); if (!ac) return -EINVAL; Loading @@ -368,28 +244,44 @@ static int acpi_ac_resume(struct device *dev) return 0; } #endif static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); static int acpi_ac_remove(struct acpi_device *device) static int acpi_ac_remove(struct platform_device *pdev) { struct acpi_ac *ac = NULL; struct acpi_ac *ac; if (!device || !acpi_driver_data(device)) if (!pdev) return -EINVAL; ac = acpi_driver_data(device); acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler); ac = platform_get_drvdata(pdev); if (ac->charger.dev) power_supply_unregister(&ac->charger); #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_remove_fs(device); #endif kfree(ac); return 0; } static const struct acpi_device_id acpi_ac_match[] = { { "ACPI0003", 0 }, { } }; MODULE_DEVICE_TABLE(acpi, acpi_ac_match); static struct platform_driver acpi_ac_driver = { .probe = acpi_ac_probe, .remove = acpi_ac_remove, .driver = { .name = "acpi-ac", .owner = THIS_MODULE, .pm = &acpi_ac_pm_ops, .acpi_match_table = ACPI_PTR(acpi_ac_match), }, }; static int __init acpi_ac_init(void) { int result; Loading @@ -397,34 +289,16 @@ static int __init acpi_ac_init(void) if (acpi_disabled) return -ENODEV; #ifdef CONFIG_ACPI_PROCFS_POWER acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) return -ENODEV; #endif result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); #endif result = platform_driver_register(&acpi_ac_driver); if (result < 0) return -ENODEV; } return 0; } static void __exit acpi_ac_exit(void) { acpi_bus_unregister_driver(&acpi_ac_driver); #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_ac_dir(acpi_ac_dir); #endif return; platform_driver_unregister(&acpi_ac_driver); } module_init(acpi_ac_init); module_exit(acpi_ac_exit);
drivers/acpi/acpi_lpss.c +9 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ ACPI_MODULE_NAME("acpi_lpss"); /* Offsets relative to LPSS_PRIVATE_OFFSET */ #define LPSS_GENERAL 0x08 #define LPSS_GENERAL_LTR_MODE_SW BIT(2) #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) #define LPSS_SW_LTR 0x10 #define LPSS_AUTO_LTR 0x14 #define LPSS_TX_INT 0x20 Loading Loading @@ -68,11 +69,16 @@ struct lpss_private_data { static void lpss_uart_setup(struct lpss_private_data *pdata) { unsigned int tx_int_offset = pdata->dev_desc->prv_offset + LPSS_TX_INT; unsigned int offset; u32 reg; reg = readl(pdata->mmio_base + tx_int_offset); writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + tx_int_offset); offset = pdata->dev_desc->prv_offset + LPSS_TX_INT; reg = readl(pdata->mmio_base + offset); writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + offset); offset = pdata->dev_desc->prv_offset + LPSS_GENERAL; reg = readl(pdata->mmio_base + offset); writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); } static struct lpss_device_desc lpt_dev_desc = { Loading
drivers/acpi/acpi_platform.c +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,13 @@ ACPI_MODULE_NAME("platform"); static const struct acpi_device_id acpi_platform_device_ids[] = { { "PNP0D40" }, { "ACPI0003" }, { "VPC2004" }, { "BCM4752" }, /* Intel Smart Sound Technology */ { "INT33C8" }, { "80860F28" }, { } }; Loading
drivers/acpi/button.c +3 −6 Original line number Diff line number Diff line Loading @@ -383,18 +383,15 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_POWER, input->keybit); input_set_capability(input, EV_KEY, KEY_POWER); break; case ACPI_BUTTON_TYPE_SLEEP: input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_SLEEP, input->keybit); input_set_capability(input, EV_KEY, KEY_SLEEP); break; case ACPI_BUTTON_TYPE_LID: input->evbit[0] = BIT_MASK(EV_SW); set_bit(SW_LID, input->swbit); input_set_capability(input, EV_SW, SW_LID); break; } Loading