Commit d7502f7f authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/tlv320aic31xx',...

Merge remote-tracking branches 'asoc/topic/tlv320aic31xx', 'asoc/topic/tlv320aic32x4', 'asoc/topic/tlv320aic3x', 'asoc/topic/tlv320dac33' and 'asoc/topic/ts3a227e' into asoc-next
...@@ -22,7 +22,7 @@ Required properties: ...@@ -22,7 +22,7 @@ Required properties:
Optional properties: Optional properties:
- gpio-reset - gpio pin number used for codec reset - reset-gpios - GPIO specification for the active low RESET input.
- ai31xx-micbias-vg - MicBias Voltage setting - ai31xx-micbias-vg - MicBias Voltage setting
1 or MICBIAS_2_0V - MICBIAS output is powered to 2.0V 1 or MICBIAS_2_0V - MICBIAS output is powered to 2.0V
2 or MICBIAS_2_5V - MICBIAS output is powered to 2.5V 2 or MICBIAS_2_5V - MICBIAS output is powered to 2.5V
...@@ -30,6 +30,10 @@ Optional properties: ...@@ -30,6 +30,10 @@ Optional properties:
If this node is not mentioned or if the value is unknown, then If this node is not mentioned or if the value is unknown, then
micbias is set to 2.0V. micbias is set to 2.0V.
Deprecated properties:
- gpio-reset - gpio pin number used for codec reset
CODEC output pins: CODEC output pins:
* HPL * HPL
* HPR * HPR
...@@ -48,6 +52,7 @@ CODEC input pins: ...@@ -48,6 +52,7 @@ CODEC input pins:
The pins can be used in referring sound node's audio-routing property. The pins can be used in referring sound node's audio-routing property.
Example: Example:
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/sound/tlv320aic31xx-micbias.h> #include <dt-bindings/sound/tlv320aic31xx-micbias.h>
tlv320aic31xx: tlv320aic31xx@18 { tlv320aic31xx: tlv320aic31xx@18 {
...@@ -56,6 +61,8 @@ tlv320aic31xx: tlv320aic31xx@18 { ...@@ -56,6 +61,8 @@ tlv320aic31xx: tlv320aic31xx@18 {
ai31xx-micbias-vg = <MICBIAS_OFF>; ai31xx-micbias-vg = <MICBIAS_OFF>;
reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
HPVDD-supply = <&regulator>; HPVDD-supply = <&regulator>;
SPRVDD-supply = <&regulator>; SPRVDD-supply = <&regulator>;
SPLVDD-supply = <&regulator>; SPLVDD-supply = <&regulator>;
......
...@@ -17,7 +17,7 @@ Required properties: ...@@ -17,7 +17,7 @@ Required properties:
Optional properties: Optional properties:
- gpio-reset - gpio pin number used for codec reset - reset-gpios - GPIO specification for the active low RESET input.
- ai3x-gpio-func - <array of 2 int> - AIC3X_GPIO1 & AIC3X_GPIO2 Functionality - ai3x-gpio-func - <array of 2 int> - AIC3X_GPIO1 & AIC3X_GPIO2 Functionality
- Not supported on tlv320aic3104 - Not supported on tlv320aic3104
- ai3x-micbias-vg - MicBias Voltage required. - ai3x-micbias-vg - MicBias Voltage required.
...@@ -34,6 +34,10 @@ Optional properties: ...@@ -34,6 +34,10 @@ Optional properties:
- AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the - AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the
device as covered in Documentation/devicetree/bindings/regulator/regulator.txt device as covered in Documentation/devicetree/bindings/regulator/regulator.txt
Deprecated properties:
- gpio-reset - gpio pin number used for codec reset
CODEC output pins: CODEC output pins:
* LLOUT * LLOUT
* RLOUT * RLOUT
...@@ -61,10 +65,14 @@ The pins can be used in referring sound node's audio-routing property. ...@@ -61,10 +65,14 @@ The pins can be used in referring sound node's audio-routing property.
Example: Example:
#include <dt-bindings/gpio/gpio.h>
tlv320aic3x: tlv320aic3x@1b { tlv320aic3x: tlv320aic3x@1b {
compatible = "ti,tlv320aic3x"; compatible = "ti,tlv320aic3x";
reg = <0x1b>; reg = <0x1b>;
reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
AVDD-supply = <&regulator>; AVDD-supply = <&regulator>;
IOVDD-supply = <&regulator>; IOVDD-supply = <&regulator>;
DRVDD-supply = <&regulator>; DRVDD-supply = <&regulator>;
......
...@@ -939,12 +939,12 @@ config SND_SOC_TLV320AIC32X4 ...@@ -939,12 +939,12 @@ config SND_SOC_TLV320AIC32X4
tristate tristate
config SND_SOC_TLV320AIC32X4_I2C config SND_SOC_TLV320AIC32X4_I2C
tristate tristate "Texas Instruments TLV320AIC32x4 audio CODECs - I2C"
depends on I2C depends on I2C
select SND_SOC_TLV320AIC32X4 select SND_SOC_TLV320AIC32X4
config SND_SOC_TLV320AIC32X4_SPI config SND_SOC_TLV320AIC32X4_SPI
tristate tristate "Texas Instruments TLV320AIC32x4 audio CODECs - SPI"
depends on SPI_MASTER depends on SPI_MASTER
select SND_SOC_TLV320AIC32X4 select SND_SOC_TLV320AIC32X4
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1804,11 +1804,18 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ...@@ -1804,11 +1804,18 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
if (!ai3x_setup) if (!ai3x_setup)
return -ENOMEM; return -ENOMEM;
ret = of_get_named_gpio(np, "gpio-reset", 0); ret = of_get_named_gpio(np, "reset-gpios", 0);
if (ret >= 0) if (ret >= 0) {
aic3x->gpio_reset = ret; aic3x->gpio_reset = ret;
else } else {
aic3x->gpio_reset = -1; ret = of_get_named_gpio(np, "gpio-reset", 0);
if (ret > 0) {
dev_warn(&i2c->dev, "Using deprecated property \"gpio-reset\", please update your DT");
aic3x->gpio_reset = ret;
} else {
aic3x->gpio_reset = -1;
}
}
if (of_property_read_u32_array(np, "ai3x-gpio-func", if (of_property_read_u32_array(np, "ai3x-gpio-func",
ai3x_setup->gpio_func, 2) >= 0) { ai3x_setup->gpio_func, 2) >= 0) {
......
...@@ -106,6 +106,7 @@ struct tlv320dac33_priv { ...@@ -106,6 +106,7 @@ struct tlv320dac33_priv {
int mode1_latency; /* latency caused by the i2c writes in int mode1_latency; /* latency caused by the i2c writes in
* us */ * us */
u8 burst_bclkdiv; /* BCLK divider value in burst mode */ u8 burst_bclkdiv; /* BCLK divider value in burst mode */
u8 *reg_cache;
unsigned int burst_rate; /* Interface speed in Burst modes */ unsigned int burst_rate; /* Interface speed in Burst modes */
int keep_bclk; /* Keep the BCLK continuously running int keep_bclk; /* Keep the BCLK continuously running
...@@ -121,7 +122,7 @@ struct tlv320dac33_priv { ...@@ -121,7 +122,7 @@ struct tlv320dac33_priv {
unsigned int uthr; unsigned int uthr;
enum dac33_state state; enum dac33_state state;
void *control_data; struct i2c_client *i2c;
}; };
static const u8 dac33_reg[DAC33_CACHEREGNUM] = { static const u8 dac33_reg[DAC33_CACHEREGNUM] = {
...@@ -173,7 +174,8 @@ static const u8 dac33_reg[DAC33_CACHEREGNUM] = { ...@@ -173,7 +174,8 @@ static const u8 dac33_reg[DAC33_CACHEREGNUM] = {
static inline unsigned int dac33_read_reg_cache(struct snd_soc_codec *codec, static inline unsigned int dac33_read_reg_cache(struct snd_soc_codec *codec,
unsigned reg) unsigned reg)
{ {
u8 *cache = codec->reg_cache; struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
u8 *cache = dac33->reg_cache;
if (reg >= DAC33_CACHEREGNUM) if (reg >= DAC33_CACHEREGNUM)
return 0; return 0;
...@@ -183,7 +185,8 @@ static inline unsigned int dac33_read_reg_cache(struct snd_soc_codec *codec, ...@@ -183,7 +185,8 @@ static inline unsigned int dac33_read_reg_cache(struct snd_soc_codec *codec,
static inline void dac33_write_reg_cache(struct snd_soc_codec *codec, static inline void dac33_write_reg_cache(struct snd_soc_codec *codec,
u8 reg, u8 value) u8 reg, u8 value)
{ {
u8 *cache = codec->reg_cache; struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
u8 *cache = dac33->reg_cache;
if (reg >= DAC33_CACHEREGNUM) if (reg >= DAC33_CACHEREGNUM)
return; return;
...@@ -200,7 +203,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg, ...@@ -200,7 +203,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
/* If powered off, return the cached value */ /* If powered off, return the cached value */
if (dac33->chip_power) { if (dac33->chip_power) {
val = i2c_smbus_read_byte_data(codec->control_data, value[0]); val = i2c_smbus_read_byte_data(dac33->i2c, value[0]);
if (val < 0) { if (val < 0) {
dev_err(codec->dev, "Read failed (%d)\n", val); dev_err(codec->dev, "Read failed (%d)\n", val);
value[0] = dac33_read_reg_cache(codec, reg); value[0] = dac33_read_reg_cache(codec, reg);
...@@ -233,7 +236,7 @@ static int dac33_write(struct snd_soc_codec *codec, unsigned int reg, ...@@ -233,7 +236,7 @@ static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,
dac33_write_reg_cache(codec, data[0], data[1]); dac33_write_reg_cache(codec, data[0], data[1]);
if (dac33->chip_power) { if (dac33->chip_power) {
ret = codec->hw_write(codec->control_data, data, 2); ret = i2c_master_send(dac33->i2c, data, 2);
if (ret != 2) if (ret != 2)
dev_err(codec->dev, "Write failed (%d)\n", ret); dev_err(codec->dev, "Write failed (%d)\n", ret);
else else
...@@ -243,19 +246,6 @@ static int dac33_write(struct snd_soc_codec *codec, unsigned int reg, ...@@ -243,19 +246,6 @@ static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,
return ret; return ret;
} }
static int dac33_write_locked(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value)
{
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
int ret;
mutex_lock(&dac33->mutex);
ret = dac33_write(codec, reg, value);
mutex_unlock(&dac33->mutex);
return ret;
}
#define DAC33_I2C_ADDR_AUTOINC 0x80 #define DAC33_I2C_ADDR_AUTOINC 0x80
static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg, static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value) unsigned int value)
...@@ -280,7 +270,7 @@ static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg, ...@@ -280,7 +270,7 @@ static int dac33_write16(struct snd_soc_codec *codec, unsigned int reg,
if (dac33->chip_power) { if (dac33->chip_power) {
/* We need to set autoincrement mode for 16 bit writes */ /* We need to set autoincrement mode for 16 bit writes */
data[0] |= DAC33_I2C_ADDR_AUTOINC; data[0] |= DAC33_I2C_ADDR_AUTOINC;
ret = codec->hw_write(codec->control_data, data, 3); ret = i2c_master_send(dac33->i2c, data, 3);
if (ret != 3) if (ret != 3)
dev_err(codec->dev, "Write failed (%d)\n", ret); dev_err(codec->dev, "Write failed (%d)\n", ret);
else else
...@@ -1379,8 +1369,6 @@ static int dac33_soc_probe(struct snd_soc_codec *codec) ...@@ -1379,8 +1369,6 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
int ret = 0; int ret = 0;
codec->control_data = dac33->control_data;
codec->hw_write = (hw_write_t) i2c_master_send;
dac33->codec = codec; dac33->codec = codec;
/* Read the tlv320dac33 ID registers */ /* Read the tlv320dac33 ID registers */
...@@ -1434,13 +1422,9 @@ static int dac33_soc_remove(struct snd_soc_codec *codec) ...@@ -1434,13 +1422,9 @@ static int dac33_soc_remove(struct snd_soc_codec *codec)
} }
static const struct snd_soc_codec_driver soc_codec_dev_tlv320dac33 = { static const struct snd_soc_codec_driver soc_codec_dev_tlv320dac33 = {
.read = dac33_read_reg_cache,
.write = dac33_write_locked,
.set_bias_level = dac33_set_bias_level, .set_bias_level = dac33_set_bias_level,
.idle_bias_off = true, .idle_bias_off = true,
.reg_cache_size = ARRAY_SIZE(dac33_reg),
.reg_word_size = sizeof(u8),
.reg_cache_default = dac33_reg,
.probe = dac33_soc_probe, .probe = dac33_soc_probe,
.remove = dac33_soc_remove, .remove = dac33_soc_remove,
...@@ -1499,7 +1483,14 @@ static int dac33_i2c_probe(struct i2c_client *client, ...@@ -1499,7 +1483,14 @@ static int dac33_i2c_probe(struct i2c_client *client,
if (dac33 == NULL) if (dac33 == NULL)
return -ENOMEM; return -ENOMEM;
dac33->control_data = client; dac33->reg_cache = devm_kmemdup(&client->dev,
dac33_reg,
ARRAY_SIZE(dac33_reg) * sizeof(u8),
GFP_KERNEL);
if (!dac33->reg_cache)
return -ENOMEM;
dac33->i2c = client;
mutex_init(&dac33->mutex); mutex_init(&dac33->mutex);
spin_lock_init(&dac33->lock); spin_lock_init(&dac33->lock);
......
...@@ -241,7 +241,7 @@ int ts3a227e_enable_jack_detect(struct snd_soc_component *component, ...@@ -241,7 +241,7 @@ int ts3a227e_enable_jack_detect(struct snd_soc_component *component,
{ {
struct ts3a227e *ts3a227e = snd_soc_component_get_drvdata(component); struct ts3a227e *ts3a227e = snd_soc_component_get_drvdata(component);
snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_MEDIA); snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment