From patchwork Fri May 31 18:19:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Love X-Patchwork-Id: 10970641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30A8292A for ; Fri, 31 May 2019 18:20:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1DB28448 for ; Fri, 31 May 2019 18:20:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10B6A28660; Fri, 31 May 2019 18:20:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7891A274D1 for ; Fri, 31 May 2019 18:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbfEaSUP (ORCPT ); Fri, 31 May 2019 14:20:15 -0400 Received: from bonobo.maple.relay.mailchannels.net ([23.83.214.22]:57348 "EHLO bonobo.maple.relay.mailchannels.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbfEaSUO (ORCPT ); Fri, 31 May 2019 14:20:14 -0400 X-Sender-Id: dreamhost|x-authsender|brad@nextdimension.ws Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 679E15E25F1; Fri, 31 May 2019 18:20:13 +0000 (UTC) Received: from pdx1-sub0-mail-a61.g.dreamhost.com (100-96-89-88.trex.outbound.svc.cluster.local [100.96.89.88]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CC01F5E17B2; Fri, 31 May 2019 18:19:57 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|brad@nextdimension.ws Received: from pdx1-sub0-mail-a61.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 31 May 2019 18:20:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|brad@nextdimension.ws X-MailChannels-Auth-Id: dreamhost X-Share-Skirt: 5e18e62e22d9701c_1559326813053_783496373 X-MC-Loop-Signature: 1559326813053:1014605199 X-MC-Ingress-Time: 1559326813052 Received: from pdx1-sub0-mail-a61.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTP id A602E80199; Fri, 31 May 2019 11:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nextdimension.cc; h=from :to:cc:subject:date:message-id:in-reply-to:references; s= nextdimension.cc; bh=CSY5wJWDkyJ6nh8Ifs43M72cEHg=; b=Pad9bjOY0Pr 6psoEIeFuxlzfpoiIZrQD0Djx6gkotVFtaZpka9dFrgsZCxeHtoPFLvuKrG6opqD yi3qi6OjYg/bzvF1t3hVW94KDEua4BGi7unO2X7Fg/Y6yXUvY5C1K9bIPlSlelN7 O83dWrhYGxbtVzCX31qCJb3y7Hg1dXnE= Received: from localhost.localdomain (67-198-57-188.static.grandenetworks.net [67.198.57.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad@nextdimension.ws) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTPSA id ECDDA80196; Fri, 31 May 2019 11:19:51 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a61 From: Brad Love To: linux-media@vger.kernel.org, mchehab@kernel.org, sean@mess.org Cc: Brad Love Subject: [PATCH v6 3/4] pvrusb2: Add i2c client demod/tuner support Date: Fri, 31 May 2019 13:19:44 -0500 Message-Id: <1559326785-26574-4-git-send-email-brad@nextdimension.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559326785-26574-1-git-send-email-brad@nextdimension.cc> References: <1559326785-26574-1-git-send-email-brad@nextdimension.cc> X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 30 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudefuddguddviecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdeftddmnecujfgurhephffvufffkffojghfsedttdertdertddtnecuhfhrohhmpeeurhgrugcunfhovhgvuceosghrrggusehnvgigthguihhmvghnshhiohhnrdgttgeqnecukfhppeeijedrudelkedrheejrddukeeknecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepieejrdduleekrdehjedrudekkedprhgvthhurhhnqdhprghthhepuehrrgguucfnohhvvgcuoegsrhgrugesnhgvgihtughimhgvnhhsihhonhdrtggtqedpmhgrihhlfhhrohhmpegsrhgrugesnhgvgihtughimhgvnhhsihhonhdrtggtpdhnrhgtphhtthhopegsrhgrugesnhgvgihtughimhgvnhhsihhonhdrtggtnecuvehluhhsthgvrhfuihiivgephe Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i2c client device is the "new" method to attach to dvb modules, include support for this functionality. Cleanup code has been added to init in case of failure, as well as to frontend exit. Required by Hauppauge HVR-1975 Signed-off-by: Brad Love --- Since v5: - no changes Since v4: - commit message expansion drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 11 +++++++++++ drivers/media/usb/pvrusb2/pvrusb2-dvb.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c index f302f1e..7f5df5c 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c @@ -404,6 +404,9 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) fail_frontend0: dvb_frontend_detach(adap->fe[0]); adap->fe[0] = NULL; + dvb_module_release(adap->i2c_client_tuner); + dvb_module_release(adap->i2c_client_demod[1]); + dvb_module_release(adap->i2c_client_demod[0]); return ret; } @@ -420,6 +423,14 @@ static int pvr2_dvb_frontend_exit(struct pvr2_dvb_adapter *adap) dvb_frontend_detach(adap->fe[0]); adap->fe[0] = NULL; } + + dvb_module_release(adap->i2c_client_tuner); + adap->i2c_client_tuner = NULL; + dvb_module_release(adap->i2c_client_demod[1]); + adap->i2c_client_demod[1] = NULL; + dvb_module_release(adap->i2c_client_demod[0]); + adap->i2c_client_demod[0] = NULL; + return 0; } diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.h b/drivers/media/usb/pvrusb2/pvrusb2-dvb.h index 91bff57..c0b27f5 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.h +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.h @@ -20,6 +20,9 @@ struct pvr2_dvb_adapter { struct dvb_net dvb_net; struct dvb_frontend *fe[2]; + struct i2c_client *i2c_client_demod[2]; + struct i2c_client *i2c_client_tuner; + int feedcount; int max_feed_count;