blob: 8eafd3d3dff67324899cd5433cce91d6cbc28a23 [file] [log] [blame]
Dmitry Baryshkov9c636342008-09-10 05:01:17 +04001/*
2 * Based on sound/arm/pxa2xx-ac97.c and sound/soc/pxa/pxa2xx-ac97.c
3 * which contain:
4 *
5 * Author: Nicolas Pitre
6 * Created: Dec 02, 2004
7 * Copyright: MontaVista Software Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/interrupt.h>
17#include <linux/clk.h>
18#include <linux/delay.h>
Paul Gortmakerda155d52011-07-15 12:38:28 -040019#include <linux/module.h>
Rob Herring23019a72012-03-20 14:33:19 -050020#include <linux/io.h>
Mike Dunn3b4bc7b2013-01-07 13:55:13 -080021#include <linux/gpio.h>
Robert Jarzmika4519522018-06-17 12:50:01 +020022#include <linux/of_gpio.h>
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040023
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040024#include <sound/pxa2xx-lib.h>
25
Rob Herring9482ee72012-01-03 17:10:17 -060026#include <mach/irqs.h>
Eric Miao1f017a92008-11-28 14:19:33 +080027#include <mach/regs-ac97.h>
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040028#include <mach/audio.h>
29
30static DEFINE_MUTEX(car_mutex);
31static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
32static volatile long gsr_bits;
33static struct clk *ac97_clk;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040034static struct clk *ac97conf_clk;
Robert Jarzmik26ade892009-03-15 14:10:54 +010035static int reset_gpio;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040036
Mike Dunn053fe0f2013-01-07 13:55:14 -080037extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
Eric Miaofb1bf8c2010-01-04 16:30:58 +080038
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040039/*
40 * Beware PXA27x bugs:
41 *
42 * o Slot 12 read from modem space will hang controller.
43 * o CDONE, SDONE interrupt fails after any slot 12 IO.
44 *
45 * We therefore have an hybrid approach for waiting on SDONE (interrupt or
46 * 1 jiffy timeout if interrupt never comes).
47 */
48
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020049int pxa2xx_ac97_read(int slot, unsigned short reg)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040050{
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020051 int val = -ENODEV;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040052 volatile u32 *reg_addr;
53
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020054 if (slot > 0)
55 return -ENODEV;
56
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040057 mutex_lock(&car_mutex);
58
59 /* set up primary or secondary codec space */
Marc Zyngier8825e8e2008-10-14 09:57:05 +010060 if (cpu_is_pxa25x() && reg == AC97_GPIO_STATUS)
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020061 reg_addr = slot ? &SMC_REG_BASE : &PMC_REG_BASE;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040062 else
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020063 reg_addr = slot ? &SAC_REG_BASE : &PAC_REG_BASE;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040064 reg_addr += (reg >> 1);
65
66 /* start read access across the ac97 link */
67 GSR = GSR_CDONE | GSR_SDONE;
68 gsr_bits = 0;
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020069 val = (*reg_addr & 0xffff);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040070 if (reg == AC97_GPIO_STATUS)
71 goto out;
72 if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1) <= 0 &&
73 !((GSR | gsr_bits) & GSR_SDONE)) {
74 printk(KERN_ERR "%s: read error (ac97_reg=%d GSR=%#lx)\n",
75 __func__, reg, GSR | gsr_bits);
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020076 val = -ETIMEDOUT;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040077 goto out;
78 }
79
80 /* valid data now */
81 GSR = GSR_CDONE | GSR_SDONE;
82 gsr_bits = 0;
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020083 val = (*reg_addr & 0xffff);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040084 /* but we've just started another cycle... */
85 wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
86
87out: mutex_unlock(&car_mutex);
88 return val;
89}
90EXPORT_SYMBOL_GPL(pxa2xx_ac97_read);
91
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020092int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040093{
94 volatile u32 *reg_addr;
Robert Jarzmik6f8acad2017-09-02 21:54:06 +020095 int ret = 0;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +040096
97 mutex_lock(&car_mutex);
98
99 /* set up primary or secondary codec space */
Marc Zyngier8825e8e2008-10-14 09:57:05 +0100100 if (cpu_is_pxa25x() && reg == AC97_GPIO_STATUS)
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200101 reg_addr = slot ? &SMC_REG_BASE : &PMC_REG_BASE;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400102 else
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200103 reg_addr = slot ? &SAC_REG_BASE : &PAC_REG_BASE;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400104 reg_addr += (reg >> 1);
105
106 GSR = GSR_CDONE | GSR_SDONE;
107 gsr_bits = 0;
108 *reg_addr = val;
109 if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1) <= 0 &&
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200110 !((GSR | gsr_bits) & GSR_CDONE)) {
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400111 printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n",
112 __func__, reg, GSR | gsr_bits);
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200113 ret = -EIO;
114 }
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400115
116 mutex_unlock(&car_mutex);
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200117 return ret;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400118}
119EXPORT_SYMBOL_GPL(pxa2xx_ac97_write);
120
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400121#ifdef CONFIG_PXA25x
122static inline void pxa_ac97_warm_pxa25x(void)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400123{
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400124 gsr_bits = 0;
125
Dmitry Eremin-Solenikovbeb02cd2013-10-17 14:01:35 +0400126 GCR |= GCR_WARM_RST;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400127}
128
129static inline void pxa_ac97_cold_pxa25x(void)
130{
131 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
132 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
133
134 gsr_bits = 0;
135
136 GCR = GCR_COLD_RST;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400137}
138#endif
139
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400140#ifdef CONFIG_PXA27x
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400141static inline void pxa_ac97_warm_pxa27x(void)
142{
143 gsr_bits = 0;
144
Eric Miaofb1bf8c2010-01-04 16:30:58 +0800145 /* warm reset broken on Bulverde, so manually keep AC97 reset high */
Mike Dunn053fe0f2013-01-07 13:55:14 -0800146 pxa27x_configure_ac97reset(reset_gpio, true);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400147 udelay(10);
148 GCR |= GCR_WARM_RST;
Mike Dunn053fe0f2013-01-07 13:55:14 -0800149 pxa27x_configure_ac97reset(reset_gpio, false);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400150 udelay(500);
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400151}
152
153static inline void pxa_ac97_cold_pxa27x(void)
154{
155 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
156 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
157
158 gsr_bits = 0;
159
160 /* PXA27x Developers Manual section 13.5.2.2.1 */
Robert Jarzmik4091d342014-06-09 21:59:12 +0200161 clk_prepare_enable(ac97conf_clk);
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400162 udelay(5);
Robert Jarzmik4091d342014-06-09 21:59:12 +0200163 clk_disable_unprepare(ac97conf_clk);
Mike Dunn41b645c2013-01-07 13:55:12 -0800164 GCR = GCR_COLD_RST | GCR_WARM_RST;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400165}
166#endif
167
168#ifdef CONFIG_PXA3xx
169static inline void pxa_ac97_warm_pxa3xx(void)
170{
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400171 gsr_bits = 0;
172
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400173 /* Can't use interrupts */
174 GCR |= GCR_WARM_RST;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400175}
176
177static inline void pxa_ac97_cold_pxa3xx(void)
178{
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400179 /* Hold CLKBPB for 100us */
180 GCR = 0;
181 GCR = GCR_CLKBPB;
182 udelay(100);
183 GCR = 0;
184
185 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
186 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
187
188 gsr_bits = 0;
189
190 /* Can't use interrupts on PXA3xx */
191 GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
192
193 GCR = GCR_WARM_RST | GCR_COLD_RST;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400194}
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400195#endif
196
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200197bool pxa2xx_ac97_try_warm_reset(void)
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400198{
Luotao Fu057de502009-03-26 13:18:03 +0100199 unsigned long gsr;
Dmitry Eremin-Solenikovbeb02cd2013-10-17 14:01:35 +0400200 unsigned int timeout = 100;
Luotao Fu057de502009-03-26 13:18:03 +0100201
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400202#ifdef CONFIG_PXA25x
Marc Zyngier8825e8e2008-10-14 09:57:05 +0100203 if (cpu_is_pxa25x())
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400204 pxa_ac97_warm_pxa25x();
205 else
206#endif
207#ifdef CONFIG_PXA27x
208 if (cpu_is_pxa27x())
209 pxa_ac97_warm_pxa27x();
210 else
211#endif
212#ifdef CONFIG_PXA3xx
213 if (cpu_is_pxa3xx())
214 pxa_ac97_warm_pxa3xx();
215 else
216#endif
Takashi Iwai88ec7ae2013-11-05 15:33:40 +0100217 snd_BUG();
Dmitry Eremin-Solenikovbeb02cd2013-10-17 14:01:35 +0400218
219 while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
220 mdelay(1);
221
Luotao Fu057de502009-03-26 13:18:03 +0100222 gsr = GSR | gsr_bits;
223 if (!(gsr & (GSR_PCR | GSR_SCR))) {
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400224 printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
Luotao Fu057de502009-03-26 13:18:03 +0100225 __func__, gsr);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400226
227 return false;
228 }
229
230 return true;
231}
232EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset);
233
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200234bool pxa2xx_ac97_try_cold_reset(void)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400235{
Luotao Fu057de502009-03-26 13:18:03 +0100236 unsigned long gsr;
Dmitry Eremin-Solenikovbeb02cd2013-10-17 14:01:35 +0400237 unsigned int timeout = 1000;
Luotao Fu057de502009-03-26 13:18:03 +0100238
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400239#ifdef CONFIG_PXA25x
Marc Zyngier8825e8e2008-10-14 09:57:05 +0100240 if (cpu_is_pxa25x())
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400241 pxa_ac97_cold_pxa25x();
242 else
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400243#endif
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400244#ifdef CONFIG_PXA27x
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400245 if (cpu_is_pxa27x())
246 pxa_ac97_cold_pxa27x();
247 else
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400248#endif
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400249#ifdef CONFIG_PXA3xx
250 if (cpu_is_pxa3xx())
251 pxa_ac97_cold_pxa3xx();
252 else
253#endif
Takashi Iwai88ec7ae2013-11-05 15:33:40 +0100254 snd_BUG();
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400255
Dmitry Eremin-Solenikovbeb02cd2013-10-17 14:01:35 +0400256 while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
257 mdelay(1);
258
Luotao Fu057de502009-03-26 13:18:03 +0100259 gsr = GSR | gsr_bits;
260 if (!(gsr & (GSR_PCR | GSR_SCR))) {
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400261 printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
Luotao Fu057de502009-03-26 13:18:03 +0100262 __func__, gsr);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400263
264 return false;
265 }
266
267 return true;
268}
269EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_cold_reset);
270
271
Robert Jarzmik6f8acad2017-09-02 21:54:06 +0200272void pxa2xx_ac97_finish_reset(void)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400273{
274 GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
275 GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
276}
277EXPORT_SYMBOL_GPL(pxa2xx_ac97_finish_reset);
278
279static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
280{
281 long status;
282
283 status = GSR;
284 if (status) {
285 GSR = status;
286 gsr_bits |= status;
287 wake_up(&gsr_wq);
288
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400289 /* Although we don't use those we still need to clear them
290 since they tend to spuriously trigger when MMC is used
291 (hardware bug? go figure)... */
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400292 if (cpu_is_pxa27x()) {
293 MISR = MISR_EOC;
294 PISR = PISR_EOC;
295 MCSR = MCSR_EOC;
296 }
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400297
298 return IRQ_HANDLED;
299 }
300
301 return IRQ_NONE;
302}
303
304#ifdef CONFIG_PM
305int pxa2xx_ac97_hw_suspend(void)
306{
307 GCR |= GCR_ACLINK_OFF;
Robert Jarzmik4091d342014-06-09 21:59:12 +0200308 clk_disable_unprepare(ac97_clk);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400309 return 0;
310}
311EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
312
313int pxa2xx_ac97_hw_resume(void)
314{
Robert Jarzmik4091d342014-06-09 21:59:12 +0200315 clk_prepare_enable(ac97_clk);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400316 return 0;
317}
318EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
319#endif
320
Bill Pembertone21596b2012-12-06 12:35:12 -0500321int pxa2xx_ac97_hw_probe(struct platform_device *dev)
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400322{
323 int ret;
Mark Browneae17752009-04-13 11:48:03 +0100324 pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
Robert Jarzmik26ade892009-03-15 14:10:54 +0100325
326 if (pdata) {
327 switch (pdata->reset_gpio) {
328 case 95:
329 case 113:
330 reset_gpio = pdata->reset_gpio;
331 break;
332 case 0:
333 reset_gpio = 113;
334 break;
335 case -1:
336 break;
337 default:
Takashi Iwai1f2186952009-03-19 14:08:58 +0100338 dev_err(&dev->dev, "Invalid reset GPIO %d\n",
Robert Jarzmik26ade892009-03-15 14:10:54 +0100339 pdata->reset_gpio);
340 }
Robert Jarzmika4519522018-06-17 12:50:01 +0200341 } else if (!pdata && dev->dev.of_node) {
342 pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
343 if (!pdata)
344 return -ENOMEM;
345 pdata->reset_gpio = of_get_named_gpio(dev->dev.of_node,
346 "reset-gpios", 0);
347 if (pdata->reset_gpio == -ENOENT)
348 pdata->reset_gpio = -1;
349 else if (pdata->reset_gpio < 0)
350 return pdata->reset_gpio;
351 reset_gpio = pdata->reset_gpio;
Robert Jarzmik26ade892009-03-15 14:10:54 +0100352 } else {
353 if (cpu_is_pxa27x())
354 reset_gpio = 113;
355 }
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400356
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400357 if (cpu_is_pxa27x()) {
Mike Dunn3b4bc7b2013-01-07 13:55:13 -0800358 /*
359 * This gpio is needed for a work-around to a bug in the ac97
360 * controller during warm reset. The direction and level is set
361 * here so that it is an output driven high when switching from
362 * AC97_nRESET alt function to generic gpio.
363 */
364 ret = gpio_request_one(reset_gpio, GPIOF_OUT_INIT_HIGH,
365 "pxa27x ac97 reset");
366 if (ret < 0) {
367 pr_err("%s: gpio_request_one() failed: %d\n",
368 __func__, ret);
369 goto err_conf;
370 }
Mike Dunn053fe0f2013-01-07 13:55:14 -0800371 pxa27x_configure_ac97reset(reset_gpio, false);
Mike Dunn3b4bc7b2013-01-07 13:55:13 -0800372
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400373 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
374 if (IS_ERR(ac97conf_clk)) {
375 ret = PTR_ERR(ac97conf_clk);
376 ac97conf_clk = NULL;
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300377 goto err_conf;
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400378 }
379 }
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400380
381 ac97_clk = clk_get(&dev->dev, "AC97CLK");
382 if (IS_ERR(ac97_clk)) {
383 ret = PTR_ERR(ac97_clk);
384 ac97_clk = NULL;
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300385 goto err_clk;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400386 }
387
Robert Jarzmik4091d342014-06-09 21:59:12 +0200388 ret = clk_prepare_enable(ac97_clk);
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300389 if (ret)
390 goto err_clk2;
391
Yong Zhang88e24c32011-09-22 16:59:20 +0800392 ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, 0, "AC97", NULL);
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300393 if (ret < 0)
394 goto err_irq;
395
396 return 0;
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400397
398err_irq:
399 GCR |= GCR_ACLINK_OFF;
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300400err_clk2:
401 clk_put(ac97_clk);
402 ac97_clk = NULL;
403err_clk:
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400404 if (ac97conf_clk) {
405 clk_put(ac97conf_clk);
406 ac97conf_clk = NULL;
407 }
Dmitry Baryshkov79612332009-01-05 12:58:06 +0300408err_conf:
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400409 return ret;
410}
411EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
412
413void pxa2xx_ac97_hw_remove(struct platform_device *dev)
414{
Mike Dunn3b4bc7b2013-01-07 13:55:13 -0800415 if (cpu_is_pxa27x())
416 gpio_free(reset_gpio);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400417 GCR |= GCR_ACLINK_OFF;
418 free_irq(IRQ_AC97, NULL);
Dmitry Baryshkov9d1cf392008-09-10 05:01:18 +0400419 if (ac97conf_clk) {
420 clk_put(ac97conf_clk);
421 ac97conf_clk = NULL;
422 }
Robert Jarzmik4091d342014-06-09 21:59:12 +0200423 clk_disable_unprepare(ac97_clk);
Dmitry Baryshkov9c636342008-09-10 05:01:17 +0400424 clk_put(ac97_clk);
425 ac97_clk = NULL;
426}
427EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
428
429MODULE_AUTHOR("Nicolas Pitre");
430MODULE_DESCRIPTION("Intel/Marvell PXA sound library");
431MODULE_LICENSE("GPL");
432