From patchwork Sun Apr 25 15:27:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Barth X-Patchwork-Id: 94960 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3PFRb4o013113 for ; Sun, 25 Apr 2010 15:27:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752778Ab0DYP1f (ORCPT ); Sun, 25 Apr 2010 11:27:35 -0400 Received: from fg-out-1718.google.com ([72.14.220.152]:11017 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384Ab0DYP1e (ORCPT ); Sun, 25 Apr 2010 11:27:34 -0400 Received: by fg-out-1718.google.com with SMTP id d23so1997403fga.1 for ; Sun, 25 Apr 2010 08:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=7LD3D52ssQLVdGYv2nD/7EeaPZCxJFIDUDUrF/GSkK4=; b=qE530rnLuwizObLr4fczkGcFFgLv6sPyJDNytxUTrc8Pw2tf4iBee2bojoiP4mFi0b rxDh4dp3z8xqi8xk7ysusPb+CV8+G2mUub1r/wWDJhjyrRY/BAS7vHHBTBhdVDUKgBLf SU68dBcVZremzts8dRmKahFDVz3Ggyk8gGR5A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=ruoagh4E5d+lOgFwnsPd/1OjkXWsWcf+KkXOo8DZhFn+Fzj3nb0/QLiVJLfIx0P02z 9ViJzXoQxakUxUUWudGKZalAZY4sKMYl3PKawlKcNX5V8LPArBx5Bw8o5Z4qWvmeofZ+ HsRhjds19ND8z5lIIH6pOOI9ocS5E7cWYZNrw= Received: by 10.87.40.31 with SMTP id s31mr4862252fgj.60.1272209252671; Sun, 25 Apr 2010 08:27:32 -0700 (PDT) Received: from [192.168.53.101] (p3E9E7992.dip.t-dialin.net [62.158.121.146]) by mx.google.com with ESMTPS id 12sm2886539fgg.9.2010.04.25.08.27.30 (version=SSLv3 cipher=RC4-MD5); Sun, 25 Apr 2010 08:27:32 -0700 (PDT) Message-ID: <4BD45F61.50904@googlemail.com> Date: Sun, 25 Apr 2010 17:27:29 +0200 From: Sven Barth User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Shredder/3.0.3 MIME-Version: 1.0 To: Andy Walls CC: Mike Isely , linux-media@vger.kernel.org Subject: Re: Problem with cx25840 and Terratec Grabster AV400 References: <4BD2EACA.5040005@googlemail.com> <4BD34E5A.40507@googlemail.com> <4BD35AA3.7070003@googlemail.com> <1272157158.7341.56.camel@palomino.walls.org> In-Reply-To: <1272157158.7341.56.camel@palomino.walls.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 25 Apr 2010 15:27:38 +0000 (UTC) diff -aur v4l-src/linux/drivers/media/video/cx25840//cx25840-audio.c v4l-build/linux/drivers/media/video/cx25840//cx25840-audio.c --- v4l-src/linux/drivers/media/video/cx25840//cx25840-audio.c 2009-10-18 21:08:26.497700904 +0200 +++ v4l-build/linux/drivers/media/video/cx25840//cx25840-audio.c 2010-04-25 17:16:00.205619872 +0200 @@ -438,41 +438,45 @@ { struct cx25840_state *state = to_state(i2c_get_clientdata(client)); - /* assert soft reset */ - cx25840_and_or(client, 0x810, ~0x1, 0x01); - - /* stop microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0); - - /* Mute everything to prevent the PFFT! */ - cx25840_write(client, 0x8d3, 0x1f); - - if (state->aud_input == CX25840_AUDIO_SERIAL) { - /* Set Path1 to Serial Audio Input */ - cx25840_write4(client, 0x8d0, 0x01011012); - - /* The microcontroller should not be started for the - * non-tuner inputs: autodetection is specific for - * TV audio. */ - } else { - /* Set Path1 to Analog Demod Main Channel */ - cx25840_write4(client, 0x8d0, 0x1f063870); - } + if (!is_cx2583x(state)) { + /* assert soft reset */ + cx25840_and_or(client, 0x810, ~0x1, 0x01); + + /* stop microcontroller */ + cx25840_and_or(client, 0x803, ~0x10, 0); + + /* Mute everything to prevent the PFFT! */ + cx25840_write(client, 0x8d3, 0x1f); + + if (state->aud_input == CX25840_AUDIO_SERIAL) { + /* Set Path1 to Serial Audio Input */ + cx25840_write4(client, 0x8d0, 0x01011012); + + /* The microcontroller should not be started for the + * non-tuner inputs: autodetection is specific for + * TV audio. */ + } else { + /* Set Path1 to Analog Demod Main Channel */ + cx25840_write4(client, 0x8d0, 0x1f063870); + } + } set_audclk_freq(client, state->audclk_freq); - if (state->aud_input != CX25840_AUDIO_SERIAL) { - /* When the microcontroller detects the - * audio format, it will unmute the lines */ - cx25840_and_or(client, 0x803, ~0x10, 0x10); - } - - /* deassert soft reset */ - cx25840_and_or(client, 0x810, ~0x1, 0x00); - - /* Ensure the controller is running when we exit */ - if (is_cx2388x(state) || is_cx231xx(state)) - cx25840_and_or(client, 0x803, ~0x10, 0x10); + if (!is_cx2583x(state)) { + if (state->aud_input != CX25840_AUDIO_SERIAL) { + /* When the microcontroller detects the + * audio format, it will unmute the lines */ + cx25840_and_or(client, 0x803, ~0x10, 0x10); + } + + /* deassert soft reset */ + cx25840_and_or(client, 0x810, ~0x1, 0x00); + + /* Ensure the controller is running when we exit */ + if (is_cx2388x(state) || is_cx231xx(state)) + cx25840_and_or(client, 0x803, ~0x10, 0x10); + } } static int get_volume(struct i2c_client *client) Nur in v4l-build/linux/drivers/media/video/cx25840/: cx25840-audio.c.bak. diff -aur v4l-src/linux/drivers/media/video/cx25840//cx25840-core.c v4l-build/linux/drivers/media/video/cx25840//cx25840-core.c --- v4l-src/linux/drivers/media/video/cx25840//cx25840-core.c 2010-04-24 10:48:56.392367351 +0200 +++ v4l-build/linux/drivers/media/video/cx25840//cx25840-core.c 2010-04-25 17:12:37.448983292 +0200 @@ -691,6 +691,11 @@ } cx25840_and_or(client, 0x401, ~0x60, 0); cx25840_and_or(client, 0x401, ~0x60, 0x60); + + /* Don't write into audio registers on cx2583x chips */ + if (is_cx2583x(state)) + return; + cx25840_and_or(client, 0x810, ~0x01, 1); if (state->radio) { @@ -704,8 +709,7 @@ To be precise: it affects cards with tuner models 85, 99 and 112 (model numbers from tveeprom). */ int hw_fix = state->pvr150_workaround; - - if (std == V4L2_STD_NTSC_M_JP) { + if (std == V4L2_STD_NTSC_M_JP) { /* Japan uses EIAJ audio standard */ cx25840_write(client, 0x808, hw_fix ? 0x2f : 0xf7); } else if (std == V4L2_STD_NTSC_M_KR) { @@ -742,7 +746,6 @@ cx25840_write(client, 0x80b, 0x10); } } - cx25840_and_or(client, 0x810, ~0x01, 0); } @@ -849,10 +852,8 @@ state->vid_input = vid_input; state->aud_input = aud_input; - if (!is_cx2583x(state)) { - cx25840_audio_set_path(client); - input_change(client); - } + cx25840_audio_set_path(client); + input_change(client); if (is_cx2388x(state)) { /* Audio channel 1 src : Parallel 1 */ @@ -1504,8 +1505,6 @@ struct cx25840_state *state = to_state(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (is_cx2583x(state)) - return -EINVAL; return set_input(client, state->vid_input, input); } @@ -1514,8 +1513,7 @@ struct cx25840_state *state = to_state(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (!is_cx2583x(state)) - input_change(client); + input_change(client); return 0; }