aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/amd/cs5536/cs5536.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/southbridge/amd/cs5536/cs5536.c')
-rw-r--r--src/southbridge/amd/cs5536/cs5536.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/southbridge/amd/cs5536/cs5536.c b/src/southbridge/amd/cs5536/cs5536.c
index 872de36887..0c0368f217 100644
--- a/src/southbridge/amd/cs5536/cs5536.c
+++ b/src/southbridge/amd/cs5536/cs5536.c
@@ -23,6 +23,7 @@
#include <device/pci.h>
#include <device/pci_ops.h>
#include <device/pci_ids.h>
+#include <device/smbus.h>
#include <console/console.h>
#include <stdint.h>
#include <pc80/isa-dma.h>
@@ -33,6 +34,7 @@
#include <stdlib.h>
#include "chip.h"
#include "cs5536.h"
+#include "smbus.h"
struct msrinit {
u32 msrnum;
@@ -667,6 +669,23 @@ static void southbridge_enable(struct device *dev)
}
+static int lsmbus_read_byte(device_t dev, u8 address)
+{
+ u16 device;
+ struct resource *res;
+ struct bus *pbus;
+
+ device = dev->path.i2c.device;
+ pbus = get_pbus_smbus(dev);
+ res = find_resource(pbus->dev, 0x10);
+
+ return do_smbus_read_byte(res->base, device, address);
+}
+
+static struct smbus_bus_operations lops_smbus_bus = {
+ .read_byte = lsmbus_read_byte,
+};
+
static struct device_operations southbridge_ops = {
.read_resources = cs5536_read_resources,
.set_resources = pci_dev_set_resources,
@@ -674,6 +693,7 @@ static struct device_operations southbridge_ops = {
.init = southbridge_init,
// .enable = southbridge_enable,
.scan_bus = scan_static_bus,
+ .ops_smbus_bus = &lops_smbus_bus,
};
static const struct pci_driver cs5536_pci_driver __pci_driver = {