aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatol Pomozov <anatol.pomozov@gmail.com>2014-09-26 12:57:27 -0400
committerMark Brown <broonie@kernel.org>2014-09-29 14:46:20 -0400
commit6f67c380056ceaf5844f18d3a5d769d233247849 (patch)
tree168bed40ef09af1ce49a7b364f1be4da14c6acda
parent0e612ff10c86241683f0a77e3dd0a6631b640009 (diff)
ASoC: rt5677: Add dts properties for input/output differential configuration
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/sound/rt5677.txt9
-rw-r--r--include/sound/rt5677.h5
-rw-r--r--sound/soc/codecs/rt5677.c23
3 files changed, 36 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/sound/rt5677.txt b/Documentation/devicetree/bindings/sound/rt5677.txt
index bd28df604b7b..0701b834fc73 100644
--- a/Documentation/devicetree/bindings/sound/rt5677.txt
+++ b/Documentation/devicetree/bindings/sound/rt5677.txt
@@ -19,6 +19,14 @@ Optional properties:
19 19
20- realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin. 20- realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin.
21 21
22- realtek,in1-differential
23- realtek,in2-differential
24- realtek,lout1-differential
25- realtek,lout2-differential
26- realtek,lout3-differential
27 Boolean. Indicate MIC1/2 input and LOUT1/2/3 outputs are differential,
28 rather than single-ended.
29
22Pins on the device (for linking into audio routes): 30Pins on the device (for linking into audio routes):
23 31
24 * IN1P 32 * IN1P
@@ -47,4 +55,5 @@ rt5677 {
47 55
48 realtek,pow-ldo2-gpio = 56 realtek,pow-ldo2-gpio =
49 <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>; 57 <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
58 realtek,in1-differential = "true";
50}; 59};
diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h
index a676717f74f4..082670e3a353 100644
--- a/include/sound/rt5677.h
+++ b/include/sound/rt5677.h
@@ -19,9 +19,12 @@ enum rt5677_dmic2_clk {
19 19
20 20
21struct rt5677_platform_data { 21struct rt5677_platform_data {
22 /* IN1 IN2 can optionally be differential */ 22 /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */
23 bool in1_diff; 23 bool in1_diff;
24 bool in2_diff; 24 bool in2_diff;
25 bool lout1_diff;
26 bool lout2_diff;
27 bool lout3_diff;
25 /* DMIC2 clock source selection */ 28 /* DMIC2 clock source selection */
26 enum rt5677_dmic2_clk dmic2_clk_pin; 29 enum rt5677_dmic2_clk dmic2_clk_pin;
27}; 30};
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index d2c6abf38ad2..97dff7172fb6 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -3569,6 +3569,17 @@ MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id);
3569 3569
3570static int rt5677_parse_dt(struct rt5677_priv *rt5677, struct device_node *np) 3570static int rt5677_parse_dt(struct rt5677_priv *rt5677, struct device_node *np)
3571{ 3571{
3572 rt5677->pdata.in1_diff = of_property_read_bool(np,
3573 "realtek,in1-differential");
3574 rt5677->pdata.in2_diff = of_property_read_bool(np,
3575 "realtek,in2-differential");
3576 rt5677->pdata.lout1_diff = of_property_read_bool(np,
3577 "realtek,lout1-differential");
3578 rt5677->pdata.lout2_diff = of_property_read_bool(np,
3579 "realtek,lout2-differential");
3580 rt5677->pdata.lout3_diff = of_property_read_bool(np,
3581 "realtek,lout3-differential");
3582
3572 rt5677->pow_ldo2 = of_get_named_gpio(np, 3583 rt5677->pow_ldo2 = of_get_named_gpio(np,
3573 "realtek,pow-ldo2-gpio", 0); 3584 "realtek,pow-ldo2-gpio", 0);
3574 3585
@@ -3660,6 +3671,18 @@ static int rt5677_i2c_probe(struct i2c_client *i2c,
3660 regmap_update_bits(rt5677->regmap, RT5677_IN1, 3671 regmap_update_bits(rt5677->regmap, RT5677_IN1,
3661 RT5677_IN_DF2, RT5677_IN_DF2); 3672 RT5677_IN_DF2, RT5677_IN_DF2);
3662 3673
3674 if (rt5677->pdata.lout1_diff)
3675 regmap_update_bits(rt5677->regmap, RT5677_LOUT1,
3676 RT5677_LOUT1_L_DF, RT5677_LOUT1_L_DF);
3677
3678 if (rt5677->pdata.lout2_diff)
3679 regmap_update_bits(rt5677->regmap, RT5677_LOUT1,
3680 RT5677_LOUT2_L_DF, RT5677_LOUT2_L_DF);
3681
3682 if (rt5677->pdata.lout3_diff)
3683 regmap_update_bits(rt5677->regmap, RT5677_LOUT1,
3684 RT5677_LOUT3_L_DF, RT5677_LOUT3_L_DF);
3685
3663 if (rt5677->pdata.dmic2_clk_pin == RT5677_DMIC_CLK2) { 3686 if (rt5677->pdata.dmic2_clk_pin == RT5677_DMIC_CLK2) {
3664 regmap_update_bits(rt5677->regmap, RT5677_GEN_CTRL2, 3687 regmap_update_bits(rt5677->regmap, RT5677_GEN_CTRL2,
3665 RT5677_GPIO5_FUNC_MASK, 3688 RT5677_GPIO5_FUNC_MASK,