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

TOMOYO Linux Cross Reference
Linux/arch/arm/plat-samsung/platformdata.c

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* linux/arch/arm/plat-samsung/platformdata.c
  2  *
  3  * Copyright 2010 Ben Dooks <ben-linux <at> fluff.org>
  4  *
  5  * Helper for platform data setting
  6  *
  7  * This program is free software; you can redistribute it and/or modify
  8  * it under the terms of the GNU General Public License version 2 as
  9  * published by the Free Software Foundation.
 10 */
 11 
 12 #include <linux/kernel.h>
 13 #include <linux/slab.h>
 14 #include <linux/string.h>
 15 #include <linux/platform_device.h>
 16 
 17 #include <plat/devs.h>
 18 #include <plat/sdhci.h>
 19 
 20 void __init *s3c_set_platdata(void *pd, size_t pdsize,
 21                               struct platform_device *pdev)
 22 {
 23         void *npd;
 24 
 25         if (!pd) {
 26                 /* too early to use dev_name(), may not be registered */
 27                 printk(KERN_ERR "%s: no platform data supplied\n", pdev->name);
 28                 return NULL;
 29         }
 30 
 31         npd = kmemdup(pd, pdsize, GFP_KERNEL);
 32         if (!npd) {
 33                 printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name);
 34                 return NULL;
 35         }
 36 
 37         pdev->dev.platform_data = npd;
 38         return npd;
 39 }
 40 
 41 void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
 42                              struct s3c_sdhci_platdata *set)
 43 {
 44         set->cd_type = pd->cd_type;
 45         set->ext_cd_init = pd->ext_cd_init;
 46         set->ext_cd_cleanup = pd->ext_cd_cleanup;
 47         set->ext_cd_gpio = pd->ext_cd_gpio;
 48         set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
 49 
 50         if (pd->max_width)
 51                 set->max_width = pd->max_width;
 52         if (pd->cfg_gpio)
 53                 set->cfg_gpio = pd->cfg_gpio;
 54         if (pd->host_caps)
 55                 set->host_caps |= pd->host_caps;
 56         if (pd->host_caps2)
 57                 set->host_caps2 |= pd->host_caps2;
 58         if (pd->pm_caps)
 59                 set->pm_caps |= pd->pm_caps;
 60 }
 61 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp