diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c64xx/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/include/mach/map.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/setup-spi.c | 45 | ||||
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | 7 |
6 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 5552e048c2be..43881862c22c 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
@@ -77,6 +77,11 @@ config S3C64XX_SETUP_SDHCI_GPIO | |||
77 | help | 77 | help |
78 | Common setup code for S3C64XX SDHCI GPIO configurations | 78 | Common setup code for S3C64XX SDHCI GPIO configurations |
79 | 79 | ||
80 | config S3C64XX_SETUP_SPI | ||
81 | bool | ||
82 | help | ||
83 | Common setup code for SPI GPIO configurations | ||
84 | |||
80 | # S36400 Macchine support | 85 | # S36400 Macchine support |
81 | 86 | ||
82 | config MACH_SMDK6400 | 87 | config MACH_SMDK6400 |
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index d1d0f09f3b30..d7d9bb5dfb72 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile | |||
@@ -34,6 +34,7 @@ obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o | |||
34 | obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o | 34 | obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o |
35 | obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o | 35 | obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o |
36 | obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 36 | obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
37 | obj-$(CONFIG_S3C64XX_SETUP_SPI) += setup-spi.o | ||
37 | 38 | ||
38 | # PM | 39 | # PM |
39 | 40 | ||
diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h index 23a1d71e4d53..8e2097bb208a 100644 --- a/arch/arm/mach-s3c64xx/include/mach/map.h +++ b/arch/arm/mach-s3c64xx/include/mach/map.h | |||
@@ -115,6 +115,8 @@ | |||
115 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG | 115 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG |
116 | #define S3C_PA_RTC S3C64XX_PA_RTC | 116 | #define S3C_PA_RTC S3C64XX_PA_RTC |
117 | #define S3C_PA_WDT S3C64XX_PA_WATCHDOG | 117 | #define S3C_PA_WDT S3C64XX_PA_WATCHDOG |
118 | #define S3C_PA_SPI0 S3C64XX_PA_SPI0 | ||
119 | #define S3C_PA_SPI1 S3C64XX_PA_SPI1 | ||
118 | 120 | ||
119 | #define SAMSUNG_PA_ADC S3C64XX_PA_ADC | 121 | #define SAMSUNG_PA_ADC S3C64XX_PA_ADC |
120 | #define SAMSUNG_PA_CFCON S3C64XX_PA_CFCON | 122 | #define SAMSUNG_PA_CFCON S3C64XX_PA_CFCON |
diff --git a/arch/arm/mach-s3c64xx/setup-spi.c b/arch/arm/mach-s3c64xx/setup-spi.c new file mode 100644 index 000000000000..d9592ad7a825 --- /dev/null +++ b/arch/arm/mach-s3c64xx/setup-spi.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* linux/arch/arm/mach-s3c64xx/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 | |||
11 | #include <linux/gpio.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | ||
15 | #include <plat/s3c64xx-spi.h> | ||
16 | |||
17 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | ||
18 | struct s3c64xx_spi_info s3c64xx_spi0_pdata __initdata = { | ||
19 | .fifo_lvl_mask = 0x7f, | ||
20 | .rx_lvl_offset = 13, | ||
21 | .tx_st_done = 21, | ||
22 | }; | ||
23 | |||
24 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | ||
25 | { | ||
26 | s3c_gpio_cfgall_range(S3C64XX_GPC(0), 3, | ||
27 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
28 | return 0; | ||
29 | } | ||
30 | #endif | ||
31 | |||
32 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | ||
33 | struct s3c64xx_spi_info s3c64xx_spi1_pdata __initdata = { | ||
34 | .fifo_lvl_mask = 0x7f, | ||
35 | .rx_lvl_offset = 13, | ||
36 | .tx_st_done = 21, | ||
37 | }; | ||
38 | |||
39 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | ||
40 | { | ||
41 | s3c_gpio_cfgall_range(S3C64XX_GPC(4), 3, | ||
42 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
43 | return 0; | ||
44 | } | ||
45 | #endif | ||
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 8b27e61d0345..080ea18d3f94 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -1498,6 +1498,9 @@ void __init s3c64xx_spi0_set_platdata(struct s3c64xx_spi_info *pd, | |||
1498 | 1498 | ||
1499 | pd->num_cs = num_cs; | 1499 | pd->num_cs = num_cs; |
1500 | pd->src_clk_nr = src_clk_nr; | 1500 | pd->src_clk_nr = src_clk_nr; |
1501 | if (!pd->cfg_gpio) | ||
1502 | pd->cfg_gpio = s3c64xx_spi0_cfg_gpio; | ||
1503 | |||
1501 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi0); | 1504 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi0); |
1502 | } | 1505 | } |
1503 | #endif /* CONFIG_S3C64XX_DEV_SPI0 */ | 1506 | #endif /* CONFIG_S3C64XX_DEV_SPI0 */ |
@@ -1537,6 +1540,9 @@ void __init s3c64xx_spi1_set_platdata(struct s3c64xx_spi_info *pd, | |||
1537 | 1540 | ||
1538 | pd->num_cs = num_cs; | 1541 | pd->num_cs = num_cs; |
1539 | pd->src_clk_nr = src_clk_nr; | 1542 | pd->src_clk_nr = src_clk_nr; |
1543 | if (!pd->cfg_gpio) | ||
1544 | pd->cfg_gpio = s3c64xx_spi1_cfg_gpio; | ||
1545 | |||
1540 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi1); | 1546 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi1); |
1541 | } | 1547 | } |
1542 | #endif /* CONFIG_S3C64XX_DEV_SPI1 */ | 1548 | #endif /* CONFIG_S3C64XX_DEV_SPI1 */ |
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h index effca5394d19..d3e2209c8099 100644 --- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | |||
@@ -71,4 +71,11 @@ extern void s3c64xx_spi1_set_platdata(struct s3c64xx_spi_info *pd, | |||
71 | int src_clk_nr, int num_cs); | 71 | int src_clk_nr, int num_cs); |
72 | extern void s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info *pd, | 72 | extern void s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info *pd, |
73 | int src_clk_nr, int num_cs); | 73 | int src_clk_nr, int num_cs); |
74 | |||
75 | /* defined by architecture to configure gpio */ | ||
76 | extern int s3c64xx_spi0_cfg_gpio(struct platform_device *dev); | ||
77 | extern int s3c64xx_spi1_cfg_gpio(struct platform_device *dev); | ||
78 | |||
79 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; | ||
80 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; | ||
74 | #endif /* __S3C64XX_PLAT_SPI_H */ | 81 | #endif /* __S3C64XX_PLAT_SPI_H */ |