aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/via/k8t890/k8t890_ctrl.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2007-11-15 15:52:42 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2007-11-15 15:52:42 +0000
commit70ab323ae61567a005058f6e7bdd1f6990e6e7fd (patch)
treed91d14376cc38436f3b51073737cce75b47262b9 /src/southbridge/via/k8t890/k8t890_ctrl.c
parente13abe53b49fdd61fcf56bc21b578057c5f1c72f (diff)
Various cosmetic fixes and improvements (trivial).
- Use 'static' where appropriate. - Use 'const' where appropriate. - Indentation fixes. - Add comment wrt init code which is only valid for VT8237R. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2974 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/via/k8t890/k8t890_ctrl.c')
-rw-r--r--src/southbridge/via/k8t890/k8t890_ctrl.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/southbridge/via/k8t890/k8t890_ctrl.c b/src/southbridge/via/k8t890/k8t890_ctrl.c
index c57c165195..128d50f1a7 100644
--- a/src/southbridge/via/k8t890/k8t890_ctrl.c
+++ b/src/southbridge/via/k8t890/k8t890_ctrl.c
@@ -41,12 +41,17 @@
* V-Link CKG Control 0xb0 0x05 0x05 0x06 0x03
* V-Link CKG Control 0xb1 0x05 0x05 0x01 0x03
*/
-static void ctrl_init(struct device *dev)
+static void ctrl_init_vt8237r(struct device *dev)
{
u8 reg;
+
+ /*
+ * This init code is valid only for the VT8237R! For different
+ * sounthbridges (e.g. VT8237A, VT8237S, VT8237 (without plus R)
+ * and VT8251) a different init code is required.
+ */
device_t devsb = dev_find_device(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VT8237R_LPC, 0);
-
if (!devsb)
return;
@@ -132,17 +137,17 @@ static void ctrl_enable(struct device *dev)
pci_write_config8(dev, 0x63, regm3 | (regm & 0x3F));
}
-static struct device_operations ctrl_ops = {
- .read_resources = pci_dev_read_resources,
- .set_resources = pci_dev_set_resources,
- .enable_resources = pci_dev_enable_resources,
- .enable = ctrl_enable,
- .init = ctrl_init,
- .ops_pci = 0,
+static const struct device_operations ctrl_ops = {
+ .read_resources = pci_dev_read_resources,
+ .set_resources = pci_dev_set_resources,
+ .enable_resources = pci_dev_enable_resources,
+ .enable = ctrl_enable,
+ .init = ctrl_init_vt8237r,
+ .ops_pci = 0,
};
static const struct pci_driver northbridge_driver __pci_driver = {
- .ops = &ctrl_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T890CE_7,
+ .ops = &ctrl_ops,
+ .vendor = PCI_VENDOR_ID_VIA,
+ .device = PCI_DEVICE_ID_VIA_K8T890CE_7,
};