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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/pasemi/misc.c

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/platforms/pasemi/misc.c (Version linux-6.12-rc7) and /arch/i386/platforms/pasemi/misc.c (Version linux-6.1.116)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  * Copyright (C) 2007 PA Semi, Inc                
  4  *                                                
  5  * Parts based on arch/powerpc/sysdev/fsl_soc.    
  6  *                                                
  7  * 2006 (c) MontaVista Software, Inc.             
  8  */                                               
  9                                                   
 10 #include <linux/errno.h>                          
 11 #include <linux/kernel.h>                         
 12 #include <linux/pci.h>                            
 13 #include <linux/of.h>                             
 14 #include <linux/of_irq.h>                         
 15 #include <linux/i2c.h>                            
 16                                                   
 17 #ifdef CONFIG_I2C_BOARDINFO                       
 18 /* The below is from fsl_soc.c.  It's copied b    
 19  * official bus bindings at this time it doesn    
 20  * the platforms, even though they happen to b    
 21  */                                               
 22 struct i2c_driver_device {                        
 23         char    *of_device;                       
 24         char    *i2c_type;                        
 25 };                                                
 26                                                   
 27 static struct i2c_driver_device i2c_devices[]     
 28         {"dallas,ds1338",  "ds1338"},             
 29 };                                                
 30                                                   
 31 static int __init find_i2c_driver(struct devic    
 32                                      struct i2    
 33 {                                                 
 34         int i;                                    
 35                                                   
 36         for (i = 0; i < ARRAY_SIZE(i2c_devices    
 37                 if (!of_device_is_compatible(n    
 38                         continue;                 
 39                 if (strscpy(info->type, i2c_de    
 40                         return -ENOMEM;           
 41                 return 0;                         
 42         }                                         
 43         return -ENODEV;                           
 44 }                                                 
 45                                                   
 46 static int __init pasemi_register_i2c_devices(    
 47 {                                                 
 48         struct pci_dev *pdev;                     
 49         struct device_node *adap_node;            
 50         struct device_node *node;                 
 51                                                   
 52         pdev = NULL;                              
 53         while ((pdev = pci_get_device(PCI_VEND    
 54                 adap_node = pci_device_to_OF_n    
 55                                                   
 56                 if (!adap_node)                   
 57                         continue;                 
 58                                                   
 59                 for_each_child_of_node(adap_no    
 60                         struct i2c_board_info     
 61                         const u32 *addr;          
 62                         int len;                  
 63                                                   
 64                         addr = of_get_property    
 65                         if (!addr || len < siz    
 66                             *addr > (1 << 10)     
 67                                 pr_warn("pasem    
 68                                 continue;         
 69                         }                         
 70                                                   
 71                         info.irq = irq_of_pars    
 72                         if (!info.irq)            
 73                                 info.irq = -1;    
 74                                                   
 75                         if (find_i2c_driver(no    
 76                                 continue;         
 77                                                   
 78                         info.addr = *addr;        
 79                                                   
 80                         i2c_register_board_inf    
 81                                                   
 82                 }                                 
 83         }                                         
 84         return 0;                                 
 85 }                                                 
 86 device_initcall(pasemi_register_i2c_devices);     
 87 #endif                                            
 88                                                   

~ [ 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