Lines Matching +full:codec +full:- +full:irq
1 // SPDX-License-Identifier: GPL-2.0-only
8 * (C) Copyright TOSHIBA CORPORATION 2004-2006
17 #include <asm/mach-tx39xx/ioremap.h> /* for TXX9_DIRECTMAP_BASE */
42 return __raw_readl(drvdata->base + ACINTSTS) & ACINT_REGACCRDY; in txx9aclc_regready()
45 /* AC97 controller reads codec register */
50 void __iomem *base = drvdata->base; in txx9aclc_ac97_read()
53 if (!(__raw_readl(base + ACINTSTS) & ACINT_CODECRDY(ac97->num))) in txx9aclc_ac97_read()
55 reg |= ac97->num << 7; in txx9aclc_ac97_read()
78 /* AC97 controller writes to codec register */
83 void __iomem *base = drvdata->base; in txx9aclc_ac97_write()
85 __raw_writel(((reg | (ac97->num << 7)) << ACREGACC_REG_SHIFT) | in txx9aclc_ac97_write()
99 void __iomem *base = drvdata->base; in txx9aclc_ac97_cold_reset()
100 u32 ready = ACINT_CODECRDY(ac97->num) | ACINT_REGACCRDY; in txx9aclc_ac97_cold_reset()
105 /* wait for primary codec ready status */ in txx9aclc_ac97_cold_reset()
110 dev_err(&ac97->dev, "primary codec is not ready " in txx9aclc_ac97_cold_reset()
125 static irqreturn_t txx9aclc_ac97_irq(int irq, void *dev_id) in txx9aclc_ac97_irq() argument
128 void __iomem *base = drvdata->base; in txx9aclc_ac97_irq()
145 /* disable AC-link */ in txx9aclc_ac97_remove()
146 __raw_writel(ACCTL_ENLINK, drvdata->base + ACCTLDIS); in txx9aclc_ac97_remove()
169 .name = "txx9aclc-ac97",
177 int irq; in txx9aclc_ac97_dev_probe() local
179 irq = platform_get_irq(pdev, 0); in txx9aclc_ac97_dev_probe()
180 if (irq < 0) in txx9aclc_ac97_dev_probe()
181 return irq; in txx9aclc_ac97_dev_probe()
183 drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); in txx9aclc_ac97_dev_probe()
185 return -ENOMEM; in txx9aclc_ac97_dev_probe()
188 drvdata->base = devm_ioremap_resource(&pdev->dev, r); in txx9aclc_ac97_dev_probe()
189 if (IS_ERR(drvdata->base)) in txx9aclc_ac97_dev_probe()
190 return PTR_ERR(drvdata->base); in txx9aclc_ac97_dev_probe()
193 drvdata->physbase = r->start; in txx9aclc_ac97_dev_probe()
194 if (sizeof(drvdata->physbase) > sizeof(r->start) && in txx9aclc_ac97_dev_probe()
195 r->start >= TXX9_DIRECTMAP_BASE && in txx9aclc_ac97_dev_probe()
196 r->start < TXX9_DIRECTMAP_BASE + 0x400000) in txx9aclc_ac97_dev_probe()
197 drvdata->physbase |= 0xf00000000ull; in txx9aclc_ac97_dev_probe()
198 err = devm_request_irq(&pdev->dev, irq, txx9aclc_ac97_irq, in txx9aclc_ac97_dev_probe()
199 0, dev_name(&pdev->dev), drvdata); in txx9aclc_ac97_dev_probe()
207 return devm_snd_soc_register_component(&pdev->dev, &txx9aclc_ac97_component, in txx9aclc_ac97_dev_probe()
221 .name = "txx9aclc-ac97",
230 MODULE_ALIAS("platform:txx9aclc-ac97");