Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4014610ybi; Tue, 18 Jun 2019 10:13:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG+rjcTwPiO31El2TGQLLh4JN5Ijb+pjIZjs0kYG1t+rYM6G821EdohIcvjlHRHkhSDxiR X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr114034426plg.190.1560877998281; Tue, 18 Jun 2019 10:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560877998; cv=none; d=google.com; s=arc-20160816; b=AB1fphBYHbDoAxkMbJFG08OJ0j7Naa3kWXNwEEKiTKD6x25wfzWCm/HAxkdye1Vlx0 s/uRIAENfqaBdyBQUXxgUOYvqjhLyc+tKRS8dD4eNZmnEnK9Q3i0L+Pvg9BWfxKupkbh Bn1EqbpT+A//ZAxFzzw2vTevm6XOM0aLAv/870xKNRRZwOH583XpH8Gi9hh2F0DDL0LG FdS7DxYFCcjZwhg4Ls4Ooo/Y0XWISF0HwWP6+iwmPZWtK53H8Gnq8u2f3rdwPwS3IKjU kYnFhL8L5LbZ7ww7QGVtf4J5RCGa+ZpmiABCUqfEodCdubtYJNUzOlydvStHC41/b2O5 nymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=l3H+z7hs5bxP2n91tR9Ky28kkwO4kPSIJrazmWFnQ6k=; b=J3aWcIeIjREnWf+Pr9+AmeuyJJLqwVY0/YcSVq5lg27Z8kEM0ghxjSTKh8DrW1sF0T FIxXCeSpXXx2iz6YGih+fUF+X7wB62x/84/hiKgR33LPkEZaxS7/3W8NN1IhMj0K5jge qwZdfjPyY/1hoRAw/uAvWhgf3qwMSu6wCEDe8RrGk9RPKhxz9Q7AF9YNbVjfB2Sfsyh4 hgeeDHbdx+IMFPdmLBWq/WI9A58z0uLfTJLl7tgzbYSxRzr1ICfqgK9yfNL6PyOOiLRG mGKH+VE7e9GVomof6qXy+i1+pvsr9c4JCn0ruUhnF4RXdLoYHK67CmZJkEcwYcoFTRv7 n91w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si12881650ply.324.2019.06.18.10.13.01; Tue, 18 Jun 2019 10:13:18 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729337AbfFRO7u (ORCPT + 99 others); Tue, 18 Jun 2019 10:59:50 -0400 Received: from retiisi.org.uk ([95.216.213.190]:38910 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729042AbfFRO7t (ORCPT ); Tue, 18 Jun 2019 10:59:49 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id AFB44634C7B; Tue, 18 Jun 2019 17:59:22 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.89) (envelope-from ) id 1hdFZy-0000tJ-LA; Tue, 18 Jun 2019 17:59:22 +0300 Date: Tue, 18 Jun 2019 17:59:22 +0300 From: Sakari Ailus To: Vishal Sagar Cc: Sakari Ailus , Vishal Sagar , Hyun Kwon , "laurent.pinchart@ideasonboard.com" , "mchehab@kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , Michal Simek , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , "hans.verkuil@cisco.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Dinesh Kumar , Sandip Kothari , Luca Ceresoli , Jacopo Mondi Subject: Re: [PATCH v8 2/2] media: v4l: xilinx: Add Xilinx MIPI CSI-2 Rx Subsystem driver Message-ID: <20190618145922.sq4jovxoz2khs3tq@valkosipuli.retiisi.org.uk> References: <1559555971-193235-1-git-send-email-vishal.sagar@xilinx.com> <1559555971-193235-3-git-send-email-vishal.sagar@xilinx.com> <20190605124851.xr2hmgyoe46q6xud@kekkonen.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vishal, On Fri, Jun 07, 2019 at 07:11:47AM +0000, Vishal Sagar wrote: ... > > > +/** > > > + * xcsi2rxss_s_ctrl - This is used to set the Xilinx MIPI CSI-2 V4L2 controls > > > + * @ctrl: V4L2 control to be set > > > + * > > > + * This function is used to set the V4L2 controls for the Xilinx MIPI > > > + * CSI-2 Rx Subsystem. It is used to set the active lanes in the system. > > > + * The event counters can be reset. > > > + * > > > + * Return: 0 on success, errors otherwise > > > + */ > > > +static int xcsi2rxss_s_ctrl(struct v4l2_ctrl *ctrl) > > > +{ > > > + struct xcsi2rxss_state *xcsi2rxss = > > > + container_of(ctrl->handler, struct xcsi2rxss_state, > > > + ctrl_handler); > > > + struct xcsi2rxss_core *core = &xcsi2rxss->core; > > > + int ret = 0; > > > + > > > + mutex_lock(&xcsi2rxss->lock); > > > + > > > + switch (ctrl->id) { > > > + case V4L2_CID_XILINX_MIPICSISS_ACT_LANES: > > > + /* > > > + * This will be called only when "Enable Active Lanes" parameter > > > + * is set in design > > > + */ > > > > You generally get the number of lanes from firmware. There's no need to add > > a control for it. > > > > I don't understand what firmware means here. There is no other code running. > I don't see how to modify the number of lanes apart from using v4l control. It's not the user that provides this information. Again, if you want this feature right from the time the driver is merged to mainline, then rebase the set on top of Jacopo's frame descriptor set. But it may take a while. > > > > + if (core->enable_active_lanes) { > > > + u32 active_lanes; > > > + > > > + xcsi2rxss_clr_and_set(core, XCSI_PCR_OFFSET, > > > + XCSI_PCR_ACTLANES_MASK, > > > + ctrl->val - 1); > > > + /* > > > + * This delay is to allow the value to reflect as write > > > + * and read paths are different. > > > + */ > > > + udelay(1); > > > + active_lanes = xcsi2rxss_read(core, XCSI_PCR_OFFSET); > > > + active_lanes &= XCSI_PCR_ACTLANES_MASK; > > > + active_lanes++; > > > + if (active_lanes != ctrl->val) > > > + dev_info(core->dev, "RxByteClkHS absent\n"); > > > + dev_dbg(core->dev, "active lanes = %d\n", ctrl->val); > > > + } else { > > > + ret = -EINVAL; > > > + } > > > + break; > > > + case V4L2_CID_XILINX_MIPICSISS_RESET_COUNTERS: > > > + xcsi2rxss_reset_event_counters(xcsi2rxss); > > > + break; > > > + default: > > > + ret = -EINVAL; > > > + break; > > > + } > > > + > > > + mutex_unlock(&xcsi2rxss->lock); > > > + > > > + return ret; > > > +} -- Regards, Sakari Ailus