Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp2331579rwj; Sun, 30 Oct 2022 15:47:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6A73Jch05uac1StTnth2bnxWzbz5KfLSq9HVlFSfuqX+aDELxIy3RJ7XP0QNo3UA/UWASi X-Received: by 2002:a05:6402:42d0:b0:457:d16e:283d with SMTP id i16-20020a05640242d000b00457d16e283dmr10547008edc.395.1667170036150; Sun, 30 Oct 2022 15:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667170036; cv=none; d=google.com; s=arc-20160816; b=xK67Pec2D99S/JdP4VFLudwTqpIdeO99O4hdros4mdAn7rvNYY6ANX4vPtOro6U8tV 7CBaNwpJ+jS/Ki6daoKZJC+bHYse4me8tmP32PiRbTUOKS8IerI7ZyQ22EKTr3OdBAs+ 0If+8UlJsIg7B384obHShnm4RsskOE4g8lzThs3kTSDwy1QzP2tdB0yLa25Pvuc4CarM 28ZM87qWDSJXMoaRhacKAEBONBIu+2/XTlab60BCN4R8Y4Uf3StZOTMa5CSrdIq72xDX NE2YpBkwCUQcwb0+LczpD41N+r2lXPNPOgAyZu8KQLnbob8+hTDDBvwoRnslriytHvbW 0/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=n2o/GMQ0tE3kyma8kEJB/WriSFlX/4OAcK/yGlC1IlE=; b=AvOk2kuorDWHscAbWTvR/vY7ukaoZruUFjQtXsmljENhKvuQUPuaFJJl1GsroTVJYs W+GuLAhQ9SuY3BLlKtH2y5B/PvdHKd/SqIUSCP2MgyPMziiCG9nvjiUaELOOVThanvIH DXjnbGEgl4iN8KkeIsYGmcMpdbzyvSCgMpNGsxG33rKziWagUBNdN6C5Q00PhReMHgMp 9kBlVhu3Lx/m0EkT40iGZ/EgDWUj6H7IAHOQujMXVwp0l/z46bonZt7YVwVKNi8ms74f Q0pqA7CuP86Nfrsffwgzy1jNg09fZuefidSbHpyBwQHxJJ9n/vY1EJvaXg9Khik9hYkL 9L1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HABUGdOY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go44-20020a1709070dac00b0078dcf17c084si6970896ejc.728.2022.10.30.15.46.48; Sun, 30 Oct 2022 15:47:16 -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=@gmail.com header.s=20210112 header.b=HABUGdOY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiJ3WdR (ORCPT + 99 others); Sun, 30 Oct 2022 18:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiJ3WdP (ORCPT ); Sun, 30 Oct 2022 18:33:15 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA2B95B3; Sun, 30 Oct 2022 15:33:11 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id y69so15190376ede.5; Sun, 30 Oct 2022 15:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=n2o/GMQ0tE3kyma8kEJB/WriSFlX/4OAcK/yGlC1IlE=; b=HABUGdOYJ2Ota30RMDhZXtIDHugmsIIqXOuZRUA24b6bDOpJXQ2G3HHR2xZx4lsH6m 7MPFnhxyxZZnJalq7R6AKJyp7R8e+Q9QpYuo7SrguIFU9zScACRdg44x9drn7M1Vw5nO D+F8+at+RnRWoC2j74lZ9YpPJfKZwBDJx0lA75eR93WhVTKfJsrobxOuYZ7gxPhadicD 5v5hIqYZKpEw51Gi/PlwYc725575Z/D7UzzqU0J9CMK2a6y+nKC4kOQPJRCg+LH6Xvtz S/+Q8oncydo38Iy6DHxXoS0zSzAFzL9jwzmAMRm7TCSrKxYKDhdjtI2OvvFWZEtoKKWN wvxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n2o/GMQ0tE3kyma8kEJB/WriSFlX/4OAcK/yGlC1IlE=; b=eEfv1YkxpBLnCmyt8AhHgmiGzO+NlYcqJQolUcqKJLRqzAwOh5Bw4e6+JUufodv8ed TAjYbnQFt+vg0zRmcU2/obAm/pfMYt1ohwqXxz5gQt5x2onXYAMzIvZYZ5vurbCGUHaB GrtGyxMvDuWELcPkP1MVr8ZCbi3kjA2Cgt0GJroxLrEt+e1xHajZPBsCBSVFJtPITuK2 KigbMS0jbgOuo4SXqwykg0ekNS4CclqcUexKkCfnkZ2P15wYbbUsEZAKKba4wkWXn9si QLlYpuGWou9vMuySQbdWXXuZyJpqpdKnxJW/HhjN0LnDmjivLUiGTgWDOBJtBGcm1/Kc OKkQ== X-Gm-Message-State: ACrzQf079zZoMZMWw4PaVW5OuCGcUwCw8GJfcndBzILfD05WGV9Cq6QE qgR6sh5+HtawORncyer3UCTF+hgU8boOipa7qyo= X-Received: by 2002:a05:6402:1219:b0:462:e788:723f with SMTP id c25-20020a056402121900b00462e788723fmr10523123edw.319.1667169190008; Sun, 30 Oct 2022 15:33:10 -0700 (PDT) MIME-Version: 1.0 References: <20221027103104.74576-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221027103104.74576-5-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Sun, 30 Oct 2022 22:32:43 +0000 Message-ID: Subject: Re: [PATCH v4 4/4] media: platform: Add Renesas RZ/G2L CRU driver To: Sakari Ailus Cc: Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , Jacopo Mondi , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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? Cheers, Prabhakar