Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2428682imj; Mon, 11 Feb 2019 02:43:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IbdV+uvZ3217JmRkUDRuP/+89maO2qbL4GZBCZK4QfI+diPYc8hpqxMxyxqoTt3tiTeplBO X-Received: by 2002:a65:6684:: with SMTP id b4mr18228215pgw.55.1549881805224; Mon, 11 Feb 2019 02:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549881805; cv=none; d=google.com; s=arc-20160816; b=0I8xbd2XfH3L+qCTJc8+fWPw3W+JDUEF2ZdvecZJSyAd9SVjvsupgjHCz5V5/adnph ZcgK+n6rrvvFg0sjRcrKn9al7zYFPoKxM3wROil8fuO0T2zNhTzWqQstKzUCGBWyhPBx YvHIzL+5EO4PU/lul7iHQQcba6AuGhMZW/qhQ/OreXqbCgiu00nyFYQz0YdKDq4UU7hW GF8WRL9ENeppQhp+bYlrKH6k9Oz5qBE2AK6XvnIecrN+RODdDtlcZOlacgMkzkhsOiq4 8bl0SUrWUY1IaTDNroLZq8/5fqJ5h2gIL2sRF4ilTdoEjG6kgNjnXlvz9h+5NIElawCk Vs5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:to:subject:from:dkim-signature; bh=/Ly/1DW5/dMBN3KOIitAsznNrHW0ioAAVJe0symaGh4=; b=c6lEtw6u0DBqIgFfMJXeHiOTIoydwJ6hqaWuT1XqOUD8EfIuuiZxZIy84AnllFFy2t v0tKm8Huhhc3qJCxnOEIk8ULiaVNtugDSy49CajFL7c9xaf6OXuNrDY/o7pm+xfG17V2 NDaqO5P0jBckgbTdIJvoU9dqdXCCW9guEh+hio0+EJwBWXwNUI/jgK/B5cuiTfHaOyIa L+jjzgdmfy1X1xe//7KEiQCvjqv4N+BItnKoTjWoq+Y21FlvKxsmqZHUjnagC7GYDDqG Dk+strrVHYlioD69pfDmjEGP8Vs60+MXWn/3DXzI6dqeprT4EcvP1N07DeraU/ywEWMk l39w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lucaceresoli.net header.s=default header.b=J5ngiVZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si8933821pgi.359.2019.02.11.02.43.09; Mon, 11 Feb 2019 02:43:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@lucaceresoli.net header.s=default header.b=J5ngiVZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbfBKKm2 (ORCPT + 99 others); Mon, 11 Feb 2019 05:42:28 -0500 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:45465 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726173AbfBKKm2 (ORCPT ); Mon, 11 Feb 2019 05:42:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lucaceresoli.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:To:Subject:From:Sender: Reply-To:Cc: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=PefZbUwJMzQ4ZwMXSOIIqFQDeGpOHkO2Vj/7JrEeLUU=; b=J5ngiVZfK4jGBlXcrYy0/yw3a8 6rze3AtW+z6vDUKlP4uPMOuOf1efbcNdu1pwPgdMvLUi5ZlL08BmJiWLxOeOzEfYNSCJ1ohHXYNF+ UeXC5EzBg8VKvqFmAUTUYW0bqN4r0q95eNgnFi2et6M0lfLRWL8Buz8U03k6n1/tRsV4=; Received: from [109.168.11.45] (port=59808 helo=[192.168.101.224]) by hostingweb31.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gt92f-00GzIe-Hj; Mon, 11 Feb 2019 11:42:25 +0100 From: Luca Ceresoli Subject: Re: [PATCH v3 2/2] media: v4l: xilinx: Add Xilinx MIPI CSI-2 Rx Subsystem To: Vishal Sagar , hyun.kwon@xilinx.com, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, michals@xilinx.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, sakari.ailus@linux.intel.com, hans.verkuil@cisco.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dineshk@xilinx.com, sandipk@xilinx.com References: <1549025766-135037-1-git-send-email-vishal.sagar@xilinx.com> <1549025766-135037-3-git-send-email-vishal.sagar@xilinx.com> Message-ID: <3923069f-7c69-c601-0ded-f7629696ef9b@lucaceresoli.net> Date: Mon, 11 Feb 2019 11:42:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1549025766-135037-3-git-send-email-vishal.sagar@xilinx.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vishal, On 01/02/19 13:56, Vishal Sagar wrote: > The Xilinx MIPI CSI-2 Rx Subsystem soft IP is used to capture images > from MIPI CSI-2 camera sensors and output AXI4-Stream video data ready > for image processing. Please refer to PG232 for details. For those unused to Xilinx documentation I'd use the full document name ("MIPI CSI-2 Receiver Subsystem v4.0") or, even better, a stable URL if available. > The driver is used to set the number of active lanes, if enabled > in hardware. The CSI2 Rx controller filters out all packets except for > the packets with data type fixed in hardware. RAW8 packets are always > allowed to pass through. > > It is also used to setup and handle interrupts and enable the core. It > logs all the events in respective counters between streaming on and off. > The generic short packets received are notified to application via > v4l2_events. > > The driver supports only the video format bridge enabled configuration. > Some data types like YUV 422 10bpc, RAW16, RAW20 are supported when the > CSI v2.0 feature is enabled in design. When the VCX feature is enabled, > the maximum number of virtual channels becomes 16 from 4. > > Signed-off-by: Vishal Sagar ... > +/** > + * xcsi2rxss_reset - Does a soft reset of the MIPI CSI2 Rx Subsystem > + * @core: Core Xilinx CSI2 Rx Subsystem structure pointer > + * > + * Core takes less than 100 video clock cycles to reset. > + * So a larger timeout value is chosen for margin. > + * > + * Return: 0 - on success OR -ETIME if reset times out > + */ > +static int xcsi2rxss_reset(struct xcsi2rxss_core *core) > +{ > + u32 timeout = XCSI_TIMEOUT_VAL; The comment about the timeout is duplicated here and at the #define line. Why not removing the define above and just putting u32 timeout = 1000; /* us */ here? It would make the entire timeout logic appear in a unique place. > +static int xcsi2rxss_start_stream(struct xcsi2rxss_state *state) > +{ > + struct xcsi2rxss_core *core = &state->core; > + int ret = 0; > + > + xcsi2rxss_enable(core); > + > + ret = xcsi2rxss_reset(core); > + if (ret < 0) { > + state->streaming = false; > + return ret; > + } > + > + xcsi2rxss_intr_enable(core); > + state->streaming = true; Shouldn't you propagate s_stream to the upstream subdev here calling v4l2_subdev_call(..., ..., s_stream, 1)? > + return ret; > +} -- Luca