Merge remote-tracking branches 'asoc/topic/ad1980', 'asoc/topic/adsp', 'asoc/topic/ak4104', 'asoc/topic/ak4642', 'asoc/topic/alc5623', 'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/cache' into asoc-next
This commit is contained in:
@@ -8,6 +8,8 @@ Required properties:
|
|||||||
|
|
||||||
- reg : The chip select number on the SPI bus
|
- reg : The chip select number on the SPI bus
|
||||||
|
|
||||||
|
- vdd-supply : A regulator node, providing 2.7V - 3.6V
|
||||||
|
|
||||||
Optional properties:
|
Optional properties:
|
||||||
|
|
||||||
- reset-gpio : a GPIO spec for the reset pin. If specified, it will be
|
- reset-gpio : a GPIO spec for the reset pin. If specified, it will be
|
||||||
@@ -19,4 +21,5 @@ spdif: ak4104@0 {
|
|||||||
compatible = "asahi-kasei,ak4104";
|
compatible = "asahi-kasei,ak4104";
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
spi-max-frequency = <5000000>;
|
spi-max-frequency = <5000000>;
|
||||||
|
vdd-supply = <&vdd_3v3_reg>;
|
||||||
};
|
};
|
||||||
|
25
Documentation/devicetree/bindings/sound/alc5623.txt
Normal file
25
Documentation/devicetree/bindings/sound/alc5623.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
ALC5621/ALC5622/ALC5623 audio Codec
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
|
||||||
|
- compatible: "realtek,alc5623"
|
||||||
|
- reg: the I2C address of the device.
|
||||||
|
|
||||||
|
Optional properties:
|
||||||
|
|
||||||
|
- add-ctrl: Default register value for Reg-40h, Additional Control
|
||||||
|
Register. If absent or has the value of 0, the
|
||||||
|
register is untouched.
|
||||||
|
|
||||||
|
- jack-det-ctrl: Default register value for Reg-5Ah, Jack Detect
|
||||||
|
Control Register. If absent or has value 0, the
|
||||||
|
register is untouched.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
alc5621: alc5621@1a {
|
||||||
|
compatible = "alc5621";
|
||||||
|
reg = <0x1a>;
|
||||||
|
add-ctrl = <0x3700>;
|
||||||
|
jack-det-ctrl = <0x4810>;
|
||||||
|
};
|
@@ -35,7 +35,7 @@ config SND_AT91_SOC_SAM9G20_WM8731
|
|||||||
|
|
||||||
config SND_ATMEL_SOC_WM8904
|
config SND_ATMEL_SOC_WM8904
|
||||||
tristate "Atmel ASoC driver for boards using WM8904 codec"
|
tristate "Atmel ASoC driver for boards using WM8904 codec"
|
||||||
depends on ARCH_AT91 && ATMEL_SSC && SND_ATMEL_SOC
|
depends on ARCH_AT91 && ATMEL_SSC && SND_ATMEL_SOC && I2C
|
||||||
select SND_ATMEL_SOC_SSC
|
select SND_ATMEL_SOC_SSC
|
||||||
select SND_ATMEL_SOC_DMA
|
select SND_ATMEL_SOC_DMA
|
||||||
select SND_SOC_WM8904
|
select SND_SOC_WM8904
|
||||||
|
@@ -270,7 +270,7 @@ config SND_SOC_AK5386
|
|||||||
tristate "AKM AK5638 CODEC"
|
tristate "AKM AK5638 CODEC"
|
||||||
|
|
||||||
config SND_SOC_ALC5623
|
config SND_SOC_ALC5623
|
||||||
tristate
|
tristate "Realtek ALC5623 CODEC"
|
||||||
|
|
||||||
config SND_SOC_ALC5632
|
config SND_SOC_ALC5632
|
||||||
tristate
|
tristate
|
||||||
|
@@ -189,28 +189,27 @@ static struct snd_soc_dai_driver ad1980_dai = {
|
|||||||
|
|
||||||
static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
|
static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
|
||||||
{
|
{
|
||||||
u16 retry_cnt = 0;
|
unsigned int retry_cnt = 0;
|
||||||
|
|
||||||
retry:
|
do {
|
||||||
if (try_warm && soc_ac97_ops->warm_reset) {
|
if (try_warm && soc_ac97_ops->warm_reset) {
|
||||||
soc_ac97_ops->warm_reset(codec->ac97);
|
soc_ac97_ops->warm_reset(codec->ac97);
|
||||||
if (ac97_read(codec, AC97_RESET) == 0x0090)
|
if (ac97_read(codec, AC97_RESET) == 0x0090)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
soc_ac97_ops->reset(codec->ac97);
|
soc_ac97_ops->reset(codec->ac97);
|
||||||
/* Set bit 16slot in register 74h, then every slot will has only 16
|
/*
|
||||||
* bits. This command is sent out in 20bit mode, in which case the
|
* Set bit 16slot in register 74h, then every slot will has only
|
||||||
* first nibble of data is eaten by the addr. (Tag is always 16 bit)*/
|
* 16 bits. This command is sent out in 20bit mode, in which
|
||||||
ac97_write(codec, AC97_AD_SERIAL_CFG, 0x9900);
|
* case the first nibble of data is eaten by the addr. (Tag is
|
||||||
|
* always 16 bit)
|
||||||
|
*/
|
||||||
|
ac97_write(codec, AC97_AD_SERIAL_CFG, 0x9900);
|
||||||
|
|
||||||
if (ac97_read(codec, AC97_RESET) != 0x0090)
|
if (ac97_read(codec, AC97_RESET) == 0x0090)
|
||||||
goto err;
|
return 0;
|
||||||
return 0;
|
} while (retry_cnt++ < 10);
|
||||||
|
|
||||||
err:
|
|
||||||
while (retry_cnt++ < 10)
|
|
||||||
goto retry;
|
|
||||||
|
|
||||||
printk(KERN_ERR "AD1980 AC97 reset failed\n");
|
printk(KERN_ERR "AD1980 AC97 reset failed\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
@@ -11,13 +11,14 @@
|
|||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <sound/core.h>
|
|
||||||
#include <sound/soc.h>
|
|
||||||
#include <sound/initval.h>
|
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/of_gpio.h>
|
#include <linux/of_gpio.h>
|
||||||
|
#include <linux/regulator/consumer.h>
|
||||||
#include <sound/asoundef.h>
|
#include <sound/asoundef.h>
|
||||||
|
#include <sound/core.h>
|
||||||
|
#include <sound/soc.h>
|
||||||
|
#include <sound/initval.h>
|
||||||
|
|
||||||
/* AK4104 registers addresses */
|
/* AK4104 registers addresses */
|
||||||
#define AK4104_REG_CONTROL1 0x00
|
#define AK4104_REG_CONTROL1 0x00
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
|
|
||||||
struct ak4104_private {
|
struct ak4104_private {
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
|
struct regulator *regulator;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_dapm_widget ak4104_dapm_widgets[] = {
|
static const struct snd_soc_dapm_widget ak4104_dapm_widgets[] = {
|
||||||
@@ -174,20 +176,30 @@ static int ak4104_probe(struct snd_soc_codec *codec)
|
|||||||
struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
|
struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
ret = regulator_enable(ak4104->regulator);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(codec->dev, "Unable to enable regulator: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* set power-up and non-reset bits */
|
/* set power-up and non-reset bits */
|
||||||
ret = regmap_update_bits(ak4104->regmap, AK4104_REG_CONTROL1,
|
ret = regmap_update_bits(ak4104->regmap, AK4104_REG_CONTROL1,
|
||||||
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN,
|
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN,
|
||||||
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN);
|
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto exit_disable_regulator;
|
||||||
|
|
||||||
/* enable transmitter */
|
/* enable transmitter */
|
||||||
ret = regmap_update_bits(ak4104->regmap, AK4104_REG_TX,
|
ret = regmap_update_bits(ak4104->regmap, AK4104_REG_TX,
|
||||||
AK4104_TX_TXE, AK4104_TX_TXE);
|
AK4104_TX_TXE, AK4104_TX_TXE);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto exit_disable_regulator;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
exit_disable_regulator:
|
||||||
|
regulator_disable(ak4104->regulator);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ak4104_remove(struct snd_soc_codec *codec)
|
static int ak4104_remove(struct snd_soc_codec *codec)
|
||||||
@@ -196,13 +208,42 @@ static int ak4104_remove(struct snd_soc_codec *codec)
|
|||||||
|
|
||||||
regmap_update_bits(ak4104->regmap, AK4104_REG_CONTROL1,
|
regmap_update_bits(ak4104->regmap, AK4104_REG_CONTROL1,
|
||||||
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN, 0);
|
AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN, 0);
|
||||||
|
regulator_disable(ak4104->regulator);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static int ak4104_soc_suspend(struct snd_soc_codec *codec)
|
||||||
|
{
|
||||||
|
struct ak4104_private *priv = snd_soc_codec_get_drvdata(codec);
|
||||||
|
|
||||||
|
regulator_disable(priv->regulator);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ak4104_soc_resume(struct snd_soc_codec *codec)
|
||||||
|
{
|
||||||
|
struct ak4104_private *priv = snd_soc_codec_get_drvdata(codec);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = regulator_enable(priv->regulator);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define ak4104_soc_suspend NULL
|
||||||
|
#define ak4104_soc_resume NULL
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static struct snd_soc_codec_driver soc_codec_device_ak4104 = {
|
static struct snd_soc_codec_driver soc_codec_device_ak4104 = {
|
||||||
.probe = ak4104_probe,
|
.probe = ak4104_probe,
|
||||||
.remove = ak4104_remove,
|
.remove = ak4104_remove,
|
||||||
|
.suspend = ak4104_soc_suspend,
|
||||||
|
.resume = ak4104_soc_resume,
|
||||||
|
|
||||||
.dapm_widgets = ak4104_dapm_widgets,
|
.dapm_widgets = ak4104_dapm_widgets,
|
||||||
.num_dapm_widgets = ARRAY_SIZE(ak4104_dapm_widgets),
|
.num_dapm_widgets = ARRAY_SIZE(ak4104_dapm_widgets),
|
||||||
@@ -239,6 +280,13 @@ static int ak4104_spi_probe(struct spi_device *spi)
|
|||||||
if (ak4104 == NULL)
|
if (ak4104 == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ak4104->regulator = devm_regulator_get(&spi->dev, "vdd");
|
||||||
|
if (IS_ERR(ak4104->regulator)) {
|
||||||
|
ret = PTR_ERR(ak4104->regulator);
|
||||||
|
dev_err(&spi->dev, "Unable to get Vdd regulator: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap);
|
ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap);
|
||||||
if (IS_ERR(ak4104->regmap)) {
|
if (IS_ERR(ak4104->regmap)) {
|
||||||
ret = PTR_ERR(ak4104->regmap);
|
ret = PTR_ERR(ak4104->regmap);
|
||||||
|
@@ -98,7 +98,7 @@
|
|||||||
#define MGAIN0 (1 << 0) /* MIC amp gain*/
|
#define MGAIN0 (1 << 0) /* MIC amp gain*/
|
||||||
|
|
||||||
/* TIMER */
|
/* TIMER */
|
||||||
#define ZTM(param) ((param & 0x3) << 4) /* ALC Zoro Crossing TimeOut */
|
#define ZTM(param) ((param & 0x3) << 4) /* ALC Zero Crossing TimeOut */
|
||||||
#define WTM(param) (((param & 0x4) << 4) | ((param & 0x3) << 2))
|
#define WTM(param) (((param & 0x4) << 4) | ((param & 0x3) << 2))
|
||||||
|
|
||||||
/* ALC_CTL1 */
|
/* ALC_CTL1 */
|
||||||
@@ -134,6 +134,15 @@
|
|||||||
/* MD_CTL4 */
|
/* MD_CTL4 */
|
||||||
#define DACH (1 << 0)
|
#define DACH (1 << 0)
|
||||||
|
|
||||||
|
struct ak4642_drvdata {
|
||||||
|
const struct regmap_config *regmap_config;
|
||||||
|
int extended_frequencies;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ak4642_priv {
|
||||||
|
const struct ak4642_drvdata *drvdata;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Playback Volume (table 39)
|
* Playback Volume (table 39)
|
||||||
*
|
*
|
||||||
@@ -148,6 +157,8 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
|
|||||||
|
|
||||||
SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
|
SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
|
||||||
0, 0xFF, 1, out_tlv),
|
0, 0xFF, 1, out_tlv),
|
||||||
|
SOC_SINGLE("ALC Capture Switch", ALC_CTL1, 5, 1, 0),
|
||||||
|
SOC_SINGLE("ALC Capture ZC Switch", ALC_CTL1, 4, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new ak4642_headphone_control =
|
static const struct snd_kcontrol_new ak4642_headphone_control =
|
||||||
@@ -287,7 +298,9 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai,
|
|||||||
int clk_id, unsigned int freq, int dir)
|
int clk_id, unsigned int freq, int dir)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = codec_dai->codec;
|
struct snd_soc_codec *codec = codec_dai->codec;
|
||||||
|
struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
|
||||||
u8 pll;
|
u8 pll;
|
||||||
|
int extended_freq = 0;
|
||||||
|
|
||||||
switch (freq) {
|
switch (freq) {
|
||||||
case 11289600:
|
case 11289600:
|
||||||
@@ -308,9 +321,25 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai,
|
|||||||
case 27000000:
|
case 27000000:
|
||||||
pll = PLL3 | PLL2 | PLL0;
|
pll = PLL3 | PLL2 | PLL0;
|
||||||
break;
|
break;
|
||||||
|
case 19200000:
|
||||||
|
pll = PLL3;
|
||||||
|
extended_freq = 1;
|
||||||
|
break;
|
||||||
|
case 13000000:
|
||||||
|
pll = PLL3 | PLL2 | PLL1;
|
||||||
|
extended_freq = 1;
|
||||||
|
break;
|
||||||
|
case 26000000:
|
||||||
|
pll = PLL3 | PLL2 | PLL1 | PLL0;
|
||||||
|
extended_freq = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (extended_freq && !priv->drvdata->extended_frequencies)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
snd_soc_update_bits(codec, MD_CTL1, PLL_MASK, pll);
|
snd_soc_update_bits(codec, MD_CTL1, PLL_MASK, pll);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -505,30 +534,52 @@ static const struct regmap_config ak4648_regmap = {
|
|||||||
.num_reg_defaults = ARRAY_SIZE(ak4648_reg),
|
.num_reg_defaults = ARRAY_SIZE(ak4648_reg),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct ak4642_drvdata ak4642_drvdata = {
|
||||||
|
.regmap_config = &ak4642_regmap,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct ak4642_drvdata ak4643_drvdata = {
|
||||||
|
.regmap_config = &ak4642_regmap,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct ak4642_drvdata ak4648_drvdata = {
|
||||||
|
.regmap_config = &ak4648_regmap,
|
||||||
|
.extended_frequencies = 1,
|
||||||
|
};
|
||||||
|
|
||||||
static struct of_device_id ak4642_of_match[];
|
static struct of_device_id ak4642_of_match[];
|
||||||
static int ak4642_i2c_probe(struct i2c_client *i2c,
|
static int ak4642_i2c_probe(struct i2c_client *i2c,
|
||||||
const struct i2c_device_id *id)
|
const struct i2c_device_id *id)
|
||||||
{
|
{
|
||||||
struct device_node *np = i2c->dev.of_node;
|
struct device_node *np = i2c->dev.of_node;
|
||||||
const struct regmap_config *regmap_config = NULL;
|
const struct ak4642_drvdata *drvdata = NULL;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
|
struct ak4642_priv *priv;
|
||||||
|
|
||||||
if (np) {
|
if (np) {
|
||||||
const struct of_device_id *of_id;
|
const struct of_device_id *of_id;
|
||||||
|
|
||||||
of_id = of_match_device(ak4642_of_match, &i2c->dev);
|
of_id = of_match_device(ak4642_of_match, &i2c->dev);
|
||||||
if (of_id)
|
if (of_id)
|
||||||
regmap_config = of_id->data;
|
drvdata = of_id->data;
|
||||||
} else {
|
} else {
|
||||||
regmap_config = (const struct regmap_config *)id->driver_data;
|
drvdata = (const struct ak4642_drvdata *)id->driver_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!regmap_config) {
|
if (!drvdata) {
|
||||||
dev_err(&i2c->dev, "Unknown device type\n");
|
dev_err(&i2c->dev, "Unknown device type\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
regmap = devm_regmap_init_i2c(i2c, regmap_config);
|
priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL);
|
||||||
|
if (!priv)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
priv->drvdata = drvdata;
|
||||||
|
|
||||||
|
i2c_set_clientdata(i2c, priv);
|
||||||
|
|
||||||
|
regmap = devm_regmap_init_i2c(i2c, drvdata->regmap_config);
|
||||||
if (IS_ERR(regmap))
|
if (IS_ERR(regmap))
|
||||||
return PTR_ERR(regmap);
|
return PTR_ERR(regmap);
|
||||||
|
|
||||||
@@ -543,17 +594,17 @@ static int ak4642_i2c_remove(struct i2c_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct of_device_id ak4642_of_match[] = {
|
static struct of_device_id ak4642_of_match[] = {
|
||||||
{ .compatible = "asahi-kasei,ak4642", .data = &ak4642_regmap},
|
{ .compatible = "asahi-kasei,ak4642", .data = &ak4642_drvdata},
|
||||||
{ .compatible = "asahi-kasei,ak4643", .data = &ak4642_regmap},
|
{ .compatible = "asahi-kasei,ak4643", .data = &ak4643_drvdata},
|
||||||
{ .compatible = "asahi-kasei,ak4648", .data = &ak4648_regmap},
|
{ .compatible = "asahi-kasei,ak4648", .data = &ak4648_drvdata},
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, ak4642_of_match);
|
MODULE_DEVICE_TABLE(of, ak4642_of_match);
|
||||||
|
|
||||||
static const struct i2c_device_id ak4642_i2c_id[] = {
|
static const struct i2c_device_id ak4642_i2c_id[] = {
|
||||||
{ "ak4642", (kernel_ulong_t)&ak4642_regmap },
|
{ "ak4642", (kernel_ulong_t)&ak4642_drvdata },
|
||||||
{ "ak4643", (kernel_ulong_t)&ak4642_regmap },
|
{ "ak4643", (kernel_ulong_t)&ak4643_drvdata },
|
||||||
{ "ak4648", (kernel_ulong_t)&ak4648_regmap },
|
{ "ak4648", (kernel_ulong_t)&ak4648_drvdata },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id);
|
MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/of.h>
|
||||||
#include <sound/core.h>
|
#include <sound/core.h>
|
||||||
#include <sound/pcm.h>
|
#include <sound/pcm.h>
|
||||||
#include <sound/pcm_params.h>
|
#include <sound/pcm_params.h>
|
||||||
@@ -998,8 +999,10 @@ static int alc5623_i2c_probe(struct i2c_client *client,
|
|||||||
{
|
{
|
||||||
struct alc5623_platform_data *pdata;
|
struct alc5623_platform_data *pdata;
|
||||||
struct alc5623_priv *alc5623;
|
struct alc5623_priv *alc5623;
|
||||||
|
struct device_node *np;
|
||||||
unsigned int vid1, vid2;
|
unsigned int vid1, vid2;
|
||||||
int ret;
|
int ret;
|
||||||
|
u32 val32;
|
||||||
|
|
||||||
alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv),
|
alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -1040,6 +1043,16 @@ static int alc5623_i2c_probe(struct i2c_client *client,
|
|||||||
if (pdata) {
|
if (pdata) {
|
||||||
alc5623->add_ctrl = pdata->add_ctrl;
|
alc5623->add_ctrl = pdata->add_ctrl;
|
||||||
alc5623->jack_det_ctrl = pdata->jack_det_ctrl;
|
alc5623->jack_det_ctrl = pdata->jack_det_ctrl;
|
||||||
|
} else {
|
||||||
|
if (client->dev.of_node) {
|
||||||
|
np = client->dev.of_node;
|
||||||
|
ret = of_property_read_u32(np, "add-ctrl", &val32);
|
||||||
|
if (!ret)
|
||||||
|
alc5623->add_ctrl = val32;
|
||||||
|
ret = of_property_read_u32(np, "jack-det-ctrl", &val32);
|
||||||
|
if (!ret)
|
||||||
|
alc5623->jack_det_ctrl = val32;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alc5623->id = vid2;
|
alc5623->id = vid2;
|
||||||
@@ -1081,11 +1094,18 @@ static const struct i2c_device_id alc5623_i2c_table[] = {
|
|||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
|
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
|
||||||
|
|
||||||
|
static const struct of_device_id alc5623_of_match[] = {
|
||||||
|
{ .compatible = "realtek,alc5623", },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, alc5623_of_match);
|
||||||
|
|
||||||
/* i2c codec control layer */
|
/* i2c codec control layer */
|
||||||
static struct i2c_driver alc5623_i2c_driver = {
|
static struct i2c_driver alc5623_i2c_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "alc562x-codec",
|
.name = "alc562x-codec",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.of_match_table = of_match_ptr(alc5623_of_match),
|
||||||
},
|
},
|
||||||
.probe = alc5623_i2c_probe,
|
.probe = alc5623_i2c_probe,
|
||||||
.remove = alc5623_i2c_remove,
|
.remove = alc5623_i2c_remove,
|
||||||
|
@@ -154,7 +154,7 @@ static int cq93vc_remove(struct snd_soc_codec *codec)
|
|||||||
|
|
||||||
static struct regmap *cq93vc_get_regmap(struct device *dev)
|
static struct regmap *cq93vc_get_regmap(struct device *dev)
|
||||||
{
|
{
|
||||||
struct davinci_vc *davinci_vc = codec->dev->platform_data;
|
struct davinci_vc *davinci_vc = dev->platform_data;
|
||||||
|
|
||||||
return davinci_vc->regmap;
|
return davinci_vc->regmap;
|
||||||
}
|
}
|
||||||
|
@@ -367,6 +367,11 @@ SOC_SINGLE("HPOUT2 SC Protect Switch", ARIZONA_HP2_SHORT_CIRCUIT_CTRL,
|
|||||||
SOC_SINGLE("HPOUT3 SC Protect Switch", ARIZONA_HP3_SHORT_CIRCUIT_CTRL,
|
SOC_SINGLE("HPOUT3 SC Protect Switch", ARIZONA_HP3_SHORT_CIRCUIT_CTRL,
|
||||||
ARIZONA_HP3_SC_ENA_SHIFT, 1, 0),
|
ARIZONA_HP3_SC_ENA_SHIFT, 1, 0),
|
||||||
|
|
||||||
|
SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L,
|
||||||
|
ARIZONA_OUT5_OSR_SHIFT, 1, 0),
|
||||||
|
SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L,
|
||||||
|
ARIZONA_OUT6_OSR_SHIFT, 1, 0),
|
||||||
|
|
||||||
SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
|
SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
|
||||||
ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
|
ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
|
||||||
SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L,
|
SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L,
|
||||||
|
@@ -1625,7 +1625,7 @@ int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user