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: 6014191 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 917649F399 for ; Sun, 15 Mar 2015 22:58:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C55B020303 for ; Sun, 15 Mar 2015 22:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6141202FE for ; Sun, 15 Mar 2015 22:58:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbbCOW6K (ORCPT ); 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-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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);