Skip to content

Commit

Permalink
Merge branch 'video' into release
Browse files Browse the repository at this point in the history
Conflicts:
	Documentation/kernel-parameters.txt

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
lenb committed Nov 12, 2008
2 parents 9b5a56d + 2dba1b5 commit f398778
Show file tree
Hide file tree
Showing 16 changed files with 469 additions and 84 deletions.
12 changes: 12 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ and is between 256 and 4096 characters. It is defined in the file
that require a timer override, but don't have
HPET

acpi_backlight= [HW,ACPI]
acpi_backlight=vendor
acpi_backlight=video
If set to vendor, prefer vendor specific driver
(e.g. thinkpad_acpi, sony_acpi, etc.) instead
of the ACPI video.ko driver.

acpi_display_output= [HW,ACPI]
acpi_display_output=vendor
acpi_display_output=video
See above.

acpi.debug_layer= [HW,ACPI,ACPI_DEBUG]
acpi.debug_level= [HW,ACPI,ACPI_DEBUG]
Format: <int>
Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ obj-$(CONFIG_ACPI_BUTTON) += button.o
obj-$(CONFIG_ACPI_FAN) += fan.o
obj-$(CONFIG_ACPI_DOCK) += dock.o
obj-$(CONFIG_ACPI_VIDEO) += video.o
ifdef CONFIG_ACPI_VIDEO
obj-y += video_detect.o
endif

obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
Expand Down
40 changes: 40 additions & 0 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,46 @@ struct device *acpi_get_physical_device(acpi_handle handle)

EXPORT_SYMBOL(acpi_get_physical_device);

/* ToDo: When a PCI bridge is found, return the PCI device behind the bridge
* This should work in general, but did not on a Lenovo T61 for the
* graphics card. But this must be fixed when the PCI device is
* bound and the kernel device struct is attached to the acpi device
* Note: A success call will increase reference count by one
* Do call put_device(dev) on the returned device then
*/
struct device *acpi_get_physical_pci_device(acpi_handle handle)
{
struct device *dev;
long long device_id;
acpi_status status;

status =
acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);

if (ACPI_FAILURE(status))
return NULL;

/* 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 device in the host bridge */
if (device_id >= 0x10000) {
/* It looks like a PCI device. Does it exist? */
dev = acpi_get_physical_device(handle);
} else {
/* It doesn't look like a PCI device. Does its parent
exist? */
acpi_handle phandle;
if (acpi_get_parent(handle, &phandle))
return NULL;
dev = acpi_get_physical_device(phandle);
}
if (!dev)
return NULL;
return dev;
}
EXPORT_SYMBOL(acpi_get_physical_pci_device);

static int acpi_bind_one(struct device *dev, acpi_handle handle)
{
struct acpi_device *acpi_dev;
Expand Down
32 changes: 1 addition & 31 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,36 +919,6 @@ static void acpi_device_get_busid(struct acpi_device *device,
}
}

static int
acpi_video_bus_match(struct acpi_device *device)
{
acpi_handle h_dummy;

if (!device)
return -EINVAL;

/* Since there is no HID, CID for ACPI Video drivers, we have
* to check well known required nodes for each feature we support.
*/

/* Does this device able to support video switching ? */
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) &&
ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy)))
return 0;

/* Does this device able to retrieve a video ROM ? */
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))
return 0;

/* Does this device able to configure which video head to be POSTed ? */
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) &&
ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) &&
ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy)))
return 0;

return -ENODEV;
}

/*
* acpi_bay_match - see if a device is an ejectable driver bay
*
Expand Down Expand Up @@ -1031,7 +1001,7 @@ static void acpi_device_set_id(struct acpi_device *device,
will get autoloaded and the device might still match
against another driver.
*/
if (ACPI_SUCCESS(acpi_video_bus_match(device)))
if (acpi_is_video_device(device))
cid_add = ACPI_VIDEO_HID;
else if (ACPI_SUCCESS(acpi_bay_match(device)))
cid_add = ACPI_BAY_HID;
Expand Down
35 changes: 22 additions & 13 deletions drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
device->cap._DSS = 1;
}

max_level = acpi_video_init_brightness(device);
if (acpi_video_backlight_support())
max_level = acpi_video_init_brightness(device);

if (device->cap._BCL && device->cap._BCM && max_level > 0) {
int result;
Expand Down Expand Up @@ -784,18 +785,21 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
printk(KERN_ERR PREFIX "Create sysfs link\n");

}
if (device->cap._DCS && device->cap._DSS){
static int count = 0;
char *name;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
if (!name)
return;
sprintf(name, "acpi_video%d", count++);
device->output_dev = video_output_register(name,
NULL, device, &acpi_output_properties);
kfree(name);

if (acpi_video_display_switch_support()) {

if (device->cap._DCS && device->cap._DSS) {
static int count;
char *name;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
if (!name)
return;
sprintf(name, "acpi_video%d", count++);
device->output_dev = video_output_register(name,
NULL, device, &acpi_output_properties);
kfree(name);
}
}
return;
}

/*
Expand Down Expand Up @@ -841,11 +845,16 @@ 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;

struct device *dev;

if (!video)
return -EINVAL;

dev = acpi_get_physical_pci_device(video->device->handle);
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.
*/
Expand Down
Loading

0 comments on commit f398778

Please sign in to comment.