From patchwork Fri May 3 05:50:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 18287 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UY8rq-0006UW-5e; Fri, 03 May 2013 07:49:14 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1UY8ro-0006qf-3J; Fri, 03 May 2013 07:49:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761730Ab3ECFtJ (ORCPT + 1 other); Fri, 3 May 2013 01:49:09 -0400 Received: from mail-ea0-f178.google.com ([209.85.215.178]:37972 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758751Ab3ECFtI (ORCPT ); Fri, 3 May 2013 01:49:08 -0400 Received: by mail-ea0-f178.google.com with SMTP id m14so594179eaj.37 for ; Thu, 02 May 2013 22:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding; bh=N0O8jo3+d0Okc32zDGwhs5/4GWbUjgIo04sGhgeFE1U=; b=sjf/8gsWgh1RN+1k+M74yeNBHNwlbD25pEykh+y092Ho4lU5lX/fNDFnFS266q4UDp 3/T8+pBthxAj7PQvYM7BBEx5TdgLi3GWtEslIScDvYVtLsQmBtZ1VGvCzVILvM6GbGAz yju7z/1LwC6Q85zjqadk3+Rli9iE21ycoFParL14yhmLLv2bDbyOu3oHQLCuDtGtZ7DH TYlcJWeksNVn6R5+VYclzs8m9FTiFjgCDamMPmdkGjIsk32cpq6WmACLSq4iYwWQnOLO crl5lXlX/eTqgtIVrcxMyfcTcfBhTs6fkmvf0zA5HsZz2N/TaEuR+F60G/OWDCnzbZD5 C0eA== X-Received: by 10.14.111.129 with SMTP id w1mr24310270eeg.13.1367560147619; Thu, 02 May 2013 22:49:07 -0700 (PDT) Received: from vostro ([83.145.235.199]) by mx.google.com with ESMTPSA id e50sm13594913eev.13.2013.05.02.22.49.06 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 02 May 2013 22:49:07 -0700 (PDT) Date: Fri, 3 May 2013 08:50:25 +0300 From: Timo Teras To: Timo Teras Cc: Frank =?ISO-8859-1?Q?Sch=E4fer?= , Mauro Carvalho Chehab , Linux Media Mailing List Subject: Re: Terratec Grabby hwrev 2 Message-ID: <20130503085025.0a989c42@vostro> In-Reply-To: <20130429152618.6795bae7@vostro> References: <20130325190846.3250fe98@vostro> <20130325143647.3da1360f@redhat.com> <20130325194820.7c122834@vostro> <20130325153220.3e6dbfe5@redhat.com> <20130325211238.7c325d5e@vostro> <20130326102056.63b55916@vostro> <20130327161049.683483f8@vostro> <20130328105201.7bcc7388@vostro> <20130328094052.26b7f3f5@redhat.com> <20130328153556.0b58d1aa@vostro> <20130328122252.19769614@redhat.com> <20130330115455.56c34b5f@vostro> <5159C35D.7080901@googlemail.com> <20130402084305.0f623e6e@vostro> <515B09BD.2040104@googlemail.com> <20130403112750.0bc79874@vostro> <515EEEB3.2080100@googlemail.com> <20130429152618.6795bae7@vostro> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.17; i686-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.5.3.54216 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, FROM_SAME_AS_TO 0.05, HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, INVALID_MSGID_NO_FQDN 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __DATE_TZ_RU 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_SAME_AS_FROM2 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' On Mon, 29 Apr 2013 15:26:18 +0300 Timo Teras wrote: > > > When comparing these two picture, you see that the frame is offset > > > with one or two pixels in x-direction. Perhaps this is a byte > > > offset, and in RGB format causes color values to be connected to > > > wrong pixel. > > > > > > As final note, now I hooked the device on faster machine, and the > > > AC97 detection seems random. It seemed to work with the slower > > > machine reliably after I had it do the saa7113 initialization. So > > > sounds like some sort of timing issue. > > > > More details please. ;) > > Do you mean that "Config register raw data" (see dmesg output) value > > varies ? > > I traced the USB init sequence that windows does. It is as follows > (simplified by removing some other register / eeprom reads): > em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); > msleep(20); > em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); > msleep(100); > em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); > msleep(60); > em28xx_write_reg(dev, EM28XX_R12_VINENABLE, 0x24); > em28xx_write_reg(dev, 0x0d, 0x42); > > Will test if it makes the detection of the audio chip more reliable. The patch added is below. Seems that detecting the audio chip is now a lot more reliable. So far I have not seen failures. Not sure if the GPIO twidling drives something - or if it's just the additional delay fixing things. --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -2479,6 +2479,19 @@ em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); msleep(70); break; + + case EM2860_BOARD_TERRATEC_GRABBY: + em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff); + msleep(20); + em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); + msleep(100); + em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); + msleep(100); + em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); + msleep(60); + em28xx_write_reg(dev, EM28XX_R12_VINENABLE, 0x24); + em28xx_write_reg(dev, 0x0d, 0x42); + break; } em28xx_gpio_set(dev, dev->board.tuner_gpio);