i945 GMA: restore tft brightness from cmos
authorSven Schnelle <svens@stackframe.org>
Sun, 12 Jun 2011 12:30:10 +0000 (14:30 +0200)
committerSven Schnelle <svens@stackframe.org>
Wed, 15 Jun 2011 17:40:24 +0000 (19:40 +0200)
Change-Id: Iaf10f125425a1abcf17ffca1d6e246f955f941cc
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/24
Tested-by: build bot (Jenkins)
src/mainboard/lenovo/t60/romstage.c
src/mainboard/lenovo/x60/romstage.c
src/northbridge/intel/i945/gma.c

index aa927651fcbc40886d474174d22d2eff6fa4d5a7..252ae40023e3516a8a7ec5ee8688ad389720dc5a 100644 (file)
@@ -336,6 +336,4 @@ void main(unsigned long bist)
                pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
        }
 #endif
-       /* Set legacy Brightness control to full brightness */
-       pci_write_config8(PCI_DEV(0, 2, 1), 0xf4, 0xff);
 }
index c993a3565f192fd9eebbf3f278bef36e69318de5..2aa506f78cebf079ff0828a49e7cad31ccbd8090 100644 (file)
@@ -338,6 +338,4 @@ void main(unsigned long bist)
                pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
        }
 #endif
-       /* Set legacy Brightness control to full brightness */
-       pci_write_config8(PCI_DEV(0, 2, 1), 0xf4, 0xff);
 }
index a43ef259aa9d386af91d9bfe78f45ac577212fc2..340ddcd3a1d09172749bc05757c803813acf2c50 100644 (file)
@@ -21,6 +21,7 @@
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
+#include <pc80/mc146818rtc.h>
 
 static void gma_func0_init(struct device *dev)
 {
@@ -36,11 +37,17 @@ static void gma_func0_init(struct device *dev)
 static void gma_func1_init(struct device *dev)
 {
        u32 reg32;
+       u8 val;
 
        /* IGD needs to be Bus Master, also enable IO accesss */
        reg32 = pci_read_config32(dev, PCI_COMMAND);
        pci_write_config32(dev, PCI_COMMAND, reg32 |
                        PCI_COMMAND_MASTER | PCI_COMMAND_IO);
+
+       if (!get_option(&val, "tft_brightness"))
+               pci_write_config8(dev, 0xf4, val);
+       else
+               pci_write_config8(dev, 0xf4, 0xff);
 }
 
 static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)