From patchwork Wed Jun 10 12:46:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597841 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1460914E3 for ; Wed, 10 Jun 2020 12:46:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06E4F20760 for ; Wed, 10 Jun 2020 12:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbgFJMqc (ORCPT ); Wed, 10 Jun 2020 08:46:32 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50548 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqb (ORCPT ); Wed, 10 Jun 2020 08:46:31 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DEBC12C1; Wed, 10 Jun 2020 14:46:27 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 1/9] fixes! [max9286]: Fix whitespace indent Date: Wed, 10 Jun 2020 13:46:15 +0100 Message-Id: <20200610124623.51085-2-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Fix a minor 8space->tab conversion Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 590f384161a5..ef824d2b26b8 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -813,7 +813,7 @@ static int max9286_s_ctrl(struct v4l2_ctrl *ctrl) } static const struct v4l2_ctrl_ops max9286_ctrl_ops = { - .s_ctrl = max9286_s_ctrl, + .s_ctrl = max9286_s_ctrl, }; static int max9286_v4l2_register(struct max9286_priv *priv) From patchwork Wed Jun 10 12:46:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597843 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DAFF138C for ; Wed, 10 Jun 2020 12:46:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F3E92074B for ; Wed, 10 Jun 2020 12:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728933AbgFJMqf (ORCPT ); Wed, 10 Jun 2020 08:46:35 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50566 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqe (ORCPT ); Wed, 10 Jun 2020 08:46:34 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D1FCFD1; Wed, 10 Jun 2020 14:46:28 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 2/9] fixes! [max9286]: Validate link formats Date: Wed, 10 Jun 2020 13:46:16 +0100 Message-Id: <20200610124623.51085-3-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Disallow setting a format on the source link, but enable link validation by returning the format of the first bound source when getting the format of the source pad. Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index ef824d2b26b8..7e59391a5736 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -711,7 +711,11 @@ static int max9286_set_fmt(struct v4l2_subdev *sd, struct max9286_priv *priv = sd_to_max9286(sd); struct v4l2_mbus_framefmt *cfg_fmt; - if (format->pad >= MAX9286_SRC_PAD) + /* TODO: + * Multiplexed Stream Support: Prevent setting the format on the shared + * multiplexed bus. + */ + if (format->pad == MAX9286_SRC_PAD) return -EINVAL; /* Refuse non YUV422 formats as we hardcode DT to 8 bit YUV422 */ @@ -743,11 +747,18 @@ static int max9286_get_fmt(struct v4l2_subdev *sd, { struct max9286_priv *priv = sd_to_max9286(sd); struct v4l2_mbus_framefmt *cfg_fmt; + unsigned int pad = format->pad; - if (format->pad >= MAX9286_SRC_PAD) - return -EINVAL; + /* TODO: + * Multiplexed Stream Support: Support link validation by returning the + * format of the first bound link. All links must have the same format, + * as we do not support mixing, and matching of cameras connected to + * the max9286. + */ + if (pad == MAX9286_SRC_PAD) + pad = __ffs(priv->bound_sources); - cfg_fmt = max9286_get_pad_format(priv, cfg, format->pad, format->which); + cfg_fmt = max9286_get_pad_format(priv, cfg, pad, format->which); if (!cfg_fmt) return -EINVAL; From patchwork Wed Jun 10 12:46:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597849 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 289CD138C for ; Wed, 10 Jun 2020 12:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1051720760 for ; Wed, 10 Jun 2020 12:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728986AbgFJMqi (ORCPT ); Wed, 10 Jun 2020 08:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqi (ORCPT ); Wed, 10 Jun 2020 08:46:38 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21348C03E96B for ; Wed, 10 Jun 2020 05:46:37 -0700 (PDT) Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B304BFD2; Wed, 10 Jun 2020 14:46:28 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 3/9] fixes! [max9286]: Use single sample per pixel Date: Wed, 10 Jun 2020 13:46:17 +0100 Message-Id: <20200610124623.51085-4-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham MBUS formats for a serial bus should be specified as a single sample point. This change requires updating user-space test scripts to configure as 1x16 accordingly: - media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_2X8/1280x800 field:none]" + media-ctl -d $mdev -V "'$CSI':$IDX [fmt:UYVY8_1X16/1280x800 field:none]" Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 7e59391a5736..807024a9a149 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -684,7 +684,7 @@ static int max9286_enum_mbus_code(struct v4l2_subdev *sd, if (code->pad || code->index > 0) return -EINVAL; - code->code = MEDIA_BUS_FMT_UYVY8_2X8; + code->code = MEDIA_BUS_FMT_UYVY8_1X16; return 0; } @@ -720,13 +720,13 @@ static int max9286_set_fmt(struct v4l2_subdev *sd, /* Refuse non YUV422 formats as we hardcode DT to 8 bit YUV422 */ switch (format->format.code) { - case MEDIA_BUS_FMT_UYVY8_2X8: - case MEDIA_BUS_FMT_VYUY8_2X8: - case MEDIA_BUS_FMT_YUYV8_2X8: - case MEDIA_BUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_VYUY8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YVYU8_1X16: break; default: - format->format.code = MEDIA_BUS_FMT_UYVY8_2X8; + format->format.code = MEDIA_BUS_FMT_UYVY8_1X16; break; } @@ -788,7 +788,7 @@ static void max9286_init_format(struct v4l2_mbus_framefmt *fmt) { fmt->width = 1280; fmt->height = 800; - fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; + fmt->code = MEDIA_BUS_FMT_UYVY8_1X16; fmt->colorspace = V4L2_COLORSPACE_SRGB; fmt->field = V4L2_FIELD_NONE; fmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; From patchwork Wed Jun 10 12:46:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597845 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CE94138C for ; Wed, 10 Jun 2020 12:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CD992074B for ; Wed, 10 Jun 2020 12:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728965AbgFJMqg (ORCPT ); Wed, 10 Jun 2020 08:46:36 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50566 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqg (ORCPT ); Wed, 10 Jun 2020 08:46:36 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 22782FDA; Wed, 10 Jun 2020 14:46:29 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 4/9] fixes! [max9286]: Remove redundant DPHY check Date: Wed, 10 Jun 2020 13:46:18 +0100 Message-Id: <20200610124623.51085-5-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham The vep.bus_type is set as a parameter to v4l2_fwnode_endpoint_parse. It will not be changed by the framework, so checking it is redundant. Remove the extra check. Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 807024a9a149..e170540a5d72 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -1174,15 +1174,6 @@ static int max9286_parse_dt(struct max9286_priv *priv) return ret; } - if (vep.bus_type != V4L2_MBUS_CSI2_DPHY) { - dev_err(dev, - "Media bus %u type not supported\n", - vep.bus_type); - v4l2_fwnode_endpoint_free(&vep); - of_node_put(node); - return -EINVAL; - } - priv->csi2_data_lanes = vep.bus.mipi_csi2.num_data_lanes; v4l2_fwnode_endpoint_free(&vep); From patchwork Wed Jun 10 12:46:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597847 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4A17913 for ; Wed, 10 Jun 2020 12:46:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D60F62074B for ; Wed, 10 Jun 2020 12:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728981AbgFJMqh (ORCPT ); Wed, 10 Jun 2020 08:46:37 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50566 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqh (ORCPT ); Wed, 10 Jun 2020 08:46:37 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E031FDE; Wed, 10 Jun 2020 14:46:29 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 5/9] fixes! [max9286]: Remove redundant call Date: Wed, 10 Jun 2020 13:46:19 +0100 Message-Id: <20200610124623.51085-6-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham v4l2_fwnode_endpoint_free() was being called, however we did not call v4l2_fwnode_endpoint_alloc_parse() prior which would have performed an allocation of vep->link_frequencies anyway, so the call to kfree() becomes a no-op. Remove the extraneous and redundant call. Signed-off-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index e170540a5d72..03514bd27f5c 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -1176,7 +1176,6 @@ static int max9286_parse_dt(struct max9286_priv *priv) priv->csi2_data_lanes = vep.bus.mipi_csi2.num_data_lanes; - v4l2_fwnode_endpoint_free(&vep); continue; } From patchwork Wed Jun 10 12:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597851 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F6D214E3 for ; Wed, 10 Jun 2020 12:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 872F92072E for ; Wed, 10 Jun 2020 12:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbgFJMqj (ORCPT ); Wed, 10 Jun 2020 08:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbgFJMqi (ORCPT ); Wed, 10 Jun 2020 08:46:38 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85741C03E96F for ; Wed, 10 Jun 2020 05:46:38 -0700 (PDT) Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 745FBFE0; Wed, 10 Jun 2020 14:46:30 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 6/9] fixes! [max9286-dt]: Add GPIO controller support Date: Wed, 10 Jun 2020 13:46:20 +0100 Message-Id: <20200610124623.51085-7-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham The MAX9286 exposes a GPIO controller to control the two GPIO out pins of the chip. These can in some configurations be used to control the power of the cameras, and in the case of the V3M, it is used to enable power up of the GMSL PoC regulator. The regulator can not (currently) be moddelled as a regulator due to probe time issues, and instead are controlled through the use of a gpio-hog. Signed-off-by: Kieran Bingham --- .../devicetree/bindings/media/i2c/maxim,max9286.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml index f9d3e5712c59..7d75c3b63c0b 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml @@ -46,6 +46,11 @@ properties: description: GPIO connected to the \#PWDN pin with inverted polarity maxItems: 1 + gpio-controller: true + + '#gpio-cells': + const: 2 + ports: type: object description: | From patchwork Wed Jun 10 12:46:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597853 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC72F913 for ; Wed, 10 Jun 2020 12:46:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE31720760 for ; Wed, 10 Jun 2020 12:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbgFJMqk (ORCPT ); Wed, 10 Jun 2020 08:46:40 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50566 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728991AbgFJMqk (ORCPT ); Wed, 10 Jun 2020 08:46:40 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DAAC411FC; Wed, 10 Jun 2020 14:46:30 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Jacopo Mondi Subject: [PATCH v9.2 7/9] fixes! [max9286-dt]: Fix dt-validation Date: Wed, 10 Jun 2020 13:46:21 +0100 Message-Id: <20200610124623.51085-8-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Jacopo Mondi Temporary fixup to ease review. To be squashed into v10 if accepted. Signed-off-by: Jacopo Mondi --- .../bindings/media/i2c/maxim,max9286.yaml | 86 +++++++++++++++++-- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml index 7d75c3b63c0b..4202c1ccc684 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml @@ -135,9 +135,7 @@ properties: description: | Each GMSL link is modelled as a child bus of an i2c bus multiplexer/switch, in accordance with bindings described in - Documentation/devicetree/bindings/i2c/i2c-mux.txt. The serializer - device on the remote end of the GMSL link shall be modelled as a child - node of the corresponding I2C bus. + Documentation/devicetree/bindings/i2c/i2c-mux.txt. properties: '#address-cells': @@ -146,7 +144,74 @@ properties: '#size-cells': const: 0 - additionalProperties: false + patternProperties: + "^i2c@[0-3]$": + type: object + description: | + Child node of the i2c bus multiplexer which represents a GMSL link. + Each serializer device on the GMSL link remote end is represented with + an i2c-mux child node. The MAX9286 chip supports up to 4 GMSL + channels. + + properties: + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + reg: + description: The index of the GMSL channel. + maxItems: 1 + + patternProperties: + "^camera@[0-9]+": + type: object + description: | + The remote camera device, composed by a GMSL serializer and a + connected video source. + + properties: + compatible: + description: The remote device compatible string. + + reg: + description: | + The I2C addresses to be assigned to the remote devices through + address reprogramming. The number of entries depends on the + requirements of the currently connected remote device. + + port: + type: object + + properties: + endpoint: + type: object + + properties: + remote-endpoint: + description: phandle to the MAX9286 sink endpoint. + + required: + - remote-endpoint + + additionalProperties: false + + required: + - endpoint + + additionalProperties: false + + required: + - compatible + - reg + - port + + additionalProperties: false + + additionalProperties: false + + additionalProperties: false required: - compatible @@ -225,11 +290,11 @@ examples: i2c@0 { #address-cells = <1>; #size-cells = <0>; - reg = <0>; camera@51 { - reg = <0x51>; + compatible = "imi,rdacm20"; + reg = <0x51 0x61>; port { rdacm20_out0: endpoint { @@ -246,7 +311,8 @@ examples: reg = <1>; camera@52 { - reg = <0x52>; + compatible = "imi,rdacm20"; + reg = <0x52 0x62>; port { rdacm20_out1: endpoint { @@ -262,7 +328,8 @@ examples: reg = <2>; camera@53 { - reg = <0x53>; + compatible = "imi,rdacm20"; + reg = <0x53 0x63>; port { rdacm20_out2: endpoint { @@ -278,7 +345,8 @@ examples: reg = <3>; camera@54 { - reg = <0x54>; + compatible = "imi,rdacm20"; + reg = <0x54 0x64>; port { rdacm20_out3: endpoint { From patchwork Wed Jun 10 12:46:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597855 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A29C14E3 for ; Wed, 10 Jun 2020 12:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF9DA2072E for ; Wed, 10 Jun 2020 12:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728991AbgFJMqk (ORCPT ); Wed, 10 Jun 2020 08:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728595AbgFJMqk (ORCPT ); Wed, 10 Jun 2020 08:46:40 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B034C03E96B for ; Wed, 10 Jun 2020 05:46:40 -0700 (PDT) Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B97B1253; Wed, 10 Jun 2020 14:46:31 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham , Kieran Bingham Subject: [PATCH v9.2 8/9] fixes! [max9286-dt]: Correctly match the hex camera node reg Date: Wed, 10 Jun 2020 13:46:22 +0100 Message-Id: <20200610124623.51085-9-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham The camera node reg is an i2c hex address. Update the regex. Signed-off-by: Kieran Bingham --- Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml index 4202c1ccc684..34e0431d0bc1 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml @@ -165,7 +165,7 @@ properties: maxItems: 1 patternProperties: - "^camera@[0-9]+": + "^camera@[a-f0-9]+$": type: object description: | The remote camera device, composed by a GMSL serializer and a From patchwork Wed Jun 10 12:46:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11597857 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDD52138C for ; Wed, 10 Jun 2020 12:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEE252074B for ; Wed, 10 Jun 2020 12:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbgFJMqm (ORCPT ); Wed, 10 Jun 2020 08:46:42 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:50566 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728595AbgFJMqm (ORCPT ); Wed, 10 Jun 2020 08:46:42 -0400 Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BCD8613EE; Wed, 10 Jun 2020 14:46:31 +0200 (CEST) From: Kieran Bingham To: Jacopo Mondi , linux-renesas-soc@vger.kernel.org Cc: Laurent Pinchart , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= , Kieran Bingham Subject: [PATCH v9.2 9/9] fixes! [rdacm20]: Use usleep_range over mdelay(10) Date: Wed, 10 Jun 2020 13:46:23 +0100 Message-Id: <20200610124623.51085-10-kieran@bingham.xyz> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610124623.51085-1-kieran@bingham.xyz> References: <20200610124623.51085-1-kieran@bingham.xyz> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kieran Bingham Prefer usleep_range rather than the busy looping mdelay for 10ms waits. msleep( n < 20 ) may sleep up to 20 milliseconds, but in this instance I don't think that's a issue here. All the same, use usleep_range between 10, 15 milliseconds. Signed-off-by: Kieran Bingham Acked-by: Jacopo Mondi --- drivers/media/i2c/rdacm20.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index cda3e6372ea9..1ed928c4ca70 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -488,9 +488,9 @@ static int rdacm20_initialize(struct rdacm20_device *dev) * MAX9271 GPIO1 and verify communication with the OV10635. */ max9271_clear_gpios(dev->serializer, MAX9271_GPIO1OUT); - mdelay(10); + usleep_range(10000, 15000); max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT); - mdelay(10); + usleep_range(10000, 15000); again: ret = ov10635_read16(dev, OV10635_PID);