Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db74feee authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes I537a0415,Ic9ea05a0,Ia253174f,I291a381d,I49d19860,I4e5c70a6,Iffeaf58b into msm-next

* changes:
  ALSA: core: Fix crash by avoiding appl_ptr crossing 32-bit boundary
  ASoC: core: Update ALSA core to issue restart in underrun.
  ASoC: core: Skip suspending widgets with ignore flag
  ASoC: Add a debug message to track widget power up/down
  ASoC: Add locking in DAPM widget power update
  ASoC: Update the Max value of integer controls.
  ASoC: core: Add support for getting TX and RX channels
parents 52f4f432 560a9699
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ struct snd_pcm_ops {
			     unsigned long offset);
	int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
	int (*ack)(struct snd_pcm_substream *substream);
	int (*restart)(struct snd_pcm_substream *substream);
};

/*
@@ -119,6 +120,12 @@ struct snd_pcm_ops {

#define SNDRV_PCM_POS_XRUN		((snd_pcm_uframes_t)-1)

#define SNDRV_DMA_MODE          (0)
#define SNDRV_NON_DMA_MODE      (1 << 0)
#define SNDRV_RENDER_STOPPED    (1 << 1)
#define SNDRV_RENDER_RUNNING    (1 << 2)


/* If you change this don't forget to change rates[] table in pcm_native.c */
#define SNDRV_PCM_RATE_5512		(1<<0)		/* 5512Hz */
#define SNDRV_PCM_RATE_8000		(1<<1)		/* 8000Hz */
@@ -373,6 +380,7 @@ struct snd_pcm_runtime {
	unsigned int rate_num;
	unsigned int rate_den;
	unsigned int no_period_wakeup: 1;
	unsigned int render_flag;

	/* -- SW params -- */
	int tstamp_mode;		/* mmap timestamp is updated */
+7 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
			     int direction);

int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
	unsigned int *tx_num, unsigned int *tx_slot,
	unsigned int *rx_num, unsigned int *rx_slot);

int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);

struct snd_soc_dai_ops {
@@ -167,6 +171,9 @@ struct snd_soc_dai_ops {
		unsigned int tx_num, unsigned int *tx_slot,
		unsigned int rx_num, unsigned int *rx_slot);
	int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
	int (*get_channel_map)(struct snd_soc_dai *dai,
		unsigned int *tx_num, unsigned int *tx_slot,
		unsigned int *rx_num, unsigned int *rx_slot);

	/*
	 * DAI digital mute - optional.
+1 −0
Original line number Diff line number Diff line
@@ -1149,6 +1149,7 @@ struct snd_soc_card {

	struct mutex mutex;
	struct mutex dapm_mutex;
	struct mutex dapm_power_mutex;

	bool instantiated;

+13 −1
Original line number Diff line number Diff line
@@ -716,7 +716,8 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
	runtime->silence_threshold = 0;
	runtime->silence_size = 0;
	runtime->boundary = runtime->buffer_size;
	while (runtime->boundary * 2 <= LONG_MAX - runtime->buffer_size)
	while (runtime->boundary * 2 * runtime->channels <=
					LONG_MAX - runtime->buffer_size)
		runtime->boundary *= 2;

	snd_pcm_timer_resolution_change(substream);
@@ -2712,6 +2713,7 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream,
	volatile struct snd_pcm_mmap_status *status;
	volatile struct snd_pcm_mmap_control *control;
	int err;
	snd_pcm_uframes_t hw_avail;

	memset(&sync_ptr, 0, sizeof(sync_ptr));
	if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags)))
@@ -2740,6 +2742,16 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream,
		control->avail_min = sync_ptr.c.control.avail_min;
	else
		sync_ptr.c.control.avail_min = control->avail_min;

	if (runtime->render_flag & SNDRV_NON_DMA_MODE) {
		hw_avail = snd_pcm_playback_hw_avail(runtime);
		if ((hw_avail >= runtime->start_threshold)
			&& (runtime->render_flag &
				SNDRV_RENDER_STOPPED)) {
			if (substream->ops->restart)
				substream->ops->restart(substream);
		}
	}
	sync_ptr.s.status.state = status->state;
	sync_ptr.s.status.hw_ptr = status->hw_ptr;
	sync_ptr.s.status.tstamp = status->tstamp;
+25 −0
Original line number Diff line number Diff line
@@ -2981,6 +2981,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
	card->instantiated = 0;
	mutex_init(&card->mutex);
	mutex_init(&card->dapm_mutex);
	mutex_init(&card->dapm_power_mutex);

	ret = snd_soc_instantiate_card(card);
	if (ret != 0)
@@ -4273,6 +4274,30 @@ int snd_soc_info_multi_ext(struct snd_kcontrol *kcontrol,
}
EXPORT_SYMBOL(snd_soc_info_multi_ext);

/**
 * snd_soc_dai_get_channel_map - configure DAI audio channel map
 * @dai: DAI
 * @tx_num: how many TX channels
 * @tx_slot: pointer to an array which imply the TX slot number channel
 *           0~num-1 uses
 * @rx_num: how many RX channels
 * @rx_slot: pointer to an array which imply the RX slot number channel
 *           0~num-1 uses
 *
 * configure the relationship between channel number and TDM slot number.
 */
int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
	unsigned int *tx_num, unsigned int *tx_slot,
	unsigned int *rx_num, unsigned int *rx_slot)
{
	if (dai->driver && dai->driver->ops->get_channel_map)
		return dai->driver->ops->get_channel_map(dai, tx_num, tx_slot,
			rx_num, rx_slot);
	else
		return -EINVAL;
}
EXPORT_SYMBOL(snd_soc_dai_get_channel_map);

int snd_soc_get_dai_name(struct of_phandle_args *args,
				const char **dai_name)
{
Loading