summaryrefslogtreecommitdiffstats
path: root/src/superio/ite/it8772f/superio.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-01 12:11:58 +1100
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-04 11:36:32 +0100
commit0f7ec3123952ec9f4a547a6264d7b07786b9cc2a (patch)
tree66a69ae13652c4b7ebf228227cdbec446ae53b19 /src/superio/ite/it8772f/superio.c
parent88883163c49c62d3c5156eb5fc95ef718065f561 (diff)
downloadcoreboot-0f7ec3123952ec9f4a547a6264d7b07786b9cc2a.tar.gz
coreboot-0f7ec3123952ec9f4a547a6264d7b07786b9cc2a.tar.bz2
coreboot-0f7ec3123952ec9f4a547a6264d7b07786b9cc2a.zip
superio/ite: Use common dispatch for pnp entry/exit functions
We already have these implemented under superio/common, use those instead of this copy-paste syndrom. Change-Id: I7c7737e0b3c284d8b14b36c70681ab2269bb1d4b Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/7310 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/superio/ite/it8772f/superio.c')
-rw-r--r--src/superio/ite/it8772f/superio.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/superio/ite/it8772f/superio.c b/src/superio/ite/it8772f/superio.c
index 143cc3090534..ca103518a428 100644
--- a/src/superio/ite/it8772f/superio.c
+++ b/src/superio/ite/it8772f/superio.c
@@ -23,24 +23,11 @@
#include <pc80/keyboard.h>
#include <arch/io.h>
#include <stdlib.h>
+#include <superio/conf_mode.h>
+
#include "chip.h" /* FIXME */
#include "it8772f.h"
-static void pnp_enter_ext_func_mode(struct device *dev)
-{
- u16 port = dev->path.pnp.port;
-
- outb(0x87, port);
- outb(0x01, port);
- outb(0x55, port);
- outb((port == 0x4e) ? 0xaa : 0x55, port);
-}
-
-static void pnp_exit_ext_func_mode(struct device *dev)
-{
- pnp_write_config(dev, 0x02, 0x02);
-}
-
static inline u8 it8772f_envc_read(struct resource *res, u8 addr)
{
outb(addr, res->base + 5);
@@ -187,18 +174,13 @@ static void it8772f_init(struct device *dev)
}
}
-static const struct pnp_mode_ops pnp_conf_mode_ops = {
- .enter_conf_mode = pnp_enter_ext_func_mode,
- .exit_conf_mode = pnp_exit_ext_func_mode,
-};
-
static struct device_operations ops = {
.read_resources = pnp_read_resources,
.set_resources = pnp_set_resources,
.enable_resources = pnp_enable_resources,
.enable = pnp_alt_enable,
.init = it8772f_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_870155_aa,
};
static struct pnp_info pnp_dev_info[] = {