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

Commit 74e09660 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mfd: wcd9xxx: Make DMIC clock drive strength platform dependent"

parents 4b9c8845 da9788be
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,12 @@ Optional properties:
			   involving DMIC will use the rate defined by
			   cdc-dmic-sample-rate.

 - qcom,cdc-dmic-clk-drv-strength: Specifies the drive strength for digital microphone
				   clock in the codec. Accepted values are 2,4,8 and 16.
				   The clock drive strentgh is in uA. Codec driver will
				   choose default value for particular codec if this
				   value is not specified in device tree.

 - qcom,cdc-on-demand-supplies: List of supplies which can be enabled
				dynamically.
				Supplies in this list are off by default.
+17 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2584,6 +2584,7 @@ static struct wcd9xxx_pdata *wcd9xxx_populate_dt_pdata(struct device *dev)
	u32 mclk_rate = 0;
	u32 dmic_sample_rate = 0;
	u32 mad_dmic_sample_rate = 0;
	u32 dmic_clk_drive;
	const char *static_prop_name = "qcom,cdc-static-supplies";
	const char *ond_prop_name = "qcom,cdc-on-demand-supplies";
	const char *cp_supplies_name = "qcom,cdc-cp-supplies";
@@ -2703,6 +2704,21 @@ static struct wcd9xxx_pdata *wcd9xxx_populate_dt_pdata(struct device *dev)
						  pdata->mclk_rate,
						  "mad_dmic_rate");

	pdata->dmic_clk_drv = WCD9XXX_DMIC_CLK_DRIVE_UNDEFINED;
	ret = of_property_read_u32(dev->of_node,
				   "qcom,cdc-dmic-clk-drv-strength",
				   &dmic_clk_drive);
	if (ret)
		dev_err(dev, "Looking up %s property in node %s failed, err = %d",
			"qcom,cdc-dmic-clk-drv-strength",
			dev->of_node->full_name, ret);
	else if (dmic_clk_drive != 2 && dmic_clk_drive != 4 &&
		 dmic_clk_drive != 8 && dmic_clk_drive != 16)
		dev_err(dev, "Invalid cdc-dmic-clk-drv-strength %d\n",
			dmic_clk_drive);
	else
		pdata->dmic_clk_drv = dmic_clk_drive;

	ret = of_property_read_string(dev->of_node,
				"qcom,cdc-variant",
				&cdc_name);
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -87,6 +87,8 @@

#define WCD9XXX_DMIC_SAMPLE_RATE_UNDEFINED 0

#define WCD9XXX_DMIC_CLK_DRIVE_UNDEFINED 0

struct wcd9xxx_amic {
	/*legacy mode, txfe_enable and txfe_buff take 7 input
	 * each bit represent the channel / TXFE number
@@ -184,6 +186,7 @@ struct wcd9xxx_pdata {
	u32 mclk_rate;
	u32 dmic_sample_rate;
	u32 mad_dmic_sample_rate;
	u32 dmic_clk_drv;
	enum codec_variant cdc_variant;
	u16 use_pinctrl;
};