patch 1:

        add SPKR on

        To add SPKR on for MM.

        Signed-off-by: Jeff Cheng <[email protected]>

patch 2:

        no changelog available

patch 3:

        sst: power on/off internal speaker on demand

        Sometimes setting mute alone can't shut up the internal speakers,
        better to power off/on it on demand

        CC: "Koul, Vinod" <[email protected]>
        CC: "Kp, Jeeja" <[email protected]>
        Signed-off-by: Lu Guanqun <[email protected]>
        Signed-off-by: Wang Xingchao <[email protected]>
---
 drivers/staging/intel_sst/intelmid_v2_control.c |   31 ++++++++++++++++++++--
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/intel_sst/intelmid_v2_control.c 
b/drivers/staging/intel_sst/intelmid_v2_control.c
index 9cfcb52..6f234a7 100644
--- a/drivers/staging/intel_sst/intelmid_v2_control.c
+++ b/drivers/staging/intel_sst/intelmid_v2_control.c
@@ -25,7 +25,7 @@
  *
  *  This file contains the control operations of vendor 3
  */
-
+#include <linux/gpio.h>
 #include <linux/pci.h>
 #include <linux/file.h>
 #include <sound/control.h>
@@ -163,6 +163,7 @@ static int nc_power_up_pb(unsigned int port)
 {
        struct sc_reg_access sc_access[7];
        int retval = 0;
+       int not_hp;
 
        if (snd_pmic_ops_nc.card_status == SND_CARD_UN_INIT)
                retval = nc_init_card();
@@ -170,6 +171,7 @@ static int nc_power_up_pb(unsigned int port)
                return retval;
        if (port == 0xFF)
                return 0;
+       not_hp = (snd_pmic_ops_nc.output_dev_id == MONO_EARPIECE || 
snd_pmic_ops_nc.output_dev_id == INTERNAL_SPKR);
        nc_enable_audiodac(MUTE);
        msleep(30);
 
@@ -209,7 +211,12 @@ static int nc_power_up_pb(unsigned int port)
        sst_sc_reg_access(sc_access, PMIC_READ_MODIFY, 3);
 
        msleep(30);
-
+       /* There is a mismatch between Playback Sources and the enumerated 
values of output sources.
+        * This mismatch causes ALSA upper to send Item 1 for Internal Speaker, 
but the expected enumeration is 2!
+        * For now, treat MONO_EARPIECE and INTERNAL_SPKR identically and power 
up the needed resources
+        */
+       if (not_hp)
+               gpio_set_value(64+16+2, 1);
        return nc_enable_audiodac(UNMUTE);
 
 }
@@ -270,17 +277,26 @@ static int nc_power_down(void)
 {
        int retval = 0;
        struct sc_reg_access sc_access[5];
+       int not_hp;
 
 
        if (snd_pmic_ops_nc.card_status == SND_CARD_UN_INIT)
                retval = nc_init_card();
        if (retval)
                return retval;
+       not_hp = (snd_pmic_ops_nc.output_dev_id == MONO_EARPIECE || 
snd_pmic_ops_nc.output_dev_id == INTERNAL_SPKR);
        nc_enable_audiodac(MUTE);
 
 
        pr_debug("sst: powering dn nc_power_down ....\n");
-
+       /* There is a mismatch between Playback Sources and the enumerated 
values of output sources.
+        * This mismatch causes ALSA upper to send Item 1 for Internal Speaker, 
but the expected enumeration is 2!
+        * For now, treat MONO_EARPIECE and INTERNAL_SPKR identically and power 
down the resources
+        */
+       if (not_hp) {
+               msleep(30);
+               gpio_set_value(64+16+2, 0);
+       }
        msleep(30);
 
        sc_access[0].reg_addr = DRVPOWERCTRL;
@@ -516,9 +532,18 @@ static int nc_set_selected_output_dev(u8 value)
        switch (value) {
        case STEREO_HEADPHONE:
                retval = sst_sc_reg_access(sc_access_HP, PMIC_WRITE, 2);
+               /* power off the internal speaker */
+               gpio_set_value(64+16+2, 0);
                break;
+       /* There is a mismatch between Playback Sources and the enumerated 
values of output sources.
+        * This mismatch causes ALSA upper to send Item 1 for Internal Speaker, 
but the expected enumeration is 2!
+        * For now, treat MONO_EARPIECE and INTERNAL_SPKR identically
+        */
+       case MONO_EARPIECE:
        case INTERNAL_SPKR:
                retval = sst_sc_reg_access(sc_access_IS, PMIC_WRITE, 2);
+               /* power on the internal speaker */
+               gpio_set_value(64+16+2, 1);
                break;
        default:
                pr_err("sst: rcvd illegal request: %d\n", value);
-- 
1.7.2.3

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to