From 0f7ec3123952ec9f4a547a6264d7b07786b9cc2a Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sat, 1 Nov 2014 12:11:58 +1100 Subject: superio/ite: Use common dispatch for pnp entry/exit functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://review.coreboot.org/7310 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/superio/ite/it8712f/superio.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'src/superio/ite/it8712f') diff --git a/src/superio/ite/it8712f/superio.c b/src/superio/ite/it8712f/superio.c index 9dd9f85911..02a51fb636 100644 --- a/src/superio/ite/it8712f/superio.c +++ b/src/superio/ite/it8712f/superio.c @@ -24,22 +24,9 @@ #include #include #include -#include "it8712f.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); -} +#include -static void pnp_exit_ext_func_mode(struct device *dev) -{ - pnp_write_config(dev, 0x02, 0x02); -} +#include "it8712f.h" static void it8712f_init(struct device *dev) { @@ -69,18 +56,13 @@ static void it8712f_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 = it8712f_init, - .ops_pnp_mode = &pnp_conf_mode_ops, + .ops_pnp_mode = &pnp_conf_mode_870155_aa, }; static struct pnp_info pnp_dev_info[] = { -- cgit v1.2.3