diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-01-27 17:45:44 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-01-27 17:45:44 +0100 |
commit | 90fb04f890bcb7384b4d4c216dc2640b0a870df3 (patch) | |
tree | f4c35d625351cd8034bdd37bb3e19926bad674db /include/sound | |
parent | 9b132f2764e5a04bfb2e6c6f51cf5a729617d6a4 (diff) | |
parent | a7196caf83ea9e9b56c5c8c95fbfe0d45acec46b (diff) |
Merge tag 'asoc-v5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.6
A pretty big release this time around, a lot of new drivers and both
Morimoto-san and Takashi were doing subsystem wide updates as well:
- Further big refactorings from Morimoto-san simplifying the core
interfaces and moving things to the component level.
- Transition of drivers to managed buffer allocation and removal of
redundant PCM ioctls.
- New driver support for Ingenic JZ4770, Mediatek MT6660, Qualcomm
WCD934x and WSA881x, and Realtek RT700, RT711, RT715, RT1011, RT1015
and RT1308.
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-acpi-intel-match.h | 6 | ||||
-rw-r--r-- | include/sound/soc-acpi.h | 21 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 3 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 3 | ||||
-rw-r--r-- | include/sound/soc.h | 52 | ||||
-rw-r--r-- | include/sound/sof.h | 9 | ||||
-rw-r--r-- | include/sound/sof/channel_map.h | 61 | ||||
-rw-r--r-- | include/sound/sof/dai-imx.h | 20 | ||||
-rw-r--r-- | include/sound/sof/dai.h | 1 | ||||
-rw-r--r-- | include/sound/sof/info.h | 15 | ||||
-rw-r--r-- | include/sound/sof/topology.h | 27 |
11 files changed, 174 insertions, 44 deletions
diff --git a/include/sound/soc-acpi-intel-match.h b/include/sound/soc-acpi-intel-match.h index 20c0bee3b959..ab6f75a86611 100644 --- a/include/sound/soc-acpi-intel-match.h +++ b/include/sound/soc-acpi-intel-match.h @@ -31,6 +31,12 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_sdw_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cfl_sdw_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_sdw_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[]; + /* * generic table used for HDA codec-based platforms, possibly with * additional ACPI-enumerated codecs diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index c4c997bd0379..a217a87cae86 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -61,6 +61,8 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * @platform: string used for HDaudio codec support * @codec_mask: used for HDAudio support * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver + * @link_mask: links enabled on the board + * @links: array of link _ADR descriptors, null terminated */ struct snd_soc_acpi_mach_params { u32 acpi_ipc_irq_index; @@ -68,6 +70,23 @@ struct snd_soc_acpi_mach_params { u32 codec_mask; u32 dmic_num; bool common_hdmi_codec_drv; + u32 link_mask; + const struct snd_soc_acpi_link_adr *links; +}; + +/** + * snd_soc_acpi_link_adr: ACPI-based list of _ADR, with a variable + * number of devices per link + * + * @mask: one bit set indicates the link this list applies to + * @num_adr: ARRAY_SIZE of adr + * @adr: array of _ADR (represented as u64). + */ + +struct snd_soc_acpi_link_adr { + const u32 mask; + const u32 num_adr; + const u64 *adr; }; /** @@ -78,6 +97,7 @@ struct snd_soc_acpi_mach_params { * * @id: ACPI ID (usually the codec's) used to find a matching machine driver. * @link_mask: describes required board layout, e.g. for SoundWire. + * @links: array of link _ADR descriptors, null terminated. * @drv_name: machine driver name * @fw_filename: firmware file name. Used when SOF is not enabled. * @board: board name @@ -94,6 +114,7 @@ struct snd_soc_acpi_mach_params { struct snd_soc_acpi_mach { const u8 id[ACPI_ID_LEN]; const u32 link_mask; + const struct snd_soc_acpi_link_adr *links; const char *drv_name; const char *fw_filename; const char *board; diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 939c73db6a03..eaaeb00e9e84 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -286,8 +286,6 @@ struct snd_soc_dai_driver { /* DAI driver callbacks */ int (*probe)(struct snd_soc_dai *dai); int (*remove)(struct snd_soc_dai *dai); - int (*suspend)(struct snd_soc_dai *dai); - int (*resume)(struct snd_soc_dai *dai); /* compress dai */ int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num); /* Optional Callback used at pcm creation*/ @@ -304,7 +302,6 @@ struct snd_soc_dai_driver { unsigned int symmetric_rates:1; unsigned int symmetric_channels:1; unsigned int symmetric_samplebits:1; - unsigned int bus_control:1; /* DAI is also used for the control bus */ /* probe ordering - for components with runtime dependencies */ int probe_order; diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 6e8a31225383..2a306c6f3fbc 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -392,6 +392,8 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_soc_dapm_put_enum_double_locked(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, @@ -434,6 +436,7 @@ void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm); /* dapm events */ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event); +void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream); void snd_soc_dapm_shutdown(struct snd_soc_card *card); /* external DAPM widget events */ diff --git a/include/sound/soc.h b/include/sound/soc.h index 262896799826..f0e4f36f83bf 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -464,10 +464,8 @@ static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) void snd_soc_disconnect_sync(struct device *dev); -struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, - const char *dai_link, int stream); struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link); + struct snd_soc_dai_link *dai_link); bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd); void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream); @@ -738,19 +736,9 @@ struct snd_soc_compr_ops { int (*trigger)(struct snd_compr_stream *); }; -struct snd_soc_rtdcom_list { - struct snd_soc_component *component; - struct list_head list; /* rtd::component_list */ -}; struct snd_soc_component* snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd, const char *driver_name); -#define for_each_rtd_components(rtd, rtdcom, _component) \ - for (rtdcom = list_first_entry(&(rtd)->component_list, \ - typeof(*rtdcom), list); \ - (&rtdcom->list != &(rtd)->component_list) && \ - (_component = rtdcom->component); \ - rtdcom = list_next_entry(rtdcom, list)) struct snd_soc_dai_link_component { const char *name; @@ -852,7 +840,6 @@ struct snd_soc_dai_link { /* Do not create a PCM for this DAI link (Backend link) */ unsigned int ignore:1; - struct list_head list; /* DAI link list of the soc card */ #ifdef CONFIG_SND_SOC_TOPOLOGY struct snd_soc_dobj dobj; /* For topology */ #endif @@ -952,6 +939,7 @@ struct snd_soc_dai_link { #define COMP_CODEC(_name, _dai) { .name = _name, .dai_name = _dai, } #define COMP_PLATFORM(_name) { .name = _name } #define COMP_AUX(_name) { .name = _name } +#define COMP_CODEC_CONF(_name) { .name = _name } #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", } extern struct snd_soc_dai_link_component null_dailink_component[0]; @@ -962,8 +950,7 @@ struct snd_soc_codec_conf { * specify device either by device name, or by * DT/OF node, but not both. */ - const char *dev_name; - struct device_node *of_node; + struct snd_soc_dai_link_component dlc; /* * optional map of kcontrol, widget and path name prefixes that are @@ -989,7 +976,9 @@ struct snd_soc_card { const char *long_name; const char *driver_name; const char *components; +#ifdef CONFIG_DMI char dmi_longname[80]; +#endif /* CONFIG_DMI */ char topology_shortname[32]; struct device *dev; @@ -1037,7 +1026,6 @@ struct snd_soc_card { /* CPU <--> Codec DAI links */ struct snd_soc_dai_link *dai_link; /* predefined links only */ int num_links; /* predefined links only */ - struct list_head dai_link_list; /* all links */ struct list_head rtd_list; int num_rtd; @@ -1107,11 +1095,6 @@ struct snd_soc_card { ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \ (i)++) -#define for_each_card_links(card, link) \ - list_for_each_entry(link, &(card)->dai_link_list, list) -#define for_each_card_links_safe(card, link, _link) \ - list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list) - #define for_each_card_rtds(card, rtd) \ list_for_each_entry(rtd, &(card)->rtd_list, list) #define for_each_card_rtds_safe(card, rtd, _rtd) \ @@ -1157,12 +1140,18 @@ struct snd_soc_pcm_runtime { unsigned int num; /* 0-based and monotonic increasing */ struct list_head list; /* rtd list of the soc card */ - struct list_head component_list; /* list of connected components */ /* bit field */ unsigned int pop_wait:1; unsigned int fe_compr:1; /* for Dynamic PCM */ + + int num_components; + struct snd_soc_component *components[0]; /* CPU/Codec/Platform */ }; +#define for_each_rtd_components(rtd, i, component) \ + for ((i) = 0; \ + ((i) < rtd->num_components) && ((component) = rtd->components[i]);\ + (i)++) #define for_each_rtd_codec_dai(rtd, i, dai)\ for ((i) = 0; \ ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \ @@ -1170,6 +1159,7 @@ struct snd_soc_pcm_runtime { #define for_each_rtd_codec_dai_rollback(rtd, i, dai) \ for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);) +void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd); /* mixer control */ struct soc_mixer_control { @@ -1333,13 +1323,10 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev, struct snd_soc_dai_link *dai_link); void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link); -int snd_soc_add_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); -void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); -struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, - int id, const char *name, - const char *stream_name); +int snd_soc_add_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link); +void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd); struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, @@ -1409,11 +1396,6 @@ static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm) mutex_unlock(&dapm->card->dapm_mutex); } -/* bypass */ -int snd_soc_pcm_lib_ioctl(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - unsigned int cmd, void *arg); - #include <sound/soc-component.h> #endif diff --git a/include/sound/sof.h b/include/sound/sof.h index 479101736ee0..a0cbca021230 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -22,7 +22,6 @@ struct snd_sof_dsp_ops; */ struct snd_sof_pdata { const struct firmware *fw; - const char *drv_name; const char *name; const char *platform; @@ -84,20 +83,18 @@ struct sof_dev_desc { const void *chip_info; /* defaults for no codec mode */ - const char *nocodec_fw_filename; const char *nocodec_tplg_filename; /* defaults paths for firmware and topology files */ const char *default_fw_path; const char *default_tplg_path; + /* default firmware name */ + const char *default_fw_filename; + const struct snd_sof_dsp_ops *ops; - const struct sof_arch_ops *arch_ops; }; int sof_nocodec_setup(struct device *dev, - struct snd_sof_pdata *sof_pdata, - struct snd_soc_acpi_mach *mach, - const struct sof_dev_desc *desc, const struct snd_sof_dsp_ops *ops); #endif diff --git a/include/sound/sof/channel_map.h b/include/sound/sof/channel_map.h new file mode 100644 index 000000000000..21044eb5f377 --- /dev/null +++ b/include/sound/sof/channel_map.h @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ +/* + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + */ + +#ifndef __IPC_CHANNEL_MAP_H__ +#define __IPC_CHANNEL_MAP_H__ + +#include <uapi/sound/sof/header.h> +#include <sound/sof/header.h> + +/** + * \brief Channel map, specifies transformation of one-to-many or many-to-one. + * + * In case of one-to-many specifies how the output channels are computed out of + * a single source channel, + * in case of many-to-one specifies how a single target channel is computed + * from a multichannel input stream. + * + * Channel index specifies position of the channel in the stream on the 'one' + * side. + * + * Ext ID is the identifier of external part of the transformation. Depending + * on the context, it may be pipeline ID, dai ID, ... + * + * Channel mask describes which channels are taken into account on the "many" + * side. Bit[i] set to 1 means that i-th channel is used for computation + * (either as source or as a target). + * + * Channel mask is followed by array of coefficients in Q2.30 format, + * one per each channel set in the mask (left to right, LS bit set in the + * mask corresponds to ch_coeffs[0]). + */ +struct sof_ipc_channel_map { + uint32_t ch_index; + uint32_t ext_id; + uint32_t ch_mask; + uint32_t reserved; + int32_t ch_coeffs[0]; +} __packed; + +/** + * \brief Complete map for each channel of a multichannel stream. + * + * num_ch_map Specifies number of items in the ch_map. + * More than one transformation per a single channel is allowed (in case + * multiple external entities are transformed). + * A channel may be skipped in the transformation list, then it is filled + * with 0's by the transformation function. + */ +struct sof_ipc_stream_map { + struct sof_ipc_cmd_hdr hdr; + uint32_t num_ch_map; + uint32_t reserved[3]; + struct sof_ipc_channel_map ch_map[0]; +} __packed; + +#endif /* __IPC_CHANNEL_MAP_H__ */ diff --git a/include/sound/sof/dai-imx.h b/include/sound/sof/dai-imx.h index e02fb0b0fae1..ff9088dcc6f2 100644 --- a/include/sound/sof/dai-imx.h +++ b/include/sound/sof/dai-imx.h @@ -31,4 +31,24 @@ struct sof_ipc_dai_esai_params { uint16_t reserved2; /* alignment */ } __packed; +/* SAI Configuration Request - SOF_IPC_DAI_SAI_CONFIG */ +struct sof_ipc_dai_sai_params { + struct sof_ipc_hdr hdr; + + /* MCLK */ + uint16_t reserved1; + uint16_t mclk_id; + uint32_t mclk_direction; + + uint32_t mclk_rate; /* MCLK frequency in Hz */ + uint32_t fsync_rate; /* FSYNC frequency in Hz */ + uint32_t bclk_rate; /* BCLK frequency in Hz */ + + /* TDM */ + uint32_t tdm_slots; + uint32_t rx_slots; + uint32_t tx_slots; + uint16_t tdm_slot_width; + uint16_t reserved2; /* alignment */ +} __packed; #endif diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index c229565767e5..2565edd336f1 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -75,6 +75,7 @@ struct sof_ipc_dai_config { struct sof_ipc_dai_hda_params hda; struct sof_ipc_dai_alh_params alh; struct sof_ipc_dai_esai_params esai; + struct sof_ipc_dai_sai_params sai; }; } __packed; diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h index a9156b4a062c..1c560144996c 100644 --- a/include/sound/sof/info.h +++ b/include/sound/sof/info.h @@ -30,6 +30,7 @@ enum sof_ipc_ext_data { SOF_IPC_EXT_DMA_BUFFER = 0, SOF_IPC_EXT_WINDOW, + SOF_IPC_EXT_CC_INFO, }; /* FW version - SOF_IPC_GLB_VERSION */ @@ -115,4 +116,18 @@ struct sof_ipc_window { struct sof_ipc_window_elem window[]; } __packed; +struct sof_ipc_cc_version { + struct sof_ipc_ext_data_hdr ext_hdr; + uint32_t major; + uint32_t minor; + uint32_t micro; + + /* reserved for future use */ + uint32_t reserved[4]; + + char name[16]; /* null terminated compiler name */ + char optim[4]; /* null terminated compiler -O flag value */ + char desc[]; /* null terminated compiler description */ +} __packed; + #endif diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h index c47b36240920..8e76178fedf0 100644 --- a/include/sound/sof/topology.h +++ b/include/sound/sof/topology.h @@ -36,6 +36,7 @@ enum sof_comp_type { SOF_COMP_KPB, /* A key phrase buffer component */ SOF_COMP_SELECTOR, /**< channel selector component */ SOF_COMP_DEMUX, + SOF_COMP_ASRC, /**< Asynchronous sample rate converter */ /* keep FILEREAD/FILEWRITE as the last ones */ SOF_COMP_FILEREAD = 10000, /**< host test based file IO */ SOF_COMP_FILEWRITE = 10001, /**< host test based file IO */ @@ -147,6 +148,32 @@ struct sof_ipc_comp_src { uint32_t rate_mask; /**< SOF_RATE_ supported rates */ } __packed; +/* generic ASRC component */ +struct sof_ipc_comp_asrc { + struct sof_ipc_comp comp; + struct sof_ipc_comp_config config; + /* either source or sink rate must be non zero */ + uint32_t source_rate; /**< Define fixed source rate or */ + /**< use 0 to indicate need to get */ + /**< the rate from stream */ + uint32_t sink_rate; /**< Define fixed sink rate or */ + /**< use 0 to indicate need to get */ + /**< the rate from stream */ + uint32_t asynchronous_mode; /**< synchronous 0, asynchronous 1 */ + /**< When 1 the ASRC tracks and */ + /**< compensates for drift. */ + uint32_t operation_mode; /**< push 0, pull 1, In push mode the */ + /**< ASRC consumes a defined number */ + /**< of frames at input, with varying */ + /**< number of frames at output. */ + /**< In pull mode the ASRC outputs */ + /**< a defined number of frames while */ + /**< number of input frames varies. */ + + /* reserved for future use */ + uint32_t reserved[4]; +} __attribute__((packed)); + /* generic MUX component */ struct sof_ipc_comp_mux { struct sof_ipc_comp comp; |