blob: e5f5aedc2293e6b857ef0f5753050aa5c733bb91 [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
Stephen Rothwellb41912c2007-05-01 16:12:57 +100033/* These are just here during the transition */
Stephen Rothwellf898f8d2007-05-01 16:49:51 +100034#include <linux/of_device.h>
Stephen Rothwellb41912c2007-05-01 16:12:57 +100035#include <linux/of_platform.h>
David S. Millerfd531432006-06-23 15:55:17 -070036
37#endif /* __KERNEL__ */
38#endif /* _ASM_SPARC_OF_DEVICE_H */