From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] Mixer quirk for QuickCam E 3500 Date: Wed, 22 Jul 2009 00:01:46 +0200 Message-ID: References: <1248210642-5054-1-git-send-email-bug-track@fisher-privat.net> <4A6639DA.6020500@fisher-privat.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 81FB0103845 for ; Wed, 22 Jul 2009 00:01:47 +0200 (CEST) In-Reply-To: <4A6639DA.6020500@fisher-privat.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Alexey Fisher Cc: alsa-devel@alsa-project.org, clemens@ladisch.de List-Id: alsa-devel@alsa-project.org At Tue, 21 Jul 2009 23:57:46 +0200, Alexey Fisher wrote: > > Takashi Iwai schrieb: > > At Tue, 21 Jul 2009 23:10:42 +0200, > > Alexey Fisher wrote: > >> 1. E3500 report cval->max more than it actually can handel, so if you > >> set 95% capture level it will be muted. > >> 2. betwen cval->min and cval-max(real) is 2940 control units, > >> but real are only 7. > >> 3. we found only 7 real control units, with cval->res = 384, > >> but alsa can't handel less than 10 controls, so make it more > >> and set cval->res = 192. > >> > >> Signed-off-by: Alexey Fisher > > > > Thanks for the patch. The added code looks almost good. > > But, it's better to put your code into another place, e.g. a bit > > later so that you don't insert it between the comment and the other > > code. Also, if you use switch(), you need break. > > > > In your case, simply put a new if () block with a proper comment > > after that switch() block. It's not necessarily merged into a single > > switch. The compiler should be clever enough. > > > > Also, try to keep the patch checkpatch.pl-clean. Run it once before > > submitting your patch. > > > > Could you fix these and repost? > > > > > > thanks, > > > > Takashi > > > >> --- > >> sound/usb/usbmixer.c | 7 +++++++ > >> 1 files changed, 7 insertions(+), 0 deletions(-) > >> > >> diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c > >> index 4bd3a7a..72562ee 100644 > >> --- a/sound/usb/usbmixer.c > >> +++ b/sound/usb/usbmixer.c > >> @@ -995,6 +995,13 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, > >> /* is not very clear from datasheets */ > >> /* I hope that the min value is -15360 for newer firmware --jk */ > >> switch (state->chip->usb_id) { > >> + case USB_ID(0x046d, 0x09a4): > >> + if (!strcmp(kctl->id.name, "Mic Capture Volume")) { > >> + snd_printk(KERN_INFO "using volume control quirk for the QuickCam E3500\n"); > >> + cval->min = 6080; > >> + cval->max = 8768; > >> + cval->res = 192; > >> + } > >> case USB_ID(0x0471, 0x0101): > >> case USB_ID(0x0471, 0x0104): > >> case USB_ID(0x0471, 0x0105): > > There is some thing wrong with this. After suspend and resume this quirk > not working. Even replug the cam not help, only reloading of > snd_usb_sound will do it work again. But isn't it irrelevant with your patch? Takashi