From patchwork Sun Sep 21 10:53:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 4943361 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 461F0BEEA6 for ; Sun, 21 Sep 2014 10:54:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6ADB22020F for ; Sun, 21 Sep 2014 10:54:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F5A62021A for ; Sun, 21 Sep 2014 10:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751194AbaIUKx5 (ORCPT ); Sun, 21 Sep 2014 06:53:57 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:57691 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbaIUKxk (ORCPT ); Sun, 21 Sep 2014 06:53:40 -0400 Received: by mail-lb0-f171.google.com with SMTP id l4so5314850lbv.30 for ; Sun, 21 Sep 2014 03:53:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=UyHIKy8YrAAuEvIzI6wHz0h6Dm+cRg1Un56lpHfoLpE=; b=c5x6pjNbAcUEAIUokYQubrxmaQ7zuywSIuM6qCssZERTy3UO1hmn920PvCJRX/qeLe aTL7tg1DVNSej3w77RzyiBT0MrOJzffo4IGTgrX8phPyllaQrYfSl1XMhpORY3BmQU3m TIPkk0fzoHa54JrUlBKRorYiPUiA/Wi7fjRYYlxTJXpYTzGAIiL5I2yOQohvf5KoJdbD V5vrHZUnE97iflXa5JF0Ro934NFMbsVVlXX2OE7CjESRvVxDaQgmp9ptW9GaHT/EVb5N NPsd00/IEErBV/e1XW0JKKaYQxv+afyEWJXFtr0osEhj/iIA7sz7N1d0eGT+4u3Ro2xc 3FYA== X-Gm-Message-State: ALoCoQlj1Xqhb6RD6bxFbYctcXRu5+9T2S4kyK2VsFqxlRBT1Pv3+Spdi5+kguf6rDZbpZ1EFhjT X-Received: by 10.152.116.7 with SMTP id js7mr19180228lab.12.1411296819043; Sun, 21 Sep 2014 03:53:39 -0700 (PDT) Received: from localhost.localdomain (87-93-145-93.bb.dnainternet.fi. [87.93.145.93]) by mx.google.com with ESMTPSA id zt1sm2535017lbc.31.2014.09.21.03.53.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Sep 2014 03:53:38 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen , crope@iki.fi Subject: [PATCH 2/3] af9035: Add possibility to define which I2C adapter to use Date: Sun, 21 Sep 2014 13:53:18 +0300 Message-Id: <1411296799-3525-3-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411296799-3525-1-git-send-email-olli.salonen@iki.fi> References: <1411296799-3525-1-git-send-email-olli.salonen@iki.fi> 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.7 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 Some I2C tuner drivers require that the I2C device of the tuner is added to the I2C adapter of the demodulator (Si2168+Si2157 for example). Add possibility to tell af9035_add_i2c_dev which I2C adapter should be used. Cc: crope@iki.fi Signed-off-by: Olli Salonen Acked-by: Antti Palosaari Reviewed-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 440ecb4..c50d27d 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -194,12 +194,11 @@ static int af9035_wr_reg_mask(struct dvb_usb_device *d, u32 reg, u8 val, } static int af9035_add_i2c_dev(struct dvb_usb_device *d, char *type, u8 addr, - void *platform_data) + void *platform_data, struct i2c_adapter *adapter) { int ret, num; struct state *state = d_to_priv(d); struct i2c_client *client; - struct i2c_adapter *adapter = &d->i2c_adap; struct i2c_board_info board_info = { .addr = addr, .platform_data = platform_data, @@ -1091,7 +1090,7 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap) state->af9033_config[adap->id].fe = &adap->fe[0]; state->af9033_config[adap->id].ops = &state->ops; ret = af9035_add_i2c_dev(d, "af9033", state->af9033_i2c_addr[adap->id], - &state->af9033_config[adap->id]); + &state->af9033_config[adap->id], &d->i2c_adap); if (ret) goto err; @@ -1382,7 +1381,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap) ret = af9035_add_i2c_dev(d, "it913x", state->af9033_i2c_addr[adap->id] >> 1, - &it913x_config); + &it913x_config, &d->i2c_adap); if (ret) goto err; @@ -1407,7 +1406,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap) ret = af9035_add_i2c_dev(d, "it913x", state->af9033_i2c_addr[adap->id] >> 1, - &it913x_config); + &it913x_config, &d->i2c_adap); if (ret) goto err;