Received: from eggs.gnu.org ([208.118.235.92]:35168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7UGW-0007Rj-Dc for qemu-devel@nongnu.org; Tue, 13 Mar 2012 12:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7UGQ-00057k-3B for qemu-devel@nongnu.org; Tue, 13 Mar 2012 12:07:59 -0400 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:54522 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7UGP-00057R-Rp for qemu-devel@nongnu.org; Tue, 13 Mar 2012 12:07:54 -0400 Date: Tue, 13 Mar 2012 20:07:49 +0400 (MSK) From: malc In-Reply-To: Message-ID: References: <1331652059-10090-1-git-send-email-marcandre.lureau@redhat.com> <1331652059-10090-6-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="33734824-1752463874-1331654745=:4347" Content-ID: Subject: Re: [Qemu-devel] [PATCH v4 05/11] hw/ac97: add support for volume control List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Marc-Andr=E9_Lureau?= Cc: =?ISO-8859-15?Q?Marc-Andr=E9_Lureau?= , dnb@redhat.com, dlaor@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --33734824-1752463874-1331654745=:4347 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Tue, 13 Mar 2012, Marc-Andr? Lureau wrote: > On Tue, Mar 13, 2012 at 4:37 PM, malc wrote: > > On Tue, 13 Mar 2012, Marc-Andr? Lureau wrote: > > > >> Combine output volume with Master and PCM registers values. > >> Use default values in mixer_reset (). > >> Set volume on post-load to update backend values. > >> > >> v4: > >> - fix some code style > > > > Don't think it fixes anything... > > > >> > >> Signed-off-by: Marc-Andr? Lureau > >> --- > >>  hw/ac97.c |   80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > >>  1 files changed, 80 insertions(+), 0 deletions(-) > >> > >> diff --git a/hw/ac97.c b/hw/ac97.c > >> index f7866ed..f5ae637 100644 > >> --- a/hw/ac97.c > >> +++ b/hw/ac97.c > >> @@ -436,6 +436,64 @@ static void reset_voices (AC97LinkState *s, uint8_t active[LAST_INDEX]) > >>      AUD_set_active_in (s->voice_mc, active[MC_INDEX]); > >>  } > >> > >> +static void get_volume (uint16_t vol, uint16_t mask, int inverse, > >> +                        int *mute, uint8_t *lvol, uint8_t *rvol) > >> +{ > >> +  *mute = (vol >> MUTE_SHIFT) & 1; > >> +  *rvol = (255 * (vol & mask)) / mask; > >> +  *lvol = (255 * ((vol >> 8) & mask)) / mask; > >> +  if (inverse) { > >> +    *rvol = 255 - *rvol; > >> +    *lvol = 255 - *lvol; > > > > Here. > > > > [..snip..] > > checkpatch doesn't complain here, I only get 30 warnings: > > WARNING: space prohibited between function name and open parenthesis '(' > > which seems to be the code style in audio/ > That's right. But the whole get_volume function is indented with 2 instead of 4 spaces. -- mailto:av1474@comtv.ru --33734824-1752463874-1331654745=:4347--