Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350760
b: refs/heads/master
c: 5cbc7ca
h: refs/heads/master
v: v3
  • Loading branch information
Matthias Brugger authored and Mark Brown committed Jan 26, 2013
1 parent e9fc037 commit 891678f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18dd6199fa4527229cede5784244b6eb37a21d62
refs/heads/master: 5cbc7ca987fb3f293203dc14a6c53b91b7c978a5
18 changes: 18 additions & 0 deletions trunk/drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)

struct spi_device *spi;
struct spi_transfer *t = NULL;
struct spi_master *master;
int cs_active = 0;
struct omap2_mcspi_cs *cs;
struct omap2_mcspi_device_config *cd;
Expand All @@ -935,6 +936,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)
u32 chconf;

spi = m->spi;
master = spi->master;
cs = spi->controller_state;
cd = spi->controller_data;

Expand All @@ -952,6 +954,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)
if (!t->speed_hz && !t->bits_per_word)
par_override = 0;
}
if (cd && cd->cs_per_word) {
chconf = mcspi->ctx.modulctrl;
chconf &= ~OMAP2_MCSPI_MODULCTRL_SINGLE;
mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
mcspi->ctx.modulctrl =
mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
}


if (!cs_active) {
omap2_mcspi_force_cs(spi, 1);
Expand Down Expand Up @@ -1013,6 +1023,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)
if (cs_active)
omap2_mcspi_force_cs(spi, 0);

if (cd && cd->cs_per_word) {
chconf = mcspi->ctx.modulctrl;
chconf |= OMAP2_MCSPI_MODULCTRL_SINGLE;
mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
mcspi->ctx.modulctrl =
mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
}

omap2_mcspi_set_enable(spi, 0);

m->status = status;
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/platform_data/spi-omap2-mcspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ struct omap2_mcspi_dev_attr {

struct omap2_mcspi_device_config {
unsigned turbo_mode:1;

/* toggle chip select after every word */
unsigned cs_per_word:1;
};

#endif

0 comments on commit 891678f

Please sign in to comment.