~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/macio.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/powerpc/include/asm/macio.h (Architecture ppc) and /arch/mips/include/asm-mips/macio.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef __MACIO_ASIC_H__                          
  3 #define __MACIO_ASIC_H__                          
  4 #ifdef __KERNEL__                                 
  5                                                   
  6 #include <linux/of.h>                             
  7 #include <linux/platform_device.h>                
  8                                                   
  9 extern const struct bus_type macio_bus_type;      
 10                                                   
 11 /* MacIO device driver is defined later */        
 12 struct macio_driver;                              
 13 struct macio_chip;                                
 14                                                   
 15 #define MACIO_DEV_COUNT_RESOURCES       8         
 16 #define MACIO_DEV_COUNT_IRQS            8         
 17                                                   
 18 /*                                                
 19  * the macio_bus structure is used to describe    
 20  * within a MacIO ASIC. It's typically provide    
 21  * PCI device, but could be provided different    
 22  * machines using a fake OF tree).                
 23  *                                                
 24  * The pdev field can be NULL on non-PCI machi    
 25  */                                               
 26 struct macio_bus                                  
 27 {                                                 
 28         struct macio_chip       *chip;            
 29         int                     index;            
 30 #ifdef CONFIG_PCI                                 
 31         struct pci_dev          *pdev;            
 32 #endif                                            
 33 };                                                
 34                                                   
 35 /*                                                
 36  * the macio_dev structure is used to describe    
 37  * within an Apple MacIO ASIC.                    
 38  */                                               
 39 struct macio_dev                                  
 40 {                                                 
 41         struct macio_bus        *bus;             
 42         struct macio_dev        *media_bay;       
 43         struct platform_device  ofdev;            
 44         struct device_dma_parameters dma_parms    
 45         int                     n_resources;      
 46         struct resource         resource[MACIO    
 47         int                     n_interrupts;     
 48         struct resource         interrupt[MACI    
 49 };                                                
 50 #define to_macio_device(d) container_of(d, str    
 51 #define of_to_macio_device(d) container_of(d,     
 52                                                   
 53 extern struct macio_dev *macio_dev_get(struct     
 54 extern void macio_dev_put(struct macio_dev *de    
 55                                                   
 56 /*                                                
 57  * Accessors to resources & interrupts and oth    
 58  * fields                                         
 59  */                                               
 60                                                   
 61 static inline int macio_resource_count(struct     
 62 {                                                 
 63         return dev->n_resources;                  
 64 }                                                 
 65                                                   
 66 static inline unsigned long macio_resource_sta    
 67 {                                                 
 68         return dev->resource[resource_no].star    
 69 }                                                 
 70                                                   
 71 static inline unsigned long macio_resource_end    
 72 {                                                 
 73         return dev->resource[resource_no].end;    
 74 }                                                 
 75                                                   
 76 static inline unsigned long macio_resource_len    
 77 {                                                 
 78         struct resource *res = &dev->resource[    
 79         if (res->start == 0 || res->end == 0 |    
 80                 return 0;                         
 81         return resource_size(res);                
 82 }                                                 
 83                                                   
 84 extern int macio_enable_devres(struct macio_de    
 85                                                   
 86 extern int macio_request_resource(struct macio    
 87 extern void macio_release_resource(struct maci    
 88 extern int macio_request_resources(struct maci    
 89 extern void macio_release_resources(struct mac    
 90                                                   
 91 static inline int macio_irq_count(struct macio    
 92 {                                                 
 93         return dev->n_interrupts;                 
 94 }                                                 
 95                                                   
 96 static inline int macio_irq(struct macio_dev *    
 97 {                                                 
 98         return dev->interrupt[irq_no].start;      
 99 }                                                 
100                                                   
101 static inline void macio_set_drvdata(struct ma    
102 {                                                 
103         dev_set_drvdata(&dev->ofdev.dev, data)    
104 }                                                 
105                                                   
106 static inline void* macio_get_drvdata(struct m    
107 {                                                 
108         return dev_get_drvdata(&dev->ofdev.dev    
109 }                                                 
110                                                   
111 static inline struct device_node *macio_get_of    
112 {                                                 
113         return mdev->ofdev.dev.of_node;           
114 }                                                 
115                                                   
116 #ifdef CONFIG_PCI                                 
117 static inline struct pci_dev *macio_get_pci_de    
118 {                                                 
119         return mdev->bus->pdev;                   
120 }                                                 
121 #endif                                            
122                                                   
123 /*                                                
124  * A driver for a mac-io chip based device        
125  */                                               
126 struct macio_driver                               
127 {                                                 
128         int     (*probe)(struct macio_dev* dev    
129         void    (*remove)(struct macio_dev *de    
130                                                   
131         int     (*suspend)(struct macio_dev* d    
132         int     (*resume)(struct macio_dev* de    
133         int     (*shutdown)(struct macio_dev*     
134                                                   
135 #ifdef CONFIG_PMAC_MEDIABAY                       
136         void    (*mediabay_event)(struct macio    
137 #endif                                            
138         struct device_driver    driver;           
139 };                                                
140 #define to_macio_driver(drv) container_of(drv,    
141                                                   
142 extern int macio_register_driver(struct macio_    
143 extern void macio_unregister_driver(struct mac    
144                                                   
145 #endif /* __KERNEL__ */                           
146 #endif /* __MACIO_ASIC_H__ */                     
147                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php