]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-upstream/acpi-test' of git://repo.or.cz/linux-2.6/linux-acpi-2...
authorAndi Kleen <ak@linux.intel.com>
Mon, 21 Jul 2008 22:16:54 +0000 (00:16 +0200)
committerAndi Kleen <ak@linux.intel.com>
Mon, 21 Jul 2008 22:16:54 +0000 (00:16 +0200)
drivers/acpi/pci_link.c
drivers/acpi/tables/tbfadt.c
drivers/acpi/thermal.c
drivers/acpi/video.c

index 233c40c5168412da11e3bd826a7d3a3fadd0691d..89f3b2abfdc7b9f15f65513cdb1d852712735c8f 100644 (file)
@@ -113,20 +113,23 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
 
        switch (resource->type) {
        case ACPI_RESOURCE_TYPE_START_DEPENDENT:
+       case ACPI_RESOURCE_TYPE_END_TAG:
                return AE_OK;
        case ACPI_RESOURCE_TYPE_IRQ:
                {
                        struct acpi_resource_irq *p = &resource->data.irq;
                        if (!p || !p->interrupt_count) {
-                               printk(KERN_WARNING PREFIX "Blank IRQ resource\n");
+                               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                                 "Blank _PRS IRQ resource\n"));
                                return AE_OK;
                        }
                        for (i = 0;
                             (i < p->interrupt_count
                              && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
                                if (!p->interrupts[i]) {
-                                       printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
-                                                     p->interrupts[i]);
+                                       printk(KERN_WARNING PREFIX
+                                              "Invalid _PRS IRQ %d\n",
+                                              p->interrupts[i]);
                                        continue;
                                }
                                link->irq.possible[i] = p->interrupts[i];
@@ -143,15 +146,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
                            &resource->data.extended_irq;
                        if (!p || !p->interrupt_count) {
                                printk(KERN_WARNING PREFIX
-                                             "Blank EXT IRQ resource\n");
+                                             "Blank _PRS EXT IRQ resource\n");
                                return AE_OK;
                        }
                        for (i = 0;
                             (i < p->interrupt_count
                              && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
                                if (!p->interrupts[i]) {
-                                       printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
-                                                     p->interrupts[i]);
+                                       printk(KERN_WARNING PREFIX
+                                              "Invalid _PRS IRQ %d\n",
+                                              p->interrupts[i]);
                                        continue;
                                }
                                link->irq.possible[i] = p->interrupts[i];
@@ -163,7 +167,8 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
                        break;
                }
        default:
-               printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n");
+               printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n",
+                      resource->type);
                return AE_OK;
        }
 
@@ -199,6 +204,9 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
 
 
        switch (resource->type) {
+       case ACPI_RESOURCE_TYPE_START_DEPENDENT:
+       case ACPI_RESOURCE_TYPE_END_TAG:
+               return AE_OK;
        case ACPI_RESOURCE_TYPE_IRQ:
                {
                        struct acpi_resource_irq *p = &resource->data.irq;
@@ -208,7 +216,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
                                 * particularly those those w/ _STA disabled
                                 */
                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                                 "Blank IRQ resource\n"));
+                                                 "Blank _CRS IRQ resource\n"));
                                return AE_OK;
                        }
                        *irq = p->interrupts[0];
@@ -224,7 +232,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
                                 * return at least 1 IRQ
                                 */
                                printk(KERN_WARNING PREFIX
-                                             "Blank EXT IRQ resource\n");
+                                             "Blank _CRS EXT IRQ resource\n");
                                return AE_OK;
                        }
                        *irq = p->interrupts[0];
@@ -232,10 +240,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
                }
                break;
        default:
-               printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type);
-       case ACPI_RESOURCE_TYPE_END_TAG:
+               printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n",
+                      resource->type);
                return AE_OK;
        }
+
        return AE_CTRL_TERMINATE;
 }
 
index ccb5b64bbef3396036796509da86ba4b52efc6cd..a4a41ba2484b93404ae948e3d50e5dcff81577a1 100644 (file)
@@ -124,7 +124,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
 
 static void inline
 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
