Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30043527 authored by Mark Brown's avatar Mark Brown
Browse files

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
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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,
};
+19 −18
Original line number Diff line number Diff line
@@ -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>
@@ -1606,12 +1608,12 @@ 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) {
@@ -1619,29 +1621,29 @@ static struct da7213_platform_data
		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;

@@ -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);
	if (!da7213->pdata)
		da7213->pdata = da7213_fw_to_pdata(codec);

	/* Set platform data values */
	if (da7213->pdata) {
+1 −1
Original line number Diff line number Diff line
@@ -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");