diff options
author | Sven Schnelle <svens@stackframe.org> | 2011-04-11 19:43:50 +0000 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2011-04-11 19:43:50 +0000 |
commit | 1fa61ebb3344105ae633ed7eb1be05cc574b666c (patch) | |
tree | 488647227ebb4363a9d75ff57161d37e982df38b /src/ec/lenovo | |
parent | ffcd1439f36ec27388139b9d5a379dd4294417b8 (diff) |
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
Diffstat (limited to 'src/ec/lenovo')
-rw-r--r-- | src/ec/lenovo/pmh7/chip.h | 9 | ||||
-rw-r--r-- | src/ec/lenovo/pmh7/pmh7.c | 12 | ||||
-rw-r--r-- | src/ec/lenovo/pmh7/pmh7.h | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/ec/lenovo/pmh7/chip.h b/src/ec/lenovo/pmh7/chip.h new file mode 100644 index 0000000000..e11b772697 --- /dev/null +++ b/src/ec/lenovo/pmh7/chip.h @@ -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 diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c index a46e179f81..ba378666a2 100644 --- a/src/ec/lenovo/pmh7/pmh7.c +++ b/src/ec/lenovo/pmh7/pmh7.c @@ -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 @@ void pmh7_register_write(int reg, int val) 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 @@ static void enable_dev(device_t dev) resource->size = 16; resource->align = 5; resource->gran = 5; + + pmh7_backlight_enable(conf->backlight_enable); } struct chip_operations ec_lenovo_pmh7_ops = { diff --git a/src/ec/lenovo/pmh7/pmh7.h b/src/ec/lenovo/pmh7/pmh7.h index a4a61cc2a1..a85d710689 100644 --- a/src/ec/lenovo/pmh7/pmh7.h +++ b/src/ec/lenovo/pmh7/pmh7.h @@ -31,4 +31,5 @@ void pmh7_register_clear_bit(int reg, int bit); char pmh7_register_read(int reg); void pmh7_register_write(int reg, int val); +void pmh7_backlight_enable(int onoff); #endif |