1 /* Public domain. */
2 
3 #ifndef _LINUX_PLATFORM_DEVICE_H
4 #define _LINUX_PLATFORM_DEVICE_H
5 
6 #include <linux/device.h>
7 
8 struct platform_driver;
9 
10 struct 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 
28 extern struct bus_type platform_bus_type;
29 
30 void __iomem *
31 devm_platform_ioremap_resource_byname(struct platform_device *, const char *);
32 
33 static inline void
platform_set_drvdata(struct platform_device * pdev,void * data)34 platform_set_drvdata(struct platform_device *pdev, void *data)
35 {
36 	dev_set_drvdata(&pdev->dev, data);
37 }
38 
39 static inline void *
platform_get_drvdata(struct platform_device * pdev)40 platform_get_drvdata(struct platform_device *pdev)
41 {
42 	return dev_get_drvdata(&pdev->dev);
43 }
44 
45 static inline int
platform_driver_register(struct platform_driver * platform_drv)46 platform_driver_register(struct platform_driver *platform_drv)
47 {
48 	return 0;
49 }
50 
51 void	platform_device_register(struct platform_device *);
52 struct resource *platform_get_resource(struct platform_device *, u_int, u_int);
53 
54 #endif
55