Commit 30043527 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/cs4271', 'asoc/topic/cs53l30',...

Merge remote-tracking branches 'asoc/topic/cs4271', 'asoc/topic/cs53l30', 'asoc/topic/da7213' and 'asoc/topic/da7218' into asoc-next
...@@ -674,8 +674,6 @@ static int cs4271_common_probe(struct device *dev, ...@@ -674,8 +674,6 @@ static int cs4271_common_probe(struct device *dev,
cs4271->gpio_nreset = cs4271plat->gpio_nreset; cs4271->gpio_nreset = cs4271plat->gpio_nreset;
if (gpio_is_valid(cs4271->gpio_nreset)) { if (gpio_is_valid(cs4271->gpio_nreset)) {
int ret;
ret = devm_gpio_request(dev, cs4271->gpio_nreset, ret = devm_gpio_request(dev, cs4271->gpio_nreset,
"CS4271 Reset"); "CS4271 Reset");
if (ret < 0) if (ret < 0)
......
...@@ -747,7 +747,7 @@ static unsigned int const cs53l30_src_rates[] = { ...@@ -747,7 +747,7 @@ static unsigned int const cs53l30_src_rates[] = {
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 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), .count = ARRAY_SIZE(cs53l30_src_rates),
.list = cs53l30_src_rates, .list = cs53l30_src_rates,
}; };
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
*/ */
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/i2c.h> #include <linux/i2c.h>
...@@ -1606,12 +1608,12 @@ static enum da7213_dmic_clk_rate ...@@ -1606,12 +1608,12 @@ static enum da7213_dmic_clk_rate
} }
static struct da7213_platform_data 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; struct da7213_platform_data *pdata;
const char *of_str; const char *fw_str;
u32 of_val32; u32 fw_val32;
pdata = devm_kzalloc(codec->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(codec->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) { if (!pdata) {
...@@ -1619,29 +1621,29 @@ static struct da7213_platform_data ...@@ -1619,29 +1621,29 @@ static struct da7213_platform_data
return NULL; return NULL;
} }
if (of_property_read_u32(np, "dlg,micbias1-lvl", &of_val32) >= 0) if (device_property_read_u32(dev, "dlg,micbias1-lvl", &fw_val32) >= 0)
pdata->micbias1_lvl = da7213_of_micbias_lvl(codec, of_val32); pdata->micbias1_lvl = da7213_of_micbias_lvl(codec, fw_val32);
else else
pdata->micbias1_lvl = DA7213_MICBIAS_2_2V; pdata->micbias1_lvl = DA7213_MICBIAS_2_2V;
if (of_property_read_u32(np, "dlg,micbias2-lvl", &of_val32) >= 0) if (device_property_read_u32(dev, "dlg,micbias2-lvl", &fw_val32) >= 0)
pdata->micbias2_lvl = da7213_of_micbias_lvl(codec, of_val32); pdata->micbias2_lvl = da7213_of_micbias_lvl(codec, fw_val32);
else else
pdata->micbias2_lvl = DA7213_MICBIAS_2_2V; pdata->micbias2_lvl = DA7213_MICBIAS_2_2V;
if (!of_property_read_string(np, "dlg,dmic-data-sel", &of_str)) if (!device_property_read_string(dev, "dlg,dmic-data-sel", &fw_str))
pdata->dmic_data_sel = da7213_of_dmic_data_sel(codec, of_str); pdata->dmic_data_sel = da7213_of_dmic_data_sel(codec, fw_str);
else else
pdata->dmic_data_sel = DA7213_DMIC_DATA_LRISE_RFALL; 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 = pdata->dmic_samplephase =
da7213_of_dmic_samplephase(codec, of_str); da7213_of_dmic_samplephase(codec, fw_str);
else else
pdata->dmic_samplephase = DA7213_DMIC_SAMPLE_ON_CLKEDGE; pdata->dmic_samplephase = DA7213_DMIC_SAMPLE_ON_CLKEDGE;
if (of_property_read_u32(np, "dlg,dmic-clkrate", &of_val32) >= 0) if (device_property_read_u32(dev, "dlg,dmic-clkrate", &fw_val32) >= 0)
pdata->dmic_clk_rate = da7213_of_dmic_clkrate(codec, of_val32); pdata->dmic_clk_rate = da7213_of_dmic_clkrate(codec, fw_val32);
else else
pdata->dmic_clk_rate = DA7213_DMIC_CLK_3_0MHZ; pdata->dmic_clk_rate = DA7213_DMIC_CLK_3_0MHZ;
...@@ -1713,10 +1715,9 @@ static int da7213_probe(struct snd_soc_codec *codec) ...@@ -1713,10 +1715,9 @@ static int da7213_probe(struct snd_soc_codec *codec)
DA7213_LINE_AMP_OE, DA7213_LINE_AMP_OE); DA7213_LINE_AMP_OE, DA7213_LINE_AMP_OE);
/* Handle DT/Platform data */ /* Handle DT/Platform data */
if (codec->dev->of_node) da7213->pdata = dev_get_platdata(codec->dev);
da7213->pdata = da7213_of_to_pdata(codec); if (!da7213->pdata)
else da7213->pdata = da7213_fw_to_pdata(codec);
da7213->pdata = dev_get_platdata(codec->dev);
/* Set platform data values */ /* Set platform data values */
if (da7213->pdata) { if (da7213->pdata) {
......
...@@ -1457,7 +1457,7 @@ static int da7218_dai_event(struct snd_soc_dapm_widget *w, ...@@ -1457,7 +1457,7 @@ static int da7218_dai_event(struct snd_soc_dapm_widget *w,
++i; ++i;
msleep(DA7218_SRM_CHECK_DELAY); msleep(DA7218_SRM_CHECK_DELAY);
} }
} while ((i < DA7218_SRM_CHECK_TRIES) & (!success)); } while ((i < DA7218_SRM_CHECK_TRIES) && (!success));
if (!success) if (!success)
dev_warn(codec->dev, "SRM failed to lock\n"); dev_warn(codec->dev, "SRM failed to lock\n");
......
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