Skip to content

Commit

Permalink
Pull misc-for-upstream into release branch
Browse files Browse the repository at this point in the history
Conflicts:

	drivers/usb/misc/appledisplay.c

Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
lenb committed Feb 16, 2007
2 parents 8a03d9a + 0539771 commit 81450b7
Show file tree
Hide file tree
Showing 19 changed files with 141 additions and 170 deletions.
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ L: [email protected]
W: http://acpi.sourceforge.net/
S: Supported

ACPI VIDEO DRIVER
P: Luming Yu
M: [email protected]
L: [email protected]
W: http://acpi.sourceforge.net/
S: Supported

AD1816 SOUND DRIVER
P: Thorsten Knabe
M: Thorsten Knabe <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config ACPI
depends on IA64 || X86
depends on PCI
depends on PM
select PNP
default y
---help---
Advanced Configuration and Power Interface (ACPI) support for
Expand Down
14 changes: 13 additions & 1 deletion drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct asus_hotk {
W5A, //W5A
W3V, //W3030V
xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
A4S, //Z81sp
//(Centrino)
END_MODEL
} model; //Models currently supported
Expand Down Expand Up @@ -397,7 +398,16 @@ static struct model_data model_conf[END_MODEL] = {
.brightness_set = "SPLV",
.brightness_get = "GPLV",
.display_set = "SDSP",
.display_get = "\\ADVG"}
.display_get = "\\ADVG"},

{
.name = "A4S",
.brightness_set = "SPLV",
.brightness_get = "GPLV",
.mt_bt_switch = "BLED",
.mt_wled = "WLED"
}

};

/* procdir we use */
Expand Down Expand Up @@ -1117,6 +1127,8 @@ static int asus_model_match(char *model)
return W3V;
else if (strncmp(model, "W5A", 3) == 0)
return W5A;
else if (strncmp(model, "A4S", 3) == 0)
return A4S;
else
return END_MODEL;
}
Expand Down
101 changes: 5 additions & 96 deletions drivers/acpi/bay.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ MODULE_LICENSE("GPL");
acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\
printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); }
static void bay_notify(acpi_handle handle, u32 event, void *data);
static int acpi_bay_add(struct acpi_device *device);
static int acpi_bay_remove(struct acpi_device *device, int type);

static struct acpi_driver acpi_bay_driver = {
.name = ACPI_BAY_DRIVER_NAME,
.class = ACPI_BAY_CLASS,
.ids = ACPI_BAY_HID,
.ops = {
.add = acpi_bay_add,
.remove = acpi_bay_remove,
},
};

struct bay {
acpi_handle handle;
Expand Down Expand Up @@ -234,14 +222,6 @@ int eject_removable_drive(struct device *dev)
}
EXPORT_SYMBOL_GPL(eject_removable_drive);

static int acpi_bay_add(struct acpi_device *device)
{
bay_dprintk(device->handle, "adding bay device");
strcpy(acpi_device_name(device), "Dockable Bay");
strcpy(acpi_device_class(device), "bay");
return 0;
}

static int acpi_bay_add_fs(struct bay *bay)
{
int ret;
Expand Down Expand Up @@ -303,7 +283,7 @@ static int bay_add(acpi_handle handle, int id)

/* initialize platform device stuff */
pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0);
if (pdev == NULL) {
if (IS_ERR(pdev)) {
printk(KERN_ERR PREFIX "Error registering bay device\n");
goto bay_add_err;
}
Expand Down Expand Up @@ -339,52 +319,6 @@ static int bay_add(acpi_handle handle, int id)
return -ENODEV;
}

static int acpi_bay_remove(struct acpi_device *device, int type)
{
/*** FIXME: do something here */
return 0;
}

