mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branches 'release', 'asus', 'bugzilla-8573', 'bugzilla-9995', 'bugzilla-10272', 'lockdep' and 'thermal' into release
This commit is contained in:
commit
d9ea1364d3
118 changed files with 1054 additions and 747 deletions
|
|
@ -283,34 +283,22 @@ config ACPI_TOSHIBA
|
|||
If you have a legacy free Toshiba laptop (such as the Libretto L1
|
||||
series), say Y.
|
||||
|
||||
config ACPI_CUSTOM_DSDT
|
||||
bool "Include Custom DSDT"
|
||||
config ACPI_CUSTOM_DSDT_FILE
|
||||
string "Custom DSDT Table file to include"
|
||||
default ""
|
||||
depends on !STANDALONE
|
||||
default n
|
||||
help
|
||||
This option supports a custom DSDT by linking it into the kernel.
|
||||
See Documentation/acpi/dsdt-override.txt
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config ACPI_CUSTOM_DSDT_FILE
|
||||
string "Custom DSDT Table file to include"
|
||||
depends on ACPI_CUSTOM_DSDT
|
||||
default ""
|
||||
help
|
||||
Enter the full path name to the file which includes the AmlCode
|
||||
declaration.
|
||||
|
||||
config ACPI_CUSTOM_DSDT_INITRD
|
||||
bool "Read Custom DSDT from initramfs"
|
||||
depends on BLK_DEV_INITRD
|
||||
default n
|
||||
help
|
||||
This option supports a custom DSDT by optionally loading it from initrd.
|
||||
See Documentation/acpi/dsdt-override.txt
|
||||
If unsure, don't enter a file name.
|
||||
|
||||
If you are not using this feature now, but may use it later,
|
||||
it is safe to say Y here.
|
||||
config ACPI_CUSTOM_DSDT
|
||||
bool
|
||||
default ACPI_CUSTOM_DSDT_FILE != ""
|
||||
|
||||
config ACPI_BLACKLIST_YEAR
|
||||
int "Disable ACPI for systems before Jan 1st this year" if X86_32
|
||||
|
|
|
|||
|
|
@ -293,13 +293,12 @@ static int extract_package(struct acpi_battery *battery,
|
|||
strncpy(ptr, (u8 *)&element->integer.value,
|
||||
sizeof(acpi_integer));
|
||||
ptr[sizeof(acpi_integer)] = 0;
|
||||
} else return -EFAULT;
|
||||
} else
|
||||
*ptr = 0; /* don't have value */
|
||||
} else {
|
||||
if (element->type == ACPI_TYPE_INTEGER) {
|
||||
int *x = (int *)((u8 *)battery +
|
||||
offsets[i].offset);
|
||||
*x = element->integer.value;
|
||||
} else return -EFAULT;
|
||||
int *x = (int *)((u8 *)battery + offsets[i].offset);
|
||||
*x = (element->type == ACPI_TYPE_INTEGER) ?
|
||||
element->integer.value : -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ static int __init acpi_init(void)
|
|||
|
||||
acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
|
||||
if (!acpi_kobj) {
|
||||
printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__);
|
||||
printk(KERN_WARNING "%s: kset create error\n", __func__);
|
||||
acpi_kobj = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -449,6 +449,7 @@ static int acpi_button_add(struct acpi_device *device)
|
|||
input->phys = button->phys;
|
||||
input->id.bustype = BUS_HOST;
|
||||
input->id.product = button->type;
|
||||
input->dev.parent = &device->dev;
|
||||
|
||||
switch (button->type) {
|
||||
case ACPI_BUTTON_TYPE_POWER:
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ static struct acpi_ec {
|
|||
struct mutex lock;
|
||||
wait_queue_head_t wait;
|
||||
struct list_head list;
|
||||
atomic_t irq_count;
|
||||
u8 handlers_installed;
|
||||
} *boot_ec, *first_ec;
|
||||
|
||||
|
|
@ -181,6 +182,8 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
atomic_set(&ec->irq_count, 0);
|
||||
|
||||
if (unlikely(event == ACPI_EC_EVENT_OBF_1 &&
|
||||
test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags)))
|
||||
force_poll = 1;
|
||||
|
|
@ -227,6 +230,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
|
|||
while (time_before(jiffies, delay)) {
|
||||
if (acpi_ec_check_status(ec, event))
|
||||
goto end;
|
||||
msleep(5);
|
||||
}
|
||||
}
|
||||
pr_err(PREFIX "acpi_ec_wait timeout,"
|
||||
|
|
@ -529,6 +533,13 @@ static u32 acpi_ec_gpe_handler(void *data)
|
|||
struct acpi_ec *ec = data;
|
||||
|
||||
pr_debug(PREFIX "~~~> interrupt\n");
|
||||
atomic_inc(&ec->irq_count);
|
||||
if (atomic_read(&ec->irq_count) > 5) {
|
||||
pr_err(PREFIX "GPE storm detected, disabling EC GPE\n");
|
||||
acpi_disable_gpe(NULL, ec->gpe, ACPI_ISR);
|
||||
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
|
||||
return ACPI_INTERRUPT_HANDLED;
|
||||
}
|
||||
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
|
||||
if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))
|
||||
wake_up(&ec->wait);
|
||||
|
|
@ -943,11 +954,7 @@ int __init acpi_ec_ecdt_probe(void)
|
|||
boot_ec->command_addr = ecdt_ptr->control.address;
|
||||
boot_ec->data_addr = ecdt_ptr->data.address;
|
||||
boot_ec->gpe = ecdt_ptr->gpe;
|
||||
if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
|
||||
&boot_ec->handle))) {
|
||||
pr_info("Failed to locate handle for boot EC\n");
|
||||
boot_ec->handle = ACPI_ROOT_OBJECT;
|
||||
}
|
||||
boot_ec->handle = ACPI_ROOT_OBJECT;
|
||||
} else {
|
||||
/* This workaround is needed only on some broken machines,
|
||||
* which require early EC, but fail to provide ECDT */
|
||||
|
|
|
|||
|
|
@ -91,10 +91,6 @@ static DEFINE_SPINLOCK(acpi_res_lock);
|
|||
#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
|
||||
static char osi_additional_string[OSI_STRING_LENGTH_MAX];
|
||||
|
||||
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
|
||||
static int acpi_no_initrd_override;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "Ode to _OSI(Linux)"
|
||||
*
|
||||
|
|
@ -324,67 +320,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
|
|||
return AE_OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
|
||||
static struct acpi_table_header *acpi_find_dsdt_initrd(void)
|
||||
{
|
||||
struct file *firmware_file;
|
||||
mm_segment_t oldfs;
|
||||
unsigned long len, len2;
|
||||
struct acpi_table_header *dsdt_buffer, *ret = NULL;
|
||||
struct kstat stat;
|
||||
char *ramfs_dsdt_name = "/DSDT.aml";
|
||||
|
||||
printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n");
|
||||
|
||||
/*
|
||||
* Never do this at home, only the user-space is allowed to open a file.
|
||||
* The clean way would be to use the firmware loader.
|
||||
* But this code must be run before there is any userspace available.
|
||||
* A static/init firmware infrastructure doesn't exist yet...
|
||||
*/
|
||||
if (vfs_stat(ramfs_dsdt_name, &stat) < 0)
|
||||
return ret;
|
||||
|
||||
len = stat.size;
|
||||
/* check especially against empty files */
|
||||
if (len <= 4) {
|
||||
printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0);
|
||||
if (IS_ERR(firmware_file)) {
|
||||
printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
dsdt_buffer = kmalloc(len, GFP_ATOMIC);
|
||||
if (!dsdt_buffer) {
|
||||
printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len);
|
||||
goto err;
|
||||
}
|
||||
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len,
|
||||
&firmware_file->f_pos);
|
||||
set_fs(oldfs);
|
||||
if (len2 < len) {
|
||||
printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n",
|
||||
len, ramfs_dsdt_name);
|
||||
ACPI_FREE(dsdt_buffer);
|
||||
goto err;
|
||||
}
|
||||
|
||||
printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n",
|
||||
len, ramfs_dsdt_name);
|
||||
ret = dsdt_buffer;
|
||||
err:
|
||||
filp_close(firmware_file, NULL);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
acpi_status
|
||||
acpi_os_table_override(struct acpi_table_header * existing_table,
|
||||
struct acpi_table_header ** new_table)
|
||||
|
|
@ -397,16 +332,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
|
|||
#ifdef CONFIG_ACPI_CUSTOM_DSDT
|
||||
if (strncmp(existing_table->signature, "DSDT", 4) == 0)
|
||||
*new_table = (struct acpi_table_header *)AmlCode;
|
||||
#endif
|
||||
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
|
||||
if ((strncmp(existing_table->signature, "DSDT", 4) == 0) &&
|
||||
!acpi_no_initrd_override) {
|
||||
struct acpi_table_header *initrd_table;
|
||||
|
||||
initrd_table = acpi_find_dsdt_initrd();
|
||||
if (initrd_table)
|
||||
*new_table = initrd_table;
|
||||
}
|
||||
#endif
|
||||
if (*new_table != NULL) {
|
||||
printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], "
|
||||
|
|
@ -418,15 +343,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
|
|||
return AE_OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
|
||||
static int __init acpi_no_initrd_override_setup(char *s)
|
||||
{
|
||||
acpi_no_initrd_override = 1;
|
||||
return 1;
|
||||
}
|
||||
__setup("acpi_no_initrd_override", acpi_no_initrd_override_setup);
|
||||
#endif
|
||||
|
||||
static irqreturn_t acpi_irq(int irq, void *dev_id)
|
||||
{
|
||||
u32 handled;
|
||||
|
|
@ -1237,7 +1153,7 @@ int acpi_check_resource_conflict(struct resource *res)
|
|||
|
||||
if (clash) {
|
||||
if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
|
||||
printk(KERN_INFO "%sACPI: %s resource %s [0x%llx-0x%llx]"
|
||||
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
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -76,6 +77,101 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */
|
||||
static struct dmi_system_id medion_md9580[] = {
|
||||
{
|
||||
.ident = "Medion MD9580-F laptop",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "A555"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
/* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */
|
||||
static struct dmi_system_id dell_optiplex[] = {
|
||||
{
|
||||
.ident = "Dell Optiplex GX1",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX1 600S+"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
/* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */
|
||||
static struct dmi_system_id hp_t5710[] = {
|
||||
{
|
||||
.ident = "HP t5710",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "hp t5000 series"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "098Ch"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
struct prt_quirk {
|
||||
struct dmi_system_id *system;
|
||||
unsigned int segment;
|
||||
unsigned int bus;
|
||||
unsigned int device;
|
||||
unsigned char pin;
|
||||
char *source; /* according to BIOS */
|
||||
char *actual_source;
|
||||
};
|
||||
|
||||
/*
|
||||
* These systems have incorrect _PRT entries. The BIOS claims the PCI
|
||||
* interrupt at the listed segment/bus/device/pin is connected to the first
|
||||
* link device, but it is actually connected to the second.
|
||||
*/
|
||||
static struct prt_quirk prt_quirks[] = {
|
||||
{ medion_md9580, 0, 0, 9, 'A',
|
||||
"\\_SB_.PCI0.ISA.LNKA",
|
||||
"\\_SB_.PCI0.ISA.LNKB"},
|
||||
{ dell_optiplex, 0, 0, 0xd, 'A',
|
||||
"\\_SB_.LNKB",
|
||||
"\\_SB_.LNKA"},
|
||||
{ hp_t5710, 0, 0, 1, 'A',
|
||||
"\\_SB_.PCI0.LNK1",
|
||||
"\\_SB_.PCI0.LNK3"},
|
||||
};
|
||||
|
||||
static void
|
||||
do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt)
|
||||
{
|
||||
int i;
|
||||
struct prt_quirk *quirk;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(prt_quirks); i++) {
|
||||
quirk = &prt_quirks[i];
|
||||
|
||||
/* All current quirks involve link devices, not GSIs */
|
||||
if (!prt->source)
|
||||
continue;
|
||||
|
||||
if (dmi_check_system(quirk->system) &&
|
||||
entry->id.segment == quirk->segment &&
|
||||
entry->id.bus == quirk->bus &&
|
||||
entry->id.device == quirk->device &&
|
||||
entry->pin + 'A' == quirk->pin &&
|
||||
!strcmp(prt->source, quirk->source) &&
|
||||
strlen(prt->source) >= strlen(quirk->actual_source)) {
|
||||
printk(KERN_WARNING PREFIX "firmware reports "
|
||||
"%04x:%02x:%02x[%c] connected to %s; "
|
||||
"changing to %s\n",
|
||||
entry->id.segment, entry->id.bus,
|
||||
entry->id.device, 'A' + entry->pin,
|
||||
prt->source, quirk->actual_source);
|
||||
strcpy(prt->source, quirk->actual_source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
acpi_pci_irq_add_entry(acpi_handle handle,
|
||||
int segment, int bus, struct acpi_pci_routing_table *prt)
|
||||
|
|
@ -96,6 +192,8 @@ acpi_pci_irq_add_entry(acpi_handle handle,
|
|||
entry->id.function = prt->address & 0xFFFF;
|
||||
entry->pin = prt->pin;
|
||||
|
||||
do_prt_fixups(entry, prt);
|
||||
|
||||
/*
|
||||
* Type 1: Dynamic
|
||||
* ---------------
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void acpi_pci_bridge_scan(struct acpi_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
static int acpi_pci_root_add(struct acpi_device *device)
|
||||
static int __devinit acpi_pci_root_add(struct acpi_device *device)
|
||||
{
|
||||
int result = 0;
|
||||
struct acpi_pci_root *root = NULL;
|
||||
|
|
|
|||
|
|
@ -840,17 +840,19 @@ static int is_processor_present(acpi_handle handle)
|
|||
|
||||
|
||||
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
|
||||
/*
|
||||
* if a processor object does not have an _STA object,
|
||||
* OSPM assumes that the processor is present.
|
||||
*/
|
||||
if (status == AE_NOT_FOUND)
|
||||
return 1;
|
||||
|
||||
if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT))
|
||||
return 1;
|
||||
|
||||
ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
|
||||
/*
|
||||
* _STA is mandatory for a processor that supports hot plug
|
||||
*/
|
||||
if (status == AE_NOT_FOUND)
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Processor does not support hot plug\n"));
|
||||
else
|
||||
ACPI_EXCEPTION((AE_INFO, status,
|
||||
"Processor Device is not present"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -886,8 +888,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
||||
static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
|
||||
u32 event, void *data)
|
||||
{
|
||||
struct acpi_processor *pr;
|
||||
struct acpi_device *device = NULL;
|
||||
|
|
@ -897,9 +899,10 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
|||
switch (event) {
|
||||
case ACPI_NOTIFY_BUS_CHECK:
|
||||
case ACPI_NOTIFY_DEVICE_CHECK:
|
||||
printk("Processor driver received %s event\n",
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Processor driver received %s event\n",
|
||||
(event == ACPI_NOTIFY_BUS_CHECK) ?
|
||||
"ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
|
||||
"ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"));
|
||||
|
||||
if (!is_processor_present(handle))
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -216,8 +216,10 @@ static void acpi_safe_halt(void)
|
|||
* test NEED_RESCHED:
|
||||
*/
|
||||
smp_mb();
|
||||
if (!need_resched())
|
||||
if (!need_resched()) {
|
||||
safe_halt();
|
||||
local_irq_disable();
|
||||
}
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
}
|
||||
|
||||
|
|
@ -421,7 +423,9 @@ static void acpi_processor_idle(void)
|
|||
else
|
||||
acpi_safe_halt();
|
||||
|
||||
local_irq_enable();
|
||||
if (irqs_disabled())
|
||||
local_irq_enable();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -530,7 +534,9 @@ static void acpi_processor_idle(void)
|
|||
* skew otherwise.
|
||||
*/
|
||||
sleep_ticks = 0xFFFFFFFF;
|
||||
local_irq_enable();
|
||||
if (irqs_disabled())
|
||||
local_irq_enable();
|
||||
|
||||
break;
|
||||
|
||||
case ACPI_STATE_C2:
|
||||
|
|
|
|||
|
|
@ -609,7 +609,8 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
|
|||
status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
obj = buffer.pointer;
|
||||
status = acpi_get_handle(NULL, obj->string.pointer, ejd);
|
||||
status = acpi_get_handle(ACPI_ROOT_OBJECT, obj->string.pointer,
|
||||
ejd);
|
||||
kfree(buffer.pointer);
|
||||
}
|
||||
return status;
|
||||
|
|
@ -966,7 +967,7 @@ static void acpi_device_set_id(struct acpi_device *device,
|
|||
case ACPI_BUS_TYPE_DEVICE:
|
||||
status = acpi_get_object_info(handle, &buffer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
printk(KERN_ERR PREFIX "%s: Error reading device info\n", __FUNCTION__);
|
||||
printk(KERN_ERR PREFIX "%s: Error reading device info\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ static void acpi_power_off_prepare(void)
|
|||
static void acpi_power_off(void)
|
||||
{
|
||||
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
|
||||
printk("%s called\n", __FUNCTION__);
|
||||
printk("%s called\n", __func__);
|
||||
local_irq_disable();
|
||||
acpi_enable_wakeup_device(ACPI_STATE_S5);
|
||||
acpi_enter_sleep_state(ACPI_STATE_S5);
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ void acpi_irq_stats_init(void)
|
|||
goto fail;
|
||||
|
||||
for (i = 0; i < num_counters; ++i) {
|
||||
char buffer[10];
|
||||
char buffer[12];
|
||||
char *name;
|
||||
|
||||
if (i < num_gpes)
|
||||
|
|
|
|||
|
|
@ -879,6 +879,8 @@ static void acpi_thermal_check(void *data)
|
|||
}
|
||||
|
||||
/* sys I/F for generic thermal sysfs support */
|
||||
#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
|
||||
|
||||
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
|
||||
{
|
||||
struct acpi_thermal *tz = thermal->devdata;
|
||||
|
|
@ -886,7 +888,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
|
|||
if (!tz)
|
||||
return -EINVAL;
|
||||
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
|
||||
}
|
||||
|
||||
static const char enabled[] = "kernel";
|
||||
|
|
@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
|
|||
|
||||
if (tz->trips.critical.flags.valid) {
|
||||
if (!trip)
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
|
||||
tz->trips.critical.temperature));
|
||||
trip--;
|
||||
}
|
||||
|
||||
if (tz->trips.hot.flags.valid) {
|
||||
if (!trip)
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
|
||||
tz->trips.hot.temperature));
|
||||
trip--;
|
||||
}
|
||||
|
||||
if (tz->trips.passive.flags.valid) {
|
||||
if (!trip)
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
|
||||
tz->trips.passive.temperature));
|
||||
trip--;
|
||||
}
|
||||
|
|
@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
|
|||
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
|
||||
tz->trips.active[i].flags.valid; i++) {
|
||||
if (!trip)
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
|
||||
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
|
||||
tz->trips.active[i].temperature));
|
||||
trip--;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,13 @@ MODULE_LICENSE("GPL");
|
|||
#define HCI_VIDEO_OUT_CRT 0x2
|
||||
#define HCI_VIDEO_OUT_TV 0x4
|
||||
|
||||
static const struct acpi_device_id toshiba_device_ids[] = {
|
||||
{"TOS6200", 0},
|
||||
{"TOS1900", 0},
|
||||
{"", 0},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
|
||||
|
||||
/* utility
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void acpi_ut_track_stack_ptr(void)
|
|||
* RETURN: Updated pointer to the function name
|
||||
*
|
||||
* DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
|
||||
* This allows compiler macros such as __FUNCTION__ to be used
|
||||
* This allows compiler macros such as __func__ to be used
|
||||
* with no change to the debug output.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
|
|||
* element -- which is legal)
|
||||
*/
|
||||
if (!internal_object) {
|
||||
*obj_length = 0;
|
||||
*obj_length = sizeof(union acpi_object);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -407,6 +407,12 @@ acpi_evaluate_reference(acpi_handle handle,
|
|||
break;
|
||||
}
|
||||
|
||||
if (!element->reference.handle) {
|
||||
printk(KERN_WARNING PREFIX "Invalid reference in"
|
||||
" package %s\n", pathname);
|
||||
status = AE_NULL_ENTRY;
|
||||
break;
|
||||
}
|
||||
/* Get the acpi_handle. */
|
||||
|
||||
list->handles[i] = element->reference.handle;
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
|||
|
||||
kfree(obj);
|
||||
|
||||
if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){
|
||||
if (device->cap._BCL && device->cap._BCM && max_level > 0) {
|
||||
int result;
|
||||
static int count = 0;
|
||||
char *name;
|
||||
|
|
@ -807,40 +807,11 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
|
|||
static int acpi_video_bus_check(struct acpi_video_bus *video)
|
||||
{
|
||||
acpi_status status = -ENOENT;
|
||||
long device_id;
|
||||
struct device *dev;
|
||||
struct acpi_device *device;
|
||||
|
||||
|
||||
if (!video)
|
||||
return -EINVAL;
|
||||
|
||||
device = video->device;
|
||||
|
||||
status =
|
||||
acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
|
||||
|
||||
if (!ACPI_SUCCESS(status))
|
||||
return -ENODEV;
|
||||
|
||||
/* We need to attempt to determine whether the _ADR refers to a
|
||||
PCI device or not. There's no terribly good way to do this,
|
||||
so the best we can hope for is to assume that there'll never
|
||||
be a video device in the host bridge */
|
||||
if (device_id >= 0x10000) {
|
||||
/* It looks like a PCI device. Does it exist? */
|
||||
dev = acpi_get_physical_device(device->handle);
|
||||
} else {
|
||||
/* It doesn't look like a PCI device. Does its parent
|
||||
exist? */
|
||||
acpi_handle phandle;
|
||||
if (acpi_get_parent(device->handle, &phandle))
|
||||
return -ENODEV;
|
||||
dev = acpi_get_physical_device(phandle);
|
||||
}
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
put_device(dev);
|
||||
|
||||
/* Since there is no HID, CID and so on for VGA driver, we have
|
||||
* to check well known required nodes.
|
||||
*/
|
||||
|
|
@ -1201,7 +1172,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
|
|||
if (!video)
|
||||
goto end;
|
||||
|
||||
printk(KERN_INFO PREFIX "Please implement %s\n", __FUNCTION__);
|
||||
printk(KERN_INFO PREFIX "Please implement %s\n", __func__);
|
||||
seq_printf(seq, "<TODO>\n");
|
||||
|
||||
end:
|
||||
|
|
@ -1366,37 +1337,8 @@ acpi_video_bus_write_DOS(struct file *file,
|
|||
|
||||
static int acpi_video_bus_add_fs(struct acpi_device *device)
|
||||
{
|
||||
long device_id;
|
||||
int status;
|
||||
struct proc_dir_entry *entry = NULL;
|
||||
struct acpi_video_bus *video;
|
||||
struct device *dev;
|
||||
|
||||
status =
|
||||
acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
|
||||
|
||||
if (!ACPI_SUCCESS(status))
|
||||
return -ENODEV;
|
||||
|
||||
/* We need to attempt to determine whether the _ADR refers to a
|
||||
PCI device or not. There's no terribly good way to do this,
|
||||
so the best we can hope for is to assume that there'll never
|
||||
be a video device in the host bridge */
|
||||
if (device_id >= 0x10000) {
|
||||
/* It looks like a PCI device. Does it exist? */
|
||||
dev = acpi_get_physical_device(device->handle);
|
||||
} else {
|
||||
/* It doesn't look like a PCI device. Does its parent
|
||||
exist? */
|
||||
acpi_handle phandle;
|
||||
if (acpi_get_parent(device->handle, &phandle))
|
||||
return -ENODEV;
|
||||
dev = acpi_get_physical_device(phandle);
|
||||
}
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
put_device(dev);
|
||||
|
||||
|
||||
|
||||
video = acpi_driver_data(device);
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ struct acpi_buffer *out)
|
|||
{
|
||||
struct guid_block *block = NULL;
|
||||
struct wmi_block *wblock = NULL;
|
||||
acpi_handle handle;
|
||||
acpi_handle handle, wc_handle;
|
||||
acpi_status status, wc_status = AE_ERROR;
|
||||
struct acpi_object_list input, wc_input;
|
||||
union acpi_object wc_params[1], wq_params[1];
|
||||
|
|
@ -338,8 +338,10 @@ struct acpi_buffer *out)
|
|||
* expensive, but have no corresponding WCxx method. So we
|
||||
* should not fail if this happens.
|
||||
*/
|
||||
wc_status = acpi_evaluate_object(handle, wc_method,
|
||||
&wc_input, NULL);
|
||||
wc_status = acpi_get_handle(handle, wc_method, &wc_handle);
|
||||
if (ACPI_SUCCESS(wc_status))
|
||||
wc_status = acpi_evaluate_object(handle, wc_method,
|
||||
&wc_input, NULL);
|
||||
}
|
||||
|
||||
strcpy(method, "WQ");
|
||||
|
|
@ -351,7 +353,7 @@ struct acpi_buffer *out)
|
|||
* If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if
|
||||
* the WQxx method failed - we should disable collection anyway.
|
||||
*/
|
||||
if ((block->flags & ACPI_WMI_EXPENSIVE) && wc_status) {
|
||||
if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) {
|
||||
wc_params[0].integer.value = 0;
|
||||
status = acpi_evaluate_object(handle,
|
||||
wc_method, &wc_input, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue