1 From bae79599259f1e09e362368335febe2a3c9c019b Mon Sep 17 00:00:00 2001
2 From: FERHAT Nicolas <contact@audiophonics.fr>
3 Date: Fri, 5 Apr 2019 13:06:42 +0100
4 Subject: [PATCH] Audiophonics I-Sabre 9038Q2M DAC driver
6 Signed-off-by: Audiophonics <contact@audiophonics.fr>
8 ASoC: i-sabre-q2m: use modern dai_link style
10 Signed-off-by: Hui Wang <hui.wang@canonical.com>
12 sound/soc/bcm/Kconfig | 7 +
13 sound/soc/bcm/Makefile | 2 +
14 sound/soc/bcm/i-sabre-q2m.c | 158 +++++++++++++
15 sound/soc/codecs/Kconfig | 5 +
16 sound/soc/codecs/Makefile | 2 +
17 sound/soc/codecs/i-sabre-codec.c | 392 +++++++++++++++++++++++++++++++
18 sound/soc/codecs/i-sabre-codec.h | 42 ++++
19 7 files changed, 608 insertions(+)
20 create mode 100644 sound/soc/bcm/i-sabre-q2m.c
21 create mode 100644 sound/soc/codecs/i-sabre-codec.c
22 create mode 100644 sound/soc/codecs/i-sabre-codec.h
24 --- a/sound/soc/bcm/Kconfig
25 +++ b/sound/soc/bcm/Kconfig
26 @@ -119,6 +119,13 @@ config SND_BCM2708_SOC_IQAUDIO_DIGI
28 Say Y or M if you want to add support for IQAudIO Digital IO board.
30 +config SND_BCM2708_SOC_I_SABRE_Q2M
31 + tristate "Support for Audiophonics I-Sabre Q2M DAC"
32 + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
33 + select SND_SOC_I_SABRE_CODEC
35 + Say Y or M if you want to add support for Audiophonics I-SABRE Q2M DAC
37 config SND_BCM2708_SOC_ADAU1977_ADC
38 tristate "Support for ADAU1977 ADC"
39 depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
40 --- a/sound/soc/bcm/Makefile
41 +++ b/sound/soc/bcm/Makefile
42 @@ -19,6 +19,7 @@ snd-soc-justboom-dac-objs := justboom-da
43 snd-soc-rpi-cirrus-objs := rpi-cirrus.o
44 snd-soc-rpi-proto-objs := rpi-proto.o
45 snd-soc-iqaudio-dac-objs := iqaudio-dac.o
46 + snd-soc-i-sabre-q2m-objs := i-sabre-q2m.o
47 snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o
48 snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o
49 snd-soc-audiosense-pi-objs := audiosense-pi.o
50 @@ -41,6 +42,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DA
51 obj-$(CONFIG_SND_BCM2708_SOC_RPI_CIRRUS) += snd-soc-rpi-cirrus.o
52 obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o
53 obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o
54 + obj-$(CONFIG_SND_BCM2708_SOC_I_SABRE_Q2M) += snd-soc-i-sabre-q2m.o
55 obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o
56 obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-soundcard.o
57 obj-$(CONFIG_SND_AUDIOSENSE_PI) += snd-soc-audiosense-pi.o
59 +++ b/sound/soc/bcm/i-sabre-q2m.c
62 + * ASoC Driver for I-Sabre Q2M
64 + * Author: Satoru Kawase
65 + * Modified by: Xiao Qingyong
66 + * Update kernel v4.18+ by : Audiophonics
67 + * Copyright 2018 Audiophonics
69 + * This program is free software; you can redistribute it and/or
70 + * modify it under the terms of the GNU General Public License
71 + * version 2 as published by the Free Software Foundation.
73 + * This program is distributed in the hope that it will be useful, but
74 + * WITHOUT ANY WARRANTY; without even the implied warranty of
75 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
76 + * General Public License for more details.
79 +#include <linux/kernel.h>
80 +#include <linux/init.h>
81 +#include <linux/module.h>
82 +#include <linux/delay.h>
83 +#include <linux/fs.h>
84 +#include <asm/uaccess.h>
85 +#include <sound/core.h>
86 +#include <sound/soc.h>
87 +#include <sound/pcm.h>
88 +#include <sound/pcm_params.h>
90 +#include "../codecs/i-sabre-codec.h"
93 +static int snd_rpi_i_sabre_q2m_init(struct snd_soc_pcm_runtime *rtd)
95 + struct snd_soc_component *component = rtd->codec_dai->component;
99 + value = snd_soc_component_read32(component, ISABRECODEC_REG_01);
100 + dev_info(component->card->dev, "Audiophonics Device ID : %02X\n", value);
103 + value = snd_soc_component_read32(component, ISABRECODEC_REG_02);
104 + dev_info(component->card->dev, "Audiophonics API revision : %02X\n", value);
109 +static int snd_rpi_i_sabre_q2m_hw_params(
110 + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
112 + struct snd_soc_pcm_runtime *rtd = substream->private_data;
113 + struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
116 + bclk_ratio = snd_pcm_format_physical_width(
117 + params_format(params)) * params_channels(params);
118 + return snd_soc_dai_set_bclk_ratio(cpu_dai, bclk_ratio);
121 +/* machine stream operations */
122 +static struct snd_soc_ops snd_rpi_i_sabre_q2m_ops = {
123 + .hw_params = snd_rpi_i_sabre_q2m_hw_params,
126 +SND_SOC_DAILINK_DEFS(rpi_i_sabre_q2m,
127 + DAILINK_COMP_ARRAY(COMP_CPU("bcm2708-i2s.0")),
128 + DAILINK_COMP_ARRAY(COMP_CODEC("i-sabre-codec-i2c.1-0048", "i-sabre-codec-dai")),
129 + DAILINK_COMP_ARRAY(COMP_PLATFORM("bcm2708-i2s.0")));
131 +static struct snd_soc_dai_link snd_rpi_i_sabre_q2m_dai[] = {
133 + .name = "I-Sabre Q2M",
134 + .stream_name = "I-Sabre Q2M DAC",
135 + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
136 + | SND_SOC_DAIFMT_CBS_CFS,
137 + .init = snd_rpi_i_sabre_q2m_init,
138 + .ops = &snd_rpi_i_sabre_q2m_ops,
139 + SND_SOC_DAILINK_REG(rpi_i_sabre_q2m),
143 +/* audio machine driver */
144 +static struct snd_soc_card snd_rpi_i_sabre_q2m = {
145 + .name = "I-Sabre Q2M DAC",
146 + .owner = THIS_MODULE,
147 + .dai_link = snd_rpi_i_sabre_q2m_dai,
148 + .num_links = ARRAY_SIZE(snd_rpi_i_sabre_q2m_dai)
152 +static int snd_rpi_i_sabre_q2m_probe(struct platform_device *pdev)
156 + snd_rpi_i_sabre_q2m.dev = &pdev->dev;
157 + if (pdev->dev.of_node) {
158 + struct device_node *i2s_node;
159 + struct snd_soc_dai_link *dai;
161 + dai = &snd_rpi_i_sabre_q2m_dai[0];
162 + i2s_node = of_parse_phandle(pdev->dev.of_node,
163 + "i2s-controller", 0);
165 + dai->cpus->dai_name = NULL;
166 + dai->cpus->of_node = i2s_node;
167 + dai->platforms->name = NULL;
168 + dai->platforms->of_node = i2s_node;
170 + dev_err(&pdev->dev,
171 + "Property 'i2s-controller' missing or invalid\n");
175 + dai->name = "I-Sabre Q2M";
176 + dai->stream_name = "I-Sabre Q2M DAC";
177 + dai->dai_fmt = SND_SOC_DAIFMT_I2S
178 + | SND_SOC_DAIFMT_NB_NF
179 + | SND_SOC_DAIFMT_CBS_CFS;
182 + /* Wait for registering codec driver */
185 + ret = snd_soc_register_card(&snd_rpi_i_sabre_q2m);
187 + dev_err(&pdev->dev,
188 + "snd_soc_register_card() failed: %d\n", ret);
194 +static int snd_rpi_i_sabre_q2m_remove(struct platform_device *pdev)
196 + return snd_soc_unregister_card(&snd_rpi_i_sabre_q2m);
199 +static const struct of_device_id snd_rpi_i_sabre_q2m_of_match[] = {
200 + { .compatible = "audiophonics,i-sabre-q2m", },
203 +MODULE_DEVICE_TABLE(of, snd_rpi_i_sabre_q2m_of_match);
205 +static struct platform_driver snd_rpi_i_sabre_q2m_driver = {
207 + .name = "snd-rpi-i-sabre-q2m",
208 + .owner = THIS_MODULE,
209 + .of_match_table = snd_rpi_i_sabre_q2m_of_match,
211 + .probe = snd_rpi_i_sabre_q2m_probe,
212 + .remove = snd_rpi_i_sabre_q2m_remove,
214 +module_platform_driver(snd_rpi_i_sabre_q2m_driver);
216 +MODULE_DESCRIPTION("ASoC Driver for I-Sabre Q2M");
217 +MODULE_AUTHOR("Audiophonics <http://www.audiophonics.fr>");
218 +MODULE_LICENSE("GPL");
219 --- a/sound/soc/codecs/Kconfig
220 +++ b/sound/soc/codecs/Kconfig
221 @@ -97,6 +97,7 @@ config SND_SOC_ALL_CODECS
222 select SND_SOC_ICS43432
223 select SND_SOC_INNO_RK3036
224 select SND_SOC_ISABELLE if I2C
225 + select SND_SOC_I_SABRE_CODEC if I2C
226 select SND_SOC_JZ4740_CODEC
227 select SND_SOC_JZ4725B_CODEC
228 select SND_SOC_LM4857 if I2C
229 @@ -1497,4 +1498,8 @@ config SND_SOC_TPA6130A2
230 tristate "Texas Instruments TPA6130A2 headphone amplifier"
233 +config SND_SOC_I_SABRE_CODEC
234 + tristate "Audiophonics I-SABRE Codec"
238 --- a/sound/soc/codecs/Makefile
239 +++ b/sound/soc/codecs/Makefile
240 @@ -92,6 +92,7 @@ snd-soc-hdac-hda-objs := hdac_hda.o
241 snd-soc-ics43432-objs := ics43432.o
242 snd-soc-inno-rk3036-objs := inno_rk3036.o
243 snd-soc-isabelle-objs := isabelle.o
244 +snd-soc-i-sabre-codec-objs := i-sabre-codec.o
245 snd-soc-jz4740-codec-objs := jz4740.o
246 snd-soc-jz4725b-codec-objs := jz4725b.o
247 snd-soc-l3-objs := l3.o
248 @@ -378,6 +379,7 @@ obj-$(CONFIG_SND_SOC_HDAC_HDA) += snd-so
249 obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o
250 obj-$(CONFIG_SND_SOC_INNO_RK3036) += snd-soc-inno-rk3036.o
251 obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o
252 +obj-$(CONFIG_SND_SOC_I_SABRE_CODEC) += snd-soc-i-sabre-codec.o
253 obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o
254 obj-$(CONFIG_SND_SOC_JZ4725B_CODEC) += snd-soc-jz4725b-codec.o
255 obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
257 +++ b/sound/soc/codecs/i-sabre-codec.c
260 + * Driver for I-Sabre Q2M
262 + * Author: Satoru Kawase
263 + * Modified by: Xiao Qingyong
264 + * Modified by: JC BARBAUD (Mute)
265 + * Update kernel v4.18+ by : Audiophonics
266 + * Copyright 2018 Audiophonics
268 + * This program is free software; you can redistribute it and/or
269 + * modify it under the terms of the GNU General Public License
270 + * version 2 as published by the Free Software Foundation.
272 + * This program is distributed in the hope that it will be useful, but
273 + * WITHOUT ANY WARRANTY; without even the implied warranty of
274 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
275 + * General Public License for more details.
279 +#include <linux/init.h>
280 +#include <linux/module.h>
281 +#include <linux/regmap.h>
282 +#include <linux/i2c.h>
283 +#include <sound/soc.h>
284 +#include <sound/pcm_params.h>
285 +#include <sound/tlv.h>
287 +#include "i-sabre-codec.h"
290 +/* I-Sabre Q2M Codec Private Data */
291 +struct i_sabre_codec_priv {
292 + struct regmap *regmap;
297 +/* I-Sabre Q2M Codec Default Register Value */
298 +static const struct reg_default i_sabre_codec_reg_defaults[] = {
299 + { ISABRECODEC_REG_10, 0x00 },
300 + { ISABRECODEC_REG_20, 0x00 },
301 + { ISABRECODEC_REG_21, 0x00 },
302 + { ISABRECODEC_REG_22, 0x00 },
303 + { ISABRECODEC_REG_24, 0x00 },
307 +static bool i_sabre_codec_writeable(struct device *dev, unsigned int reg)
310 + case ISABRECODEC_REG_10:
311 + case ISABRECODEC_REG_20:
312 + case ISABRECODEC_REG_21:
313 + case ISABRECODEC_REG_22:
314 + case ISABRECODEC_REG_24:
322 +static bool i_sabre_codec_readable(struct device *dev, unsigned int reg)
325 + case ISABRECODEC_REG_01:
326 + case ISABRECODEC_REG_02:
327 + case ISABRECODEC_REG_10:
328 + case ISABRECODEC_REG_20:
329 + case ISABRECODEC_REG_21:
330 + case ISABRECODEC_REG_22:
331 + case ISABRECODEC_REG_24:
339 +static bool i_sabre_codec_volatile(struct device *dev, unsigned int reg)
342 + case ISABRECODEC_REG_01:
343 + case ISABRECODEC_REG_02:
353 +static const DECLARE_TLV_DB_SCALE(volume_tlv, -10000, 100, 0);
357 +static const char * const fir_filter_type_texts[] = {
359 + "corrected minimum phase fast",
360 + "minimum phase slow",
361 + "minimum phase fast",
362 + "linear phase slow",
363 + "linear phase fast",
367 +static SOC_ENUM_SINGLE_DECL(i_sabre_fir_filter_type_enum,
368 + ISABRECODEC_REG_22, 0, fir_filter_type_texts);
371 +/* I2S / SPDIF Select */
372 +static const char * const iis_spdif_sel_texts[] = {
377 +static SOC_ENUM_SINGLE_DECL(i_sabre_iis_spdif_sel_enum,
378 + ISABRECODEC_REG_24, 0, iis_spdif_sel_texts);
382 +static const struct snd_kcontrol_new i_sabre_codec_controls[] = {
383 +SOC_SINGLE_RANGE_TLV("Digital Playback Volume", ISABRECODEC_REG_20, 0, 0, 100, 1, volume_tlv),
384 +SOC_SINGLE("Digital Playback Switch", ISABRECODEC_REG_21, 0, 1, 1),
385 +SOC_ENUM("FIR Filter Type", i_sabre_fir_filter_type_enum),
386 +SOC_ENUM("I2S/SPDIF Select", i_sabre_iis_spdif_sel_enum),
390 +static const u32 i_sabre_codec_dai_rates_slave[] = {
391 + 8000, 11025, 16000, 22050, 32000,
392 + 44100, 48000, 64000, 88200, 96000,
393 + 176400, 192000, 352800, 384000,
394 + 705600, 768000, 1411200, 1536000
397 +static const struct snd_pcm_hw_constraint_list constraints_slave = {
398 + .list = i_sabre_codec_dai_rates_slave,
399 + .count = ARRAY_SIZE(i_sabre_codec_dai_rates_slave),
402 +static int i_sabre_codec_dai_startup_slave(
403 + struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
405 + struct snd_soc_component *component = dai->component;
408 + ret = snd_pcm_hw_constraint_list(substream->runtime,
409 + 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_slave);
411 + dev_err(component->card->dev, "Failed to setup rates constraints: %d\n", ret);
417 +static int i_sabre_codec_dai_startup(
418 + struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
420 + struct snd_soc_component *component = dai->component;
421 + struct i_sabre_codec_priv *i_sabre_codec
422 + = snd_soc_component_get_drvdata(component);
424 + switch (i_sabre_codec->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
425 + case SND_SOC_DAIFMT_CBS_CFS:
426 + return i_sabre_codec_dai_startup_slave(substream, dai);
433 +static int i_sabre_codec_hw_params(
434 + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params,
435 + struct snd_soc_dai *dai)
437 + struct snd_soc_component *component = dai->component;
438 + struct i_sabre_codec_priv *i_sabre_codec
439 + = snd_soc_component_get_drvdata(component);
440 + unsigned int daifmt;
443 + dev_dbg(component->card->dev, "hw_params %u Hz, %u channels\n",
444 + params_rate(params), params_channels(params));
446 + /* Check I2S Format (Bit Size) */
447 + format_width = snd_pcm_format_width(params_format(params));
448 + if ((format_width != 32) && (format_width != 16)) {
449 + dev_err(component->card->dev, "Bad frame size: %d\n",
450 + snd_pcm_format_width(params_format(params)));
454 + /* Check Slave Mode */
455 + daifmt = i_sabre_codec->fmt & SND_SOC_DAIFMT_MASTER_MASK;
456 + if (daifmt != SND_SOC_DAIFMT_CBS_CFS) {
460 + /* Notify Sampling Frequency */
461 + switch (params_rate(params))
469 + snd_soc_component_update_bits(component, ISABRECODEC_REG_10, 0x01, 0x00);
478 + snd_soc_component_update_bits(component, ISABRECODEC_REG_10, 0x01, 0x01);
485 +static int i_sabre_codec_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
487 + struct snd_soc_component *component = dai->component;
488 + struct i_sabre_codec_priv *i_sabre_codec
489 + = snd_soc_component_get_drvdata(component);
491 + /* interface format */
492 + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
493 + case SND_SOC_DAIFMT_I2S:
496 + case SND_SOC_DAIFMT_RIGHT_J:
497 + case SND_SOC_DAIFMT_LEFT_J:
502 + /* clock inversion */
503 + if ((fmt & SND_SOC_DAIFMT_INV_MASK) != SND_SOC_DAIFMT_NB_NF) {
507 + /* Set Audio Data Format */
508 + i_sabre_codec->fmt = fmt;
513 +static int i_sabre_codec_dac_mute(struct snd_soc_dai *dai, int mute)
515 + struct snd_soc_component *component = dai->component;
518 + snd_soc_component_update_bits(component, ISABRECODEC_REG_21, 0x01, 0x01);
520 + snd_soc_component_update_bits(component, ISABRECODEC_REG_21, 0x01, 0x00);
527 +static const struct snd_soc_dai_ops i_sabre_codec_dai_ops = {
528 + .startup = i_sabre_codec_dai_startup,
529 + .hw_params = i_sabre_codec_hw_params,
530 + .set_fmt = i_sabre_codec_set_fmt,
531 + .digital_mute = i_sabre_codec_dac_mute,
534 +static struct snd_soc_dai_driver i_sabre_codec_dai = {
535 + .name = "i-sabre-codec-dai",
537 + .stream_name = "Playback",
540 + .rates = SNDRV_PCM_RATE_CONTINUOUS,
542 + .rate_max = 1536000,
543 + .formats = SNDRV_PCM_FMTBIT_S16_LE
544 + | SNDRV_PCM_FMTBIT_S32_LE,
546 + .ops = &i_sabre_codec_dai_ops,
549 +static struct snd_soc_component_driver i_sabre_codec_codec_driver = {
550 + .controls = i_sabre_codec_controls,
551 + .num_controls = ARRAY_SIZE(i_sabre_codec_controls),
555 +static const struct regmap_config i_sabre_codec_regmap = {
558 + .max_register = ISABRECODEC_MAX_REG,
560 + .reg_defaults = i_sabre_codec_reg_defaults,
561 + .num_reg_defaults = ARRAY_SIZE(i_sabre_codec_reg_defaults),
563 + .writeable_reg = i_sabre_codec_writeable,
564 + .readable_reg = i_sabre_codec_readable,
565 + .volatile_reg = i_sabre_codec_volatile,
567 + .cache_type = REGCACHE_RBTREE,
571 +static int i_sabre_codec_probe(struct device *dev, struct regmap *regmap)
573 + struct i_sabre_codec_priv *i_sabre_codec;
576 + i_sabre_codec = devm_kzalloc(dev, sizeof(*i_sabre_codec), GFP_KERNEL);
577 + if (!i_sabre_codec) {
578 + dev_err(dev, "devm_kzalloc");
582 + i_sabre_codec->regmap = regmap;
584 + dev_set_drvdata(dev, i_sabre_codec);
586 + ret = snd_soc_register_component(dev,
587 + &i_sabre_codec_codec_driver, &i_sabre_codec_dai, 1);
589 + dev_err(dev, "Failed to register CODEC: %d\n", ret);
596 +static void i_sabre_codec_remove(struct device *dev)
598 + snd_soc_unregister_component(dev);
602 +static int i_sabre_codec_i2c_probe(
603 + struct i2c_client *i2c, const struct i2c_device_id *id)
605 + struct regmap *regmap;
607 + regmap = devm_regmap_init_i2c(i2c, &i_sabre_codec_regmap);
608 + if (IS_ERR(regmap)) {
609 + return PTR_ERR(regmap);
612 + return i_sabre_codec_probe(&i2c->dev, regmap);
615 +static int i_sabre_codec_i2c_remove(struct i2c_client *i2c)
617 + i_sabre_codec_remove(&i2c->dev);
623 +static const struct i2c_device_id i_sabre_codec_i2c_id[] = {
624 + { "i-sabre-codec", },
627 +MODULE_DEVICE_TABLE(i2c, i_sabre_codec_i2c_id);
629 +static const struct of_device_id i_sabre_codec_of_match[] = {
630 + { .compatible = "audiophonics,i-sabre-codec", },
633 +MODULE_DEVICE_TABLE(of, i_sabre_codec_of_match);
635 +static struct i2c_driver i_sabre_codec_i2c_driver = {
637 + .name = "i-sabre-codec-i2c",
638 + .owner = THIS_MODULE,
639 + .of_match_table = of_match_ptr(i_sabre_codec_of_match),
641 + .probe = i_sabre_codec_i2c_probe,
642 + .remove = i_sabre_codec_i2c_remove,
643 + .id_table = i_sabre_codec_i2c_id,
645 +module_i2c_driver(i_sabre_codec_i2c_driver);
648 +MODULE_DESCRIPTION("ASoC I-Sabre Q2M codec driver");
649 +MODULE_AUTHOR("Audiophonics <http://www.audiophonics.fr>");
650 +MODULE_LICENSE("GPL");
652 +++ b/sound/soc/codecs/i-sabre-codec.h
655 + * Driver for I-Sabre Q2M
657 + * Author: Satoru Kawase
658 + * Modified by: Xiao Qingyong
659 + * Copyright 2018 Audiophonics
661 + * This program is free software; you can redistribute it and/or
662 + * modify it under the terms of the GNU General Public License
663 + * version 2 as published by the Free Software Foundation.
665 + * This program is distributed in the hope that it will be useful, but
666 + * WITHOUT ANY WARRANTY; without even the implied warranty of
667 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
668 + * General Public License for more details.
671 +#ifndef _SND_SOC_ISABRECODEC
672 +#define _SND_SOC_ISABRECODEC
675 +/* ISABRECODEC Register Address */
676 +#define ISABRECODEC_REG_01 0x01 /* Virtual Device ID : 0x01 = es9038q2m */
677 +#define ISABRECODEC_REG_02 0x02 /* API revision : 0x01 = Revision 01 */
678 +#define ISABRECODEC_REG_10 0x10 /* 0x01 = above 192kHz, 0x00 = otherwise */
679 +#define ISABRECODEC_REG_20 0x20 /* 0 - 100 (decimal value, 0 = min., 100 = max.) */
680 +#define ISABRECODEC_REG_21 0x21 /* 0x00 = Mute OFF, 0x01 = Mute ON */
681 +#define ISABRECODEC_REG_22 0x22
684 + 0x01 = corrected minimum phase fast,
685 + 0x02 = minimum phase slow,
686 + 0x03 = minimum phase fast,
687 + 0x04 = linear phase slow,
688 + 0x05 = linear phase fast,
689 + 0x06 = apodizing fast,
691 +//#define ISABRECODEC_REG_23 0x23 /* reserved */
692 +#define ISABRECODEC_REG_24 0x24 /* 0x00 = I2S, 0x01 = SPDIF */
693 +#define ISABRECODEC_MAX_REG 0x24 /* Maximum Register Number */
695 +#endif /* _SND_SOC_ISABRECODEC */