aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2010-03-24 02:27:24 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-24 07:16:47 -0400
commitfeb58cffca772097a849b413fb7954f87e9e9e71 (patch)
tree4208f76725135578a31e61e5ad9c2bfe8f3720dc /sound
parent1ad747ca9b6f97f895e0a6ccd447b158aeaa568d (diff)
ASoC: fsi: ensures process inside master lock
Bit operation for fsi_master should be done inside master lock. But soft-reset/interrupt operation were outside of it. This patch modify this problem. It still allow to INT_ST outside-operation on fsi_interrupt, but it is not problem. Because this register doesn't need the bit operation. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/fsi.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 993abb730df..db91349b680 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -79,6 +79,12 @@
79#define INT_A_IN (1 << 4) 79#define INT_A_IN (1 << 4)
80#define INT_A_OUT (1 << 0) 80#define INT_A_OUT (1 << 0)
81 81
82/* SOFT_RST */
83#define PBSR (1 << 12) /* Port B Software Reset */
84#define PASR (1 << 8) /* Port A Software Reset */
85#define IR (1 << 4) /* Interrupt Reset */
86#define FSISR (1 << 0) /* Software Reset */
87
82#define FSI_RATES SNDRV_PCM_RATE_8000_96000 88#define FSI_RATES SNDRV_PCM_RATE_8000_96000
83 89
84#define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) 90#define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
@@ -372,18 +378,13 @@ static void fsi_irq_init(struct fsi_priv *fsi, int is_play)
372 378
373static void fsi_soft_all_reset(struct fsi_master *master) 379static void fsi_soft_all_reset(struct fsi_master *master)
374{ 380{
375 u32 status = fsi_master_read(master, SOFT_RST);
376
377 /* port AB reset */ 381 /* port AB reset */
378 status &= 0x000000ff; 382 fsi_master_mask_set(master, SOFT_RST, PASR | PBSR, 0);
379 fsi_master_write(master, SOFT_RST, status);
380 mdelay(10); 383 mdelay(10);
381 384
382 /* soft reset */ 385 /* soft reset */
383 status &= 0x000000f0; 386 fsi_master_mask_set(master, SOFT_RST, FSISR, 0);
384 fsi_master_write(master, SOFT_RST, status); 387 fsi_master_mask_set(master, SOFT_RST, FSISR, FSISR);
385 status |= 0x00000001;
386 fsi_master_write(master, SOFT_RST, status);
387 mdelay(10); 388 mdelay(10);
388} 389}
389 390
@@ -558,12 +559,11 @@ static int fsi_data_pop(struct fsi_priv *fsi, int startup)
558static irqreturn_t fsi_interrupt(int irq, void *data) 559static irqreturn_t fsi_interrupt(int irq, void *data)
559{ 560{
560 struct fsi_master *master = data; 561 struct fsi_master *master = data;
561 u32 status = fsi_master_read(master, SOFT_RST) & ~0x00000010;
562 u32 int_st = fsi_master_read(master, INT_ST); 562 u32 int_st = fsi_master_read(master, INT_ST);
563 563
564 /* clear irq status */ 564 /* clear irq status */
565 fsi_master_write(master, SOFT_RST, status); 565 fsi_master_mask_set(master, SOFT_RST, IR, 0);
566 fsi_master_write(master, SOFT_RST, status | 0x00000010); 566 fsi_master_mask_set(master, SOFT_RST, IR, IR);
567 567
568 if (int_st & INT_A_OUT) 568 if (int_st & INT_A_OUT)
569 fsi_data_push(&master->fsia, 0); 569 fsi_data_push(&master->fsia, 0);