Patchwork New patch to review: d11d66d T60/PMH7: move 'touchpad' option to pmh7

login
register
about
Submitter gerrit@coreboot.org
Date 2011-06-07 08:07:57
Message ID <E1QTrKP-0002Hy-Au@ra.coresystems.de>
Download mbox | patch
Permalink /patch/3101/
State New, archived
Headers show

Comments

gerrit@coreboot.org - 2011-06-07 08:07:57
Dear list,

Sven Schnelle (svens@stackframe.org) just uploaded a new patch set to gerrit, which you can find at
http://review.coreboot.org/6.

You will also find it attached for your convenience.

Regards,
gerrit

Patch

commit d11d66d8de9e49cb8192c840cad064cebc000fd7
Author: Sven Schnelle <svens@stackframe.org>
Date:   Sun Jun 5 21:32:51 2011 +0200

    T60/PMH7: move 'touchpad' option to pmh7
    
    This option is PMH7 specific, and should be moved there,
    so all Notebook utilizing a PMH7 have this option.
    For Thinkpads without Touchpad (like the X60), simply
    don't add 'touchpad' to cmos.layout.
    
    Change-Id: Icdd0093670d565f1b16e2483aa286f4d63ccc52a
    Signed-off-by: Sven Schnelle <svens@stackframe.org>

diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index e2e5f99..86a8d5b 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -25,6 +25,7 @@ 
 #include <stdlib.h>
 #include "h8.h"
 #include "chip.h"
+#include <pc80/mc146818rtc.h>
 
 void h8_trackpoint_enable(int on)
 {
diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c
index 0ac8fa1..c81c2aa 100644
--- a/src/ec/lenovo/pmh7/pmh7.c
+++ b/src/ec/lenovo/pmh7/pmh7.c
@@ -24,6 +24,7 @@ 
 #include <stdlib.h>
 #include "pmh7.h"
 #include "chip.h"
+#include <pc80/mc146818rtc.h>
 
 void pmh7_backlight_enable(int onoff)
 {
@@ -94,6 +95,7 @@  static void enable_dev(device_t dev)
 {
 	struct ec_lenovo_pmh7_config *conf = dev->chip_info;
 	struct resource *resource;
+	char val;
 
 	resource = new_resource(dev, EC_LENOVO_PMH7_INDEX);
 	resource->flags = IORESOURCE_IO | IORESOURCE_FIXED;
@@ -104,6 +106,9 @@  static void enable_dev(device_t dev)
 
 	pmh7_backlight_enable(conf->backlight_enable);
 	pmh7_dock_event_enable(conf->dock_event_enable);
+
+	if (!get_option(&val, "touchpad"))
+		pmh7_touchpad_enable(val);
 }
 
 struct chip_operations ec_lenovo_pmh7_ops = {
diff --git a/src/mainboard/lenovo/t60/mainboard.c b/src/mainboard/lenovo/t60/mainboard.c
index d2ee2fa..7751453 100644
--- a/src/mainboard/lenovo/t60/mainboard.c
+++ b/src/mainboard/lenovo/t60/mainboard.c
@@ -34,12 +34,10 @@ 
 #include <ec/acpi/ec.h>
 #include <ec/lenovo/h8/h8.h>
 #include <northbridge/intel/i945/i945.h>
-#include <pc80/mc146818rtc.h>
 
 static void mainboard_enable(device_t dev)
 {
 	device_t dev0, idedev;
-	u8 touchpad;
 
 	/* enable Audio */
 	h8_set_audio_mute(0);
@@ -49,11 +47,6 @@  static void mainboard_enable(device_t dev)
 	if (dev0 && pci_read_config32(dev0, SKPAD) == 0xcafed00d)
 		ec_write(0x0c, 0xc7);
 
-	if (get_option(&touchpad, "touchpad") < 0)
-		touchpad = 1;
-
-	pmh7_touchpad_enable(touchpad);
-
 	idedev = dev_find_slot(0, PCI_DEVFN(0x1f,1));
 	if (idedev && idedev->chip_info && h8_ultrabay_device_present()) {
 		struct southbridge_intel_i82801gx_config *config = idedev->chip_info;