[coreboot] [commit] r6486 - in trunk/src: ec/lenovo/pmh7 mainboard/lenovo/x60

repository service svn at coreboot.org
Mon Apr 11 21:43:51 CEST 2011


Author: svens
Date: Mon Apr 11 21:43:50 2011
New Revision: 6486
URL: https://tracker.coreboot.org/trac/coreboot/changeset/6486

Log:
PMH7: Add chip config

Signed-off-by: Sven Schnelle <svens at stackframe.org>
Acked-by: Peter Stuge <peter at stuge.se>

Added:
   trunk/src/ec/lenovo/pmh7/chip.h
Modified:
   trunk/src/ec/lenovo/pmh7/pmh7.c
   trunk/src/ec/lenovo/pmh7/pmh7.h
   trunk/src/mainboard/lenovo/x60/devicetree.cb
   trunk/src/mainboard/lenovo/x60/mainboard.c

Added: trunk/src/ec/lenovo/pmh7/chip.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/src/ec/lenovo/pmh7/chip.h	Mon Apr 11 21:43:50 2011	(r6486)
@@ -0,0 +1,9 @@
+#ifndef EC_LENOVO_PMH7_CHIP_H
+#define EC_LENOVO_PMH7_CHIP_H
+
+extern struct chip_operations ec_lenovo_pmh7_ops;
+
+struct ec_lenovo_pmh7_config {
+	int backlight_enable:1;
+};
+#endif

Modified: trunk/src/ec/lenovo/pmh7/pmh7.c
==============================================================================
--- trunk/src/ec/lenovo/pmh7/pmh7.c	Mon Apr 11 21:43:32 2011	(r6485)
+++ trunk/src/ec/lenovo/pmh7/pmh7.c	Mon Apr 11 21:43:50 2011	(r6486)
@@ -23,6 +23,15 @@
 #include <device/pnp.h>
 #include <stdlib.h>
 #include "pmh7.h"
+#include "chip.h"
+
+void pmh7_backlight_enable(int onoff)
+{
+	if (onoff)
+		pmh7_register_set_bit(0x50, 5);
+	else
+		pmh7_register_clear_bit(0x50, 5);
+}
 
 void pmh7_register_set_bit(int reg, int bit)
 {
@@ -58,6 +67,7 @@
 
 static void enable_dev(device_t dev)
 {
+	struct ec_lenovo_pmh7_config *conf = dev->chip_info;
 	struct resource *resource;
 
 	resource = new_resource(dev, EC_LENOVO_PMH7_INDEX);
@@ -66,6 +76,8 @@
 	resource->size = 16;
 	resource->align = 5;
 	resource->gran = 5;
+
+	pmh7_backlight_enable(conf->backlight_enable);
 }
 
 struct chip_operations ec_lenovo_pmh7_ops = {

Modified: trunk/src/ec/lenovo/pmh7/pmh7.h
==============================================================================
--- trunk/src/ec/lenovo/pmh7/pmh7.h	Mon Apr 11 21:43:32 2011	(r6485)
+++ trunk/src/ec/lenovo/pmh7/pmh7.h	Mon Apr 11 21:43:50 2011	(r6486)
@@ -31,4 +31,5 @@
 char pmh7_register_read(int reg);
 void pmh7_register_write(int reg, int val);
 
+void pmh7_backlight_enable(int onoff);
 #endif

Modified: trunk/src/mainboard/lenovo/x60/devicetree.cb
==============================================================================
--- trunk/src/mainboard/lenovo/x60/devicetree.cb	Mon Apr 11 21:43:32 2011	(r6485)
+++ trunk/src/mainboard/lenovo/x60/devicetree.cb	Mon Apr 11 21:43:50 2011	(r6486)
@@ -85,6 +85,7 @@
 				chip ec/lenovo/pmh7
 					device pnp ff.1 on # dummy
 					end
+					register "backlight_enable" = "0x01"
 				end
 				chip ec/lenovo/h8
 					device pnp ff.2 on # dummy

Modified: trunk/src/mainboard/lenovo/x60/mainboard.c
==============================================================================
--- trunk/src/mainboard/lenovo/x60/mainboard.c	Mon Apr 11 21:43:32 2011	(r6485)
+++ trunk/src/mainboard/lenovo/x60/mainboard.c	Mon Apr 11 21:43:50 2011	(r6486)
@@ -35,17 +35,10 @@
 #include <ec/lenovo/h8/h8.h>
 #include <northbridge/intel/i945/i945.h>
 
-static void backlight_enable(void)
-{
-       pmh7_register_set_bit(0x50, 5);
-}
-
 static void mainboard_enable(device_t dev)
 {
 	device_t dev0;
 
-	backlight_enable();
-
 	/* enable Audio */
 	h8_set_audio_mute(0);
 




More information about the coreboot mailing list