From patchwork Sun Mar 15 22:57:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 28786 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YXHU9-00082Y-Iu; Sun, 15 Mar 2015 23:58:17 +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.72/mailfrontend-5) with esmtp id 1YXHU7-0006mj-8P; Sun, 15 Mar 2015 23:58:17 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbbCOW6K (ORCPT + 1 other); Sun, 15 Mar 2015 18:58:10 -0400 Received: from smtp.bredband2.com ([83.219.192.166]:56462 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbbCOW6E (ORCPT ); Sun, 15 Mar 2015 18:58:04 -0400 Received: from localhost.localdomain (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id B454911F634; Sun, 15 Mar 2015 23:57:56 +0100 (CET) From: Benjamin Larsson To: crope@iki.fi, mchehab@osg.samsung.com Cc: Linux Media Mailing List Subject: [PATCH 04/10] rtl28xxu: swap frontend order for slave demods Date: Sun, 15 Mar 2015 23:57:49 +0100 Message-Id: <1426460275-3766-4-git-send-email-benjamin@southpole.se> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426460275-3766-1-git-send-email-benjamin@southpole.se> References: <1426460275-3766-1-git-send-email-benjamin@southpole.se> 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: 2015.3.15.224819 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Some devices have 2 demodulators, when this is the case make the slave demod be listed first. Enumerating the slave first will help legacy applications to use the hardware. Signed-off-by: Benjamin Larsson --- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c index ea75b3a..bb5003d 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c @@ -853,6 +853,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) if (dev->slave_demod) { struct i2c_board_info info = {}; + struct dvb_frontend *tmp_fe; /* * We continue on reduced mode, without DVB-T2/C, using master @@ -907,6 +908,11 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) dev->i2c_client_slave_demod = client; } + + /* Swap frontend order */ + tmp_fe = adap->fe[0]; + adap->fe[0] = adap->fe[1]; + adap->fe[1] = tmp_fe; } return 0; @@ -1134,12 +1140,6 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) adap->fe[0]->ops.tuner_ops.get_rf_strength; break; case TUNER_RTL2832_R828D: - fe = dvb_attach(r820t_attach, adap->fe[0], - dev->demod_i2c_adapter, - &rtl2832u_r828d_config); - adap->fe[0]->ops.read_signal_strength = - adap->fe[0]->ops.tuner_ops.get_rf_strength; - if (adap->fe[1]) { fe = dvb_attach(r820t_attach, adap->fe[1], dev->demod_i2c_adapter, @@ -1147,6 +1147,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) adap->fe[1]->ops.read_signal_strength = adap->fe[1]->ops.tuner_ops.get_rf_strength; } + + fe = dvb_attach(r820t_attach, adap->fe[0], + dev->demod_i2c_adapter, + &rtl2832u_r828d_config); + adap->fe[0]->ops.read_signal_strength = + adap->fe[0]->ops.tuner_ops.get_rf_strength; break; default: dev_err(&d->intf->dev, "unknown tuner %d\n", dev->tuner);