summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/of_iommu.h
blob: ffbe4707d4aa82f4ac898c6d0ca214d6a8227805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __OF_IOMMU_H
#define __OF_IOMMU_H

#include <linux/device.h>
#include <linux/iommu.h>
#include <linux/of.h>

#ifdef CONFIG_OF_IOMMU

extern int of_get_dma_window(struct device_node *dn, const char *prefix,
			     int index, unsigned long *busno, dma_addr_t *addr,
			     size_t *size);

extern void of_iommu_init(void);
extern struct iommu_ops *of_iommu_configure(struct device *dev,
					struct device_node *master_np);

#else

static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
			    int index, unsigned long *busno, dma_addr_t *addr,
			    size_t *size)
{
	return -EINVAL;
}

static inline void of_iommu_init(void) { }
static inline struct iommu_ops *of_iommu_configure(struct device *dev,
					 struct device_node *master_np)
{
	return NULL;
}

#endif	/* CONFIG_OF_IOMMU */

void of_iommu_set_ops(struct device_node *np, struct iommu_ops *ops);
struct iommu_ops *of_iommu_get_ops(struct device_node *np);

extern struct of_device_id __iommu_of_table;

typedef int (*of_iommu_init_fn)(struct device_node *);

#define IOMMU_OF_DECLARE(name, compat, fn) \
	_OF_DECLARE(iommu, name, compat, fn, of_iommu_init_fn)

#endif /* __OF_IOMMU_H */
.vendor = ISAPNP_VENDOR(_dva, _dvb, _dvc), .function = ISAPNP_FUNCTION(_dfunction) #define ISAPNP_DEVICE_SINGLE_END \ .card_vendor = 0, .card_device = 0 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) #define __ISAPNP__ /* lowlevel configuration */ int isapnp_present(void); int isapnp_cfg_begin(int csn, int device); int isapnp_cfg_end(void); unsigned char isapnp_read_byte(unsigned char idx); void isapnp_write_byte(unsigned char idx, unsigned char val); #ifdef CONFIG_PROC_FS int isapnp_proc_init(void); int isapnp_proc_done(void); #else static inline int isapnp_proc_init(void) { return 0; } static inline int isapnp_proc_done(void) { return 0; } #endif /* compat */ struct pnp_card *pnp_find_card(unsigned short vendor, unsigned short device, struct pnp_card *from); struct pnp_dev *pnp_find_dev(struct pnp_card *card, unsigned short vendor, unsigned short function, struct pnp_dev *from); #else /* !CONFIG_ISAPNP */ /* lowlevel configuration */ static inline int isapnp_present(void) { return 0; } static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; } static inline int isapnp_cfg_end(void) { return -ENODEV; } static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; } static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; } static inline struct pnp_card *pnp_find_card(unsigned short vendor, unsigned short device, struct pnp_card *from) { return NULL; } static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card, unsigned short vendor, unsigned short function, struct pnp_dev *from) { return NULL; } #endif /* CONFIG_ISAPNP */ #endif /* __KERNEL__ */ #endif /* LINUX_ISAPNP_H */