Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3662109rdh; Mon, 27 Nov 2023 23:27:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtzWGH6rdtrNx0RS8urqMZ6r8TyZ7bJQBaVZNHEqx/V9GrJSurvE406OQPGydmLpXngB6N X-Received: by 2002:a17:90b:4c91:b0:285:bd52:32df with SMTP id my17-20020a17090b4c9100b00285bd5232dfmr6490085pjb.30.1701156450541; Mon, 27 Nov 2023 23:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701156450; cv=none; d=google.com; s=arc-20160816; b=F9maQJIXvuM2But4nOUNj2o6KaiPnJuG9w52zuq92YZO3YQNxLFlVhgUNjSMZYmiK/ kv0I0/g84uHj8U/aaSDakYYZdK7kquFNOnWQhLsJsRT7TvDQU2Qf6wpfzUWUJ6wwCLSw ItCc1ZTGaS3c2n+IWjbnDuCzzqcRFwkcj1d5Jf8c4kNSRaasMf7fynH5g+kTC5NxmMad 69YAmmuzjmBXfyY+1BJcQYi+RT6ljyumFvRBFd9ywSNngY9JK7YuCgvfqjpT7qwjdKQI vrvIXKMQ//WjU6FJ0d0oUBk5srqWoMcTRnaHSGFzr7Sy/RpS8IOHV/Hzjxyk1b7+4lqz nHNA== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Ssqh7w0gyO7jZ8y3HEvt5feOCunBeqJzsQ7BVPvXVNk=; fh=XSYgRU0XaPChAqEvBD2QrkVcDv9Csvk6N6igiEqyY8w=; b=S1WEHyqoyrvYNsRXQDJ9itBtKVzyONV6+PgiD9/cBZpgMUYpvYPY5XgqJJ5ODRxbqM rdquwgACGUiZB47ptIOA5J3qaCmXdvxCtCaBqgmGLI5OWzc9IWkEx0FacGisVrXRBMkI dzmRMoyoH1fySlZpj5gux7YA+P6pjaV5UxIzHolUK2wa8V6NO+MklnP10JR4DjFoUBvd FVlsJE1In4vVOGUZpr7mNM820jA2+vrQSUutk5Wd87xH4/Vf+OBfma+WqDN47L9b7Kut 1ahyrz6ECwVZ7N0Z5v47vIOKOSo/tBGOIuRLPGspNE3kFxuK27z9tXGQvr1sI5MA4YGj Ys6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=5+dddTwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fv15-20020a17090b0e8f00b0027ffcd44adasi11501117pjb.133.2023.11.27.23.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 23:27:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=5+dddTwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8CB0480E3435; Mon, 27 Nov 2023 23:27:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234615AbjK1H1H (ORCPT + 99 others); Tue, 28 Nov 2023 02:27:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234358AbjK1H1D (ORCPT ); Tue, 28 Nov 2023 02:27:03 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DD5CD6D; Mon, 27 Nov 2023 23:27:09 -0800 (PST) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AS20ROl031456; Tue, 28 Nov 2023 08:26:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=selector1; bh=Ssqh7w0gyO7jZ8y3HEvt5 feOCunBeqJzsQ7BVPvXVNk=; b=5+dddTwDgfGM3saJyJ2k6qe0mmiiWTsiflx7l kqL2iTnqTq+4O+DoQXIHkHtH99G7dh2FI4od5yIOQc2E2dolxWOa/4+6JttE3YMy Iw9oeL8PFkDMnEnp0E6hBQfvMe2qK7EcZTHg+HorMiLV+cn7/MCjC6yufeuncdds AzvFBq06XQV96oLm97nOA0HWhEemuZpWu/sflKcjwH9WT7NfSXo3HdhJX2CWr8ws StPHYOGms3pE/b+O9DOaHmU61338bLAKWyeeqmVnYMX2zTeG7m8XZ1MGCVAK0gXK 3HA3VAINFSdLqUKrXPZMOgfYbJeWw4VNjazVYImuooe+QLZaA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3uk951u1j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 08:26:54 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9138910002A; Tue, 28 Nov 2023 08:26:53 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4458D214D20; Tue, 28 Nov 2023 08:26:53 +0100 (CET) Received: from gnbcxd0016.gnb.st.com (10.129.178.213) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 28 Nov 2023 08:26:53 +0100 Date: Tue, 28 Nov 2023 08:26:45 +0100 From: Alain Volmat To: Sakari Ailus CC: Mauro Carvalho Chehab , Benjamin Mugnier , Sylvain Petinot , , Subject: Re: [PATCH 4/7] media: i2c: st-mipid02: use active state to store pad formats Message-ID: <20231128072645.GA1435577@gnbcxd0016.gnb.st.com> Mail-Followup-To: Sakari Ailus , Mauro Carvalho Chehab , Benjamin Mugnier , Sylvain Petinot , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231125182057.1379357-1-alain.volmat@foss.st.com> <20231125182057.1379357-5-alain.volmat@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Disclaimer: ce message est personnel / this message is private X-Originating-IP: [10.129.178.213] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-28_06,2023-11-27_01,2023-05-22_02 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 23:27:27 -0800 (PST) Hi Sakari, On Tue, Nov 28, 2023 at 06:40:02AM +0000, Sakari Ailus wrote: > On Sat, Nov 25, 2023 at 07:20:52PM +0100, Alain Volmat wrote: > > Store formats information within pad allowing to simplify further more > > the driver (mutex / format store within the driver structure no more > > necessary). > > > > Signed-off-by: Alain Volmat > > Applied with the following diff: > > diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c > index 7af209905d7b..2cc07b3ed0da 100644 > --- a/drivers/media/i2c/st-mipid02.c > +++ b/drivers/media/i2c/st-mipid02.c > @@ -563,8 +563,8 @@ static const struct v4l2_mbus_framefmt default_fmt = { > .height = 480, > }; > > -static int mipid02_init_cfg(struct v4l2_subdev *sd, > - struct v4l2_subdev_state *state) > +static int mipid02_init_state(struct v4l2_subdev *sd, > + struct v4l2_subdev_state *state) > { > *v4l2_subdev_state_get_format(state, MIPID02_SINK_0) = default_fmt; > /* MIPID02_SINK_1 isn't supported yet */ > @@ -642,7 +642,6 @@ static const struct v4l2_subdev_video_ops mipid02_video_ops = { > }; > > static const struct v4l2_subdev_pad_ops mipid02_pad_ops = { > - .init_cfg = mipid02_init_cfg, > .enum_mbus_code = mipid02_enum_mbus_code, > .get_fmt = v4l2_subdev_get_fmt, > .set_fmt = mipid02_set_fmt, > @@ -653,6 +652,10 @@ static const struct v4l2_subdev_ops mipid02_subdev_ops = { > .pad = &mipid02_pad_ops, > }; > > +static const struct v4l2_subdev_internal_ops mipid02_subdev_internal_ops = { > + .init_state = mipid02_init_state, > +}; > + > static const struct media_entity_operations mipid02_subdev_entity_ops = { > .link_validate = v4l2_subdev_link_validate, > }; > @@ -851,6 +854,7 @@ static int mipid02_probe(struct i2c_client *client) > > bridge->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > bridge->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; > + bridge->sd.internal_ops = &mipid02_subdev_internal_ops; > bridge->sd.entity.ops = &mipid02_subdev_entity_ops; > bridge->pad[0].flags = MEDIA_PAD_FL_SINK; > bridge->pad[1].flags = MEDIA_PAD_FL_SINK; > Thanks a lot Sakari for taking care of that !! Regards, Alain > -- > Sakari Ailus