aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2009-04-02 02:21:15 -0400
committerTakashi Iwai <tiwai@suse.de>2009-04-05 21:55:42 -0400
commit81baf3a7f686c5d22359cb06fc11d20907ba12f8 (patch)
treeb4f13bce4e1af868ed7672646e56682d18d0a2b1 /sound
parentdf163587eab15a24cc34cf8434a5657416f8a203 (diff)
ALSA: snd-atmel-ac97c: do a proper reset of the external codec
This patch will enable the AC97C before resetting the external codec, leaving the AC97C disabled will result in floating I/O lines that can affect the reset procedure. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/atmel/ac97c.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index e8484cb9ac62..90527c14901e 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -730,17 +730,17 @@ static bool filter(struct dma_chan *chan, void *slave)
730 730
731static void atmel_ac97c_reset(struct atmel_ac97c *chip) 731static void atmel_ac97c_reset(struct atmel_ac97c *chip)
732{ 732{
733 ac97c_writel(chip, MR, AC97C_MR_WRST); 733 ac97c_writel(chip, MR, 0);
734 ac97c_writel(chip, MR, AC97C_MR_ENA);
735 ac97c_writel(chip, CAMR, 0);
736 ac97c_writel(chip, COMR, 0);
734 737
735 if (gpio_is_valid(chip->reset_pin)) { 738 if (gpio_is_valid(chip->reset_pin)) {
736 gpio_set_value(chip->reset_pin, 0); 739 gpio_set_value(chip->reset_pin, 0);
737 /* AC97 v2.2 specifications says minimum 1 us. */ 740 /* AC97 v2.2 specifications says minimum 1 us. */
738 udelay(10); 741 udelay(2);
739 gpio_set_value(chip->reset_pin, 1); 742 gpio_set_value(chip->reset_pin, 1);
740 } 743 }
741
742 udelay(1);
743 ac97c_writel(chip, MR, AC97C_MR_ENA);
744} 744}
745 745
746static int __devinit atmel_ac97c_probe(struct platform_device *pdev) 746static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
@@ -826,6 +826,8 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
826 826
827 snd_card_set_dev(card, &pdev->dev); 827 snd_card_set_dev(card, &pdev->dev);
828 828
829 atmel_ac97c_reset(chip);
830
829 /* Enable overrun interrupt from codec channel */ 831 /* Enable overrun interrupt from codec channel */
830 ac97c_writel(chip, COMR, AC97C_CSR_OVRUN); 832 ac97c_writel(chip, COMR, AC97C_CSR_OVRUN);
831 ac97c_writel(chip, IER, ac97c_readl(chip, IMR) | AC97C_SR_COEVT); 833 ac97c_writel(chip, IER, ac97c_readl(chip, IMR) | AC97C_SR_COEVT);
@@ -836,8 +838,6 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
836 goto err_ac97_bus; 838 goto err_ac97_bus;
837 } 839 }
838 840
839 atmel_ac97c_reset(chip);
840
841 retval = atmel_ac97c_mixer_new(chip); 841 retval = atmel_ac97c_mixer_new(chip);
842 if (retval) { 842 if (retval) {
843 dev_dbg(&pdev->dev, "could not register ac97 mixer\n"); 843 dev_dbg(&pdev->dev, "could not register ac97 mixer\n");