Lines Matching +full:ac97 +full:- +full:controller
1 // SPDX-License-Identifier: GPL-2.0
3 // Hitachi Audio Controller (AC97) support for SH7760/SH7780
10 /* BIG FAT FIXME: although the SH7760 has 2 independent AC97 units, only
13 * to edit the code a bit to use the other AC97 unit. --mlau
40 #define CR_CR (1 << 15) /* "codec-ready" indicator */
44 #define CR_ST (1 << 5) /* AC97 link start bit */
46 #define CSAR_RD (1 << 19) /* AC97 data read bit */
69 /* manual-suggested AC97 codec access timeouts (us) */
94 #define HACREG(reg) (*(unsigned long *)(hac->mmio + (reg)))
97 * AC97 read/write flow as outlined in the SH7760 manual (pages 903-906)
105 for (i = AC97_READ_RETRY; i; i--) { in hac_get_codec_data()
110 --to1) in hac_get_codec_data()
114 --to2) in hac_get_codec_data()
141 for (i = AC97_READ_RETRY; i; i--) { in hac_read_codec_aux()
150 --to) in hac_read_codec_aux()
162 static void hac_ac97_write(struct snd_ac97 *ac97, unsigned short reg, in hac_ac97_write() argument
165 int unit_id = 0 /* ac97->private_data */; in hac_ac97_write()
169 for (i = AC97_WRITE_RETRY; i; i--) { in hac_ac97_write()
177 /* poll-wait for CMDAMT and CMDDMT */ in hac_ac97_write()
180 --to) in hac_ac97_write()
190 static unsigned short hac_ac97_read(struct snd_ac97 *ac97, in hac_ac97_read() argument
193 int unit_id = 0 /* ac97->private_data */; in hac_ac97_read()
198 static void hac_ac97_warmrst(struct snd_ac97 *ac97) in hac_ac97_warmrst() argument
200 int unit_id = 0 /* ac97->private_data */; in hac_ac97_warmrst()
207 for (tmo = 1000; (tmo > 0) && !(HACREG(HACCR) & CR_CR); tmo--) in hac_ac97_warmrst()
211 printk(KERN_INFO "hac: reset: AC97 link down!\n"); in hac_ac97_warmrst()
216 static void hac_ac97_coldrst(struct snd_ac97 *ac97) in hac_ac97_coldrst() argument
218 int unit_id = 0 /* ac97->private_data */; in hac_ac97_coldrst()
225 hac_ac97_warmrst(ac97); in hac_ac97_coldrst()
239 struct hac_priv *hac = &hac_cpu_data[dai->id]; in hac_hw_params()
240 int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; in hac_hw_params()
242 switch (params->msbits) { in hac_hw_params()
252 pr_debug("hac: invalid depth %d bit\n", params->msbits); in hac_hw_params()
253 return -EINVAL; in hac_hw_params()
272 .name = "hac-dai.0",
289 .name = "hac-dai.1",
310 .name = "sh4-hac",
322 return devm_snd_soc_register_component(&pdev->dev, &sh4_hac_component, in hac_soc_platform_probe()
333 .name = "hac-pcm-audio",
343 MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver");