blob: a5d9811f9697734863510a8b1c7336d228ac45ab [file] [log] [blame]
David S. Millerfd531432006-06-23 15:55:17 -07001#ifndef _ASM_SPARC_OF_DEVICE_H
2#define _ASM_SPARC_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
Stephen Rothwellf898f8d2007-05-01 16:49:51 +10006#include <linux/of.h>
David S. Millerfd531432006-06-23 15:55:17 -07007#include <linux/mod_devicetable.h>
David S. Millercf44bbc2006-06-29 14:34:50 -07008#include <asm/openprom.h>
David S. Millerfd531432006-06-23 15:55:17 -07009
David S. Millerfd531432006-06-23 15:55:17 -070010/*
11 * The of_device is a kind of "base class" that is a superset of
12 * struct device for use by devices attached to an OF node and
13 * probed using OF properties.
14 */
15struct of_device
16{
David S. Millercf44bbc2006-06-29 14:34:50 -070017 struct device_node *node;
18 struct device dev;
19 struct resource resource[PROMREG_MAX];
David S. Miller8f96cd12006-06-29 15:08:02 -070020 unsigned int irqs[PROMINTR_MAX];
21 int num_irqs;
David S. Millercf44bbc2006-06-29 14:34:50 -070022
23 void *sysdata;
24
25 int slot;
26 int portid;
27 int clock_freq;
David S. Millerfd531432006-06-23 15:55:17 -070028};
David S. Millerfd531432006-06-23 15:55:17 -070029
David S. Miller3ca9fab2006-06-29 14:35:33 -070030extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
David S. Millere3a411a32006-12-28 21:01:32 -080031extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
David S. Miller3ca9fab2006-06-29 14:35:33 -070032
David S. Miller50596252008-08-27 04:22:37 -070033extern void of_propagate_archdata(struct of_device *bus);
34
Stephen Rothwelle3445682008-08-12 17:45:23 -070035/* This is just here during the transition */
Stephen Rothwellb41912c2007-05-01 16:12:57 +100036#include <linux/of_platform.h>
David S. Millerfd531432006-06-23 15:55:17 -070037
38#endif /* __KERNEL__ */
39#endif /* _ASM_SPARC_OF_DEVICE_H */