Lines Matching +full:ac97 +full:- +full:controller
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Based on sound/arm/pxa2xx-ac97.c and sound/soc/pxa/pxa2xx-ac97.c
22 #include <sound/pxa2xx-lib.h>
24 #include <linux/platform_data/asoc-pxa.h>
26 #include "pxa2xx-ac97-regs.h"
39 * o Slot 12 read from modem space will hang controller.
48 int val = -ENODEV; in pxa2xx_ac97_read()
52 return -ENODEV; in pxa2xx_ac97_read()
65 /* start read access across the ac97 link */ in pxa2xx_ac97_read()
75 val = -ETIMEDOUT; in pxa2xx_ac97_read()
114 ret = -EIO; in pxa2xx_ac97_write()
146 /* warm reset broken on Bulverde, so manually keep AC97 reset high */ in pxa_ac97_warm_pxa27x()
220 while (!((readl(ac97_reg_base + GSR) | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) in pxa2xx_ac97_try_warm_reset()
257 while (!((readl(ac97_reg_base + GSR) | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) in pxa2xx_ac97_try_cold_reset()
328 pxa2xx_audio_ops_t *pdata = dev->dev.platform_data; in pxa2xx_ac97_hw_probe()
332 dev_err(&dev->dev, "Missing MMIO resource\n"); in pxa2xx_ac97_hw_probe()
337 switch (pdata->reset_gpio) { in pxa2xx_ac97_hw_probe()
340 reset_gpio = pdata->reset_gpio; in pxa2xx_ac97_hw_probe()
345 case -1: in pxa2xx_ac97_hw_probe()
348 dev_err(&dev->dev, "Invalid reset GPIO %d\n", in pxa2xx_ac97_hw_probe()
349 pdata->reset_gpio); in pxa2xx_ac97_hw_probe()
351 } else if (!pdata && dev->dev.of_node) { in pxa2xx_ac97_hw_probe()
352 pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); in pxa2xx_ac97_hw_probe()
354 return -ENOMEM; in pxa2xx_ac97_hw_probe()
355 pdata->reset_gpio = of_get_named_gpio(dev->dev.of_node, in pxa2xx_ac97_hw_probe()
356 "reset-gpios", 0); in pxa2xx_ac97_hw_probe()
357 if (pdata->reset_gpio == -ENOENT) in pxa2xx_ac97_hw_probe()
358 pdata->reset_gpio = -1; in pxa2xx_ac97_hw_probe()
359 else if (pdata->reset_gpio < 0) in pxa2xx_ac97_hw_probe()
360 return pdata->reset_gpio; in pxa2xx_ac97_hw_probe()
361 reset_gpio = pdata->reset_gpio; in pxa2xx_ac97_hw_probe()
369 * This gpio is needed for a work-around to a bug in the ac97 in pxa2xx_ac97_hw_probe()
370 * controller during warm reset. The direction and level is set in pxa2xx_ac97_hw_probe()
375 "pxa27x ac97 reset"); in pxa2xx_ac97_hw_probe()
383 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK"); in pxa2xx_ac97_hw_probe()
391 ac97_clk = clk_get(&dev->dev, "AC97CLK"); in pxa2xx_ac97_hw_probe()
408 ret = request_irq(irq, pxa2xx_ac97_irq, 0, "AC97", NULL); in pxa2xx_ac97_hw_probe()