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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-s5pc100/setup-sdhci-gpio.c

Version: ~ [ linux-5.13-rc7 ] ~ [ linux-5.12.12 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.45 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.127 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.195 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.237 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.273 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.273 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* linux/arch/arm/plat-s5pc100/setup-sdhci-gpio.c
  2  *
  3  * Copyright 2009 Samsung Eletronics
  4  *
  5  * S5PC100 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
  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/types.h>
 14 #include <linux/interrupt.h>
 15 #include <linux/platform_device.h>
 16 #include <linux/io.h>
 17 #include <linux/gpio.h>
 18 #include <linux/mmc/host.h>
 19 #include <linux/mmc/card.h>
 20 
 21 #include <plat/gpio-cfg.h>
 22 #include <plat/sdhci.h>
 23 
 24 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
 25 {
 26         struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
 27         unsigned int num;
 28 
 29         num = width;
 30         /* In case of 8 width, we should decrease the 2 */
 31         if (width == 8)
 32                 num = width - 2;
 33 
 34         /* Set all the necessary GPG0/GPG1 pins to special-function 0 */
 35         s3c_gpio_cfgrange_nopull(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));
 36 
 37         if (width == 8)
 38                 s3c_gpio_cfgrange_nopull(S5PC100_GPG1(0), 2, S3C_GPIO_SFN(2));
 39 
 40         if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
 41                 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
 42                 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
 43         }
 44 }
 45 
 46 void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
 47 {
 48         struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
 49 
 50         /* Set all the necessary GPG2 pins to special-function 2 */
 51         s3c_gpio_cfgrange_nopull(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
 52 
 53         if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
 54                 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
 55                 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
 56         }
 57 }
 58 
 59 void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
 60 {
 61         struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
 62 
 63         /* Set all the necessary GPG3 pins to special-function 2 */
 64         s3c_gpio_cfgrange_nopull(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
 65 
 66         if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
 67                 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
 68                 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
 69         }
 70 }
 71 

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