ALSA: hda: Drop snd_hdac_calc_stream_format()
authorCezary Rojewski <cezary.rojewski@intel.com>
Fri, 17 Nov 2023 12:06:08 +0000 (13:06 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Nov 2023 16:28:47 +0000 (17:28 +0100)
There are no users of the function.

Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20231117120610.1755254-15-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hdaudio.h
sound/hda/hdac_device.c

index b00c631c4053976552af4c944157562f96c93598..62a3cd154ff2b4ed91abbac3658085726dbebf2b 100644 (file)
@@ -145,11 +145,6 @@ unsigned int snd_hdac_stream_format_bits(snd_pcm_format_t format, snd_pcm_subfor
 unsigned int snd_hdac_stream_format(unsigned int channels, unsigned int bits, unsigned int rate);
 unsigned int snd_hdac_spdif_stream_format(unsigned int channels, unsigned int bits,
                                          unsigned int rate, unsigned short spdif_ctls);
-unsigned int snd_hdac_calc_stream_format(unsigned int rate,
-                                        unsigned int channels,
-                                        snd_pcm_format_t format,
-                                        unsigned int maxbps,
-                                        unsigned short spdif_ctls);
 int snd_hdac_query_supported_pcm(struct hdac_device *codec, hda_nid_t nid,
                                 u32 *ratesp, u64 *formatsp, u32 *subformatsp,
                                 unsigned int *bpsp);
index 556bd24f40140c78ba84c5aa94387bf4892b75e3..7f7b67fe1b65f1b731a6e3bf602d3c0d1be2576c 100644 (file)
@@ -849,67 +849,6 @@ unsigned int snd_hdac_spdif_stream_format(unsigned int channels, unsigned int bi
 }
 EXPORT_SYMBOL_GPL(snd_hdac_spdif_stream_format);
 
-/**
- * snd_hdac_calc_stream_format - calculate the format bitset
- * @rate: the sample rate
- * @channels: the number of channels
- * @format: the PCM format (SNDRV_PCM_FORMAT_XXX)
- * @maxbps: the max. bps
- * @spdif_ctls: HD-audio SPDIF status bits (0 if irrelevant)
- *
- * Calculate the format bitset from the given rate, channels and th PCM format.
- *
- * Return zero if invalid.
- */
-unsigned int snd_hdac_calc_stream_format(unsigned int rate,
-                                        unsigned int channels,
-                                        snd_pcm_format_t format,
-                                        unsigned int maxbps,
-                                        unsigned short spdif_ctls)
-{
-       int i;
-       unsigned int val = 0;
-
-       for (i = 0; rate_bits[i].hz; i++)
-               if (rate_bits[i].hz == rate) {
-                       val = rate_bits[i].hda_fmt;
-                       break;
-               }
-       if (!rate_bits[i].hz)
-               return 0;
-
-       if (channels == 0 || channels > 8)
-               return 0;
-       val |= channels - 1;
-
-       switch (snd_pcm_format_width(format)) {
-       case 8:
-               val |= AC_FMT_BITS_8;
-               break;
-       case 16:
-               val |= AC_FMT_BITS_16;
-               break;
-       case 20:
-       case 24:
-       case 32:
-               if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE)
-                       val |= AC_FMT_BITS_32;
-               else if (maxbps >= 24)
-                       val |= AC_FMT_BITS_24;
-               else
-                       val |= AC_FMT_BITS_20;
-               break;
-       default:
-               return 0;
-       }
-
-       if (spdif_ctls & AC_DIG1_NONAUDIO)
-               val |= AC_FMT_TYPE_NON_PCM;
-
-       return val;
-}
-EXPORT_SYMBOL_GPL(snd_hdac_calc_stream_format);
-
 static unsigned int query_pcm_param(struct hdac_device *codec, hda_nid_t nid)
 {
        unsigned int val = 0;