mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
Merge branches 'battery', 'bugzilla-14667', 'bugzilla-15096', 'bugzilla-15480', 'bugzilla-15521', 'bugzilla-15605', 'gpe-reference-counters', 'misc', 'pxm-fix' and 'video-random-key' into release
This commit is contained in:
parent
f79e1cec8c
dadf28a10c
ac7729da88
3162b6f0c5
bc73675b99
b7b30de53a
bf02bd2590
1638bca898
0f9b75ef37
17c452f99c
commit
c25f7cf203
4360 changed files with 8784 additions and 3753 deletions
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/memory_hotplug.h>
|
||||
#include <linux/slab.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
#define ACPI_MEMORY_DEVICE_CLASS "memory"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <linux/freezer.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/slab.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -117,19 +117,14 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
|
|||
if (ACPI_FAILURE(status))
|
||||
return_ACPI_STATUS(status);
|
||||
|
||||
/* Mark wake-enabled or HW enable, or both */
|
||||
/* Clear the GPE (of stale events), then enable it */
|
||||
status = acpi_hw_clear_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status))
|
||||
return_ACPI_STATUS(status);
|
||||
|
||||
if (gpe_event_info->runtime_count) {
|
||||
/* Clear the GPE (of stale events), then enable it */
|
||||
status = acpi_hw_clear_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status))
|
||||
return_ACPI_STATUS(status);
|
||||
|
||||
/* Enable the requested runtime GPE */
|
||||
status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
/* Enable the requested GPE */
|
||||
status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
|||
|
|
@ -468,6 +468,18 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
|
|||
|
||||
acpi_ut_add_reference(obj_desc->field.region_obj);
|
||||
|
||||
/* allow full data read from EC address space */
|
||||
if (obj_desc->field.region_obj->region.space_id ==
|
||||
ACPI_ADR_SPACE_EC) {
|
||||
if (obj_desc->common_field.bit_length > 8)
|
||||
obj_desc->common_field.access_bit_width =
|
||||
ACPI_ROUND_UP(obj_desc->common_field.
|
||||
bit_length, 8);
|
||||
obj_desc->common_field.access_byte_width =
|
||||
ACPI_DIV_8(obj_desc->common_field.
|
||||
access_bit_width);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
|
||||
"RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
|
||||
obj_desc->field.start_field_bit_offset,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/jiffies.h>
|
||||
#include <linux/async.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#ifdef CONFIG_ACPI_PROCFS_POWER
|
||||
#include <linux/proc_fs.h>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/device.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/slab.h>
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/mpspec.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/slab.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/notifier.h>
|
||||
|
|
@ -1025,13 +1026,10 @@ static int dock_remove(struct dock_station *ds)
|
|||
static acpi_status
|
||||
find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
|
||||
{
|
||||
acpi_status status = AE_OK;
|
||||
|
||||
if (is_dock(handle))
|
||||
if (dock_add(handle) >= 0)
|
||||
status = AE_CTRL_TERMINATE;
|
||||
dock_add(handle);
|
||||
|
||||
return status;
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static acpi_status
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/io.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
|
@ -628,12 +629,12 @@ static u32 acpi_ec_gpe_handler(void *data)
|
|||
|
||||
static acpi_status
|
||||
acpi_ec_space_handler(u32 function, acpi_physical_address address,
|
||||
u32 bits, u64 *value,
|
||||
u32 bits, u64 *value64,
|
||||
void *handler_context, void *region_context)
|
||||
{
|
||||
struct acpi_ec *ec = handler_context;
|
||||
int result = 0, i;
|
||||
u8 temp = 0;
|
||||
int result = 0, i, bytes = bits / 8;
|
||||
u8 *value = (u8 *)value64;
|
||||
|
||||
if ((address > 0xFF) || !value || !handler_context)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
|
@ -641,32 +642,15 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
|
|||
if (function != ACPI_READ && function != ACPI_WRITE)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
if (bits != 8 && acpi_strict)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
if (EC_FLAGS_MSI)
|
||||
if (EC_FLAGS_MSI || bits > 8)
|
||||
acpi_ec_burst_enable(ec);
|
||||
|
||||
if (function == ACPI_READ) {
|
||||
result = acpi_ec_read(ec, address, &temp);
|
||||
*value = temp;
|
||||
} else {
|
||||
temp = 0xff & (*value);
|
||||
result = acpi_ec_write(ec, address, temp);
|
||||
}
|
||||
for (i = 0; i < bytes; ++i, ++address, ++value)
|
||||
result = (function == ACPI_READ) ?
|
||||
acpi_ec_read(ec, address, value) :
|
||||
acpi_ec_write(ec, address, *value);
|
||||
|
||||
for (i = 8; unlikely(bits - i > 0); i += 8) {
|
||||
++address;
|
||||
if (function == ACPI_READ) {
|
||||
result = acpi_ec_read(ec, address, &temp);
|
||||
(*value) |= ((u64)temp) << i;
|
||||
} else {
|
||||
temp = 0xff & ((*value) >> i);
|
||||
result = acpi_ec_write(ec, address, temp);
|
||||
}
|
||||
}
|
||||
|
||||
if (EC_FLAGS_MSI)
|
||||
if (EC_FLAGS_MSI || bits > 8)
|
||||
acpi_ec_burst_disable(ec);
|
||||
|
||||
switch (result) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <linux/proc_fs.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <net/netlink.h>
|
||||
#include <net/genetlink.h>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/acpi.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,10 @@ int node_to_pxm(int node)
|
|||
|
||||
void __acpi_map_pxm_to_node(int pxm, int node)
|
||||
{
|
||||
pxm_to_node_map[pxm] = node;
|
||||
node_to_pxm_map[node] = pxm;
|
||||
if (pxm_to_node_map[pxm] == NUMA_NO_NODE || node < pxm_to_node_map[pxm])
|
||||
pxm_to_node_map[pxm] = node;
|
||||
if (node_to_pxm_map[node] == PXM_INVAL || pxm < node_to_pxm_map[node])
|
||||
node_to_pxm_map[node] = pxm;
|
||||
}
|
||||
|
||||
int acpi_map_pxm_to_node(int pxm)
|
||||
|
|
|
|||
|
|
@ -758,7 +758,14 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
|
|||
queue = hp ? kacpi_hotplug_wq :
|
||||
(type == OSL_NOTIFY_HANDLER ? kacpi_notify_wq : kacpid_wq);
|
||||
dpc->wait = hp ? 1 : 0;
|
||||
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
|
||||
|
||||
if (queue == kacpi_hotplug_wq)
|
||||
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
|
||||
else if (queue == kacpi_notify_wq)
|
||||
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
|
||||
else
|
||||
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
|
||||
|
||||
ret = queue_work(queue, &dpc->work);
|
||||
|
||||
if (!ret) {
|
||||
|
|
@ -1151,16 +1158,10 @@ int acpi_check_resource_conflict(const struct resource *res)
|
|||
|
||||
if (clash) {
|
||||
if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
|
||||
printk("%sACPI: %s resource %s [0x%llx-0x%llx]"
|
||||
" conflicts with ACPI region %s"
|
||||
" [0x%llx-0x%llx]\n",
|
||||
acpi_enforce_resources == ENFORCE_RESOURCES_LAX
|
||||
? KERN_WARNING : KERN_ERR,
|
||||
ioport ? "I/O" : "Memory", res->name,
|
||||
(long long) res->start, (long long) res->end,
|
||||
res_list_elem->name,
|
||||
(long long) res_list_elem->start,
|
||||
(long long) res_list_elem->end);
|
||||
printk(KERN_WARNING "ACPI: resource %s %pR"
|
||||
" conflicts with ACPI region %s %pR\n",
|
||||
res->name, res, res_list_elem->name,
|
||||
res_list_elem);
|
||||
if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX)
|
||||
printk(KERN_NOTICE "ACPI: This conflict may"
|
||||
" cause random problems and system"
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include <linux/pm.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/slab.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include <linux/pm.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/pci.h>
|
||||
#include <linux/pci-acpi.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/slab.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/acpi.h>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/jiffies.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/time.h>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
* - Added _PDC for platforms with Intel CPUs
|
||||
*/
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <acpi/processor.h>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include <linux/dmi.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/system.h>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/acpi.h>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/cpufeature.h>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/cpufreq.h>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include "sbshc.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/signal.h>
|
||||
|
|
@ -1080,12 +1081,6 @@ static void acpi_device_set_id(struct acpi_device *device)
|
|||
if (ACPI_IS_ROOT_DEVICE(device)) {
|
||||
acpi_add_id(device, ACPI_SYSTEM_HID);
|
||||
break;
|
||||
} else if (ACPI_IS_ROOT_DEVICE(device->parent)) {
|
||||
/* \_SB_, the only root-level namespace device */
|
||||
acpi_add_id(device, ACPI_BUS_HID);
|
||||
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
|
||||
strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
|
||||
break;
|
||||
}
|
||||
|
||||
status = acpi_get_object_info(device->handle, &info);
|
||||
|
|
@ -1120,6 +1115,12 @@ static void acpi_device_set_id(struct acpi_device *device)
|
|||
acpi_add_id(device, ACPI_DOCK_HID);
|
||||
else if (!acpi_ibm_smbus_match(device))
|
||||
acpi_add_id(device, ACPI_SMBUS_IBM_HID);
|
||||
else if (!acpi_device_hid(device) &&
|
||||
ACPI_IS_ROOT_DEVICE(device->parent)) {
|
||||
acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
|
||||
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
|
||||
strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
|
||||
}
|
||||
|
||||
break;
|
||||
case ACPI_BUS_TYPE_POWER:
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
|
|
|
|||
|
|
@ -39,10 +39,12 @@
|
|||
#include <linux/sort.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/pci_ids.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <linux/suspend.h>
|
||||
|
||||
#define PREFIX "ACPI: "
|
||||
|
||||
|
|
@ -88,7 +90,6 @@ module_param(allow_duplicates, bool, 0644);
|
|||
static int register_count = 0;
|
||||
static int acpi_video_bus_add(struct acpi_device *device);
|
||||
static int acpi_video_bus_remove(struct acpi_device *device, int type);
|
||||
static int acpi_video_resume(struct acpi_device *device);
|
||||
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id video_device_ids[] = {
|
||||
|
|
@ -104,7 +105,6 @@ static struct acpi_driver acpi_video_bus = {
|
|||
.ops = {
|
||||
.add = acpi_video_bus_add,
|
||||
.remove = acpi_video_bus_remove,
|
||||
.resume = acpi_video_resume,
|
||||
.notify = acpi_video_bus_notify,
|
||||
},
|
||||
};
|
||||
|
|
@ -159,6 +159,7 @@ struct acpi_video_bus {
|
|||
struct proc_dir_entry *dir;
|
||||
struct input_dev *input;
|
||||
char phys[32]; /* for input device */
|
||||
struct notifier_block pm_nb;
|
||||
};
|
||||
|
||||
struct acpi_video_device_flags {
|
||||
|
|
@ -1020,6 +1021,13 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
|||
if (IS_ERR(device->backlight))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Save current brightness level in case we have to restore it
|
||||
* before acpi_video_device_lcd_set_level() is called next time.
|
||||
*/
|
||||
device->backlight->props.brightness =
|
||||
acpi_video_get_brightness(device->backlight);
|
||||
|
||||
result = sysfs_create_link(&device->backlight->dev.kobj,
|
||||
&device->dev->dev.kobj, "device");
|
||||
if (result)
|
||||
|
|
@ -2122,7 +2130,7 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
|
|||
{
|
||||
struct acpi_video_bus *video = acpi_driver_data(device);
|
||||
struct input_dev *input;
|
||||
int keycode;
|
||||
int keycode = 0;
|
||||
|
||||
if (!video)
|
||||
return;
|
||||
|
|
@ -2158,17 +2166,19 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
|
|||
break;
|
||||
|
||||
default:
|
||||
keycode = KEY_UNKNOWN;
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Unsupported event [0x%x]\n", event));
|
||||
break;
|
||||
}
|
||||
|
||||
acpi_notifier_call_chain(device, event, 0);
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
|
||||
if (keycode) {
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -2179,7 +2189,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
|
|||
struct acpi_device *device = NULL;
|
||||
struct acpi_video_bus *bus;
|
||||
struct input_dev *input;
|
||||
int keycode;
|
||||
int keycode = 0;
|
||||
|
||||
if (!video_device)
|
||||
return;
|
||||
|
|
@ -2220,39 +2230,48 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
|
|||
keycode = KEY_DISPLAY_OFF;
|
||||
break;
|
||||
default:
|
||||
keycode = KEY_UNKNOWN;
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Unsupported event [0x%x]\n", event));
|
||||
break;
|
||||
}
|
||||
|
||||
acpi_notifier_call_chain(device, event, 0);
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
|
||||
if (keycode) {
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int instance;
|
||||
static int acpi_video_resume(struct acpi_device *device)
|
||||
static int acpi_video_resume(struct notifier_block *nb,
|
||||
unsigned long val, void *ign)
|
||||
{
|
||||
struct acpi_video_bus *video;
|
||||
struct acpi_video_device *video_device;
|
||||
int i;
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
switch (val) {
|
||||
case PM_HIBERNATION_PREPARE:
|
||||
case PM_SUSPEND_PREPARE:
|
||||
case PM_RESTORE_PREPARE:
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
video = acpi_driver_data(device);
|
||||
video = container_of(nb, struct acpi_video_bus, pm_nb);
|
||||
|
||||
dev_info(&video->device->dev, "Restoring backlight state\n");
|
||||
|
||||
for (i = 0; i < video->attached_count; i++) {
|
||||
video_device = video->attached_array[i].bind_info;
|
||||
if (video_device && video_device->backlight)
|
||||
acpi_video_set_brightness(video_device->backlight);
|
||||
}
|
||||
return AE_OK;
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static acpi_status
|
||||
|
|
@ -2276,6 +2295,8 @@ acpi_video_bus_match(acpi_handle handle, u32 level, void *context,
|
|||
return AE_OK;
|
||||
}
|
||||
|
||||
static int instance;
|
||||
|
||||
static int acpi_video_bus_add(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_video_bus *video;
|
||||
|
|
@ -2357,7 +2378,6 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
|||
set_bit(KEY_BRIGHTNESSDOWN, input->keybit);
|
||||
set_bit(KEY_BRIGHTNESS_ZERO, input->keybit);
|
||||
set_bit(KEY_DISPLAY_OFF, input->keybit);
|
||||
set_bit(KEY_UNKNOWN, input->keybit);
|
||||
|
||||
error = input_register_device(input);
|
||||
if (error)
|
||||
|
|
@ -2369,6 +2389,10 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
|||
video->flags.rom ? "yes" : "no",
|
||||
video->flags.post ? "yes" : "no");
|
||||
|
||||
video->pm_nb.notifier_call = acpi_video_resume;
|
||||
video->pm_nb.priority = 0;
|
||||
register_pm_notifier(&video->pm_nb);
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_input_dev:
|
||||
|
|
@ -2395,6 +2419,8 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
|
|||
|
||||
video = acpi_driver_data(device);
|
||||
|
||||
unregister_pm_notifier(&video->pm_nb);
|
||||
|
||||
acpi_video_bus_stop_devices(video);
|
||||
acpi_video_bus_put_devices(video);
|
||||
acpi_video_bus_remove_fs(device);
|
||||
|
|
|
|||
Loading…
Reference in a new issue