Revert "FROMLIST: ALSA: usb-audio: Export USB SND APIs for modules"

This reverts commit 0f3a199f3c.

Reason for revert: This is not built via GKI and therefore we do
not have a way to support or test/validate this patchset. Please
implement this functionality as a vendor module.

Change-Id: I644ba3e4c40a4492e4dcc3d23312860c31553d0b
Signed-off-by: Neill Kapron <nkapron@google.com>
This commit is contained in:
Neill Kapron
2025-03-13 19:15:27 +00:00
committed by Carlos Llamas
parent 1bbb6bf71e
commit 30b1b9a350
5 changed files with 21 additions and 71 deletions
-4
View File
@@ -1030,7 +1030,6 @@ int snd_usb_lock_shutdown(struct snd_usb_audio *chip)
wake_up(&chip->shutdown_wait);
return err;
}
EXPORT_SYMBOL_GPL(snd_usb_lock_shutdown);
/* autosuspend and unlock the shutdown */
void snd_usb_unlock_shutdown(struct snd_usb_audio *chip)
@@ -1039,7 +1038,6 @@ void snd_usb_unlock_shutdown(struct snd_usb_audio *chip)
if (atomic_dec_and_test(&chip->usage_count))
wake_up(&chip->shutdown_wait);
}
EXPORT_SYMBOL_GPL(snd_usb_unlock_shutdown);
int snd_usb_autoresume(struct snd_usb_audio *chip)
{
@@ -1062,7 +1060,6 @@ int snd_usb_autoresume(struct snd_usb_audio *chip)
}
return 0;
}
EXPORT_SYMBOL_GPL(snd_usb_autoresume);
void snd_usb_autosuspend(struct snd_usb_audio *chip)
{
@@ -1076,7 +1073,6 @@ void snd_usb_autosuspend(struct snd_usb_audio *chip)
for (i = 0; i < chip->num_interfaces; i++)
usb_autopm_put_interface(chip->intf[i]);
}
EXPORT_SYMBOL_GPL(snd_usb_autosuspend);
static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
{
-1
View File
@@ -1524,7 +1524,6 @@ unlock:
mutex_unlock(&chip->mutex);
return err;
}
EXPORT_SYMBOL_GPL(snd_usb_endpoint_prepare);
/* get the current rate set to the given clock by any endpoint */
int snd_usb_endpoint_get_clock_rate(struct snd_usb_audio *chip, int clock)
-1
View File
@@ -62,7 +62,6 @@ void *snd_usb_find_csint_desc(void *buffer, int buflen, void *after, u8 dsubtype
}
return NULL;
}
EXPORT_SYMBOL_GPL(snd_usb_find_csint_desc);
/*
* Wrapper for usb_control_msg().
+21 -54
View File
@@ -148,16 +148,6 @@ find_format(struct list_head *fmt_list_head, snd_pcm_format_t format,
return found;
}
const struct audioformat *
snd_usb_find_format(struct list_head *fmt_list_head, snd_pcm_format_t format,
unsigned int rate, unsigned int channels, bool strict_match,
struct snd_usb_substream *subs)
{
return find_format(fmt_list_head, format, rate, channels, strict_match,
subs);
}
EXPORT_SYMBOL_GPL(snd_usb_find_format);
static const struct audioformat *
find_substream_format(struct snd_usb_substream *subs,
const struct snd_pcm_hw_params *params)
@@ -167,14 +157,6 @@ find_substream_format(struct snd_usb_substream *subs,
true, subs);
}
const struct audioformat *
snd_usb_find_substream_format(struct snd_usb_substream *subs,
const struct snd_pcm_hw_params *params)
{
return find_substream_format(subs, params);
}
EXPORT_SYMBOL_GPL(snd_usb_find_substream_format);
bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs)
{
const struct audioformat *fp;
@@ -479,9 +461,20 @@ static void close_endpoints(struct snd_usb_audio *chip,
}
}
int snd_usb_hw_params(struct snd_usb_substream *subs,
struct snd_pcm_hw_params *hw_params)
/*
* hw_params callback
*
* allocate a buffer and set the given audio format.
*
* so far we use a physically linear buffer although packetize transfer
* doesn't need a continuous area.
* if sg buffer is supported on the later version of alsa, we'll follow
* that.
*/
static int snd_usb_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
struct snd_usb_substream *subs = substream->runtime->private_data;
struct snd_usb_audio *chip = subs->stream->chip;
const struct audioformat *fmt;
const struct audioformat *sync_fmt;
@@ -506,7 +499,7 @@ int snd_usb_hw_params(struct snd_usb_substream *subs,
if (fmt->implicit_fb) {
sync_fmt = snd_usb_find_implicit_fb_sync_format(chip, fmt,
hw_params,
!subs->direction,
!substream->stream,
&sync_fixed_rate);
if (!sync_fmt) {
usb_audio_dbg(chip,
@@ -586,28 +579,15 @@ int snd_usb_hw_params(struct snd_usb_substream *subs,
return ret;
}
EXPORT_SYMBOL_GPL(snd_usb_hw_params);
/*
* hw_params callback
* hw_free callback
*
* allocate a buffer and set the given audio format.
*
* so far we use a physically linear buffer although packetize transfer
* doesn't need a continuous area.
* if sg buffer is supported on the later version of alsa, we'll follow
* that.
* reset the audio format and release the buffer
*/
static int snd_usb_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
static int snd_usb_hw_free(struct snd_pcm_substream *substream)
{
struct snd_usb_substream *subs = substream->runtime->private_data;
return snd_usb_hw_params(subs, hw_params);
}
int snd_usb_hw_free(struct snd_usb_substream *subs)
{
struct snd_usb_audio *chip = subs->stream->chip;
snd_media_stop_pipeline(subs);
@@ -623,19 +603,6 @@ int snd_usb_hw_free(struct snd_usb_substream *subs)
return 0;
}
EXPORT_SYMBOL_GPL(snd_usb_hw_free);
/*
* hw_free callback
*
* reset the audio format and release the buffer
*/
static int snd_usb_pcm_hw_free(struct snd_pcm_substream *substream)
{
struct snd_usb_substream *subs = substream->runtime->private_data;
return snd_usb_hw_free(subs);
}
/* free-wheeling mode? (e.g. dmix) */
static int in_free_wheeling_mode(struct snd_pcm_runtime *runtime)
@@ -1779,8 +1746,8 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream
static const struct snd_pcm_ops snd_usb_playback_ops = {
.open = snd_usb_pcm_open,
.close = snd_usb_pcm_close,
.hw_params = snd_usb_pcm_hw_params,
.hw_free = snd_usb_pcm_hw_free,
.hw_params = snd_usb_hw_params,
.hw_free = snd_usb_hw_free,
.prepare = snd_usb_pcm_prepare,
.trigger = snd_usb_substream_playback_trigger,
.sync_stop = snd_usb_pcm_sync_stop,
@@ -1791,8 +1758,8 @@ static const struct snd_pcm_ops snd_usb_playback_ops = {
static const struct snd_pcm_ops snd_usb_capture_ops = {
.open = snd_usb_pcm_open,
.close = snd_usb_pcm_close,
.hw_params = snd_usb_pcm_hw_params,
.hw_free = snd_usb_pcm_hw_free,
.hw_params = snd_usb_hw_params,
.hw_free = snd_usb_hw_free,
.prepare = snd_usb_pcm_prepare,
.trigger = snd_usb_substream_capture_trigger,
.sync_stop = snd_usb_pcm_sync_stop,
-11
View File
@@ -15,15 +15,4 @@ void snd_usb_preallocate_buffer(struct snd_usb_substream *subs);
int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip,
struct audioformat *fmt);
const struct audioformat *
snd_usb_find_format(struct list_head *fmt_list_head, snd_pcm_format_t format,
unsigned int rate, unsigned int channels, bool strict_match,
struct snd_usb_substream *subs);
const struct audioformat *
snd_usb_find_substream_format(struct snd_usb_substream *subs,
const struct snd_pcm_hw_params *params);
int snd_usb_hw_params(struct snd_usb_substream *subs,
struct snd_pcm_hw_params *hw_params);
int snd_usb_hw_free(struct snd_usb_substream *subs);
#endif /* __USBAUDIO_PCM_H */