From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82BE9C001DF for ; Wed, 2 Aug 2023 11:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbjHBLOv (ORCPT ); Wed, 2 Aug 2023 07:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232692AbjHBLOs (ORCPT ); Wed, 2 Aug 2023 07:14:48 -0400 Received: from mgamail.intel.com (unknown [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 136A32D4E; Wed, 2 Aug 2023 04:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690974871; x=1722510871; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=h/cs+jJte6HO7usFj7kMbMOyqZ6ySurFpnQ9adQ5vBQ=; b=dyMhi2UDruns4JEJefzPSUnQUtHPcwFchcdIup3lrTNcNlYOrxXmnwhZ o3Ex0oKDs9Fg19r43gvnEDKhZYXJghqDHJro8k0DNuzgpklEFI/WCOT5P 0Qc2Z1a43xp2zyKe5GpwxI9GdDLLQmLwiLznox08Jzv9ZNwspoHkfEYjW Vf0CDRWS5xo//f/zPN5hs0eHsGX+9lVzq/ufdU1HIPHcF4ZGKUzcThEDs LEPqMhpP+tOBsUuQJij2L8B6guoUBdAKc09IETKpORI2ETNndgcpkCuVQ fnvQR2CbO3SJu9HVC59fJbw3YLAdTFS2kXOzrS8bg5Rn173pd/ET7A9gl A==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="349155844" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="349155844" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 04:14:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="722825000" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="722825000" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 04:14:12 -0700 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 43A0811FBE7; Wed, 2 Aug 2023 14:14:10 +0300 (EEST) Date: Wed, 2 Aug 2023 11:14:10 +0000 From: Sakari Ailus To: Tomi Valkeinen Cc: Jai Luthra , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Laurent Pinchart , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Maxime Ripard , niklas.soderlund+renesas@ragnatech.se, Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , nm@ti.com, devarsht@ti.com Subject: Re: [PATCH v8 16/16] media: ti: Add CSI2RX support for J721E Message-ID: References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> <20230731-upstream_csi-v8-16-fb7d3661c2c9@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Moi, On Wed, Aug 02, 2023 at 02:04:57PM +0300, Tomi Valkeinen wrote: > > +static int ti_csi2rx_enum_fmt_vid_cap(struct file *file, void *priv, > > + struct v4l2_fmtdesc *f) > > +{ > > + const struct ti_csi2rx_fmt *fmt = NULL; > > + > > + if (f->mbus_code) { > > + if (f->index > 0) > > + return -EINVAL; > > This fails to enumerate the formats if mbus_code is set, doesn't it? This is intentional: if the mbus_code field is set, you're supposed to get only format(s) corresponding to that mbus code. > > > + > > + fmt = find_format_by_code(f->mbus_code); > > + } else { > > + if (f->index >= num_formats) > > + return -EINVAL; > > + > > + fmt = &formats[f->index]; > > + } > > + > > + if (!fmt) > > + return -EINVAL; > > + > > + f->pixelformat = fmt->fourcc; > > + memset(f->reserved, 0, sizeof(f->reserved)); > > + f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; > > + > > + return 0; > > +} -- Sakari Ailus