diff options
| author | Irene Zubarev <zubarev@us.ibm.com> | 2002-09-09 00:40:30 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2002-09-09 00:40:30 -0700 |
| commit | ef7f120ab49379a4745574dddf480c845ea2c7ab (patch) | |
| tree | 05fd1489349c7677423289d7ec1c44daf5a21265 /drivers/hotplug/ibmphp_hpc.c | |
| parent | 9adaeddf526a83c4ad09b33588f20679bec85e22 (diff) | |
[PATCH] IBM PCI Hotplug driver update for PCI based controllers
Diffstat (limited to 'drivers/hotplug/ibmphp_hpc.c')
| -rw-r--r-- | drivers/hotplug/ibmphp_hpc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/hotplug/ibmphp_hpc.c b/drivers/hotplug/ibmphp_hpc.c index de70037b449a..ae959809e8a8 100644 --- a/drivers/hotplug/ibmphp_hpc.c +++ b/drivers/hotplug/ibmphp_hpc.c @@ -379,6 +379,26 @@ static void isa_ctrl_write (struct controller *ctlr_ptr, u8 offset, u8 data) outb (data, port_address); } +static u8 pci_ctrl_read (struct controller *ctrl, u8 offset) +{ + u8 data = 0x00; + debug ("inside pci_ctrl_read\n"); + if (ctrl->ctrl_dev) + pci_read_config_byte (ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, &data); + return data; +} + +static u8 pci_ctrl_write (struct controller *ctrl, u8 offset, u8 data) +{ + u8 rc = -ENODEV; + debug ("inside pci_ctrl_write\n"); + if (ctrl->ctrl_dev) { + pci_write_config_byte (ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, data); + rc = 0; + } + return rc; +} + static u8 ctrl_read (struct controller *ctlr, void *base, u8 offset) { u8 rc; @@ -386,6 +406,9 @@ static u8 ctrl_read (struct controller *ctlr, void *base, u8 offset) case 0: rc = isa_ctrl_read (ctlr, offset); break; + case 1: + rc = pci_ctrl_read (ctlr, offset); + break; case 2: case 4: rc = i2c_ctrl_read (ctlr, base, offset); @@ -403,6 +426,9 @@ static u8 ctrl_write (struct controller *ctlr, void *base, u8 offset, u8 data) case 0: isa_ctrl_write(ctlr, offset, data); break; + case 1: + rc = pci_ctrl_write (ctlr, offset, data); + break; case 2: case 4: rc = i2c_ctrl_write(ctlr, base, offset, data); |
