Lines Matching defs:aic26
32 struct aic26 {
52 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
68 rc = spi_write_then_read(aic26->spi, buffer, 2, buffer, 2);
70 dev_err(&aic26->spi->dev, "AIC26 reg read error\n");
96 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
114 rc = spi_write(aic26->spi, buffer, 4);
116 dev_err(&aic26->spi->dev, "AIC26 reg read error\n");
135 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
139 dev_dbg(&aic26->spi->dev, "aic26_hw_params(substream=%p, params=%p)\n",
141 dev_dbg(&aic26->spi->dev, "rate=%i format=%i\n", params_rate(params),
155 dev_dbg(&aic26->spi->dev, "bad rate\n"); return -EINVAL;
165 dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
181 if (aic26->master)
190 reg |= wlen | aic26->datfm | (divisor << 3) | divisor;
202 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
205 dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n",
221 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
223 dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i,"
231 aic26->mclk = freq;
238 struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
240 dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n",
245 case SND_SOC_DAIFMT_CBM_CFM: aic26->master = 1; break;
246 case SND_SOC_DAIFMT_CBS_CFS: aic26->master = 0; break;
248 dev_dbg(&aic26->spi->dev, "bad master\n"); return -EINVAL;
253 case SND_SOC_DAIFMT_I2S: aic26->datfm = AIC26_DATFM_I2S; break;
254 case SND_SOC_DAIFMT_DSP_A: aic26->datfm = AIC26_DATFM_DSP; break;
255 case SND_SOC_DAIFMT_RIGHT_J: aic26->datfm = AIC26_DATFM_RIGHTJ; break;
256 case SND_SOC_DAIFMT_LEFT_J: aic26->datfm = AIC26_DATFM_LEFTJ; break;
258 dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
328 struct aic26 *aic26;
335 /* Fetch the relevant aic26 private data here (it's already been
337 aic26 = socdev->codec_data;
338 if (aic26 == NULL) {
339 dev_err(&pdev->dev, "aic26: missing codec pointer\n");
342 codec = &aic26->codec;
350 dev_err(&pdev->dev, "aic26: failed to create pcms\n");
383 struct aic26 *aic26 = dev_get_drvdata(dev);
386 val = aic26_reg_read_cache(&aic26->codec, AIC26_REG_AUDIO_CTRL2);
399 struct aic26 *aic26 = dev_get_drvdata(dev);
402 val = aic26_reg_read_cache(&aic26->codec, AIC26_REG_AUDIO_CTRL2);
404 aic26_reg_write(&aic26->codec, AIC26_REG_AUDIO_CTRL2, val);
417 struct aic26 *aic26;
423 aic26 = kzalloc(sizeof *aic26, GFP_KERNEL);
424 if (!aic26)
428 aic26->spi = spi;
429 dev_set_drvdata(&spi->dev, aic26);
434 snd_soc_codec_set_drvdata(&aic26->codec, aic26);
435 aic26->codec.name = "aic26";
436 aic26->codec.owner = THIS_MODULE;
437 aic26->codec.dai = &aic26_dai;
438 aic26->codec.num_dai = 1;
439 aic26->codec.read = aic26_reg_read;
440 aic26->codec.write = aic26_reg_write;
441 aic26->master = 1;
442 mutex_init(&aic26->codec.mutex);
443 INIT_LIST_HEAD(&aic26->codec.dapm_widgets);
444 INIT_LIST_HEAD(&aic26->codec.dapm_paths);
445 aic26->codec.reg_cache_size = AIC26_NUM_REGS;
446 aic26->codec.reg_cache = aic26->reg_cache;
452 kfree(aic26);
457 aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00);
460 aic26_reg_write(&aic26->codec, AIC26_REG_POWER_CTRL, 0);
463 reg = aic26_reg_read(&aic26->codec, AIC26_REG_AUDIO_CTRL3);
466 aic26_reg_write(&aic26->codec, AIC26_REG_AUDIO_CTRL3, reg);
469 for (i = 0; i < ARRAY_SIZE(aic26->reg_cache); i++)
470 aic26_reg_read(&aic26->codec, i);
480 of_snd_soc_register_codec(&aic26_soc_codec_dev, aic26, &aic26_dai,
490 struct aic26 *aic26 = dev_get_drvdata(&spi->dev);
493 kfree(aic26);