/**
* bay_create_acpi_device - add new devices to acpi
* @handle - handle of the device to add
*
* This function will create a new acpi_device for the given
* handle if one does not exist already. This should cause
* acpi to scan for drivers for the given devices, and call
* matching driver's add routine.
*
* Returns a pointer to the acpi_device corresponding to the handle.
*/
static struct acpi_device * bay_create_acpi_device(acpi_handle handle)
{
struct acpi_device *device = NULL;
struct acpi_device *parent_device;
acpi_handle parent;
int ret;

bay_dprintk(handle, "Trying to get device");
if (acpi_bus_get_device(handle, &device)) {
/*
* no device created for this object,
* so we should create one.
*/
bay_dprintk(handle, "No device for handle");
acpi_get_parent(handle, &parent);
if (acpi_bus_get_device(parent, &parent_device))
parent_device = NULL;

ret = acpi_bus_add(&device, parent_device, handle,
ACPI_BUS_TYPE_DEVICE);
if (ret) {
pr_debug("error adding bus, %x\n",
-ret);
return NULL;
}
}
return device;
}

/**
* bay_notify - act upon an acpi bay notification
* @handle: the bay handle
Expand All @@ -394,38 +328,19 @@ static struct acpi_device * bay_create_acpi_device(acpi_handle handle)
*/
static void bay_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_device *dev;
struct bay *bay_dev = (struct bay *)data;
struct device *dev = &bay_dev->pdev->dev;

bay_dprintk(handle, "Bay event");

switch(event) {
case ACPI_NOTIFY_BUS_CHECK:
printk("Bus Check\n");
case ACPI_NOTIFY_DEVICE_CHECK:
printk("Device Check\n");
dev = bay_create_acpi_device(handle);
if (dev)
acpi_bus_generate_event(dev, event, 0);
else
printk("No device for generating event\n");
/* wouldn't it be a good idea to just rescan SATA
* right here?
*/
break;
case ACPI_NOTIFY_EJECT_REQUEST:
printk("Eject request\n");
dev = bay_create_acpi_device(handle);
if (dev)
acpi_bus_generate_event(dev, event, 0);
else
printk("No device for generating eventn");

/* wouldn't it be a good idea to just call the
* eject_device here if we were a SATA device?
*/
kobject_uevent(&dev->kobj, KOBJ_CHANGE);
break;
default:
printk("unknown event %d\n", event);
printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event);
}
}

Expand Down Expand Up @@ -457,10 +372,6 @@ static int __init bay_init(void)
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, find_bay, &bays, NULL);

if (bays)
if ((acpi_bus_register_driver(&acpi_bay_driver) < 0))
printk(KERN_ERR "Unable to register bay driver\n");

if (!bays)
return -ENODEV;

Expand All @@ -481,8 +392,6 @@ static void __exit bay_exit(void)
kfree(bay->name);
kfree(bay);
}

acpi_bus_unregister_driver(&acpi_bay_driver);
}

postcore_initcall(bay_init);
Expand Down
4 changes: 3 additions & 1 deletion drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
mutex_lock(&ec->lock);
if (ec->global_lock) {
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
if (ACPI_FAILURE(status))
if (ACPI_FAILURE(status)) {
mutex_unlock(&ec->lock);
return -ENODEV;
}
}

/* Make sure GPE is enabled before doing transaction */
Expand Down
11 changes: 0 additions & 11 deletions drivers/acpi/events/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,17 +636,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
}
}

if (!acpi_gbl_system_awake_and_running) {
/*
* We just woke up because of a wake GPE. Disable any further GPEs
* until we are fully up and running (Only wake GPEs should be enabled
* at this time, but we just brute-force disable them all.)
* 1) We must disable this particular wake GPE so it won't fire again
* 2) We want to disable all wake GPEs, since we are now awake
*/
(void)acpi_hw_disable_all_gpes();
}

/*
* Dispatch the GPE to either an installed handler, or the control method
* associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
Expand Down
62 changes: 62 additions & 0 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,65 @@ static int __init init_acpi_device_notify(void)
}

arch_initcall(init_acpi_device_notify);


#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)

/* Every ACPI platform has a mc146818 compatible "cmos rtc". Here we find
* its device node and pass extra config data. This helps its driver use
* capabilities that the now-obsolete mc146818 didn't have, and informs it
* that this board's RTC is wakeup-capable (per ACPI spec).
*/
#include <linux/mc146818rtc.h>

static struct cmos_rtc_board_info rtc_info;


