27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/errno.h>
31 #include <linux/pci.h>
35 #define SMBUS_IO_SIZE 64
38 #define GPIO_IO_SIZE 64
39 #define GPIO_IO_SIZE_CENTERTON 128
42 #define WDT_IO_SIZE 64
44 static struct resource smbus_sch_resource = {
49 static struct resource gpio_sch_resource = {
53 static struct mfd_cell lpc_sch_cells[] = {
57 .resources = &smbus_sch_resource,
62 .resources = &gpio_sch_resource,
66 static struct resource wdt_sch_resource = {
70 static struct mfd_cell tunnelcreek_cells[] = {
74 .resources = &wdt_sch_resource,
89 unsigned int base_addr_cfg;
90 unsigned short base_addr;
94 pci_read_config_dword(dev,
SMBASE, &base_addr_cfg);
95 if (!(base_addr_cfg & (1 << 31))) {
96 dev_err(&dev->
dev,
"Decode of the SMBus I/O range disabled\n");
99 base_addr = (
unsigned short)base_addr_cfg;
100 if (base_addr == 0) {
101 dev_err(&dev->
dev,
"I/O space for SMBus uninitialized\n");
105 smbus_sch_resource.
start = base_addr;
108 pci_read_config_dword(dev,
GPIOBASE, &base_addr_cfg);
109 if (!(base_addr_cfg & (1 << 31))) {
110 dev_err(&dev->
dev,
"Decode of the GPIO I/O range disabled\n");
113 base_addr = (
unsigned short)base_addr_cfg;
114 if (base_addr == 0) {
115 dev_err(&dev->
dev,
"I/O space for GPIO uninitialized\n");
119 gpio_sch_resource.
start = base_addr;
127 lpc_sch_cells[i].
id = id->
device;
137 pci_read_config_dword(dev,
WDTBASE, &base_addr_cfg);
138 if (!(base_addr_cfg & (1 << 31))) {
139 dev_err(&dev->
dev,
"Decode of the WDT I/O range disabled\n");
143 base_addr = (
unsigned short)base_addr_cfg;
144 if (base_addr == 0) {
145 dev_err(&dev->
dev,
"I/O space for WDT uninitialized\n");
150 wdt_sch_resource.
start = base_addr;
153 for (i = 0; i <
ARRAY_SIZE(tunnelcreek_cells); i++)
154 tunnelcreek_cells[i].
id = id->
device;
174 .id_table = lpc_sch_ids,
175 .probe = lpc_sch_probe,