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

Unverified Commit df6a3e24 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/tfa9879', 'asoc/topic/ts3a277e',...

Merge remote-tracking branches 'asoc/topic/tfa9879', 'asoc/topic/ts3a277e', 'asoc/topic/wm8741', 'asoc/topic/wm97xx' and 'asoc/topic/zte' into asoc-next
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
NXP TFA9879 class-D audio amplifier

Required properties:

- compatible : "nxp,tfa9879"

- reg : the I2C address of the device

Example:

&i2c1 {
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c1>;
	status = "okay";

	codec: tfa9879@6c {
		#sound-dai-cells = <0>;
		compatible = "nxp,tfa9879";
		reg = <0x6c>;
        };
};
+6 −3
Original line number Diff line number Diff line
@@ -214,9 +214,9 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_WM8998 if MFD_WM8998
	select SND_SOC_WM9081 if I2C
	select SND_SOC_WM9090 if I2C
	select SND_SOC_WM9705 if SND_SOC_AC97_BUS
	select SND_SOC_WM9712 if SND_SOC_AC97_BUS
	select SND_SOC_WM9713 if SND_SOC_AC97_BUS
	select SND_SOC_WM9705 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW)
	select SND_SOC_WM9712 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW)
	select SND_SOC_WM9713 if (SND_SOC_AC97_BUS || SND_SOC_AC97_BUS_NEW)
        help
          Normally ASoC codec drivers are only built if a machine driver which
          uses them is also built since they are only usable with a machine
@@ -1132,14 +1132,17 @@ config SND_SOC_WM9090
config SND_SOC_WM9705
	tristate
	select REGMAP_AC97
	select AC97_BUS_COMPAT if AC97_BUS_NEW

config SND_SOC_WM9712
	tristate
	select REGMAP_AC97
	select AC97_BUS_COMPAT if AC97_BUS_NEW

config SND_SOC_WM9713
	tristate
	select REGMAP_AC97
	select AC97_BUS_COMPAT if AC97_BUS_NEW

config SND_SOC_ZX_AUD96P22
	tristate "ZTE ZX AUD96P22 CODEC"
+6 −0
Original line number Diff line number Diff line
@@ -312,9 +312,15 @@ static const struct i2c_device_id tfa9879_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, tfa9879_i2c_id);

static const struct of_device_id tfa9879_of_match[] = {
	{ .compatible = "nxp,tfa9879", },
	{ }
};

static struct i2c_driver tfa9879_i2c_driver = {
	.driver = {
		.name = "tfa9879",
		.of_match_table = tfa9879_of_match,
	},
	.probe = tfa9879_i2c_probe,
	.remove = tfa9879_i2c_remove,
+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/of_gpio.h>
#include <linux/regmap.h>
#include <linux/acpi.h>

#include <sound/core.h>
#include <sound/jack.h>
@@ -374,11 +375,20 @@ static const struct of_device_id ts3a227e_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ts3a227e_of_match);

#ifdef CONFIG_ACPI
static struct acpi_device_id ts3a227e_acpi_match[] = {
	{ "104C227E", 0 },
	{},
};
MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
#endif

static struct i2c_driver ts3a227e_driver = {
	.driver = {
		.name = "ts3a227e",
		.pm = &ts3a227e_pm,
		.of_match_table = of_match_ptr(ts3a227e_of_match),
		.acpi_match_table = ACPI_PTR(ts3a227e_acpi_match),
	},
	.probe = ts3a227e_i2c_probe,
	.id_table = ts3a227e_i2c_ids,
+23 −16
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
{
	struct snd_soc_codec *codec = dai->codec;
	struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
	u16 iface = snd_soc_read(codec, WM8741_FORMAT_CONTROL) & 0x1FC;
	unsigned int iface;
	int i;

	/* The set of sample rates that can be supported depends on the
@@ -223,15 +223,16 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
	/* bit size */
	switch (params_width(params)) {
	case 16:
		iface = 0x0;
		break;
	case 20:
		iface |= 0x0001;
		iface = 0x1;
		break;
	case 24:
		iface |= 0x0002;
		iface = 0x2;
		break;
	case 32:
		iface |= 0x0003;
		iface = 0x3;
		break;
	default:
		dev_dbg(codec->dev, "wm8741_hw_params:    Unsupported bit size param = %d",
@@ -242,7 +243,9 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
	dev_dbg(codec->dev, "wm8741_hw_params:    bit size param = %d, rate param = %d",
		params_width(params), params_rate(params));

	snd_soc_write(codec, WM8741_FORMAT_CONTROL, iface);
	snd_soc_update_bits(codec, WM8741_FORMAT_CONTROL, WM8741_IWL_MASK,
			    iface);

	return 0;
}

@@ -295,7 +298,7 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
		unsigned int fmt)
{
	struct snd_soc_codec *codec = codec_dai->codec;
	u16 iface = snd_soc_read(codec, WM8741_FORMAT_CONTROL) & 0x1C3;
	unsigned int iface;

	/* check master/slave audio interface */
	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -308,18 +311,19 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
	/* interface format */
	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
	case SND_SOC_DAIFMT_I2S:
		iface |= 0x0008;
		iface = 0x08;
		break;
	case SND_SOC_DAIFMT_RIGHT_J:
		iface = 0x00;
		break;
	case SND_SOC_DAIFMT_LEFT_J:
		iface |= 0x0004;
		iface = 0x04;
		break;
	case SND_SOC_DAIFMT_DSP_A:
		iface |= 0x000C;
		iface = 0x0C;
		break;
	case SND_SOC_DAIFMT_DSP_B:
		iface |= 0x001C;
		iface = 0x1C;
		break;
	default:
		return -EINVAL;
@@ -329,14 +333,14 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
	case SND_SOC_DAIFMT_NB_NF:
		break;
	case SND_SOC_DAIFMT_IB_IF:
		iface |= 0x0010;
	case SND_SOC_DAIFMT_NB_IF:
		iface |= 0x10;
		break;
	case SND_SOC_DAIFMT_IB_NF:
		iface |= 0x0020;
		iface |= 0x20;
		break;
	case SND_SOC_DAIFMT_NB_IF:
		iface |= 0x0030;
	case SND_SOC_DAIFMT_IB_IF:
		iface |= 0x30;
		break;
	default:
		return -EINVAL;
@@ -347,7 +351,10 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
				fmt & SND_SOC_DAIFMT_FORMAT_MASK,
				((fmt & SND_SOC_DAIFMT_INV_MASK)));

	snd_soc_write(codec, WM8741_FORMAT_CONTROL, iface);
	snd_soc_update_bits(codec, WM8741_FORMAT_CONTROL,
			    WM8741_BCP_MASK | WM8741_LRP_MASK | WM8741_FMT_MASK,
			    iface);

	return 0;
}

Loading