diff options
Diffstat (limited to 'drivers/spi/spi_mpc83xx.c')
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index df6420029004..b95085a46f90 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -89,9 +89,6 @@ struct mpc83xx_spi { | |||
89 | 89 | ||
90 | bool qe_mode; | 90 | bool qe_mode; |
91 | 91 | ||
92 | void (*activate_cs) (u8 cs, u8 polarity); | ||
93 | void (*deactivate_cs) (u8 cs, u8 polarity); | ||
94 | |||
95 | u8 busy; | 92 | u8 busy; |
96 | 93 | ||
97 | struct workqueue_struct *workqueue; | 94 | struct workqueue_struct *workqueue; |
@@ -153,15 +150,14 @@ MPC83XX_SPI_TX_BUF(u32) | |||
153 | 150 | ||
154 | static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | 151 | static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) |
155 | { | 152 | { |
156 | struct mpc83xx_spi *mpc83xx_spi; | 153 | struct mpc83xx_spi *mpc83xx_spi = spi_master_get_devdata(spi->master); |
157 | u8 pol = spi->mode & SPI_CS_HIGH ? 1 : 0; | 154 | struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data; |
155 | bool pol = spi->mode & SPI_CS_HIGH; | ||
158 | struct spi_mpc83xx_cs *cs = spi->controller_state; | 156 | struct spi_mpc83xx_cs *cs = spi->controller_state; |
159 | 157 | ||
160 | mpc83xx_spi = spi_master_get_devdata(spi->master); | ||
161 | |||
162 | if (value == BITBANG_CS_INACTIVE) { | 158 | if (value == BITBANG_CS_INACTIVE) { |
163 | if (mpc83xx_spi->deactivate_cs) | 159 | if (pdata->cs_control) |
164 | mpc83xx_spi->deactivate_cs(spi->chip_select, pol); | 160 | pdata->cs_control(spi, !pol); |
165 | } | 161 | } |
166 | 162 | ||
167 | if (value == BITBANG_CS_ACTIVE) { | 163 | if (value == BITBANG_CS_ACTIVE) { |
@@ -186,8 +182,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
186 | mpc83xx_spi_write_reg(mode, regval); | 182 | mpc83xx_spi_write_reg(mode, regval); |
187 | local_irq_restore(flags); | 183 | local_irq_restore(flags); |
188 | } | 184 | } |
189 | if (mpc83xx_spi->activate_cs) | 185 | if (pdata->cs_control) |
190 | mpc83xx_spi->activate_cs(spi->chip_select, pol); | 186 | pdata->cs_control(spi, pol); |
191 | } | 187 | } |
192 | } | 188 | } |
193 | 189 | ||
@@ -582,8 +578,6 @@ static int __init mpc83xx_spi_probe(struct platform_device *dev) | |||
582 | master->cleanup = mpc83xx_spi_cleanup; | 578 | master->cleanup = mpc83xx_spi_cleanup; |
583 | 579 | ||
584 | mpc83xx_spi = spi_master_get_devdata(master); | 580 | mpc83xx_spi = spi_master_get_devdata(master); |
585 | mpc83xx_spi->activate_cs = pdata->activate_cs; | ||
586 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; | ||
587 | mpc83xx_spi->qe_mode = pdata->qe_mode; | 581 | mpc83xx_spi->qe_mode = pdata->qe_mode; |
588 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; | 582 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; |
589 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; | 583 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; |