diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h index ee92a32d08..69a0667445 100644 --- a/src/include/device/pnp.h +++ b/src/include/device/pnp.h @@ -4,9 +4,10 @@ #include #include #include +#include #include -#ifndef __SIMPLE_DEVICE__ +#if !ENV_PNP_SIMPLE_DEVICE /* Primitive PNP resource manipulation */ void pnp_write_config(struct device *dev, u8 reg, u8 value); @@ -18,7 +19,7 @@ void pnp_set_iobase(struct device *dev, u8 index, u16 iobase); void pnp_set_irq(struct device *dev, u8 index, u8 irq); void pnp_set_drq(struct device *dev, u8 index, u8 drq); -#endif /* __SIMPLE_DEVICE */ +#endif /* PNP device operations */ void pnp_read_resources(struct device *dev); diff --git a/src/include/device/pnp_ops.h b/src/include/device/pnp_ops.h index 9086fdf67c..61d05a86ad 100644 --- a/src/include/device/pnp_ops.h +++ b/src/include/device/pnp_ops.h @@ -19,7 +19,7 @@ #include #include -#ifdef __SIMPLE_DEVICE__ +#if ENV_PNP_SIMPLE_DEVICE static __always_inline void pnp_write_config( pnp_devfn_t dev, uint8_t reg, uint8_t value) @@ -82,6 +82,6 @@ void pnp_set_drq(pnp_devfn_t dev, unsigned int index, unsigned int drq) pnp_write_config(dev, index, drq & 0xff); } -#endif /* __SIMPLE_DEVICE__ */ +#endif #endif diff --git a/src/include/device/pnp_type.h b/src/include/device/pnp_type.h index db26f2f259..dc2d27c84d 100644 --- a/src/include/device/pnp_type.h +++ b/src/include/device/pnp_type.h @@ -20,4 +20,10 @@ typedef u32 pnp_devfn_t; #define PNP_DEV(PORT, FUNC) (((PORT) << 8) | (FUNC)) +#if defined(__SIMPLE_DEVICE__) +#define ENV_PNP_SIMPLE_DEVICE 1 +#else +#define ENV_PNP_SIMPLE_DEVICE 0 +#endif + #endif /* __DEVICE_PNP_TYPE_H__ */