1/* Public domain. */
2
3#ifndef _LINUX_PLATFORM_DEVICE_H
4#define _LINUX_PLATFORM_DEVICE_H
5
6#include <linux/device.h>
7
8struct platform_driver;
9
10struct platform_device {
11	struct device dev;
12	int num_resources;
13	struct resource *resource;
14	struct device *parent;
15	bus_space_tag_t iot;
16	bus_dma_tag_t dmat;
17	int node;
18
19#ifdef __HAVE_FDT
20	struct fdt_attach_args *faa;
21#endif
22
23	LIST_ENTRY(platform_device) next;
24};
25
26#define to_platform_device(p)	(struct platform_device *)(p)
27
28extern struct bus_type platform_bus_type;
29
30void __iomem *
31devm_platform_ioremap_resource_byname(struct platform_device *, const char *);
32
33static inline void
34platform_set_drvdata(struct platform_device *pdev, void *data)
35{
36	dev_set_drvdata(&pdev->dev, data);
37}
38
39static inline void *
40platform_get_drvdata(struct platform_device *pdev)
41{
42	return dev_get_drvdata(&pdev->dev);
43}
44
45static inline int
46platform_driver_register(struct platform_driver *platform_drv)
47{
48	return 0;
49}
50
51void	platform_device_register(struct platform_device *);
52struct resource *platform_get_resource(struct platform_device *, u_int, u_int);
53
54#endif
55