xref: /OK3568_Linux_fs/kernel/include/linux/platform_device.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * platform_device.h - generic, centralized driver model
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * See Documentation/driver-api/driver-model/ for more information.
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef _PLATFORM_DEVICE_H_
11*4882a593Smuzhiyun #define _PLATFORM_DEVICE_H_
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/device.h>
14*4882a593Smuzhiyun #include <linux/android_kabi.h>
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #define PLATFORM_DEVID_NONE	(-1)
17*4882a593Smuzhiyun #define PLATFORM_DEVID_AUTO	(-2)
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun struct mfd_cell;
20*4882a593Smuzhiyun struct property_entry;
21*4882a593Smuzhiyun struct platform_device_id;
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun struct platform_device {
24*4882a593Smuzhiyun 	const char	*name;
25*4882a593Smuzhiyun 	int		id;
26*4882a593Smuzhiyun 	bool		id_auto;
27*4882a593Smuzhiyun 	struct device	dev;
28*4882a593Smuzhiyun 	u64		platform_dma_mask;
29*4882a593Smuzhiyun 	struct device_dma_parameters dma_parms;
30*4882a593Smuzhiyun 	u32		num_resources;
31*4882a593Smuzhiyun 	struct resource	*resource;
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun 	const struct platform_device_id	*id_entry;
34*4882a593Smuzhiyun 	char *driver_override; /* Driver name to force a match */
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun 	/* MFD cell pointer */
37*4882a593Smuzhiyun 	struct mfd_cell *mfd_cell;
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun 	/* arch specific additions */
40*4882a593Smuzhiyun 	struct pdev_archdata	archdata;
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun 	ANDROID_KABI_RESERVE(1);
43*4882a593Smuzhiyun 	ANDROID_KABI_RESERVE(2);
44*4882a593Smuzhiyun };
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #define platform_get_device_id(pdev)	((pdev)->id_entry)
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #define dev_is_platform(dev) ((dev)->bus == &platform_bus_type)
49*4882a593Smuzhiyun #define to_platform_device(x) container_of((x), struct platform_device, dev)
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun extern int platform_device_register(struct platform_device *);
52*4882a593Smuzhiyun extern void platform_device_unregister(struct platform_device *);
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun extern struct bus_type platform_bus_type;
55*4882a593Smuzhiyun extern struct device platform_bus;
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun extern struct resource *platform_get_resource(struct platform_device *,
58*4882a593Smuzhiyun 					      unsigned int, unsigned int);
59*4882a593Smuzhiyun extern struct device *
60*4882a593Smuzhiyun platform_find_device_by_driver(struct device *start,
61*4882a593Smuzhiyun 			       const struct device_driver *drv);
62*4882a593Smuzhiyun extern void __iomem *
63*4882a593Smuzhiyun devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
64*4882a593Smuzhiyun 				unsigned int index, struct resource **res);
65*4882a593Smuzhiyun extern void __iomem *
66*4882a593Smuzhiyun devm_platform_ioremap_resource(struct platform_device *pdev,
67*4882a593Smuzhiyun 			       unsigned int index);
68*4882a593Smuzhiyun extern void __iomem *
69*4882a593Smuzhiyun devm_platform_ioremap_resource_wc(struct platform_device *pdev,
70*4882a593Smuzhiyun 				  unsigned int index);
71*4882a593Smuzhiyun extern void __iomem *
72*4882a593Smuzhiyun devm_platform_ioremap_resource_byname(struct platform_device *pdev,
73*4882a593Smuzhiyun 				      const char *name);
74*4882a593Smuzhiyun extern int platform_get_irq(struct platform_device *, unsigned int);
75*4882a593Smuzhiyun extern int platform_get_irq_optional(struct platform_device *, unsigned int);
76*4882a593Smuzhiyun extern int platform_irq_count(struct platform_device *);
77*4882a593Smuzhiyun extern struct resource *platform_get_resource_byname(struct platform_device *,
78*4882a593Smuzhiyun 						     unsigned int,
79*4882a593Smuzhiyun 						     const char *);
80*4882a593Smuzhiyun extern int platform_get_irq_byname(struct platform_device *, const char *);
81*4882a593Smuzhiyun extern int platform_get_irq_byname_optional(struct platform_device *dev,
82*4882a593Smuzhiyun 					    const char *name);
83*4882a593Smuzhiyun extern int platform_add_devices(struct platform_device **, int);
84*4882a593Smuzhiyun 
85*4882a593Smuzhiyun struct platform_device_info {
86*4882a593Smuzhiyun 		struct device *parent;
87*4882a593Smuzhiyun 		struct fwnode_handle *fwnode;
88*4882a593Smuzhiyun 		bool of_node_reused;
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun 		const char *name;
91*4882a593Smuzhiyun 		int id;
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun 		const struct resource *res;
94*4882a593Smuzhiyun 		unsigned int num_res;
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun 		const void *data;
97*4882a593Smuzhiyun 		size_t size_data;
98*4882a593Smuzhiyun 		u64 dma_mask;
99*4882a593Smuzhiyun 
100*4882a593Smuzhiyun 		const struct property_entry *properties;
101*4882a593Smuzhiyun 
102*4882a593Smuzhiyun 		ANDROID_KABI_RESERVE(1);
103*4882a593Smuzhiyun };
104*4882a593Smuzhiyun extern struct platform_device *platform_device_register_full(
105*4882a593Smuzhiyun 		const struct platform_device_info *pdevinfo);
106*4882a593Smuzhiyun 
107*4882a593Smuzhiyun /**
108*4882a593Smuzhiyun  * platform_device_register_resndata - add a platform-level device with
109*4882a593Smuzhiyun  * resources and platform-specific data
110*4882a593Smuzhiyun  *
111*4882a593Smuzhiyun  * @parent: parent device for the device we're adding
112*4882a593Smuzhiyun  * @name: base name of the device we're adding
113*4882a593Smuzhiyun  * @id: instance id
114*4882a593Smuzhiyun  * @res: set of resources that needs to be allocated for the device
115*4882a593Smuzhiyun  * @num: number of resources
116*4882a593Smuzhiyun  * @data: platform specific data for this platform device
117*4882a593Smuzhiyun  * @size: size of platform specific data
118*4882a593Smuzhiyun  *
119*4882a593Smuzhiyun  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
120*4882a593Smuzhiyun  */
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)121*4882a593Smuzhiyun static inline struct platform_device *platform_device_register_resndata(
122*4882a593Smuzhiyun 		struct device *parent, const char *name, int id,
123*4882a593Smuzhiyun 		const struct resource *res, unsigned int num,
124*4882a593Smuzhiyun 		const void *data, size_t size) {
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun 	struct platform_device_info pdevinfo = {
127*4882a593Smuzhiyun 		.parent = parent,
128*4882a593Smuzhiyun 		.name = name,
129*4882a593Smuzhiyun 		.id = id,
130*4882a593Smuzhiyun 		.res = res,
131*4882a593Smuzhiyun 		.num_res = num,
132*4882a593Smuzhiyun 		.data = data,
133*4882a593Smuzhiyun 		.size_data = size,
134*4882a593Smuzhiyun 		.dma_mask = 0,
135*4882a593Smuzhiyun 	};
136*4882a593Smuzhiyun 
137*4882a593Smuzhiyun 	return platform_device_register_full(&pdevinfo);
138*4882a593Smuzhiyun }
139*4882a593Smuzhiyun 
140*4882a593Smuzhiyun /**
141*4882a593Smuzhiyun  * platform_device_register_simple - add a platform-level device and its resources
142*4882a593Smuzhiyun  * @name: base name of the device we're adding
143*4882a593Smuzhiyun  * @id: instance id
144*4882a593Smuzhiyun  * @res: set of resources that needs to be allocated for the device
145*4882a593Smuzhiyun  * @num: number of resources
146*4882a593Smuzhiyun  *
147*4882a593Smuzhiyun  * This function creates a simple platform device that requires minimal
148*4882a593Smuzhiyun  * resource and memory management. Canned release function freeing memory
149*4882a593Smuzhiyun  * allocated for the device allows drivers using such devices to be
150*4882a593Smuzhiyun  * unloaded without waiting for the last reference to the device to be
151*4882a593Smuzhiyun  * dropped.
152*4882a593Smuzhiyun  *
153*4882a593Smuzhiyun  * This interface is primarily intended for use with legacy drivers which
154*4882a593Smuzhiyun  * probe hardware directly.  Because such drivers create sysfs device nodes
155*4882a593Smuzhiyun  * themselves, rather than letting system infrastructure handle such device
156*4882a593Smuzhiyun  * enumeration tasks, they don't fully conform to the Linux driver model.
157*4882a593Smuzhiyun  * In particular, when such drivers are built as modules, they can't be
158*4882a593Smuzhiyun  * "hotplugged".
159*4882a593Smuzhiyun  *
160*4882a593Smuzhiyun  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
161*4882a593Smuzhiyun  */
platform_device_register_simple(const char * name,int id,const struct resource * res,unsigned int num)162*4882a593Smuzhiyun static inline struct platform_device *platform_device_register_simple(
163*4882a593Smuzhiyun 		const char *name, int id,
164*4882a593Smuzhiyun 		const struct resource *res, unsigned int num)
165*4882a593Smuzhiyun {
166*4882a593Smuzhiyun 	return platform_device_register_resndata(NULL, name, id,
167*4882a593Smuzhiyun 			res, num, NULL, 0);
168*4882a593Smuzhiyun }
169*4882a593Smuzhiyun 
170*4882a593Smuzhiyun /**
171*4882a593Smuzhiyun  * platform_device_register_data - add a platform-level device with platform-specific data
172*4882a593Smuzhiyun  * @parent: parent device for the device we're adding
173*4882a593Smuzhiyun  * @name: base name of the device we're adding
174*4882a593Smuzhiyun  * @id: instance id
175*4882a593Smuzhiyun  * @data: platform specific data for this platform device
176*4882a593Smuzhiyun  * @size: size of platform specific data
177*4882a593Smuzhiyun  *
178*4882a593Smuzhiyun  * This function creates a simple platform device that requires minimal
179*4882a593Smuzhiyun  * resource and memory management. Canned release function freeing memory
180*4882a593Smuzhiyun  * allocated for the device allows drivers using such devices to be
181*4882a593Smuzhiyun  * unloaded without waiting for the last reference to the device to be
182*4882a593Smuzhiyun  * dropped.
183*4882a593Smuzhiyun  *
184*4882a593Smuzhiyun  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
185*4882a593Smuzhiyun  */
platform_device_register_data(struct device * parent,const char * name,int id,const void * data,size_t size)186*4882a593Smuzhiyun static inline struct platform_device *platform_device_register_data(
187*4882a593Smuzhiyun 		struct device *parent, const char *name, int id,
188*4882a593Smuzhiyun 		const void *data, size_t size)
189*4882a593Smuzhiyun {
190*4882a593Smuzhiyun 	return platform_device_register_resndata(parent, name, id,
191*4882a593Smuzhiyun 			NULL, 0, data, size);
192*4882a593Smuzhiyun }
193*4882a593Smuzhiyun 
194*4882a593Smuzhiyun extern struct platform_device *platform_device_alloc(const char *name, int id);
195*4882a593Smuzhiyun extern int platform_device_add_resources(struct platform_device *pdev,
196*4882a593Smuzhiyun 					 const struct resource *res,
197*4882a593Smuzhiyun 					 unsigned int num);
198*4882a593Smuzhiyun extern int platform_device_add_data(struct platform_device *pdev,
199*4882a593Smuzhiyun 				    const void *data, size_t size);
200*4882a593Smuzhiyun extern int platform_device_add_properties(struct platform_device *pdev,
201*4882a593Smuzhiyun 				const struct property_entry *properties);
202*4882a593Smuzhiyun extern int platform_device_add(struct platform_device *pdev);
203*4882a593Smuzhiyun extern void platform_device_del(struct platform_device *pdev);
204*4882a593Smuzhiyun extern void platform_device_put(struct platform_device *pdev);
205*4882a593Smuzhiyun 
206*4882a593Smuzhiyun struct platform_driver {
207*4882a593Smuzhiyun 	int (*probe)(struct platform_device *);
208*4882a593Smuzhiyun 	int (*remove)(struct platform_device *);
209*4882a593Smuzhiyun 	void (*shutdown)(struct platform_device *);
210*4882a593Smuzhiyun 	int (*suspend)(struct platform_device *, pm_message_t state);
211*4882a593Smuzhiyun 	int (*resume)(struct platform_device *);
212*4882a593Smuzhiyun 	struct device_driver driver;
213*4882a593Smuzhiyun 	const struct platform_device_id *id_table;
214*4882a593Smuzhiyun 	bool prevent_deferred_probe;
215*4882a593Smuzhiyun 
216*4882a593Smuzhiyun 	ANDROID_KABI_RESERVE(1);
217*4882a593Smuzhiyun };
218*4882a593Smuzhiyun 
219*4882a593Smuzhiyun #define to_platform_driver(drv)	(container_of((drv), struct platform_driver, \
220*4882a593Smuzhiyun 				 driver))
221*4882a593Smuzhiyun 
222*4882a593Smuzhiyun /*
223*4882a593Smuzhiyun  * use a macro to avoid include chaining to get THIS_MODULE
224*4882a593Smuzhiyun  */
225*4882a593Smuzhiyun #define platform_driver_register(drv) \
226*4882a593Smuzhiyun 	__platform_driver_register(drv, THIS_MODULE)
227*4882a593Smuzhiyun extern int __platform_driver_register(struct platform_driver *,
228*4882a593Smuzhiyun 					struct module *);
229*4882a593Smuzhiyun extern void platform_driver_unregister(struct platform_driver *);
230*4882a593Smuzhiyun 
231*4882a593Smuzhiyun /* non-hotpluggable platform devices may use this so that probe() and
232*4882a593Smuzhiyun  * its support may live in __init sections, conserving runtime memory.
233*4882a593Smuzhiyun  */
234*4882a593Smuzhiyun #define platform_driver_probe(drv, probe) \
235*4882a593Smuzhiyun 	__platform_driver_probe(drv, probe, THIS_MODULE)
236*4882a593Smuzhiyun extern int __platform_driver_probe(struct platform_driver *driver,
237*4882a593Smuzhiyun 		int (*probe)(struct platform_device *), struct module *module);
238*4882a593Smuzhiyun 
platform_get_drvdata(const struct platform_device * pdev)239*4882a593Smuzhiyun static inline void *platform_get_drvdata(const struct platform_device *pdev)
240*4882a593Smuzhiyun {
241*4882a593Smuzhiyun 	return dev_get_drvdata(&pdev->dev);
242*4882a593Smuzhiyun }
243*4882a593Smuzhiyun 
platform_set_drvdata(struct platform_device * pdev,void * data)244*4882a593Smuzhiyun static inline void platform_set_drvdata(struct platform_device *pdev,
245*4882a593Smuzhiyun 					void *data)
246*4882a593Smuzhiyun {
247*4882a593Smuzhiyun 	dev_set_drvdata(&pdev->dev, data);
248*4882a593Smuzhiyun }
249*4882a593Smuzhiyun 
250*4882a593Smuzhiyun /* module_platform_driver() - Helper macro for drivers that don't do
251*4882a593Smuzhiyun  * anything special in module init/exit.  This eliminates a lot of
252*4882a593Smuzhiyun  * boilerplate.  Each module may only use this macro once, and
253*4882a593Smuzhiyun  * calling it replaces module_init() and module_exit()
254*4882a593Smuzhiyun  */
255*4882a593Smuzhiyun #define module_platform_driver(__platform_driver) \
256*4882a593Smuzhiyun 	module_driver(__platform_driver, platform_driver_register, \
257*4882a593Smuzhiyun 			platform_driver_unregister)
258*4882a593Smuzhiyun 
259*4882a593Smuzhiyun /* builtin_platform_driver() - Helper macro for builtin drivers that
260*4882a593Smuzhiyun  * don't do anything special in driver init.  This eliminates some
261*4882a593Smuzhiyun  * boilerplate.  Each driver may only use this macro once, and
262*4882a593Smuzhiyun  * calling it replaces device_initcall().  Note this is meant to be
263*4882a593Smuzhiyun  * a parallel of module_platform_driver() above, but w/o _exit stuff.
264*4882a593Smuzhiyun  */
265*4882a593Smuzhiyun #define builtin_platform_driver(__platform_driver) \
266*4882a593Smuzhiyun 	builtin_driver(__platform_driver, platform_driver_register)
267*4882a593Smuzhiyun 
268*4882a593Smuzhiyun /* module_platform_driver_probe() - Helper macro for drivers that don't do
269*4882a593Smuzhiyun  * anything special in module init/exit.  This eliminates a lot of
270*4882a593Smuzhiyun  * boilerplate.  Each module may only use this macro once, and
271*4882a593Smuzhiyun  * calling it replaces module_init() and module_exit()
272*4882a593Smuzhiyun  */
273*4882a593Smuzhiyun #define module_platform_driver_probe(__platform_driver, __platform_probe) \
274*4882a593Smuzhiyun static int __init __platform_driver##_init(void) \
275*4882a593Smuzhiyun { \
276*4882a593Smuzhiyun 	return platform_driver_probe(&(__platform_driver), \
277*4882a593Smuzhiyun 				     __platform_probe);    \
278*4882a593Smuzhiyun } \
279*4882a593Smuzhiyun module_init(__platform_driver##_init); \
280*4882a593Smuzhiyun static void __exit __platform_driver##_exit(void) \
281*4882a593Smuzhiyun { \
282*4882a593Smuzhiyun 	platform_driver_unregister(&(__platform_driver)); \
283*4882a593Smuzhiyun } \
284*4882a593Smuzhiyun module_exit(__platform_driver##_exit);
285*4882a593Smuzhiyun 
286*4882a593Smuzhiyun /* builtin_platform_driver_probe() - Helper macro for drivers that don't do
287*4882a593Smuzhiyun  * anything special in device init.  This eliminates some boilerplate.  Each
288*4882a593Smuzhiyun  * driver may only use this macro once, and using it replaces device_initcall.
289*4882a593Smuzhiyun  * This is meant to be a parallel of module_platform_driver_probe above, but
290*4882a593Smuzhiyun  * without the __exit parts.
291*4882a593Smuzhiyun  */
292*4882a593Smuzhiyun #define builtin_platform_driver_probe(__platform_driver, __platform_probe) \
293*4882a593Smuzhiyun static int __init __platform_driver##_init(void) \
294*4882a593Smuzhiyun { \
295*4882a593Smuzhiyun 	return platform_driver_probe(&(__platform_driver), \
296*4882a593Smuzhiyun 				     __platform_probe);    \
297*4882a593Smuzhiyun } \
298*4882a593Smuzhiyun device_initcall(__platform_driver##_init); \
299*4882a593Smuzhiyun 
300*4882a593Smuzhiyun #define platform_create_bundle(driver, probe, res, n_res, data, size) \
301*4882a593Smuzhiyun 	__platform_create_bundle(driver, probe, res, n_res, data, size, THIS_MODULE)
302*4882a593Smuzhiyun extern struct platform_device *__platform_create_bundle(
303*4882a593Smuzhiyun 	struct platform_driver *driver, int (*probe)(struct platform_device *),
304*4882a593Smuzhiyun 	struct resource *res, unsigned int n_res,
305*4882a593Smuzhiyun 	const void *data, size_t size, struct module *module);
306*4882a593Smuzhiyun 
307*4882a593Smuzhiyun int __platform_register_drivers(struct platform_driver * const *drivers,
308*4882a593Smuzhiyun 				unsigned int count, struct module *owner);
309*4882a593Smuzhiyun void platform_unregister_drivers(struct platform_driver * const *drivers,
310*4882a593Smuzhiyun 				 unsigned int count);
311*4882a593Smuzhiyun 
312*4882a593Smuzhiyun #define platform_register_drivers(drivers, count) \
313*4882a593Smuzhiyun 	__platform_register_drivers(drivers, count, THIS_MODULE)
314*4882a593Smuzhiyun 
315*4882a593Smuzhiyun #ifdef CONFIG_SUSPEND
316*4882a593Smuzhiyun extern int platform_pm_suspend(struct device *dev);
317*4882a593Smuzhiyun extern int platform_pm_resume(struct device *dev);
318*4882a593Smuzhiyun #else
319*4882a593Smuzhiyun #define platform_pm_suspend		NULL
320*4882a593Smuzhiyun #define platform_pm_resume		NULL
321*4882a593Smuzhiyun #endif
322*4882a593Smuzhiyun 
323*4882a593Smuzhiyun #ifdef CONFIG_HIBERNATE_CALLBACKS
324*4882a593Smuzhiyun extern int platform_pm_freeze(struct device *dev);
325*4882a593Smuzhiyun extern int platform_pm_thaw(struct device *dev);
326*4882a593Smuzhiyun extern int platform_pm_poweroff(struct device *dev);
327*4882a593Smuzhiyun extern int platform_pm_restore(struct device *dev);
328*4882a593Smuzhiyun #else
329*4882a593Smuzhiyun #define platform_pm_freeze		NULL
330*4882a593Smuzhiyun #define platform_pm_thaw		NULL
331*4882a593Smuzhiyun #define platform_pm_poweroff		NULL
332*4882a593Smuzhiyun #define platform_pm_restore		NULL
333*4882a593Smuzhiyun #endif
334*4882a593Smuzhiyun 
335*4882a593Smuzhiyun extern int platform_dma_configure(struct device *dev);
336*4882a593Smuzhiyun 
337*4882a593Smuzhiyun #ifdef CONFIG_PM_SLEEP
338*4882a593Smuzhiyun #define USE_PLATFORM_PM_SLEEP_OPS \
339*4882a593Smuzhiyun 	.suspend = platform_pm_suspend, \
340*4882a593Smuzhiyun 	.resume = platform_pm_resume, \
341*4882a593Smuzhiyun 	.freeze = platform_pm_freeze, \
342*4882a593Smuzhiyun 	.thaw = platform_pm_thaw, \
343*4882a593Smuzhiyun 	.poweroff = platform_pm_poweroff, \
344*4882a593Smuzhiyun 	.restore = platform_pm_restore,
345*4882a593Smuzhiyun #else
346*4882a593Smuzhiyun #define USE_PLATFORM_PM_SLEEP_OPS
347*4882a593Smuzhiyun #endif
348*4882a593Smuzhiyun 
349*4882a593Smuzhiyun #ifndef CONFIG_SUPERH
350*4882a593Smuzhiyun /*
351*4882a593Smuzhiyun  * REVISIT: This stub is needed for all non-SuperH users of early platform
352*4882a593Smuzhiyun  * drivers. It should go away once we introduce the new platform_device-based
353*4882a593Smuzhiyun  * early driver framework.
354*4882a593Smuzhiyun  */
is_sh_early_platform_device(struct platform_device * pdev)355*4882a593Smuzhiyun static inline int is_sh_early_platform_device(struct platform_device *pdev)
356*4882a593Smuzhiyun {
357*4882a593Smuzhiyun 	return 0;
358*4882a593Smuzhiyun }
359*4882a593Smuzhiyun #endif /* CONFIG_SUPERH */
360*4882a593Smuzhiyun 
361*4882a593Smuzhiyun /* For now only SuperH uses it */
362*4882a593Smuzhiyun void early_platform_cleanup(void);
363*4882a593Smuzhiyun 
364*4882a593Smuzhiyun #endif /* _PLATFORM_DEVICE_H_ */
365