aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>2015-12-22 13:27:54 -0500
committerMark Brown <broonie@kernel.org>2015-12-22 19:11:39 -0500
commitd8ef140dccc1645aa37a140ed7585458294210b8 (patch)
treef86c9971437fb052974fc17889ab5a59381dab5d
parent9ff099790412cb46536efba02039b36d81300976 (diff)
ASoC: da7219: Remove internal LDO features of codec
In AB silicon, the internal LDO is not supported so remove DT and driver references to this (digital voltage direct from 'VDD' supply) Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/sound/da7219.txt6
-rw-r--r--include/sound/da7219.h11
-rw-r--r--sound/soc/codecs/da7219.c50
-rw-r--r--sound/soc/codecs/da7219.h7
4 files changed, 6 insertions, 68 deletions
diff --git a/Documentation/devicetree/bindings/sound/da7219.txt b/Documentation/devicetree/bindings/sound/da7219.txt
index 1b7030911a3b..062a2a08250e 100644
--- a/Documentation/devicetree/bindings/sound/da7219.txt
+++ b/Documentation/devicetree/bindings/sound/da7219.txt
@@ -28,13 +28,15 @@ Optional properties:
28- clocks : phandle and clock specifier for codec MCLK. 28- clocks : phandle and clock specifier for codec MCLK.
29- clock-names : Clock name string for 'clocks' attribute, should be "mclk". 29- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
30 30
31- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
32 [<1050>, <1100>, <1200>, <1400>]
33- dlg,micbias-lvl : Voltage (mV) for Mic Bias 31- dlg,micbias-lvl : Voltage (mV) for Mic Bias
34 [<1800>, <2000>, <2200>, <2400>, <2600>] 32 [<1800>, <2000>, <2200>, <2400>, <2600>]
35- dlg,mic-amp-in-sel : Mic input source type 33- dlg,mic-amp-in-sel : Mic input source type
36 ["diff", "se_p", "se_n"] 34 ["diff", "se_p", "se_n"]
37 35
36Deprecated properties:
37- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
38 (LDO unavailable in production HW so property no longer required).
39
38====== 40======
39 41
40Child node - 'da7219_aad': 42Child node - 'da7219_aad':
diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index 3f39e135312d..307198b469bc 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -14,14 +14,6 @@
14#ifndef __DA7219_PDATA_H 14#ifndef __DA7219_PDATA_H
15#define __DA7219_PDATA_H 15#define __DA7219_PDATA_H
16 16
17/* LDO */
18enum da7219_ldo_lvl_sel {
19 DA7219_LDO_LVL_SEL_1_05V = 0,
20 DA7219_LDO_LVL_SEL_1_10V,
21 DA7219_LDO_LVL_SEL_1_20V,
22 DA7219_LDO_LVL_SEL_1_40V,
23};
24
25/* Mic Bias */ 17/* Mic Bias */
26enum da7219_micbias_voltage { 18enum da7219_micbias_voltage {
27 DA7219_MICBIAS_1_8V = 1, 19 DA7219_MICBIAS_1_8V = 1,
@@ -41,9 +33,6 @@ enum da7219_mic_amp_in_sel {
41struct da7219_aad_pdata; 33struct da7219_aad_pdata;
42 34
43struct da7219_pdata { 35struct da7219_pdata {
44 /* Internal LDO */
45 enum da7219_ldo_lvl_sel ldo_lvl_sel;
46
47 /* Mic */ 36 /* Mic */
48 enum da7219_micbias_voltage micbias_lvl; 37 enum da7219_micbias_voltage micbias_lvl;
49 enum da7219_mic_amp_in_sel mic_amp_in_sel; 38 enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 0a177ae8e0c3..2630c503e3df 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1406,24 +1406,6 @@ static const struct of_device_id da7219_of_match[] = {
1406}; 1406};
1407MODULE_DEVICE_TABLE(of, da7219_of_match); 1407MODULE_DEVICE_TABLE(of, da7219_of_match);
1408 1408
1409static enum da7219_ldo_lvl_sel da7219_of_ldo_lvl(struct snd_soc_codec *codec,
1410 u32 val)
1411{
1412 switch (val) {
1413 case 1050:
1414 return DA7219_LDO_LVL_SEL_1_05V;
1415 case 1100:
1416 return DA7219_LDO_LVL_SEL_1_10V;
1417 case 1200:
1418 return DA7219_LDO_LVL_SEL_1_20V;
1419 case 1400:
1420 return DA7219_LDO_LVL_SEL_1_40V;
1421 default:
1422 dev_warn(codec->dev, "Invalid LDO level");
1423 return DA7219_LDO_LVL_SEL_1_05V;
1424 }
1425}
1426
1427static enum da7219_micbias_voltage 1409static enum da7219_micbias_voltage
1428 da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val) 1410 da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
1429{ 1411{
@@ -1470,9 +1452,6 @@ static struct da7219_pdata *da7219_of_to_pdata(struct snd_soc_codec *codec)
1470 if (!pdata) 1452 if (!pdata)
1471 return NULL; 1453 return NULL;
1472 1454
1473 if (of_property_read_u32(np, "dlg,ldo-lvl", &of_val32) >= 0)
1474 pdata->ldo_lvl_sel = da7219_of_ldo_lvl(codec, of_val32);
1475
1476 if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0) 1455 if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0)
1477 pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32); 1456 pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32);
1478 else 1457 else
@@ -1517,24 +1496,13 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
1517 snd_soc_update_bits(codec, DA7219_REFERENCES, 1496 snd_soc_update_bits(codec, DA7219_REFERENCES,
1518 DA7219_BIAS_EN_MASK, 1497 DA7219_BIAS_EN_MASK,
1519 DA7219_BIAS_EN_MASK); 1498 DA7219_BIAS_EN_MASK);
1520
1521 /* Enable Internal Digital LDO */
1522 snd_soc_update_bits(codec, DA7219_LDO_CTRL,
1523 DA7219_LDO_EN_MASK,
1524 DA7219_LDO_EN_MASK);
1525 } 1499 }
1526 break; 1500 break;
1527 case SND_SOC_BIAS_OFF: 1501 case SND_SOC_BIAS_OFF:
1528 /* Only disable if jack detection not active */ 1502 /* Only disable master bias if jack detection not active */
1529 if (!da7219->aad->jack) { 1503 if (!da7219->aad->jack)
1530 /* Bypass Internal Digital LDO */
1531 snd_soc_update_bits(codec, DA7219_LDO_CTRL,
1532 DA7219_LDO_EN_MASK, 0);
1533
1534 /* Master bias */
1535 snd_soc_update_bits(codec, DA7219_REFERENCES, 1504 snd_soc_update_bits(codec, DA7219_REFERENCES,
1536 DA7219_BIAS_EN_MASK, 0); 1505 DA7219_BIAS_EN_MASK, 0);
1537 }
1538 1506
1539 /* MCLK */ 1507 /* MCLK */
1540 if (da7219->mclk) 1508 if (da7219->mclk)
@@ -1601,19 +1569,6 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
1601 if (pdata) { 1569 if (pdata) {
1602 u8 micbias_lvl = 0; 1570 u8 micbias_lvl = 0;
1603 1571
1604 /* Internal LDO */
1605 switch (pdata->ldo_lvl_sel) {
1606 case DA7219_LDO_LVL_SEL_1_05V:
1607 case DA7219_LDO_LVL_SEL_1_10V:
1608 case DA7219_LDO_LVL_SEL_1_20V:
1609 case DA7219_LDO_LVL_SEL_1_40V:
1610 snd_soc_update_bits(codec, DA7219_LDO_CTRL,
1611 DA7219_LDO_LEVEL_SELECT_MASK,
1612 (pdata->ldo_lvl_sel <<
1613 DA7219_LDO_LEVEL_SELECT_SHIFT));
1614 break;
1615 }
1616
1617 /* Mic Bias voltages */ 1572 /* Mic Bias voltages */
1618 switch (pdata->micbias_lvl) { 1573 switch (pdata->micbias_lvl) {
1619 case DA7219_MICBIAS_1_8V: 1574 case DA7219_MICBIAS_1_8V:
@@ -1823,7 +1778,6 @@ static struct reg_default da7219_reg_defaults[] = {
1823 { DA7219_CHIP_ID1, 0x23 }, 1778 { DA7219_CHIP_ID1, 0x23 },
1824 { DA7219_CHIP_ID2, 0x93 }, 1779 { DA7219_CHIP_ID2, 0x93 },
1825 { DA7219_CHIP_REVISION, 0x00 }, 1780 { DA7219_CHIP_REVISION, 0x00 },
1826 { DA7219_LDO_CTRL, 0x00 },
1827 { DA7219_IO_CTRL, 0x00 }, 1781 { DA7219_IO_CTRL, 0x00 },
1828 { DA7219_GAIN_RAMP_CTRL, 0x00 }, 1782 { DA7219_GAIN_RAMP_CTRL, 0x00 },
1829 { DA7219_PC_COUNT, 0x02 }, 1783 { DA7219_PC_COUNT, 0x02 },
diff --git a/sound/soc/codecs/da7219.h b/sound/soc/codecs/da7219.h
index b514268c6c56..2b3f4471a17f 100644
--- a/sound/soc/codecs/da7219.h
+++ b/sound/soc/codecs/da7219.h
@@ -85,7 +85,6 @@
85#define DA7219_CHIP_ID1 0x81 85#define DA7219_CHIP_ID1 0x81
86#define DA7219_CHIP_ID2 0x82 86#define DA7219_CHIP_ID2 0x82
87#define DA7219_CHIP_REVISION 0x83 87#define DA7219_CHIP_REVISION 0x83
88#define DA7219_LDO_CTRL 0x90
89#define DA7219_IO_CTRL 0x91 88#define DA7219_IO_CTRL 0x91
90#define DA7219_GAIN_RAMP_CTRL 0x92 89#define DA7219_GAIN_RAMP_CTRL 0x92
91#define DA7219_PC_COUNT 0x94 90#define DA7219_PC_COUNT 0x94
@@ -569,12 +568,6 @@
569#define DA7219_CHIP_MAJOR_SHIFT 4 568#define DA7219_CHIP_MAJOR_SHIFT 4
570#define DA7219_CHIP_MAJOR_MASK (0xF << 4) 569#define DA7219_CHIP_MAJOR_MASK (0xF << 4)
571 570
572/* DA7219_LDO_CTRL = 0x90 */
573#define DA7219_LDO_LEVEL_SELECT_SHIFT 4
574#define DA7219_LDO_LEVEL_SELECT_MASK (0x3 << 4)
575#define DA7219_LDO_EN_SHIFT 7
576#define DA7219_LDO_EN_MASK (0x1 << 7)
577
578/* DA7219_IO_CTRL = 0x91 */ 571/* DA7219_IO_CTRL = 0x91 */
579#define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0 572#define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0
580#define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0) 573#define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0)