| /Linux-v4.19/sound/pci/hda/ |
| D | hda_bind.c | 22 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in hda_codec_match() local 27 u32 id = codec->probe_id ? codec->probe_id : codec->core.vendor_id; in hda_codec_match() 28 u32 rev_id = codec->core.revision_id; in hda_codec_match() 33 codec->preset = list; in hda_codec_match() 43 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in hda_codec_unsol_event() local 45 if (codec->patch_ops.unsol_event) in hda_codec_unsol_event() 46 codec->patch_ops.unsol_event(codec, ev); in hda_codec_unsol_event() 54 int snd_hda_codec_set_name(struct hda_codec *codec, const char *name) in snd_hda_codec_set_name() argument 60 err = snd_hdac_device_set_chip_name(&codec->core, name); in snd_hda_codec_set_name() 65 if (!*codec->card->mixername || in snd_hda_codec_set_name() [all …]
|
| D | patch_ca0132.c | 960 struct hda_codec *codec; member 1078 static unsigned int codec_send_command(struct hda_codec *codec, hda_nid_t nid, in codec_send_command() argument 1082 response = snd_hda_codec_read(codec, nid, 0, verb, parm); in codec_send_command() 1088 static int codec_set_converter_format(struct hda_codec *codec, hda_nid_t nid, in codec_set_converter_format() argument 1091 return codec_send_command(codec, nid, VENDOR_CHIPIO_STREAM_FORMAT, in codec_set_converter_format() 1095 static int codec_set_converter_stream_channel(struct hda_codec *codec, in codec_set_converter_stream_channel() argument 1102 return codec_send_command(codec, nid, AC_VERB_SET_CHANNEL_STREAMID, in codec_set_converter_stream_channel() 1107 static int chipio_send(struct hda_codec *codec, in chipio_send() argument 1116 res = snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0, in chipio_send() 1129 static int chipio_write_address(struct hda_codec *codec, in chipio_write_address() argument [all …]
|
| D | hda_codec.c | 40 #define codec_in_pm(codec) snd_hdac_is_in_pm(&codec->core) argument 41 #define hda_codec_is_power_on(codec) snd_hdac_is_power_on(&codec->core) argument 42 #define codec_has_epss(codec) \ argument 43 ((codec)->core.power_caps & AC_PWRST_EPSS) 44 #define codec_has_clkstop(codec) \ argument 45 ((codec)->core.power_caps & AC_PWRST_CLKSTOP) 53 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in codec_exec_verb() local 54 struct hda_bus *bus = codec->bus; in codec_exec_verb() 61 snd_hda_power_up_pm(codec); in codec_exec_verb() 65 err = snd_hdac_bus_exec_verb_unlocked(&bus->core, codec->core.addr, in codec_exec_verb() [all …]
|
| D | patch_via.c | 105 static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec); 107 struct hda_codec *codec, 113 static struct via_spec *via_new_spec(struct hda_codec *codec) in via_new_spec() argument 121 codec->spec = spec; in via_new_spec() 123 spec->codec_type = get_codec_type(codec); in via_new_spec() 131 codec->power_save_node = 1; in via_new_spec() 133 codec->patch_ops = via_patch_ops; in via_new_spec() 137 static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec) in get_codec_type() argument 139 u32 vendor_id = codec->core.vendor_id; in get_codec_type() 155 if (snd_hda_param_read(codec, 0x16, AC_PAR_CONNLIST_LEN) == 0x7) in get_codec_type() [all …]
|
| D | patch_cirrus.c | 142 static inline int cs_vendor_coef_get(struct hda_codec *codec, unsigned int idx) in cs_vendor_coef_get() argument 144 struct cs_spec *spec = codec->spec; in cs_vendor_coef_get() 145 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_get() 147 return snd_hda_codec_read(codec, spec->vendor_nid, 0, in cs_vendor_coef_get() 151 static inline void cs_vendor_coef_set(struct hda_codec *codec, unsigned int idx, in cs_vendor_coef_set() argument 154 struct cs_spec *spec = codec->spec; in cs_vendor_coef_set() 155 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set() 157 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set() 167 static void cs_automute(struct hda_codec *codec) in cs_automute() argument 169 struct cs_spec *spec = codec->spec; in cs_automute() [all …]
|
| D | patch_realtek.c | 109 void (*init_hook)(struct hda_codec *codec); 111 void (*power_hook)(struct hda_codec *codec); 113 void (*shutup)(struct hda_codec *codec); 114 void (*reboot_notify)(struct hda_codec *codec); 133 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in alc_read_coefex_idx() argument 138 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); in alc_read_coefex_idx() 139 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); in alc_read_coefex_idx() 143 #define alc_read_coef_idx(codec, coef_idx) \ argument 144 alc_read_coefex_idx(codec, 0x20, coef_idx) 146 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, in alc_write_coefex_idx() argument [all …]
|
| D | patch_hdmi.c | 52 #define is_haswell(codec) ((codec)->core.vendor_id == 0x80862807) argument 53 #define is_broadwell(codec) ((codec)->core.vendor_id == 0x80862808) argument 54 #define is_skylake(codec) ((codec)->core.vendor_id == 0x80862809) argument 55 #define is_broxton(codec) ((codec)->core.vendor_id == 0x8086280a) argument 56 #define is_kabylake(codec) ((codec)->core.vendor_id == 0x8086280b) argument 57 #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ argument 58 ((codec)->core.vendor_id == 0x80862800)) 59 #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) argument 60 #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ argument 61 || is_skylake(codec) || is_broxton(codec) \ [all …]
|
| D | patch_analog.c | 62 static int create_beep_ctls(struct hda_codec *codec) in create_beep_ctls() argument 64 struct ad198x_spec *spec = codec->spec; in create_beep_ctls() 73 kctl = snd_ctl_new1(knew, codec); in create_beep_ctls() 77 err = snd_hda_ctl_add(codec, 0, kctl); in create_beep_ctls() 84 #define create_beep_ctls(codec) 0 argument 88 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, in ad198x_power_eapd_write() argument 91 if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD) in ad198x_power_eapd_write() 92 snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE, in ad198x_power_eapd_write() 93 !codec->inv_eapd ? 0x00 : 0x02); in ad198x_power_eapd_write() 94 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) in ad198x_power_eapd_write() [all …]
|
| D | patch_conexant.c | 87 static int cx_auto_parse_beep(struct hda_codec *codec) in cx_auto_parse_beep() argument 89 struct conexant_spec *spec = codec->spec; in cx_auto_parse_beep() 92 for_each_hda_codec_node(nid, codec) in cx_auto_parse_beep() 93 if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_BEEP) in cx_auto_parse_beep() 98 #define cx_auto_parse_beep(codec) 0 argument 106 static void cx_auto_parse_eapd(struct hda_codec *codec) in cx_auto_parse_eapd() argument 108 struct conexant_spec *spec = codec->spec; in cx_auto_parse_eapd() 111 for_each_hda_codec_node(nid, codec) { in cx_auto_parse_eapd() 112 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in cx_auto_parse_eapd() 114 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) in cx_auto_parse_eapd() [all …]
|
| D | hda_generic.c | 111 static void parse_user_hints(struct hda_codec *codec) in parse_user_hints() argument 113 struct hda_gen_spec *spec = codec->spec; in parse_user_hints() 116 val = snd_hda_get_bool_hint(codec, "jack_detect"); in parse_user_hints() 118 codec->no_jack_detect = !val; in parse_user_hints() 119 val = snd_hda_get_bool_hint(codec, "inv_jack_detect"); in parse_user_hints() 121 codec->inv_jack_detect = !!val; in parse_user_hints() 122 val = snd_hda_get_bool_hint(codec, "trigger_sense"); in parse_user_hints() 124 codec->no_trigger_sense = !val; in parse_user_hints() 125 val = snd_hda_get_bool_hint(codec, "inv_eapd"); in parse_user_hints() 127 codec->inv_eapd = !!val; in parse_user_hints() [all …]
|
| D | hda_jack.c | 33 bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) in is_jack_detectable() argument 35 if (codec->no_jack_detect) in is_jack_detectable() 37 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT)) in is_jack_detectable() 39 if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) & in is_jack_detectable() 42 if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) && in is_jack_detectable() 43 !codec->jackpoll_interval) in is_jack_detectable() 50 static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) in read_pin_sense() argument 55 if (!codec->no_trigger_sense) { in read_pin_sense() 56 pincap = snd_hda_query_pin_caps(codec, nid); in read_pin_sense() 58 snd_hda_codec_read(codec, nid, 0, in read_pin_sense() [all …]
|
| D | hda_codec.h | 114 int (*build_controls)(struct hda_codec *codec); 115 int (*build_pcms)(struct hda_codec *codec); 116 int (*init)(struct hda_codec *codec); 117 void (*free)(struct hda_codec *codec); 118 void (*unsol_event)(struct hda_codec *codec, unsigned int res); 119 void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, 122 int (*suspend)(struct hda_codec *codec); 123 int (*resume)(struct hda_codec *codec); 124 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); 126 void (*reboot_notify)(struct hda_codec *codec); [all …]
|
| D | hda_proc.c | 36 #define param_read(codec, nid, parm) \ argument 37 snd_hdac_read_parm_uncached(&(codec)->core, nid, parm) 62 struct hda_codec *codec, hda_nid_t nid, in print_nid_array() argument 89 struct hda_codec *codec, hda_nid_t nid) in print_nid_pcms() argument 94 list_for_each_entry(cpcm, &codec->pcm_list_head, list) { in print_nid_pcms() 108 struct hda_codec *codec, hda_nid_t nid, int dir) in print_amp_caps() argument 111 caps = param_read(codec, nid, dir == HDA_OUTPUT ? in print_amp_caps() 126 static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid, in is_stereo_amps() argument 140 if (snd_hda_get_raw_connections(codec, nid, &conn, 1) < 0) in is_stereo_amps() 143 wcaps = snd_hda_param_read(codec, conn, AC_PAR_AUDIO_WIDGET_CAP); in is_stereo_amps() [all …]
|
| D | hda_local.h | 130 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ argument 131 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx) 132 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, 134 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, 136 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, 138 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid, 140 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, 142 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, 144 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name, 148 #define snd_hda_add_vmaster(codec, name, tlv, slaves, suffix) \ argument [all …]
|
| D | patch_si3054.c | 78 #define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0)) argument 79 #define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val)) argument 80 #define SET_REG_CACHE(codec,reg,val) \ argument 81 snd_hda_codec_write_cache(codec,reg,0,SI3054_VERB_WRITE_NODE,val) 102 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in si3054_switch_get() local 105 uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ; in si3054_switch_get() 112 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in si3054_switch_put() local 116 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) | mask); in si3054_switch_put() 118 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) & ~mask); in si3054_switch_put() 139 static int si3054_build_controls(struct hda_codec *codec) in si3054_build_controls() argument [all …]
|
| D | patch_sigmatel.c | 253 struct hda_codec *codec, in stac_playback_pcm_hook() argument 257 struct sigmatel_spec *spec = codec->spec; in stac_playback_pcm_hook() 263 struct hda_codec *codec, in stac_capture_pcm_hook() argument 267 struct sigmatel_spec *spec = codec->spec; in stac_capture_pcm_hook() 283 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook() 288 snd_hda_codec_write(codec, hinfo->nid, 0, in stac_capture_pcm_hook() 300 static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, in stac_gpio_set() argument 304 hda_nid_t fg = codec->core.afg; in stac_gpio_set() 306 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); in stac_gpio_set() 308 gpiostate = snd_hda_codec_read(codec, fg, 0, in stac_gpio_set() [all …]
|
| D | hda_auto_parser.c | 60 static void add_auto_cfg_input_pin(struct hda_codec *codec, struct auto_pin_cfg *cfg, in add_auto_cfg_input_pin() argument 67 nid_has_volume(codec, nid, HDA_INPUT); in add_auto_cfg_input_pin() 106 static bool check_pincap_validity(struct hda_codec *codec, hda_nid_t pin, in check_pincap_validity() argument 109 unsigned int pincap = snd_hda_query_pin_caps(codec, pin); in check_pincap_validity() 127 static bool can_be_headset_mic(struct hda_codec *codec, in can_be_headset_mic() argument 139 def_conf = snd_hda_codec_get_pincfg(codec, item->pin); in can_be_headset_mic() 170 int snd_hda_parse_pin_defcfg(struct hda_codec *codec, in snd_hda_parse_pin_defcfg() argument 182 if (!snd_hda_get_int_hint(codec, "parser_flags", &i)) in snd_hda_parse_pin_defcfg() 192 for_each_hda_codec_node(nid, codec) { in snd_hda_parse_pin_defcfg() 193 unsigned int wid_caps = get_wcaps(codec, nid); in snd_hda_parse_pin_defcfg() [all …]
|
| D | hda_sysfs.c | 33 struct hda_codec *codec = dev_get_drvdata(dev); in power_on_acct_show() local 34 snd_hda_update_power_acct(codec); in power_on_acct_show() 35 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct)); in power_on_acct_show() 42 struct hda_codec *codec = dev_get_drvdata(dev); in power_off_acct_show() local 43 snd_hda_update_power_acct(codec); in power_off_acct_show() 44 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct)); in power_off_acct_show() 56 struct hda_codec *codec = dev_get_drvdata(dev); \ 57 return sprintf(buf, "0x%x\n", codec->field); \ 65 struct hda_codec *codec = dev_get_drvdata(dev); \ 67 codec->field ? codec->field : ""); \ [all …]
|
| D | Makefile | 5 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 …]
|
| /Linux-v4.19/sound/pci/ali5451/ |
| D | ali5451.c | 156 #define ALI_REG(codec, x) ((codec)->port + x) argument 195 struct snd_ali *codec; member 281 static inline unsigned int snd_ali_5451_peek(struct snd_ali *codec, in snd_ali_5451_peek() argument 284 return (unsigned int)inl(ALI_REG(codec, port)); in snd_ali_5451_peek() 287 static inline void snd_ali_5451_poke(struct snd_ali *codec, in snd_ali_5451_poke() argument 291 outl((unsigned int)val, ALI_REG(codec, port)); in snd_ali_5451_poke() 294 static int snd_ali_codec_ready(struct snd_ali *codec, in snd_ali_codec_ready() argument 303 res = snd_ali_5451_peek(codec,port); in snd_ali_codec_ready() 311 snd_ali_5451_poke(codec, port, res & ~0x8000); in snd_ali_codec_ready() 312 dev_dbg(codec->card->dev, "ali_codec_ready: codec is not ready.\n "); in snd_ali_codec_ready() [all …]
|
| /Linux-v4.19/sound/hda/ |
| D | hdac_device.c | 17 static void setup_fg_nodes(struct hdac_device *codec); 18 static int get_codec_vendor_name(struct hdac_device *codec); 39 int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, in snd_hdac_device_init() argument 46 dev = &codec->dev; in snd_hdac_device_init() 55 codec->bus = bus; in snd_hdac_device_init() 56 codec->addr = addr; in snd_hdac_device_init() 57 codec->type = HDA_DEV_CORE; in snd_hdac_device_init() 58 pm_runtime_set_active(&codec->dev); in snd_hdac_device_init() 59 pm_runtime_get_noresume(&codec->dev); in snd_hdac_device_init() 60 atomic_set(&codec->in_pm, 0); in snd_hdac_device_init() [all …]
|
| D | hdac_regmap.c | 24 static int codec_pm_lock(struct hdac_device *codec) in codec_pm_lock() argument 26 return snd_hdac_keep_power_up(codec); in codec_pm_lock() 29 static void codec_pm_unlock(struct hdac_device *codec, int lock) in codec_pm_unlock() argument 32 snd_hdac_power_down_pm(codec); in codec_pm_unlock() 39 struct hdac_device *codec = dev_to_hdac_dev(dev); in hda_volatile_reg() local 44 return !codec->cache_coef; in hda_volatile_reg() 66 struct hdac_device *codec = dev_to_hdac_dev(dev); in hda_writeable_reg() local 71 snd_array_for_each(&codec->vendor_verbs, i, v) { in hda_writeable_reg() 76 if (codec->caps_overwriting) in hda_writeable_reg() 84 return codec->cache_coef; in hda_writeable_reg() [all …]
|
| D | hdac_sysfs.c | 24 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 …]
|
| /Linux-v4.19/drivers/staging/media/zoran/ |
| D | videocodec.c | 55 struct videocodec *codec; member 60 const struct videocodec *codec; member 77 struct videocodec *codec; in videocodec_attach() local 99 if ((master->flags & h->codec->flags) == master->flags) { in videocodec_attach() 101 h->codec->name); in videocodec_attach() 103 if (!try_module_get(h->codec->owner)) in videocodec_attach() 106 codec = kmemdup(h->codec, sizeof(struct videocodec), in videocodec_attach() 108 if (!codec) { in videocodec_attach() 115 res = strlen(codec->name); in videocodec_attach() 116 snprintf(codec->name + res, sizeof(codec->name) - res, in videocodec_attach() [all …]
|
| /Linux-v4.19/drivers/staging/greybus/ |
| D | audio_codec.c | 33 find_dai_stream_params(struct gbaudio_codec_info *codec, int id, int stream) in find_dai_stream_params() argument 37 list_for_each_entry(dai, &codec->dai_list, list) { in find_dai_stream_params() 44 static int gbaudio_module_enable_tx(struct gbaudio_codec_info *codec, in gbaudio_module_enable_tx() argument 62 params = find_dai_stream_params(codec, id, SNDRV_PCM_STREAM_PLAYBACK); in gbaudio_module_enable_tx() 64 dev_err(codec->dev, "Failed to fetch dai_stream pointer\n"); in gbaudio_module_enable_tx() 179 static int gbaudio_module_enable_rx(struct gbaudio_codec_info *codec, in gbaudio_module_enable_rx() argument 197 params = find_dai_stream_params(codec, id, SNDRV_PCM_STREAM_CAPTURE); in gbaudio_module_enable_rx() 199 dev_err(codec->dev, "Failed to fetch dai_stream pointer\n"); in gbaudio_module_enable_rx() 314 int gbaudio_module_update(struct gbaudio_codec_info *codec, in gbaudio_module_update() argument 325 dev_dbg(codec->dev, "No action required for %s\n", w->name); in gbaudio_module_update() [all …]
|