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

Commit 644cbda5 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5720',...

Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5720', 'asoc/topic/tegra', 'asoc/topic/tlv320aic32x4' and 'asoc/topic/tlv320aic3x' into asoc-next
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@ Texas Instruments - tlv320aic32x4 Codec module
The tlv320aic32x4 serial control bus communicates through I2C protocols

Required properties:
 - compatible: Should be "ti,tlv320aic32x4"
 - compatible - "string" - One of:
	"ti,tlv320aic32x4" TLV320AIC3204
	"ti,tlv320aic32x6" TLV320AIC3206, TLV320AIC3256
 - reg: I2C slave address
 - supply-*: Required supply regulators are:
    "iov" - digital IO power supply
@@ -18,6 +20,8 @@ Optional properties:
 - reset-gpios: Reset-GPIO phandle with args as described in gpio/gpio.txt
 - clocks/clock-names: Clock named 'mclk' for the master clock of the codec.
   See clock/clock-bindings.txt for information about the detailed format.
 - aic32x4-gpio-func - <array of 5 int>
	- Types are defined in include/sound/tlv320aic32x4.h


Example:
@@ -27,4 +31,11 @@ codec: tlv320aic32x4@18 {
	reg = <0x18>;
	clocks = <&clks 201>;
	clock-names = "mclk";
	aic32x4-gpio-func= <
			0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
			0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
			0x04 /* MFP3 AIC32X4_MFP3_GPIO_ENABLED */
			0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
			0x08 /* MFP5 AIC32X4_MFP5_GPIO_INPUT */
		>;
};
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@ Optional properties:
	3 - MICBIAS output is connected to AVDD,
	If this node is not mentioned or if the value is incorrect, then MicBias
	is powered down.
- ai3x-ocmv - Output Common-Mode Voltage selection:
	0 - 1.35V,
	1 - 1.5V,
	2 - 1.65V,
	3 - 1.8V
- AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the
  device as covered in Documentation/devicetree/bindings/regulator/regulator.txt

+23 −0
Original line number Diff line number Diff line
@@ -22,7 +22,30 @@
#define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K	0x00000001
#define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K	0x00000002

/* GPIO API */
#define AIC32X4_MFPX_DEFAULT_VALUE	0xff

#define AIC32X4_MFP1_DIN_DISABLED	0
#define AIC32X4_MFP1_DIN_ENABLED	0x2
#define AIC32X4_MFP1_GPIO_IN		0x4

#define AIC32X4_MFP2_GPIO_OUT_LOW	0x0
#define AIC32X4_MFP2_GPIO_OUT_HIGH	0x1

#define AIC32X4_MFP_GPIO_ENABLED	0x4

#define AIC32X4_MFP5_GPIO_DISABLED	0x0
#define AIC32X4_MFP5_GPIO_INPUT		0x8
#define AIC32X4_MFP5_GPIO_OUTPUT	0xc
#define AIC32X4_MFP5_GPIO_OUT_LOW	0x0
#define AIC32X4_MFP5_GPIO_OUT_HIGH	0x1

struct aic32x4_setup_data {
	unsigned int gpio_func[5];
};

struct aic32x4_pdata {
	struct aic32x4_setup_data *setup;
	u32 power_cfg;
	u32 micpga_routing;
	bool swapdacs;
+7 −4
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static int tas2552_setup_pll(struct snd_soc_codec *codec,
		 * pll_clk = (.5 * pll_clkin * J.D) / 2^p
		 * Need to fill in J and D here based on incoming freq
		 */
		unsigned int d;
		unsigned int d, q, t;
		u8 j;
		u8 pll_sel = (tas2552->pll_clk_id << 3) & TAS2552_PLL_SRC_MASK;
		u8 p = snd_soc_read(codec, TAS2552_PLL_CTRL_1);
@@ -200,9 +200,12 @@ static int tas2552_setup_pll(struct snd_soc_codec *codec,
		p = (p >> 7);

recalc:
		j = (pll_clk * 2 * (1 << p)) / pll_clkin;
		d = (pll_clk * 2 * (1 << p)) % pll_clkin;
		d /= (pll_clkin / 10000);
		t = (pll_clk * 2) << p;
		j = t / pll_clkin;
		d = t % pll_clkin;
		t = pll_clkin / 10000;
		q = d / (t + 1);
		d = q + ((9999 - pll_clkin % 10000) * (d / t - q)) / 10000;

		if (d && (pll_clkin < 512000 || pll_clkin > 9200000)) {
			if (tas2552->pll_clk_id == TAS2552_PLL_CLKIN_BCLK) {
+2 −0
Original line number Diff line number Diff line
@@ -47,12 +47,14 @@ static int aic32x4_i2c_remove(struct i2c_client *i2c)

static const struct i2c_device_id aic32x4_i2c_id[] = {
	{ "tlv320aic32x4", 0 },
	{ "tlv320aic32x6", 1 },
	{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, aic32x4_i2c_id);

static const struct of_device_id aic32x4_of_id[] = {
	{ .compatible = "ti,tlv320aic32x4", },
	{ .compatible = "ti,tlv320aic32x6", },
	{ /* senitel */ }
};
MODULE_DEVICE_TABLE(of, aic32x4_of_id);
Loading