From patchwork Tue Jul 22 20:12:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 4605541 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 AE758C0514 for ; Tue, 22 Jul 2014 20:12:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DECEA2015A for ; Tue, 22 Jul 2014 20:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B84C20155 for ; Tue, 22 Jul 2014 20:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756669AbaGVUMj (ORCPT ); Tue, 22 Jul 2014 16:12:39 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:43263 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756573AbaGVUMh (ORCPT ); Tue, 22 Jul 2014 16:12:37 -0400 Received: from gauss.fritz.box (host-188-174-204-36.customer.m-online.net [188.174.204.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zzam) by smtp.gentoo.org (Postfix) with ESMTPSA id 01B8B340121; Tue, 22 Jul 2014 20:12:35 +0000 (UTC) From: Matthias Schwarzott To: crope@iki.fi, m.chehab@samsung.com, linux-media@vger.kernel.org Cc: Matthias Schwarzott Subject: [PATCH 4/8] cx231xx: prepare for i2c_client attachment Date: Tue, 22 Jul 2014 22:12:14 +0200 Message-Id: <1406059938-21141-5-git-send-email-zzam@gentoo.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1406059938-21141-1-git-send-email-zzam@gentoo.org> References: <1406059938-21141-1-git-send-email-zzam@gentoo.org> 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, 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 This is needed to support PCTV QuatroStick 522e which uses a si2157. The si2157 driver is written using i2c_client attachment. Signed-off-by: Matthias Schwarzott --- drivers/media/usb/cx231xx/cx231xx-dvb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 4504bc6..5c69be7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -67,6 +67,7 @@ struct cx231xx_dvb { struct dmx_frontend fe_hw; struct dmx_frontend fe_mem; struct dvb_net net; + struct i2c_client *i2c_client_tuner; }; static struct s5h1432_config dvico_s5h1432_config = { @@ -549,11 +550,18 @@ fail_adapter: static void unregister_dvb(struct cx231xx_dvb *dvb) { + struct i2c_client *client; dvb_net_release(&dvb->net); dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem); dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw); dvb_dmxdev_release(&dvb->dmxdev); dvb_dmx_release(&dvb->demux); + client = dvb->i2c_client_tuner; + /* remove I2C tuner */ + if (client) { + module_put(client->dev.driver->owner); + i2c_unregister_device(client); + } dvb_unregister_frontend(dvb->frontend); dvb_frontend_detach(dvb->frontend); dvb_unregister_adapter(&dvb->adapter);