Re: [PATCH] thinkpad-acpi: fix return value of volume callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 22 Feb 2010, Clemens Ladisch wrote:
> Fix up the volume status setting functions to return a non-zero value if
> the control value has changed, so that the ALSA framework can correctly
> generate control change notifications.

Please explain...

> 
> Signed-off-by: Clemens Ladisch <clemens@xxxxxxxxxx>
> 
> --- linux/drivers/platform/x86/thinkpad_acpi.c
> +++ linux/drivers/platform/x86/thinkpad_acpi.c
> @@ -6537,8 +6537,11 @@ static int volume_set_mute_ec(const bool
>  	n = (mute) ? s | TP_EC_AUDIO_MUTESW_MSK :
>  		     s & ~TP_EC_AUDIO_MUTESW_MSK;
>  
> -	if (n != s)
> +	if (n != s) {
>  		rc = volume_set_status_ec(n);
> +		if (!rc)
> +			rc = 1;
> +	}
>  
>  unlock:
>  	mutex_unlock(&volume_mutex);
> @@ -6569,8 +6572,11 @@ static int volume_set_volume_ec(const u8
>  
>  	n = (s & ~TP_EC_AUDIO_LVL_MSK) | vol;
>  
> -	if (n != s)
> +	if (n != s) {
>  		rc = volume_set_status_ec(n);
> +		if (!rc)
> +			rc = 1;
> +	}
>  
>  unlock:
>  	mutex_unlock(&volume_mutex);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux