Skip to content

Commit 0cb3a12

Browse files
committed
Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus
2 parents 4368c27 + 9986943 commit 0cb3a12

File tree

3 files changed

+41
-19
lines changed

3 files changed

+41
-19
lines changed

sound/soc/sh/rcar/cmd.c

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,24 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
3131
struct rsnd_mod *mix = rsnd_io_to_mod_mix(io);
3232
struct device *dev = rsnd_priv_to_dev(priv);
3333
u32 data;
34+
u32 path[] = {
35+
[1] = 1 << 0,
36+
[5] = 1 << 8,
37+
[6] = 1 << 12,
38+
[9] = 1 << 15,
39+
};
3440

3541
if (!mix && !dvc)
3642
return 0;
3743

44+
if (ARRAY_SIZE(path) < rsnd_mod_id(mod) + 1)
45+
return -ENXIO;
46+
3847
if (mix) {
3948
struct rsnd_dai *rdai;
4049
struct rsnd_mod *src;
4150
struct rsnd_dai_stream *tio;
4251
int i;
43-
u32 path[] = {
44-
[0] = 0,
45-
[1] = 1 << 0,
46-
[2] = 0,
47-
[3] = 0,
48-
[4] = 0,
49-
[5] = 1 << 8
50-
};
5152

5253
/*
5354
* it is assuming that integrater is well understanding about
@@ -70,16 +71,19 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
7071
} else {
7172
struct rsnd_mod *src = rsnd_io_to_mod_src(io);
7273

73-
u32 path[] = {
74-
[0] = 0x30000,
75-
[1] = 0x30001,
76-
[2] = 0x40000,
77-
[3] = 0x10000,
78-
[4] = 0x20000,
79-
[5] = 0x40100
74+
u8 cmd_case[] = {
75+
[0] = 0x3,
76+
[1] = 0x3,
77+
[2] = 0x4,
78+
[3] = 0x1,
79+
[4] = 0x2,
80+
[5] = 0x4,
81+
[6] = 0x1,
82+
[9] = 0x2,
8083
};
8184

82-
data = path[rsnd_mod_id(src)];
85+
data = path[rsnd_mod_id(src)] |
86+
cmd_case[rsnd_mod_id(src)] << 16;
8387
}
8488

8589
dev_dbg(dev, "ctu/mix path = 0x%08x", data);

sound/soc/sh/rcar/dma.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,17 +454,31 @@ static u32 rsnd_dmapp_read(struct rsnd_dma *dma, u32 reg)
454454
return ioread32(rsnd_dmapp_addr(dmac, dma, reg));
455455
}
456456

457+
static void rsnd_dmapp_bset(struct rsnd_dma *dma, u32 data, u32 mask, u32 reg)
458+
{
459+
struct rsnd_mod *mod = rsnd_mod_get(dma);
460+
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
461+
struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
462+
void __iomem *addr = rsnd_dmapp_addr(dmac, dma, reg);
463+
u32 val = ioread32(addr);
464+
465+
val &= ~mask;
466+
val |= (data & mask);
467+
468+
iowrite32(val, addr);
469+
}
470+
457471
static int rsnd_dmapp_stop(struct rsnd_mod *mod,
458472
struct rsnd_dai_stream *io,
459473
struct rsnd_priv *priv)
460474
{
461475
struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
462476
int i;
463477

464-
rsnd_dmapp_write(dma, 0, PDMACHCR);
478+
rsnd_dmapp_bset(dma, 0, PDMACHCR_DE, PDMACHCR);
465479

466480
for (i = 0; i < 1024; i++) {
467-
if (0 == rsnd_dmapp_read(dma, PDMACHCR))
481+
if (0 == (rsnd_dmapp_read(dma, PDMACHCR) & PDMACHCR_DE))
468482
return 0;
469483
udelay(1);
470484
}

sound/soc/sh/rcar/ssiu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod,
6464
mask1 = (1 << 4) | (1 << 20); /* mask sync bit */
6565
mask2 = (1 << 4); /* mask sync bit */
6666
val1 = val2 = 0;
67-
if (rsnd_ssi_is_pin_sharing(io)) {
67+
if (id == 8) {
68+
/*
69+
* SSI8 pin is sharing with SSI7, nothing to do.
70+
*/
71+
} else if (rsnd_ssi_is_pin_sharing(io)) {
6872
int shift = -1;
6973

7074
switch (id) {

0 commit comments

Comments
 (0)