aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l36.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cs35l36.c')
-rw-r--r--sound/soc/codecs/cs35l36.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index e9b5f76f27a8..31ae752e242f 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -444,7 +444,8 @@ static bool cs35l36_volatile_reg(struct device *dev, unsigned int reg)
}
}
-static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 25, 0);
+static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
+ TLV_DB_MINMAX_ITEM(-10200, 1200));
static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
static const char * const cs35l36_pcm_sftramp_text[] = {
@@ -756,14 +757,14 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
{
struct cs35l36_private *cs35l36 =
snd_soc_component_get_drvdata(component_dai->component);
- unsigned int asp_fmt, lrclk_fmt, sclk_fmt, slave_mode, clk_frc;
+ unsigned int asp_fmt, lrclk_fmt, sclk_fmt, clock_provider, clk_frc;
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
- slave_mode = 1;
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_CBP_CFP:
+ clock_provider = 1;
break;
- case SND_SOC_DAIFMT_CBS_CFS:
- slave_mode = 0;
+ case SND_SOC_DAIFMT_CBC_CFC:
+ clock_provider = 0;
break;
default:
return -EINVAL;
@@ -771,10 +772,10 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
regmap_update_bits(cs35l36->regmap, CS35L36_ASP_TX_PIN_CTRL,
CS35L36_SCLK_MSTR_MASK,
- slave_mode << CS35L36_SCLK_MSTR_SHIFT);
+ clock_provider << CS35L36_SCLK_MSTR_SHIFT);
regmap_update_bits(cs35l36->regmap, CS35L36_ASP_RATE_CTRL,
CS35L36_LRCLK_MSTR_MASK,
- slave_mode << CS35L36_LRCLK_MSTR_SHIFT);
+ clock_provider << CS35L36_LRCLK_MSTR_SHIFT);
switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
case SND_SOC_DAIFMT_CONT:
@@ -995,7 +996,7 @@ static struct snd_soc_dai_driver cs35l36_dai[] = {
.formats = CS35L36_TX_FORMATS,
},
.ops = &cs35l36_ops,
- .symmetric_rates = 1,
+ .symmetric_rate = 1,
},
};
@@ -1156,7 +1157,7 @@ static int cs35l36_component_probe(struct snd_soc_component *component)
{
struct cs35l36_private *cs35l36 =
snd_soc_component_get_drvdata(component);
- int ret = 0;
+ int ret;
if ((cs35l36->rev_id == CS35L36_REV_A0) && cs35l36->pdata.dcm_mode) {
regmap_update_bits(cs35l36->regmap, CS35L36_BSTCVRT_DCM_CTRL,
@@ -1299,7 +1300,6 @@ static const struct snd_soc_component_driver soc_component_dev_cs35l36 = {
.idle_bias_on = 1,
.use_pmdown_time = 1,
.endianness = 1,
- .non_legacy_dai_naming = 1,
};
static struct regmap_config cs35l36_regmap = {
@@ -1700,8 +1700,7 @@ static const struct reg_sequence cs35l36_revb0_errata_patch[] = {
{ CS35L36_TESTKEY_CTRL, CS35L36_TEST_LOCK2 },
};
-static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
- const struct i2c_device_id *id)
+static int cs35l36_i2c_probe(struct i2c_client *i2c_client)
{
struct cs35l36_private *cs35l36;
struct device *dev = &i2c_client->dev;
@@ -1721,7 +1720,7 @@ static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
if (IS_ERR(cs35l36->regmap)) {
ret = PTR_ERR(cs35l36->regmap);
dev_err(dev, "regmap_init() failed: %d\n", ret);
- goto err;
+ return ret;
}
cs35l36->num_supplies = ARRAY_SIZE(cs35l36_supplies);
@@ -1804,7 +1803,7 @@ static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
if (ret < 0) {
dev_err(&i2c_client->dev, "Failed to read otp_id Register %d\n",
ret);
- return ret;
+ goto err;
}
if ((l37_id_reg & CS35L36_OTP_REV_MASK) == CS35L36_OTP_REV_L37)
@@ -1911,7 +1910,7 @@ err_disable_regs:
return ret;
}
-static int cs35l36_i2c_remove(struct i2c_client *client)
+static void cs35l36_i2c_remove(struct i2c_client *client)
{
struct cs35l36_private *cs35l36 = i2c_get_clientdata(client);
@@ -1925,8 +1924,6 @@ static int cs35l36_i2c_remove(struct i2c_client *client)
gpiod_set_value_cansleep(cs35l36->reset_gpio, 0);
regulator_bulk_disable(cs35l36->num_supplies, cs35l36->supplies);
-
- return 0;
}
static const struct of_device_id cs35l36_of_match[] = {
{.compatible = "cirrus,cs35l36"},
@@ -1947,7 +1944,7 @@ static struct i2c_driver cs35l36_i2c_driver = {
.of_match_table = cs35l36_of_match,
},
.id_table = cs35l36_id,
- .probe = cs35l36_i2c_probe,
+ .probe_new = cs35l36_i2c_probe,
.remove = cs35l36_i2c_remove,
};
module_i2c_driver(cs35l36_i2c_driver);