From dd4715b6a5beca80ce9655f8711327a83d05b416 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 10 Jun 2013 22:08:35 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/3481 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- src/include/device/pnp.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/include/device/pnp.h') 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 */ -- cgit v1.2.3