Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp943320rwo; Wed, 2 Aug 2023 06:37:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/Xcn7O6Av6/nhBNBtFK05vSkjsxAHHP5c55PqkhxfNLthQGsd2bmdF/w0GdIhnGyRwnO1 X-Received: by 2002:a05:6a20:9151:b0:123:152d:d46b with SMTP id x17-20020a056a20915100b00123152dd46bmr20009333pzc.26.1690983438705; Wed, 02 Aug 2023 06:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690983438; cv=none; d=google.com; s=arc-20160816; b=oOhNp0C4WAe61qb7Ci1ZxMdbNS3GJWUB7mJddpLcxlW3Dz+QTaMUVNXrSFhSCwQmEW zIjV521fdKLFv4CKmJ18XlQdZCgBQ4Q6UROcB5cskJggjYfrUwuOgzX308bx+w3wbNrX KKWh2PGLRCKPG3028kNFH4bm0SLJ0puhlU5n23xpzmmSU2PY2w9D62GfHQWK4rMOLbOO GtH0AuBpyDtPqpDYkkYijdpFWQTmdmWsWMXaRGl04ug/D7tQuZhcdtUZ6hBFT/pSBzOo a63x9S8nCYiUq1dpaJB/UXH1KitDsHwgfFhlbifGL8ble0dFW0dKOilM57uzjZzpGb0u AyFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=qPfubchaKJdEXfd78RBlwpgYqpf6R9jnKgaw4VNe1+Q=; fh=yCIEMRQ/TqgYF55EacZ33qYMHdbwutfEceImQJKjxJA=; b=m19bVXxNN/2izJ45EpZo0mS7bHiu4huQ2FIvX4osgijwjLhxs30IYupCwJJvIq6TtW MCOoJq0ylnsgDWC1e2GwhlfMSSBwcV3njMYGYa67+6Bpzcpc5D8pZGRsK+u2r61VAR8N TqsWRGBIQVYQthMexLxcqKpfX+Ddz6A5bwsOrM0PPMweRQ6GQLvHEUsaMaRSvfwYB7nQ GK8tob4hKfwjV2VULfThF7jsMXcOAqkR3Oiwv2KxhotVkaqDL4xNkNpJ36zRRhFfcS5f fTBrTrQuYNXYOVr7vY3JDtvodMuk1hapaPsSKWqKBJ9lV2h5VUf97DDtfWH6t3lZWj4u QSjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lXGYLSBl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y37-20020a056a001ca500b006871178848csi8857023pfw.208.2023.08.02.06.37.06; Wed, 02 Aug 2023 06:37:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lXGYLSBl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbjHBMJi (ORCPT + 99 others); Wed, 2 Aug 2023 08:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbjHBMJh (ORCPT ); Wed, 2 Aug 2023 08:09:37 -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 20D9D1BF9; Wed, 2 Aug 2023 05:09:35 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A4D08DA; Wed, 2 Aug 2023 14:08:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690978110; bh=dFHjp0u14PNVIqbD7MDsFSNrr4G9iZZbUmhtrzJ8pZ0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lXGYLSBlj7V8uWwGIPM0yWgf20TFiBhd2F7+uTiiPGxlwLSOO0N8a87U2TQUwdfw7 IxADMafWg58moT3hclaJjCvShTZOJ1FQ/kYzNMUGoBni76Vu8DMz006+97q2+Cnvut UciMioHBfTnSPbeBqFy0DhBoAU0vSozExkHbgcK0= Message-ID: <00e1bb24-c2c0-e24b-9852-3b40858859cf@ideasonboard.com> Date: Wed, 2 Aug 2023 15:09:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v8 16/16] media: ti: Add CSI2RX support for J721E Content-Language: en-US To: Sakari Ailus 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 References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> <20230731-upstream_csi-v8-16-fb7d3661c2c9@ti.com> From: Tomi Valkeinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2023 14:14, Sakari Ailus wrote: > 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. Right. But the above code doesn't do that, does it? It will only return the first format, and error for anything else. Ah, the driver only supports a single mbus code per fourcc. In that case it's ok. Tomi >> >>> + >>> + 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; >>> +} >