diff options
| -rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 22 | ||||
| -rw-r--r-- | include/linux/fsl_devices.h | 4 |
2 files changed, 9 insertions, 17 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index bdae9f908978..1b74d5ca03f3 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/types.h> | ||
| 16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 18 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
| @@ -30,8 +31,7 @@ | |||
| 30 | 31 | ||
| 31 | struct mpc52xx_psc_spi { | 32 | struct mpc52xx_psc_spi { |
| 32 | /* fsl_spi_platform data */ | 33 | /* fsl_spi_platform data */ |
| 33 | void (*activate_cs)(u8, u8); | 34 | void (*cs_control)(struct spi_device *spi, bool on); |
| 34 | void (*deactivate_cs)(u8, u8); | ||
| 35 | u32 sysclk; | 35 | u32 sysclk; |
| 36 | 36 | ||
| 37 | /* driver internal data */ | 37 | /* driver internal data */ |
| @@ -111,18 +111,16 @@ static void mpc52xx_psc_spi_activate_cs(struct spi_device *spi) | |||
| 111 | out_be16((u16 __iomem *)&psc->ccr, ccr); | 111 | out_be16((u16 __iomem *)&psc->ccr, ccr); |
| 112 | mps->bits_per_word = cs->bits_per_word; | 112 | mps->bits_per_word = cs->bits_per_word; |
| 113 | 113 | ||
| 114 | if (mps->activate_cs) | 114 | if (mps->cs_control) |
| 115 | mps->activate_cs(spi->chip_select, | 115 | mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0); |
| 116 | (spi->mode & SPI_CS_HIGH) ? 1 : 0); | ||
| 117 | } | 116 | } |
| 118 | 117 | ||
| 119 | static void mpc52xx_psc_spi_deactivate_cs(struct spi_device *spi) | 118 | static void mpc52xx_psc_spi_deactivate_cs(struct spi_device *spi) |
| 120 | { | 119 | { |
| 121 | struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); | 120 | struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); |
| 122 | 121 | ||
| 123 | if (mps->deactivate_cs) | 122 | if (mps->cs_control) |
| 124 | mps->deactivate_cs(spi->chip_select, | 123 | mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1); |
| 125 | (spi->mode & SPI_CS_HIGH) ? 1 : 0); | ||
| 126 | } | 124 | } |
| 127 | 125 | ||
| 128 | #define MPC52xx_PSC_BUFSIZE (MPC52xx_PSC_RFNUM_MASK + 1) | 126 | #define MPC52xx_PSC_BUFSIZE (MPC52xx_PSC_RFNUM_MASK + 1) |
| @@ -382,15 +380,13 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
| 382 | mps->irq = irq; | 380 | mps->irq = irq; |
| 383 | if (pdata == NULL) { | 381 | if (pdata == NULL) { |
| 384 | dev_warn(dev, "probe called without platform data, no " | 382 | dev_warn(dev, "probe called without platform data, no " |
| 385 | "(de)activate_cs function will be called\n"); | 383 | "cs_control function will be called\n"); |
| 386 | mps->activate_cs = NULL; | 384 | mps->cs_control = NULL; |
| 387 | mps->deactivate_cs = NULL; | ||
| 388 | mps->sysclk = 0; | 385 | mps->sysclk = 0; |
| 389 | master->bus_num = bus_num; | 386 | master->bus_num = bus_num; |
| 390 | master->num_chipselect = 255; | 387 | master->num_chipselect = 255; |
| 391 | } else { | 388 | } else { |
| 392 | mps->activate_cs = pdata->activate_cs; | 389 | mps->cs_control = pdata->cs_control; |
| 393 | mps->deactivate_cs = pdata->deactivate_cs; | ||
| 394 | mps->sysclk = pdata->sysclk; | 390 | mps->sysclk = pdata->sysclk; |
| 395 | master->bus_num = pdata->bus_num; | 391 | master->bus_num = pdata->bus_num; |
| 396 | master->num_chipselect = pdata->max_chipselect; | 392 | master->num_chipselect = pdata->max_chipselect; |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 244677cc082b..43fc95d822d5 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
| @@ -79,10 +79,6 @@ struct fsl_spi_platform_data { | |||
| 79 | u16 max_chipselect; | 79 | u16 max_chipselect; |
| 80 | void (*cs_control)(struct spi_device *spi, bool on); | 80 | void (*cs_control)(struct spi_device *spi, bool on); |
| 81 | u32 sysclk; | 81 | u32 sysclk; |
| 82 | |||
| 83 | /* Legacy hooks, used by mpc52xx_psc_spi driver. */ | ||
| 84 | void (*activate_cs)(u8 cs, u8 polarity); | ||
| 85 | void (*deactivate_cs)(u8 cs, u8 polarity); | ||
| 86 | }; | 82 | }; |
| 87 | 83 | ||
| 88 | struct mpc8xx_pcmcia_ops { | 84 | struct mpc8xx_pcmcia_ops { |
