diff options
-rwxr-xr-x | Documentation/devicetree/bindings/sound/taiko_codec.txt | 6 | ||||
-rw-r--r-- | drivers/mfd/wcd9xxx-core.c | 18 | ||||
-rwxr-xr-x | include/linux/mfd/wcd9xxx/pdata.h | 5 |
3 files changed, 27 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/sound/taiko_codec.txt b/Documentation/devicetree/bindings/sound/taiko_codec.txt index 1e1a9157c90e..0b38ba2b7b95 100755 --- a/Documentation/devicetree/bindings/sound/taiko_codec.txt +++ b/Documentation/devicetree/bindings/sound/taiko_codec.txt @@ -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. diff --git a/drivers/mfd/wcd9xxx-core.c b/drivers/mfd/wcd9xxx-core.c index 7a1fd306a7b0..c2ee8979e50a 100644 --- a/drivers/mfd/wcd9xxx-core.c +++ b/drivers/mfd/wcd9xxx-core.c @@ -1,4 +1,4 @@ -/* 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); diff --git a/include/linux/mfd/wcd9xxx/pdata.h b/include/linux/mfd/wcd9xxx/pdata.h index 9c3508f79245..7dc7d42013fb 100755 --- a/include/linux/mfd/wcd9xxx/pdata.h +++ b/include/linux/mfd/wcd9xxx/pdata.h @@ -1,4 +1,4 @@ -/* 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; }; |