From patchwork Thu Aug 22 08:05:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 1151359 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46DcYJ6nncz9sML for ; Thu, 22 Aug 2019 18:06:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732000AbfHVIGL (ORCPT ); Thu, 22 Aug 2019 04:06:11 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:45117 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731618AbfHVIGK (ORCPT ); Thu, 22 Aug 2019 04:06:10 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0i6a-0005Xu-05; Thu, 22 Aug 2019 10:06:00 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i0i6X-0005WW-NH; Thu, 22 Aug 2019 10:05:57 +0200 From: Marco Felsch To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: devicetree@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org Subject: [PATCH v9 01/13] dt-bindings: connector: analog: add sdtv standards property Date: Thu, 22 Aug 2019 10:05:44 +0200 Message-Id: <20190822080556.17109-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822080556.17109-1-m.felsch@pengutronix.de> References: <20190822080556.17109-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some connectors no matter if in- or output supports only a limited range of sdtv standards. It doesn't matter if the hardware behind that connector supports more than the listed formats since the users are restriced by a label e.g. to plug only a camera into this connector which uses the PAL format. This patch adds the capability to describe such limitation within the firmware. There are no format restrictions if the property isn't present, so it's completely backward compatible. Signed-off-by: Marco Felsch Reviewed-by: Rob Herring --- [1] https://patchwork.kernel.org/cover/10794703/ v8: Hi Rob, I dropped your r b tag becuase of the changes I made in this version. Please can you have look on it again? Luckily this would be the last time ;-) - move definition to include/dt-bindings/display - rename tvnorms.h to sdtv-standards.h - TVORMS_* -> SDTV_STD_* - add sync comments - adapt commit message - fix bindings documentation v7: I kept Robs r b tag because I only changed the example and extended TVNORM_* macros. - fix some style issues - add TVNORM_NTSC, TVNORM_525_60 and TVNORM_625_50 v6: - tvnorms.h: use tabs instead of spaces - tvnorms.h: add TVNORM_PAL and TVNORM_SECAM - tvnorms.h: drop rarely used TVNORM_ATSC_* norms v2-v4: - nothing since the patch was squashed from series [1] into this series. --- .../display/connector/analog-tv-connector.txt | 6 ++ include/dt-bindings/display/sdtv-standards.h | 76 +++++++++++++++++++ include/uapi/linux/videodev2.h | 4 + 3 files changed, 86 insertions(+) create mode 100644 include/dt-bindings/display/sdtv-standards.h diff --git a/Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt b/Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt index 0c0970c210ab..883bcb2604c7 100644 --- a/Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt +++ b/Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt @@ -6,16 +6,22 @@ Required properties: Optional properties: - label: a symbolic name for the connector +- sdtv-standards: limit the supported TV standards on a connector to the given + ones. If not specified all TV standards are allowed. + Possible TV standards are defined in + include/dt-bindings/display/sdtv-standards.h. Required nodes: - Video port for TV input Example ------- +#include tv: connector { compatible = "composite-video-connector"; label = "tv"; + sdtv-standards = <(SDTV_STD_PAL | SDTV_STD_NTSC)>; port { tv_connector_in: endpoint { diff --git a/include/dt-bindings/display/sdtv-standards.h b/include/dt-bindings/display/sdtv-standards.h new file mode 100644 index 000000000000..bb6966505a6c --- /dev/null +++ b/include/dt-bindings/display/sdtv-standards.h @@ -0,0 +1,76 @@ +/* SPDX-License-Identifier: GPL-2.0-only or X11 */ +/* + * Copyright 2019 Pengutronix, Marco Felsch + */ + +#ifndef _DT_BINDINGS_DISPLAY_SDTV_STDS_H +#define _DT_BINDINGS_DISPLAY_SDTV_STDS_H + +/* + * Attention: Keep the TV_STD_* bit definitions in sync with + * include/uapi/linux/videodev2.h V4L2_STD_* bit definitions. + */ +/* One bit for each standard */ +#define SDTV_STD_PAL_B 0x00000001 +#define SDTV_STD_PAL_B1 0x00000002 +#define SDTV_STD_PAL_G 0x00000004 +#define SDTV_STD_PAL_H 0x00000008 +#define SDTV_STD_PAL_I 0x00000010 +#define SDTV_STD_PAL_D 0x00000020 +#define SDTV_STD_PAL_D1 0x00000040 +#define SDTV_STD_PAL_K 0x00000080 + +#define SDTV_STD_PAL (SDTV_STD_PAL_B | \ + SDTV_STD_PAL_B1 | \ + SDTV_STD_PAL_G | \ + SDTV_STD_PAL_H | \ + SDTV_STD_PAL_I | \ + SDTV_STD_PAL_D | \ + SDTV_STD_PAL_D1 | \ + SDTV_STD_PAL_K) + +#define SDTV_STD_PAL_M 0x00000100 +#define SDTV_STD_PAL_N 0x00000200 +#define SDTV_STD_PAL_Nc 0x00000400 +#define SDTV_STD_PAL_60 0x00000800 + +#define SDTV_STD_NTSC_M 0x00001000 /* BTSC */ +#define SDTV_STD_NTSC_M_JP 0x00002000 /* EIA-J */ +#define SDTV_STD_NTSC_443 0x00004000 +#define SDTV_STD_NTSC_M_KR 0x00008000 /* FM A2 */ + +#define SDTV_STD_NTSC (SDTV_STD_NTSC_M | \ + SDTV_STD_NTSC_M_JP | \ + SDTV_STD_NTSC_M_KR) + +#define SDTV_STD_SECAM_B 0x00010000 +#define SDTV_STD_SECAM_D 0x00020000 +#define SDTV_STD_SECAM_G 0x00040000 +#define SDTV_STD_SECAM_H 0x00080000 +#define SDTV_STD_SECAM_K 0x00100000 +#define SDTV_STD_SECAM_K1 0x00200000 +#define SDTV_STD_SECAM_L 0x00400000 +#define SDTV_STD_SECAM_LC 0x00800000 + +#define SDTV_STD_SECAM (SDTV_STD_SECAM_B | \ + SDTV_STD_SECAM_D | \ + SDTV_STD_SECAM_G | \ + SDTV_STD_SECAM_H | \ + SDTV_STD_SECAM_K | \ + SDTV_STD_SECAM_K1 | \ + SDTV_STD_SECAM_L | \ + SDTV_STD_SECAM_LC) + +/* Standards for Countries with 60Hz Line frequency */ +#define SDTV_STD_525_60 (SDTV_STD_PAL_M | \ + SDTV_STD_PAL_60 | \ + SDTV_STD_NTSC | \ + SDTV_STD_NTSC_443) + +/* Standards for Countries with 50Hz Line frequency */ +#define SDTV_STD_625_50 (SDTV_STD_PAL | \ + SDTV_STD_PAL_N | \ + SDTV_STD_PAL_Nc | \ + SDTV_STD_SECAM) + +#endif /* _DT_BINDINGS_DISPLAY_SDTV_STDS_H */ diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 530638dffd93..c358cc34fc34 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1208,6 +1208,10 @@ struct v4l2_selection { typedef __u64 v4l2_std_id; +/* + * Attention: Keep the V4L2_STD_* bit definitions in sync with + * include/dt-bindings/display/sdtv-standards.h TV_STD_* bit definitions. + */ /* one bit for each */ #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001) #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002) From patchwork Thu Aug 22 08:05:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 1151357 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46DcYH2MF5z9sNC for ; Thu, 22 Aug 2019 18:06:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731364AbfHVIGI (ORCPT ); Thu, 22 Aug 2019 04:06:08 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:36505 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731366AbfHVIGH (ORCPT ); Thu, 22 Aug 2019 04:06:07 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0i6a-0005Xx-Jh; Thu, 22 Aug 2019 10:06:00 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i0i6X-0005Wj-Ph; Thu, 22 Aug 2019 10:05:57 +0200 From: Marco Felsch To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: devicetree@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org, Javier Martinez Canillas , Mauro Carvalho Chehab , Rob Herring Subject: [PATCH v9 04/13] partial revert of "[media] tvp5150: add HW input connectors support" Date: Thu, 22 Aug 2019 10:05:47 +0200 Message-Id: <20190822080556.17109-5-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822080556.17109-1-m.felsch@pengutronix.de> References: <20190822080556.17109-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Javier Martinez Canillas Commit f7b4b54e6364 ("[media] tvp5150: add HW input connectors support") added input signals support for the tvp5150, but the approach was found to be incorrect so the corresponding DT binding commit 82c2ffeb217a ("[media] tvp5150: document input connectors DT bindings") was reverted. This left the driver with an undocumented (and wrong) DT parsing logic, so lets get rid of this code as well until the input connectors support is implemented properly. It's a partial revert due other patches added on top of mentioned commit not allowing the commit to be reverted cleanly anymore. But all the code related to the DT parsing logic and input entities creation are removed. Suggested-by: Laurent Pinchart Signed-off-by: Javier Martinez Canillas Acked-by: Laurent Pinchart [m.felsch@pengutronix.de: rm TVP5150_INPUT_NUM define] Signed-off-by: Marco Felsch Signed-off-by: Mauro Carvalho Chehab Acked-by: Rob Herring --- drivers/media/i2c/tvp5150.c | 145 ---------------------------- include/dt-bindings/media/tvp5150.h | 2 - 2 files changed, 147 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index edad49cebcdf..11a5fd7e2f58 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -53,8 +53,6 @@ struct tvp5150 { struct v4l2_subdev sd; #ifdef CONFIG_MEDIA_CONTROLLER struct media_pad pads[TVP5150_NUM_PADS]; - struct media_entity input_ent[TVP5150_INPUT_NUM]; - struct media_pad input_pad[TVP5150_INPUT_NUM]; #endif struct v4l2_ctrl_handler hdl; struct v4l2_rect rect; @@ -1169,40 +1167,6 @@ static int tvp5150_enum_frame_size(struct v4l2_subdev *sd, return 0; } -/**************************************************************************** - Media entity ops - ****************************************************************************/ - -#ifdef CONFIG_MEDIA_CONTROLLER -static int tvp5150_link_setup(struct media_entity *entity, - const struct media_pad *local, - const struct media_pad *remote, u32 flags) -{ - struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); - struct tvp5150 *decoder = to_tvp5150(sd); - int i; - - for (i = 0; i < TVP5150_INPUT_NUM; i++) { - if (remote->entity == &decoder->input_ent[i]) - break; - } - - /* Do nothing for entities that are not input connectors */ - if (i == TVP5150_INPUT_NUM) - return 0; - - decoder->input = i; - - tvp5150_selmux(sd); - - return 0; -} - -static const struct media_entity_operations tvp5150_sd_media_ops = { - .link_setup = tvp5150_link_setup, -}; -#endif - /**************************************************************************** I2C Command ****************************************************************************/ @@ -1350,42 +1314,6 @@ static int tvp5150_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) return 0; } -static int tvp5150_registered(struct v4l2_subdev *sd) -{ -#ifdef CONFIG_MEDIA_CONTROLLER - struct tvp5150 *decoder = to_tvp5150(sd); - int ret = 0; - int i; - - for (i = 0; i < TVP5150_INPUT_NUM; i++) { - struct media_entity *input = &decoder->input_ent[i]; - struct media_pad *pad = &decoder->input_pad[i]; - - if (!input->name) - continue; - - decoder->input_pad[i].flags = MEDIA_PAD_FL_SOURCE; - - ret = media_entity_pads_init(input, 1, pad); - if (ret < 0) - return ret; - - ret = media_device_register_entity(sd->v4l2_dev->mdev, input); - if (ret < 0) - return ret; - - ret = media_create_pad_link(input, 0, &sd->entity, - TVP5150_PAD_IF_INPUT, 0); - if (ret < 0) { - media_device_unregister_entity(input); - return ret; - } - } -#endif - - return 0; -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_ctrl_ops tvp5150_ctrl_ops = { @@ -1439,10 +1367,6 @@ static const struct v4l2_subdev_ops tvp5150_ops = { .pad = &tvp5150_pad_ops, }; -static const struct v4l2_subdev_internal_ops tvp5150_internal_ops = { - .registered = tvp5150_registered, -}; - /**************************************************************************** I2C Client & Driver ****************************************************************************/ @@ -1595,12 +1519,6 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np) { struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 }; struct device_node *ep; -#ifdef CONFIG_MEDIA_CONTROLLER - struct device_node *connectors, *child; - struct media_entity *input; - const char *name; - u32 input_type; -#endif unsigned int flags; int ret = 0; @@ -1624,67 +1542,6 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np) decoder->mbus_type = bus_cfg.bus_type; -#ifdef CONFIG_MEDIA_CONTROLLER - connectors = of_get_child_by_name(np, "connectors"); - - if (!connectors) - goto err; - - for_each_available_child_of_node(connectors, child) { - ret = of_property_read_u32(child, "input", &input_type); - if (ret) { - dev_err(decoder->sd.dev, - "missing type property in node %pOFn\n", - child); - of_node_put(child); - goto err_connector; - } - - if (input_type >= TVP5150_INPUT_NUM) { - ret = -EINVAL; - of_node_put(child); - goto err_connector; - } - - input = &decoder->input_ent[input_type]; - - /* Each input connector can only be defined once */ - if (input->name) { - dev_err(decoder->sd.dev, - "input %s with same type already exists\n", - input->name); - of_node_put(child); - ret = -EINVAL; - goto err_connector; - } - - switch (input_type) { - case TVP5150_COMPOSITE0: - case TVP5150_COMPOSITE1: - input->function = MEDIA_ENT_F_CONN_COMPOSITE; - break; - case TVP5150_SVIDEO: - input->function = MEDIA_ENT_F_CONN_SVIDEO; - break; - } - - input->flags = MEDIA_ENT_FL_CONNECTOR; - - ret = of_property_read_string(child, "label", &name); - if (ret < 0) { - dev_err(decoder->sd.dev, - "missing label property in node %pOFn\n", - child); - of_node_put(child); - goto err_connector; - } - - input->name = name; - } - -err_connector: - of_node_put(connectors); -#endif err: of_node_put(ep); return ret; @@ -1735,7 +1592,6 @@ static int tvp5150_probe(struct i2c_client *c) } v4l2_i2c_subdev_init(sd, c, &tvp5150_ops); - sd->internal_ops = &tvp5150_internal_ops; sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; #if defined(CONFIG_MEDIA_CONTROLLER) @@ -1750,7 +1606,6 @@ static int tvp5150_probe(struct i2c_client *c) if (res < 0) return res; - sd->entity.ops = &tvp5150_sd_media_ops; #endif res = tvp5150_detect_version(core); diff --git a/include/dt-bindings/media/tvp5150.h b/include/dt-bindings/media/tvp5150.h index 01eedf4985b8..dda00c038530 100644 --- a/include/dt-bindings/media/tvp5150.h +++ b/include/dt-bindings/media/tvp5150.h @@ -14,8 +14,6 @@ #define TVP5150_COMPOSITE1 1 #define TVP5150_SVIDEO 2 -#define TVP5150_INPUT_NUM 3 - /* TVP5150 HW outputs */ #define TVP5150_NORMAL 0 #define TVP5150_BLACK_SCREEN 1 From patchwork Thu Aug 22 08:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 1151358 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46DcYH6BTgz9sNk for ; Thu, 22 Aug 2019 18:06:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731365AbfHVIGI (ORCPT ); Thu, 22 Aug 2019 04:06:08 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35709 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfHVIGH (ORCPT ); Thu, 22 Aug 2019 04:06:07 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0i6a-0005Y0-0D; Thu, 22 Aug 2019 10:06:00 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i0i6X-0005Wx-Qs; Thu, 22 Aug 2019 10:05:57 +0200 From: Marco Felsch To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: devicetree@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org, Rob Herring Subject: [PATCH v9 06/13] media: dt-bindings: tvp5150: Add input port connectors DT bindings Date: Thu, 22 Aug 2019 10:05:49 +0200 Message-Id: <20190822080556.17109-7-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822080556.17109-1-m.felsch@pengutronix.de> References: <20190822080556.17109-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The TVP5150/1 decoders support different video input sources to their AIP1A/B pins. Possible configurations are as follows: - Analog Composite signal connected to AIP1A. - Analog Composite signal connected to AIP1B. - Analog S-Video Y (luminance) and C (chrominance) signals connected to AIP1A and AIP1B respectively. This patch extends the device tree bindings documentation to describe how the input connectors for these devices should be defined in a DT. Signed-off-by: Marco Felsch Reviewed-by: Rob Herring --- Changelog: v7: Hi Rob, I droped your r b tag because I changed the bindings in this patch version. Please can you have a look on it again? - fix missing AIP1B svideo connection (description and examples) v3: - remove examples for one and two inputs - replace space by tabs v2: - adapt port layout in accordance with https://www.spinics.net/lists/linux-media/msg138546.html with the svideo-connector deviation (use only one endpoint) --- .../devicetree/bindings/media/i2c/tvp5150.txt | 112 ++++++++++++++++-- 1 file changed, 105 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt index 8c0fc1a26bf0..28b64ad149ef 100644 --- a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt +++ b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt @@ -12,11 +12,32 @@ Optional Properties: - pdn-gpios: phandle for the GPIO connected to the PDN pin, if any. - reset-gpios: phandle for the GPIO connected to the RESETB pin, if any. -The device node must contain one 'port' child node for its digital output -video port, in accordance with the video interface bindings defined in -Documentation/devicetree/bindings/media/video-interfaces.txt. +The device node must contain one 'port' child node per device physical input +and output port, in accordance with the video interface bindings defined in +Documentation/devicetree/bindings/media/video-interfaces.txt. The port nodes +are numbered as follows -Required Endpoint Properties for parallel synchronization: + Name Type Port + -------------------------------------- + AIP1A sink 0 + AIP1B sink 1 + Y-OUT src 2 + +The device node must contain at least one sink port and the src port. Each input +port must be linked to an endpoint defined in +Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt. The +port/connector layout is as follows + +tvp-5150 port@0 (AIP1A) + endpoint@0 -----------> Comp0-Con port + endpoint@1 ------+----> Svideo-Con port +tvp-5150 port@1 (AIP1B) | + endpoint@1 ------+ + endpoint@0 -----------> Comp1-Con port +tvp-5150 port@2 + endpoint (video bitstream output at YOUT[0-7] parallel bus) + +Required Endpoint Properties for parallel synchronization on output port: - hsync-active: active state of the HSYNC signal. Must be <1> (HIGH). - vsync-active: active state of the VSYNC signal. Must be <1> (HIGH). @@ -26,17 +47,94 @@ Required Endpoint Properties for parallel synchronization: If none of hsync-active, vsync-active and field-even-active is specified, the endpoint is assumed to use embedded BT.656 synchronization. -Example: +Example - three input sources: + +comp_connector_0 { + compatible = "composite-video-connector"; + label = "Composite0"; + + port { + composite0_to_tvp5150: endpoint { + remote-endpoint = <&tvp5150_to_composite0>; + }; + }; +}; + +comp_connector_1 { + compatible = "composite-video-connector"; + label = "Composite1"; + + port { + composite1_to_tvp5150: endpoint { + remote-endpoint = <&tvp5150_to_composite1>; + }; + }; +}; + +svideo_connector { + compatible = "svideo-connector"; + label = "S-Video"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + svideo_luma_to_tvp5150: endpoint@0 { + reg = <0>; + remote-endpoint = <&tvp5150_to_svideo_luma>; + }; + + svideo_chroma_to_tvp5150: endpoint@1 { + reg = <1>; + remote-endpoint = <&tvp5150_to_svideo_chroma>; + }; + }; +}; &i2c2 { - ... tvp5150@5c { compatible = "ti,tvp5150"; reg = <0x5c>; pdn-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>; + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tvp5150_to_composite0: endpoint@0 { + reg = <0>; + remote-endpoint = <&composite0_to_tvp5150>; + }; + + tvp5150_to_svideo_luma: endpoint@1 { + reg = <1>; + remote-endpoint = <&svideo_luma_to_tvp5150>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + tvp5150_to_composite1: endpoint@0 { + reg = <0>; + remote-endpoint = <&composite1_to_tvp5150>; + }; + + tvp5150_to_svideo_chroma: endpoint@1 { + reg = <1>; + remote-endpoint = <&svideo_chroma_to_tvp5150>; + }; + }; + + port@2 { + reg = <2>; - port { tvp5150_1: endpoint { remote-endpoint = <&ccdc_ep>; }; From patchwork Thu Aug 22 08:05:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 1151356 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46DcYD3MRVz9sML for ; Thu, 22 Aug 2019 18:06:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731415AbfHVIGH (ORCPT ); Thu, 22 Aug 2019 04:06:07 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:37377 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731365AbfHVIGH (ORCPT ); Thu, 22 Aug 2019 04:06:07 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0i6d-0005Y5-Hh; Thu, 22 Aug 2019 10:06:03 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i0i6X-0005XA-Ts; Thu, 22 Aug 2019 10:05:57 +0200 From: Marco Felsch To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: devicetree@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org, Rob Herring Subject: [PATCH v9 10/13] media: dt-bindings: tvp5150: cleanup bindings stlye Date: Thu, 22 Aug 2019 10:05:53 +0200 Message-Id: <20190822080556.17109-11-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822080556.17109-1-m.felsch@pengutronix.de> References: <20190822080556.17109-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Use underlines to highlight optional and required properties. This is quite common for all bindings. Align descriptions and start sentence with uppercase letter. Also reword the usage of the required endpoint properties for the output port in case BT.656 should be used. Signed-off-by: Marco Felsch Reviewed-by: Rob Herring --- .../devicetree/bindings/media/i2c/tvp5150.txt | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt index 28b64ad149ef..cc98b38c7e73 100644 --- a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt +++ b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt @@ -5,12 +5,14 @@ The TVP5150 and TVP5151 are video decoders that convert baseband NTSC and PAL with discrete syncs or 8-bit ITU-R BT.656 with embedded syncs output formats. Required Properties: -- compatible: value must be "ti,tvp5150" -- reg: I2C slave address +==================== +- compatible: Value must be "ti,tvp5150". +- reg: I2C slave address. Optional Properties: -- pdn-gpios: phandle for the GPIO connected to the PDN pin, if any. -- reset-gpios: phandle for the GPIO connected to the RESETB pin, if any. +==================== +- pdn-gpios: Phandle for the GPIO connected to the PDN pin, if any. +- reset-gpios: Phandle for the GPIO connected to the RESETB pin, if any. The device node must contain one 'port' child node per device physical input and output port, in accordance with the video interface bindings defined in @@ -24,9 +26,8 @@ are numbered as follows Y-OUT src 2 The device node must contain at least one sink port and the src port. Each input -port must be linked to an endpoint defined in -Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt. The -port/connector layout is as follows +port must be linked to an endpoint defined in [1]. The port/connector layout is +as follows tvp-5150 port@0 (AIP1A) endpoint@0 -----------> Comp0-Con port @@ -38,14 +39,17 @@ tvp-5150 port@2 endpoint (video bitstream output at YOUT[0-7] parallel bus) Required Endpoint Properties for parallel synchronization on output port: +========================================================================= -- hsync-active: active state of the HSYNC signal. Must be <1> (HIGH). -- vsync-active: active state of the VSYNC signal. Must be <1> (HIGH). -- field-even-active: field signal level during the even field data - transmission. Must be <0>. +- hsync-active: Active state of the HSYNC signal. Must be <1> (HIGH). +- vsync-active: Active state of the VSYNC signal. Must be <1> (HIGH). +- field-even-active: Field signal level during the even field data + transmission. Must be <0>. -If none of hsync-active, vsync-active and field-even-active is specified, -the endpoint is assumed to use embedded BT.656 synchronization. +Note: Do not specify any of these properties if you want to use the embedded + BT.656 synchronization. + +[1] Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt. Example - three input sources: From patchwork Thu Aug 22 08:05:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 1151361 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46DcYR6b0Nz9sBp for ; Thu, 22 Aug 2019 18:06:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731956AbfHVIGJ (ORCPT ); Thu, 22 Aug 2019 04:06:09 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44275 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731389AbfHVIGI (ORCPT ); Thu, 22 Aug 2019 04:06:08 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0i6d-0005Y4-Hg; Thu, 22 Aug 2019 10:06:03 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i0i6X-0005XE-UV; Thu, 22 Aug 2019 10:05:57 +0200 From: Marco Felsch To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, jacopo+renesas@jmondi.org, robh+dt@kernel.org, laurent.pinchart@ideasonboard.com Cc: devicetree@vger.kernel.org, kernel@pengutronix.de, linux-media@vger.kernel.org, Rob Herring Subject: [PATCH v9 11/13] media: dt-bindings: tvp5150: add optional sdtv standards documentation Date: Thu, 22 Aug 2019 10:05:54 +0200 Message-Id: <20190822080556.17109-12-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822080556.17109-1-m.felsch@pengutronix.de> References: <20190822080556.17109-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Document the optional binding to limit the possible sdtv standards on the input connectors. Signed-off-by: Marco Felsch Reviewed-by: Rob Herring v8: - adapt to new sdtv-standards - adapt commit message - fix missing include within example code --- .../devicetree/bindings/media/i2c/tvp5150.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt index cc98b38c7e73..f876b79c335f 100644 --- a/Documentation/devicetree/bindings/media/i2c/tvp5150.txt +++ b/Documentation/devicetree/bindings/media/i2c/tvp5150.txt @@ -49,13 +49,22 @@ Required Endpoint Properties for parallel synchronization on output port: Note: Do not specify any of these properties if you want to use the embedded BT.656 synchronization. +Optional Connector Properties: +============================== + +- sdtv-standards: Set the possible signals to which the hardware tries to lock + instead of using the autodetection mechnism. Please look at + [1] for more information. + [1] Documentation/devicetree/bindings/display/connector/analog-tv-connector.txt. Example - three input sources: +#include comp_connector_0 { compatible = "composite-video-connector"; label = "Composite0"; + sdtv-standards = ; /* limit to pal-m signals */ port { composite0_to_tvp5150: endpoint { @@ -67,6 +76,7 @@ comp_connector_0 { comp_connector_1 { compatible = "composite-video-connector"; label = "Composite1"; + sdtv-standards = ; /* limit to ntsc-m signals */ port { composite1_to_tvp5150: endpoint {