]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/simple', 'asoc...
authorMark Brown <broonie@kernel.org>
Thu, 29 Sep 2016 19:44:41 +0000 (12:44 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 29 Sep 2016 19:44:41 +0000 (12:44 -0700)
1  2  3  4  5  6 
Documentation/devicetree/bindings/sound/simple-card.txt
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/stac9766.c

index 59d862801e59102397d570a661fb832e7b463fe0,59d862801e59102397d570a661fb832e7b463fe0,5ecdde6d9f639f95482e22d3716aa9e3e42ac9d3,59d862801e59102397d570a661fb832e7b463fe0,59d862801e59102397d570a661fb832e7b463fe0,59d862801e59102397d570a661fb832e7b463fe0..c7a93931fad27c7d88069925ae5125434f3e8f74
@@@@@@@ -22,6 -22,6 -22,8 -22,6 -22,6 -22,6 +22,8 @@@@@@@ Optional properties
                                          headphones are attached.
      - simple-audio-card,mic-det-gpio  : Reference to GPIO that signals when
                                          a microphone is attached.
++ +++- simple-audio-card,aux-devs              : List of phandles pointing to auxiliary devices, such
++ +++                                    as amplifiers, to be added to the sound card.
      
      Optional subnodes:
      
                                          sub-nodes. This container may be
                                          omitted when the card has only one
                                          DAI link. See the examples and the
  -                                       section bellow.
  +                                       section below.
      
      Dai-link subnode properties and subnodes:
      
@@@@@@@ -162,3 -162,3 -164,38 -162,3 -162,3 -162,3 +164,38 @@@@@@@ sound 
                };
        };
      };
++ +++
++ +++Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec
++ +++through TPA6130A2 amplifier to headphones:
++ +++
++ +++&i2c0 {
++ +++  codec: tlv320dac3100@18 {
++ +++          compatible = "ti,tlv320dac3100";
++ +++          ...
++ +++  }
++ +++
++ +++  amp: tpa6130a2@60 {
++ +++          compatible = "ti,tpa6130a2";
++ +++          ...
++ +++  }
++ +++}
++ +++
++ +++sound {
++ +++  compatible = "simple-audio-card";
++ +++  ...
++ +++  simple-audio-card,widgets =
++ +++          "Headphone", "Headphone Jack";
++ +++  simple-audio-card,routing =
++ +++          "Headphone Jack", "HPLEFT",
++ +++          "Headphone Jack", "HPRIGHT",
++ +++          "LEFTIN", "HPL",
++ +++          "RIGHTIN", "HPR";
++ +++  simple-audio-card,aux-devs = <&amp>;
++ +++  simple-audio-card,cpu {
++ +++          sound-dai = <&ssi2>;
++ +++  };
++ +++  simple-audio-card,codec {
++ +++          sound-dai = <&codec>;
++ +++          clocks = ...
++ +++  };
++ +++};
index a635bd09d637d76ba1b66da09e424a050846a3d5,0187851c0f68132162e781f7b1d9a76f2bfd6ac3,527b759c1562dab6229f1d4c345d1ac21530c62b,527b759c1562dab6229f1d4c345d1ac21530c62b,527b759c1562dab6229f1d4c345d1ac21530c62b,a635bd09d637d76ba1b66da09e424a050846a3d5..1589325855bc10ca41c1180de3e06b745d32ee19
@@@@@@@ -411,6 -411,8 -411,6 -411,6 -411,6 -411,6 +411,8 @@@@@@@ static const struct snd_kcontrol_new sg
                        0, 8,
                        0x7f, 1,
                        headphone_volume),
+ ++++  SOC_SINGLE("Headphone Playback Switch", SGTL5000_CHIP_ANA_CTRL,
+ ++++                  4, 1, 1),
        SOC_SINGLE("Headphone Playback ZC Switch", SGTL5000_CHIP_ANA_CTRL,
                        5, 1, 0),
      
                        SGTL5000_LINE_OUT_VOL_RIGHT_SHIFT,
                        0x1f, 1,
                        lineout_volume),
