From patchwork Sat Nov 25 18:20:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 169762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2093071vqx; Sat, 25 Nov 2023 10:22:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEm7ZnB6fo/nBa7bx2ErpoX5o4I93q7XH7Bd6lT+bRVflaSlcvSbMtYvVcSkSf70dsgXtNj X-Received: by 2002:a17:902:be14:b0:1cf:b55d:a0fd with SMTP id r20-20020a170902be1400b001cfb55da0fdmr2480976pls.33.1700936566246; Sat, 25 Nov 2023 10:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700936566; cv=none; d=google.com; s=arc-20160816; b=CZC4DBWVx5TaEh6Odtfj9mcOMYQ02pWIRVPlljPhtgC0TIyTzS/GJfXan+wVRWPKC3 393nxXFwBYWKNLrIX+hi8tgUwgkrDfndndcsT03ZZsqNdxoclMFPozQIDfDp/yjvKcwe jr+mkBinhetaaJsu1ZQtCKPSYnhAWt5YtSQka85ng/QnyiK3akMTMC8daJ8IKAFtKROg JjM6PL6Q2nZMdyGCVrGga+l7Rmym1n7c+6xj3j79T/8CDRORz45KSfaKnaVOiwoqgINs eISCRrkltYhqlu9gnzTWMWrSPdECCM2QGxuD5Jpqy0qGt0PDxCrcQvZC/1BJS53rcla6 lggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/goBROYTeH/F32rKxIN/0DnppG1ZihAuto8o1t5kprE=; fh=aATIuJQBPIMUXucEnWXDVLrPAQTYMg8TXITJvQquOpU=; b=s4Aa4flnjIwqcK0fWfvCDKFxHaY4MPlgXhwpFZtwg/58PkobJmgCEVae/0zYMhT4N1 reIrPvYtlhIQje2ezl5uTvvht9xoObr7jwy0ojWgY0/6zjZQhWhpiVOYb1jLyhsuqlEe OSyo7FthMm0DRtGxKD917l8sihxwWKE2c/VQSQr1Qn5iQ+QFh7mCuRzszgeZQr+z669v rNBF67TMH5bx3TmNfVj8jNR8ZYlyJsEHh3I2cK7JDah3KQRxHqvwSqYazmoV5YqkFjHG 0yjGgix7aYXrI4n6jyIukmHNp+1/18++P6ybsAE5nlov+Ojx3jA+iocpvVEq3cD6mW7I s3EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=aS38ssEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id mm20-20020a17090b359400b002800f26bfdasi6647729pjb.12.2023.11.25.10.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 10:22:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=aS38ssEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 213B38062911; Sat, 25 Nov 2023 10:22:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbjKYSW2 (ORCPT + 99 others); Sat, 25 Nov 2023 13:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjKYSW1 (ORCPT ); Sat, 25 Nov 2023 13:22:27 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6946C5; Sat, 25 Nov 2023 10:22:33 -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 3APCHQIm014841; Sat, 25 Nov 2023 19:21:57 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=/goBROYTeH/F32rKxIN/0DnppG1ZihAuto8o1t5kprE=; b=aS 38ssEeprTn0MvTM/CvCVJc+dFdKvppmM1tqn5BKxm8yWFK0Vi3U2rBulkbTxZvPX uGsGEDUYL9Vu86fBMaM4cbM3pb5EkGcbZ6z/V+YTsvC9+cHcbKL0ijzjZejk3R5U 28+Bd7mPl59PX3Zw4uzahmXBTfAF0QGk7G7s2ljvqkQUWWvLYDzlRW6x/z6VUh2o /eL3WjHFq6tx20rHoT4AqhW9llHtXnQvNdM8/d5wcG94EDt8aQg6l8y9UBSYHTUW 4+ul+5KTZtpL0lWAExwlm9keF8LJBqVLukonyPrzi8gGWEr94JXNB9wYx9uj3QSz 0YqMLqxBgz7ugnJvij3Q== 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 3uk951hvn7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 25 Nov 2023 19:21:57 +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 42D0510002A; Sat, 25 Nov 2023 19:21:57 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3972823C6A4; Sat, 25 Nov 2023 19:21:57 +0100 (CET) Received: from localhost (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; Sat, 25 Nov 2023 19:21:58 +0100 From: Alain Volmat To: Mauro Carvalho Chehab , Benjamin Mugnier , Sylvain Petinot CC: Sakari Ailus , Alain Volmat , , Subject: [PATCH 2/7] media: i2c: st-mipid02: don't keep track of streaming status Date: Sat, 25 Nov 2023 19:20:50 +0100 Message-ID: <20231125182057.1379357-3-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231125182057.1379357-1-alain.volmat@foss.st.com> References: <20231125182057.1379357-1-alain.volmat@foss.st.com> MIME-Version: 1.0 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-25_17,2023-11-22_01,2023-05-22_02 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 10:22:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783561260898526076 X-GMAIL-MSGID: 1783561260898526076 As explained in the following series, subdev do not have to keep track of their streaming status: https://lore.kernel.org/linux-media/20230914181704.4811-1-laurent.pinchart@ideasonboard.com/ Signed-off-by: Alain Volmat --- drivers/media/i2c/st-mipid02.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index b699f0b4efe7..1efaa54866a8 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -112,7 +112,6 @@ struct mipid02_dev { } r; /* lock to protect all members below */ struct mutex lock; - bool streaming; struct v4l2_mbus_framefmt fmt; }; @@ -629,22 +628,13 @@ static int mipid02_s_stream(struct v4l2_subdev *sd, int enable) struct i2c_client *client = bridge->i2c_client; int ret = 0; - dev_dbg(&client->dev, "%s : requested %d / current = %d", __func__, - enable, bridge->streaming); - mutex_lock(&bridge->lock); - - if (bridge->streaming == enable) - goto out; + dev_dbg(&client->dev, "%s : requested %d\n", __func__, enable); ret = enable ? mipid02_stream_enable(bridge) : mipid02_stream_disable(bridge); - if (!ret) - bridge->streaming = enable; - -out: - dev_dbg(&client->dev, "%s current now = %d / %d", __func__, - bridge->streaming, ret); - mutex_unlock(&bridge->lock); + if (ret) + dev_err(&client->dev, "failed to stream %s (%d)\n", + enable ? "enable" : "disable", ret); return ret; } @@ -777,20 +767,14 @@ static int mipid02_set_fmt(struct v4l2_subdev *sd, mutex_lock(&bridge->lock); - if (bridge->streaming) { - ret = -EBUSY; - goto error; - } - if (format->pad == MIPID02_SOURCE) mipid02_set_fmt_source(sd, sd_state, format); else mipid02_set_fmt_sink(sd, sd_state, format); -error: mutex_unlock(&bridge->lock); - return ret; + return 0; } static const struct v4l2_subdev_video_ops mipid02_video_ops = {