Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp333455rwi; Mon, 31 Oct 2022 01:50:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bJNwOolB5IY9g0oeVwOY8nO0aZTXfB/CWJcirrt5F9jz2hCt+k0etf5VQFwMPUEs8k+sD X-Received: by 2002:a17:903:124c:b0:184:cb7e:67c5 with SMTP id u12-20020a170903124c00b00184cb7e67c5mr13364654plh.117.1667206253082; Mon, 31 Oct 2022 01:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667206253; cv=none; d=google.com; s=arc-20160816; b=gPgsWqBGZD9dvbNWlLE0S9hqbqc3aVFCNb/ofE40sulUP+u3Mh05f6FcBYgC+W9tUh sgDo97unlHxZmFkq4p17/DZgXVB8Mw683lTn16zxZDLq9IriPwfU/lAcsb8qGDkn1fIo 27wPMCOVe9573d8ZPSkXTPi+rZP5jplIJ4Dngqo+AFWhBQPQ3uQ5HiDVBTz8bPgLYyp5 gpZJ75XyqGJY842XwllZmee7NRmO9Khixn4Rj5B3aEmY3L9j+HiF9uPTgvb3tqpvLUzT pQP6tHm7w0BaVyfAW2H/kiWWQS6mVyl7u7Di86Bz0XAhrkPN5KkZW2OBoM0UHhxiZjmd vD/w== 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=nlJV6yIN1wS6P3/80Wg4xcA8P2JGNmkcwuHXtcRvouo=; b=boiARrbzSCaTZ1HEzMkmB1OAaXLa/OgRSX98QgXFjDUISkSPgGjqRVCYXbuTk/I+eW Pj4cqOk2nDVhJ2aSeM8dEGeDRQO7OPgoAjUR6nF+2ZdqqHvLqbpvqFtct/Fgqb74f1sG iYb+NSGifMBznQKi2MUEGBfFHb1y8dn5gMVRQysmt2cIOQxKfIQccNaosiQVq2g+DJaB QjbnKLf9xwlyLq70/t24rO3gJGb9sVfqNveqevQzENGofSa+Cl0X0ljI/eFA9Bqhm4KF csfGL4b440uciRESiI1CNONHuFW3dSGyo91pgHbNQRoVjg7Vy4sGne/swbC6EAtaUlgb rlOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZFmgBRtr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a170902650b00b001727a15dbf8si6959609plk.345.2022.10.31.01.50.40; Mon, 31 Oct 2022 01:50:53 -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 header.i=@intel.com header.s=Intel header.b=ZFmgBRtr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJaITk (ORCPT + 99 others); Mon, 31 Oct 2022 04:19:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiJaITi (ORCPT ); Mon, 31 Oct 2022 04:19:38 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F2059FEA; Mon, 31 Oct 2022 01:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667204378; x=1698740378; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lbmevJjnjpGGx89wIvYMNqwP6/k7SVFB7D/svXf4f3Q=; b=ZFmgBRtrG/AzYYinGijkyX07wvba3HRqSwiWSVxrXGAnzx0SNHyquXZY Jjn8ugRRuPpN+aUUp9bguQ6dvJSUXxOLWfFHuARvgye41zVb6OH1zoLk8 3fLtB7SSltUaZ4Hna75rZmgrCydoS7dEw76PyQ23uGGertUNVJaG2zEsZ 3cffd6WI98j0YWrrWDFpwUarjOw0V1YBgFvcZzaMbwYWxLnvPLeF04lXN KPgWkOVfBxfVEl2B7Qoyvur9W9OCaoPHGPPxlTok318wvc2sKwWAlscWm CvihE1llBYOjTax3/dbjWCjI4BeypTGgE5wPUH7ejMLnLHwC2Lp/O7ist w==; X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="335500652" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="335500652" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 01:19:37 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="776051657" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="776051657" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 01:19:34 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id 130C72026C; Mon, 31 Oct 2022 10:19:32 +0200 (EET) Date: Mon, 31 Oct 2022 08:19:32 +0000 From: Sakari Ailus To: "Lad, Prabhakar" Cc: Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , Jacopo Mondi , Niklas =?iso-8859-1?Q?S=F6derlund?= , Hans Verkuil , Geert Uytterhoeven , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Lad Prabhakar Subject: Re: [PATCH v4 4/4] media: platform: Add Renesas RZ/G2L CRU driver Message-ID: References: <20221027103104.74576-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221027103104.74576-5-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Hi Prabhakar, On Sun, Oct 30, 2022 at 10:32:43PM +0000, Lad, Prabhakar wrote: > Hi Sakari, > > On Fri, Oct 28, 2022 at 1:22 PM Sakari Ailus > wrote: > > > > Hi Prabhakar, > > > > On Thu, Oct 27, 2022 at 08:04:40PM +0100, Lad, Prabhakar wrote: > > ... > > > > > +static int rzg2l_cru_ip_s_stream(struct v4l2_subdev *sd, int enable) > > > > > +{ > > > > > + struct rzg2l_cru_dev *cru; > > > > > + int ret; > > > > > + > > > > > + cru = v4l2_get_subdevdata(sd); > > > > > + > > > > > + if (!cru->is_csi) > > > > > + return -EINVAL; > > > > > + > > > > > + ret = v4l2_subdev_call(cru->ip.remote, video, s_stream, enable); > > > > > > > > It's up to the driver how call pre_streamon() and post_streamoff(), as long > > > > as it takes place on both sides of s_stream(). > > > > > > > > In other words, as it seems your device doesn't need anything special, you > > > > could waive implemeting the callbacks yourself and call pre_streamon() and > > > > post_streamoff() here. > > > > > > > Here the cru->ip.remote = CSI, in the rzg2l_cru_set_stream(1) where we > > > are calling pre_streamon()/post_streamoff() callbacks the subdev is > > > CRU-IP. So the calls from rzg2l_cru_set_stream() land into > > > rzg2l_cru_ip_pre_streamon() and rzg2l_cru_ip_post_streamoff() which > > > are calling pre_streamon/post_streamoff for the CSI subdev. > > > > Again, you should call the source sub-device's pre_streamon and > > post_streamoff from the s_stream handler (not from > > rzg2l_cru_ip_pre_streamon or rzg2l_cru_ip_post_streamoff). > > > > Starting streaming takes place link by link. This allows a driver to omit > > implementing pre_streamon and post_streamon callbacks if it doesn't need > > them. > > > Thank you for the explanation that makes sense now to me. > > Now with this approach the initialization sequence of CSI + CRU won't > align as per the HW manual. Unfortunately I'll have to switch back on > exporting the functions. I hope that's okay? It is not. What exactly would you like to do that you can't with the pre_streamon/post_streamoff callbacks called from s_stream? In the worst case we can redefine where they are to be called. -- Kind regards, Sakari Ailus