blob: 53b46507ffde02c9baab0c6343cd22ffb76c8092 [file] [log] [blame]
Stephen Rothwellb41912c2007-05-01 16:12:57 +10001#ifndef _ASM_POWERPC_OF_PLATFORM_H
2#define _ASM_POWERPC_OF_PLATFORM_H
Benjamin Herrenschmidt7eebde72006-11-11 17:24:59 +11003/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 */
13
Benjamin Herrenschmidt7eebde72006-11-11 17:24:59 +110014/* Platform drivers register/unregister */
Stephen Rothwell18cce5d2007-10-17 13:43:34 +100015static inline int of_register_platform_driver(struct of_platform_driver *drv)
16{
17 return of_register_driver(drv, &of_platform_bus_type);
18}
19static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
20{
21 of_unregister_driver(drv);
22}
Benjamin Herrenschmidt7eebde72006-11-11 17:24:59 +110023
24/* Platform devices and busses creation */
25extern struct of_device *of_platform_device_create(struct device_node *np,
26 const char *bus_id,
27 struct device *parent);
28/* pseudo "matches" value to not do deep probe */
29#define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
30
31extern int of_platform_bus_probe(struct device_node *root,
Stephen Rothwellb91bdd12007-12-21 15:21:51 +110032 const struct of_device_id *matches,
Benjamin Herrenschmidt7eebde72006-11-11 17:24:59 +110033 struct device *parent);
34
Benjamin Herrenschmidt7eebde72006-11-11 17:24:59 +110035extern struct of_device *of_find_device_by_phandle(phandle ph);
Stephen Rothwellb41912c2007-05-01 16:12:57 +100036
David Gibson22258fa2008-01-11 14:25:34 +110037extern void of_instantiate_rtc(void);
38
Stephen Rothwellb41912c2007-05-01 16:12:57 +100039#endif /* _ASM_POWERPC_OF_PLATFORM_H */