Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182827
b: refs/heads/master
c: 48dbc41
h: refs/heads/master
i:
  182825: cdba6db
  182823: 8f07641
v: v3
  • Loading branch information
Mark Brown committed Jan 17, 2010
1 parent ded0456 commit 72db078
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 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: 157a777c8e809bd0c703e3f7617b3539df30feff
refs/heads/master: 48dbc41988d07c7a9ba83afd31543d8ecb2beecc
40 changes: 20 additions & 20 deletions trunk/sound/soc/imx/imx-ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
static int imx_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
{
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
u32 sccr;

sccr = readl(ssi->base + SSI_STCCR);
Expand All @@ -87,7 +87,7 @@ static int imx_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
*/
static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
{
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
u32 strcr = 0, scr;

scr = readl(ssi->base + SSI_SCR) & ~(SSI_SCR_SYN | SSI_SCR_NET);
Expand Down Expand Up @@ -160,7 +160,7 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
static int imx_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq, int dir)
{
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
u32 scr;

scr = readl(ssi->base + SSI_SCR);
Expand Down Expand Up @@ -188,7 +188,7 @@ static int imx_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
static int imx_ssi_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
u32 stccr, srccr;

stccr = readl(ssi->base + SSI_STCCR);
Expand Down Expand Up @@ -237,7 +237,7 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *cpu_dai)
{
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
u32 reg, sccr;

/* Tx/Rx config */
Expand Down Expand Up @@ -274,7 +274,7 @@ static int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
struct imx_ssi *ssi = cpu_dai->private_data;
unsigned int sier_bits, sier;
unsigned int scr;

Expand Down Expand Up @@ -570,7 +570,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
};
EXPORT_SYMBOL_GPL(soc_ac97_ops);

struct snd_soc_dai *imx_ssi_pcm_dai[2];
struct snd_soc_dai imx_ssi_pcm_dai[2];
EXPORT_SYMBOL_GPL(imx_ssi_pcm_dai);

static int imx_ssi_probe(struct platform_device *pdev)
Expand All @@ -581,6 +581,10 @@ static int imx_ssi_probe(struct platform_device *pdev)
struct snd_soc_platform *platform;
int ret = 0;
unsigned int val;
struct snd_soc_dai *dai = &imx_ssi_pcm_dai[pdev->id];

if (dai->id >= ARRAY_SIZE(imx_ssi_pcm_dai))
return -EINVAL;

ssi = kzalloc(sizeof(*ssi), GFP_KERNEL);
if (!ssi)
Expand All @@ -592,8 +596,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
ssi->flags = pdata->flags;
}

imx_ssi_pcm_dai[pdev->id] = &ssi->dai;

ssi->irq = platform_get_irq(pdev, 0);

ssi->clk = clk_get(&pdev->dev, NULL);
Expand Down Expand Up @@ -631,13 +633,9 @@ static int imx_ssi_probe(struct platform_device *pdev)
}
ac97_ssi = ssi;
setup_channel_to_ac97(ssi);
memcpy(&ssi->dai, &imx_ac97_dai, sizeof(imx_ac97_dai));
memcpy(dai, &imx_ac97_dai, sizeof(imx_ac97_dai));
} else
memcpy(&ssi->dai, &imx_ssi_dai, sizeof(imx_ssi_dai));

ssi->dai.id = pdev->id;
ssi->dai.dev = &pdev->dev;
ssi->dai.name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
memcpy(dai, &imx_ssi_dai, sizeof(imx_ssi_dai));

writel(0x0, ssi->base + SSI_SIER);

Expand All @@ -652,9 +650,10 @@ static int imx_ssi_probe(struct platform_device *pdev)
if (res)
ssi->dma_params_rx.dma = res->start;

ssi->dai.id = pdev->id;
ssi->dai.dev = &pdev->dev;
ssi->dai.name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
dai->id = pdev->id;
dai->dev = &pdev->dev;
dai->name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
dai->private_data = ssi;

if ((cpu_is_mx27() || cpu_is_mx21()) &&
!(ssi->flags & IMX_SSI_USE_AC97)) {
Expand All @@ -671,7 +670,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize);
writel(val, ssi->base + SSI_SFCSR);

ret = snd_soc_register_dai(&ssi->dai);
ret = snd_soc_register_dai(dai);
if (ret) {
dev_err(&pdev->dev, "register DAI failed\n");
goto failed_register;
Expand Down Expand Up @@ -699,8 +698,9 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev)
{
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct imx_ssi *ssi = platform_get_drvdata(pdev);
struct snd_soc_dai *dai = &imx_ssi_pcm_dai[pdev->id];

snd_soc_unregister_dai(&ssi->dai);
snd_soc_unregister_dai(dai);

if (ssi->flags & IMX_SSI_USE_AC97)
ac97_ssi = NULL;
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/soc/imx/imx-ssi.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
#define IMX_SSI_RX_DIV_PSR 4
#define IMX_SSI_RX_DIV_PM 5

extern struct snd_soc_dai *imx_ssi_pcm_dai[2];
extern struct snd_soc_dai imx_ssi_pcm_dai[2];
extern struct snd_soc_platform imx_soc_platform;

#define DRV_NAME "imx-ssi"
Expand All @@ -195,7 +195,6 @@ struct imx_pcm_dma_params {
};

struct imx_ssi {
struct snd_soc_dai dai;
struct platform_device *ac97_dev;

struct snd_soc_device imx_ac97;
Expand Down

0 comments on commit 72db078

Please sign in to comment.