diff options
-rw-r--r-- | arch/arm/mach-exynos/setup-spi.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/setup-spi.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/setup-spi.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5p64x0/setup-spi.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/setup-spi.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-spi.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | 8 | ||||
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 5 |
8 files changed, 19 insertions, 29 deletions
diff --git a/arch/arm/mach-exynos/setup-spi.c b/arch/arm/mach-exynos/setup-spi.c index a71ec4db4cf4..4999829d1c6e 100644 --- a/arch/arm/mach-exynos/setup-spi.c +++ b/arch/arm/mach-exynos/setup-spi.c | |||
@@ -9,12 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | 12 | #include <plat/gpio-cfg.h> |
15 | 13 | ||
16 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 14 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
17 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | 15 | int s3c64xx_spi0_cfg_gpio(void) |
18 | { | 16 | { |
19 | s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2)); | 17 | s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2)); |
20 | s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP); | 18 | s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP); |
@@ -25,7 +23,7 @@ int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | |||
25 | #endif | 23 | #endif |
26 | 24 | ||
27 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | 25 | #ifdef CONFIG_S3C64XX_DEV_SPI1 |
28 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | 26 | int s3c64xx_spi1_cfg_gpio(void) |
29 | { | 27 | { |
30 | s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2)); | 28 | s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2)); |
31 | s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP); | 29 | s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP); |
@@ -36,7 +34,7 @@ int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | |||
36 | #endif | 34 | #endif |
37 | 35 | ||
38 | #ifdef CONFIG_S3C64XX_DEV_SPI2 | 36 | #ifdef CONFIG_S3C64XX_DEV_SPI2 |
39 | int s3c64xx_spi2_cfg_gpio(struct platform_device *dev) | 37 | int s3c64xx_spi2_cfg_gpio(void) |
40 | { | 38 | { |
41 | s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5)); | 39 | s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5)); |
42 | s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP); | 40 | s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP); |
diff --git a/arch/arm/mach-s3c24xx/setup-spi.c b/arch/arm/mach-s3c24xx/setup-spi.c index 42abe157f98f..3d47e023ce94 100644 --- a/arch/arm/mach-s3c24xx/setup-spi.c +++ b/arch/arm/mach-s3c24xx/setup-spi.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <mach/regs-gpio.h> | 18 | #include <mach/regs-gpio.h> |
19 | 19 | ||
20 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 20 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
21 | int s3c64xx_spi0_cfg_gpio(struct platform_device *pdev) | 21 | int s3c64xx_spi0_cfg_gpio(void) |
22 | { | 22 | { |
23 | /* enable hsspi bit in misccr */ | 23 | /* enable hsspi bit in misccr */ |
24 | s3c2410_modify_misccr(S3C2416_MISCCR_HSSPI_EN2, 1); | 24 | s3c2410_modify_misccr(S3C2416_MISCCR_HSSPI_EN2, 1); |
diff --git a/arch/arm/mach-s3c64xx/setup-spi.c b/arch/arm/mach-s3c64xx/setup-spi.c index ff999d95b370..4dc53450d715 100644 --- a/arch/arm/mach-s3c64xx/setup-spi.c +++ b/arch/arm/mach-s3c64xx/setup-spi.c | |||
@@ -9,12 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | 12 | #include <plat/gpio-cfg.h> |
15 | 13 | ||
16 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 14 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
17 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | 15 | int s3c64xx_spi0_cfg_gpio(void) |
18 | { | 16 | { |
19 | s3c_gpio_cfgall_range(S3C64XX_GPC(0), 3, | 17 | s3c_gpio_cfgall_range(S3C64XX_GPC(0), 3, |
20 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | 18 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); |
@@ -23,7 +21,7 @@ int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | |||
23 | #endif | 21 | #endif |
24 | 22 | ||
25 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | 23 | #ifdef CONFIG_S3C64XX_DEV_SPI1 |
26 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | 24 | int s3c64xx_spi1_cfg_gpio(void) |
27 | { | 25 | { |
28 | s3c_gpio_cfgall_range(S3C64XX_GPC(4), 3, | 26 | s3c_gpio_cfgall_range(S3C64XX_GPC(4), 3, |
29 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | 27 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); |
diff --git a/arch/arm/mach-s5p64x0/setup-spi.c b/arch/arm/mach-s5p64x0/setup-spi.c index 1cf84b524698..7664356720ca 100644 --- a/arch/arm/mach-s5p64x0/setup-spi.c +++ b/arch/arm/mach-s5p64x0/setup-spi.c | |||
@@ -9,11 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/platform_device.h> | ||
13 | #include <plat/gpio-cfg.h> | 12 | #include <plat/gpio-cfg.h> |
14 | 13 | ||
15 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 14 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
16 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | 15 | int s3c64xx_spi0_cfg_gpio(void) |
17 | { | 16 | { |
18 | if (soc_is_s5p6450()) | 17 | if (soc_is_s5p6450()) |
19 | s3c_gpio_cfgall_range(S5P6450_GPC(0), 3, | 18 | s3c_gpio_cfgall_range(S5P6450_GPC(0), 3, |
@@ -26,7 +25,7 @@ int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | |||
26 | #endif | 25 | #endif |
27 | 26 | ||
28 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | 27 | #ifdef CONFIG_S3C64XX_DEV_SPI1 |
29 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | 28 | int s3c64xx_spi1_cfg_gpio(void) |
30 | { | 29 | { |
31 | if (soc_is_s5p6450()) | 30 | if (soc_is_s5p6450()) |
32 | s3c_gpio_cfgall_range(S5P6450_GPC(4), 3, | 31 | s3c_gpio_cfgall_range(S5P6450_GPC(4), 3, |
diff --git a/arch/arm/mach-s5pc100/setup-spi.c b/arch/arm/mach-s5pc100/setup-spi.c index 4b42718948a4..183567961de1 100644 --- a/arch/arm/mach-s5pc100/setup-spi.c +++ b/arch/arm/mach-s5pc100/setup-spi.c | |||
@@ -9,12 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | 12 | #include <plat/gpio-cfg.h> |
15 | 13 | ||
16 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 14 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
17 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | 15 | int s3c64xx_spi0_cfg_gpio(void) |
18 | { | 16 | { |
19 | s3c_gpio_cfgall_range(S5PC100_GPB(0), 3, | 17 | s3c_gpio_cfgall_range(S5PC100_GPB(0), 3, |
20 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | 18 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); |
@@ -23,7 +21,7 @@ int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | |||
23 | #endif | 21 | #endif |
24 | 22 | ||
25 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | 23 | #ifdef CONFIG_S3C64XX_DEV_SPI1 |
26 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | 24 | int s3c64xx_spi1_cfg_gpio(void) |
27 | { | 25 | { |
28 | s3c_gpio_cfgall_range(S5PC100_GPB(4), 3, | 26 | s3c_gpio_cfgall_range(S5PC100_GPB(4), 3, |
29 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | 27 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); |
@@ -32,7 +30,7 @@ int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | |||
32 | #endif | 30 | #endif |
33 | 31 | ||
34 | #ifdef CONFIG_S3C64XX_DEV_SPI2 | 32 | #ifdef CONFIG_S3C64XX_DEV_SPI2 |
35 | int s3c64xx_spi2_cfg_gpio(struct platform_device *dev) | 33 | int s3c64xx_spi2_cfg_gpio(void) |
36 | { | 34 | { |
37 | s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3)); | 35 | s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3)); |
38 | s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP); | 36 | s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP); |
diff --git a/arch/arm/mach-s5pv210/setup-spi.c b/arch/arm/mach-s5pv210/setup-spi.c index 2cd66a632791..81aecc162f82 100644 --- a/arch/arm/mach-s5pv210/setup-spi.c +++ b/arch/arm/mach-s5pv210/setup-spi.c | |||
@@ -9,12 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | 12 | #include <plat/gpio-cfg.h> |
15 | 13 | ||
16 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | 14 | #ifdef CONFIG_S3C64XX_DEV_SPI0 |
17 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | 15 | int s3c64xx_spi0_cfg_gpio(void) |
18 | { | 16 | { |
19 | s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2)); | 17 | s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2)); |
20 | s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP); | 18 | s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP); |
@@ -25,7 +23,7 @@ int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | |||
25 | #endif | 23 | #endif |
26 | 24 | ||
27 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | 25 | #ifdef CONFIG_S3C64XX_DEV_SPI1 |
28 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | 26 | int s3c64xx_spi1_cfg_gpio(void) |
29 | { | 27 | { |
30 | s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2)); | 28 | s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2)); |
31 | s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP); | 29 | s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP); |
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h index 4e9b9c314a29..89dbaee43800 100644 --- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h +++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | |||
@@ -39,7 +39,7 @@ struct s3c64xx_spi_csinfo { | |||
39 | struct s3c64xx_spi_info { | 39 | struct s3c64xx_spi_info { |
40 | int src_clk_nr; | 40 | int src_clk_nr; |
41 | int num_cs; | 41 | int num_cs; |
42 | int (*cfg_gpio)(struct platform_device *pdev); | 42 | int (*cfg_gpio)(void); |
43 | }; | 43 | }; |
44 | 44 | ||
45 | /** | 45 | /** |
@@ -60,9 +60,9 @@ extern void s3c64xx_spi2_set_platdata(struct s3c64xx_spi_info *pd, | |||
60 | int src_clk_nr, int num_cs); | 60 | int src_clk_nr, int num_cs); |
61 | 61 | ||
62 | /* defined by architecture to configure gpio */ | 62 | /* defined by architecture to configure gpio */ |
63 | extern int s3c64xx_spi0_cfg_gpio(struct platform_device *dev); | 63 | extern int s3c64xx_spi0_cfg_gpio(void); |
64 | extern int s3c64xx_spi1_cfg_gpio(struct platform_device *dev); | 64 | extern int s3c64xx_spi1_cfg_gpio(void); |
65 | extern int s3c64xx_spi2_cfg_gpio(struct platform_device *dev); | 65 | extern int s3c64xx_spi2_cfg_gpio(void); |
66 | 66 | ||
67 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; | 67 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; |
68 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; | 68 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; |
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 8698618e56fe..0a9e43e635aa 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -1071,7 +1071,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) | |||
1071 | goto err1; | 1071 | goto err1; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | if (sci->cfg_gpio == NULL || sci->cfg_gpio(pdev)) { | 1074 | if (sci->cfg_gpio == NULL || sci->cfg_gpio()) { |
1075 | dev_err(&pdev->dev, "Unable to config gpio\n"); | 1075 | dev_err(&pdev->dev, "Unable to config gpio\n"); |
1076 | ret = -EBUSY; | 1076 | ret = -EBUSY; |
1077 | goto err2; | 1077 | goto err2; |
@@ -1214,12 +1214,11 @@ static int s3c64xx_spi_suspend(struct device *dev) | |||
1214 | 1214 | ||
1215 | static int s3c64xx_spi_resume(struct device *dev) | 1215 | static int s3c64xx_spi_resume(struct device *dev) |
1216 | { | 1216 | { |
1217 | struct platform_device *pdev = to_platform_device(dev); | ||
1218 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); | 1217 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); |
1219 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); | 1218 | struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); |
1220 | struct s3c64xx_spi_info *sci = sdd->cntrlr_info; | 1219 | struct s3c64xx_spi_info *sci = sdd->cntrlr_info; |
1221 | 1220 | ||
1222 | sci->cfg_gpio(pdev); | 1221 | sci->cfg_gpio(); |
1223 | 1222 | ||
1224 | /* Enable the clock */ | 1223 | /* Enable the clock */ |
1225 | clk_enable(sdd->src_clk); | 1224 | clk_enable(sdd->src_clk); |