ASoC: TSCS42xx: Add headphone auto switching
authorSteven Eckhoff <steven.eckhoff.opensource@gmail.com>
Mon, 4 Jun 2018 20:47:02 +0000 (15:47 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 18 Jun 2018 11:54:38 +0000 (12:54 +0100)
Add headphone auto switching controls

Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tscs42xx.c
sound/soc/codecs/tscs42xx.h

index 5d596e4dab0c6bbe281131564b2eab452efd3cab..7396a6e5277e68814117e2953839aa85b7ac03aa 100644 (file)
@@ -647,6 +647,12 @@ static const struct snd_kcontrol_new tscs42xx_snd_controls[] = {
        /* Mic Bias */
        SOC_SINGLE("Mic Bias Boost Switch", 0x71, 0x07, 1, 0),
 
+       /* Headphone Auto Switching */
+       SOC_SINGLE("Headphone Auto Switching Switch",
+                       R_CTL, FB_CTL_HPSWEN, 1, 0),
+       SOC_SINGLE("Headphone Detect Polarity Toggle Switch",
+                       R_CTL, FB_CTL_HPSWPOL, 1, 0),
+
        /* Coefficient Ram */
        COEFF_RAM_CTL("Cascade1L BiQuad1", BIQUAD_SIZE, 0x00),
        COEFF_RAM_CTL("Cascade1L BiQuad2", BIQUAD_SIZE, 0x05),
index 814c8f3c4a68c83b7e9e2c5dc129ca50b7d5dc1b..6b3a210816356b48a2baa432ca57d3e7db63d9d9 100644 (file)
@@ -34,6 +34,7 @@ enum {
 #define R_DACSR         0x19
 #define R_PWRM1         0x1A
 #define R_PWRM2         0x1B
+#define R_CTL          0x1C
 #define R_CONFIG0       0x1F
 #define R_CONFIG1       0x20
 #define R_DMICCTL       0x24
@@ -1110,6 +1111,13 @@ enum {
 #define RV_PWRM2_VREF_DISABLE \
         RV(FV_PWRM2_VREF_DISABLE, FB_PWRM2_VREF)
 
+/******************************
+ *      R_CTL (0x1C)          *
+ ******************************/
+
+/* Fiel Offsets */
+#define FB_CTL_HPSWEN                        7
+#define FB_CTL_HPSWPOL                       6
 
 /******************************
  *      R_CONFIG0 (0x1F)      *