From patchwork Sat Sep 15 20:14:25 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: 10601589 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 369801803 for ; Sat, 15 Sep 2018 20:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2693C294C7 for ; Sat, 15 Sep 2018 20:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B2AA2A601; Sat, 15 Sep 2018 20:14:45 +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 AF8032A9CC for ; Sat, 15 Sep 2018 20:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728038AbeIPBew (ORCPT ); Sat, 15 Sep 2018 21:34:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43474 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728005AbeIPBev (ORCPT ); Sat, 15 Sep 2018 21:34:51 -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=knTo6vpbASUlWC2dX54mnPlWUc8t1IuMDv4AWJy/2W8=; b=BbcVq6F+mteDvyoar9OGPyGs3 ckd4zS+6fx9o9o3TO2hCqQ6GO9xsJLk2oER9pUTEG57fNmrSqat2FhgN53Xm+UuxeFg4yBwWF8wRb FmNF0P/9ylL3x9rsI+b35Eq77ohdzXFc6t4+Zbi97xCigqk8za33M4vppkPHnmgcT97UgZfjpqA3m WimBbRjv2eIXfonE5EVjbp8uiKt+pGBOoZo6IbAuKvooP5vyBlqfTFhxVZ1Gwi+zD6+IE+jGmMFTl lhIWWZUIpSc6Bwa3Mn0/HcsB11H9tLt9pwgh+0J18cDgCkkcdd+qjhmSm8DdOQO4Itz6Fj25dwKgb aIR3IqGdg==; 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-0002P9-Lp; Sat, 15 Sep 2018 20:14:39 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1g1Gxc-0008SH-13; Sat, 15 Sep 2018 17:14:32 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Marco Felsch , Philipp Zabel , Nasser Afshin , Hans Verkuil , Javier Martinez Canillas Subject: [PATCH v2 10/14] media: tvp5150: declare its own pads Date: Sat, 15 Sep 2018 17:14:25 -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/i2c/tvp5150.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 94841cf81a7d..1f3dc2702954 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -38,10 +38,16 @@ MODULE_PARM_DESC(debug, "Debug level (0-2)"); #define dprintk0(__dev, __arg...) dev_dbg_lvl(__dev, 0, 0, __arg) +enum tvp5150_pads { + TVP5150_PAD_IF_INPUT, + TVP5150_PAD_VID_OUT, + TVP5150_NUM_PADS +}; + struct tvp5150 { struct v4l2_subdev sd; #ifdef CONFIG_MEDIA_CONTROLLER - struct media_pad pads[DEMOD_NUM_PADS]; + struct media_pad pads[TVP5150_NUM_PADS]; struct media_entity input_ent[TVP5150_INPUT_NUM]; struct media_pad input_pad[TVP5150_INPUT_NUM]; #endif @@ -866,7 +872,7 @@ static int tvp5150_fill_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *f; struct tvp5150 *decoder = to_tvp5150(sd); - if (!format || (format->pad != DEMOD_PAD_VID_OUT)) + if (!format || (format->pad != TVP5150_PAD_VID_OUT)) return -EINVAL; f = &format->format; @@ -1217,7 +1223,7 @@ static int tvp5150_registered(struct v4l2_subdev *sd) return ret; ret = media_create_pad_link(input, 0, &sd->entity, - DEMOD_PAD_IF_INPUT, 0); + TVP5150_PAD_IF_INPUT, 0); if (ret < 0) { media_device_unregister_entity(input); return ret; @@ -1499,14 +1505,14 @@ static int tvp5150_probe(struct i2c_client *c, sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; #if defined(CONFIG_MEDIA_CONTROLLER) - core->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; - core->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - core->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - core->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; + core->pads[TVP5150_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + core->pads[TVP5150_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + core->pads[TVP5150_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + core->pads[TVP5150_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; - res = media_entity_pads_init(&sd->entity, DEMOD_NUM_PADS, core->pads); + res = media_entity_pads_init(&sd->entity, TVP5150_NUM_PADS, core->pads); if (res < 0) return res;