ASoC: da7219: Remove internal LDO features of codec
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Tue, 22 Dec 2015 18:27:54 +0000 (18:27 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 23 Dec 2015 00:11:39 +0000 (00:11 +0000)
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>
Documentation/devicetree/bindings/sound/da7219.txt
include/sound/da7219.h
sound/soc/codecs/da7219.c
sound/soc/codecs/da7219.h

index 1b7030911a3bfc8f13a276c00e5dc03d8ec7b5db..062a2a08250eb859d6b1aaa044a02954ce628b17 100644 (file)
@@ -28,13 +28,15 @@ Optional properties:
 - clocks : phandle and clock specifier for codec MCLK.
 - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
 
-- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
-       [<1050>, <1100>, <1200>, <1400>]
 - dlg,micbias-lvl : Voltage (mV) for Mic Bias
        [<1800>, <2000>, <2200>, <2400>, <2600>]
 - dlg,mic-amp-in-sel : Mic input source type
        ["diff", "se_p", "se_n"]
 
+Deprecated properties:
+- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
+  (LDO unavailable in production HW so property no longer required).
+
 ======
 
 Child node - 'da7219_aad':
index 3f39e135312db031a0e55cf3b538fee230415c9a..307198b469bc1f29e3a5dd145a0d1ef2827a9942 100644 (file)
 #ifndef __DA7219_PDATA_H
 #define __DA7219_PDATA_H
 
-/* LDO */
-enum da7219_ldo_lvl_sel {
-       DA7219_LDO_LVL_SEL_1_05V = 0,
-       DA7219_LDO_LVL_SEL_1_10V,
-       DA7219_LDO_LVL_SEL_1_20V,
-       DA7219_LDO_LVL_SEL_1_40V,
-};
-
 /* Mic Bias */
 enum da7219_micbias_voltage {
        DA7219_MICBIAS_1_8V = 1,
@@ -41,9 +33,6 @@ enum da7219_mic_amp_in_sel {
 struct da7219_aad_pdata;
 
 struct da7219_pdata {
-       /* Internal LDO */
-       enum da7219_ldo_lvl_sel ldo_lvl_sel;
-
        /* Mic */
        enum da7219_micbias_voltage micbias_lvl;
        enum da7219_mic_amp_in_sel mic_amp_in_sel;
index 0a177ae8e0c37941f1dd36d6cfc327301ab35e6b..2630c503e3df835dbe7dc525f575828b3e85ada9 100644 (file)
@@ -1406,24 +1406,6 @@ static const struct of_device_id da7219_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, da7219_of_match);
 
-static enum da7219_ldo_lvl_sel da7219_of_ldo_lvl(struct snd_soc_codec *codec,
-                                                u32 val)
-{
-       switch (val) {
-       case 1050:
-               return DA7219_LDO_LVL_SEL_1_05V;
-       case 1100:
-               return DA7219_LDO_LVL_SEL_1_10V;
-       case 1200:
-               return DA7219_LDO_LVL_SEL_1_20V;
-       case 1400:
-               return DA7219_LDO_LVL_SEL_1_40V;
-       default:
-               dev_warn(codec->dev, "Invalid LDO level");
-               return DA7219_LDO_LVL_SEL_1_05V;
-       }
-}
-
 static enum da7219_micbias_voltage
        da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
 {
@@ -1470,9 +1452,6 @@ static struct da7219_pdata *da7219_of_to_pdata(struct snd_soc_codec *codec)
        if (!pdata)
                return NULL;
 
-       if (of_property_read_u32(np, "dlg,ldo-lvl", &of_val32) >= 0)
-               pdata->ldo_lvl_sel = da7219_of_ldo_lvl(codec, of_val32);
-
        if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0)
                pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32);
        else
@@ -1517,24 +1496,13 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
                        snd_soc_update_bits(codec, DA7219_REFERENCES,
                                            DA7219_BIAS_EN_MASK,
                                            DA7219_BIAS_EN_MASK);
-
-                       /* Enable Internal Digital LDO */
-                       snd_soc_update_bits(codec, DA7219_LDO_CTRL,
-                                           DA7219_LDO_EN_MASK,
-                                           DA7219_LDO_EN_MASK);
                }
                break;
        case SND_SOC_BIAS_OFF:
-               /* Only disable if jack detection not active */
-               if (!da7219->aad->jack) {
-                       /* Bypass Internal Digital LDO */
-                       snd_soc_update_bits(codec, DA7219_LDO_CTRL,
-                                           DA7219_LDO_EN_MASK, 0);
-
-                       /* Master bias */
+               /* Only disable master bias if jack detection not active */
+               if (!da7219->aad->jack)
                        snd_soc_update_bits(codec, DA7219_REFERENCES,
                                            DA7219_BIAS_EN_MASK, 0);
-               }
 
                /* MCLK */
                if (da7219->mclk)
@@ -1601,19 +1569,6 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
        if (pdata) {
                u8 micbias_lvl = 0;
 
-               /* Internal LDO */
-               switch (pdata->ldo_lvl_sel) {
-               case DA7219_LDO_LVL_SEL_1_05V:
-               case DA7219_LDO_LVL_SEL_1_10V:
-               case DA7219_LDO_LVL_SEL_1_20V:
-               case DA7219_LDO_LVL_SEL_1_40V:
-                       snd_soc_update_bits(codec, DA7219_LDO_CTRL,
-                                           DA7219_LDO_LEVEL_SELECT_MASK,
-                                           (pdata->ldo_lvl_sel <<
-                                            DA7219_LDO_LEVEL_SELECT_SHIFT));
-                       break;
-               }
-
                /* Mic Bias voltages */
                switch (pdata->micbias_lvl) {
                case DA7219_MICBIAS_1_8V:
@@ -1823,7 +1778,6 @@ static struct reg_default da7219_reg_defaults[] = {
        { DA7219_CHIP_ID1, 0x23 },
        { DA7219_CHIP_ID2, 0x93 },
        { DA7219_CHIP_REVISION, 0x00 },
-       { DA7219_LDO_CTRL, 0x00 },
        { DA7219_IO_CTRL, 0x00 },
        { DA7219_GAIN_RAMP_CTRL, 0x00 },
        { DA7219_PC_COUNT, 0x02 },
index b514268c6c568de4bfb75eb9499cc969888143dd..2b3f4471a17fec367e1e3b622f8d27b1df32995e 100644 (file)
@@ -85,7 +85,6 @@
 #define DA7219_CHIP_ID1                        0x81
 #define DA7219_CHIP_ID2                        0x82
 #define DA7219_CHIP_REVISION           0x83
-#define DA7219_LDO_CTRL                        0x90
 #define DA7219_IO_CTRL                 0x91
 #define DA7219_GAIN_RAMP_CTRL          0x92
 #define DA7219_PC_COUNT                        0x94
 #define DA7219_CHIP_MAJOR_SHIFT        4
 #define DA7219_CHIP_MAJOR_MASK (0xF << 4)
 
-/* DA7219_LDO_CTRL = 0x90 */
-#define DA7219_LDO_LEVEL_SELECT_SHIFT  4
-#define DA7219_LDO_LEVEL_SELECT_MASK   (0x3 << 4)
-#define DA7219_LDO_EN_SHIFT            7
-#define DA7219_LDO_EN_MASK             (0x1 << 7)
-
 /* DA7219_IO_CTRL = 0x91 */
 #define DA7219_IO_VOLTAGE_LEVEL_SHIFT          0
 #define DA7219_IO_VOLTAGE_LEVEL_MASK           (0x1 << 0)