Hi Alan,

This patch can be cleanly applied to your tree.

--guanqun

On Thu, Mar 24, 2011 at 10:37:14PM +0800, Lu, Guanqun wrote:
> patch 1:
> 
>       add SPKR on
> 
>       To add SPKR on for MM.
> 
>       Signed-off-by: Jeff Cheng <jeff_ch...@wistron.com>
> 
> 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" <vinod.k...@intel.com>
>       CC: "Kp, Jeeja" <jeeja...@intel.com>
>       Signed-off-by: Lu Guanqun <guanqun...@intel.com>
>       Signed-off-by: Wang Xingchao <xingchao.w...@intel.com>
> ---
>  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
MeeGo-kernel@lists.meego.com
http://lists.meego.com/listinfo/meego-kernel

Reply via email to