Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp297751pxp; Wed, 9 Mar 2022 03:14:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc8NVr3VdHMOmIWQ2jY6Y83jHVfAeSJ4o5HewJbAC4k7ypBC1I4yVgymKDFocgaYuMgokW X-Received: by 2002:a17:902:7606:b0:151:6e0f:8986 with SMTP id k6-20020a170902760600b001516e0f8986mr22532786pll.20.1646824457192; Wed, 09 Mar 2022 03:14:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646824457; cv=none; d=google.com; s=arc-20160816; b=Sx4QCyi7ZqmbSVEDaUXEa0cCkdhS9EG8JBDiD1lB3oUSj0pIE1kUPj+9RNgrh4D+nh 27dgxzXwGfVS3l/cR5SSNNPRaZYKW2OC7iPBEVImI4+nhmkys9OfkCEm5zKN50vDWvaE 2CTVWrCe5BPP0dQ3w/UKA4lgLyy9xNjijXS7WwqOOs/m3f4BBAixG/zxjKtgpI3ONuaE +9k+QTPxtFgWGELDgse4bySmghvmzhHOUYEoXoIR50KMfJ9SHwkVpdLsd6Jx1u8U1OLi u+A7lV4fpKM8x1WcRXvUsP99yB3+MJrHO7lVY1kOXhtwKsWka5BNGOQBpo3Wn7gtEHmm P4EQ== 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; bh=8WOfAd8OBAW7yTSPXV62a9nXPmeh9TH05OEk0moVkTw=; b=AcX62vGi7HeI8jx2jPZP296rnp5GtrBFF4aybBgXhvCuqM99a6jsfo3sS160X4MJm0 lSP5mmPW0RZ3nEIgzOhMDwMFx9izWosjUhIbVJ7F0Xe3Vi5xCez9egGr0CAe3jL1SFGo uXzM1MZv8Ya/ySCAl/Z+PhaUrHCpj9x/HKeTsAQiC4yezZIXMoasBzUnXpmrLIu+6wwb rydOY1R6DDjzpCHaq03tECAdwfMeiWfBTou/nEWShkK4GISdUCbQM77IToOvXw4OLYDu OAgqSrfZrfLWCIV8UBB0AYBxTVWgumv74D8EqNrc4E5knX5iijyX03y121Xj25sL+t+G NSDw== ARC-Authentication-Results: i=1; mx.google.com; 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 k189-20020a6384c6000000b003805d50ba70si1605511pgd.192.2022.03.09.03.14.01; Wed, 09 Mar 2022 03:14:17 -0800 (PST) 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; 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 S231442AbiCIIoW (ORCPT + 99 others); Wed, 9 Mar 2022 03:44:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231435AbiCIIoT (ORCPT ); Wed, 9 Mar 2022 03:44:19 -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 1B399B7C77; Wed, 9 Mar 2022 00:43:19 -0800 (PST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 936BBC0014; Wed, 9 Mar 2022 08:43:12 +0000 (UTC) Date: Wed, 9 Mar 2022 09:43:11 +0100 From: Jacopo Mondi To: Laurentiu Palcu Cc: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Niklas =?utf-8?Q?S=C3=B6derlund?= , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: i2c: rdacm2x: properly set subdev entity function Message-ID: <20220309084311.vn3awybkxzxd32i4@uno.localdomain> References: <20220308125549.9676-1-laurentiu.palcu@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220308125549.9676-1-laurentiu.palcu@oss.nxp.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Laurentiu, On Tue, Mar 08, 2022 at 02:55:49PM +0200, Laurentiu Palcu wrote: > The subdevice entity function was left unset, which produces a warning > when probing the device: > > mxc-md bus@58000000:camera: Entity type for entity rdacm20 19-0051 was > not initialized! > > Also, set the entity flags to MEDIA_ENT_FL_DEFAULT instead of > MEDIA_ENT_F_CAM_SENSOR which will be used for entity's function instead. > > Signed-off-by: Laurentiu Palcu > --- > Hi, > > Only tested the rdacm20 part but I believe rdacm21 should work as well. > > Cheers, > laurentiu > > drivers/media/i2c/rdacm20.c | 3 ++- > drivers/media/i2c/rdacm21.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c > index 025a610de893..ea5b7d5151ee 100644 > --- a/drivers/media/i2c/rdacm20.c > +++ b/drivers/media/i2c/rdacm20.c > @@ -611,7 +611,8 @@ static int rdacm20_probe(struct i2c_client *client) > goto error_free_ctrls; > > dev->pad.flags = MEDIA_PAD_FL_SOURCE; > - dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR; > + dev->sd.entity.flags |= MEDIA_ENT_FL_DEFAULT; I'm not sure if setting the DEFAULT flag is right: * %MEDIA_ENT_FL_DEFAULT * indicates the default entity for a given type. * This can be used to report the default audio and video devices or the * default camera sensor. In a typical setup there will be several RDACM2x in use, marking all of them as "default" seems not right (if I understood the flag description right). > + dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; This seems right, and it's probably worth a Fixes tag? Thanks j > ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); > if (ret < 0) > goto error_free_ctrls; > diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c > index 12ec5467ed1e..be89bd43e88b 100644 > --- a/drivers/media/i2c/rdacm21.c > +++ b/drivers/media/i2c/rdacm21.c > @@ -583,7 +583,8 @@ static int rdacm21_probe(struct i2c_client *client) > goto error_free_ctrls; > > dev->pad.flags = MEDIA_PAD_FL_SOURCE; > - dev->sd.entity.flags |= MEDIA_ENT_F_CAM_SENSOR; > + dev->sd.entity.flags |= MEDIA_ENT_FL_DEFAULT; > + dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; > ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad); > if (ret < 0) > goto error_free_ctrls; > -- > 2.33.0 >