From patchwork Wed Aug 1 15:55:03 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: 10552571 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 EBF59139A for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB4762A163 for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5172A1DA; Wed, 1 Aug 2018 15:55:24 +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 5F1A22B6D0 for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389961AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56514 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389932AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -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=DDfUfa5e0S+k6/EvmhsyWR+eHAe2PcrLRfc65ZuOti0=; b=C3fK+bRMQudHcYOM7Y3UWzXvS Mo/2v0mS7obNMGfZO10O+zr7TIIehiSfSojs+Sc4bNx30ftNVVm5oJwUn/nrXzIF5s8IgB/E+g9OA 1HsSnaF9C+hUgavmke7HKJXD/vZ4ie+B7UPwOTgqGSgAaYtWBz1uCFCWoBMTXzdgQtjh+MEkvGw3K 98Fxaenu9miqLT1tCwzAyaCZv4dYyAQ55lgJhmSBcJBTHInHv7T1hHyKtFwwixup8lnViQMpTLiFz CMzXYqPLJX3W7cBl8fast7DqqnvsrV+Xy0DfGZ/X2PkNPmWdfWLteFM4dHty2KQU1rYD4xmL82MzE r7wvghiLg==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o2-HF; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wN-21; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , "Gustavo A. R. Silva" , Devin Heitmueller , Hans Verkuil , Brian Warner , Sakari Ailus , Marco Felsch , Philipp Zabel , Nasser Afshin , Javier Martinez Canillas , Kees Cook , Shuah Khan , Pravin Shedge , Laurent Pinchart Subject: [PATCH 01/13] media: v4l2: remove VBI output pad Date: Wed, 1 Aug 2018 12:55:03 -0300 Message-Id: <5a5b24eb632c949c316c79b0c647a6754cb40834.1533138685.git.mchehab+samsung@kernel.org> 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 The signal there is the same as the video output (well, except for sliced VBI, but let's simplify the model and ignore it, at least for now - as it is routed together with raw VBI). Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/au8522_decoder.c | 1 - drivers/media/i2c/saa7115.c | 1 - drivers/media/i2c/tvp5150.c | 1 - drivers/media/pci/saa7134/saa7134-core.c | 1 - drivers/media/v4l2-core/v4l2-mc.c | 2 +- include/media/v4l2-mc.h | 2 -- 6 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index f285096a48f0..198dd2b6f326 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -720,7 +720,6 @@ static int au8522_probe(struct i2c_client *client, state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE; state->pads[DEMOD_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index b07114b5efb2..4c72db58dfd2 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1836,7 +1836,6 @@ static int saa711x_probe(struct i2c_client *client, #if defined(CONFIG_MEDIA_CONTROLLER) state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 76e6bed5a1da..66235e10acdd 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1501,7 +1501,6 @@ static int tvp5150_probe(struct i2c_client *c, #if defined(CONFIG_MEDIA_CONTROLLER) core->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; core->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - core->pads[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index 9e76de2411ae..267d143c3a48 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -847,7 +847,6 @@ static void saa7134_create_entities(struct saa7134_dev *dev) dev->demod.name = "saa713x"; dev->demod_pad[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; dev->demod_pad[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - dev->demod_pad[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE; dev->demod.function = MEDIA_ENT_F_ATV_DECODER; ret = media_entity_pads_init(&dev->demod, DEMOD_NUM_PADS, diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c index 0fc185a2ce90..982bab3530f6 100644 --- a/drivers/media/v4l2-core/v4l2-mc.c +++ b/drivers/media/v4l2-core/v4l2-mc.c @@ -147,7 +147,7 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) } if (io_vbi) { - ret = media_create_pad_link(decoder, DEMOD_PAD_VBI_OUT, + ret = media_create_pad_link(decoder, DEMOD_PAD_VID_OUT, io_vbi, 0, MEDIA_LNK_FL_ENABLED); if (ret) diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h index 2634d9dc9916..7c9c781b16a9 100644 --- a/include/media/v4l2-mc.h +++ b/include/media/v4l2-mc.h @@ -89,14 +89,12 @@ enum if_aud_dec_pad_index { * * @DEMOD_PAD_IF_INPUT: IF input sink pad. * @DEMOD_PAD_VID_OUT: Video output source pad. - * @DEMOD_PAD_VBI_OUT: Vertical Blank Interface (VBI) output source pad. * @DEMOD_PAD_AUDIO_OUT: Audio output source pad. * @DEMOD_NUM_PADS: Maximum number of output pads. */ enum demod_pad_index { DEMOD_PAD_IF_INPUT, DEMOD_PAD_VID_OUT, - DEMOD_PAD_VBI_OUT, DEMOD_PAD_AUDIO_OUT, DEMOD_NUM_PADS }; From patchwork Wed Aug 1 15:55:04 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: 10552583 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 211E99093 for ; Wed, 1 Aug 2018 15:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DE162A262 for ; Wed, 1 Aug 2018 15:55:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 020392B6D0; Wed, 1 Aug 2018 15:55:27 +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 354602A277 for ; Wed, 1 Aug 2018 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389970AbeHARlq (ORCPT ); Wed, 1 Aug 2018 13:41:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56538 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389955AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -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=72KcmL+VNh2oEj2bcaqfjE5AM0nIcSbkt3AFfYL1sO0=; b=G5nn0GERoIiHIvxmZ0lByR7rL pFujdd93glSLTqiECr6sexf0WX1U9Yu2XcD1T6dL1JpvxqOz6wDzyoLSQ3r5WEHqhH+ybQbA9KKT1 TQJZ9jgelZVVNEQWXA4l2+bqxGvXr9kCjds0C1l8dO6Xun+S3Lu/Fw5DgF9wqSaCrTpATuw83S8Do nQb8RHSf3S+s4WBcujnwIwkU37mXrOvUbnbOEk6pHtWYRRDmED5q+tiLeJYYd5VBlSj9Ws69k3Bms c6t88Wy5zsHBe7NG7TDruTO7NaYKEUrIyEISLNZT5w29VMbrvPYU+LUoqkDtujhlbskyIkD3vlNxW S5b4riFrA==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o1-Hk; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wR-3A; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Antti Palosaari , Michael Krufky , Devin Heitmueller , Hans Verkuil , "Gustavo A. R. Silva" , Brian Warner , Sakari Ailus , Marco Felsch , Philipp Zabel , Nasser Afshin , Javier Martinez Canillas , Kees Cook Subject: [PATCH 02/13] media: v4l2: taint pads with the signal types for consumer devices Date: Wed, 1 Aug 2018 12:55:04 -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 Consumer devices are provided with a wide diferent range of types supported by the same driver, allowing different configutations. In order to make easier to setup media controller links, "taint" pads with the signal type it carries. While here, get rid of DEMOD_PAD_VBI_OUT, as the signal it carries is actually the same as the normal video output. The difference happens at the video/VBI interface: - for VBI, only the hidden lines are streamed; - for video, the stream is usually cropped to hide the vbi lines. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/au8522_decoder.c | 3 ++ drivers/media/i2c/msp3400-driver.c | 2 ++ drivers/media/i2c/saa7115.c | 2 ++ drivers/media/i2c/tvp5150.c | 2 ++ drivers/media/pci/saa7134/saa7134-core.c | 2 ++ drivers/media/tuners/si2157.c | 3 ++ drivers/media/usb/dvb-usb-v2/mxl111sf.c | 2 ++ drivers/media/v4l2-core/tuner-core.c | 5 +++ include/media/media-entity.h | 35 ++++++++++++++++++++ 9 files changed, 56 insertions(+) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index 198dd2b6f326..583fdaa7339f 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -719,8 +719,11 @@ static int au8522_probe(struct i2c_client *client, #if defined(CONFIG_MEDIA_CONTROLLER) state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; state->pads[DEMOD_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[DEMOD_PAD_AUDIO_OUT].sig_type = PAD_SIGNAL_AUDIO; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; ret = media_entity_pads_init(&sd->entity, ARRAY_SIZE(state->pads), diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 3db966db83eb..3b9c729fbd52 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -704,7 +704,9 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) #if defined(CONFIG_MEDIA_CONTROLLER) state->pads[IF_AUD_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[IF_AUD_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_AUDIO; state->pads[IF_AUD_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[IF_AUD_DEC_PAD_OUT].sig_type = PAD_SIGNAL_AUDIO; sd->entity.function = MEDIA_ENT_F_IF_AUD_DECODER; diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 4c72db58dfd2..8798a06c212f 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1835,7 +1835,9 @@ static int saa711x_probe(struct i2c_client *client, #if defined(CONFIG_MEDIA_CONTROLLER) state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 66235e10acdd..5037a03b5442 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1500,7 +1500,9 @@ static int tvp5150_probe(struct i2c_client *c, #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; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index 267d143c3a48..c4e2df197bf9 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -846,7 +846,9 @@ static void saa7134_create_entities(struct saa7134_dev *dev) if (!decoder) { dev->demod.name = "saa713x"; dev->demod_pad[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + dev->demod_pad[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; dev->demod_pad[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + dev->demod_pad[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; dev->demod.function = MEDIA_ENT_F_ATV_DECODER; ret = media_entity_pads_init(&dev->demod, DEMOD_NUM_PADS, diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 9e34d31d724d..d222912662d7 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -469,8 +469,11 @@ static int si2157_probe(struct i2c_client *client, 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_TV_CARRIERS; 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[0]); diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index 4713ba65e1c2..51a1b26199e6 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c @@ -893,7 +893,9 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap) state->tuner.function = MEDIA_ENT_F_TUNER; state->tuner.name = "mxl111sf tuner"; state->tuner_pads[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->tuner_pads[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; state->tuner_pads[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; + state->tuner_pads[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_TV_CARRIERS; ret = media_entity_pads_init(&state->tuner, TUNER_NUM_PADS, state->tuner_pads); diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index 7f858c39753c..d4c32ccd0930 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v4l2-core/tuner-core.c @@ -685,15 +685,20 @@ static int tuner_probe(struct i2c_client *client, */ if (t->type == TUNER_TDA9887) { t->pad[IF_VID_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + t->pad[IF_VID_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; t->pad[IF_VID_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; + t->pad[IF_VID_DEC_PAD_OUT].sig_type = PAD_SIGNAL_DV; ret = media_entity_pads_init(&t->sd.entity, IF_VID_DEC_PAD_NUM_PADS, &t->pad[0]); t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER; } else { t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; + t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; + t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_TV_CARRIERS; t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; + t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS, &t->pad[0]); t->sd.entity.function = MEDIA_ENT_F_TUNER; diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 3aa3d58d1d58..8bfbe6b59fa9 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -155,6 +155,40 @@ struct media_link { bool is_backlink; }; +/** + * struct media_pad_signal_type - type of the signal inside a media pad + * + * @PAD_SIGNAL_DEFAULT + * Default signal. Use this when all inputs or all outputs are + * uniquely identified by the pad number. + * @PAD_SIGNAL_ANALOG + * The pad contains an analog signa. It can be Radio Frequency, + * Intermediate Frequency or baseband signal. + * Tuner inputs, composite and s-video signals should use it. + * On tuner sources, this is used for digital TV demodulators and for + * IF-PLL demodulator like tda9887. + * @PAD_SIGNAL_TV_CARRIERS + * The pad contains analog signals carrying either a digital or an analog + * modulated (or baseband) signal. This is provided by tuner source + * pads and used by analog TV standard decoders and by digital TV demods. + * @PAD_SIGNAL_DV + * Contains a digital video signal, with can be a bitstream of samples + * taken from an analog TV video source. On such case, it usually + * contains the VBI data on it. + * @PAD_SIGNAL_AUDIO + * Contains an Intermediate Frequency analog signal from an audio + * sub-carrier or an audio bitstream. IF signals are provided by tuners + * and consumed by audio AM/FM decoders. Bitstream audio is provided by + * an audio decoder. + */ +enum media_pad_signal_type { + PAD_SIGNAL_DEFAULT = 0, + PAD_SIGNAL_ANALOG, + PAD_SIGNAL_TV_CARRIERS, + PAD_SIGNAL_DV, + PAD_SIGNAL_AUDIO, +}; + /** * struct media_pad - A media pad graph object. * @@ -169,6 +203,7 @@ struct media_pad { struct media_gobj graph_obj; /* must be first field in struct */ struct media_entity *entity; u16 index; + enum media_pad_signal_type sig_type; unsigned long flags; }; From patchwork Wed Aug 1 15:55:05 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: 10552593 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 B389B13B8 for ; Wed, 1 Aug 2018 15:55:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A22162A163 for ; Wed, 1 Aug 2018 15:55:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96B382A262; Wed, 1 Aug 2018 15:55:32 +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 04B842A163 for ; Wed, 1 Aug 2018 15:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389981AbeHARlv (ORCPT ); Wed, 1 Aug 2018 13:41:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56484 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389906AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=rIs7y4hzDAWGwdx/bfCuexwOCID9QcGEyyhCFvdqrco=; b=qXRTsD8ydfOT/Di17ecOcTryY +Nt66D56nwFblTh4+n+kzKqxsYyklKarTu+PKYMCIZbiJcjk1G8A7u8gbzf4BRw4+m/I0BS0hS1v+ rzSF/4b34258tfnwHQ6abrarsdYOcjBD5X0awLoLMq/yfoj+CLCvlXpF+Q4FBIrLVpx1JY0KIXKjn b1J5DwPXoyqwPz0RkesA+IEY3VJeADWNXtdRVCoRuIzXBD5/E/3DW/+343XV3TbGEVBbHXzVLJ+Qx f1eEN93uBgyB8h7c4ZutamX6eEGcpbwwF+mKC23hbMI+PyuQU17Og3g6HQg/JiaNtw7c4d+j4jSyk MtDVjk9ZA==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005nw-Ed; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wV-4F; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Laurent Pinchart , Pravin Shedge , Hans Verkuil , Shuah Khan Subject: [PATCH 03/13] v4l2-mc: switch it to use the new approach to setup pipelines Date: Wed, 1 Aug 2018 12:55:05 -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 Instead of relying on a static map for pids, use the new sig_type "taint" type to setup the pipelines with the same tipe between different entities. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- drivers/media/media-entity.c | 26 +++++++++++ drivers/media/v4l2-core/v4l2-mc.c | 73 ++++++++++++++++++++++++------- include/media/media-entity.h | 19 ++++++++ 3 files changed, 101 insertions(+), 17 deletions(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 3498551e618e..0b1cb3559140 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -662,6 +662,32 @@ static void __media_entity_remove_link(struct media_entity *entity, kfree(link); } +int media_get_pad_index(struct media_entity *entity, bool is_sink, + enum media_pad_signal_type sig_type) +{ + int i; + bool pad_is_sink; + + if (!entity) + return -EINVAL; + + for (i = 0; i < entity->num_pads; i++) { + if (entity->pads[i].flags == MEDIA_PAD_FL_SINK) + pad_is_sink = true; + else if (entity->pads[i].flags == MEDIA_PAD_FL_SOURCE) + pad_is_sink = false; + else + continue; /* This is an error! */ + + if (pad_is_sink != is_sink) + continue; + if (entity->pads[i].sig_type == sig_type) + return i; + } + return -EINVAL; +} +EXPORT_SYMBOL_GPL(media_get_pad_index); + int media_create_pad_link(struct media_entity *source, u16 source_pad, struct media_entity *sink, u16 sink_pad, u32 flags) diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c index 982bab3530f6..1925e1a3b861 100644 --- a/drivers/media/v4l2-core/v4l2-mc.c +++ b/drivers/media/v4l2-core/v4l2-mc.c @@ -28,7 +28,7 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) struct media_entity *io_v4l = NULL, *io_vbi = NULL, *io_swradio = NULL; bool is_webcam = false; u32 flags; - int ret; + int ret, pad_sink, pad_source; if (!mdev) return 0; @@ -97,29 +97,52 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) /* Link the tuner and IF video output pads */ if (tuner) { if (if_vid) { - ret = media_create_pad_link(tuner, TUNER_PAD_OUTPUT, - if_vid, - IF_VID_DEC_PAD_IF_INPUT, + pad_source = media_get_pad_index(tuner, false, + PAD_SIGNAL_ANALOG); + pad_sink = media_get_pad_index(if_vid, true, + PAD_SIGNAL_ANALOG); + if (pad_source < 0 || pad_sink < 0) + return -EINVAL; + ret = media_create_pad_link(tuner, pad_source, + if_vid, pad_sink, MEDIA_LNK_FL_ENABLED); if (ret) return ret; - ret = media_create_pad_link(if_vid, IF_VID_DEC_PAD_OUT, - decoder, DEMOD_PAD_IF_INPUT, + + pad_source = media_get_pad_index(if_vid, false, + PAD_SIGNAL_DV); + pad_sink = media_get_pad_index(decoder, true, + PAD_SIGNAL_DV); + if (pad_source < 0 || pad_sink < 0) + return -EINVAL; + ret = media_create_pad_link(if_vid, pad_source, + decoder, pad_sink, MEDIA_LNK_FL_ENABLED); if (ret) return ret; } else { - ret = media_create_pad_link(tuner, TUNER_PAD_OUTPUT, - decoder, DEMOD_PAD_IF_INPUT, + pad_source = media_get_pad_index(tuner, false, + PAD_SIGNAL_ANALOG); + pad_sink = media_get_pad_index(decoder, true, + PAD_SIGNAL_ANALOG); + if (pad_source < 0 || pad_sink < 0) + return -EINVAL; + ret = media_create_pad_link(tuner, pad_source, + decoder, pad_sink, MEDIA_LNK_FL_ENABLED); if (ret) return ret; } if (if_aud) { - ret = media_create_pad_link(tuner, TUNER_PAD_AUD_OUT, - if_aud, - IF_AUD_DEC_PAD_IF_INPUT, + pad_source = media_get_pad_index(tuner, false, + PAD_SIGNAL_AUDIO); + pad_sink = media_get_pad_index(decoder, true, + PAD_SIGNAL_AUDIO); + if (pad_source < 0 || pad_sink < 0) + return -EINVAL; + ret = media_create_pad_link(tuner, pad_source, + if_aud, pad_sink, MEDIA_LNK_FL_ENABLED); if (ret) return ret; @@ -131,7 +154,10 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) /* Create demod to V4L, VBI and SDR radio links */ if (io_v4l) { - ret = media_create_pad_link(decoder, DEMOD_PAD_VID_OUT, + pad_source = media_get_pad_index(decoder, false, PAD_SIGNAL_DV); + if (pad_source < 0) + return -EINVAL; + ret = media_create_pad_link(decoder, pad_source, io_v4l, 0, MEDIA_LNK_FL_ENABLED); if (ret) @@ -139,7 +165,10 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) } if (io_swradio) { - ret = media_create_pad_link(decoder, DEMOD_PAD_VID_OUT, + pad_source = media_get_pad_index(decoder, false, PAD_SIGNAL_DV); + if (pad_source < 0) + return -EINVAL; + ret = media_create_pad_link(decoder, pad_source, io_swradio, 0, MEDIA_LNK_FL_ENABLED); if (ret) @@ -147,7 +176,10 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) } if (io_vbi) { - ret = media_create_pad_link(decoder, DEMOD_PAD_VID_OUT, + pad_source = media_get_pad_index(decoder, false, PAD_SIGNAL_DV); + if (pad_source < 0) + return -EINVAL; + ret = media_create_pad_link(decoder, pad_source, io_vbi, 0, MEDIA_LNK_FL_ENABLED); if (ret) @@ -161,15 +193,22 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) case MEDIA_ENT_F_CONN_RF: if (!tuner) continue; - + pad_source = media_get_pad_index(tuner, false, + PAD_SIGNAL_ANALOG); + if (pad_source < 0) + return -EINVAL; ret = media_create_pad_link(entity, 0, tuner, - TUNER_PAD_RF_INPUT, + pad_source, flags); break; case MEDIA_ENT_F_CONN_SVIDEO: case MEDIA_ENT_F_CONN_COMPOSITE: + pad_sink = media_get_pad_index(decoder, true, + PAD_SIGNAL_ANALOG); + if (pad_sink < 0) + return -EINVAL; ret = media_create_pad_link(entity, 0, decoder, - DEMOD_PAD_IF_INPUT, + pad_sink, flags); break; default: diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 8bfbe6b59fa9..ac8b93e46167 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -675,6 +675,25 @@ static inline void media_entity_cleanup(struct media_entity *entity) {} #define media_entity_cleanup(entity) do { } while (false) #endif + +/** + * media_get_pad_index() - retrieves a pad index from an entity + * + * @entity: entity where the pads belong + * @is_sink: true if the pad is a sink, false if it is a source + * @sig_type: type of signal of the pad to be search + * + * This helper function finds the first pad index inside an entity that + * satisfies both @is_sink and @sig_type conditions. + * + * Return: + * + * On success, return the pad number. If the pad was not found or the media + * entity is a NULL pointer, return -EINVAL. + */ +int media_get_pad_index(struct media_entity *entity, bool is_sink, + enum media_pad_signal_type sig_type); + /** * media_create_pad_link() - creates a link between two entities. * From patchwork Wed Aug 1 15:55:06 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: 10552587 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 EBD0E9093 for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD5E32A163 for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D242C2A277; Wed, 1 Aug 2018 15:55:29 +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 5287D2A262 for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389950AbeHARlt (ORCPT ); Wed, 1 Aug 2018 13:41:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56456 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389691AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=e7146wFGjVnm3TEUkR3sazTT4wALWPl7bQ1Jys0OD58=; b=g1ulaYwOnipwlXsbEbGXQMVGg zGYOHq7uI0I3xJIjxTuIo4Ke4xu2Q/SBR/xpEzN2pPMXyZSQQIHyNsC9XMUrRmgXLhwI7WgQbCDZf apfZmafSeXuKSKpeONOGRIiKiNFrJ/8/ZXp8xRRlRePaeEdlLAVkotuxy5mhS7LN/k4VP2GX0L4F0 x6/B04vRz+CmG7hQIQkukGw592fItDsTAYD3vbuNgP+5UE+R4K7KCoZwE93VDjgdWR3o8qg5opQWE M4v5H4kNP3AnkztsDiGNAjEveES/SSQbW5Wi7poSDe8P8OVCQ2obDW+aNbFRsdli9EOSUv85DRSGj CjzWlcR6w==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005nx-EE; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wZ-5U; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , Max Kellermann Subject: [PATCH 04/13] media: dvb: use signals to discover pads Date: Wed, 1 Aug 2018 12:55:06 -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 On tuner pads, multiple signals are present. Be sure to get the right PAD by using them. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvbdev.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 3c8778570331..50f174248eef 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -621,7 +621,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap, unsigned demux_pad = 0; unsigned dvr_pad = 0; unsigned ntuner = 0, ndemod = 0; - int ret; + int ret, pad_source, pad_sink; static const char *connector_name = "Television"; if (!mdev) @@ -681,7 +681,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap, if (ret) return ret; - if (!ntuner) + if (!ntuner) { ret = media_create_pad_links(mdev, MEDIA_ENT_F_CONN_RF, conn, 0, @@ -689,22 +689,31 @@ int dvb_create_media_graph(struct dvb_adapter *adap, demod, 0, MEDIA_LNK_FL_ENABLED, false); - else + } else { + pad_sink = media_get_pad_index(tuner, true, + PAD_SIGNAL_ANALOG); + if (pad_sink < 0) + return -EINVAL; ret = media_create_pad_links(mdev, MEDIA_ENT_F_CONN_RF, conn, 0, MEDIA_ENT_F_TUNER, - tuner, TUNER_PAD_RF_INPUT, + tuner, pad_sink, MEDIA_LNK_FL_ENABLED, false); + } if (ret) return ret; } if (ntuner && ndemod) { + pad_source = media_get_pad_index(tuner, true, + PAD_SIGNAL_ANALOG); + if (pad_source) + return -EINVAL; ret = media_create_pad_links(mdev, MEDIA_ENT_F_TUNER, - tuner, TUNER_PAD_OUTPUT, + tuner, pad_source, MEDIA_ENT_F_DTV_DEMOD, demod, 0, MEDIA_LNK_FL_ENABLED, false); From patchwork Wed Aug 1 15:55:07 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: 10552567 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 9E9B4139A for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE352A163 for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82E172A20C; Wed, 1 Aug 2018 15:55:23 +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 365242A163 for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389918AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389812AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=gFolxMOovmChDte/cboRdPFOhpNtmzeGuUOylG2cWdY=; b=hrKbGU3sRm5bXNShNJzPm+AkF 6rjKe7EnK/k/n/vq7RrOsbz6DWV26U+7OCsUhOonkA9dUEdLkmghZph6o4atTwAOKN05H+Of6qLsU QPICMb7i1Rs+2kL8GEe2GsBZ3FzX4SE23ixQciApAtmoPl7wLABRNukKgOeBcwDzFp9CZcjXVuhBJ m0QOw46RRNwYflIDly76GT20bdlNl8bq4UX6MvRfWUW1JXouJU0aAdF4h6u3+hfF4i8TiCcnazS7+ 5elYLHQ4vaZ2l5no5ID8xyy9kB7iZSx6ESyBXeyzCpe/GfkxqE7UHvYoA8fItpjSRYd/OqPcsLTlE ZBa5CZaAQ==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005nv-Gp; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wd-70; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , "Gustavo A. R. Silva" Subject: [PATCH 05/13] media: au0828: use signals instead of hardcoding a pad number Date: Wed, 1 Aug 2018 12:55:07 -0300 Message-Id: <652a795df24165d6dbf93d31a1f3ea10b65ed989.1533138685.git.mchehab+samsung@kernel.org> 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 When creating the audio link, use pad signals, instead of hardcoding using the pad index number. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index cd363a2100d4..4729b2a2f21c 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -266,11 +266,13 @@ static void au0828_media_graph_notify(struct media_entity *new, create_link: if (decoder && mixer) { - ret = media_create_pad_link(decoder, - DEMOD_PAD_AUDIO_OUT, - mixer, 0, - MEDIA_LNK_FL_ENABLED); - if (ret) + ret = media_get_pad_index(decoder, false, + PAD_SIGNAL_AUDIO); + if (ret >= 0) + ret = media_create_pad_link(decoder, ret, + mixer, 0, + MEDIA_LNK_FL_ENABLED); + if (ret < 0) dev_err(&dev->usbdev->dev, "Mixer Pad Link Create Error: %d\n", ret); } From patchwork Wed Aug 1 15:55:08 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: 10552589 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 223B213B8 for ; Wed, 1 Aug 2018 15:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EAE12A163 for ; Wed, 1 Aug 2018 15:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 034272A262; Wed, 1 Aug 2018 15:55:29 +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 9430C2A1DA for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389978AbeHARlt (ORCPT ); Wed, 1 Aug 2018 13:41:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56490 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389907AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=rOAhml5lussG2nic8jvHQ95zlN3was6lx105NZsrA2g=; b=OrjCeLsMhAFMK1pFudBmECcrO yR+SdwQ668N0dr0SUYJ6rAOPCPB7UVn6u0GjJeGMx+Zpx/7AypFjGEOPCwadknHhJ5CWgfUBvf+/V 2UktVUvS1ciwqqt3wC7KoVWzoZmi+DMpgUo6/DVvotPay7PN12WRN2KkWTfMZRK0WgRf73LMy0Ev6 Zt3te+bFqbcim9KsQiFGqAGEZ8C+36IFFY0LUFgm0GZ/gUHSb5qcZ3OIRrHE9MGfITllyIPjmRTm6 Hqe5XaH84nLI0mcp9hJhluipAwFZSTbSf8uiHAn/07bC7InR2QikssF84iBQHSWC0l28TMUgg2j+y MH+LonP9w==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005ny-E9; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wh-8D; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil , Devin Heitmueller , "Gustavo A. R. Silva" Subject: [PATCH 06/13] media: au8522: declare its own pads Date: Wed, 1 Aug 2018 12:55:08 -0300 Message-Id: <727ba77c1e3fe51af8fadd6029291886f42176c1.1533138685.git.mchehab+samsung@kernel.org> 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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/au8522_decoder.c | 12 ++++++------ drivers/media/dvb-frontends/au8522_priv.h | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index 583fdaa7339f..b2dd20ffd002 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -718,12 +718,12 @@ static int au8522_probe(struct i2c_client *client, v4l2_i2c_subdev_init(sd, client, &au8522_ops); #if defined(CONFIG_MEDIA_CONTROLLER) - state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; - state->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; - state->pads[DEMOD_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[DEMOD_PAD_AUDIO_OUT].sig_type = PAD_SIGNAL_AUDIO; + state->pads[AU8522_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[AU8522_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + state->pads[AU8522_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[AU8522_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; + state->pads[AU8522_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[AU8522_PAD_AUDIO_OUT].sig_type = PAD_SIGNAL_AUDIO; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; ret = media_entity_pads_init(&sd->entity, ARRAY_SIZE(state->pads), diff --git a/drivers/media/dvb-frontends/au8522_priv.h b/drivers/media/dvb-frontends/au8522_priv.h index 2043c1744753..68299d2705f7 100644 --- a/drivers/media/dvb-frontends/au8522_priv.h +++ b/drivers/media/dvb-frontends/au8522_priv.h @@ -40,6 +40,13 @@ #define AU8522_DIGITAL_MODE 1 #define AU8522_SUSPEND_MODE 2 +enum au8522_pads { + AU8522_PAD_IF_INPUT, + AU8522_PAD_VID_OUT, + AU8522_PAD_AUDIO_OUT, + AU8522_NUM_PADS +}; + struct au8522_state { struct i2c_client *c; struct i2c_adapter *i2c; @@ -71,7 +78,7 @@ struct au8522_state { struct v4l2_ctrl_handler hdl; #ifdef CONFIG_MEDIA_CONTROLLER - struct media_pad pads[DEMOD_NUM_PADS]; + struct media_pad pads[AU8522_NUM_PADS]; #endif }; From patchwork Wed Aug 1 15:55:09 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: 10552591 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 E1696174A for ; Wed, 1 Aug 2018 15:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D17DC2A163 for ; Wed, 1 Aug 2018 15:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C60AC2A262; Wed, 1 Aug 2018 15:55:31 +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 70D572A163 for ; Wed, 1 Aug 2018 15:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389992AbeHARlv (ORCPT ); Wed, 1 Aug 2018 13:41:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56468 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389825AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=OXqwyspzdjOfae+DxMnQo8Kd/JBfx3SUldNHp9RxrR4=; b=O3uT5ZnASjJCjvLmOpdZeR2gH n46VqnX9HJe/+3GSi+sVSMk4cXv4ouvmObZKm3NUbem4b0slzxQcewV2lFosiZzD4qbCsKsAJq1r5 yAt8BO92UtONhvBMlDPKfbzuObcs8vtDmy2SYKB5pvseL5qoRKI12EfyuFpZPlndEmUdUtdXtoWCB V5rRAsxvs8C80Wzpa+oHyRZx6GDThQkKK2lAPOU/WVGvGzm36oR5plzYDUgZa65nKPf7c+My+drJU g0qDcqTrYMR8Cnhy8LHQF0w4EntxpL1bPlvtm+WdpcX9Q0P1VNmR7Y8p/lBX9ZGl5vFXi59uS8knF 5CBekSKqg==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005nz-Ex; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wl-9B; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Thomas Gleixner , Kate Stewart , Philippe Ombredanne , Greg Kroah-Hartman Subject: [PATCH 07/13] media: msp3400: declare its own pads Date: Wed, 1 Aug 2018 12:55:09 -0300 Message-Id: <8839fb63e761749123fc20d43875f1484c7c4346.1533138685.git.mchehab+samsung@kernel.org> 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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/msp3400-driver.c | 8 ++++---- drivers/media/i2c/msp3400-driver.h | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 3b9c729fbd52..ef70fe0c77a1 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -703,10 +703,10 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) v4l2_i2c_subdev_init(sd, client, &msp_ops); #if defined(CONFIG_MEDIA_CONTROLLER) - state->pads[IF_AUD_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; - state->pads[IF_AUD_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_AUDIO; - state->pads[IF_AUD_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[IF_AUD_DEC_PAD_OUT].sig_type = PAD_SIGNAL_AUDIO; + state->pads[MSP3400_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[MSP3400_PAD_IF_INPUT].sig_type = PAD_SIGNAL_AUDIO; + state->pads[MSP3400_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[MSP3400_PAD_OUT].sig_type = PAD_SIGNAL_AUDIO; sd->entity.function = MEDIA_ENT_F_IF_AUD_DECODER; diff --git a/drivers/media/i2c/msp3400-driver.h b/drivers/media/i2c/msp3400-driver.h index b6c7698bce5a..2bb9d5ff1bbd 100644 --- a/drivers/media/i2c/msp3400-driver.h +++ b/drivers/media/i2c/msp3400-driver.h @@ -52,6 +52,12 @@ extern int msp_standard; extern bool msp_dolby; extern int msp_stereo_thresh; +enum msp3400_pads { + MSP3400_PAD_IF_INPUT, + MSP3400_PAD_OUT, + MSP3400_NUM_PADS +}; + struct msp_state { struct v4l2_subdev sd; struct v4l2_ctrl_handler hdl; @@ -106,7 +112,7 @@ struct msp_state { unsigned int watch_stereo:1; #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER) - struct media_pad pads[IF_AUD_DEC_PAD_NUM_PADS]; + struct media_pad pads[MSP3400_NUM_PADS]; #endif }; From patchwork Wed Aug 1 15:55:10 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: 10552577 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 9384E9093 for ; Wed, 1 Aug 2018 15:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 839D52A163 for ; Wed, 1 Aug 2018 15:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 781E52A20C; Wed, 1 Aug 2018 15:55:26 +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 288AC2A163 for ; Wed, 1 Aug 2018 15:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389946AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56510 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389863AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=1AOnCzgg7tH+6R8b5woB5OuY5y9x7d9jyA7HjpmQDG0=; b=JqVLOC/FjCXsa39/UiYW/Nh8P BGzx5K4aeAfHxZJd+J3zvaXeqNMU20cdhdw7F8GKo7FBHjV/JvKqsx3GDcTY5U2euNPdzj3Bz3K2b w+SOc96svywf0l//fW3dLsKTTI3QdsN4S31vjgRhsdOGppcr0vgFCrgL1FPcejT1IuA6u2crfwcSc Zi+KrEv4b1kMiHeLMX2yAQIvhN1b2GyJ+IxxLMNkKwRVROOCMKJuFQ6BhS3V2ikUsn/KcMhnzz7LV ehMl86i1dcxxRxqicUSQ/uNrVxX1/5wqagmbOqNrQtS0meJVBt1vg/NA6aWBbjggGw9Z2KPIagvO8 5QBWwR55Q==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o0-Gm; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wp-AB; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Sakari Ailus , Brian Warner Subject: [PATCH 08/13] media: saa7115: declare its own pads Date: Wed, 1 Aug 2018 12:55:10 -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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/saa7115.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 8798a06c212f..09bedbc71567 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -59,10 +59,17 @@ enum saa711x_model { SAA7118, }; + +enum saa711x_pads { + SAA711X_PAD_IF_INPUT, + SAA711X_PAD_VID_OUT, + SAA711X_NUM_PADS +}; + struct saa711x_state { struct v4l2_subdev sd; #ifdef CONFIG_MEDIA_CONTROLLER - struct media_pad pads[DEMOD_NUM_PADS]; + struct media_pad pads[SAA711X_NUM_PADS]; #endif struct v4l2_ctrl_handler hdl; @@ -1834,14 +1841,14 @@ static int saa711x_probe(struct i2c_client *client, v4l2_i2c_subdev_init(sd, client, &saa711x_ops); #if defined(CONFIG_MEDIA_CONTROLLER) - state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; - state->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - state->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; + state->pads[SAA711X_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[SAA711X_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + state->pads[SAA711X_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + state->pads[SAA711X_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; sd->entity.function = MEDIA_ENT_F_ATV_DECODER; - ret = media_entity_pads_init(&sd->entity, DEMOD_NUM_PADS, state->pads); + ret = media_entity_pads_init(&sd->entity, SAA711X_NUM_PADS, state->pads); if (ret < 0) return ret; #endif From patchwork Wed Aug 1 15:55:11 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: 10552585 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 ADFE0174A for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BFAB2A163 for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 607E82A277; Wed, 1 Aug 2018 15:55:29 +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 083992A163 for ; Wed, 1 Aug 2018 15:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389925AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56466 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389854AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=Mi9a60w4TaWi5RgyRR/WCC53HvAjTasXg0LZ0JaFIZQ=; b=PPA76JecfDsES1RLJqrUSWnn5 al+7/BjQXxW0T403aUAuiYHPSq4WflMVHkwmb2+8jg7PzBcXCBrmvQxx0sfu1TYyGup6FL0tDAXCR lKBBVz06fCcw2DQTsu4Wk5+4EXILzEBPu9TtUaJosg5grVHZll8emHcGA4xgAzySRkkwsCCqKyO+O EAUebJy1awFc9bH6zl1ZrHQTJqr8KW3UL6jipS3L9cbDy3oWGxpk7x+/uIUQ6VM6gq5MwCXswHA1t WVEpf6fBVEmpAej+t8MRz1Eq85xF1iDet2VCxOMXpFdb05hvYgFVr9XXCkUUjj5Y8yBD1DwluSart 20+RxGHmw==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o3-Hd; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wt-Bc; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Marco Felsch , Philipp Zabel , Nasser Afshin , Javier Martinez Canillas Subject: [PATCH 09/13] media: tvp5150: declare its own pads Date: Wed, 1 Aug 2018 12:55:11 -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. 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 5037a03b5442..a9f7c70ca25c 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; From patchwork Wed Aug 1 15:55:12 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: 10552573 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 697A79093 for ; Wed, 1 Aug 2018 15:55:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 592632A163 for ; Wed, 1 Aug 2018 15:55:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D7DA2A1DA; Wed, 1 Aug 2018 15:55:25 +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 EAC402A262 for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389958AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56476 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389864AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=HyLuCqOptdplivbzD8INNopQKCdMoBbgA1ed0fJy3Rw=; b=eQ9PaKXMRg3YN7Y1EY5ruNVni kHQazmm43+c/nMY6RHAwinzrjmEu9J3p6tpGSUGogPuEo9Hfp9NVwva1Po/+hlodU9EEDVpFLfLOX Vjobt3LFfmeUqw8MqPYVfVfisoK/r0mrQvIVrM8J5R2amtqNVm1ixkIwMYtNu2OGO7CMOIPEeJx3f GAoD70sMkRAOah0JnkkBRjc+XFKDhehvINhAw/5JE2kyH1Vq3Fz6AwQgsRcoO2IvagZfgYBNmes87 cCUWw9tOxDxbUFIT4s6KYwYPJNzOBlVAc1QGdHJNbZk3ZKDQDmoGmGkoE61Qn9bBvj4IVdfrcSXEm wTlusJYWg==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o4-LE; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003x2-D5; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Antti Palosaari Subject: [PATCH 10/13] media: si2157: declare its own pads Date: Wed, 1 Aug 2018 12:55:12 -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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/si2157.c | 14 +++++++------- drivers/media/tuners/si2157_priv.h | 9 ++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index d222912662d7..dc21a86c0175 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -468,14 +468,14 @@ 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_TV_CARRIERS; - dev->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; - dev->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; + 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_TV_CARRIERS; + 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, TUNER_NUM_PADS, + 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 }; From patchwork Wed Aug 1 15:55:13 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: 10552575 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 01119139A for ; Wed, 1 Aug 2018 15:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E54112A163 for ; Wed, 1 Aug 2018 15:55:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D99532A20C; Wed, 1 Aug 2018 15:55:25 +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 804E02A163 for ; Wed, 1 Aug 2018 15:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389957AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56482 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389895AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=kcvbsXE1Ey2ifGfztMnjf+MyEj2V4Yh0g3bEiW5Uej0=; b=EwvfFc84sfBuX2+WEJqGnfT2Y TjXxbzQSupkdPdxn+rNFpL9/XF2nlnsK7+bTMvC1pJgpEig2Gmcs5l/zmF1rZrPTzOKlelPPDy9pF z+mM3izO31jiNaiusmM87HTmfDDoyvGvdav+/1tot4iaoTyWVL8WYOU+MSDvEcTku4AVUCFIiuJtd bGfOPgiI0wT3m9HyqfhELqx2VAVjjozYUu2eRPCTdECS9cyCQmzXtUHwfay/LJKAw3pMr+XoSeqJe YvHAMTCaMlp9zpvUKrn42OjUqiuX61R3uTdlne+Lu6WpUikukXuUQmypuczNw5OFqYf10xetgRF3o JLGOsIRYA==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o6-LM; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003x7-Ea; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Kees Cook , Hans Verkuil , Bhumika Goyal Subject: [PATCH 11/13] media: saa7134: declare its own pads Date: Wed, 1 Aug 2018 12:55:13 -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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/saa7134/saa7134-core.c | 10 +++++----- drivers/media/pci/saa7134/saa7134.h | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index c4e2df197bf9..8984b1bf57a5 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -845,13 +845,13 @@ static void saa7134_create_entities(struct saa7134_dev *dev) */ if (!decoder) { dev->demod.name = "saa713x"; - dev->demod_pad[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; - dev->demod_pad[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - dev->demod_pad[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; - dev->demod_pad[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; + dev->demod_pad[SAA7134_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + dev->demod_pad[SAA7134_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + dev->demod_pad[SAA7134_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE; + dev->demod_pad[SAA7134_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV; dev->demod.function = MEDIA_ENT_F_ATV_DECODER; - ret = media_entity_pads_init(&dev->demod, DEMOD_NUM_PADS, + ret = media_entity_pads_init(&dev->demod, SAA7134_NUM_PADS, dev->demod_pad); if (ret < 0) pr_err("failed to initialize demod pad!\n"); diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h index d99e937a98c1..ac05a38aa728 100644 --- a/drivers/media/pci/saa7134/saa7134.h +++ b/drivers/media/pci/saa7134/saa7134.h @@ -547,6 +547,12 @@ struct saa7134_mpeg_ops { unsigned long status); }; +enum saa7134_pads { + SAA7134_PAD_IF_INPUT, + SAA7134_PAD_VID_OUT, + SAA7134_NUM_PADS +}; + /* global device status */ struct saa7134_dev { struct list_head devlist; @@ -674,7 +680,7 @@ struct saa7134_dev { struct media_pad input_pad[SAA7134_INPUT_MAX + 1]; struct media_entity demod; - struct media_pad demod_pad[DEMOD_NUM_PADS]; + struct media_pad demod_pad[SAA7134_NUM_PADS]; struct media_pad video_pad, vbi_pad; struct media_entity *decoder; From patchwork Wed Aug 1 15:55:14 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: 10552581 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 2E4ABA748 for ; Wed, 1 Aug 2018 15:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D1252A163 for ; Wed, 1 Aug 2018 15:55:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 112642B802; Wed, 1 Aug 2018 15:55:28 +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 ABAC62A163 for ; Wed, 1 Aug 2018 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389962AbeHARlq (ORCPT ); Wed, 1 Aug 2018 13:41:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56534 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389863AbeHARlo (ORCPT ); Wed, 1 Aug 2018 13:41:44 -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=yo4NgHCKn3XK0iIjAG3Q1McGoD7j3VPuR+jmVeQEQrg=; b=ACYKGlzI8kIMQjfd1ZZm694Fw zlkz9WREA4sVNTZkwofvKvzohuITHytQJXydEXoCFuMyl5oDybAXqqxTk96wEnI2mlZBEnOR5JU8F 2pdREuZH4TPkNaBZGmUQUJKx7FZq4TreYP/V9XY0+Pn9pPlgermX/xiTb7WWqhkp7dtMFgB9z0eZc 4P4seQolb/kgilrq7Raqd5XMMA5Rly8rHXvHOAIvc+pLstju0ArdcG1YTUZj63ChIbzG9Tx6lkfyU 73ZHUHyQyCKUlib+uvTYVFTPtotAmdluTmfwewvGUl4Msn3sdQea7SyrWmgA1c+4cCpFI14zIs/7Z jjOFbJKZQ==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o7-LC; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003xF-Fk; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Michael Krufky Subject: [PATCH 12/13] media: mxl111sf: declare its own pads Date: Wed, 1 Aug 2018 12:55:14 -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. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 10 +++++----- drivers/media/usb/dvb-usb-v2/mxl111sf.h | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index 51a1b26199e6..7454672fbec9 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c @@ -892,13 +892,13 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap) #ifdef CONFIG_MEDIA_CONTROLLER_DVB state->tuner.function = MEDIA_ENT_F_TUNER; state->tuner.name = "mxl111sf tuner"; - state->tuner_pads[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; - state->tuner_pads[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; - state->tuner_pads[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; - state->tuner_pads[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_TV_CARRIERS; + state->tuner_pads[MXL111SF_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->tuner_pads[MXL111SF_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; + state->tuner_pads[MXL111SF_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; + state->tuner_pads[MXL111SF_PAD_OUTPUT].sig_type = PAD_SIGNAL_TV_CARRIERS; ret = media_entity_pads_init(&state->tuner, - TUNER_NUM_PADS, state->tuner_pads); + MXL111SF_NUM_PADS, state->tuner_pads); if (ret) return ret; diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.h b/drivers/media/usb/dvb-usb-v2/mxl111sf.h index 22253d4908eb..ed98654ba7fd 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.h @@ -52,6 +52,12 @@ struct mxl111sf_adap_state { int (*fe_sleep)(struct dvb_frontend *); }; +enum mxl111sf_pads { + MXL111SF_PAD_RF_INPUT, + MXL111SF_PAD_OUTPUT, + MXL111SF_NUM_PADS +}; + struct mxl111sf_state { struct dvb_usb_device *d; @@ -94,7 +100,7 @@ struct mxl111sf_state { struct mutex msg_lock; #ifdef CONFIG_MEDIA_CONTROLLER_DVB struct media_entity tuner; - struct media_pad tuner_pads[2]; + struct media_pad tuner_pads[MXL111SF_NUM_PADS]; #endif }; From patchwork Wed Aug 1 15:55:15 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: 10552569 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 6C8C49093 for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B9A92A163 for ; Wed, 1 Aug 2018 15:55:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FD502A20C; Wed, 1 Aug 2018 15:55:24 +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 D61A12A163 for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389927AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56474 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389863AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -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=1ol2Yfrz6PuDEnTIUvoOrJziFKYJZuzueN+cOLXbh/M=; b=CpqI2EahSCIODO/3HgmwVUfs0 b1sVDs6GGBPokoqjdJUTT2OV170ZK4bFWjQSxz8MTyBeJYJ+phYTH/YMHMqnFB6wg6BkD9R68yrl2 RgdvWbcZi0f/M+FOUl2n/zLzbDYAD/ow9QBWfne1gfme4U3+42NtaHUWaypqptRE2eZZFjFBen6OD CGPp+DMT319sN8AjClq1Cu+gxo4vG1eVAnbqAS9RkWsbKqqQx0QzNBOQaU9SUtLA8XGgujbU5P8d+ XVX6OMkEA9PabLlD+Wi+PicRpkcPrrGd37Eye/Mxya25qGZLX4sbI3nTZs31WB2vIu8RiAHhtCUjc 1bFHNl64w==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005o8-LN; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003xK-Gk; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil Subject: [PATCH 13/13] media: v4l2-mc: get rid of global pad indexes Date: Wed, 1 Aug 2018 12:55:15 -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 Now that all drivers are using pad signal types, we can get rid of the global static definition, as routes are stablished using the pad signal type. The tuner and IF-PLL pads are now used only by the tuner core, so move the definitions to be there. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/tuner-core.c | 13 +++++ include/media/v4l2-mc.h | 76 ---------------------------- 2 files changed, 13 insertions(+), 76 deletions(-) diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index d4c32ccd0930..e35438ca0b50 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v4l2-core/tuner-core.c @@ -97,6 +97,19 @@ static const struct v4l2_subdev_ops tuner_ops; * Internal struct used inside the driver */ +enum tuner_pad_index { + TUNER_PAD_RF_INPUT, + TUNER_PAD_OUTPUT, + TUNER_PAD_AUD_OUT, + TUNER_NUM_PADS +}; + +enum if_vid_dec_pad_index { + IF_VID_DEC_PAD_IF_INPUT, + IF_VID_DEC_PAD_OUT, + IF_VID_DEC_PAD_NUM_PADS +}; + struct tuner { /* device */ struct dvb_frontend fe; diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h index 7c9c781b16a9..bf5043c1ab6b 100644 --- a/include/media/v4l2-mc.h +++ b/include/media/v4l2-mc.h @@ -23,82 +23,6 @@ #include #include -/** - * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER - * - * @TUNER_PAD_RF_INPUT: Radiofrequency (RF) sink pad, usually linked to a - * RF connector entity. - * @TUNER_PAD_OUTPUT: Tuner video output source pad. Contains the video - * chrominance and luminance or the hole bandwidth - * of the signal converted to an Intermediate Frequency - * (IF) or to baseband (on zero-IF tuners). - * @TUNER_PAD_AUD_OUT: Tuner audio output source pad. Tuners used to decode - * analog TV signals have an extra pad for audio output. - * Old tuners use an analog stage with a saw filter for - * the audio IF frequency. The output of the pad is, in - * this case, the audio IF, with should be decoded either - * by the bridge chipset (that's the case of cx2388x - * chipsets) or may require an external IF sound - * processor, like msp34xx. On modern silicon tuners, - * the audio IF decoder is usually incorporated at the - * tuner. On such case, the output of this pad is an - * audio sampled data. - * @TUNER_NUM_PADS: Number of pads of the tuner. - */ -enum tuner_pad_index { - TUNER_PAD_RF_INPUT, - TUNER_PAD_OUTPUT, - TUNER_PAD_AUD_OUT, - TUNER_NUM_PADS -}; - -/** - * enum if_vid_dec_pad_index - video IF-PLL pad index for - * MEDIA_ENT_F_IF_VID_DECODER - * - * @IF_VID_DEC_PAD_IF_INPUT: video Intermediate Frequency (IF) sink pad - * @IF_VID_DEC_PAD_OUT: IF-PLL video output source pad. Contains the - * video chrominance and luminance IF signals. - * @IF_VID_DEC_PAD_NUM_PADS: Number of pads of the video IF-PLL. - */ -enum if_vid_dec_pad_index { - IF_VID_DEC_PAD_IF_INPUT, - IF_VID_DEC_PAD_OUT, - IF_VID_DEC_PAD_NUM_PADS -}; - -/** - * enum if_aud_dec_pad_index - audio/sound IF-PLL pad index for - * MEDIA_ENT_F_IF_AUD_DECODER - * - * @IF_AUD_DEC_PAD_IF_INPUT: audio Intermediate Frequency (IF) sink pad - * @IF_AUD_DEC_PAD_OUT: IF-PLL audio output source pad. Contains the - * audio sampled stream data, usually connected - * to the bridge bus via an Inter-IC Sound (I2S) - * bus. - * @IF_AUD_DEC_PAD_NUM_PADS: Number of pads of the audio IF-PLL. - */ -enum if_aud_dec_pad_index { - IF_AUD_DEC_PAD_IF_INPUT, - IF_AUD_DEC_PAD_OUT, - IF_AUD_DEC_PAD_NUM_PADS -}; - -/** - * enum demod_pad_index - analog TV pad index for MEDIA_ENT_F_ATV_DECODER - * - * @DEMOD_PAD_IF_INPUT: IF input sink pad. - * @DEMOD_PAD_VID_OUT: Video output source pad. - * @DEMOD_PAD_AUDIO_OUT: Audio output source pad. - * @DEMOD_NUM_PADS: Maximum number of output pads. - */ -enum demod_pad_index { - DEMOD_PAD_IF_INPUT, - DEMOD_PAD_VID_OUT, - DEMOD_PAD_AUDIO_OUT, - DEMOD_NUM_PADS -}; - /* We don't need to include pci.h or usb.h here */ struct pci_dev; struct usb_device;