Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update abdac.c #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions sound/atmel/abdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ static int atmel_abdac_open(struct snd_pcm_substream *substream)
SNDRV_PCM_HW_PARAM_RATE, &dac->constraints_rates);
}

static int atmel_abdac_close(struct snd_pcm_substream *substream)
static void atmel_abdac_close(struct snd_pcm_substream *substream)
{
struct atmel_abdac *dac = snd_pcm_substream_chip(substream);
dac->substream = NULL;
return 0;
}

static int atmel_abdac_hw_params(struct snd_pcm_substream *substream,
Expand Down Expand Up @@ -470,7 +469,8 @@ static int atmel_abdac_probe(struct platform_device *pdev)
goto out_unmap_regs;
}

if (pdata->dws.dma_dev) {
if (pdata->dws.dma_dev)
{
dma_cap_mask_t mask;

dma_cap_zero(mask);
Expand Down Expand Up @@ -501,13 +501,17 @@ static int atmel_abdac_probe(struct platform_device *pdev)
sprintf(card->longname, "Atmel Audio Bitstream DAC");

retval = atmel_abdac_pcm_new(dac);
if (retval) {

if (retval)
{
dev_dbg(&pdev->dev, "could not register ABDAC pcm device\n");
goto out_release_dma;
}

retval = snd_card_register(card);
if (retval) {

if (retval)
{
dev_dbg(&pdev->dev, "could not register sound card\n");
goto out_release_dma;
}
Expand Down Expand Up @@ -535,19 +539,17 @@ static int atmel_abdac_probe(struct platform_device *pdev)
}

#ifdef CONFIG_PM_SLEEP
static int atmel_abdac_suspend(struct device *pdev)
static void atmel_abdac_suspend(struct device *pdev)
{
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_abdac *dac = card->private_data;

dw_dma_cyclic_stop(dac->dma.chan);
clk_disable(dac->sample_clk);
clk_disable(dac->pclk);

return 0;
}

static int atmel_abdac_resume(struct device *pdev)
static void atmel_abdac_resume(struct device *pdev)
{
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_abdac *dac = card->private_data;
Expand All @@ -556,8 +558,6 @@ static int atmel_abdac_resume(struct device *pdev)
clk_enable(dac->sample_clk);
if (test_bit(DMA_READY, &dac->flags))
dw_dma_cyclic_start(dac->dma.chan);

return 0;
}

static SIMPLE_DEV_PM_OPS(atmel_abdac_pm, atmel_abdac_suspend, atmel_abdac_resume);
Expand All @@ -566,7 +566,7 @@ static SIMPLE_DEV_PM_OPS(atmel_abdac_pm, atmel_abdac_suspend, atmel_abdac_resume
#define ATMEL_ABDAC_PM_OPS NULL
#endif

static int atmel_abdac_remove(struct platform_device *pdev)
static void atmel_abdac_remove(struct platform_device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct atmel_abdac *dac = get_dac(card);
Expand All @@ -580,8 +580,6 @@ static int atmel_abdac_remove(struct platform_device *pdev)
iounmap(dac->regs);
free_irq(dac->irq, dac);
snd_card_free(card);

return 0;
}

static struct platform_driver atmel_abdac_driver = {
Expand Down