From patchwork Thu Nov 19 08:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 7655931 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A5DC9F2E2 for ; Thu, 19 Nov 2015 08:40:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A3FB203C3 for ; Thu, 19 Nov 2015 08:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 142F12009C for ; Thu, 19 Nov 2015 08:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757110AbbKSIkn (ORCPT ); Thu, 19 Nov 2015 03:40:43 -0500 Received: from lists.s-osg.org ([54.187.51.154]:34033 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755529AbbKSIkm (ORCPT ); Thu, 19 Nov 2015 03:40:42 -0500 Received: from recife.lan (unknown [179.179.53.250]) by lists.s-osg.org (Postfix) with ESMTPSA id 4F841462B3; Thu, 19 Nov 2015 00:40:41 -0800 (PST) Date: Thu, 19 Nov 2015 06:40:37 -0200 From: Mauro Carvalho Chehab To: Antti Palosaari Cc: LMML Subject: Fw: [PATCH] [media] tda10023: fix wrong register assignment Message-ID: <20151119064037.5de24284@recife.lan> Organization: Samsung X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-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-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Antti, Could you please review this patch? Thanks! Mauro Forwarded message: Date: Tue, 8 Sep 2015 09:43:04 +0200 From: Manuel Kampert To: linux-media@vger.kernel.org Subject: [PATCH] [media] tda10023: fix wrong register assignment Register INTP1 (0x12) Bit POCLKP (bit 0) sets the output clock polarity of tda10023 . However, the driver tries to set the parallel output mode in this register which is not correct. Parallel output mode is set on register INTP2 (0x20) INTPSEL (bit 1/0) . Drivers affected by this patch are the anysee devices. Signed-off-by: Manuel Kampert --- @@ -781,6 +779,11 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) adap->fe[0] = dvb_attach(tda10023_attach, &anysee_tda10023_config, &d->i2c_adap, 0x48); + /* output clock polarity */ + ret = anysee_write_reg(d, 0x12, 0xa0); + if (ret) + goto error; + break; case ANYSEE_HW_507SI: /* 11 */ /* E30 S2 Plus */ @@ -846,6 +849,11 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) adap->fe[0] = dvb_attach(tda10023_attach, &anysee_tda10023_config, &d->i2c_adap, 0x48); + + /* output clock polarity */ + ret = anysee_write_reg(d, 0x12, 0xa0); + if (ret) + goto error; } /* break out if first frontend attaching fails */ -- 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 -- 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 diff --git a/drivers/media/dvb-frontends/tda10023.c b/drivers/media/dvb-frontends/tda10023.c --- a/drivers/media/dvb-frontends/tda10023.c +++ b/drivers/media/dvb-frontends/tda10023.c @@ -269,10 +269,9 @@ static int tda10023_init (struct dvb_frontend *fe) /* 084 */ 0x02, 0xff, 0x93, /* AGCCONF1 IFS=1 KAGCIF=2 KAGCTUN=3 */ /* 087 */ 0x2d, 0xff, 0xf6, /* SWEEP SWPOS=1 SWDYN=7 SWSTEP=1 SWLEN=2 */ /* 090 */ 0x04, 0x10, 0x00, /* SWRAMP=1 */ -/* 093 */ 0x12, 0xff, TDA10023_OUTPUT_MODE_PARALLEL_B, /* - INTP1 POCLKP=1 FEL=1 MFS=0 */ +/* 093 */ 0x12, 0xff, 0xa1, /* POCLKP=1 */ /* 096 */ 0x2b, 0x01, 0xa1, /* INTS1 */ -/* 099 */ 0x20, 0xff, 0x04, /* INTP2 SWAPP=? MSBFIRSTP=? INTPSEL=? */ +/* 099 */ 0x20, 0xff, TDA10023_OUTPUT_MODE_PARALLEL_B, /* INTPSEL=? */ /* 102 */ 0x2c, 0xff, 0x0d, /* INTP/S TRIP=0 TRIS=0 */ /* 105 */ 0xc4, 0xff, 0x00, /* 108 */ 0xc3, 0x30, 0x00, @@ -291,7 +290,7 @@ static int tda10023_init (struct dvb_frontend *fe) } if (state->config->output_mode) - tda10023_inittab[95] = state->config->output_mode; + tda10023_inittab[101] = state->config->output_mode; tda10023_writetab(state, tda10023_inittab); diff --git a/drivers/media/dvb-frontends/tda1002x.h b/drivers/media/dvb-frontends/tda1002x.h index 0d33461..dc7258f 100644 --- a/drivers/media/dvb-frontends/tda1002x.h +++ b/drivers/media/dvb-frontends/tda1002x.h @@ -33,9 +33,9 @@ struct tda1002x_config { }; enum tda10023_output_mode { - TDA10023_OUTPUT_MODE_PARALLEL_A = 0xe0, - TDA10023_OUTPUT_MODE_PARALLEL_B = 0xa1, - TDA10023_OUTPUT_MODE_PARALLEL_C = 0xa0, + TDA10023_OUTPUT_MODE_PARALLEL_A = 0x04, + TDA10023_OUTPUT_MODE_PARALLEL_B = 0x05, + TDA10023_OUTPUT_MODE_PARALLEL_C = 0x06, TDA10023_OUTPUT_MODE_SERIAL, /* TODO: not implemented */ }; diff --git a/drivers/media/usb/dvb-usb-v2/anysee.c b/drivers/media/usb/dvb-usb-v2/anysee.c index ae917c0..698a1d2 100644 --- a/drivers/media/usb/dvb-usb-v2/anysee.c +++ b/drivers/media/usb/dvb-usb-v2/anysee.c @@ -291,7 +291,6 @@ static struct tda10023_config anysee_tda10023_config = { .pll_m = 11, .pll_p = 3, .pll_n = 1, - .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_C, .deltaf = 0xfeeb, }; @@ -327,7 +326,6 @@ static struct tda10023_config anysee_tda10023_tda18212_config = { .pll_m = 12, .pll_p = 3, .pll_n = 1, - .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_B, .deltaf = 0xba02, };