Blame view

include/linux/of_address.h 1.52 KB
6b884a8d5   Grant Likely   of/address: merge...
1
2
3
  #ifndef __OF_ADDRESS_H
  #define __OF_ADDRESS_H
  #include <linux/ioport.h>
99ce39e35   Grant Likely   dt: include linux...
4
  #include <linux/errno.h>
6b884a8d5   Grant Likely   of/address: merge...
5
  #include <linux/of.h>
0131d8973   Sebastian Andrzej Siewior   of/address: use p...
6
  extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
1f5bef30c   Grant Likely   of/address: merge...
7
8
  extern int of_address_to_resource(struct device_node *dev, int index,
  				  struct resource *r);
90e33f62e   Grant Likely   of/address: Add o...
9
10
11
12
  extern struct device_node *of_find_matching_node_by_address(
  					struct device_node *from,
  					const struct of_device_id *matches,
  					u64 base_address);
6b884a8d5   Grant Likely   of/address: merge...
13
  extern void __iomem *of_iomap(struct device_node *device, int index);
22ae782f8   Grant Likely   of/address: Clean...
14
15
16
17
18
19
20
21
22
23
24
25
26
  /* Extract an address from a device, returns the region size and
   * the address space flags too. The PCI version uses a BAR number
   * instead of an absolute index
   */
  extern const u32 *of_get_address(struct device_node *dev, int index,
  			   u64 *size, unsigned int *flags);
  
  #ifndef pci_address_to_pio
  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
  #define pci_address_to_pio pci_address_to_pio
  #endif
  
  #ifdef CONFIG_PCI
0131d8973   Sebastian Andrzej Siewior   of/address: use p...
27
  extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
22ae782f8   Grant Likely   of/address: Clean...
28
29
30
31
32
33
34
35
36
  			       u64 *size, unsigned int *flags);
  extern int of_pci_address_to_resource(struct device_node *dev, int bar,
  				      struct resource *r);
  #else /* CONFIG_PCI */
  static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
  				             struct resource *r)
  {
  	return -ENOSYS;
  }
0131d8973   Sebastian Andrzej Siewior   of/address: use p...
37
  static inline const __be32 *of_get_pci_address(struct device_node *dev,
22ae782f8   Grant Likely   of/address: Clean...
38
39
40
41
42
  		int bar_no, u64 *size, unsigned int *flags)
  {
  	return NULL;
  }
  #endif /* CONFIG_PCI */
6b884a8d5   Grant Likely   of/address: merge...
43
  #endif /* __OF_ADDRESS_H */