/* PNP devices are registered in a subsys_initcall();
* ACPI specifies the PNP IDs to use.
*/
#include <linux/pnp.h>

static int __init pnp_match(struct device *dev, void *data)
{
static const char *ids[] = { "PNP0b00", "PNP0b01", "PNP0b02", };
struct pnp_dev *pnp = to_pnp_dev(dev);
int i;

for (i = 0; i < ARRAY_SIZE(ids); i++) {
if (compare_pnp_id(pnp->id, ids[i]) != 0)
return 1;
}
return 0;
}

static struct device *__init get_rtc_dev(void)
{
return bus_find_device(&pnp_bus_type, NULL, NULL, pnp_match);
}

static int __init acpi_rtc_init(void)
{
struct device *dev = get_rtc_dev();

if (dev) {
rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm;
rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm;
rtc_info.rtc_century = acpi_gbl_FADT.century;

/* NOTE: acpi_gbl_FADT->rtcs4 is NOT currently useful */

dev->platform_data = &rtc_info;

/* RTC always wakes from S1/S2/S3, and often S4/STD */
device_init_wakeup(dev, 1);

put_device(dev);
} else
pr_debug("ACPI: RTC unavailable?\n");
return 0;
}
/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
fs_initcall(acpi_rtc_init);

#endif
13 changes: 8 additions & 5 deletions drivers/acpi/ibm_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ static int ibm_acpi_driver_init(void)
printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION);
printk(IBM_INFO "%s\n", IBM_URL);

if (ibm_thinkpad_ec_found)
printk(IBM_INFO "ThinkPad EC firmware %s\n",
ibm_thinkpad_ec_found);

return 0;
}

Expand Down Expand Up @@ -2617,7 +2621,7 @@ static void __init ibm_handle_init(char *name,
ibm_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, ARRAY_SIZE(object##_paths), &object##_path)

static int set_ibm_param(const char *val, struct kernel_param *kp)
static int __init set_ibm_param(const char *val, struct kernel_param *kp)
{
unsigned int i;

Expand Down Expand Up @@ -2659,7 +2663,8 @@ static void acpi_ibm_exit(void)
for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--)
ibm_exit(&ibms[i]);

remove_proc_entry(IBM_DIR, acpi_root_dir);
if (proc_dir)
remove_proc_entry(IBM_DIR, acpi_root_dir);

if (ibm_thinkpad_ec_found)
kfree(ibm_thinkpad_ec_found);
Expand Down Expand Up @@ -2710,9 +2715,6 @@ 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 Expand Up @@ -2742,6 +2744,7 @@ static int __init acpi_ibm_init(void)
proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir);
if (!proc_dir) {
printk(IBM_ERR "unable to create proc dir %s", IBM_DIR);
acpi_ibm_exit();
return -ENODEV;
}
proc_dir->owner = THIS_MODULE;
Expand Down
22 changes: 1 addition & 21 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
{
if (phys > ULONG_MAX) {
printk(KERN_ERR PREFIX "Cannot map memory that high\n");
return 0;
return NULL;
}
if (acpi_gbl_permanent_mmap)
/*
Expand Down Expand Up @@ -890,26 +890,6 @@ u32 acpi_os_get_line(char *buffer)
}
#endif /* ACPI_FUTURE_USAGE */

/* Assumes no unreadable holes inbetween */
u8 acpi_os_readable(void *ptr, acpi_size len)
{
#if defined(__i386__) || defined(__x86_64__)
char tmp;
return !__get_user(tmp, (char __user *)ptr)
&& !__get_user(tmp, (char __user *)ptr + len - 1);
#endif
return 1;
}

#ifdef ACPI_FUTURE_USAGE
u8 acpi_os_writable(void *ptr, acpi_size len)
{
/* could do dummy write (racy) or a kernel page table lookup.
The later may be difficult at early boot when kmap doesn't work yet. */
return 1;
}
#endif

acpi_status acpi_os_signal(u32 function, void *info)
{
switch (function) {
Expand Down
Loading

0 comments on commit 81450b7

Please sign in to comment.