···141141{142142 struct device *dev = simple_priv_to_dev(priv);143143144144+ /* dai might be NULL */145145+ if (!dai)146146+ return;147147+144148 if (dai->name)145149 dev_dbg(dev, "%s dai name = %s\n",146150 name, dai->name);
+9-7
include/uapi/sound/sof/fw.h
···1313#ifndef __INCLUDE_UAPI_SOF_FW_H__1414#define __INCLUDE_UAPI_SOF_FW_H__15151616+#include <linux/types.h>1717+1618#define SND_SOF_FW_SIG_SIZE 41719#define SND_SOF_FW_ABI 11820#define SND_SOF_FW_SIG "Reef"···48464947struct snd_sof_blk_hdr {5048 enum snd_sof_fw_blk_type type;5151- uint32_t size; /* bytes minus this header */5252- uint32_t offset; /* offset from base */4949+ __u32 size; /* bytes minus this header */5050+ __u32 offset; /* offset from base */5351} __packed;54525553/*···63616462struct snd_sof_mod_hdr {6563 enum snd_sof_fw_mod_type type;6666- uint32_t size; /* bytes minus this header */6767- uint32_t num_blocks; /* number of blocks */6464+ __u32 size; /* bytes minus this header */6565+ __u32 num_blocks; /* number of blocks */6866} __packed;69677068/*···7270 */7371struct snd_sof_fw_header {7472 unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */7575- uint32_t file_size; /* size of file minus this header */7676- uint32_t num_modules; /* number of modules */7777- uint32_t abi; /* version of header format */7373+ __u32 file_size; /* size of file minus this header */7474+ __u32 num_modules; /* number of modules */7575+ __u32 abi; /* version of header format */7876} __packed;79778078#endif
+8-6
include/uapi/sound/sof/header.h
···99#ifndef __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__1010#define __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__11111212+#include <linux/types.h>1313+1214/*1315 * Header for all non IPC ABI data.1416 *···1816 * Used by any bespoke component data structures or binary blobs.1917 */2018struct sof_abi_hdr {2121- uint32_t magic; /**< 'S', 'O', 'F', '\0' */2222- uint32_t type; /**< component specific type */2323- uint32_t size; /**< size in bytes of data excl. this struct */2424- uint32_t abi; /**< SOF ABI version */2525- uint32_t reserved[4]; /**< reserved for future use */2626- uint32_t data[0]; /**< Component data - opaque to core */1919+ __u32 magic; /**< 'S', 'O', 'F', '\0' */2020+ __u32 type; /**< component specific type */2121+ __u32 size; /**< size in bytes of data excl. this struct */2222+ __u32 abi; /**< SOF ABI version */2323+ __u32 reserved[4]; /**< reserved for future use */2424+ __u32 data[0]; /**< Component data - opaque to core */2725} __packed;28262927#endif
···6363 struct device_node *endpoint;6464 struct of_endpoint info;6565 int i, id;6666+ const u32 *reg;6667 int ret;67686869 /* use driver specified DAI ID if exist */···8483 return info.id;85848685 node = of_get_parent(ep);8686+ reg = of_get_property(node, "reg", NULL);8787 of_node_put(node);8888- if (of_get_property(node, "reg", NULL))8888+ if (reg)8989 return info.port;9090 }9191 node = of_graph_get_port_parent(ep);···210208211209 dev_dbg(dev, "link_of DPCM (%pOF)\n", ep);212210213213- of_node_put(ports);214214- of_node_put(port);215215- of_node_put(node);216216-217211 if (li->cpu) {218212 int is_single_links = 0;219213···227229228230 ret = asoc_simple_parse_cpu(ep, dai_link, &is_single_links);229231 if (ret)230230- return ret;232232+ goto out_put_node;231233232234 ret = asoc_simple_parse_clk_cpu(dev, ep, dai_link, dai);233235 if (ret < 0)234234- return ret;236236+ goto out_put_node;235237236238 ret = asoc_simple_set_dailink_name(dev, dai_link,237239 "fe.%s",238240 cpus->dai_name);239241 if (ret < 0)240240- return ret;242242+ goto out_put_node;241243242244 /* card->num_links includes Codec */243245 asoc_simple_canonicalize_cpu(dai_link, is_single_links);···261263262264 ret = asoc_simple_parse_codec(ep, dai_link);263265 if (ret < 0)264264- return ret;266266+ goto out_put_node;265267266268 ret = asoc_simple_parse_clk_codec(dev, ep, dai_link, dai);267269 if (ret < 0)268268- return ret;270270+ goto out_put_node;269271270272 ret = asoc_simple_set_dailink_name(dev, dai_link,271273 "be.%s",272274 codecs->dai_name);273275 if (ret < 0)274274- return ret;276276+ goto out_put_node;275277276278 /* check "prefix" from top node */277279 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,···291293292294 ret = asoc_simple_parse_tdm(ep, dai);293295 if (ret)294294- return ret;296296+ goto out_put_node;295297296298 ret = asoc_simple_parse_daifmt(dev, cpu_ep, codec_ep,297299 NULL, &dai_link->dai_fmt);298300 if (ret < 0)299299- return ret;301301+ goto out_put_node;300302301303 dai_link->dpcm_playback = 1;302304 dai_link->dpcm_capture = 1;303305 dai_link->ops = &graph_ops;304306 dai_link->init = asoc_simple_dai_init;305307306306- return 0;308308+out_put_node:309309+ of_node_put(ports);310310+ of_node_put(port);311311+ of_node_put(node);312312+ return ret;307313}308314309315static int graph_dai_link_of(struct asoc_simple_priv *priv,
+7
sound/soc/generic/simple-card-utils.c
···349349 /* Assumes platform == cpu */350350 if (!dai_link->platforms->of_node)351351 dai_link->platforms->of_node = dai_link->cpus->of_node;352352+353353+ /*354354+ * DPCM BE can be no platform.355355+ * Alloced memory will be waste, but not leak.356356+ */357357+ if (!dai_link->platforms->of_node)358358+ dai_link->num_platforms = 0;352359}353360EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform);354361
+13-13
sound/soc/generic/simple-card.c
···124124125125 li->link++;126126127127- of_node_put(node);128128-129127 /* For single DAI link & old style of DT node */130128 if (is_top)131129 prefix = PREFIX;···145147146148 ret = asoc_simple_parse_cpu(np, dai_link, &is_single_links);147149 if (ret)148148- return ret;150150+ goto out_put_node;149151150152 ret = asoc_simple_parse_clk_cpu(dev, np, dai_link, dai);151153 if (ret < 0)152152- return ret;154154+ goto out_put_node;153155154156 ret = asoc_simple_set_dailink_name(dev, dai_link,155157 "fe.%s",156158 cpus->dai_name);157159 if (ret < 0)158158- return ret;160160+ goto out_put_node;159161160162 asoc_simple_canonicalize_cpu(dai_link, is_single_links);161163 } else {···178180179181 ret = asoc_simple_parse_codec(np, dai_link);180182 if (ret < 0)181181- return ret;183183+ goto out_put_node;182184183185 ret = asoc_simple_parse_clk_codec(dev, np, dai_link, dai);184186 if (ret < 0)185185- return ret;187187+ goto out_put_node;186188187189 ret = asoc_simple_set_dailink_name(dev, dai_link,188190 "be.%s",189191 codecs->dai_name);190192 if (ret < 0)191191- return ret;193193+ goto out_put_node;192194193195 /* check "prefix" from top node */194196 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,···206208207209 ret = asoc_simple_parse_tdm(np, dai);208210 if (ret)209209- return ret;211211+ goto out_put_node;210212211213 ret = asoc_simple_parse_daifmt(dev, node, codec,212214 prefix, &dai_link->dai_fmt);213215 if (ret < 0)214214- return ret;216216+ goto out_put_node;215217216218 dai_link->dpcm_playback = 1;217219 dai_link->dpcm_capture = 1;218220 dai_link->ops = &simple_ops;219221 dai_link->init = asoc_simple_dai_init;220222221221- return 0;223223+out_put_node:224224+ of_node_put(node);225225+ return ret;222226}223227224228static int simple_dai_link_of(struct asoc_simple_priv *priv,···364364 goto error;365365 }366366367367- of_node_put(codec);368368-369367 /* get convert-xxx property */370368 memset(&adata, 0, sizeof(adata));371369 for_each_child_of_node(node, np)···385387 ret = func_noml(priv, np, codec, li, is_top);386388387389 if (ret < 0) {390390+ of_node_put(codec);388391 of_node_put(np);389392 goto error;390393 }391394 }392395396396+ of_node_put(codec);393397 node = of_get_next_child(top, node);394398 } while (!is_top && node);395399
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-bxt-match.c - tables and support for BXT ACPI enumeration.33+ * soc-acpi-intel-bxt-match.c - tables and support for BXT ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
+1-1
sound/soc/intel/common/soc-acpi-intel-byt-match.c
···11// SPDX-License-Identifier: GPL-2.0-only22/*33- * soc-apci-intel-byt-match.c - tables and support for BYT ACPI enumeration.33+ * soc-acpi-intel-byt-match.c - tables and support for BYT ACPI enumeration.44 *55 * Copyright (c) 2017, Intel Corporation.66 */
+1-1
sound/soc/intel/common/soc-acpi-intel-cht-match.c
···11// SPDX-License-Identifier: GPL-2.0-only22/*33- * soc-apci-intel-cht-match.c - tables and support for CHT ACPI enumeration.33+ * soc-acpi-intel-cht-match.c - tables and support for CHT ACPI enumeration.44 *55 * Copyright (c) 2017, Intel Corporation.66 */
+1-1
sound/soc/intel/common/soc-acpi-intel-cnl-match.c
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-cnl-match.c - tables and support for CNL ACPI enumeration.33+ * soc-acpi-intel-cnl-match.c - tables and support for CNL ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
+1-1
sound/soc/intel/common/soc-acpi-intel-glk-match.c
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-glk-match.c - tables and support for GLK ACPI enumeration.33+ * soc-acpi-intel-glk-match.c - tables and support for GLK ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
+1-1
sound/soc/intel/common/soc-acpi-intel-hda-match.c
···22// Copyright (c) 2018, Intel Corporation.3344/*55- * soc-apci-intel-hda-match.c - tables and support for HDA+ACPI enumeration.55+ * soc-acpi-intel-hda-match.c - tables and support for HDA+ACPI enumeration.66 *77 */88
···11// SPDX-License-Identifier: GPL-2.0-only22/*33- * soc-apci-intel-hsw-bdw-match.c - tables and support for ACPI enumeration.33+ * soc-acpi-intel-hsw-bdw-match.c - tables and support for ACPI enumeration.44 *55 * Copyright (c) 2017, Intel Corporation.66 */
+1-1
sound/soc/intel/common/soc-acpi-intel-icl-match.c
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-icl-match.c - tables and support for ICL ACPI enumeration.33+ * soc-acpi-intel-icl-match.c - tables and support for ICL ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
+1-1
sound/soc/intel/common/soc-acpi-intel-kbl-match.c
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-kbl-match.c - tables and support for KBL ACPI enumeration.33+ * soc-acpi-intel-kbl-match.c - tables and support for KBL ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
+1-1
sound/soc/intel/common/soc-acpi-intel-skl-match.c
···11// SPDX-License-Identifier: GPL-2.022/*33- * soc-apci-intel-skl-match.c - tables and support for SKL ACPI enumeration.33+ * soc-acpi-intel-skl-match.c - tables and support for SKL ACPI enumeration.44 *55 * Copyright (c) 2018, Intel Corporation.66 *
···326326 val |= I2S_CHN_4;327327 break;328328 case 2:329329- case 1:330329 val |= I2S_CHN_2;331330 break;332331 default:···458459 },459460 .capture = {460461 .stream_name = "Capture",461461- .channels_min = 1,462462+ .channels_min = 2,462463 .channels_max = 2,463464 .rates = SNDRV_PCM_RATE_8000_192000,464465 .formats = (SNDRV_PCM_FMTBIT_S8 |···658659 }659660660661 if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {661661- if (val >= 1 && val <= 8)662662+ if (val >= 2 && val <= 8)662663 soc_dai->capture.channels_max = val;663664 }664665
+32
sound/soc/rockchip/rockchip_max98090.c
···6060 SOC_DAPM_PIN_SWITCH("Speaker"),6161};62626363+static int rk_jack_event(struct notifier_block *nb, unsigned long event,6464+ void *data)6565+{6666+ struct snd_soc_jack *jack = (struct snd_soc_jack *)data;6767+ struct snd_soc_dapm_context *dapm = &jack->card->dapm;6868+6969+ if (event & SND_JACK_MICROPHONE)7070+ snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");7171+ else7272+ snd_soc_dapm_disable_pin(dapm, "MICBIAS");7373+7474+ snd_soc_dapm_sync(dapm);7575+7676+ return 0;7777+}7878+7979+static struct notifier_block rk_jack_nb = {8080+ .notifier_call = rk_jack_event,8181+};8282+8383+static int rk_init(struct snd_soc_pcm_runtime *runtime)8484+{8585+ /*8686+ * The jack has already been created in the rk_98090_headset_init()8787+ * function.8888+ */8989+ snd_soc_jack_notifier_register(&headset_jack, &rk_jack_nb);9090+9191+ return 0;9292+}9393+6394static int rk_aif1_hw_params(struct snd_pcm_substream *substream,6495 struct snd_pcm_hw_params *params)6596{···149118static struct snd_soc_dai_link rk_dailink = {150119 .name = "max98090",151120 .stream_name = "Audio",121121+ .init = rk_init,152122 .ops = &rk_aif1_ops,153123 /* set max98090 as slave */154124 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+5-3
sound/soc/samsung/odroid.c
···284284 }285285286286 of_node_put(cpu);287287- of_node_put(codec);288287 if (ret < 0)289289- return ret;288288+ goto err_put_node;290289291290 ret = snd_soc_of_get_dai_link_codecs(dev, codec, codec_link);292291 if (ret < 0)···308309 ret = PTR_ERR(priv->clk_i2s_bus);309310 goto err_put_sclk;310311 }311311- of_node_put(cpu_dai);312312313313 ret = devm_snd_soc_register_card(dev, card);314314 if (ret < 0) {···315317 goto err_put_clk_i2s;316318 }317319320320+ of_node_put(cpu_dai);321321+ of_node_put(codec);318322 return 0;319323320324err_put_clk_i2s:···326326err_put_cpu_dai:327327 of_node_put(cpu_dai);328328 snd_soc_of_put_dai_link_codecs(codec_link);329329+err_put_node:330330+ of_node_put(codec);329331 return ret;330332}331333
+5-2
sound/soc/soc-core.c
···15111511 }15121512 }1513151315141514- if (dai_link->dai_fmt)15151515- snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt);15141514+ if (dai_link->dai_fmt) {15151515+ ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt);15161516+ if (ret)15171517+ return ret;15181518+ }1516151915171520 ret = soc_post_component_init(rtd, dai_link->name);15181521 if (ret)
+6-4
sound/soc/soc-dapm.c
···11571157 list_add_tail(&widget->work_list, list);1158115811591159 if (custom_stop_condition && custom_stop_condition(widget, dir)) {11601160- widget->endpoints[dir] = 1;11611161- return widget->endpoints[dir];11601160+ list = NULL;11611161+ custom_stop_condition = NULL;11621162 }1163116311641164 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) {···11951195 *11961196 * Optionally, can be supplied with a function acting as a stopping condition.11971197 * This function takes the dapm widget currently being examined and the walk11981198- * direction as an arguments, it should return true if the walk should be11991199- * stopped and false otherwise.11981198+ * direction as an arguments, it should return true if widgets from that point11991199+ * in the graph onwards should not be added to the widget list.12001200 */12011201static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,12021202 struct list_head *list,···37063706 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n",37073707 w->name, ret);3708370837093709+ kfree_const(w->sname);37103710+ kfree(w);37093711 return ERR_PTR(ret);37103712}37113713
+2-2
sound/soc/sof/intel/cnl.c
···101101 /*102102 * This interrupt is not shared so no need to return IRQ_NONE.103103 */104104- dev_err_ratelimited(sdev->dev,105105- "error: nothing to do in IRQ thread\n");104104+ dev_dbg_ratelimited(sdev->dev,105105+ "nothing to do in IPC IRQ thread\n");106106 }107107108108 /* re-enable IPC interrupt */
+2-2
sound/soc/sof/intel/hda-ipc.c
···224224 /*225225 * This interrupt is not shared so no need to return IRQ_NONE.226226 */227227- dev_err_ratelimited(sdev->dev,228228- "error: nothing to do in IRQ thread\n");227227+ dev_dbg_ratelimited(sdev->dev,228228+ "nothing to do in IPC IRQ thread\n");229229 }230230231231 /* re-enable IPC interrupt */
+36-10
sound/soc/ti/davinci-mcasp.c
···196196{197197 u32 bit;198198199199- for_each_set_bit(bit, &mcasp->pdir, PIN_BIT_AFSR) {199199+ for_each_set_bit(bit, &mcasp->pdir, PIN_BIT_AMUTE) {200200 if (enable)201201 mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, BIT(bit));202202 else···224224 if (mcasp_is_synchronous(mcasp)) {225225 mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXHCLKRST);226226 mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXCLKRST);227227+ mcasp_set_clk_pdir(mcasp, true);227228 }228229229230 /* Activate serializer(s) */···12641263 return ret;12651264}1266126512661266+static int davinci_mcasp_hw_rule_slot_width(struct snd_pcm_hw_params *params,12671267+ struct snd_pcm_hw_rule *rule)12681268+{12691269+ struct davinci_mcasp_ruledata *rd = rule->private;12701270+ struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);12711271+ struct snd_mask nfmt;12721272+ int i, slot_width;12731273+12741274+ snd_mask_none(&nfmt);12751275+ slot_width = rd->mcasp->slot_width;12761276+12771277+ for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {12781278+ if (snd_mask_test(fmt, i)) {12791279+ if (snd_pcm_format_width(i) <= slot_width) {12801280+ snd_mask_set(&nfmt, i);12811281+ }12821282+ }12831283+ }12841284+12851285+ return snd_mask_refine(fmt, &nfmt);12861286+}12871287+12671288static const unsigned int davinci_mcasp_dai_rates[] = {12681289 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000,12691290 88200, 96000, 176400, 192000,···14071384 struct davinci_mcasp_ruledata *ruledata =14081385 &mcasp->ruledata[substream->stream];14091386 u32 max_channels = 0;14101410- int i, dir;13871387+ int i, dir, ret;14111388 int tdm_slots = mcasp->tdm_slots;1412138914131390 /* Do not allow more then one stream per direction */···14361413 max_channels++;14371414 }14381415 ruledata->serializers = max_channels;14161416+ ruledata->mcasp = mcasp;14391417 max_channels *= tdm_slots;14401418 /*14411419 * If the already active stream has less channels than the calculated···14631439 0, SNDRV_PCM_HW_PARAM_CHANNELS,14641440 &mcasp->chconstr[substream->stream]);1465144114661466- if (mcasp->slot_width)14671467- snd_pcm_hw_constraint_minmax(substream->runtime,14681468- SNDRV_PCM_HW_PARAM_SAMPLE_BITS,14691469- 8, mcasp->slot_width);14421442+ if (mcasp->slot_width) {14431443+ /* Only allow formats require <= slot_width bits on the bus */14441444+ ret = snd_pcm_hw_rule_add(substream->runtime, 0,14451445+ SNDRV_PCM_HW_PARAM_FORMAT,14461446+ davinci_mcasp_hw_rule_slot_width,14471447+ ruledata,14481448+ SNDRV_PCM_HW_PARAM_FORMAT, -1);14491449+ if (ret)14501450+ return ret;14511451+ }1470145214711453 /*14721454 * If we rely on implicit BCLK divider setting we should14731455 * set constraints based on what we can provide.14741456 */14751457 if (mcasp->bclk_master && mcasp->bclk_div == 0 && mcasp->sysclk_freq) {14761476- int ret;14771477-14781478- ruledata->mcasp = mcasp;14791479-14801458 ret = snd_pcm_hw_rule_add(substream->runtime, 0,14811459 SNDRV_PCM_HW_PARAM_RATE,14821460 davinci_mcasp_hw_rule_rate,