diff options
author | Georg Chini <georg.chini@triaton-webhosting.com> | 2007-08-02 00:55:58 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-08-03 17:08:33 -0400 |
commit | 3daadf33013a1c4d7abf4a65b24644cdd8ae896a (patch) | |
tree | 807e1e2d951f0a36f1704eb7450bc1b09b42b4d5 | |
parent | 3fc701d5d459f3b83ba874613048d36e91debca2 (diff) |
[SOUND] CS4231 SBus: Two fixes.
Remove unnecessary sbus_dma_reset function and change sbus_dma_enable
to avoid occasional system crashes when stopping recording.
Signed-off-by: Georg Chini <georg.chini@triaton-webhosting.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | sound/sparc/cs4231.c | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index dca0344cc1bc..f2950cab74a6 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -74,7 +74,6 @@ struct cs4231_dma_control { | |||
74 | void (*enable)(struct cs4231_dma_control *dma_cont, int on); | 74 | void (*enable)(struct cs4231_dma_control *dma_cont, int on); |
75 | int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len); | 75 | int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len); |
76 | unsigned int (*address)(struct cs4231_dma_control *dma_cont); | 76 | unsigned int (*address)(struct cs4231_dma_control *dma_cont); |
77 | void (*reset)(struct snd_cs4231 *chip); | ||
78 | void (*preallocate)(struct snd_cs4231 *chip, struct snd_pcm *pcm); | 77 | void (*preallocate)(struct snd_cs4231 *chip, struct snd_pcm *pcm); |
79 | #ifdef EBUS_SUPPORT | 78 | #ifdef EBUS_SUPPORT |
80 | struct ebus_dma_info ebus_info; | 79 | struct ebus_dma_info ebus_info; |
@@ -1214,10 +1213,6 @@ static int __init snd_cs4231_probe(struct snd_cs4231 *chip) | |||
1214 | 1213 | ||
1215 | spin_lock_irqsave(&chip->lock, flags); | 1214 | spin_lock_irqsave(&chip->lock, flags); |
1216 | 1215 | ||
1217 | |||
1218 | /* Reset DMA engine (sbus only). */ | ||
1219 | chip->p_dma.reset(chip); | ||
1220 | |||
1221 | __cs4231_readb(chip, CS4231P(chip, STATUS)); /* clear any pendings IRQ */ | 1216 | __cs4231_readb(chip, CS4231P(chip, STATUS)); /* clear any pendings IRQ */ |
1222 | __cs4231_writeb(chip, 0, CS4231P(chip, STATUS)); | 1217 | __cs4231_writeb(chip, 0, CS4231P(chip, STATUS)); |
1223 | mb(); | 1218 | mb(); |
@@ -1861,14 +1856,13 @@ static void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on) | |||
1861 | if (!on) { | 1856 | if (!on) { |
1862 | sbus_writel(0, base->regs + base->dir + APCNC); | 1857 | sbus_writel(0, base->regs + base->dir + APCNC); |
1863 | sbus_writel(0, base->regs + base->dir + APCNVA); | 1858 | sbus_writel(0, base->regs + base->dir + APCNVA); |
1864 | sbus_writel(0, base->regs + base->dir + APCC); | 1859 | if ( base->dir == APC_PLAY ) { |
1865 | sbus_writel(0, base->regs + base->dir + APCVA); | 1860 | sbus_writel(0, base->regs + base->dir + APCC); |
1861 | sbus_writel(0, base->regs + base->dir + APCVA); | ||
1862 | } | ||
1866 | 1863 | ||
1867 | /* ACK any APC interrupts. */ | 1864 | udelay(1200); |
1868 | csr = sbus_readl(base->regs + APCCSR); | ||
1869 | sbus_writel(csr, base->regs + APCCSR); | ||
1870 | } | 1865 | } |
1871 | udelay(1000); | ||
1872 | csr = sbus_readl(base->regs + APCCSR); | 1866 | csr = sbus_readl(base->regs + APCCSR); |
1873 | shift = 0; | 1867 | shift = 0; |
1874 | if ( base->dir == APC_PLAY ) | 1868 | if ( base->dir == APC_PLAY ) |
@@ -1894,23 +1888,6 @@ static unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont) | |||
1894 | return sbus_readl(base->regs + base->dir + APCVA); | 1888 | return sbus_readl(base->regs + base->dir + APCVA); |
1895 | } | 1889 | } |
1896 | 1890 | ||
1897 | static void sbus_dma_reset(struct snd_cs4231 *chip) | ||
1898 | { | ||
1899 | sbus_writel(APC_CHIP_RESET, chip->port + APCCSR); | ||
1900 | sbus_writel(0x00, chip->port + APCCSR); | ||
1901 | sbus_writel(sbus_readl(chip->port + APCCSR) | APC_CDC_RESET, | ||
1902 | chip->port + APCCSR); | ||
1903 | |||
1904 | udelay(20); | ||
1905 | |||
1906 | sbus_writel(sbus_readl(chip->port + APCCSR) & ~APC_CDC_RESET, | ||
1907 | chip->port + APCCSR); | ||
1908 | sbus_writel(sbus_readl(chip->port + APCCSR) | (APC_XINT_ENA | | ||
1909 | APC_XINT_PENA | | ||
1910 | APC_XINT_CENA), | ||
1911 | chip->port + APCCSR); | ||
1912 | } | ||
1913 | |||
1914 | static void sbus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) | 1891 | static void sbus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) |
1915 | { | 1892 | { |
1916 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS, | 1893 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS, |
@@ -1986,14 +1963,12 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card, | |||
1986 | chip->p_dma.enable = sbus_dma_enable; | 1963 | chip->p_dma.enable = sbus_dma_enable; |
1987 | chip->p_dma.request = sbus_dma_request; | 1964 | chip->p_dma.request = sbus_dma_request; |
1988 | chip->p_dma.address = sbus_dma_addr; | 1965 | chip->p_dma.address = sbus_dma_addr; |
1989 | chip->p_dma.reset = sbus_dma_reset; | ||
1990 | chip->p_dma.preallocate = sbus_dma_preallocate; | 1966 | chip->p_dma.preallocate = sbus_dma_preallocate; |
1991 | 1967 | ||
1992 | chip->c_dma.prepare = sbus_dma_prepare; | 1968 | chip->c_dma.prepare = sbus_dma_prepare; |
1993 | chip->c_dma.enable = sbus_dma_enable; | 1969 | chip->c_dma.enable = sbus_dma_enable; |
1994 | chip->c_dma.request = sbus_dma_request; | 1970 | chip->c_dma.request = sbus_dma_request; |
1995 | chip->c_dma.address = sbus_dma_addr; | 1971 | chip->c_dma.address = sbus_dma_addr; |
1996 | chip->c_dma.reset = sbus_dma_reset; | ||
1997 | chip->c_dma.preallocate = sbus_dma_preallocate; | 1972 | chip->c_dma.preallocate = sbus_dma_preallocate; |
1998 | 1973 | ||
1999 | if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt, | 1974 | if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt, |
@@ -2087,11 +2062,6 @@ static unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont) | |||
2087 | return ebus_dma_addr(&dma_cont->ebus_info); | 2062 | return ebus_dma_addr(&dma_cont->ebus_info); |
2088 | } | 2063 | } |
2089 | 2064 | ||
2090 | static void _ebus_dma_reset(struct snd_cs4231 *chip) | ||
2091 | { | ||
2092 | return; | ||
2093 | } | ||
2094 | |||
2095 | static void _ebus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) | 2065 | static void _ebus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) |
2096 | { | 2066 | { |
2097 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 2067 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
@@ -2171,14 +2141,12 @@ static int __init snd_cs4231_ebus_create(struct snd_card *card, | |||
2171 | chip->p_dma.enable = _ebus_dma_enable; | 2141 | chip->p_dma.enable = _ebus_dma_enable; |
2172 | chip->p_dma.request = _ebus_dma_request; | 2142 | chip->p_dma.request = _ebus_dma_request; |
2173 | chip->p_dma.address = _ebus_dma_addr; | 2143 | chip->p_dma.address = _ebus_dma_addr; |
2174 | chip->p_dma.reset = _ebus_dma_reset; | ||
2175 | chip->p_dma.preallocate = _ebus_dma_preallocate; | 2144 | chip->p_dma.preallocate = _ebus_dma_preallocate; |
2176 | 2145 | ||
2177 | chip->c_dma.prepare = _ebus_dma_prepare; | 2146 | chip->c_dma.prepare = _ebus_dma_prepare; |
2178 | chip->c_dma.enable = _ebus_dma_enable; | 2147 | chip->c_dma.enable = _ebus_dma_enable; |
2179 | chip->c_dma.request = _ebus_dma_request; | 2148 | chip->c_dma.request = _ebus_dma_request; |
2180 | chip->c_dma.address = _ebus_dma_addr; | 2149 | chip->c_dma.address = _ebus_dma_addr; |
2181 | chip->c_dma.reset = _ebus_dma_reset; | ||
2182 | chip->c_dma.preallocate = _ebus_dma_preallocate; | 2150 | chip->c_dma.preallocate = _ebus_dma_preallocate; |
2183 | 2151 | ||
2184 | chip->port = ioremap(edev->resource[0].start, 0x10); | 2152 | chip->port = ioremap(edev->resource[0].start, 0x10); |