pcm1789.c (3eb66e91a25497065c5322b1268cbc3953642227) pcm1789.c (1eb2c43d26a585bbbe196360e921c5ffe9d00fd1)
1// SPDX-License-Identifier: GPL-2.0
2// Audio driver for PCM1789
3// Copyright (C) 2018 Bootlin
4// Mylène Josserand <mylene.josserand@bootlin.com>
5
6#include <linux/gpio/consumer.h>
7#include <linux/module.h>
8#include <linux/workqueue.h>

--- 46 unchanged lines hidden (view full) ---

55 struct snd_soc_component *component = codec_dai->component;
56 struct pcm1789_private *priv = snd_soc_component_get_drvdata(component);
57
58 priv->format = format;
59
60 return 0;
61}
62
1// SPDX-License-Identifier: GPL-2.0
2// Audio driver for PCM1789
3// Copyright (C) 2018 Bootlin
4// Mylène Josserand <mylene.josserand@bootlin.com>
5
6#include <linux/gpio/consumer.h>
7#include <linux/module.h>
8#include <linux/workqueue.h>

--- 46 unchanged lines hidden (view full) ---

55 struct snd_soc_component *component = codec_dai->component;
56 struct pcm1789_private *priv = snd_soc_component_get_drvdata(component);
57
58 priv->format = format;
59
60 return 0;
61}
62
63static int pcm1789_digital_mute(struct snd_soc_dai *codec_dai, int mute)
63static int pcm1789_mute(struct snd_soc_dai *codec_dai, int mute, int direction)
64{
65 struct snd_soc_component *component = codec_dai->component;
66 struct pcm1789_private *priv = snd_soc_component_get_drvdata(component);
67
68 return regmap_update_bits(priv->regmap, PCM1789_SOFT_MUTE,
69 PCM1789_MUTE_MASK,
70 mute ? 0 : PCM1789_MUTE_MASK);
71}

--- 90 unchanged lines hidden (view full) ---

162 }
163
164 return ret;
165}
166
167static const struct snd_soc_dai_ops pcm1789_dai_ops = {
168 .set_fmt = pcm1789_set_dai_fmt,
169 .hw_params = pcm1789_hw_params,
64{
65 struct snd_soc_component *component = codec_dai->component;
66 struct pcm1789_private *priv = snd_soc_component_get_drvdata(component);
67
68 return regmap_update_bits(priv->regmap, PCM1789_SOFT_MUTE,
69 PCM1789_MUTE_MASK,
70 mute ? 0 : PCM1789_MUTE_MASK);
71}

--- 90 unchanged lines hidden (view full) ---

162 }
163
164 return ret;
165}
166
167static const struct snd_soc_dai_ops pcm1789_dai_ops = {
168 .set_fmt = pcm1789_set_dai_fmt,
169 .hw_params = pcm1789_hw_params,
170 .digital_mute = pcm1789_digital_mute,
170 .mute_stream = pcm1789_mute,
171 .trigger = pcm1789_trigger,
171 .trigger = pcm1789_trigger,
172 .no_capture_mute = 1,
172};
173
174static const DECLARE_TLV_DB_SCALE(pcm1789_dac_tlv, -12000, 50, 1);
175
176static const struct snd_kcontrol_new pcm1789_controls[] = {
177 SOC_DOUBLE_R_RANGE_TLV("DAC Playback Volume", PCM1789_DAC_VOL_LEFT,
178 PCM1789_DAC_VOL_RIGHT, 0, 0xf, 0xff, 0,
179 pcm1789_dac_tlv),

--- 94 unchanged lines hidden ---
173};
174
175static const DECLARE_TLV_DB_SCALE(pcm1789_dac_tlv, -12000, 50, 1);
176
177static const struct snd_kcontrol_new pcm1789_controls[] = {
178 SOC_DOUBLE_R_RANGE_TLV("DAC Playback Volume", PCM1789_DAC_VOL_LEFT,
179 PCM1789_DAC_VOL_RIGHT, 0, 0xf, 0xff, 0,
180 pcm1789_dac_tlv),

--- 94 unchanged lines hidden ---