setup-spi.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* linux/arch/arm/mach-exynos4/setup-spi.c
  2. *
  3. * Copyright (C) 2011 Samsung Electronics Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/gpio.h>
  11. #include <linux/platform_device.h>
  12. #include <plat/gpio-cfg.h>
  13. #ifdef CONFIG_S3C64XX_DEV_SPI0
  14. int s3c64xx_spi0_cfg_gpio(struct platform_device *dev)
  15. {
  16. s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2));
  17. s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP);
  18. s3c_gpio_cfgall_range(EXYNOS4_GPB(2), 2,
  19. S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
  20. return 0;
  21. }
  22. #endif
  23. #ifdef CONFIG_S3C64XX_DEV_SPI1
  24. int s3c64xx_spi1_cfg_gpio(struct platform_device *dev)
  25. {
  26. s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2));
  27. s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP);
  28. s3c_gpio_cfgall_range(EXYNOS4_GPB(6), 2,
  29. S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
  30. return 0;
  31. }
  32. #endif
  33. #ifdef CONFIG_S3C64XX_DEV_SPI2
  34. int s3c64xx_spi2_cfg_gpio(struct platform_device *dev)
  35. {
  36. s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5));
  37. s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP);
  38. s3c_gpio_cfgall_range(EXYNOS4_GPC1(3), 2,
  39. S3C_GPIO_SFN(5), S3C_GPIO_PULL_UP);
  40. return 0;
  41. }
  42. #endif