blob: f320246a05863ddfd05d9e107e1aa85f12f24880 [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 dev;
18 struct resource resource[PROMREG_MAX];
David S. Miller8f96cd12006-06-29 15:08:02 -070019 unsigned int irqs[PROMINTR_MAX];
20 int num_irqs;
David S. Millercf44bbc2006-06-29 14:34:50 -070021
22 void *sysdata;
23
24 int slot;
25 int portid;
26 int clock_freq;
David S. Millerfd531432006-06-23 15:55:17 -070027};
David S. Millerfd531432006-06-23 15:55:17 -070028
David S. Miller3ca9fab2006-06-29 14:35:33 -070029extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
David S. Millere3a411a32006-12-28 21:01:32 -080030extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
David S. Miller3ca9fab2006-06-29 14:35:33 -070031
David S. Miller50596252008-08-27 04:22:37 -070032extern void of_propagate_archdata(struct of_device *bus);
33
Stephen Rothwelle3445682008-08-12 17:45:23 -070034/* This is just here during the transition */
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 */