-                            u8 byte_width, u64 address)
+                            u8 bit_width, u64 address)
 {
 
        /*
@@ -136,7 +136,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
        /* All other fields are byte-wide */
 
        generic_address->space_id = ACPI_ADR_SPACE_SYSTEM_IO;
-       generic_address->bit_width = byte_width << 3;
+       generic_address->bit_width = bit_width;
        generic_address->bit_offset = 0;
        generic_address->access_width = 0;
 }
@@ -343,11 +343,9 @@ static void acpi_tb_convert_fadt(void)
         *
         * The PM event blocks are split into two register blocks, first is the
         * PM Status Register block, followed immediately by the PM Enable Register
-        * block. Each is of length (xpm1x_event_block.bit_width/2)
+        * block. Each is of length (pm1_event_length/2)
         */
-       WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1a_event_block.bit_width));
-       pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT
-                                              .xpm1a_event_block.bit_width);
+       pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
 
        /* The PM1A register block is required */
 
@@ -362,17 +360,14 @@ static void acpi_tb_convert_fadt(void)
        /* The PM1B register block is optional, ignore if not present */
 
        if (acpi_gbl_FADT.xpm1b_event_block.address) {
-               WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1b_event_block.bit_width));
-               pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT
-                                                      .xpm1b_event_block
-                                                      .bit_width);
                acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
                                             pm1_register_length,
                                             (acpi_gbl_FADT.xpm1b_event_block.
                                              address + pm1_register_length));
                /* Don't forget to copy space_id of the GAS */
                acpi_gbl_xpm1b_enable.space_id =
-                   acpi_gbl_FADT.xpm1b_event_block.space_id;
+                   acpi_gbl_FADT.xpm1a_event_block.space_id;
+
        }
 }
 
index 84c795fb9b1ebef3a787907ba372cc368923a6c2..9adfd180df6ae6f74f450f4fa7049782868a183e 100644 (file)
@@ -769,6 +769,47 @@ static void acpi_thermal_run(unsigned long data)
                acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data);
 }
 
+static void acpi_thermal_active_off(void *data)
+{
+       int result = 0;
+       struct acpi_thermal *tz = data;
+       int i = 0;
+       int j = 0;
+       struct acpi_thermal_active *active = NULL;
+
+       if (!tz) {
+               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
+               return;
+       }
+
+       result = acpi_thermal_get_temperature(tz);
+       if (result)
+               return;
+
+       for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
+               active = &(tz->trips.active[i]);
+               if (!active || !active->flags.valid)
+                       break;
+               if (tz->temperature >= active->temperature) {
+                       /*
+                        * If the thermal temperature is greater than the
+                        * active threshod, unnecessary to turn off the
+                        * the active cooling device.
+                        */
+                       continue;
+               }
+               /*
+                * Below Threshold?
+                * ----------------
+                * Turn OFF all cooling devices associated with this
+                * threshold.
+                */
+               for (j = 0; j < active->devices.count; j++)
+                       result = acpi_bus_set_power(active->devices.handles[j],
+                                                   ACPI_STATE_D3);
+       }
+}
+
 static void acpi_thermal_check(void *data)
 {
        int result = 0;
@@ -1624,6 +1665,8 @@ static int acpi_thermal_add(struct acpi_device *device)
 
        init_timer(&tz->timer);
 
+       acpi_thermal_active_off(tz);
+
        acpi_thermal_check(tz);
 
        status = acpi_install_notify_handler(device->handle,
index 64c889331f3bd97be35ca4eeb0153e50aae74111..e32b6c14d9280b72328d43928ed0b6d7a08ad7a3 100644 (file)
@@ -741,7 +741,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
 
        max_level = acpi_video_init_brightness(device);
 
-       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;
@@ -753,7 +753,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
                device->backlight = backlight_device_register(name,
                        NULL, device, &acpi_backlight_ops);
                device->backlight->props.max_brightness = device->brightness->count-3;
-               device->backlight->props.brightness = acpi_video_get_brightness(device->backlight);
+               /*
+                * If there exists the _BQC object, the _BQC object will be
+                * called to get the current backlight brightness. Otherwise
+                * the brightness will be set to the maximum.
+                */
+               if (device->cap._BQC)
+                       device->backlight->props.brightness =
+                               acpi_video_get_brightness(device->backlight);
+               else
+                       device->backlight->props.brightness =
+                               device->backlight->props.max_brightness;
                backlight_update_status(device->backlight);
                kfree(name);