Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/cs4271', 'asoc/topic/cs53l…
Browse files Browse the repository at this point in the history
…30', 'asoc/topic/da7213' and 'asoc/topic/da7218' into asoc-next
  • Loading branch information
broonie committed Jul 3, 2017
5 parents c7a9dd3 + 177e271 + 92f468d + 0e54153 + 679d026 commit f83ff1f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
2 changes: 0 additions & 2 deletions sound/soc/codecs/cs4271.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,6 @@ static int cs4271_common_probe(struct device *dev,
cs4271->gpio_nreset = cs4271plat->gpio_nreset;

if (gpio_is_valid(cs4271->gpio_nreset)) {
int ret;

ret = devm_gpio_request(dev, cs4271->gpio_nreset,
"CS4271 Reset");
if (ret < 0)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/cs53l30.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ static unsigned int const cs53l30_src_rates[] = {
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
};

static struct snd_pcm_hw_constraint_list src_constraints = {
static const struct snd_pcm_hw_constraint_list src_constraints = {
.count = ARRAY_SIZE(cs53l30_src_rates),
.list = cs53l30_src_rates,
};
Expand Down
37 changes: 19 additions & 18 deletions sound/soc/codecs/da7213.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/

#include <linux/acpi.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -1606,42 +1608,42 @@ static enum da7213_dmic_clk_rate
}

static struct da7213_platform_data
*da7213_of_to_pdata(struct snd_soc_codec *codec)
*da7213_fw_to_pdata(struct snd_soc_codec *codec)
{
struct device_node *np = codec->dev->of_node;
struct device *dev = codec->dev;
struct da7213_platform_data *pdata;
const char *of_str;
u32 of_val32;
const char *fw_str;
u32 fw_val32;

pdata = devm_kzalloc(codec->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
dev_warn(codec->dev, "Failed to allocate memory for pdata\n");
return NULL;
}

if (of_property_read_u32(np, "dlg,micbias1-lvl", &of_val32) >= 0)
pdata->micbias1_lvl = da7213_of_micbias_lvl(codec, of_val32);
if (device_property_read_u32(dev, "dlg,micbias1-lvl", &fw_val32) >= 0)
pdata->micbias1_lvl = da7213_of_micbias_lvl(codec, fw_val32);
else
pdata->micbias1_lvl = DA7213_MICBIAS_2_2V;

if (of_property_read_u32(np, "dlg,micbias2-lvl", &of_val32) >= 0)
pdata->micbias2_lvl = da7213_of_micbias_lvl(codec, of_val32);
if (device_property_read_u32(dev, "dlg,micbias2-lvl", &fw_val32) >= 0)
pdata->micbias2_lvl = da7213_of_micbias_lvl(codec, fw_val32);
else
pdata->micbias2_lvl = DA7213_MICBIAS_2_2V;

if (!of_property_read_string(np, "dlg,dmic-data-sel", &of_str))
pdata->dmic_data_sel = da7213_of_dmic_data_sel(codec, of_str);
if (!device_property_read_string(dev, "dlg,dmic-data-sel", &fw_str))
pdata->dmic_data_sel = da7213_of_dmic_data_sel(codec, fw_str);
else
pdata->dmic_data_sel = DA7213_DMIC_DATA_LRISE_RFALL;

if (!of_property_read_string(np, "dlg,dmic-samplephase", &of_str))
if (!device_property_read_string(dev, "dlg,dmic-samplephase", &fw_str))
pdata->dmic_samplephase =
da7213_of_dmic_samplephase(codec, of_str);
da7213_of_dmic_samplephase(codec, fw_str);
else
pdata->dmic_samplephase = DA7213_DMIC_SAMPLE_ON_CLKEDGE;

if (of_property_read_u32(np, "dlg,dmic-clkrate", &of_val32) >= 0)
pdata->dmic_clk_rate = da7213_of_dmic_clkrate(codec, of_val32);
if (device_property_read_u32(dev, "dlg,dmic-clkrate", &fw_val32) >= 0)
pdata->dmic_clk_rate = da7213_of_dmic_clkrate(codec, fw_val32);
else
pdata->dmic_clk_rate = DA7213_DMIC_CLK_3_0MHZ;

Expand Down Expand Up @@ -1713,10 +1715,9 @@ static int da7213_probe(struct snd_soc_codec *codec)
DA7213_LINE_AMP_OE, DA7213_LINE_AMP_OE);

/* Handle DT/Platform data */
if (codec->dev->of_node)
da7213->pdata = da7213_of_to_pdata(codec);
else
da7213->pdata = dev_get_platdata(codec->dev);
da7213->pdata = dev_get_platdata(codec->dev);
if (!da7213->pdata)
da7213->pdata = da7213_fw_to_pdata(codec);

/* Set platform data values */
if (da7213->pdata) {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/da7218.c
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ static int da7218_dai_event(struct snd_soc_dapm_widget *w,
++i;
msleep(DA7218_SRM_CHECK_DELAY);
}
} while ((i < DA7218_SRM_CHECK_TRIES) & (!success));
} while ((i < DA7218_SRM_CHECK_TRIES) && (!success));

if (!success)
dev_warn(codec->dev, "SRM failed to lock\n");
Expand Down

0 comments on commit f83ff1f

Please sign in to comment.