From patchwork Sat Mar 23 17:27:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Schaefer X-Patchwork-Id: 17586 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UJSDE-0000Hn-Fy; Sat, 23 Mar 2013 18:26:36 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1UJSDD-0005Lu-Im; Sat, 23 Mar 2013 18:26:36 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881Ab3CWR0b (ORCPT + 1 other); Sat, 23 Mar 2013 13:26:31 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:43686 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655Ab3CWR0b (ORCPT ); Sat, 23 Mar 2013 13:26:31 -0400 Received: by mail-ee0-f42.google.com with SMTP id b47so2625637eek.15 for ; Sat, 23 Mar 2013 10:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=ncbuM4b4QkJC4BePSXXEVLqSJRvnGtHKhSVnBrU5Yig=; b=DZQLvTYl+WCXlVZ0G4tksLsPyeIY6NWYV+hRC82c26yuQb6N23BZFQ1Uz4XtQLjOQY FDF8x/O/N8Z2TMaxSca3V1mOW8HRF9cvbd+SYgZyWNrBf8S1js0grqMWzUQsP899Q3WS yXM5agdMXWHkSBYUgY0qGUt/XXOsUdVoBRYLYtLLBbQpS3cCXfUBfbrnRTZDFLPE82N0 LowxhkPLioZdx3wsQQQEHv9yPhvjbJALVuukxq9QMix8R2/uBO15ocUW27mur+dqcLfg N2+/pywEadIAZBxFm1BgO/0KvXSMOJOPef8bxNQ2PX8bwC6FkHgifmDsR1bKoe7BgmhD fQ6A== X-Received: by 10.14.219.129 with SMTP id m1mr16199007eep.16.1364059589862; Sat, 23 Mar 2013 10:26:29 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-109-90-247-70.unitymediagroup.de. [109.90.247.70]) by mx.google.com with ESMTPS id f47sm9283468eep.13.2013.03.23.10.26.28 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Mar 2013 10:26:29 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: mchehab@redhat.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH v2 4/5] em28xx: make em28xx_set_outfmt() working with EM25xx family bridges Date: Sat, 23 Mar 2013 18:27:11 +0100 Message-Id: <1364059632-29070-5-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364059632-29070-1-git-send-email-fschaefer.oss@googlemail.com> References: <1364059632-29070-1-git-send-email-fschaefer.oss@googlemail.com> 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: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.23.172118 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 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, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Streaming doesn't work with the EM2765 if bit 5 of the output format register 0x27 is set. It's actually not clear if really has to be set for the other chips, but for now let's keep it to avoid regressions and add a comment to the code. Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-core.c | 20 +++++++++++++++----- 1 Datei geändert, 15 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index b2dcb3d..7b9f76b 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -697,12 +697,22 @@ int em28xx_vbi_supported(struct em28xx *dev) int em28xx_set_outfmt(struct em28xx *dev) { int ret; - u8 vinctrl; - - ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT, - dev->format->reg | 0x20, 0xff); + u8 fmt, vinctrl; + + fmt = dev->format->reg; + if (!dev->is_em25xx) + fmt |= 0x20; + /* NOTE: it's not clear if this is really needed ! + * The datasheets say bit 5 is a reserved bit and devices seem to work + * fine without it. But the Windows driver sets it for em2710/50+em28xx + * devices and we've always been setting it, too. + * + * em2765 (em25xx, em276x/7x/8x ?) devices do NOT work with this bit set, + * it's likely used for an additional (compressed ?) format there. + */ + ret = em28xx_write_reg(dev, EM28XX_R27_OUTFMT, fmt); if (ret < 0) - return ret; + return ret; ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode); if (ret < 0)