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

Commit 84f7f731 authored by Asish Bhattacharya's avatar Asish Bhattacharya Committed by Martin Fick
Browse files

audio-lnx: Add latest snapshot for audio drivers.



Propagate the changes based on latest snapshot
for audio kernel source tree.

Change-Id: I15cdbf2651ee8bf70a56b08013e1fbce16859d9b
Signed-off-by: default avatarAsish Bhattacharya <asishb@codeaurora.org>
parent 366f7504
Loading
Loading
Loading
Loading
+33 −16
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int wcd9xxx_slim_read_device(struct wcd9xxx *wcd9xxx, unsigned short reg,

	if (!wcd9xxx->dev_up) {
		dev_dbg_ratelimited(
			wcd9xxx->dev, "%s: No read allowed. dev_up = %d\n",
			wcd9xxx->dev, "%s: No read allowed. dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
		return 0;
	}
@@ -268,7 +268,7 @@ static int wcd9xxx_slim_write_device(struct wcd9xxx *wcd9xxx,

	if (!wcd9xxx->dev_up) {
		dev_dbg_ratelimited(
			wcd9xxx->dev, "%s: No write allowed. dev_up = %d\n",
			wcd9xxx->dev, "%s: No write allowed. dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
		return 0;
	}
@@ -345,7 +345,7 @@ int wcd9xxx_slim_write_repeat(struct wcd9xxx *wcd9xxx, unsigned short reg,

	if (!wcd9xxx->dev_up) {
		dev_dbg_ratelimited(
			wcd9xxx->dev, "%s: No write allowed. dev_up = %d\n",
			wcd9xxx->dev, "%s: No write allowed. dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
		ret = 0;
		goto done;
@@ -426,7 +426,7 @@ int wcd9xxx_slim_bulk_write(struct wcd9xxx *wcd9xxx,

	if (!wcd9xxx->dev_up) {
		dev_dbg_ratelimited(
			wcd9xxx->dev, "%s: No write allowed. dev_up = %d\n",
			wcd9xxx->dev, "%s: No write allowed. dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
		return 0;
	}
@@ -1479,12 +1479,27 @@ static int wcd9xxx_slim_device_reset(struct slim_device *sldev)
		return -EINVAL;
	}

	dev_info(wcd9xxx->dev, "%s: device reset, dev_up = %d\n",
	/*
	 * Wait for 500 ms for device down to complete. Observed delay
	 *  of ~200ms for device down to complete after being called,
	 * due to context switch issue.
	 */
	ret = wait_on_bit_timeout(&wcd9xxx->dev_up, 0,
				  TASK_INTERRUPTIBLE,
				  msecs_to_jiffies(500));
	if (ret)
		pr_err("%s: slim device down not complete in 500 msec\n",
				__func__);

	mutex_lock(&wcd9xxx->reset_lock);

	dev_info(wcd9xxx->dev, "%s: device reset, dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
	if (wcd9xxx->dev_up)
	if (wcd9xxx->dev_up) {
		mutex_unlock(&wcd9xxx->reset_lock);
		return 0;
	}

	mutex_lock(&wcd9xxx->reset_lock);
	ret = wcd9xxx_reset(wcd9xxx->dev);
	if (ret)
		dev_err(wcd9xxx->dev, "%s: Resetting Codec failed\n", __func__);
@@ -1502,7 +1517,7 @@ static int wcd9xxx_slim_device_up(struct slim_device *sldev)
		pr_err("%s: wcd9xxx is NULL\n", __func__);
		return -EINVAL;
	}
	dev_info(wcd9xxx->dev, "%s: slim device up, dev_up = %d\n",
	dev_info(wcd9xxx->dev, "%s: slim device up, dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
	if (wcd9xxx->dev_up)
		return 0;
@@ -1525,18 +1540,20 @@ static int wcd9xxx_slim_device_down(struct slim_device *sldev)
		return -EINVAL;
	}

	dev_info(wcd9xxx->dev, "%s: device down, dev_up = %d\n",
	mutex_lock(&wcd9xxx->reset_lock);

	dev_info(wcd9xxx->dev, "%s: device down, dev_up = %lu\n",
			__func__, wcd9xxx->dev_up);
	if (!wcd9xxx->dev_up)
	if (!wcd9xxx->dev_up) {
		mutex_unlock(&wcd9xxx->reset_lock);
		return 0;
	}

	wcd9xxx->dev_up = false;

	mutex_lock(&wcd9xxx->reset_lock);
	if (wcd9xxx->dev_down)
		wcd9xxx->dev_down(wcd9xxx);
	wcd9xxx_irq_exit(&wcd9xxx->core_res);
	wcd9xxx_reset_low(wcd9xxx->dev);
	wcd9xxx->dev_up = false;
	mutex_unlock(&wcd9xxx->reset_lock);

	return 0;
+2 −1
Original line number Diff line number Diff line
@@ -448,6 +448,7 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,
				  unsigned int offset,
				  unsigned int gpio)
{
	struct lpi_gpio_state *state = gpiochip_get_data(chip);
	struct pinctrl_pin_desc pindesc;
	struct lpi_gpio_pad *pad;
	unsigned int func;
@@ -463,7 +464,7 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,
		"pull up"
	};

	pctldev = pctldev ? : to_gpio_state(chip)->ctrl;
	pctldev = pctldev ? : state->ctrl;
	pindesc = pctldev->desc->pins[offset];
	pad = pctldev->desc->pins[offset].drv_data;
	ctl_reg = lpi_gpio_read(pad, LPI_GPIO_REG_DIR_CTL);
+1 −1
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ struct wcd9xxx {
	int (*post_reset)(struct wcd9xxx *wcd9xxx);

	void *ssr_priv;
	bool dev_up;
	unsigned long dev_up;

	u32 num_of_supplies;
	struct regulator_bulk_data *supplies;
+10 −0
Original line number Diff line number Diff line
@@ -53,4 +53,14 @@ struct dts_eagle_param_desc {
	uint32_t device;
} __packed;

#define HWDEP_FE_BASE                   3000 /*unique base for FE hw dep nodes*/
struct snd_pcm_mmap_fd {
	int32_t dir;
	int32_t fd;
	int32_t size;
	int32_t actual_size;
};

#define SNDRV_PCM_IOCTL_MMAP_DATA_FD    _IOWR('U', 0xd2, struct snd_pcm_mmap_fd)

#endif
+16 −8
Original line number Diff line number Diff line
@@ -2055,6 +2055,9 @@ static const char * const rdac2_mux_text[] = {
	"ZERO", "RX2", "RX1"
};

static const struct snd_kcontrol_new adc1_switch =
	SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0);

static const struct soc_enum rdac2_mux_enum =
	SOC_ENUM_SINGLE(MSM89XX_PMIC_DIGITAL_CDC_CONN_HPHR_DAC_CTL,
		0, 3, rdac2_mux_text);
@@ -3105,7 +3108,8 @@ static const struct snd_soc_dapm_route audio_map[] = {
	{"ADC2 MUX", "INP2", "ADC2_INP2"},
	{"ADC2 MUX", "INP3", "ADC2_INP3"},

	{"ADC1", NULL, "AMIC1"},
	{"ADC1", NULL, "ADC1_INP1"},
	{"ADC1_INP1", "Switch", "AMIC1"},
	{"ADC2_INP2", NULL, "AMIC2"},
	{"ADC2_INP3", NULL, "AMIC3"},

@@ -3446,6 +3450,8 @@ static const struct snd_soc_dapm_widget msm_anlg_cdc_dapm_widgets[] = {

	SND_SOC_DAPM_SPK("Ext Spk", msm_anlg_cdc_codec_enable_spk_ext_pa),

	SND_SOC_DAPM_SWITCH("ADC1_INP1", SND_SOC_NOPM, 0, 0,
			    &adc1_switch),
	SND_SOC_DAPM_SUPPLY("RX1 CLK", MSM89XX_PMIC_DIGITAL_CDC_DIG_CLK_CTL,
			    0, 0, NULL, 0),
	SND_SOC_DAPM_SUPPLY("RX2 CLK", MSM89XX_PMIC_DIGITAL_CDC_DIG_CLK_CTL,
@@ -4052,7 +4058,7 @@ int msm_anlg_codec_info_create_codec_entry(struct snd_info_entry *codec_root,

	sdm660_cdc_priv = snd_soc_codec_get_drvdata(codec);
	card = codec->component.card;
	sdm660_cdc_priv->entry = snd_register_module_info(codec_root->module,
	sdm660_cdc_priv->entry = snd_info_create_subdir(codec_root->module,
							     "spmi0-03",
							     codec_root);
	if (!sdm660_cdc_priv->entry) {
@@ -4320,13 +4326,15 @@ static struct snd_soc_codec_driver soc_codec_dev_sdm660_cdc = {
	.suspend = msm_anlg_cdc_suspend,
	.resume = msm_anlg_cdc_resume,
	.reg_word_size = 1,
	.get_regmap = msm_anlg_get_regmap,
	.component_driver = {
		.controls = msm_anlg_cdc_snd_controls,
		.num_controls = ARRAY_SIZE(msm_anlg_cdc_snd_controls),
		.dapm_widgets = msm_anlg_cdc_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(msm_anlg_cdc_dapm_widgets),
		.dapm_routes = audio_map,
		.num_dapm_routes = ARRAY_SIZE(audio_map),
	.get_regmap = msm_anlg_get_regmap,
	},
};

static int msm_anlg_cdc_init_supplies(struct sdm660_cdc_priv *sdm660_cdc,
Loading