summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2013-06-10 22:08:35 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-06-17 21:39:40 +0200
commitdd4715b6a5beca80ce9655f8711327a83d05b416 (patch)
tree39d934c6d5bbab9f8fbfa856ec033efd26a7ce55 /src/include/device
parentf898f7ba4d10146b45241afe65fd54b3c049cc4f (diff)
pnp: Implement common handling for PnP config modes
Many super i/o chips only answer to PnP requests if they are in a configuration state (sometimes also called ext func mode). To cope with that, the code of many chips implements its own version of our default PnP functions like pnp_set_resource(), pnp_enable_resource() etc. To avoid this code duplication, this patch extends our PnP device interface with optional functions to enter and exit configuration mode. Change-Id: I9b7662a0db70ede93276764fa15020f251eb46bd Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: http://review.coreboot.org/3481 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/device.h2
-rw-r--r--src/include/device/pnp.h7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 44a9742ab8..9defb19d83 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -13,6 +13,7 @@ typedef struct device * device_t;
struct pci_operations;
struct pci_bus_operations;
struct smbus_bus_operations;
+struct pnp_mode_ops;
/* Chip operations */
struct chip_operations {
@@ -42,6 +43,7 @@ struct device_operations {
const struct pci_operations *ops_pci;
const struct smbus_bus_operations *ops_smbus_bus;
const struct pci_bus_operations *ops_pci_bus;
+ const struct pnp_mode_ops *ops_pnp_mode;
};
#endif
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h
index 566722335c..434f0a440e 100644
--- a/src/include/device/pnp.h
+++ b/src/include/device/pnp.h
@@ -52,5 +52,12 @@ struct resource *pnp_get_resource(device_t dev, unsigned index);
void pnp_enable_devices(struct device *dev, struct device_operations *ops,
unsigned int functions, struct pnp_info *info);
+struct pnp_mode_ops {
+ void (*enter_conf_mode)(device_t dev);
+ void (*exit_conf_mode)(device_t dev);
+};
+void pnp_enter_conf_mode(device_t dev);
+void pnp_exit_conf_mode(device_t dev);
+
#endif
#endif /* DEVICE_PNP_H */