summaryrefslogtreecommitdiff
path: root/src/superio/winbond
diff options
context:
space:
mode:
Diffstat (limited to 'src/superio/winbond')
-rw-r--r--src/superio/winbond/w83627dhg/superio.c19
-rw-r--r--src/superio/winbond/w83627ehg/superio.c19
-rw-r--r--src/superio/winbond/w83627hf/superio.c19
-rw-r--r--src/superio/winbond/w83627thg/superio.c19
-rw-r--r--src/superio/winbond/w83627uhg/superio.c19
-rw-r--r--src/superio/winbond/w83697hf/superio.c19
-rw-r--r--src/superio/winbond/w83977f/superio.c19
-rw-r--r--src/superio/winbond/w83977tf/superio.c19
8 files changed, 16 insertions, 136 deletions
diff --git a/src/superio/winbond/w83627dhg/superio.c b/src/superio/winbond/w83627dhg/superio.c
index 537d83490f..a9314196ee 100644
--- a/src/superio/winbond/w83627dhg/superio.c
+++ b/src/superio/winbond/w83627dhg/superio.c
@@ -20,23 +20,13 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <uart8250.h>
#include <pc80/keyboard.h>
#include <stdlib.h>
#include "chip.h"
#include "w83627dhg.h"
-void pnp_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-void pnp_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void w83627dhg_enable_UR2(device_t dev)
{
u8 reg8;
@@ -65,18 +55,13 @@ static void w83627dhg_init(device_t 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 = w83627dhg_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83627ehg/superio.c b/src/superio/winbond/w83627ehg/superio.c
index 631105b2f8..6f2c9deef3 100644
--- a/src/superio/winbond/w83627ehg/superio.c
+++ b/src/superio/winbond/w83627ehg/superio.c
@@ -24,6 +24,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <uart8250.h>
@@ -33,17 +34,6 @@
#include "chip.h"
#include "w83627ehg.h"
-static void pnp_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void pnp_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void pnp_write_index(u16 port, u8 reg, u8 value)
{
outb(reg, port);
@@ -141,18 +131,13 @@ static void w83627ehg_pnp_enable_resources(device_t dev)
pnp_exit_conf_mode(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 = w83627ehg_pnp_enable_resources,
.enable = pnp_alt_enable,
.init = w83627ehg_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83627hf/superio.c b/src/superio/winbond/w83627hf/superio.c
index 4d68c35033..5a4e964dc3 100644
--- a/src/superio/winbond/w83627hf/superio.c
+++ b/src/superio/winbond/w83627hf/superio.c
@@ -24,6 +24,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <uart8250.h>
@@ -33,17 +34,6 @@
#include "chip.h"
#include "w83627hf.h"
-static void pnp_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void pnp_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void pnp_write_index(u16 port, u8 reg, u8 value)
{
outb(reg, port);
@@ -148,18 +138,13 @@ static void w83627hf_pnp_enable_resources(device_t dev)
pnp_exit_conf_mode(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 = w83627hf_pnp_enable_resources,
.enable = pnp_alt_enable,
.init = w83627hf_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83627thg/superio.c b/src/superio/winbond/w83627thg/superio.c
index f1c56032c5..257cd0ad76 100644
--- a/src/superio/winbond/w83627thg/superio.c
+++ b/src/superio/winbond/w83627thg/superio.c
@@ -23,6 +23,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <uart8250.h>
@@ -30,17 +31,6 @@
#include "chip.h"
#include "w83627thg.h"
-static void w83627thg_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void w83627thg_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void w83627thg_init(device_t dev)
{
struct superio_winbond_w83627thg_config *conf = dev->chip_info;
@@ -55,18 +45,13 @@ static void w83627thg_init(device_t dev)
}
}
-static const struct pnp_mode_ops pnp_conf_mode_ops = {
- .enter_conf_mode = w83627thg_enter_ext_func_mode,
- .exit_conf_mode = w83627thg_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_enable,
.init = w83627thg_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83627uhg/superio.c b/src/superio/winbond/w83627uhg/superio.c
index d2cbdc945c..3f1ca38d30 100644
--- a/src/superio/winbond/w83627uhg/superio.c
+++ b/src/superio/winbond/w83627uhg/superio.c
@@ -21,6 +21,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <stdint.h>
@@ -30,17 +31,6 @@
#include "chip.h"
#include "w83627uhg.h"
-static void w83627uhg_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void w83627uhg_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
/*
* Set the UART clock source.
*
@@ -101,18 +91,13 @@ static void w83627uhg_init(device_t dev)
}
}
-static const struct pnp_mode_ops pnp_conf_mode_ops = {
- .enter_conf_mode = w83627uhg_enter_ext_func_mode,
- .exit_conf_mode = w83627uhg_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_enable,
.init = w83627uhg_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83697hf/superio.c b/src/superio/winbond/w83697hf/superio.c
index 9431b34d23..79ebcc9408 100644
--- a/src/superio/winbond/w83697hf/superio.c
+++ b/src/superio/winbond/w83697hf/superio.c
@@ -21,6 +21,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <lib.h>
@@ -30,17 +31,6 @@
#include "chip.h"
#include "w83697hf.h"
-static void pnp_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void pnp_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void hwmon_set_fan_divisor(unsigned int base, int num, unsigned int divisor) {
unsigned char enc, buf;
@@ -81,18 +71,13 @@ static void w83697hf_init(device_t 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 = w83697hf_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83977f/superio.c b/src/superio/winbond/w83977f/superio.c
index 8368839d26..6756830dbd 100644
--- a/src/superio/winbond/w83977f/superio.c
+++ b/src/superio/winbond/w83977f/superio.c
@@ -21,6 +21,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <uart8250.h>
@@ -29,17 +30,6 @@
#include "chip.h"
#include "w83977f.h"
-static void w83977f_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void w83977f_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void w83977f_init(device_t dev)
{
struct superio_winbond_w83977f_config *conf = dev->chip_info;
@@ -54,18 +44,13 @@ static void w83977f_init(device_t dev)
}
}
-static const struct pnp_mode_ops pnp_conf_mode_ops = {
- .enter_conf_mode = w83977f_enter_ext_func_mode,
- .exit_conf_mode = w83977f_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_enable,
.init = w83977f_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {
diff --git a/src/superio/winbond/w83977tf/superio.c b/src/superio/winbond/w83977tf/superio.c
index ff55f5d2f6..0200d26b04 100644
--- a/src/superio/winbond/w83977tf/superio.c
+++ b/src/superio/winbond/w83977tf/superio.c
@@ -23,6 +23,7 @@
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
+#include <superio/conf_mode.h>
#include <console/console.h>
#include <string.h>
#include <uart8250.h>
@@ -31,17 +32,6 @@
#include "chip.h"
#include "w83977tf.h"
-static void w83977tf_enter_ext_func_mode(device_t dev)
-{
- outb(0x87, dev->path.pnp.port);
- outb(0x87, dev->path.pnp.port);
-}
-
-static void w83977tf_exit_ext_func_mode(device_t dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}
-
static void w83977tf_init(device_t dev)
{
struct superio_winbond_w83977tf_config *conf = dev->chip_info;
@@ -56,18 +46,13 @@ static void w83977tf_init(device_t dev)
}
}
-static const struct pnp_mode_ops pnp_conf_mode_ops = {
- .enter_conf_mode = w83977tf_enter_ext_func_mode,
- .exit_conf_mode = w83977tf_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_enable,
.init = w83977tf_init,
- .ops_pnp_mode = &pnp_conf_mode_ops,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
};
static struct pnp_info pnp_dev_info[] = {