+ ++++  SOC_SINGLE("Lineout Playback Switch", SGTL5000_CHIP_ANA_CTRL, 8, 1, 1),
      };
      
      /* mute the codec used by alsa core */
@@@@@@@ -1151,14 -1154,12 -1151,12 -1151,12 -1151,12 -1151,14 +1154,14 @@@@@@@ static struct snd_soc_codec_driver sgtl
        .remove = sgtl5000_remove,
        .set_bias_level = sgtl5000_set_bias_level,
        .suspend_bias_off = true,
 ----   .controls = sgtl5000_snd_controls,
 ----   .num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
 ----   .dapm_widgets = sgtl5000_dapm_widgets,
 ----   .num_dapm_widgets = ARRAY_SIZE(sgtl5000_dapm_widgets),
 ----   .dapm_routes = sgtl5000_dapm_routes,
 ----   .num_dapm_routes = ARRAY_SIZE(sgtl5000_dapm_routes),
 ++++   .component_driver = {
 ++++           .controls               = sgtl5000_snd_controls,
 ++++           .num_controls           = ARRAY_SIZE(sgtl5000_snd_controls),
 ++++           .dapm_widgets           = sgtl5000_dapm_widgets,
 ++++           .num_dapm_widgets       = ARRAY_SIZE(sgtl5000_dapm_widgets),
 ++++           .dapm_routes            = sgtl5000_dapm_routes,
 ++++           .num_dapm_routes        = ARRAY_SIZE(sgtl5000_dapm_routes),
 ++++   },
      };
      
      static const struct regmap_config sgtl5000_regmap = {
index 2c5941f3a23405c091ff09bccb9fd2be4a69989d,0945c51df003df37f415b4cbf9d9076826f1c7b6,0945c51df003df37f415b4cbf9d9076826f1c7b6,a718c653dab36db0d3103cb86832c6d32a6a5af0,0945c51df003df37f415b4cbf9d9076826f1c7b6,2c5941f3a23405c091ff09bccb9fd2be4a69989d..27f30d352867923a3c9d7a8a4519de2c8c65f7d0
@@@@@@@ -85,10 -85,10 -85,10 -85,10 -85,10 -85,10 +85,10 @@@@@@@ static SOC_ENUM_SINGLE_DECL(stac9766_bo
      static SOC_ENUM_SINGLE_DECL(stac9766_stereo_mic_enum,
                            AC97_STAC_STEREO_MIC, 2, stac9766_stereo_mic);
      
--- --static const DECLARE_TLV_DB_LINEAR(master_tlv, -4600, 0);
--- --static const DECLARE_TLV_DB_LINEAR(record_tlv, 0, 2250);
--- --static const DECLARE_TLV_DB_LINEAR(beep_tlv, -4500, 0);
--- --static const DECLARE_TLV_DB_LINEAR(mix_tlv, -3450, 1200);
+++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(master_tlv, -4650, 150, 0);
+++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(record_tlv,     0, 150, 0);
+++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(beep_tlv,   -4500, 300, 0);
+++ ++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(mix_tlv,    -3450, 150, 0);
      
      static const struct snd_kcontrol_new stac9766_snd_ac97_controls[] = {
        SOC_DOUBLE_TLV("Speaker Volume", AC97_MASTER, 8, 0, 31, 1, master_tlv),
@@@@@@@ -320,10 -320,8 -320,8 -320,8 -320,8 -320,10 +320,10 @@@@@@@ static int stac9766_codec_remove(struc
      }
      
      static struct snd_soc_codec_driver soc_codec_dev_stac9766 = {
 ----   .controls = stac9766_snd_ac97_controls,
 ----   .num_controls = ARRAY_SIZE(stac9766_snd_ac97_controls),
 ++++   .component_driver = {
 ++++           .controls               = stac9766_snd_ac97_controls,
 ++++           .num_controls           = ARRAY_SIZE(stac9766_snd_ac97_controls),
 ++++   },
        .write = stac9766_ac97_write,
        .read = stac9766_ac97_read,
        .set_bias_level = stac9766_set_bias_level,