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

Commit d053c2b9 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/qcom', 'asoc/topic/rockchip' and...

Merge remote-tracking branches 'asoc/topic/qcom', 'asoc/topic/rockchip' and 'asoc/topic/rt5616' into asoc-next
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -16,6 +16,24 @@ Required properties:
				* "spkr-iomux"
- qcom,model		: Name of the sound card.

- qcom,audio-routing	: A list of the connections between audio components.
			  Each entry is a pair of strings, the first being the
			  connection's sink, the second being the connection's
			  source. Valid names could be power supplies, MicBias
			  of msm8x16_wcd codec and the jacks on the board:

			  Power supplies:
			  * MIC BIAS External1
			  * MIC BIAS External2
			  * MIC BIAS Internal1
			  * MIC BIAS Internal2

			  Board connectors:
			  * Headset Mic
			  * Secondary Mic",
			  * DMIC
			  * Ext Spk

Dai-link subnode properties and subnodes:

Required dai-link subnodes:
@@ -37,6 +55,18 @@ sound: sound {
	reg-names = "mic-iomux", "spkr-iomux";
	qcom,model = "DB410c";

	qcom,audio-routing =
		"MIC BIAS External1", "Handset Mic",
		"MIC BIAS Internal2", "Headset Mic",
		"MIC BIAS External1", "Secondary Mic",
		"AMIC1", "MIC BIAS External1",
		"AMIC2", "MIC BIAS Internal2",
		"AMIC3", "MIC BIAS External1",
		"DMIC1", "MIC BIAS Internal1",
		"MIC BIAS Internal1", "Digital Mic1",
		"DMIC2", "MIC BIAS Internal1",
		"MIC BIAS Internal1", "Digital Mic2";

	/* I2S - Internal codec */
	internal-dai-link@0 {
		cpu { /* PRIMARY */
+22 −0
Original line number Diff line number Diff line
ROCKCHIP with MAX98357A/RT5514/DA7219 codecs on GRU boards

Required properties:
- compatible: "rockchip,rk3399-gru-sound"
- rockchip,cpu: The phandle of the Rockchip I2S controller that's
  connected to the codecs
- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs

Optional properties:
- dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
  If this option is specified, which means it's required dmic need
  delay for DMIC to ready so that rt5514 can avoid recording before
  DMIC send valid data

Example:

sound {
	compatible = "rockchip,rk3399-gru-sound";
	rockchip,cpu = <&i2s0>;
	rockchip,codec = <&max98357a &rt5514 &da7219>;
	dmic-wakeup-delay-ms = <20>;
};
+4 −5
Original line number Diff line number Diff line
@@ -294,8 +294,7 @@ static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);

/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
static unsigned int bst_tlv[] = {
	TLV_DB_RANGE_HEAD(7),
static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(bst_tlv,
	0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
	1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
	2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
@@ -303,7 +302,7 @@ static unsigned int bst_tlv[] = {
	6, 6, TLV_DB_SCALE_ITEM(4400, 0, 0),
	7, 7, TLV_DB_SCALE_ITEM(5000, 0, 0),
	8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0),
};
);

static const struct snd_kcontrol_new rt5616_snd_controls[] = {
	/* Headphone Output Volume */
@@ -1267,14 +1266,14 @@ static int rt5616_resume(struct snd_soc_codec *codec)
#define RT5616_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
			SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)

struct snd_soc_dai_ops rt5616_aif_dai_ops = {
static struct snd_soc_dai_ops rt5616_aif_dai_ops = {
	.hw_params = rt5616_hw_params,
	.set_fmt = rt5616_set_dai_fmt,
	.set_sysclk = rt5616_set_dai_sysclk,
	.set_pll = rt5616_set_dai_pll,
};

struct snd_soc_dai_driver rt5616_dai[] = {
static struct snd_soc_dai_driver rt5616_dai[] = {
	{
		.name = "rt5616-aif1",
		.id = RT5616_AIF1,
+20 −0
Original line number Diff line number Diff line
@@ -85,6 +85,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
		return ERR_PTR(ret);
	}

	/* DAPM routes */
	if (of_property_read_bool(node, "qcom,audio-routing")) {
		ret = snd_soc_of_parse_audio_routing(card,
					"qcom,audio-routing");
		if (ret)
			return ERR_PTR(ret);
	}


	/* Populate links */
	num_links = of_get_child_count(node);

@@ -147,6 +156,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
	return data;
}

static const struct snd_soc_dapm_widget apq8016_sbc_dapm_widgets[] = {

	SND_SOC_DAPM_MIC("Handset Mic", NULL),
	SND_SOC_DAPM_MIC("Headset Mic", NULL),
	SND_SOC_DAPM_MIC("Secondary Mic", NULL),
	SND_SOC_DAPM_MIC("Digital Mic1", NULL),
	SND_SOC_DAPM_MIC("Digital Mic2", NULL),
};

static int apq8016_sbc_platform_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
@@ -159,6 +177,8 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev)
		return -ENOMEM;

	card->dev = dev;
	card->dapm_widgets = apq8016_sbc_dapm_widgets;
	card->num_dapm_widgets = ARRAY_SIZE(apq8016_sbc_dapm_widgets);
	data = apq8016_sbc_parse_of(card);
	if (IS_ERR(data)) {
		dev_err(&pdev->dev, "Error resolving dai links: %ld\n",
+12 −0
Original line number Diff line number Diff line
@@ -41,3 +41,15 @@ config SND_SOC_ROCKCHIP_RT5645
	help
	  Say Y or M here if you want to add support for SoC audio on Rockchip
	  boards using the RT5645/RT5650 codec, such as Veyron.

config SND_SOC_RK3399_GRU_SOUND
	tristate "ASoC support multiple codecs for Rockchip RK3399 GRU boards"
	depends on SND_SOC_ROCKCHIP && I2C && GPIOLIB && CLKDEV_LOOKUP && SPI
	select SND_SOC_ROCKCHIP_I2S
	select SND_SOC_MAX98357A
	select SND_SOC_RT5514
	select SND_SOC_DA7219
	select SND_SOC_RT5514_SPI
	help
	  Say Y or M here if you want to add support multiple codecs for SoC
	  audio on Rockchip RK3399 GRU boards.
Loading