Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp245255pxj; Thu, 3 Jun 2021 05:47:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOub1AET8uLU31O3DNy5ngKu6n+9nHbWrcTya++IEPEGc2H8diIQ/354EHvQXgjREDl+qd X-Received: by 2002:a17:906:1952:: with SMTP id b18mr25348812eje.262.1622724425445; Thu, 03 Jun 2021 05:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622724425; cv=none; d=google.com; s=arc-20160816; b=pSxdwyZrJq+U8NRJ0Ls9bOhUjyBrHRGQjBOpAaC6Bxsw1Jc95wh8tUyrXqfaUSOdYg jmbHlyVD+JqnEN9uJ23FhcAZPn4MN9zTy7vU4NwqB9bsqsXTuEG1tmEyGk4DJWvthZbq R/1jDase84UnokJaTFwI1kqGPsp1T5WjtkHM2eV5v2iSA/890H3urWA5shOrG5XFccmP 3bQ36bswZcSXwKXOy6tvfjs5g8qK2o8ugcJT1a/JEKq9vBwtwksl3Oc4CZqTXfb6My2Z 5jCZoXn7mq9Zve8R6iQiXVljqquofjIIxLdztps6ffWB5RiWBtWemb1ESRwecCzbUdCQ 0Psg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ld2ZYEAAJsMe8VGDEMRHK4KP5BnvM8RHtb2fs8ozz44=; b=upWHUV2nS+uKkUTF1je8SJuxF0Cj4DdL3ZG9Nv8khxuej4L1TGTkYsdolWjrjote/s EosL9r/0dEtA/Ur1Asj/G16ZdqxK/VF1NnGh6NxcUgN7vAM62JD0T9Q0Y1yOsHpUzObv e5lPWTEfduvU5ka/RUnjgR5nNWp8CR3P/jCLI4wgcnJ4Fgdxch1lOAjnePXXayge2+T3 HMoeGrGkufsC+bNf6LvSfQYBZlFdN02GszT8Kt/DGElcqD5EhYXzoD2n+8Du4S3MhM2D GJnfx0ZfccXfeVMjMrFL+Hy46XmjTWbqtCyjKZquRSaek4HeDDf6I5lqsJZKCFn5Hrm1 Cdpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SjeOvqCm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si2166732ejl.429.2021.06.03.05.46.42; Thu, 03 Jun 2021 05:47:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SjeOvqCm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbhFCMoq (ORCPT + 99 others); Thu, 3 Jun 2021 08:44:46 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:49664 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbhFCMop (ORCPT ); Thu, 3 Jun 2021 08:44:45 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 153Cgp2W101671; Thu, 3 Jun 2021 07:42:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1622724171; bh=Ld2ZYEAAJsMe8VGDEMRHK4KP5BnvM8RHtb2fs8ozz44=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=SjeOvqCm8QWJHJNEpKhM4orHSFy3DQdmXXXfbsIHiZwRIli2yadTzQZ7QOZFs2vtk 0rtYbfitbaSF7e+25CjqjaQ2F6STjDMrzziY3fwkIwpFgqVvV1DrqsBu4BJSnlOCb4 kc8E8+87LfFEe0I/h/ZbsFLxyoLXxAUkEXSQHhrw= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 153CgpXE124022 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Jun 2021 07:42:51 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 3 Jun 2021 07:42:51 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Thu, 3 Jun 2021 07:42:51 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 153CgoAC025764; Thu, 3 Jun 2021 07:42:50 -0500 Date: Thu, 3 Jun 2021 18:12:49 +0530 From: Pratyush Yadav To: Tomi Valkeinen CC: Maxime Ripard , Mauro Carvalho Chehab , Rob Herring , Kishon Vijay Abraham I , Vinod Koul , Peter Ujfalusi , Steve Longerbeam , Benoit Parrot , , , , , , Vignesh Raghavendra , Chunfeng Yun , Laurent Pinchart Subject: Re: [PATCH v2 10/18] media: cadence: csi2rx: Populate subdev devnode Message-ID: <20210603124247.qk42workxhfirbum@ti.com> References: <20210526152308.16525-1-p.yadav@ti.com> <20210526152308.16525-11-p.yadav@ti.com> <9c38a72c-18e8-1e54-b3b4-85ff5d47857a@ideasonboard.com> <20210528072401.2vdrtjdiepnr72vv@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/05/21 10:35AM, Tomi Valkeinen wrote: > On 28/05/2021 10:24, Pratyush Yadav wrote: > > On 28/05/21 10:16AM, Tomi Valkeinen wrote: > > > On 26/05/2021 18:23, Pratyush Yadav wrote: > > > > The devnode can be used by media-ctl and other userspace tools to > > > > perform configurations on the subdev. Without it, media-ctl returns > > > > ENOENT when setting format on the sensor subdev. > > > > > > > > Signed-off-by: Pratyush Yadav > > > > --- > > > > > > > > (no changes since v1) > > > > > > > > drivers/media/platform/cadence/cdns-csi2rx.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > > > > index 1df21f462f3c..49bed63d5faa 100644 > > > > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > > > > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > > > > @@ -613,6 +613,7 @@ static int csi2rx_probe(struct platform_device *pdev) > > > > csi2rx->pads[CSI2RX_PAD_SINK].flags = MEDIA_PAD_FL_SINK; > > > > for (i = CSI2RX_PAD_SOURCE_STREAM0; i < CSI2RX_PAD_MAX; i++) > > > > csi2rx->pads[i].flags = MEDIA_PAD_FL_SOURCE; > > > > + csi2rx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > > > > ret = media_entity_pads_init(&csi2rx->subdev.entity, CSI2RX_PAD_MAX, > > > > csi2rx->pads); > > > > > > > > > > I don't understand this one. There's nothing to configure in cdns-csi2rx > > > from userspace, as far as I can see, so why is the dev node needed? And why > > > would the lack of csi2rx dev node cause sensor subdev config to fail? > > > > Sensor config does not fail. But when I run media-ctl to set the format > > on /dev/media0, I get an error message that comes because the devnode > > for the bridge does not exist. I was not 100% sure about this patch but > > I figured if media-ctl expects it then it should be exposed. > > > > I don't mind dropping this patch. Just want to make sure what the right > > thing to do here is. Should every element of the pipeline have a devnode > > or not? > > Tbh, I don't know. But I don't see why they should have. Also, my test works > fine if I remove the devnode here. > > What media-ctl parameters did you use which fails? Media controller topology: root@j7-evm:~# media-ctl -p Media controller API version 5.13.0 Media device information ------------------------ driver j721e-csi2rx model TI-CSI2RX serial bus info platform:4500000.ticsi2rx hw revision 0x1 driver version 5.13.0 Device topology - entity 1: cdns_csi2rx.4504000.csi-bridge (5 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink <- "ov5640 9-003c":0 [ENABLED,IMMUTABLE] pad1: Source -> "j721e-csi2rx":0 [ENABLED,IMMUTABLE] pad2: Source pad3: Source pad4: Source - entity 7: ov5640 9-003c (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "cdns_csi2rx.4504000.csi-bridge":0 [ENABLED,IMMUTABLE] - entity 11: j721e-csi2rx (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "cdns_csi2rx.4504000.csi-bridge":1 [ENABLED,IMMUTABLE] Setting resolution on the sensor (with cdns-csi2rx devnode present): root@j7-evm:~# media-ctl --set-v4l2 '"ov5640 9-003c":0 [fmt:UYVY8_2X8/1920x1080@1/30]' The above command works. Setting resolution on the sensor (without the devnode present): root@j7-evm:~# media-ctl --set-v4l2 '"ov5640 9-003c":0 [fmt:UYVY8_2X8/1920x1080@1/30]' Unable to setup formats: No such file or directory (2) This sets the format correctly on the sensor but fails when it tried to set it on the bridge. -- Regards, Pratyush Yadav Texas Instruments Inc.