Lines Matching +full:codec +full:- +full:0

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * HD-audio regmap helpers
13 #define AC_AMP_FAKE_MUTE 0x10 /* fake mute bit set to amp verbs */
15 int snd_hdac_regmap_init(struct hdac_device *codec);
16 void snd_hdac_regmap_exit(struct hdac_device *codec);
17 int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec,
19 int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg,
21 int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec,
23 int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg,
25 int snd_hdac_regmap_update_raw(struct hdac_device *codec, unsigned int reg,
27 int snd_hdac_regmap_update_raw_once(struct hdac_device *codec, unsigned int reg,
29 void snd_hdac_regmap_sync(struct hdac_device *codec);
32 * snd_hdac_regmap_encode_verb - encode the verb to a pseudo register
34 * @verb: codec verb
39 (((verb) << 8) | 0x80000 | ((unsigned int)(nid) << 20))
42 * snd_hdac_regmap_encode_amp - encode the AMP verb to a pseudo register
44 * @ch: channel (left = 0, right = 1)
57 * snd_hdac_regmap_encode_amp_stereo - encode a pseudo register for stereo AMPs
71 * snd_hdac_regmap_write - Write a verb with caching
72 * @nid: codec NID
79 snd_hdac_regmap_write(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_write() argument
84 return snd_hdac_regmap_write_raw(codec, cmd, val); in snd_hdac_regmap_write()
88 * snd_hda_regmap_update - Update a verb value with caching
89 * @nid: codec NID
97 snd_hdac_regmap_update(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_update() argument
103 return snd_hdac_regmap_update_raw(codec, cmd, mask, val); in snd_hdac_regmap_update()
107 * snd_hda_regmap_read - Read a verb with caching
108 * @nid: codec NID
115 snd_hdac_regmap_read(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_read() argument
120 return snd_hdac_regmap_read_raw(codec, cmd, val); in snd_hdac_regmap_read()
124 * snd_hdac_regmap_get_amp - Read AMP value
125 * @codec: HD-audio codec
127 * @ch: channel (left=0 or right=1)
132 * Read AMP value. The volume is between 0 to 0x7f, 0x80 = mute bit.
136 snd_hdac_regmap_get_amp(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_get_amp() argument
142 err = snd_hdac_regmap_read_raw(codec, cmd, &val); in snd_hdac_regmap_get_amp()
143 return err < 0 ? err : val; in snd_hdac_regmap_get_amp()
147 * snd_hdac_regmap_update_amp - update the AMP value
148 * @codec: HD-audio codec
150 * @ch: channel (left=0 or right=1)
157 * Returns 0 if the value is unchanged, 1 if changed, or a negative error.
160 snd_hdac_regmap_update_amp(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_update_amp() argument
165 return snd_hdac_regmap_update_raw(codec, cmd, mask, val); in snd_hdac_regmap_update_amp()
169 * snd_hdac_regmap_get_amp_stereo - Read stereo AMP values
170 * @codec: HD-audio codec
172 * @ch: channel (left=0 or right=1)
181 snd_hdac_regmap_get_amp_stereo(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_get_amp_stereo() argument
187 err = snd_hdac_regmap_read_raw(codec, cmd, &val); in snd_hdac_regmap_get_amp_stereo()
188 return err < 0 ? err : val; in snd_hdac_regmap_get_amp_stereo()
192 * snd_hdac_regmap_update_amp_stereo - update the stereo AMP value
193 * @codec: HD-audio codec
202 * Returns 0 if the value is unchanged, 1 if changed, or a negative error.
205 snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid, in snd_hdac_regmap_update_amp_stereo() argument
210 return snd_hdac_regmap_update_raw(codec, cmd, mask, val); in snd_hdac_regmap_update_amp_stereo()
214 * snd_hdac_regmap_sync_node - sync the widget node attributes
215 * @codec: HD-audio codec
219 snd_hdac_regmap_sync_node(struct hdac_device *codec, hda_nid_t nid) in snd_hdac_regmap_sync_node() argument
221 regcache_mark_dirty(codec->regmap); in snd_hdac_regmap_sync_node()
222 regcache_sync_region(codec->regmap, nid << 20, ((nid + 1) << 20) - 1); in snd_hdac_regmap_sync_node()