Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44971
b: refs/heads/master
c: 49a13cd
h: refs/heads/master
i:
  44969: 20f36ab
  44967: 0772551
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Dec 7, 2006
1 parent 86fd52b commit d8331a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a12095c2b50c8a7c80517e37c00d6e6c863d43c5
refs/heads/master: 49a13cd6a2acd284ee106eaea7eeea8f2cc6796a
23 changes: 18 additions & 5 deletions trunk/drivers/acpi/ibm_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/proc_fs.h>
#include <linux/backlight.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -361,7 +362,7 @@ enum { /* Fan control constants */
* control */
};

static int ibm_thinkpad_ec_found;
static char* ibm_thinkpad_ec_found = NULL;

struct ibm_struct {
char *name;
Expand Down Expand Up @@ -2540,11 +2541,15 @@ static void acpi_ibm_exit(void)
ibm_exit(&ibms[i]);

remove_proc_entry(IBM_DIR, acpi_root_dir);

if (ibm_thinkpad_ec_found)
kfree(ibm_thinkpad_ec_found);
}

static int __init check_dmi_for_ec(void)
static char* __init check_dmi_for_ec(void)
{
struct dmi_device *dev = NULL;
char ec_fw_string[18];

/*
* ThinkPad T23 or newer, A31 or newer, R50e or newer,
Expand All @@ -2554,10 +2559,15 @@ static int __init check_dmi_for_ec(void)
* See http://thinkwiki.org/wiki/List_of_DMI_IDs
*/
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
if (strstr(dev->name, "IBM ThinkPad Embedded Controller"))
return 1;
if (sscanf(dev->name,
"IBM ThinkPad Embedded Controller -[%17c",
ec_fw_string) == 1) {
ec_fw_string[sizeof(ec_fw_string) - 1] = 0;
ec_fw_string[strcspn(ec_fw_string, " ]")] = 0;
return kstrdup(ec_fw_string, GFP_KERNEL);
}
}
return 0;
return NULL;
}

static int __init acpi_ibm_init(void)
Expand All @@ -2581,6 +2591,9 @@ static int __init acpi_ibm_init(void)

/* Models with newer firmware report the EC in DMI */
ibm_thinkpad_ec_found = check_dmi_for_ec();
if (ibm_thinkpad_ec_found)
printk(IBM_INFO "ThinkPad EC firmware %s\n",
ibm_thinkpad_ec_found);

/* these handles are not required */
IBM_HANDLE_INIT(vid);
Expand Down

0 comments on commit d8331a8

Please sign in to comment.