Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139215
b: refs/heads/master
c: 34c8a20
h: refs/heads/master
i:
  139213: f6aa2b2
  139211: 1f3bf55
  139207: d30a188
  139199: d4b2b6f
v: v3
  • Loading branch information
Anton Vorontsov authored and Linus Torvalds committed Apr 1, 2009
1 parent b190650 commit 701de72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3b1b1cbf002e65a3cabd479e68b5f35886a26db
refs/heads/master: 34c8a20c6ee6af25ee35da9ca15ba81faacfc73d
16 changes: 9 additions & 7 deletions trunk/drivers/spi/spi_mpc83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
}

#define MPC83XX_SPI_RX_BUF(type) \
static \
void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
{ \
type * rx = mpc83xx_spi->rx; \
Expand All @@ -131,6 +132,7 @@ void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
}

#define MPC83XX_SPI_TX_BUF(type) \
static \
u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \
{ \
u32 data; \
Expand Down Expand Up @@ -172,16 +174,16 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)

if (cs->hw_mode != regval) {
unsigned long flags;
void *tmp_ptr = &mpc83xx_spi->base->mode;
__be32 __iomem *mode = &mpc83xx_spi->base->mode;

regval = cs->hw_mode;
/* Turn off IRQs locally to minimize time that
* SPI is disabled
*/
local_irq_save(flags);
/* Turn off SPI unit prior changing mode */
mpc83xx_spi_write_reg(tmp_ptr, regval & ~SPMODE_ENABLE);
mpc83xx_spi_write_reg(tmp_ptr, regval);
mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
mpc83xx_spi_write_reg(mode, regval);
local_irq_restore(flags);
}
if (mpc83xx_spi->activate_cs)
Expand Down Expand Up @@ -284,16 +286,16 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
if (cs->hw_mode != regval) {
unsigned long flags;
void *tmp_ptr = &mpc83xx_spi->base->mode;
__be32 __iomem *mode = &mpc83xx_spi->base->mode;

regval = cs->hw_mode;
/* Turn off IRQs locally to minimize time
* that SPI is disabled
*/
local_irq_save(flags);
/* Turn off SPI unit prior changing mode */
mpc83xx_spi_write_reg(tmp_ptr, regval & ~SPMODE_ENABLE);
mpc83xx_spi_write_reg(tmp_ptr, regval);
mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
mpc83xx_spi_write_reg(mode, regval);
local_irq_restore(flags);
}
return 0;
Expand Down Expand Up @@ -483,7 +485,7 @@ static int mpc83xx_spi_setup(struct spi_device *spi)
return 0;
}

irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
static irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
{
struct mpc83xx_spi *mpc83xx_spi = context_data;
u32 event;
Expand Down

0 comments on commit 701de72

Please sign in to comment.