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

Commit 636f7858 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/asoc' into for-linus

parents 56487c27 a0c27ab2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -266,6 +266,12 @@
	.get = snd_soc_dapm_get_enum_virt, \
	.put = snd_soc_dapm_put_enum_virt, \
	.private_value = (unsigned long)&xenum }
#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
	.info = snd_soc_info_enum_double, \
	.get = xget, \
	.put = xput, \
	.private_value = (unsigned long)&xenum }
#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
	.info = snd_soc_info_enum_double, \
+32 −38
Original line number Diff line number Diff line
@@ -907,6 +907,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
				struct regulator_init_data *init_data,
				int voltage)
{
	dev_err(codec->dev, "this setup needs regulator support in the kernel\n");
	return -EINVAL;
}

@@ -1218,6 +1219,34 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
	return 0;
}

static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec)
{
	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
	int ret;

	/* set internal ldo to 1.2v */
	ret = ldo_regulator_register(codec, &ldo_init_data, LDO_VOLTAGE);
	if (ret) {
		dev_err(codec->dev,
			"Failed to register vddd internal supplies: %d\n", ret);
		return ret;
	}

	sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;

	ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
			sgtl5000->supplies);

	if (ret) {
		ldo_regulator_remove(codec);
		dev_err(codec->dev, "Failed to request supplies: %d\n", ret);
		return ret;
	}

	dev_info(codec->dev, "Using internal LDO instead of VDDD\n");
	return 0;
}

static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
{
	u16 reg;
@@ -1235,31 +1264,10 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
	if (!ret)
		external_vddd = 1;
	else {
		/* set internal ldo to 1.2v */
		int voltage = LDO_VOLTAGE;

		ret = ldo_regulator_register(codec, &ldo_init_data, voltage);
		if (ret) {
			dev_err(codec->dev,
			"Failed to register vddd internal supplies: %d\n",
				ret);
			return ret;
		}

		sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;

		ret = regulator_bulk_get(codec->dev,
				ARRAY_SIZE(sgtl5000->supplies),
				sgtl5000->supplies);

		if (ret) {
			ldo_regulator_remove(codec);
			dev_err(codec->dev,
				"Failed to request supplies: %d\n", ret);

		ret = sgtl5000_replace_vddd_with_ldo(codec);
		if (ret)
			return ret;
	}
	}

	ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
					sgtl5000->supplies);
@@ -1287,7 +1295,6 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
	 * roll back to use internal LDO
	 */
	if (external_vddd && rev >= 0x11) {
		int voltage = LDO_VOLTAGE;
		/* disable all regulator first */
		regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
					sgtl5000->supplies);
@@ -1295,23 +1302,10 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
		regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
					sgtl5000->supplies);

		ret = ldo_regulator_register(codec, &ldo_init_data, voltage);
		ret = sgtl5000_replace_vddd_with_ldo(codec);
		if (ret)
			return ret;

		sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;

		ret = regulator_bulk_get(codec->dev,
				ARRAY_SIZE(sgtl5000->supplies),
				sgtl5000->supplies);
		if (ret) {
			ldo_regulator_remove(codec);
			dev_err(codec->dev,
				"Failed to request supplies: %d\n", ret);

			return ret;
		}

		ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
						sgtl5000->supplies);
		if (ret)
+3 −3
Original line number Diff line number Diff line
@@ -3409,6 +3409,9 @@ static irqreturn_t wm8962_irq(int irq, void *data)
	active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2);
	active &= ~mask;

	/* Acknowledge the interrupts */
	snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);

	if (active & WM8962_FLL_LOCK_EINT) {
		dev_dbg(codec->dev, "FLL locked\n");
		complete(&wm8962->fll_lock);
@@ -3433,9 +3436,6 @@ static irqreturn_t wm8962_irq(int irq, void *data)
				      msecs_to_jiffies(250));
	}

	/* Acknowledge the interrupts */
	snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);

	return IRQ_HANDLED;
}

+5 −4
Original line number Diff line number Diff line
@@ -62,9 +62,9 @@ static void davinci_vcif_start(struct snd_pcm_substream *substream)
	w = readl(davinci_vc->base + DAVINCI_VC_CTRL);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
	else
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);

	writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
}
@@ -80,9 +80,9 @@ static void davinci_vcif_stop(struct snd_pcm_substream *substream)
	/* Reset transmitter/receiver and sample rate/frame sync generators */
	w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
	else
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
		MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);

	writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
}
@@ -159,6 +159,7 @@ static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
	case SNDRV_PCM_TRIGGER_RESUME:
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
		davinci_vcif_start(substream);
		break;
	case SNDRV_PCM_TRIGGER_STOP:
	case SNDRV_PCM_TRIGGER_SUSPEND:
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+7 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <plat/audio.h>

#include "dma.h"
#include "idma.h"
#include "i2s.h"
#include "i2s-regs.h"

@@ -60,6 +61,7 @@ struct i2s_dai {
	/* DMA parameters */
	struct s3c_dma_params dma_playback;
	struct s3c_dma_params dma_capture;
	struct s3c_dma_params idma_playback;
	u32	quirks;
	u32	suspend_i2smod;
	u32	suspend_i2scon;
@@ -877,6 +879,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
	if (i2s->quirks & QUIRK_NEED_RSTCLR)
		writel(CON_RSTCLR, i2s->addr + I2SCON);

	if (i2s->quirks & QUIRK_SEC_DAI)
		idma_reg_addr_init((void *)i2s->addr,
					i2s->sec_dai->idma_playback.dma_addr);

probe_exit:
	/* Reset any constraint on RFS and BFS */
	i2s->rfs = 0;
@@ -1077,6 +1083,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
		sec_dai->dma_playback.dma_size = 4;
		sec_dai->base = regs_base;
		sec_dai->quirks = quirks;
		sec_dai->idma_playback.dma_addr = i2s_cfg->idma_addr;
		sec_dai->pri_dai = pri_dai;
		pri_dai->sec_dai = sec_dai;
	}
Loading