Home
last modified time | relevance | path

Searched refs:codec (Results 1 – 25 of 170) sorted by relevance

1234567

/sound/pci/hda/
Dhda_bind.c24 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in hda_codec_match() local
29 u32 id = codec->probe_id ? codec->probe_id : codec->core.vendor_id; in hda_codec_match()
30 u32 rev_id = codec->core.revision_id; in hda_codec_match()
35 codec->preset = list; in hda_codec_match()
45 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in hda_codec_unsol_event() local
48 if (codec->bus->shutdown) in hda_codec_unsol_event()
52 if (codec->core.dev.power.power_state.event != PM_EVENT_ON) in hda_codec_unsol_event()
55 if (codec->patch_ops.unsol_event) in hda_codec_unsol_event()
56 codec->patch_ops.unsol_event(codec, ev); in hda_codec_unsol_event()
64 int snd_hda_codec_set_name(struct hda_codec *codec, const char *name) in snd_hda_codec_set_name() argument
[all …]
Dpatch_ca0132.c1135 struct hda_codec *codec; member
1515 static unsigned int codec_send_command(struct hda_codec *codec, hda_nid_t nid, in codec_send_command() argument
1519 response = snd_hda_codec_read(codec, nid, 0, verb, parm); in codec_send_command()
1525 static int codec_set_converter_format(struct hda_codec *codec, hda_nid_t nid, in codec_set_converter_format() argument
1528 return codec_send_command(codec, nid, VENDOR_CHIPIO_STREAM_FORMAT, in codec_set_converter_format()
1532 static int codec_set_converter_stream_channel(struct hda_codec *codec, in codec_set_converter_stream_channel() argument
1539 return codec_send_command(codec, nid, AC_VERB_SET_CHANNEL_STREAMID, in codec_set_converter_stream_channel()
1544 static int chipio_send(struct hda_codec *codec, in chipio_send() argument
1553 res = snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0, in chipio_send()
1566 static int chipio_write_address(struct hda_codec *codec, in chipio_write_address() argument
[all …]
Dhda_codec.c27 #define codec_in_pm(codec) snd_hdac_is_in_pm(&codec->core) argument
28 #define hda_codec_is_power_on(codec) snd_hdac_is_power_on(&codec->core) argument
29 #define codec_has_epss(codec) \ argument
30 ((codec)->core.power_caps & AC_PWRST_EPSS)
31 #define codec_has_clkstop(codec) \ argument
32 ((codec)->core.power_caps & AC_PWRST_CLKSTOP)
40 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in codec_exec_verb() local
41 struct hda_bus *bus = codec->bus; in codec_exec_verb()
48 snd_hda_power_up_pm(codec); in codec_exec_verb()
52 err = snd_hdac_bus_exec_verb_unlocked(&bus->core, codec->core.addr, in codec_exec_verb()
[all …]
Dpatch_via.c92 static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec);
94 struct hda_codec *codec,
100 static struct via_spec *via_new_spec(struct hda_codec *codec) in via_new_spec() argument
108 codec->spec = spec; in via_new_spec()
110 spec->codec_type = get_codec_type(codec); in via_new_spec()
119 codec->power_save_node = 1; in via_new_spec()
121 codec->patch_ops = via_patch_ops; in via_new_spec()
125 static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec) in get_codec_type() argument
127 u32 vendor_id = codec->core.vendor_id; in get_codec_type()
143 if (snd_hda_param_read(codec, 0x16, AC_PAR_CONNLIST_LEN) == 0x7) in get_codec_type()
[all …]
Dpatch_conexant.c81 static int cx_auto_parse_beep(struct hda_codec *codec) in cx_auto_parse_beep() argument
83 struct conexant_spec *spec = codec->spec; in cx_auto_parse_beep()
86 for_each_hda_codec_node(nid, codec) in cx_auto_parse_beep()
87 if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_BEEP) in cx_auto_parse_beep()
92 #define cx_auto_parse_beep(codec) 0 argument
100 static void cx_auto_parse_eapd(struct hda_codec *codec) in cx_auto_parse_eapd() argument
102 struct conexant_spec *spec = codec->spec; in cx_auto_parse_eapd()
105 for_each_hda_codec_node(nid, codec) { in cx_auto_parse_eapd()
106 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in cx_auto_parse_eapd()
108 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) in cx_auto_parse_eapd()
[all …]
Dpatch_cirrus.c130 static inline int cs_vendor_coef_get(struct hda_codec *codec, unsigned int idx) in cs_vendor_coef_get() argument
132 struct cs_spec *spec = codec->spec; in cs_vendor_coef_get()
134 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
136 return snd_hda_codec_read(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
140 static inline void cs_vendor_coef_set(struct hda_codec *codec, unsigned int idx, in cs_vendor_coef_set() argument
143 struct cs_spec *spec = codec->spec; in cs_vendor_coef_set()
145 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
147 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
157 static void cs_automute(struct hda_codec *codec) in cs_automute() argument
159 struct cs_spec *spec = codec->spec; in cs_automute()
[all …]
Dpatch_hdmi.c77 struct hda_codec *codec; member
97 int (*pin_get_eld)(struct hda_codec *codec, hda_nid_t pin_nid,
100 void (*pin_setup_infoframe)(struct hda_codec *codec, hda_nid_t pin_nid,
105 int (*pin_hbr_setup)(struct hda_codec *codec, hda_nid_t pin_nid,
108 int (*setup_stream)(struct hda_codec *codec, hda_nid_t cvt_nid,
112 void (*pin_cvt_fixup)(struct hda_codec *codec,
124 struct hda_codec *codec; member
188 static inline bool codec_has_acomp(struct hda_codec *codec) in codec_has_acomp() argument
190 struct hdmi_spec *spec = codec->spec; in codec_has_acomp()
194 #define codec_has_acomp(codec) false argument
[all …]
Dpatch_realtek.c108 void (*init_hook)(struct hda_codec *codec);
110 void (*power_hook)(struct hda_codec *codec);
112 void (*shutup)(struct hda_codec *codec);
137 static void coef_mutex_lock(struct hda_codec *codec) in coef_mutex_lock() argument
139 struct alc_spec *spec = codec->spec; in coef_mutex_lock()
141 snd_hda_power_up_pm(codec); in coef_mutex_lock()
145 static void coef_mutex_unlock(struct hda_codec *codec) in coef_mutex_unlock() argument
147 struct alc_spec *spec = codec->spec; in coef_mutex_unlock()
150 snd_hda_power_down_pm(codec); in coef_mutex_unlock()
153 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in __alc_read_coefex_idx() argument
[all …]
Dhda_generic.c105 static void parse_user_hints(struct hda_codec *codec) in parse_user_hints() argument
107 struct hda_gen_spec *spec = codec->spec; in parse_user_hints()
110 val = snd_hda_get_bool_hint(codec, "jack_detect"); in parse_user_hints()
112 codec->no_jack_detect = !val; in parse_user_hints()
113 val = snd_hda_get_bool_hint(codec, "inv_jack_detect"); in parse_user_hints()
115 codec->inv_jack_detect = !!val; in parse_user_hints()
116 val = snd_hda_get_bool_hint(codec, "trigger_sense"); in parse_user_hints()
118 codec->no_trigger_sense = !val; in parse_user_hints()
119 val = snd_hda_get_bool_hint(codec, "inv_eapd"); in parse_user_hints()
121 codec->inv_eapd = !!val; in parse_user_hints()
[all …]
Dpatch_cs8409.c22 static int cs8409_parse_auto_config(struct hda_codec *codec) in cs8409_parse_auto_config() argument
24 struct cs8409_spec *spec = codec->spec; in cs8409_parse_auto_config()
28 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); in cs8409_parse_auto_config()
32 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in cs8409_parse_auto_config()
45 snd_hda_gen_fix_pin_power(codec, spec->gen.adc_nids[idx]); in cs8409_parse_auto_config()
55 static struct cs8409_spec *cs8409_alloc_spec(struct hda_codec *codec) in cs8409_alloc_spec() argument
62 codec->spec = spec; in cs8409_alloc_spec()
63 spec->codec = codec; in cs8409_alloc_spec()
64 codec->power_save_node = 1; in cs8409_alloc_spec()
72 static inline int cs8409_vendor_coef_get(struct hda_codec *codec, unsigned int idx) in cs8409_vendor_coef_get() argument
[all …]
Dpatch_analog.c50 static int create_beep_ctls(struct hda_codec *codec) in create_beep_ctls() argument
52 struct ad198x_spec *spec = codec->spec; in create_beep_ctls()
61 kctl = snd_ctl_new1(knew, codec); in create_beep_ctls()
65 err = snd_hda_ctl_add(codec, 0, kctl); in create_beep_ctls()
72 #define create_beep_ctls(codec) 0 argument
76 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, in ad198x_power_eapd_write() argument
79 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
80 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write()
81 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write()
82 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) in ad198x_power_eapd_write()
[all …]
Dhda_jack.c29 bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) in is_jack_detectable() argument
31 if (codec->no_jack_detect) in is_jack_detectable()
33 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT)) in is_jack_detectable()
35 if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) & in is_jack_detectable()
38 if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) && in is_jack_detectable()
39 !codec->jackpoll_interval) in is_jack_detectable()
46 static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id) in read_pin_sense() argument
51 if (!codec->no_trigger_sense) { in read_pin_sense()
52 pincap = snd_hda_query_pin_caps(codec, nid); in read_pin_sense()
54 snd_hda_codec_read(codec, nid, 0, in read_pin_sense()
[all …]
Dhda_local.h117 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ argument
118 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx)
119 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
121 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
123 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
125 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid,
127 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
129 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
131 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
135 #define snd_hda_add_vmaster(codec, name, tlv, followers, suffix, access) \ argument
[all …]
Dpatch_sigmatel.c242 struct hda_codec *codec, in stac_playback_pcm_hook() argument
246 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook()
252 struct hda_codec *codec, in stac_capture_pcm_hook() argument
256 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook()
272 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
277 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook()
289 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument
293 hda_nid_t fg = codec->core.afg; in stac_gpio_set()
295 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set()
297 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set()
[all …]
Dhda_proc.c22 #define param_read(codec, nid, parm) \ argument
23 snd_hdac_read_parm_uncached(&(codec)->core, nid, parm)
48 struct hda_codec *codec, hda_nid_t nid, in print_nid_array() argument
75 struct hda_codec *codec, hda_nid_t nid) in print_nid_pcms() argument
80 list_for_each_entry(cpcm, &codec->pcm_list_head, list) { in print_nid_pcms()
94 struct hda_codec *codec, hda_nid_t nid, int dir) in print_amp_caps() argument
97 caps = param_read(codec, nid, dir == HDA_OUTPUT ? in print_amp_caps()
112 static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid, in is_stereo_amps() argument
126 if (snd_hda_get_raw_connections(codec, nid, &conn, 1) < 0) in is_stereo_amps()
129 wcaps = snd_hda_param_read(codec, conn, AC_PAR_AUDIO_WIDGET_CAP); in is_stereo_amps()
[all …]
Dpatch_si3054.c64 #define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0)) argument
65 #define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val)) argument
66 #define SET_REG_CACHE(codec,reg,val) \ argument
67 snd_hda_codec_write_cache(codec,reg,0,SI3054_VERB_WRITE_NODE,val)
88 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in si3054_switch_get() local
91 uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ; in si3054_switch_get()
98 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in si3054_switch_put() local
102 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) | mask); in si3054_switch_put()
104 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) & ~mask); in si3054_switch_put()
125 static int si3054_build_controls(struct hda_codec *codec) in si3054_build_controls() argument
[all …]
Dhda_sysfs.c34 struct hda_codec *codec = dev_get_drvdata(dev); in power_on_acct_show() local
35 snd_hda_update_power_acct(codec); in power_on_acct_show()
36 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct)); in power_on_acct_show()
43 struct hda_codec *codec = dev_get_drvdata(dev); in power_off_acct_show() local
44 snd_hda_update_power_acct(codec); in power_off_acct_show()
45 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct)); in power_off_acct_show()
57 struct hda_codec *codec = dev_get_drvdata(dev); \
58 return sprintf(buf, "0x%x\n", codec->field); \
66 struct hda_codec *codec = dev_get_drvdata(dev); \
68 codec->field ? codec->field : ""); \
[all …]
Dhda_auto_parser.c56 static void add_auto_cfg_input_pin(struct hda_codec *codec, struct auto_pin_cfg *cfg, in add_auto_cfg_input_pin() argument
63 nid_has_volume(codec, nid, HDA_INPUT); in add_auto_cfg_input_pin()
108 static bool check_pincap_validity(struct hda_codec *codec, hda_nid_t pin, in check_pincap_validity() argument
111 unsigned int pincap = snd_hda_query_pin_caps(codec, pin); in check_pincap_validity()
129 static bool can_be_headset_mic(struct hda_codec *codec, in can_be_headset_mic() argument
141 def_conf = snd_hda_codec_get_pincfg(codec, item->pin); in can_be_headset_mic()
172 int snd_hda_parse_pin_defcfg(struct hda_codec *codec, in snd_hda_parse_pin_defcfg() argument
184 if (!snd_hda_get_int_hint(codec, "parser_flags", &i)) in snd_hda_parse_pin_defcfg()
194 for_each_hda_codec_node(nid, codec) { in snd_hda_parse_pin_defcfg()
195 unsigned int wid_caps = get_wcaps(codec, nid); in snd_hda_parse_pin_defcfg()
[all …]
Dhda_jack.h55 snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id);
63 snd_hda_jack_tbl_get(struct hda_codec *codec, hda_nid_t nid) in snd_hda_jack_tbl_get() argument
65 return snd_hda_jack_tbl_get_mst(codec, nid, 0); in snd_hda_jack_tbl_get()
69 snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec,
72 void snd_hda_jack_tbl_disconnect(struct hda_codec *codec);
73 void snd_hda_jack_tbl_clear(struct hda_codec *codec);
75 void snd_hda_jack_set_dirty_all(struct hda_codec *codec);
77 int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid,
81 snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid,
95 snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_detect_enable_callback() argument
[all …]
DMakefile5 snd-hda-codec-y := hda_bind.o hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o
6 snd-hda-codec-y += hda_controller.o
7 snd-hda-codec-$(CONFIG_SND_PROC_FS) += hda_proc.o
9 snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
10 snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
16 snd-hda-codec-generic-objs := hda_generic.o
17 snd-hda-codec-realtek-objs := patch_realtek.o
18 snd-hda-codec-cmedia-objs := patch_cmedia.o
19 snd-hda-codec-analog-objs := patch_analog.o
20 snd-hda-codec-idt-objs := patch_sigmatel.o
[all …]
Dhda_beep.c26 struct hda_codec *codec = beep->codec; in generate_tone() local
29 snd_hda_power_up(codec); in generate_tone()
34 snd_hda_codec_write(codec, beep->nid, 0, in generate_tone()
40 snd_hda_power_down(codec); in generate_tone()
124 snd_hda_power_up_pm(beep->codec); in turn_on_beep()
135 snd_hda_power_down_pm(beep->codec); in turn_off_beep()
143 int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) in snd_hda_enable_beep_device() argument
145 struct hda_beep *beep = codec->beep; in snd_hda_enable_beep_device()
189 beep->codec->beep = NULL; in beep_dev_free()
204 int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) in snd_hda_attach_beep_device() argument
[all …]
/sound/pci/ali5451/
Dali5451.c141 #define ALI_REG(codec, x) ((codec)->port + x) argument
180 struct snd_ali *codec; member
266 static inline unsigned int snd_ali_5451_peek(struct snd_ali *codec, in snd_ali_5451_peek() argument
269 return (unsigned int)inl(ALI_REG(codec, port)); in snd_ali_5451_peek()
272 static inline void snd_ali_5451_poke(struct snd_ali *codec, in snd_ali_5451_poke() argument
276 outl((unsigned int)val, ALI_REG(codec, port)); in snd_ali_5451_poke()
279 static int snd_ali_codec_ready(struct snd_ali *codec, in snd_ali_codec_ready() argument
288 res = snd_ali_5451_peek(codec,port); in snd_ali_codec_ready()
296 snd_ali_5451_poke(codec, port, res & ~0x8000); in snd_ali_codec_ready()
297 dev_dbg(codec->card->dev, "ali_codec_ready: codec is not ready.\n "); in snd_ali_codec_ready()
[all …]
/sound/hda/
Dhdac_device.c18 static void setup_fg_nodes(struct hdac_device *codec);
19 static int get_codec_vendor_name(struct hdac_device *codec);
40 int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, in snd_hdac_device_init() argument
47 dev = &codec->dev; in snd_hdac_device_init()
56 codec->bus = bus; in snd_hdac_device_init()
57 codec->addr = addr; in snd_hdac_device_init()
58 codec->type = HDA_DEV_CORE; in snd_hdac_device_init()
59 mutex_init(&codec->widget_lock); in snd_hdac_device_init()
60 mutex_init(&codec->regmap_lock); in snd_hdac_device_init()
61 pm_runtime_set_active(&codec->dev); in snd_hdac_device_init()
[all …]
Dhdac_regmap.c26 static int codec_pm_lock(struct hdac_device *codec) in codec_pm_lock() argument
28 return snd_hdac_keep_power_up(codec); in codec_pm_lock()
31 static void codec_pm_unlock(struct hdac_device *codec, int lock) in codec_pm_unlock() argument
34 snd_hdac_power_down_pm(codec); in codec_pm_unlock()
41 struct hdac_device *codec = dev_to_hdac_dev(dev); in hda_volatile_reg() local
46 return !codec->cache_coef; in hda_volatile_reg()
68 struct hdac_device *codec = dev_to_hdac_dev(dev); in hda_writeable_reg() local
73 snd_array_for_each(&codec->vendor_verbs, i, v) { in hda_writeable_reg()
78 if (codec->caps_overwriting) in hda_writeable_reg()
86 return codec->cache_coef; in hda_writeable_reg()
[all …]
Dhdac_sysfs.c24 struct hdac_device *codec = dev_to_hdac_dev(dev); \
25 return sprintf(buf, "0x%x\n", codec->type); \
34 struct hdac_device *codec = dev_to_hdac_dev(dev); \
36 codec->type ? codec->type : ""); \
89 ssize_t (*show)(struct hdac_device *codec, hda_nid_t nid,
91 ssize_t (*store)(struct hdac_device *codec, hda_nid_t nid,
114 struct hdac_device *codec; in widget_attr_show() local
119 nid = get_codec_nid(kobj, &codec); in widget_attr_show()
122 return wid_attr->show(codec, nid, wid_attr, buf); in widget_attr_show()
130 struct hdac_device *codec; in widget_attr_store() local
[all …]

1234567