Commit 86a37eb6 authored by Mark Brown's avatar Mark Brown

ASoC: Few constifications (mostly arguments)

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make few pointers in ASoC functions as pointers to const, so the code is
clearer to read, a bit safer and allows further constifications (e.g.
placing some data as rodata).
parents d6bb39fe de267e7a
...@@ -180,8 +180,8 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, ...@@ -180,8 +180,8 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio); int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio);
/* Digital Audio interface formatting */ /* Digital Audio interface formatting */
int snd_soc_dai_get_fmt_max_priority(struct snd_soc_pcm_runtime *rtd); int snd_soc_dai_get_fmt_max_priority(const struct snd_soc_pcm_runtime *rtd);
u64 snd_soc_dai_get_fmt(struct snd_soc_dai *dai, int priority); u64 snd_soc_dai_get_fmt(const struct snd_soc_dai *dai, int priority);
int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
...@@ -198,11 +198,11 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, ...@@ -198,11 +198,11 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
int direction); int direction);
int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai, int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot); unsigned int *rx_num, unsigned int *rx_slot);
int snd_soc_dai_is_dummy(struct snd_soc_dai *dai); int snd_soc_dai_is_dummy(const struct snd_soc_dai *dai);
int snd_soc_dai_hw_params(struct snd_soc_dai *dai, int snd_soc_dai_hw_params(struct snd_soc_dai *dai,
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
...@@ -218,7 +218,7 @@ void snd_soc_dai_suspend(struct snd_soc_dai *dai); ...@@ -218,7 +218,7 @@ void snd_soc_dai_suspend(struct snd_soc_dai *dai);
void snd_soc_dai_resume(struct snd_soc_dai *dai); void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
struct snd_soc_pcm_runtime *rtd, int num); struct snd_soc_pcm_runtime *rtd, int num);
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream); bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int stream);
void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link); void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link);
void snd_soc_dai_action(struct snd_soc_dai *dai, void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action); int stream, int action);
...@@ -232,7 +232,7 @@ static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai, ...@@ -232,7 +232,7 @@ static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai,
{ {
snd_soc_dai_action(dai, stream, -1); snd_soc_dai_action(dai, stream, -1);
} }
int snd_soc_dai_active(struct snd_soc_dai *dai); int snd_soc_dai_active(const struct snd_soc_dai *dai);
int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order); int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);
int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order); int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order);
...@@ -271,7 +271,7 @@ int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai, ...@@ -271,7 +271,7 @@ int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream, struct snd_compr_stream *cstream,
struct snd_compr_metadata *metadata); struct snd_compr_metadata *metadata);
const char *snd_soc_dai_name_get(struct snd_soc_dai *dai); const char *snd_soc_dai_name_get(const struct snd_soc_dai *dai);
struct snd_soc_dai_ops { struct snd_soc_dai_ops {
/* DAI driver callbacks */ /* DAI driver callbacks */
...@@ -307,7 +307,7 @@ struct snd_soc_dai_ops { ...@@ -307,7 +307,7 @@ struct snd_soc_dai_ops {
int (*set_channel_map)(struct snd_soc_dai *dai, int (*set_channel_map)(struct snd_soc_dai *dai,
unsigned int tx_num, const unsigned int *tx_slot, unsigned int tx_num, const unsigned int *tx_slot,
unsigned int rx_num, const unsigned int *rx_slot); unsigned int rx_num, const unsigned int *rx_slot);
int (*get_channel_map)(struct snd_soc_dai *dai, int (*get_channel_map)(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot); unsigned int *rx_num, unsigned int *rx_slot);
int (*set_tristate)(struct snd_soc_dai *dai, int tristate); int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
...@@ -413,7 +413,7 @@ struct snd_soc_dai_driver { ...@@ -413,7 +413,7 @@ struct snd_soc_dai_driver {
unsigned int id; unsigned int id;
unsigned int base; unsigned int base;
struct snd_soc_dobj dobj; struct snd_soc_dobj dobj;
struct of_phandle_args *dai_args; const struct of_phandle_args *dai_args;
/* ops */ /* ops */
const struct snd_soc_dai_ops *ops; const struct snd_soc_dai_ops *ops;
...@@ -473,7 +473,7 @@ struct snd_soc_dai { ...@@ -473,7 +473,7 @@ struct snd_soc_dai {
unsigned int probed:1; unsigned int probed:1;
}; };
static inline struct snd_soc_pcm_stream * static inline const struct snd_soc_pcm_stream *
snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
{ {
return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
...@@ -518,7 +518,8 @@ static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *play ...@@ -518,7 +518,8 @@ static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *play
snd_soc_dai_dma_data_set_capture(dai, capture); snd_soc_dai_dma_data_set_capture(dai, capture);
} }
static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream) static inline unsigned int snd_soc_dai_tdm_mask_get(const struct snd_soc_dai *dai,
int stream)
{ {
return dai->stream[stream].tdm_mask; return dai->stream[stream].tdm_mask;
} }
...@@ -529,7 +530,8 @@ static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream, ...@@ -529,7 +530,8 @@ static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream,
dai->stream[stream].tdm_mask = tdm_mask; dai->stream[stream].tdm_mask = tdm_mask;
} }
static inline unsigned int snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream) static inline unsigned int snd_soc_dai_stream_active(const struct snd_soc_dai *dai,
int stream)
{ {
/* see snd_soc_dai_action() for setup */ /* see snd_soc_dai_action() for setup */
return dai->stream[stream].active; return dai->stream[stream].active;
......
...@@ -534,10 +534,10 @@ static inline int snd_soc_set_dmi_name(struct snd_soc_card *card, ...@@ -534,10 +534,10 @@ static inline int snd_soc_set_dmi_name(struct snd_soc_card *card,
/* Utility functions to get clock rates from various things */ /* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); int snd_soc_params_to_frame_size(const struct snd_pcm_hw_params *params);
int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); int snd_soc_params_to_bclk(const struct snd_pcm_hw_params *parms);
int snd_soc_tdm_params_to_bclk(struct snd_pcm_hw_params *params, int snd_soc_tdm_params_to_bclk(const struct snd_pcm_hw_params *params,
int tdm_width, int tdm_slots, int slot_multiple); int tdm_width, int tdm_slots, int slot_multiple);
/* set runtime hw params */ /* set runtime hw params */
...@@ -675,7 +675,7 @@ struct snd_soc_dai_link_component { ...@@ -675,7 +675,7 @@ struct snd_soc_dai_link_component {
const char *name; const char *name;
struct device_node *of_node; struct device_node *of_node;
const char *dai_name; const char *dai_name;
struct of_phandle_args *dai_args; const struct of_phandle_args *dai_args;
}; };
/* /*
...@@ -837,7 +837,8 @@ struct snd_soc_dai_link { ...@@ -837,7 +837,8 @@ struct snd_soc_dai_link {
#endif #endif
}; };
static inline int snd_soc_link_num_ch_map(struct snd_soc_dai_link *link) { static inline int snd_soc_link_num_ch_map(const struct snd_soc_dai_link *link)
{
return max(link->num_cpus, link->num_codecs); return max(link->num_cpus, link->num_codecs);
} }
...@@ -1299,7 +1300,7 @@ struct soc_enum { ...@@ -1299,7 +1300,7 @@ struct soc_enum {
#endif #endif
}; };
static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) static inline bool snd_soc_volsw_is_stereo(const struct soc_mixer_control *mc)
{ {
if (mc->reg == mc->rreg && mc->shift == mc->rshift) if (mc->reg == mc->rreg && mc->shift == mc->rshift)
return false; return false;
...@@ -1311,7 +1312,7 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) ...@@ -1311,7 +1312,7 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
return true; return true;
} }
static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e, static inline unsigned int snd_soc_enum_val_to_item(const struct soc_enum *e,
unsigned int val) unsigned int val)
{ {
unsigned int i; unsigned int i;
...@@ -1326,7 +1327,7 @@ static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e, ...@@ -1326,7 +1327,7 @@ static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e,
return 0; return 0;
} }
static inline unsigned int snd_soc_enum_item_to_val(struct soc_enum *e, static inline unsigned int snd_soc_enum_item_to_val(const struct soc_enum *e,
unsigned int item) unsigned int item)
{ {
if (!e->values) if (!e->values)
...@@ -1401,7 +1402,7 @@ unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np, ...@@ -1401,7 +1402,7 @@ unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np,
snd_soc_daifmt_clock_provider_from_bitmap( \ snd_soc_daifmt_clock_provider_from_bitmap( \
snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix)) snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix))
int snd_soc_get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream); int snd_soc_get_stream_cpu(const struct snd_soc_dai_link *dai_link, int stream);
int snd_soc_get_dlc(const struct of_phandle_args *args, int snd_soc_get_dlc(const struct of_phandle_args *args,
struct snd_soc_dai_link_component *dlc); struct snd_soc_dai_link_component *dlc);
int snd_soc_of_get_dlc(struct device_node *of_node, int snd_soc_of_get_dlc(struct device_node *of_node,
......
...@@ -1833,7 +1833,7 @@ static int rx_macro_hw_params(struct snd_pcm_substream *substream, ...@@ -1833,7 +1833,7 @@ static int rx_macro_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int rx_macro_get_channel_map(struct snd_soc_dai *dai, static int rx_macro_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -1167,7 +1167,7 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream, ...@@ -1167,7 +1167,7 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int tx_macro_get_channel_map(struct snd_soc_dai *dai, static int tx_macro_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -892,7 +892,7 @@ static int va_macro_hw_params(struct snd_pcm_substream *substream, ...@@ -892,7 +892,7 @@ static int va_macro_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int va_macro_get_channel_map(struct snd_soc_dai *dai, static int va_macro_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -992,7 +992,7 @@ static int wsa_macro_hw_params(struct snd_pcm_substream *substream, ...@@ -992,7 +992,7 @@ static int wsa_macro_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int wsa_macro_get_channel_map(struct snd_soc_dai *dai, static int wsa_macro_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -2009,7 +2009,7 @@ static int wcd9335_set_channel_map(struct snd_soc_dai *dai, ...@@ -2009,7 +2009,7 @@ static int wcd9335_set_channel_map(struct snd_soc_dai *dai,
return 0; return 0;
} }
static int wcd9335_get_channel_map(struct snd_soc_dai *dai, static int wcd9335_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -1952,7 +1952,7 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai, ...@@ -1952,7 +1952,7 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
return 0; return 0;
} }
static int wcd934x_get_channel_map(struct snd_soc_dai *dai, static int wcd934x_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
......
...@@ -341,7 +341,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn ...@@ -341,7 +341,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
{ {
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_stream *stream_info; const struct snd_soc_pcm_stream *stream_info;
struct hdac_ext_stream *link_stream; struct hdac_ext_stream *link_stream;
struct hdac_ext_link *link; struct hdac_ext_link *link;
struct avs_dma_data *data; struct avs_dma_data *data;
...@@ -637,7 +637,7 @@ static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_so ...@@ -637,7 +637,7 @@ static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_so
static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_pcm_stream *stream_info; const struct snd_soc_pcm_stream *stream_info;
struct avs_dma_data *data; struct avs_dma_data *data;
struct hdac_ext_stream *host_stream; struct hdac_ext_stream *host_stream;
unsigned int format_val; unsigned int format_val;
......
...@@ -297,7 +297,7 @@ static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc, ...@@ -297,7 +297,7 @@ static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc,
return 0; return 0;
} }
const char *snd_soc_dai_name_get(struct snd_soc_dai *dai) const char *snd_soc_dai_name_get(const struct snd_soc_dai *dai)
{ {
/* see snd_soc_is_matching_dai() */ /* see snd_soc_is_matching_dai() */
if (dai->driver->name) if (dai->driver->name)
...@@ -3430,7 +3430,7 @@ unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np, ...@@ -3430,7 +3430,7 @@ unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np,
} }
EXPORT_SYMBOL_GPL(snd_soc_daifmt_parse_clock_provider_raw); EXPORT_SYMBOL_GPL(snd_soc_daifmt_parse_clock_provider_raw);
int snd_soc_get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream) int snd_soc_get_stream_cpu(const struct snd_soc_dai_link *dai_link, int stream)
{ {
/* /*
* [Normal] * [Normal]
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <sound/soc-link.h> #include <sound/soc-link.h>
#define soc_dai_ret(dai, ret) _soc_dai_ret(dai, __func__, ret) #define soc_dai_ret(dai, ret) _soc_dai_ret(dai, __func__, ret)
static inline int _soc_dai_ret(struct snd_soc_dai *dai, static inline int _soc_dai_ret(const struct snd_soc_dai *dai,
const char *func, int ret) const char *func, int ret)
{ {
/* Positive, Zero values are not errors */ /* Positive, Zero values are not errors */
...@@ -134,7 +134,7 @@ int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) ...@@ -134,7 +134,7 @@ int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
} }
EXPORT_SYMBOL_GPL(snd_soc_dai_set_bclk_ratio); EXPORT_SYMBOL_GPL(snd_soc_dai_set_bclk_ratio);
int snd_soc_dai_get_fmt_max_priority(struct snd_soc_pcm_runtime *rtd) int snd_soc_dai_get_fmt_max_priority(const struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
int i, max = 0; int i, max = 0;
...@@ -166,7 +166,7 @@ int snd_soc_dai_get_fmt_max_priority(struct snd_soc_pcm_runtime *rtd) ...@@ -166,7 +166,7 @@ int snd_soc_dai_get_fmt_max_priority(struct snd_soc_pcm_runtime *rtd)
* modes. This will mean that sometimes fewer formats * modes. This will mean that sometimes fewer formats
* are reported here than are supported by set_fmt(). * are reported here than are supported by set_fmt().
*/ */
u64 snd_soc_dai_get_fmt(struct snd_soc_dai *dai, int priority) u64 snd_soc_dai_get_fmt(const struct snd_soc_dai *dai, int priority)
{ {
const struct snd_soc_dai_ops *ops = dai->driver->ops; const struct snd_soc_dai_ops *ops = dai->driver->ops;
u64 fmt = 0; u64 fmt = 0;
...@@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_channel_map); ...@@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_channel_map);
* @rx_slot: pointer to an array which imply the RX slot number channel * @rx_slot: pointer to an array which imply the RX slot number channel
* 0~num-1 uses * 0~num-1 uses
*/ */
int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai, int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
unsigned int *tx_num, unsigned int *tx_slot, unsigned int *tx_num, unsigned int *tx_slot,
unsigned int *rx_num, unsigned int *rx_slot) unsigned int *rx_num, unsigned int *rx_slot)
{ {
...@@ -471,9 +471,9 @@ int snd_soc_dai_compress_new(struct snd_soc_dai *dai, ...@@ -471,9 +471,9 @@ int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
* *
* Returns true if the DAI supports the indicated stream type. * Returns true if the DAI supports the indicated stream type.
*/ */
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) bool snd_soc_dai_stream_valid(const struct snd_soc_dai *dai, int dir)
{ {
struct snd_soc_pcm_stream *stream = snd_soc_dai_get_pcm_stream(dai, dir); const struct snd_soc_pcm_stream *stream = snd_soc_dai_get_pcm_stream(dai, dir);
/* If the codec specifies any channels at all, it supports the stream */ /* If the codec specifies any channels at all, it supports the stream */
return stream->channels_min; return stream->channels_min;
...@@ -528,7 +528,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, ...@@ -528,7 +528,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai,
} }
EXPORT_SYMBOL_GPL(snd_soc_dai_action); EXPORT_SYMBOL_GPL(snd_soc_dai_action);
int snd_soc_dai_active(struct snd_soc_dai *dai) int snd_soc_dai_active(const struct snd_soc_dai *dai)
{ {
int stream, active; int stream, active;
......
...@@ -504,7 +504,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) ...@@ -504,7 +504,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
unsigned int bits = 0, cpu_bits = 0; unsigned int bits = 0, cpu_bits = 0;
for_each_rtd_codec_dais(rtd, i, codec_dai) { for_each_rtd_codec_dais(rtd, i, codec_dai) {
struct snd_soc_pcm_stream *pcm_codec = snd_soc_dai_get_pcm_stream(codec_dai, stream); const struct snd_soc_pcm_stream *pcm_codec = snd_soc_dai_get_pcm_stream(codec_dai, stream);
if (pcm_codec->sig_bits == 0) { if (pcm_codec->sig_bits == 0) {
bits = 0; bits = 0;
...@@ -514,7 +514,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) ...@@ -514,7 +514,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
} }
for_each_rtd_cpu_dais(rtd, i, cpu_dai) { for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
struct snd_soc_pcm_stream *pcm_cpu = snd_soc_dai_get_pcm_stream(cpu_dai, stream); const struct snd_soc_pcm_stream *pcm_cpu = snd_soc_dai_get_pcm_stream(cpu_dai, stream);
if (pcm_cpu->sig_bits == 0) { if (pcm_cpu->sig_bits == 0) {
cpu_bits = 0; cpu_bits = 0;
...@@ -538,7 +538,7 @@ static void soc_pcm_hw_init(struct snd_pcm_hardware *hw) ...@@ -538,7 +538,7 @@ static void soc_pcm_hw_init(struct snd_pcm_hardware *hw)
} }
static void soc_pcm_hw_update_rate(struct snd_pcm_hardware *hw, static void soc_pcm_hw_update_rate(struct snd_pcm_hardware *hw,
struct snd_soc_pcm_stream *p) const struct snd_soc_pcm_stream *p)
{ {
hw->rates = snd_pcm_rate_mask_intersect(hw->rates, p->rates); hw->rates = snd_pcm_rate_mask_intersect(hw->rates, p->rates);
...@@ -551,20 +551,20 @@ static void soc_pcm_hw_update_rate(struct snd_pcm_hardware *hw, ...@@ -551,20 +551,20 @@ static void soc_pcm_hw_update_rate(struct snd_pcm_hardware *hw,
} }
static void soc_pcm_hw_update_chan(struct snd_pcm_hardware *hw, static void soc_pcm_hw_update_chan(struct snd_pcm_hardware *hw,
struct snd_soc_pcm_stream *p) const struct snd_soc_pcm_stream *p)
{ {
hw->channels_min = max(hw->channels_min, p->channels_min); hw->channels_min = max(hw->channels_min, p->channels_min);
hw->channels_max = min(hw->channels_max, p->channels_max); hw->channels_max = min(hw->channels_max, p->channels_max);
} }
static void soc_pcm_hw_update_format(struct snd_pcm_hardware *hw, static void soc_pcm_hw_update_format(struct snd_pcm_hardware *hw,
struct snd_soc_pcm_stream *p) const struct snd_soc_pcm_stream *p)
{ {
hw->formats &= p->formats; hw->formats &= p->formats;
} }
static void soc_pcm_hw_update_subformat(struct snd_pcm_hardware *hw, static void soc_pcm_hw_update_subformat(struct snd_pcm_hardware *hw,
struct snd_soc_pcm_stream *p) const struct snd_soc_pcm_stream *p)
{ {
hw->subformats &= p->subformats; hw->subformats &= p->subformats;
} }
...@@ -583,8 +583,8 @@ int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime *rtd, ...@@ -583,8 +583,8 @@ int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime *rtd,
{ {
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
struct snd_soc_dai *cpu_dai; struct snd_soc_dai *cpu_dai;
struct snd_soc_pcm_stream *codec_stream; const struct snd_soc_pcm_stream *codec_stream;
struct snd_soc_pcm_stream *cpu_stream; const struct snd_soc_pcm_stream *cpu_stream;
unsigned int cpu_chan_min = 0, cpu_chan_max = UINT_MAX; unsigned int cpu_chan_min = 0, cpu_chan_max = UINT_MAX;
int i; int i;
...@@ -1712,7 +1712,7 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream) ...@@ -1712,7 +1712,7 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream)
hw->formats &= formats; hw->formats &= formats;
for_each_rtd_cpu_dais(fe, i, dai) { for_each_rtd_cpu_dais(fe, i, dai) {
struct snd_soc_pcm_stream *cpu_stream; const struct snd_soc_pcm_stream *cpu_stream;
/* /*
* Skip CPUs which don't support the current stream * Skip CPUs which don't support the current stream
...@@ -1750,7 +1750,7 @@ static void dpcm_runtime_setup_be_format(struct snd_pcm_substream *substream) ...@@ -1750,7 +1750,7 @@ static void dpcm_runtime_setup_be_format(struct snd_pcm_substream *substream)
for_each_dpcm_be(fe, stream, dpcm) { for_each_dpcm_be(fe, stream, dpcm) {
struct snd_soc_pcm_runtime *be = dpcm->be; struct snd_soc_pcm_runtime *be = dpcm->be;
struct snd_soc_pcm_stream *codec_stream; const struct snd_soc_pcm_stream *codec_stream;
int i; int i;
for_each_rtd_codec_dais(be, i, dai) { for_each_rtd_codec_dais(be, i, dai) {
...@@ -1787,7 +1787,7 @@ static void dpcm_runtime_setup_be_chan(struct snd_pcm_substream *substream) ...@@ -1787,7 +1787,7 @@ static void dpcm_runtime_setup_be_chan(struct snd_pcm_substream *substream)
for_each_dpcm_be(fe, stream, dpcm) { for_each_dpcm_be(fe, stream, dpcm) {
struct snd_soc_pcm_runtime *be = dpcm->be; struct snd_soc_pcm_runtime *be = dpcm->be;
struct snd_soc_pcm_stream *cpu_stream; const struct snd_soc_pcm_stream *cpu_stream;
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
int i; int i;
...@@ -1809,7 +1809,7 @@ static void dpcm_runtime_setup_be_chan(struct snd_pcm_substream *substream) ...@@ -1809,7 +1809,7 @@ static void dpcm_runtime_setup_be_chan(struct snd_pcm_substream *substream)
* DAIs connected to a single CPU DAI, use CPU DAI's directly * DAIs connected to a single CPU DAI, use CPU DAI's directly
*/ */
if (be->dai_link->num_codecs == 1) { if (be->dai_link->num_codecs == 1) {
struct snd_soc_pcm_stream *codec_stream = snd_soc_dai_get_pcm_stream( const struct snd_soc_pcm_stream *codec_stream = snd_soc_dai_get_pcm_stream(
snd_soc_rtd_to_codec(be, 0), stream); snd_soc_rtd_to_codec(be, 0), stream);
soc_pcm_hw_update_chan(hw, codec_stream); soc_pcm_hw_update_chan(hw, codec_stream);
...@@ -1835,7 +1835,7 @@ static void dpcm_runtime_setup_be_rate(struct snd_pcm_substream *substream) ...@@ -1835,7 +1835,7 @@ static void dpcm_runtime_setup_be_rate(struct snd_pcm_substream *substream)
for_each_dpcm_be(fe, stream, dpcm) { for_each_dpcm_be(fe, stream, dpcm) {
struct snd_soc_pcm_runtime *be = dpcm->be; struct snd_soc_pcm_runtime *be = dpcm->be;
struct snd_soc_pcm_stream *pcm; const struct snd_soc_pcm_stream *pcm;
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
int i; int i;
......
...@@ -21,7 +21,7 @@ int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots) ...@@ -21,7 +21,7 @@ int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots)
} }
EXPORT_SYMBOL_GPL(snd_soc_calc_frame_size); EXPORT_SYMBOL_GPL(snd_soc_calc_frame_size);
int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params) int snd_soc_params_to_frame_size(const struct snd_pcm_hw_params *params)
{ {
int sample_size; int sample_size;
...@@ -40,7 +40,7 @@ int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots) ...@@ -40,7 +40,7 @@ int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots)
} }
EXPORT_SYMBOL_GPL(snd_soc_calc_bclk); EXPORT_SYMBOL_GPL(snd_soc_calc_bclk);
int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params) int snd_soc_params_to_bclk(const struct snd_pcm_hw_params *params)
{ {
int ret; int ret;
...@@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk); ...@@ -79,7 +79,7 @@ EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk);
* Return: bclk frequency in Hz, else a negative error code if params format * Return: bclk frequency in Hz, else a negative error code if params format
* is invalid. * is invalid.
*/ */
int snd_soc_tdm_params_to_bclk(struct snd_pcm_hw_params *params, int snd_soc_tdm_params_to_bclk(const struct snd_pcm_hw_params *params,
int tdm_width, int tdm_slots, int slot_multiple) int tdm_width, int tdm_slots, int slot_multiple)
{ {
if (!tdm_slots) if (!tdm_slots)
...@@ -211,7 +211,7 @@ static struct snd_soc_dai_driver dummy_dai = { ...@@ -211,7 +211,7 @@ static struct snd_soc_dai_driver dummy_dai = {
.ops = &dummy_dai_ops, .ops = &dummy_dai_ops,
}; };
int snd_soc_dai_is_dummy(struct snd_soc_dai *dai) int snd_soc_dai_is_dummy(const struct snd_soc_dai *dai)
{ {
if (dai->driver == &dummy_dai) if (dai->driver == &dummy_dai)
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment