From patchwork Sat Sep 15 20:14:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10601569 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 84F3C14D6 for ; Sat, 15 Sep 2018 20:14:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 757022A62E for ; Sat, 15 Sep 2018 20:14:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E1E12AA12; Sat, 15 Sep 2018 20:14:41 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D725B2A62E for ; Sat, 15 Sep 2018 20:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbeIPBer (ORCPT ); Sat, 15 Sep 2018 21:34:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43368 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727697AbeIPBer (ORCPT ); Sat, 15 Sep 2018 21:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PCuIzXJmdt12PSNq2XMPPCIspCrc4NDXH+LrezRZbkg=; b=UgrojYOpbu6K2YhD/noz1WQHL 9jd3vBUKuA3JQ1COIhJCz/Pm/1lzAEpEahNfyPAArA+ZFXyMHM84F0V1+fp/4nhfBFTmJ3FUiU2AB KdGuElE7HYSC0QI8grTS/FecMTjNKgUyCh6cNpjFGphtXNHHpZVcE65z23Dj2HuCKa2hHRkATRgVQ bTFl29mHrXESll1ONAXNRpa20NaFy6RxJ/7tJaBZMZhBYT3x0qUJjShozJjAOFEXygb5I8uEJslyg PqttB/fVN1eEVBDu26NaGJT8iJD8CkYymr1+yMNEai7ssKy/x0kR7Zy4SDgAkBQp7EL3+a0N3MQol UUN39LlBg==; Received: from [179.95.0.169] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1Gxe-0002P3-J8; Sat, 15 Sep 2018 20:14:35 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1g1Gxc-0008SL-25; Sat, 15 Sep 2018 17:14:32 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Antti Palosaari Subject: [PATCH v2 11/14] media: si2157: declare its own pads Date: Sat, 15 Sep 2018 17:14:26 -0300 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: 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 As we don't need anymore to share pad numbers with similar drivers, use its own pad definition instead of a global model. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/si2157.c | 15 ++++++++------- drivers/media/tuners/si2157_priv.h | 9 ++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 0e39810922fc..d389f1fc237a 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -467,14 +467,15 @@ static int si2157_probe(struct i2c_client *client, dev->ent.name = KBUILD_MODNAME; dev->ent.function = MEDIA_ENT_F_TUNER; - dev->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; - dev->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - dev->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; - dev->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG; - dev->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; - dev->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; - ret = media_entity_pads_init(&dev->ent, TUNER_NUM_PADS, + dev->pad[SI2157_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; + dev->pad[SI2157_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + dev->pad[SI2157_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + dev->pad[SI2157_PAD_VID_OUT].sig_type = PAD_SIGNAL_ANALOG; + dev->pad[SI2157_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; + dev->pad[SI2157_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; + + ret = media_entity_pads_init(&dev->ent, SI2157_NUM_PADS, &dev->pad[0]); if (ret) diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index e6436f74abaa..129a35e4e11b 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -21,6 +21,13 @@ #include #include "si2157.h" +enum si2157_pads { + SI2157_PAD_RF_INPUT, + SI2157_PAD_VID_OUT, + SI2157_PAD_AUD_OUT, + SI2157_NUM_PADS +}; + /* state struct */ struct si2157_dev { struct mutex i2c_mutex; @@ -35,7 +42,7 @@ struct si2157_dev { #if defined(CONFIG_MEDIA_CONTROLLER) struct media_device *mdev; struct media_entity ent; - struct media_pad pad[TUNER_NUM_PADS]; + struct media_pad pad[SI2157_NUM_PADS]; #endif };