diff options
-rw-r--r-- | arch/arm/mach-s5pc100/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/include/mach/map.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/setup-spi.c | 65 | ||||
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | 2 |
6 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index e538a4c67e9..75a26eaf263 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig | |||
@@ -45,6 +45,11 @@ config S5PC100_SETUP_SDHCI_GPIO | |||
45 | help | 45 | help |
46 | Common setup code for SDHCI gpio. | 46 | Common setup code for SDHCI gpio. |
47 | 47 | ||
48 | config S5PC100_SETUP_SPI | ||
49 | bool | ||
50 | help | ||
51 | Common setup code for SPI GPIO configurations. | ||
52 | |||
48 | config MACH_SMDKC100 | 53 | config MACH_SMDKC100 |
49 | bool "SMDKC100" | 54 | bool "SMDKC100" |
50 | select CPU_S5PC100 | 55 | select CPU_S5PC100 |
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile index 238a836b3f7..291e246c0ec 100644 --- a/arch/arm/mach-s5pc100/Makefile +++ b/arch/arm/mach-s5pc100/Makefile | |||
@@ -22,6 +22,7 @@ obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o | |||
22 | obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o | 22 | obj-$(CONFIG_S5PC100_SETUP_IDE) += setup-ide.o |
23 | obj-$(CONFIG_S5PC100_SETUP_KEYPAD) += setup-keypad.o | 23 | obj-$(CONFIG_S5PC100_SETUP_KEYPAD) += setup-keypad.o |
24 | obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 24 | obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
25 | obj-$(CONFIG_S5PC100_SETUP_SPI) += setup-spi.o | ||
25 | 26 | ||
26 | # device support | 27 | # device support |
27 | obj-y += dev-audio.o | 28 | obj-y += dev-audio.o |
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index ccbe6b767f7..54bc4f82e17 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
@@ -100,6 +100,9 @@ | |||
100 | #define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG | 100 | #define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG |
101 | #define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY | 101 | #define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY |
102 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG | 102 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG |
103 | #define S3C_PA_SPI0 S5PC100_PA_SPI0 | ||
104 | #define S3C_PA_SPI1 S5PC100_PA_SPI1 | ||
105 | #define S3C_PA_SPI2 S5PC100_PA_SPI2 | ||
103 | 106 | ||
104 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID | 107 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID |
105 | #define S5P_PA_FIMC0 S5PC100_PA_FIMC0 | 108 | #define S5P_PA_FIMC0 S5PC100_PA_FIMC0 |
diff --git a/arch/arm/mach-s5pc100/setup-spi.c b/arch/arm/mach-s5pc100/setup-spi.c new file mode 100644 index 00000000000..431a6f747ca --- /dev/null +++ b/arch/arm/mach-s5pc100/setup-spi.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* linux/arch/arm/mach-s5pc100/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 | .high_speed = 1, | ||
22 | .tx_st_done = 21, | ||
23 | }; | ||
24 | |||
25 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | ||
26 | { | ||
27 | s3c_gpio_cfgall_range(S5PC100_GPB(0), 3, | ||
28 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
29 | return 0; | ||
30 | } | ||
31 | #endif | ||
32 | |||
33 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | ||
34 | struct s3c64xx_spi_info s3c64xx_spi1_pdata __initdata = { | ||
35 | .fifo_lvl_mask = 0x7f, | ||
36 | .rx_lvl_offset = 13, | ||
37 | .high_speed = 1, | ||
38 | .tx_st_done = 21, | ||
39 | }; | ||
40 | |||
41 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | ||
42 | { | ||
43 | s3c_gpio_cfgall_range(S5PC100_GPB(4), 3, | ||
44 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
45 | return 0; | ||
46 | } | ||
47 | #endif | ||
48 | |||
49 | #ifdef CONFIG_S3C64XX_DEV_SPI2 | ||
50 | struct s3c64xx_spi_info s3c64xx_spi2_pdata __initdata = { | ||
51 | .fifo_lvl_mask = 0x7f, | ||
52 | .rx_lvl_offset = 13, | ||
53 | .high_speed = 1, | ||
54 | .tx_st_done = 21, | ||
55 | }; | ||
56 | |||
57 | int s3c64xx_spi2_cfg_gpio(struct platform_device *dev) | ||
58 | { | ||
59 | s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3)); | ||
60 | s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP); | ||
61 | s3c_gpio_cfgall_range(S5PC100_GPB(2), 2, | ||
62 | S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); | ||
63 | return 0; | ||
64 | } | ||
65 | #endif | ||
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 080ea18d3f9..de0d88d6a0f 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -1582,6 +1582,9 @@ void __init s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info *pd, | |||
1582 | 1582 | ||
1583 | pd->num_cs = num_cs; | 1583 | pd->num_cs = num_cs; |
1584 | pd->src_clk_nr = src_clk_nr; | 1584 | pd->src_clk_nr = src_clk_nr; |
1585 | if (!pd->cfg_gpio) | ||
1586 | pd->cfg_gpio = s3c64xx_spi2_cfg_gpio; | ||
1587 | |||
1585 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi2); | 1588 | s3c_set_platdata(pd, sizeof(*pd), &s3c64xx_device_spi2); |
1586 | } | 1589 | } |
1587 | #endif /* CONFIG_S3C64XX_DEV_SPI2 */ | 1590 | #endif /* CONFIG_S3C64XX_DEV_SPI2 */ |
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h index d3e2209c809..aea68b60ef9 100644 --- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | |||
@@ -75,7 +75,9 @@ extern void s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info *pd, | |||
75 | /* defined by architecture to configure gpio */ | 75 | /* defined by architecture to configure gpio */ |
76 | extern int s3c64xx_spi0_cfg_gpio(struct platform_device *dev); | 76 | extern int s3c64xx_spi0_cfg_gpio(struct platform_device *dev); |
77 | extern int s3c64xx_spi1_cfg_gpio(struct platform_device *dev); | 77 | extern int s3c64xx_spi1_cfg_gpio(struct platform_device *dev); |
78 | extern int s3c64xx_spi2_cfg_gpio(struct platform_device *dev); | ||
78 | 79 | ||
79 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; | 80 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; |
80 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; | 81 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; |
82 | extern struct s3c64xx_spi_info s3c64xx_spi2_pdata; | ||
81 | #endif /* __S3C64XX_PLAT_SPI_H */ | 83 | #endif /* __S3C64XX_PLAT_SPI_H */ |