#ifndef _PLATFORM_DEVICE_H_
#define _PLATFORM_DEVICE_H_
#include <linux/device.h>
#define PLATFORM_DEVID_NONE …
#define PLATFORM_DEVID_AUTO …
struct irq_affinity;
struct mfd_cell;
struct property_entry;
struct platform_device_id;
struct platform_device { … };
#define platform_get_device_id(pdev) …
#define dev_is_platform(dev) …
#define to_platform_device(x) …
extern int platform_device_register(struct platform_device *);
extern void platform_device_unregister(struct platform_device *);
extern const struct bus_type platform_bus_type;
extern struct device platform_bus;
extern struct resource *platform_get_resource(struct platform_device *,
unsigned int, unsigned int);
extern struct resource *platform_get_mem_or_io(struct platform_device *,
unsigned int);
extern struct device *
platform_find_device_by_driver(struct device *start,
const struct device_driver *drv);
#ifdef CONFIG_HAS_IOMEM
extern void __iomem *
devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
unsigned int index, struct resource **res);
extern void __iomem *
devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index);
extern void __iomem *
devm_platform_ioremap_resource_byname(struct platform_device *pdev,
const char *name);
#else
static inline void __iomem *
devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
unsigned int index, struct resource **res)
{
return ERR_PTR(-EINVAL);
}
static inline void __iomem *
devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index)
{
return ERR_PTR(-EINVAL);
}
static inline void __iomem *
devm_platform_ioremap_resource_byname(struct platform_device *pdev,
const char *name)
{
return ERR_PTR(-EINVAL);
}
#endif
extern int platform_get_irq(struct platform_device *, unsigned int);
extern int platform_get_irq_optional(struct platform_device *, unsigned int);
extern int platform_irq_count(struct platform_device *);
extern int devm_platform_get_irqs_affinity(struct platform_device *dev,
struct irq_affinity *affd,
unsigned int minvec,
unsigned int maxvec,
int **irqs);
extern struct resource *platform_get_resource_byname(struct platform_device *,
unsigned int,
const char *);
extern int platform_get_irq_byname(struct platform_device *, const char *);
extern int platform_get_irq_byname_optional(struct platform_device *dev,
const char *name);
extern int platform_add_devices(struct platform_device **, int);
struct platform_device_info { … };
extern struct platform_device *platform_device_register_full(
const struct platform_device_info *pdevinfo);
static inline struct platform_device *platform_device_register_resndata(
struct device *parent, const char *name, int id,
const struct resource *res, unsigned int num,
const void *data, size_t size) { … }
static inline struct platform_device *platform_device_register_simple(
const char *name, int id,
const struct resource *res, unsigned int num)
{ … }
static inline struct platform_device *platform_device_register_data(
struct device *parent, const char *name, int id,
const void *data, size_t size)
{ … }
extern struct platform_device *platform_device_alloc(const char *name, int id);
extern int platform_device_add_resources(struct platform_device *pdev,
const struct resource *res,
unsigned int num);
extern int platform_device_add_data(struct platform_device *pdev,
const void *data, size_t size);
extern int platform_device_add(struct platform_device *pdev);
extern void platform_device_del(struct platform_device *pdev);
extern void platform_device_put(struct platform_device *pdev);
struct platform_driver { … };
#define to_platform_driver(drv) …
#define platform_driver_register(drv) …
extern int __platform_driver_register(struct platform_driver *,
struct module *);
extern void platform_driver_unregister(struct platform_driver *);
#define platform_driver_probe(drv, probe) …
extern int __platform_driver_probe(struct platform_driver *driver,
int (*probe)(struct platform_device *), struct module *module);
static inline void *platform_get_drvdata(const struct platform_device *pdev)
{ … }
static inline void platform_set_drvdata(struct platform_device *pdev,
void *data)
{ … }
#define module_platform_driver(__platform_driver) …
#define builtin_platform_driver(__platform_driver) …
#define module_platform_driver_probe(__platform_driver, __platform_probe) …
#define builtin_platform_driver_probe(__platform_driver, __platform_probe) … \
#define platform_create_bundle(driver, probe, res, n_res, data, size) …
extern struct platform_device *__platform_create_bundle(
struct platform_driver *driver, int (*probe)(struct platform_device *),
struct resource *res, unsigned int n_res,
const void *data, size_t size, struct module *module);
int __platform_register_drivers(struct platform_driver * const *drivers,
unsigned int count, struct module *owner);
void platform_unregister_drivers(struct platform_driver * const *drivers,
unsigned int count);
#define platform_register_drivers(drivers, count) …
#ifdef CONFIG_SUSPEND
extern int platform_pm_suspend(struct device *dev);
extern int platform_pm_resume(struct device *dev);
#else
#define platform_pm_suspend …
#define platform_pm_resume …
#endif
#ifdef CONFIG_HIBERNATE_CALLBACKS
extern int platform_pm_freeze(struct device *dev);
extern int platform_pm_thaw(struct device *dev);
extern int platform_pm_poweroff(struct device *dev);
extern int platform_pm_restore(struct device *dev);
#else
#define platform_pm_freeze …
#define platform_pm_thaw …
#define platform_pm_poweroff …
#define platform_pm_restore …
#endif
#ifdef CONFIG_PM_SLEEP
#define USE_PLATFORM_PM_SLEEP_OPS …
#else
#define USE_PLATFORM_PM_SLEEP_OPS
#endif
#ifndef CONFIG_SUPERH
static inline int is_sh_early_platform_device(struct platform_device *pdev)
{ … }
#endif
void early_platform_cleanup(void);
#endif