/linux/sound/pci/hda/ |
H A D | hda_codec.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 27 #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) 35 * Send and receive a verb - passed to exec_verb override for hdac_device 40 struct hda_codec *codec = container_of(dev, struct hda_codec, core); in codec_exec_verb() local [all …]
|
H A D | patch_ca0132.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 37 #define FLOAT_ZERO 0x00000000 38 #define FLOAT_ONE 0x3f800000 39 #define FLOAT_TWO 0x40000000 40 #define FLOAT_THREE 0x40400000 41 #define FLOAT_FIVE 0x40a00000 42 #define FLOAT_SIX 0x40c00000 43 #define FLOAT_EIGHT 0x41000000 44 #define FLOAT_MINUS_5 0xc0a00000 46 #define UNSOL_TAG_DSP 0x16 [all …]
|
H A D | hda_generic.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 32 * snd_hda_gen_spec_init - initialize hda_gen_spec struct 39 snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32); in snd_hda_gen_spec_init() 40 snd_array_init(&spec->paths, sizeof(struct nid_path), 8); in snd_hda_gen_spec_init() 41 snd_array_init(&spec->loopback_list, sizeof(struct hda_amp_list), 8); in snd_hda_gen_spec_init() 42 mutex_init(&spec->pcm_mutex); in snd_hda_gen_spec_init() 43 return 0; in snd_hda_gen_spec_init() 48 * snd_hda_gen_add_kctl - Add a new kctl_new struct from the template 62 struct snd_kcontrol_new *knew = snd_array_new(&spec->kctls); in snd_hda_gen_add_kctl() [all …]
|
H A D | hda_jack.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Jack-detection handling for HD-audio 20 * is_jack_detectable - Check whether the given pin is jack-detectable 21 * @codec: the HDA codec 26 * detection is prohibited in the codec level, the pin config has 29 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() [all …]
|
H A D | patch_conexant.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * HD audio interface patch for Conexant HDA audio codec 7 * Tobin Davis <tdavis@dsl-only.net> 52 HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0, 1, 0, HDA_OUTPUT), 53 HDA_CODEC_MUTE_BEEP_MONO("Beep Playback Switch", 0, 1, 0, HDA_OUTPUT), 63 spec->gen.beep_nid = nid; in set_beep_amp() 64 for (i = 0; i < ARRAY_SIZE(cxt_beep_mixer); i++) { in set_beep_amp() 65 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, in set_beep_amp() 68 return -ENOMEM; in set_beep_amp() 69 knew->private_value = beep_amp; in set_beep_amp() [all …]
|
H A D | patch_cs8409.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 22 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() 29 if (err < 0) in cs8409_parse_auto_config() 32 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in cs8409_parse_auto_config() 33 if (err < 0) in cs8409_parse_auto_config() 37 if (spec->gen.dyn_adc_switch) { in cs8409_parse_auto_config() 38 unsigned int done = 0; in cs8409_parse_auto_config() 40 for (i = 0; i < spec->gen.input_mux.num_items; i++) { in cs8409_parse_auto_config() [all …]
|
H A D | patch_cmedia.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 5 * HD audio interface patch for C-Media CMI9880 22 #define CM9825_VERB_SET_HPF_1 0x781 23 #define CM9825_VERB_SET_HPF_2 0x785 24 #define CM9825_VERB_SET_PLL 0x7a0 25 #define CM9825_VERB_SET_NEG 0x7a1 26 #define CM9825_VERB_SET_ADCL 0x7a2 27 #define CM9825_VERB_SET_DACL 0x7a3 28 #define CM9825_VERB_SET_MBIAS 0x7a4 [all …]
|
H A D | patch_senarytech.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * HD audio interface patch for Senary HDA audio codec 41 HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0, 1, 0, HDA_OUTPUT), 42 HDA_CODEC_MUTE_BEEP_MONO("Beep Playback Switch", 0, 1, 0, HDA_OUTPUT), 52 spec->gen.beep_nid = nid; in set_beep_amp() 53 for (i = 0; i < ARRAY_SIZE(senary_beep_mixer); i++) { in set_beep_amp() 54 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, in set_beep_amp() 57 return -ENOMEM; in set_beep_amp() 58 knew->private_value = beep_amp; in set_beep_amp() 60 return 0; in set_beep_amp() [all …]
|
H A D | hda_proc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 17 static int dump_coef = -1; 19 MODULE_PARM_DESC(dump_coef, "Dump processing coefficients in codec proc file (-1=auto, 0=disable, 1… 22 #define param_read(codec, nid, parm) \ argument 23 snd_hdac_read_parm_uncached(&(codec)->core, nid, parm) 38 if (wid_value == -1) in get_wid_type_name() 40 wid_value &= 0xf; in get_wid_type_name() 48 struct hda_codec *codec, hda_nid_t nid, in print_nid_array() argument 52 struct hda_nid_item *items = array->list, *item; in print_nid_array() [all …]
|
H A D | patch_si3054.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 5 * HD audio interface patch for Silicon Labs 3054/5 modem codec 7 * Copyright (c) 2005 Sasha Khapyorsky <sashak@alsa-project.org> 20 #define SI3054_VERB_READ_NODE 0x900 21 #define SI3054_VERB_WRITE_NODE 0x100 46 #define SI3054_MEI_READY 0xf 49 #define SI3054_ATAG_MASK 0x00f0 50 #define SI3054_DTAG_MASK 0xf000 53 #define SI3054_GPIO_OH 0x0001 [all …]
|
H A D | hda_auto_parser.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * BIOS auto-parser helper functions for HD-audio 25 return 0; in is_in_nid_list() 38 return (int)(a->seq - b->seq); in compare_seq() 49 sort(list, num_pins, sizeof(list[0]), compare_seq, NULL); in sort_pins_by_sequence() 50 for (i = 0; i < num_pins; i++) in sort_pins_by_sequence() 55 /* add the found input-pin to the cfg->inputs[] table */ 56 static void add_auto_cfg_input_pin(struct hda_codec *codec, struct auto_pin_cfg *cfg, in add_auto_cfg_input_pin() argument 59 if (cfg->num_inputs < AUTO_CFG_MAX_INS) { in add_auto_cfg_input_pin() 60 cfg->inputs[cfg->num_inputs].pin = nid; in add_auto_cfg_input_pin() [all …]
|
H A D | patch_realtek.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Universal Interface for Intel High Definition Audio Codec 39 /* extra amp-initialization sequence types */ 87 /* codec parameterization */ 115 void (*init_hook)(struct hda_codec *codec); 116 void (*power_hook)(struct hda_codec *codec); 117 void (*shutup)(struct hda_codec *codec); 146 static void coef_mutex_lock(struct hda_codec *codec) in coef_mutex_lock() argument 148 struct alc_spec *spec = codec->spec; in coef_mutex_lock() 150 snd_hda_power_up_pm(codec); in coef_mutex_lock() [all …]
|
H A D | hda_jack.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * Jack-detection handling for HD-audio 35 /* jack-detection stuff */ 36 unsigned int pin_sense; /* cached pin-sense value */ 37 unsigned int jack_detect:1; /* capable of jack-detection? */ 40 unsigned int block_report:1; /* in a transitional state - do not report to userspace */ 55 snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id); 58 * snd_hda_jack_tbl_get - query the jack-table entry for the given NID 59 * @codec: the HDA codec 63 snd_hda_jack_tbl_get(struct hda_codec *codec, hda_nid_t nid) in snd_hda_jack_tbl_get() argument [all …]
|
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 2 menu "HD-Audio" 23 This option enables the HD-audio controller. Don't forget 24 to choose the appropriate codec options below. 27 will be called snd-hda-intel. 43 will be called snd-hda-tegra. 48 bool "Build hwdep interface for HD-audio driver" 51 Say Y here to build a hwdep interface for HD-audio driver. 52 This interface can be used for out-of-band communication 56 bool "Allow dynamic codec reconfiguration" [all …]
|
/linux/sound/pci/ali5451/ |
H A D | ali5451.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * -- 11 * -- 21 #include <linux/dma-mapping.h> 74 #define ALI_5451_V02 0x02 80 #define ALI_LEGACY_DMAR0 0x00 /* ADR0 */ 81 #define ALI_LEGACY_DMAR4 0x04 /* CNT0 */ 82 #define ALI_LEGACY_DMAR11 0x0b /* MOD */ 83 #define ALI_LEGACY_DMAR15 0x0f /* MMR */ 84 #define ALI_MPUR0 0x20 [all …]
|
/linux/sound/hda/ |
H A D | hdac_device.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HD-audio codec core device 19 static void setup_fg_nodes(struct hdac_device *codec); 20 static int get_codec_vendor_name(struct hdac_device *codec); 28 * snd_hdac_device_init - initialize the HD-audio codec base device 29 * @codec: device to initialize 32 * @addr: codec address 41 int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, in snd_hdac_device_init() argument 48 dev = &codec->dev; in snd_hdac_device_init() 50 dev->parent = bus->dev; in snd_hdac_device_init() [all …]
|
H A D | hdac_regmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Regmap support for HD-audio verbs 9 * - Provided for not all verbs but only subset standard non-volatile verbs. 10 * - For reading, only AC_VERB_GET_* variants can be used. 11 * - For writing, mapped to the *corresponding* AC_VERB_SET_* variants, 25 static int codec_pm_lock(struct hdac_device *codec) in codec_pm_lock() argument 27 return snd_hdac_keep_power_up(codec); in codec_pm_lock() 30 static void codec_pm_unlock(struct hdac_device *codec, int lock) in codec_pm_unlock() argument 33 snd_hdac_power_down_pm(codec); in codec_pm_unlock() 36 #define get_verb(reg) (((reg) >> 8) & 0xfff) [all …]
|
H A D | hdac_sysfs.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * sysfs support for HD-audio core device 24 struct hdac_device *codec = dev_to_hdac_dev(dev); \ 25 return sysfs_emit(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, 98 struct device *dev = kobj_to_dev(kobj->parent->parent); in get_codec_nid() 102 ret = kstrtoint(kobj->name, 16, &nid); in get_codec_nid() [all …]
|
/linux/sound/soc/codecs/ |
H A D | hda.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // Copyright(c) 2021-2022 Intel Corporation 16 static int hda_codec_create_dais(struct hda_codec *codec, int pcm_count, in hda_codec_create_dais() argument 19 struct device *dev = &codec->core.dev; in hda_codec_create_dais() 26 return -ENOMEM; in hda_codec_create_dais() 28 pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list); in hda_codec_create_dais() 30 for (i = 0; i < pcm_count; i++, pcm = list_next_entry(pcm, list)) { in hda_codec_create_dais() 34 dev_info(dev, "creating for %s %d\n", pcm->name, i); in hda_codec_create_dais() 36 drvs[i].name = pcm->name; in hda_codec_create_dais() 41 if (!pcm->stream[dir].substreams) { in hda_codec_create_dais() [all …]
|
H A D | cs40l50-codec.c | 1 // SPDX-License-Identifier: GPL-2.0 4 // integrated DSP, and closed-loop algorithms 15 #define CS40L50_REFCLK_INPUT 0x2C04 16 #define CS40L50_ASP_CONTROL2 0x4808 17 #define CS40L50_ASP_DATA_CONTROL5 0x4840 20 #define CS40L50_PLL_REFCLK_BCLK 0x0 21 #define CS40L50_PLL_REFCLK_MCLK 0x5 22 #define CS40L50_PLL_REEFCLK_MCLK_CFG 0x00 25 #define CS40L50_PLL_REFCLK_CLOSED_LOOP 0 29 #define CS40L50_PLL_REFCLK_SEL_MASK GENMASK(2, 0) [all …]
|
/linux/drivers/media/pci/zoran/ |
H A D | videocodec.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Interface for MJPEG (and maybe later MPEG/WAVELETS) codec's 20 struct videocodec *codec; member 25 const struct videocodec *codec; member 42 struct videocodec *codec; in videocodec_attach() local 53 master->name, master->flags, master->magic); in videocodec_attach() 63 if ((master->flags & h->codec->flags) == master->flags) { in videocodec_attach() 64 zrdev_dbg(zr, "%s: try '%s'\n", __func__, h->codec->name); in videocodec_attach() 66 codec = kmemdup(h->codec, sizeof(struct videocodec), GFP_KERNEL); in videocodec_attach() 67 if (!codec) in videocodec_attach() [all …]
|
H A D | zr36016.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 /* codec io API */ 28 * Local hardware I/O functions: read/write via codec layer 35 u8 value = 0; in zr36016_read() 36 struct zoran *zr = videocodec_to_zoran(ptr->codec); in zr36016_read() 39 if (ptr->codec->master_data->readreg) in zr36016_read() 40 value = (ptr->codec->master_data->readreg(ptr->codec, reg)) & 0xFF; in zr36016_read() 42 zrdev_err(zr, "%s: invalid I/O setup, nothing read!\n", ptr->name); in zr36016_read() 44 zrdev_dbg(zr, "%s: reading from 0x%04x: %02x\n", ptr->name, reg, value); in zr36016_read() 51 struct zoran *zr = videocodec_to_zoran(ptr->codec); in zr36016_write() [all …]
|
/linux/sound/soc/sof/intel/ |
H A D | hda-codec.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 #define IDISP_VID_INTEL 0x80860000 24 static int hda_codec_mask = -1; 26 MODULE_PARM_DESC(codec_mask, "SOF HDA codec mask for probing"); 28 /* load the legacy HDA codec driver */ 29 static int request_codec_module(struct hda_codec *codec) in request_codec_module() argument 35 switch (codec->probe_id) { in request_codec_module() 38 mod = "snd-hda-codec-generic"; in request_codec_module() 42 snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias)); in request_codec_module() 48 dev_dbg(&codec->core.dev, "loading codec module: %s\n", mod); in request_codec_module() [all …]
|
/linux/include/sound/ |
H A D | hda_regmap.h | 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, [all …]
|
/linux/drivers/staging/media/sunxi/cedrus/ |
H A D | cedrus_h264.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 12 #include <media/videobuf2-dma-contig.h> 19 CEDRUS_SRAM_H264_PRED_WEIGHT_TABLE = 0x000, 20 CEDRUS_SRAM_H264_FRAMEBUFFER_LIST = 0x100, 21 CEDRUS_SRAM_H264_REF_LIST_0 = 0x190, 22 CEDRUS_SRAM_H264_REF_LIST_1 = 0x199, 23 CEDRUS_SRAM_H264_SCALING_LIST_8x8_0 = 0x200, 24 CEDRUS_SRAM_H264_SCALING_LIST_8x8_1 = 0x210, 25 CEDRUS_SRAM_H264_SCALING_LIST_4x4 = 0x220, 53 while (count--) in cedrus_h264_write_sram() [all …]
|