diff options
author | Mark Brown <broonie@linaro.org> | 2014-01-24 14:00:55 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-04 07:49:10 -0500 |
commit | 4ddc86005b1266b81c7b1b574a2402d3d8deda44 (patch) | |
tree | 5b68d70e5191616e235ee569adb990c34170267b | |
parent | 99adef310f682d6343cb40c1f6c9c25a4b3a450d (diff) |
spi/s3c64xx: Remove unused /CS GPIO management
The GPIO enable and disable is done in the core so does not need to be
replicated in the driver, delete the unneeded code. enable_cs() was not
referenced at all.
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index ae907dde1371..da32cd9c9b59 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -555,23 +555,6 @@ static void enable_datapath(struct s3c64xx_spi_driver_data *sdd, | |||
555 | writel(chcfg, regs + S3C64XX_SPI_CH_CFG); | 555 | writel(chcfg, regs + S3C64XX_SPI_CH_CFG); |
556 | } | 556 | } |
557 | 557 | ||
558 | static inline void enable_cs(struct s3c64xx_spi_driver_data *sdd, | ||
559 | struct spi_device *spi) | ||
560 | { | ||
561 | if (sdd->tgl_spi != NULL) { /* If last device toggled after mssg */ | ||
562 | if (sdd->tgl_spi != spi) { /* if last mssg on diff device */ | ||
563 | /* Deselect the last toggled device */ | ||
564 | if (spi->cs_gpio >= 0) | ||
565 | gpio_set_value(spi->cs_gpio, | ||
566 | spi->mode & SPI_CS_HIGH ? 0 : 1); | ||
567 | } | ||
568 | sdd->tgl_spi = NULL; | ||
569 | } | ||
570 | |||
571 | if (spi->cs_gpio >= 0) | ||
572 | gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH ? 1 : 0); | ||
573 | } | ||
574 | |||
575 | static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd, | 558 | static u32 s3c64xx_spi_wait_for_timeout(struct s3c64xx_spi_driver_data *sdd, |
576 | int timeout_ms) | 559 | int timeout_ms) |
577 | { | 560 | { |
@@ -691,16 +674,6 @@ static int wait_for_xfer(struct s3c64xx_spi_driver_data *sdd, | |||
691 | return 0; | 674 | return 0; |
692 | } | 675 | } |
693 | 676 | ||
694 | static inline void disable_cs(struct s3c64xx_spi_driver_data *sdd, | ||
695 | struct spi_device *spi) | ||
696 | { | ||
697 | if (sdd->tgl_spi == spi) | ||
698 | sdd->tgl_spi = NULL; | ||
699 | |||
700 | if (spi->cs_gpio >= 0) | ||
701 | gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH ? 0 : 1); | ||
702 | } | ||
703 | |||
704 | static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) | 677 | static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) |
705 | { | 678 | { |
706 | void __iomem *regs = sdd->regs; | 679 | void __iomem *regs = sdd->regs; |
@@ -1092,14 +1065,12 @@ static int s3c64xx_spi_setup(struct spi_device *spi) | |||
1092 | 1065 | ||
1093 | pm_runtime_put(&sdd->pdev->dev); | 1066 | pm_runtime_put(&sdd->pdev->dev); |
1094 | writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); | 1067 | writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); |
1095 | disable_cs(sdd, spi); | ||
1096 | return 0; | 1068 | return 0; |
1097 | 1069 | ||
1098 | setup_exit: | 1070 | setup_exit: |
1099 | pm_runtime_put(&sdd->pdev->dev); | 1071 | pm_runtime_put(&sdd->pdev->dev); |
1100 | /* setup() returns with device de-selected */ | 1072 | /* setup() returns with device de-selected */ |
1101 | writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); | 1073 | writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); |
1102 | disable_cs(sdd, spi); | ||
1103 | 1074 | ||
1104 | gpio_free(cs->line); | 1075 | gpio_free(cs->line); |
1105 | spi_set_ctldata(spi, NULL); | 1076 | spi_set_ctldata(spi, NULL); |