Skip to content

Commit a57d5cc

Browse files
committed
ASoC: tlv320adcx140: Merge fixes from Pengutronix
Merge patches that Pengutronix have been carrying in their tree for a while and were upstreamed by Sascha Hauer together with some new features that are going into the next release.
2 parents 1a75f24 + 46378ab commit a57d5cc

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

sound/soc/codecs/tlv320adcx140.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "tlv320adcx140.h"
2424

2525
struct adcx140_priv {
26-
struct snd_soc_component *component;
2726
struct regulator *supply_areg;
2827
struct gpio_desc *gpio_reset;
2928
struct regmap *regmap;
@@ -338,7 +337,7 @@ static const struct snd_kcontrol_new adcx140_dapm_ch4_dre_en_switch =
338337
SOC_DAPM_SINGLE("Switch", ADCX140_CH4_CFG0, 0, 1, 0);
339338

340339
static const struct snd_kcontrol_new adcx140_dapm_dre_en_switch =
341-
SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 0);
340+
SOC_DAPM_SINGLE("Switch", ADCX140_DSP_CFG1, 3, 1, 1);
342341

343342
/* Output Mixer */
344343
static const struct snd_kcontrol_new adcx140_output_mixer_controls[] = {
@@ -699,7 +698,6 @@ static void adcx140_pwr_ctrl(struct adcx140_priv *adcx140, bool power_state)
699698
{
700699
int pwr_ctrl = 0;
701700
int ret = 0;
702-
struct snd_soc_component *component = adcx140->component;
703701

704702
if (power_state)
705703
pwr_ctrl = ADCX140_PWR_CFG_ADC_PDZ | ADCX140_PWR_CFG_PLL_PDZ;
@@ -711,7 +709,7 @@ static void adcx140_pwr_ctrl(struct adcx140_priv *adcx140, bool power_state)
711709
ret = regmap_write(adcx140->regmap, ADCX140_PHASE_CALIB,
712710
adcx140->phase_calib_on ? 0x00 : 0x40);
713711
if (ret)
714-
dev_err(component->dev, "%s: register write error %d\n",
712+
dev_err(adcx140->dev, "%s: register write error %d\n",
715713
__func__, ret);
716714
}
717715

@@ -727,7 +725,7 @@ static int adcx140_hw_params(struct snd_pcm_substream *substream,
727725
struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component);
728726
u8 data = 0;
729727

730-
switch (params_width(params)) {
728+
switch (params_physical_width(params)) {
731729
case 16:
732730
data = ADCX140_16_BIT_WORD;
733731
break;
@@ -742,7 +740,7 @@ static int adcx140_hw_params(struct snd_pcm_substream *substream,
742740
break;
743741
default:
744742
dev_err(component->dev, "%s: Unsupported width %d\n",
745-
__func__, params_width(params));
743+
__func__, params_physical_width(params));
746744
return -EINVAL;
747745
}
748746

@@ -1156,6 +1154,9 @@ static int adcx140_i2c_probe(struct i2c_client *i2c)
11561154
adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev,
11571155
"reset", GPIOD_OUT_LOW);
11581156
if (IS_ERR(adcx140->gpio_reset))
1157+
return dev_err_probe(&i2c->dev, PTR_ERR(adcx140->gpio_reset),
1158+
"Failed to get Reset GPIO\n");
1159+
if (!adcx140->gpio_reset)
11591160
dev_info(&i2c->dev, "Reset GPIO not defined\n");
11601161

11611162
adcx140->supply_areg = devm_regulator_get_optional(adcx140->dev,

0 commit comments

Comments
 (0)