#ifndef _LINUX_PNP_H
#define _LINUX_PNP_H
#include <linux/device.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/mod_devicetable.h>
#include <linux/console.h>
#define PNP_NAME_LEN …
struct pnp_protocol;
struct pnp_dev;
#ifdef CONFIG_PNP
struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type,
unsigned int num);
#else
static inline struct resource *pnp_get_resource(struct pnp_dev *dev,
unsigned long type, unsigned int num)
{
return NULL;
}
#endif
static inline int pnp_resource_valid(struct resource *res)
{ … }
static inline int pnp_resource_enabled(struct resource *res)
{ … }
static inline resource_size_t pnp_resource_len(struct resource *res)
{ … }
static inline resource_size_t pnp_port_start(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline resource_size_t pnp_port_end(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline unsigned long pnp_port_flags(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline resource_size_t pnp_port_len(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline resource_size_t pnp_mem_start(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline resource_size_t pnp_mem_end(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline resource_size_t pnp_mem_len(struct pnp_dev *dev,
unsigned int bar)
{ … }
static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline resource_size_t pnp_dma(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar)
{ … }
static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar)
{ … }
struct pnp_card { … };
#define global_to_pnp_card(n) …
#define protocol_to_pnp_card(n) …
#define to_pnp_card(n) …
#define pnp_for_each_card(card) …
struct pnp_card_link { … };
static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard)
{ … }
static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data)
{ … }
struct pnp_dev { … };
#define global_to_pnp_dev(n) …
#define card_to_pnp_dev(n) …
#define protocol_to_pnp_dev(n) …
#define to_pnp_dev(n) …
#define pnp_for_each_dev(dev) …
#define card_for_each_dev(card, dev) …
#define pnp_dev_name(dev) …
static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
{ … }
static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
{ … }
struct pnp_fixup { … };
#define PNP_CONFIG_NORMAL …
#define PNP_CONFIG_FORCE …
#define PNP_READ …
#define PNP_WRITE …
#define PNP_DISABLE …
#define PNP_CONFIGURABLE …
#define PNP_REMOVABLE …
#define PNP_CONSOLE …
#define pnp_can_read(dev) …
#define pnp_can_write(dev) …
#define pnp_can_disable(dev) …
#define pnp_can_configure(dev) …
#define pnp_can_suspend(dev) …
#ifdef CONFIG_ISAPNP
extern struct pnp_protocol isapnp_protocol;
#define pnp_device_is_isapnp(dev) …
#else
#define pnp_device_is_isapnp …
#endif
extern struct mutex pnp_res_mutex;
#ifdef CONFIG_PNPBIOS
extern struct pnp_protocol pnpbios_protocol;
extern bool arch_pnpbios_disabled(void);
#define pnp_device_is_pnpbios …
#else
#define pnp_device_is_pnpbios(dev) …
#define arch_pnpbios_disabled() …
#endif
#ifdef CONFIG_PNPACPI
extern struct pnp_protocol pnpacpi_protocol;
static inline struct acpi_device *pnp_acpi_device(struct pnp_dev *dev)
{ … }
#else
#define pnp_acpi_device …
#endif
#define PNP_READY …
#define PNP_ATTACHED …
#define PNP_BUSY …
#define PNP_FAULTY …
#define isapnp_card_number(dev) …
#define isapnp_csn_number(dev) …
struct pnp_id { … };
struct pnp_driver { … };
#define to_pnp_driver(drv) …
struct pnp_card_driver { … };
#define to_pnp_card_driver(drv) …
#define PNP_DRIVER_RES_DO_NOT_CHANGE …
#define PNP_DRIVER_RES_DISABLE …
struct pnp_protocol { … };
#define to_pnp_protocol(n) …
#define protocol_for_each_card(protocol, card) …
#define protocol_for_each_dev(protocol, dev) …
#if defined(CONFIG_PNP)
int pnp_device_attach(struct pnp_dev *pnp_dev);
void pnp_device_detach(struct pnp_dev *pnp_dev);
extern struct list_head pnp_global;
extern int pnp_platform_devices;
struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
const char *id, struct pnp_dev *from);
void pnp_release_card_device(struct pnp_dev *dev);
int pnp_register_card_driver(struct pnp_card_driver *drv);
void pnp_unregister_card_driver(struct pnp_card_driver *drv);
extern struct list_head pnp_cards;
int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t base,
resource_size_t size);
int pnp_auto_config_dev(struct pnp_dev *dev);
int pnp_start_dev(struct pnp_dev *dev);
int pnp_stop_dev(struct pnp_dev *dev);
int pnp_activate_dev(struct pnp_dev *dev);
int pnp_disable_dev(struct pnp_dev *dev);
int pnp_range_reserved(resource_size_t start, resource_size_t end);
int pnp_is_active(struct pnp_dev *dev);
int compare_pnp_id(struct pnp_id *pos, const char *id);
int pnp_register_driver(struct pnp_driver *drv);
void pnp_unregister_driver(struct pnp_driver *drv);
bool dev_is_pnp(const struct device *dev);
#else
static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { }
#define pnp_platform_devices …
static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; }
static inline void pnp_release_card_device(struct pnp_dev *dev) { }
static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; }
static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
static inline int pnp_possible_config(struct pnp_dev *dev, int type,
resource_size_t base,
resource_size_t size) { return 0; }
static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_range_reserved(resource_size_t start, resource_size_t end) { return 0; }
static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; }
static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
static inline bool dev_is_pnp(const struct device *dev) { return false; }
#endif
#define module_pnp_driver(__pnp_driver) …
#endif