PMH7: Add chip config

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

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6486 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Sven Schnelle 2011-04-11 19:43:50 +00:00
parent ffcd1439f3
commit 1fa61ebb33
5 changed files with 23 additions and 7 deletions

View File

@ -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

View File

@ -23,6 +23,15 @@
#include <device/pnp.h> #include <device/pnp.h>
#include <stdlib.h> #include <stdlib.h>
#include "pmh7.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) void pmh7_register_set_bit(int reg, int bit)
{ {
@ -58,6 +67,7 @@ void pmh7_register_write(int reg, int val)
static void enable_dev(device_t dev) static void enable_dev(device_t dev)
{ {
struct ec_lenovo_pmh7_config *conf = dev->chip_info;
struct resource *resource; struct resource *resource;
resource = new_resource(dev, EC_LENOVO_PMH7_INDEX); resource = new_resource(dev, EC_LENOVO_PMH7_INDEX);
@ -66,6 +76,8 @@ static void enable_dev(device_t dev)
resource->size = 16; resource->size = 16;
resource->align = 5; resource->align = 5;
resource->gran = 5; resource->gran = 5;
pmh7_backlight_enable(conf->backlight_enable);
} }
struct chip_operations ec_lenovo_pmh7_ops = { struct chip_operations ec_lenovo_pmh7_ops = {

View File

@ -31,4 +31,5 @@ void pmh7_register_clear_bit(int reg, int bit);
char pmh7_register_read(int reg); char pmh7_register_read(int reg);
void pmh7_register_write(int reg, int val); void pmh7_register_write(int reg, int val);
void pmh7_backlight_enable(int onoff);
#endif #endif

View File

@ -85,6 +85,7 @@ chip northbridge/intel/i945
chip ec/lenovo/pmh7 chip ec/lenovo/pmh7
device pnp ff.1 on # dummy device pnp ff.1 on # dummy
end end
register "backlight_enable" = "0x01"
end end
chip ec/lenovo/h8 chip ec/lenovo/h8
device pnp ff.2 on # dummy device pnp ff.2 on # dummy

View File

@ -35,17 +35,10 @@
#include <ec/lenovo/h8/h8.h> #include <ec/lenovo/h8/h8.h>
#include <northbridge/intel/i945/i945.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) static void mainboard_enable(device_t dev)
{ {
device_t dev0; device_t dev0;
backlight_enable();
/* enable Audio */ /* enable Audio */
h8_set_audio_mute(0); h8_set_audio_mute(0);