···11+Freescale i.MX audio complex with S/PDIF transceiver22+33+Required properties:44+55+ - compatible : "fsl,imx-audio-spdif"66+77+ - model : The user-visible name of this sound complex88+99+ - spdif-controller : The phandle of the i.MX S/PDIF controller1010+1111+1212+Optional properties:1313+1414+ - spdif-out : This is a boolean property. If present, the transmitting1515+ function of S/PDIF will be enabled, indicating there's a physical1616+ S/PDIF out connector/jack on the board or it's connecting to some1717+ other IP block, such as an HDMI encoder/display-controller.1818+1919+ - spdif-in : This is a boolean property. If present, the receiving2020+ function of S/PDIF will be enabled, indicating there's a physical2121+ S/PDIF in connector/jack on the board.2222+2323+* Note: At least one of these two properties should be set in the DT binding.2424+2525+2626+Example:2727+2828+sound-spdif {2929+ compatible = "fsl,imx-audio-spdif";3030+ model = "imx-spdif";3131+ spdif-controller = <&spdif>;3232+ spdif-out;3333+ spdif-in;3434+};
···11+* mvebu (Kirkwood, Dove, Armada 370) audio controller22+33+Required properties:44+55+- compatible: "marvell,mvebu-audio"66+77+- reg: physical base address of the controller and length of memory mapped88+ region.99+1010+- interrupts: list of two irq numbers.1111+ The first irq is used for data flow and the second one is used for errors.1212+1313+- clocks: one or two phandles.1414+ The first one is mandatory and defines the internal clock.1515+ The second one is optional and defines an external clock.1616+1717+- clock-names: names associated to the clocks:1818+ "internal" for the internal clock1919+ "extclk" for the external clock2020+2121+Example:2222+2323+i2s1: audio-controller@b4000 {2424+ compatible = "marvell,mvebu-audio";2525+ reg = <0xb4000 0x2210>;2626+ interrupts = <21>, <22>;2727+ clocks = <&gate_clk 13>;2828+ clock-names = "internal";2929+};
+1
Documentation/sound/alsa/HD-Audio-Models.txt
···244244 5stack-no-fp D965 5stack without front panel245245 dell-3stack Dell Dimension E520246246 dell-bios Fixes with Dell BIOS setup247247+ dell-bios-amic Fixes with Dell BIOS setup including analog mic247248 volknob Fixes with volume-knob widget 0x24248249 auto BIOS setup (default)249250
+2
Documentation/sound/alsa/HD-Audio.txt
···454454- need_dac_fix (bool): limits the DACs depending on the channel count455455- primary_hp (bool): probe headphone jacks as the primary outputs;456456 default true457457+- multi_io (bool): try probing multi-I/O config (e.g. shared458458+ line-in/surround, mic/clfe jacks)457459- multi_cap_vol (bool): provide multiple capture volumes458460- inv_dmic_split (bool): provide split internal mic volume/switch for459461 phase-inverted digital mics
+11
MAINTAINERS
···76767676F: include/uapi/sound/76777677F: sound/7678767876797679+SOUND - COMPRESSED AUDIO76807680+M: Vinod Koul <vinod.koul@intel.com>76817681+L: alsa-devel@alsa-project.org (moderated for non-subscribers)76827682+T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git76837683+S: Supported76847684+F: Documentation/sound/alsa/compress_offload.txt76857685+F: include/sound/compress_driver.h76867686+F: include/uapi/sound/compress_*76877687+F: sound/core/compress_offload.c76887688+F: sound/soc/soc-compress.c76897689+76797690SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)76807691M: Liam Girdwood <lgirdwood@gmail.com>76817692M: Mark Brown <broonie@kernel.org>
···697697 unsigned int probed:1; /* Codec has been probed */698698 unsigned int ac97_registered:1; /* Codec has been AC97 registered */699699 unsigned int ac97_created:1; /* Codec has been created by SoC */700700- unsigned int sysfs_registered:1; /* codec has been sysfs registered */701700 unsigned int cache_init:1; /* codec cache has been initialized */702701 unsigned int using_regmap:1; /* using regmap access */703702 u32 cache_only; /* Suppress writes to hardware */···704705705706 /* codec IO */706707 void *control_data; /* codec control (i2c/3wire) data */707707- enum snd_soc_control_type control_type;708708 hw_write_t hw_write;709709 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);710710 unsigned int (*read)(struct snd_soc_codec *, unsigned int);···722724#ifdef CONFIG_DEBUG_FS723725 struct dentry *debugfs_codec_root;724726 struct dentry *debugfs_reg;725725- struct dentry *debugfs_dapm;726727#endif727728};728729···846849847850#ifdef CONFIG_DEBUG_FS848851 struct dentry *debugfs_platform_root;849849- struct dentry *debugfs_dapm;850852#endif851853};852854···930934 /* machine stream operations */931935 const struct snd_soc_ops *ops;932936 const struct snd_soc_compr_ops *compr_ops;937937+938938+ /* For unidirectional dai links */939939+ bool playback_only;940940+ bool capture_only;933941};934942935943struct snd_soc_codec_conf {
+1-1
include/uapi/sound/hdspm.h
···111111 enum hdspm_ltc_input_format input_format;112112};113113114114-#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)114114+#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)115115116116/**117117 * The status data reflects the device's current state
+2-2
sound/core/pcm_lib.c
···184184 do { \185185 if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { \186186 xrun_log_show(substream); \187187- if (printk_ratelimit()) { \187187+ if (snd_printd_ratelimit()) { \188188 snd_printd("PCM: " fmt, ##args); \189189 } \190190 dump_stack_on_xrun(substream); \···342342 return -EPIPE;343343 }344344 if (pos >= runtime->buffer_size) {345345- if (printk_ratelimit()) {345345+ if (snd_printd_ratelimit()) {346346 char name[16];347347 snd_pcm_debug_name(substream, name, sizeof(name));348348 xrun_log_show(substream);
+1-1
sound/drivers/dummy.c
···10221022 if (i >= ARRAY_SIZE(fields))10231023 continue;10241024 snd_info_get_str(item, ptr, sizeof(item));10251025- if (strict_strtoull(item, 0, &val))10251025+ if (kstrtoull(item, 0, &val))10261026 continue;10271027 if (fields[i].size == sizeof(int))10281028 *get_dummy_int_ptr(dummy, fields[i].offset) = val;
···443443 for (i = 0; i < 8; ++i)444444 iwave[i] = snd_gf1_peek(gus, bank_pos + i);445445#ifdef CONFIG_SND_DEBUG_ROM446446- printk(KERN_DEBUG "ROM at 0x%06x = %*phC\n", bank_pos,447447- 8, iwave);446446+ printk(KERN_DEBUG "ROM at 0x%06x = %8phC\n", bank_pos, iwave);448447#endif449448 if (strncmp(iwave, "INTRWAVE", 8))450449 continue; /* first check */
+1-2
sound/oss/dmabuf.c
···557557 unsigned long flags;558558 int err = 0, n = 0;559559 struct dma_buffparms *dmap = adev->dmap_in;560560- int go;561560562561 if (!(adev->open_mode & OPEN_READ))563562 return -EIO;···583584 spin_unlock_irqrestore(&dmap->lock,flags);584585 return -EAGAIN;585586 }586586- if ((go = adev->go))587587+ if (adev->go)587588 timeout = dmabuf_timeout(dmap);588589589590 spin_unlock_irqrestore(&dmap->lock,flags);
+2-7
sound/pci/hda/Kconfig
···152152 This module is automatically loaded at probing.153153154154config SND_HDA_I915155155- bool "Build Display HD-audio controller/codec power well support for i915 cards"155155+ bool156156+ default y156157 depends on DRM_I915157157- help158158- Say Y here to include full HDMI and DisplayPort HD-audio controller/codec159159- power-well support for Intel Haswell graphics cards based on the i915 driver.160160-161161- Note that this option must be enabled for Intel Haswell C+ stepping machines, otherwise162162- the GPU audio controller/codecs will not be initialized or damaged when exit from S3 mode.163158164159config SND_HDA_CODEC_CIRRUS165160 bool "Build Cirrus Logic codec support"
+62-2
sound/pci/hda/hda_codec.c
···666666}667667EXPORT_SYMBOL_HDA(snd_hda_get_conn_index);668668669669+670670+/* return DEVLIST_LEN parameter of the given widget */671671+static unsigned int get_num_devices(struct hda_codec *codec, hda_nid_t nid)672672+{673673+ unsigned int wcaps = get_wcaps(codec, nid);674674+ unsigned int parm;675675+676676+ if (!codec->dp_mst || !(wcaps & AC_WCAP_DIGITAL) ||677677+ get_wcaps_type(wcaps) != AC_WID_PIN)678678+ return 0;679679+680680+ parm = snd_hda_param_read(codec, nid, AC_PAR_DEVLIST_LEN);681681+ if (parm == -1 && codec->bus->rirb_error)682682+ parm = 0;683683+ return parm & AC_DEV_LIST_LEN_MASK;684684+}685685+686686+/**687687+ * snd_hda_get_devices - copy device list without cache688688+ * @codec: the HDA codec689689+ * @nid: NID of the pin to parse690690+ * @dev_list: device list array691691+ * @max_devices: max. number of devices to store692692+ *693693+ * Copy the device list. This info is dynamic and so not cached.694694+ * Currently called only from hda_proc.c, so not exported.695695+ */696696+int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,697697+ u8 *dev_list, int max_devices)698698+{699699+ unsigned int parm;700700+ int i, dev_len, devices;701701+702702+ parm = get_num_devices(codec, nid);703703+ if (!parm) /* not multi-stream capable */704704+ return 0;705705+706706+ dev_len = parm + 1;707707+ dev_len = dev_len < max_devices ? dev_len : max_devices;708708+709709+ devices = 0;710710+ while (devices < dev_len) {711711+ parm = snd_hda_codec_read(codec, nid, 0,712712+ AC_VERB_GET_DEVICE_LIST, devices);713713+ if (parm == -1 && codec->bus->rirb_error)714714+ break;715715+716716+ for (i = 0; i < 8; i++) {717717+ dev_list[devices] = (u8)parm;718718+ parm >>= 4;719719+ devices++;720720+ if (devices >= dev_len)721721+ break;722722+ }723723+ }724724+ return devices;725725+}726726+669727/**670728 * snd_hda_queue_unsol_event - add an unsolicited event to queue671729 * @bus: the BUS···12741216{12751217 struct hda_codec *codec =12761218 container_of(work, struct hda_codec, jackpoll_work.work);12771277- if (!codec->jackpoll_interval)12781278- return;1279121912801220 snd_hda_jack_set_dirty_all(codec);12811221 snd_hda_jack_poll_all(codec);12221222+12231223+ if (!codec->jackpoll_interval)12241224+ return;12251225+12821226 queue_delayed_work(codec->bus->workq, &codec->jackpoll_work,12831227 codec->jackpoll_interval);12841228}
+21
sound/pci/hda/hda_codec.h
···9494#define AC_VERB_GET_HDMI_DIP_XMIT 0x0f329595#define AC_VERB_GET_HDMI_CP_CTRL 0x0f339696#define AC_VERB_GET_HDMI_CHAN_SLOT 0x0f349797+#define AC_VERB_GET_DEVICE_SEL 0xf359898+#define AC_VERB_GET_DEVICE_LIST 0xf36979998100/*99101 * SET verbs···135133#define AC_VERB_SET_HDMI_DIP_XMIT 0x732136134#define AC_VERB_SET_HDMI_CP_CTRL 0x733137135#define AC_VERB_SET_HDMI_CHAN_SLOT 0x734136136+#define AC_VERB_SET_DEVICE_SEL 0x735138137139138/*140139 * Parameter IDs···157154#define AC_PAR_GPIO_CAP 0x11158155#define AC_PAR_AMP_OUT_CAP 0x12159156#define AC_PAR_VOL_KNB_CAP 0x13157157+#define AC_PAR_DEVLIST_LEN 0x15160158#define AC_PAR_HDMI_LPCM_CAP 0x20161159162160/*···255251#define AC_UNSOL_RES_TAG_SHIFT 26256252#define AC_UNSOL_RES_SUBTAG (0x1f<<21)257253#define AC_UNSOL_RES_SUBTAG_SHIFT 21254254+#define AC_UNSOL_RES_DE (0x3f<<15) /* Device Entry255255+ * (for DP1.2 MST)256256+ */257257+#define AC_UNSOL_RES_DE_SHIFT 15258258+#define AC_UNSOL_RES_IA (1<<2) /* Inactive (for DP1.2 MST) */258259#define AC_UNSOL_RES_ELDV (1<<1) /* ELD Data valid (for HDMI) */259260#define AC_UNSOL_RES_PD (1<<0) /* pinsense detect */260261#define AC_UNSOL_RES_CP_STATE (1<<1) /* content protection */···360351#define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */361352#define AC_LPCMCAP_44K (1<<30) /* 44.1kHz support */362353#define AC_LPCMCAP_44K_MS (1<<31) /* 44.1kHz-multiplies support */354354+355355+/* Display pin's device list length */356356+#define AC_DEV_LIST_LEN_MASK 0x3f357357+#define AC_MAX_DEV_LIST_LEN 64363358364359/*365360 * Control Parameters···472459#define AC_DEFCFG_LOCATION_SHIFT 24473460#define AC_DEFCFG_PORT_CONN (0x3<<30)474461#define AC_DEFCFG_PORT_CONN_SHIFT 30462462+463463+/* Display pin's device list entry */464464+#define AC_DE_PD (1<<0)465465+#define AC_DE_ELDV (1<<1)466466+#define AC_DE_IA (1<<2)475467476468/* device device types (0x0-0xf) */477469enum {···903885 unsigned int pcm_format_first:1; /* PCM format must be set first */904886 unsigned int epss:1; /* supporting EPSS? */905887 unsigned int cached_write:1; /* write only to caches */888888+ unsigned int dp_mst:1; /* support DP1.2 Multi-stream transport */906889#ifdef CONFIG_PM907890 unsigned int power_on :1; /* current (global) power-state */908891 unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */···991972 const hda_nid_t *list);992973int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,993974 hda_nid_t nid, int recursive);975975+int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,976976+ u8 *dev_list, int max_devices);994977int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid,995978 u32 *ratesp, u64 *formatsp, unsigned int *bpsp);996979
+63-16
sound/pci/hda/hda_generic.c
···142142 val = snd_hda_get_bool_hint(codec, "primary_hp");143143 if (val >= 0)144144 spec->no_primary_hp = !val;145145+ val = snd_hda_get_bool_hint(codec, "multi_io");146146+ if (val >= 0)147147+ spec->no_multi_io = !val;145148 val = snd_hda_get_bool_hint(codec, "multi_cap_vol");146149 if (val >= 0)147150 spec->multi_cap_vol = !!val;···816813817814static int hda_gen_mixer_mute_put(struct snd_kcontrol *kcontrol,818815 struct snd_ctl_elem_value *ucontrol);816816+static int hda_gen_bind_mute_put(struct snd_kcontrol *kcontrol,817817+ struct snd_ctl_elem_value *ucontrol);819818820819enum {821820 HDA_CTL_WIDGET_VOL,···835830 .put = hda_gen_mixer_mute_put, /* replaced */836831 .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0),837832 },838838- HDA_BIND_MUTE(NULL, 0, 0, 0),833833+ {834834+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,835835+ .info = snd_hda_mixer_amp_switch_info,836836+ .get = snd_hda_mixer_bind_switch_get,837837+ .put = hda_gen_bind_mute_put, /* replaced */838838+ .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0),839839+ },839840};840841841842/* add dynamic controls from template */···948937}949938950939/* playback mute control with the software mute bit check */951951-static int hda_gen_mixer_mute_put(struct snd_kcontrol *kcontrol,952952- struct snd_ctl_elem_value *ucontrol)940940+static void sync_auto_mute_bits(struct snd_kcontrol *kcontrol,941941+ struct snd_ctl_elem_value *ucontrol)953942{954943 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);955944 struct hda_gen_spec *spec = codec->spec;···960949 ucontrol->value.integer.value[0] &= enabled;961950 ucontrol->value.integer.value[1] &= enabled;962951 }952952+}963953954954+static int hda_gen_mixer_mute_put(struct snd_kcontrol *kcontrol,955955+ struct snd_ctl_elem_value *ucontrol)956956+{957957+ sync_auto_mute_bits(kcontrol, ucontrol);964958 return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);959959+}960960+961961+static int hda_gen_bind_mute_put(struct snd_kcontrol *kcontrol,962962+ struct snd_ctl_elem_value *ucontrol)963963+{964964+ sync_auto_mute_bits(kcontrol, ucontrol);965965+ return snd_hda_mixer_bind_switch_put(kcontrol, ucontrol);965966}966967967968/* any ctl assigned to the path with the given index? */···15641541 cfg->speaker_pins,15651542 spec->multiout.extra_out_nid,15661543 spec->speaker_paths);15671567- if (fill_mio_first && cfg->line_outs == 1 &&15441544+ if (!spec->no_multi_io &&15451545+ fill_mio_first && cfg->line_outs == 1 &&15681546 cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {15691547 err = fill_multi_ios(codec, cfg->line_out_pins[0], true);15701548 if (!err)···15781554 spec->private_dac_nids, spec->out_paths,15791555 spec->main_out_badness);1580155615811581- if (fill_mio_first &&15571557+ if (!spec->no_multi_io && fill_mio_first &&15821558 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {15831559 /* try to fill multi-io first */15841560 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);···16061582 return err;16071583 badness += err;16081584 }16091609- if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {15851585+ if (!spec->no_multi_io &&15861586+ cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {16101587 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);16111588 if (err < 0)16121589 return err;···16251600 check_aamix_out_path(codec, spec->speaker_paths[0]);16261601 }1627160216281628- if (cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)16031603+ if (!spec->no_multi_io &&16041604+ cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)16291605 if (count_multiio_pins(codec, cfg->hp_pins[0]) >= 2)16301606 spec->multi_ios = 1; /* give badness */16311607···37503724/* check each pin in the given array; returns true if any of them is plugged */37513725static bool detect_jacks(struct hda_codec *codec, int num_pins, hda_nid_t *pins)37523726{37533753- int i, present = 0;37273727+ int i;37283728+ bool present = false;3754372937553730 for (i = 0; i < num_pins; i++) {37563731 hda_nid_t nid = pins[i];···37603733 /* don't detect pins retasked as inputs */37613734 if (snd_hda_codec_get_pin_target(codec, nid) & AC_PINCTL_IN_EN)37623735 continue;37633763- present |= snd_hda_jack_detect(codec, nid);37363736+ if (snd_hda_jack_detect_state(codec, nid) == HDA_JACK_PRESENT)37373737+ present = true;37643738 }37653739 return present;37663740}3767374137683742/* standard HP/line-out auto-mute helper */37693743static void do_automute(struct hda_codec *codec, int num_pins, hda_nid_t *pins,37703770- bool mute)37443744+ int *paths, bool mute)37713745{37723746 struct hda_gen_spec *spec = codec->spec;37733747 int i;···37803752 break;3781375337823754 if (spec->auto_mute_via_amp) {37553755+ struct nid_path *path;37563756+ hda_nid_t mute_nid;37573757+37583758+ path = snd_hda_get_path_from_idx(codec, paths[i]);37593759+ if (!path)37603760+ continue;37613761+ mute_nid = get_amp_nid_(path->ctls[NID_PATH_MUTE_CTL]);37623762+ if (!mute_nid)37633763+ continue;37833764 if (mute)37843784- spec->mute_bits |= (1ULL << nid);37653765+ spec->mute_bits |= (1ULL << mute_nid);37853766 else37863786- spec->mute_bits &= ~(1ULL << nid);37673767+ spec->mute_bits &= ~(1ULL << mute_nid);37873768 set_pin_eapd(codec, nid, !mute);37883769 continue;37893770 }···38233786void snd_hda_gen_update_outputs(struct hda_codec *codec)38243787{38253788 struct hda_gen_spec *spec = codec->spec;37893789+ int *paths;38263790 int on;3827379138283792 /* Control HP pins/amps depending on master_mute state;38293793 * in general, HP pins/amps control should be enabled in all cases,38303794 * but currently set only for master_mute, just to be safe38313795 */37963796+ if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT)37973797+ paths = spec->out_paths;37983798+ else37993799+ paths = spec->hp_paths;38323800 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins),38333833- spec->autocfg.hp_pins, spec->master_mute);38013801+ spec->autocfg.hp_pins, paths, spec->master_mute);3834380238353803 if (!spec->automute_speaker)38363804 on = 0;···38433801 on = spec->hp_jack_present | spec->line_jack_present;38443802 on |= spec->master_mute;38453803 spec->speaker_muted = on;38043804+ if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)38053805+ paths = spec->out_paths;38063806+ else38073807+ paths = spec->speaker_paths;38463808 do_automute(codec, ARRAY_SIZE(spec->autocfg.speaker_pins),38473847- spec->autocfg.speaker_pins, on);38093809+ spec->autocfg.speaker_pins, paths, on);3848381038493811 /* toggle line-out mutes if needed, too */38503812 /* if LO is a copy of either HP or Speaker, don't need to handle it */···38613815 on = spec->hp_jack_present;38623816 on |= spec->master_mute;38633817 spec->line_out_muted = on;38183818+ paths = spec->out_paths;38643819 do_automute(codec, ARRAY_SIZE(spec->autocfg.line_out_pins),38653865- spec->autocfg.line_out_pins, on);38203820+ spec->autocfg.line_out_pins, paths, on);38663821}38673822EXPORT_SYMBOL_HDA(snd_hda_gen_update_outputs);38683823···39343887 /* don't detect pins retasked as outputs */39353888 if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN)39363889 continue;39373937- if (snd_hda_jack_detect(codec, pin)) {38903890+ if (snd_hda_jack_detect_state(codec, pin) == HDA_JACK_PRESENT) {39383891 mux_select(codec, 0, spec->am_entry[i].idx);39393892 return;39403893 }
+1
sound/pci/hda/hda_generic.h
···220220 unsigned int hp_mic:1; /* Allow HP as a mic-in */221221 unsigned int suppress_hp_mic_detect:1; /* Don't detect HP/mic */222222 unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins */223223+ unsigned int no_multi_io:1; /* Don't try multi I/O config */223224 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */224225 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */225226 unsigned int own_eapd_ctl:1; /* set EAPD by own function */
+3-3
sound/pci/hda/hda_hwdep.c
···295295 struct snd_hwdep *hwdep = dev_get_drvdata(dev); \296296 struct hda_codec *codec = hwdep->private_data; \297297 unsigned long val; \298298- int err = strict_strtoul(buf, 0, &val); \298298+ int err = kstrtoul(buf, 0, &val); \299299 if (err < 0) \300300 return err; \301301 codec->type = val; \···654654 p = snd_hda_get_hint(codec, key);655655 if (!p)656656 ret = -ENOENT;657657- else if (strict_strtoul(p, 0, &val))657657+ else if (kstrtoul(p, 0, &val))658658 ret = -EINVAL;659659 else {660660 *valp = val;···751751 struct hda_codec **codecp) \752752{ \753753 unsigned long val; \754754- if (!strict_strtoul(buf, 0, &val)) \754754+ if (!kstrtoul(buf, 0, &val)) \755755 (*codecp)->name = val; \756756}757757
+30-4
sound/pci/hda/hda_intel.c
···11601160 goto __skip;1161116111621162 /* clear STATESTS */11631163- azx_writeb(chip, STATESTS, STATESTS_INT_MASK);11631163+ azx_writew(chip, STATESTS, STATESTS_INT_MASK);1164116411651165 /* reset controller */11661166 azx_enter_link_reset(chip);···12421242 }1243124312441244 /* clear STATESTS */12451245- azx_writeb(chip, STATESTS, STATESTS_INT_MASK);12451245+ azx_writew(chip, STATESTS, STATESTS_INT_MASK);1246124612471247 /* clear rirb status */12481248 azx_writeb(chip, RIRBSTS, RIRB_INT_MASK);···1451145114521452#if 014531453 /* clear state status int */14541454- if (azx_readb(chip, STATESTS) & 0x04)14551455- azx_writeb(chip, STATESTS, 0x04);14541454+ if (azx_readw(chip, STATESTS) & 0x04)14551455+ azx_writew(chip, STATESTS, 0x04);14561456#endif14571457 spin_unlock(&chip->reg_lock);14581458···29712971 struct snd_card *card = dev_get_drvdata(dev);29722972 struct azx *chip = card->private_data;2973297329742974+ /* enable controller wake up event */29752975+ azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |29762976+ STATESTS_INT_MASK);29772977+29742978 azx_stop_chip(chip);29752979 azx_enter_link_reset(chip);29762980 azx_clear_irq_pending(chip);···29872983{29882984 struct snd_card *card = dev_get_drvdata(dev);29892985 struct azx *chip = card->private_data;29862986+ struct hda_bus *bus;29872987+ struct hda_codec *codec;29882988+ int status;2990298929912990 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)29922991 hda_display_power(true);29922992+29932993+ /* Read STATESTS before controller reset */29942994+ status = azx_readw(chip, STATESTS);29952995+29932996 azx_init_pci(chip);29942997 azx_init_chip(chip, 1);29982998+29992999+ bus = chip->bus;30003000+ if (status && bus) {30013001+ list_for_each_entry(codec, &bus->codec_list, list)30023002+ if (status & (1 << codec->addr))30033003+ queue_delayed_work(codec->bus->workq,30043004+ &codec->jackpoll_work, codec->jackpoll_interval);30053005+ }30063006+30073007+ /* disable controller Wake Up event*/30083008+ azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) &30093009+ ~STATESTS_INT_MASK);30103010+29953011 return 0;29963012}29973013···3855383138563832 /* Request power well for Haswell HDA controller and codec */38573833 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {38343834+#ifdef CONFIG_SND_HDA_I91538583835 err = hda_i915_init();38593836 if (err < 0) {38603837 snd_printk(KERN_ERR SFX "Error request power-well from i915\n");38613838 goto out_free;38623839 }38403840+#endif38633841 hda_display_power(true);38643842 }38653843
+14-8
sound/pci/hda/hda_jack.c
···194194EXPORT_SYMBOL_HDA(snd_hda_pin_sense);195195196196/**197197- * snd_hda_jack_detect - query pin Presence Detect status197197+ * snd_hda_jack_detect_state - query pin Presence Detect status198198 * @codec: the CODEC to sense199199 * @nid: the pin NID to sense200200 *201201- * Query and return the pin's Presence Detect status.201201+ * Query and return the pin's Presence Detect status, as either202202+ * HDA_JACK_NOT_PRESENT, HDA_JACK_PRESENT or HDA_JACK_PHANTOM.202203 */203203-int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid)204204+int snd_hda_jack_detect_state(struct hda_codec *codec, hda_nid_t nid)204205{205205- u32 sense = snd_hda_pin_sense(codec, nid);206206- return get_jack_plug_state(sense);206206+ struct hda_jack_tbl *jack = snd_hda_jack_tbl_get(codec, nid);207207+ if (jack && jack->phantom_jack)208208+ return HDA_JACK_PHANTOM;209209+ else if (snd_hda_pin_sense(codec, nid) & AC_PINSENSE_PRESENCE)210210+ return HDA_JACK_PRESENT;211211+ else212212+ return HDA_JACK_NOT_PRESENT;207213}208208-EXPORT_SYMBOL_HDA(snd_hda_jack_detect);214214+EXPORT_SYMBOL_HDA(snd_hda_jack_detect_state);209215210216/**211217 * snd_hda_jack_detect_enable - enable the jack-detection···253247int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,254248 hda_nid_t gating_nid)255249{256256- struct hda_jack_tbl *gated = snd_hda_jack_tbl_get(codec, gated_nid);257257- struct hda_jack_tbl *gating = snd_hda_jack_tbl_get(codec, gating_nid);250250+ struct hda_jack_tbl *gated = snd_hda_jack_tbl_new(codec, gated_nid);251251+ struct hda_jack_tbl *gating = snd_hda_jack_tbl_new(codec, gating_nid);258252259253 if (!gated || !gating)260254 return -EINVAL;
+12-1
sound/pci/hda/hda_jack.h
···7575 hda_nid_t gating_nid);76767777u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid);7878-int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);7878+7979+/* the jack state returned from snd_hda_jack_detect_state() */8080+enum {8181+ HDA_JACK_NOT_PRESENT, HDA_JACK_PRESENT, HDA_JACK_PHANTOM,8282+};8383+8484+int snd_hda_jack_detect_state(struct hda_codec *codec, hda_nid_t nid);8585+8686+static inline bool snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid)8787+{8888+ return snd_hda_jack_detect_state(codec, nid) != HDA_JACK_NOT_PRESENT;8989+}79908091bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid);8192
···193193 Say Y if you want to add support for SoC audio on an i.MX board with194194 a sgtl5000 codec.195195196196+config SND_SOC_IMX_SPDIF197197+ tristate "SoC Audio support for i.MX boards with S/PDIF"198198+ select SND_SOC_IMX_PCM_DMA199199+ select SND_SOC_FSL_SPDIF200200+ select SND_SOC_SPDIF201201+ select REGMAP_MMIO202202+ help203203+ SoC Audio support for i.MX boards with S/PDIF204204+ Say Y if you want to add support for SoC audio on an i.MX board with205205+ a S/DPDIF.206206+196207config SND_SOC_IMX_MC13783197208 tristate "SoC Audio support for I.MX boards with mc13783"198209 depends on MFD_MC13783 && ARM
···11config SND_KIRKWOOD_SOC22- tristate "SoC Audio for the Marvell Kirkwood chip"33- depends on ARCH_KIRKWOOD || COMPILE_TEST22+ tristate "SoC Audio for the Marvell Kirkwood and Dove chips"33+ depends on ARCH_KIRKWOOD || ARCH_DOVE || COMPILE_TEST44 help55 Say Y or M if you want to add support for codecs attached to66 the Kirkwood I2S interface. You will also need to select the
···183183 list_add(&(pins[i].list), &jack->pins);184184 }185185186186- snd_soc_dapm_new_widgets(&jack->codec->card->dapm);187187-188186 /* Update to reflect the last reported status; canned jack189187 * implementations are likely to set their state before the190188 * card has an opportunity to associate pins.
+10
sound/soc/soc-pcm.c
···20202020 capture = 1;20212021 }2022202220232023+ if (rtd->dai_link->playback_only) {20242024+ playback = 1;20252025+ capture = 0;20262026+ }20272027+20282028+ if (rtd->dai_link->capture_only) {20292029+ playback = 0;20302030+ capture = 1;20312031+ }20322032+20232033 /* create the PCM */20242034 if (rtd->dai_link->no_pcm) {20252035 snprintf(new_name, sizeof(new_name), "(%s)",
+2-2
sound/usb/6fire/firmware.c
···346346 if (!memcmp(version, known_fw_versions + i, 2))347347 return 0;348348349349- snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "349349+ snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. "350350 "please reconnect to power. if this failure "351351 "still happens, check your firmware installation.",352352- 4, version);352352+ version);353353 return -EINVAL;354354}355355
+3
sound/usb/endpoint.c
···418418 struct snd_usb_endpoint *ep;419419 int is_playback = direction == SNDRV_PCM_STREAM_PLAYBACK;420420421421+ if (WARN_ON(!alts))422422+ return NULL;423423+421424 mutex_lock(&chip->mutex);422425423426 list_for_each_entry(ep, &chip->ep_list, list) {
+138-105
sound/usb/pcm.c
···327327 return 0;328328}329329330330+static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,331331+ struct usb_device *dev,332332+ struct usb_interface_descriptor *altsd,333333+ unsigned int attr)334334+{335335+ struct usb_host_interface *alts;336336+ struct usb_interface *iface;337337+ unsigned int ep;338338+339339+ /* Implicit feedback sync EPs consumers are always playback EPs */340340+ if (subs->direction != SNDRV_PCM_STREAM_PLAYBACK)341341+ return 0;342342+343343+ switch (subs->stream->chip->usb_id) {344344+ case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */345345+ case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */346346+ ep = 0x81;347347+ iface = usb_ifnum_to_if(dev, 3);348348+349349+ if (!iface || iface->num_altsetting == 0)350350+ return -EINVAL;351351+352352+ alts = &iface->altsetting[1];353353+ goto add_sync_ep;354354+ break;355355+ case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */356356+ case USB_ID(0x0763, 0x2081):357357+ ep = 0x81;358358+ iface = usb_ifnum_to_if(dev, 2);359359+360360+ if (!iface || iface->num_altsetting == 0)361361+ return -EINVAL;362362+363363+ alts = &iface->altsetting[1];364364+ goto add_sync_ep;365365+ }366366+ if (attr == USB_ENDPOINT_SYNC_ASYNC &&367367+ altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&368368+ altsd->bInterfaceProtocol == 2 &&369369+ altsd->bNumEndpoints == 1 &&370370+ USB_ID_VENDOR(subs->stream->chip->usb_id) == 0x0582 /* Roland */ &&371371+ search_roland_implicit_fb(dev, altsd->bInterfaceNumber + 1,372372+ altsd->bAlternateSetting,373373+ &alts, &ep) >= 0) {374374+ goto add_sync_ep;375375+ }376376+377377+ /* No quirk */378378+ return 0;379379+380380+add_sync_ep:381381+ subs->sync_endpoint = snd_usb_add_endpoint(subs->stream->chip,382382+ alts, ep, !subs->direction,383383+ SND_USB_ENDPOINT_TYPE_DATA);384384+ if (!subs->sync_endpoint)385385+ return -EINVAL;386386+387387+ subs->data_endpoint->sync_master = subs->sync_endpoint;388388+389389+ return 0;390390+}391391+392392+static int set_sync_endpoint(struct snd_usb_substream *subs,393393+ struct audioformat *fmt,394394+ struct usb_device *dev,395395+ struct usb_host_interface *alts,396396+ struct usb_interface_descriptor *altsd)397397+{398398+ int is_playback = subs->direction == SNDRV_PCM_STREAM_PLAYBACK;399399+ unsigned int ep, attr;400400+ bool implicit_fb;401401+ int err;402402+403403+ /* we need a sync pipe in async OUT or adaptive IN mode */404404+ /* check the number of EP, since some devices have broken405405+ * descriptors which fool us. if it has only one EP,406406+ * assume it as adaptive-out or sync-in.407407+ */408408+ attr = fmt->ep_attr & USB_ENDPOINT_SYNCTYPE;409409+410410+ err = set_sync_ep_implicit_fb_quirk(subs, dev, altsd, attr);411411+ if (err < 0)412412+ return err;413413+414414+ if (altsd->bNumEndpoints < 2)415415+ return 0;416416+417417+ if ((is_playback && attr != USB_ENDPOINT_SYNC_ASYNC) ||418418+ (!is_playback && attr != USB_ENDPOINT_SYNC_ADAPTIVE))419419+ return 0;420420+421421+ /* check sync-pipe endpoint */422422+ /* ... and check descriptor size before accessing bSynchAddress423423+ because there is a version of the SB Audigy 2 NX firmware lacking424424+ the audio fields in the endpoint descriptors */425425+ if ((get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_ISOC ||426426+ (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&427427+ get_endpoint(alts, 1)->bSynchAddress != 0)) {428428+ snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n",429429+ dev->devnum, fmt->iface, fmt->altsetting,430430+ get_endpoint(alts, 1)->bmAttributes,431431+ get_endpoint(alts, 1)->bLength,432432+ get_endpoint(alts, 1)->bSynchAddress);433433+ return -EINVAL;434434+ }435435+ ep = get_endpoint(alts, 1)->bEndpointAddress;436436+ if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&437437+ ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) ||438438+ (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) {439439+ snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n",440440+ dev->devnum, fmt->iface, fmt->altsetting,441441+ is_playback, ep, get_endpoint(alts, 0)->bSynchAddress);442442+ return -EINVAL;443443+ }444444+445445+ implicit_fb = (get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_USAGE_MASK)446446+ == USB_ENDPOINT_USAGE_IMPLICIT_FB;447447+448448+ subs->sync_endpoint = snd_usb_add_endpoint(subs->stream->chip,449449+ alts, ep, !subs->direction,450450+ implicit_fb ?451451+ SND_USB_ENDPOINT_TYPE_DATA :452452+ SND_USB_ENDPOINT_TYPE_SYNC);453453+ if (!subs->sync_endpoint)454454+ return -EINVAL;455455+456456+ subs->data_endpoint->sync_master = subs->sync_endpoint;457457+458458+ return 0;459459+}460460+330461/*331462 * find a matching format and set up the interface332463 */···467336 struct usb_host_interface *alts;468337 struct usb_interface_descriptor *altsd;469338 struct usb_interface *iface;470470- unsigned int ep, attr;471471- int is_playback = subs->direction == SNDRV_PCM_STREAM_PLAYBACK;472472- int err, implicit_fb = 0;339339+ int err;473340474341 iface = usb_ifnum_to_if(dev, fmt->iface);475342 if (WARN_ON(!iface))···512383 subs->data_endpoint = snd_usb_add_endpoint(subs->stream->chip,513384 alts, fmt->endpoint, subs->direction,514385 SND_USB_ENDPOINT_TYPE_DATA);386386+515387 if (!subs->data_endpoint)516388 return -EINVAL;517389518518- /* we need a sync pipe in async OUT or adaptive IN mode */519519- /* check the number of EP, since some devices have broken520520- * descriptors which fool us. if it has only one EP,521521- * assume it as adaptive-out or sync-in.522522- */523523- attr = fmt->ep_attr & USB_ENDPOINT_SYNCTYPE;390390+ err = set_sync_endpoint(subs, fmt, dev, alts, altsd);391391+ if (err < 0)392392+ return err;524393525525- switch (subs->stream->chip->usb_id) {526526- case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */527527- case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */528528- if (is_playback) {529529- implicit_fb = 1;530530- ep = 0x81;531531- iface = usb_ifnum_to_if(dev, 3);532532-533533- if (!iface || iface->num_altsetting == 0)534534- return -EINVAL;535535-536536- alts = &iface->altsetting[1];537537- goto add_sync_ep;538538- }539539- break;540540- case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */541541- case USB_ID(0x0763, 0x2081):542542- if (is_playback) {543543- implicit_fb = 1;544544- ep = 0x81;545545- iface = usb_ifnum_to_if(dev, 2);546546-547547- if (!iface || iface->num_altsetting == 0)548548- return -EINVAL;549549-550550- alts = &iface->altsetting[1];551551- goto add_sync_ep;552552- }553553- }554554- if (is_playback &&555555- attr == USB_ENDPOINT_SYNC_ASYNC &&556556- altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&557557- altsd->bInterfaceProtocol == 2 &&558558- altsd->bNumEndpoints == 1 &&559559- USB_ID_VENDOR(subs->stream->chip->usb_id) == 0x0582 /* Roland */ &&560560- search_roland_implicit_fb(dev, altsd->bInterfaceNumber + 1,561561- altsd->bAlternateSetting,562562- &alts, &ep) >= 0) {563563- implicit_fb = 1;564564- goto add_sync_ep;565565- }566566-567567- if (((is_playback && attr == USB_ENDPOINT_SYNC_ASYNC) ||568568- (!is_playback && attr == USB_ENDPOINT_SYNC_ADAPTIVE)) &&569569- altsd->bNumEndpoints >= 2) {570570- /* check sync-pipe endpoint */571571- /* ... and check descriptor size before accessing bSynchAddress572572- because there is a version of the SB Audigy 2 NX firmware lacking573573- the audio fields in the endpoint descriptors */574574- if ((get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_ISOC ||575575- (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&576576- get_endpoint(alts, 1)->bSynchAddress != 0 &&577577- !implicit_fb)) {578578- snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n",579579- dev->devnum, fmt->iface, fmt->altsetting,580580- get_endpoint(alts, 1)->bmAttributes,581581- get_endpoint(alts, 1)->bLength,582582- get_endpoint(alts, 1)->bSynchAddress);583583- return -EINVAL;584584- }585585- ep = get_endpoint(alts, 1)->bEndpointAddress;586586- if (!implicit_fb &&587587- get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&588588- (( is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) ||589589- (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) {590590- snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n",591591- dev->devnum, fmt->iface, fmt->altsetting,592592- is_playback, ep, get_endpoint(alts, 0)->bSynchAddress);593593- return -EINVAL;594594- }595595-596596- implicit_fb = (get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_USAGE_MASK)597597- == USB_ENDPOINT_USAGE_IMPLICIT_FB;598598-599599-add_sync_ep:600600- subs->sync_endpoint = snd_usb_add_endpoint(subs->stream->chip,601601- alts, ep, !subs->direction,602602- implicit_fb ?603603- SND_USB_ENDPOINT_TYPE_DATA :604604- SND_USB_ENDPOINT_TYPE_SYNC);605605- if (!subs->sync_endpoint)606606- return -EINVAL;607607-608608- subs->data_endpoint->sync_master = subs->sync_endpoint;609609- }610610-611611- if ((err = snd_usb_init_pitch(subs->stream->chip, fmt->iface, alts, fmt)) < 0)394394+ err = snd_usb_init_pitch(subs->stream->chip, fmt->iface, alts, fmt);395395+ if (err < 0)612396 return err;613397614398 subs->cur_audiofmt = fmt;615399616400 snd_usb_set_format_quirk(subs, fmt);617617-618618-#if 0619619- printk(KERN_DEBUG620620- "setting done: format = %d, rate = %d..%d, channels = %d\n",621621- fmt->format, fmt->rate_min, fmt->rate_max, fmt->channels);622622- printk(KERN_DEBUG623623- " datapipe = 0x%0x, syncpipe = 0x%0x\n",624624- subs->datapipe, subs->syncpipe);625625-#endif626401627402 return 0;628403}
+3-5
sound/usb/usx2y/usbusx2y.c
···305305{306306 int i;307307 for (i = 0; i < URBS_AsyncSeq; ++i) {308308- if (S[i].urb) {309309- usb_kill_urb(S->urb[i]);310310- usb_free_urb(S->urb[i]);311311- S->urb[i] = NULL;312312- }308308+ usb_kill_urb(S->urb[i]);309309+ usb_free_urb(S->urb[i]);310310+ S->urb[i] = NULL;313311 }314312 kfree(S->buffer);315313}