Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2215405rdf; Mon, 6 Nov 2023 07:51:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHplDbJ3Lku8lD26uNQpInNbWqSQdDzQ/0VSNdImpjTcSTK1e1B7mutNVWkqXxFOnEaZ6Zs X-Received: by 2002:a17:902:ca0b:b0:1c7:2740:cfb3 with SMTP id w11-20020a170902ca0b00b001c72740cfb3mr24527847pld.35.1699285900095; Mon, 06 Nov 2023 07:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699285900; cv=none; d=google.com; s=arc-20160816; b=U7LUxZz4XiX+yJUvjj6obI70zfV407F/UvWVJU+M5tzmefHTEqpwAFq5GTTnXzY7W+ YNjnHKQQjOizQkNra7smYWTGo4+LgRJLdAPElS3bvH8q09fxXBk1Z2dNU5YRcGRur/hK bv/VJV6SDI8gHeyzYRr5++/TOmTaUEAarlrD8NIHkpZsTlYBef+2cn42E6IfgbjsFb4W BJKAG5t6Vk2z1jAK1VnhC4+/rMJu4E9cAeensQio+bfn21frCHRJYi6G9WghlwfITMOn N96U1yIyJHoetlXZhILnKcjGTplEGAPBOGjxL2t6WIi+J0RJpwlw19ItgzegTQXzisf2 mpPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2fzTFRtE8OUbr2+PUc5Jsl8FOsZhgcgp2/rGQyh/LaY=; fh=PuT56cSTXzbtrJUQbPx7GafhVqY7PP93VvsN+Z2ba00=; b=YNxYUpjXwKYNjBK2M+EO2YJ4T/OrVG+uH8uZQgXNPVQB10XRlZKvcKu+qbIQuItU3i tDuQ+KO9Oul/Lb/vAqKlux2EN+x7bztVfDwYvc4GOwQ/GkH8oAN5KB2rYDWtZl+J0R1D /4sdV76JHm4LIGlJM1HIqCHVyiJjuJRVijvCiftwysbt66O5p3ByrYTjOZ1PKSqXwLlw 9ITvaz+aq8GXuS2iRRJPVfK8H2uwSU2fq5gaQAy7MrOh3QyzZPKNUUiRDA2ez9R4MFRV G1GvASUmhl2Gme7KuFxKgOonh9evgD9tCNBopcNRbf6Cf0Xb2y6Ac1V3iJnVtUkHZnRP l2LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Mb+7QgvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id p2-20020a170902e74200b001bb95a5cb9fsi8994126plf.522.2023.11.06.07.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:51:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Mb+7QgvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 910068080D74; Mon, 6 Nov 2023 07:50:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232201AbjKFPt4 (ORCPT + 99 others); Mon, 6 Nov 2023 10:49:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231827AbjKFPtz (ORCPT ); Mon, 6 Nov 2023 10:49:55 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A367A107; Mon, 6 Nov 2023 07:49:51 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 67EE4C0007; Mon, 6 Nov 2023 15:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1699285790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2fzTFRtE8OUbr2+PUc5Jsl8FOsZhgcgp2/rGQyh/LaY=; b=Mb+7QgvYWX/CYi2SnZpUmb520oUd+hxz+xJaJ7govP4NaDscocn8T9sLa3PPdowGzGVeE9 jHw2T41xtF3qCod4eSrM4sJzrq8YgUQpdW8lYtEDb+8DkfQ4O2BMcuDO69Qtos2P1gGAkl ImYQ3hsGtS8UgiexOWyg2LX7cwI9oJ28QBPHvi9nFCjY0s8vT3TNpuDEQgUi5cO0EiI5qx fks8P+retlmvPU/zNNZaGyfSiHG0+/ZwnRFr3rjOfdB0bJJX1wAlFQ55iLivjyT+8c9UYb b0XcMrPuzjGhK32FwDE8RsogzTjUwcznfhXPGLRsltUjPh3cVBC/yup6+vJDuA== Date: Mon, 6 Nov 2023 16:49:48 +0100 From: Mehdi Djait To: Paul Kocialkowski Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com Subject: Re: [PATCH v7 3/3] media: i2c: Introduce a driver for the Techwell TW9900 decoder Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GND-Sasl: mehdi.djait@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 07:50:32 -0800 (PST) Hi Paul, On Mon, Nov 06, 2023 at 04:25:18PM +0100, Paul Kocialkowski wrote: > > > > +static void tw9900_fill_fmt(const struct tw9900_mode *mode, > > > > + struct v4l2_mbus_framefmt *fmt) > > > > +{ > > > > + fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; > > > > + fmt->width = mode->width; > > > > + fmt->height = mode->height; > > > > + fmt->field = V4L2_FIELD_NONE; > > > > + fmt->quantization = V4L2_QUANTIZATION_DEFAULT; > > > > + fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; > > > > + fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(V4L2_COLORSPACE_SMPTE170M); > > > > + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(V4L2_COLORSPACE_SMPTE170M); > > > > +} > > > > + > > > > +static int tw9900_cfg_fmt(struct v4l2_subdev *sd, > > > > > > You might have to differentiate between set_fmt/get_fmt to return -EBUSY > > > if streaming is on in set_fmt. However I understand it will just copy the > > > current mode in both cases, but this might still be required to follow v4l2 > > > semantics (please double-check). > > > > > > > This should be done in the driver calling the pad subdev_call set_fmt, > > right ? > > Well the two things are distinct, even though it's not obvious to think about > a case where you wouldn't have a video device to grab the frames. > > For instance you can see this being done here: > https://elixir.bootlin.com/linux/latest/source/drivers/media/i2c/ov5648.c#L2259 > > I'm just not sure about what the V4L2 subdev API mandates. It would be useful > to find some piece of documentation that clarifies the requirement. Ok, I will split the functions then. -- Kind Regards Mehdi Djait