From patchwork Wed Mar 13 07:24:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13591088 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8F891CD22 for ; Wed, 13 Mar 2024 07:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710314762; cv=none; b=ZHrP5uX/UTjxRUDntIle7aQABZO19M1rEJXxJM9ujPIplKReN9xqH6GKgIa8ctzNNMhGCLUFD6DJzm/k2M8OIqug/JTPeIaidaG5/JWZHOqXN5or6q0zDTmpCga4HTmEz4tzCClyu/iRPBFHNZpU006nqoIEUlkR7oQ9fxOeyHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710314762; c=relaxed/simple; bh=jcR/tkubng7hsJ4ph6IZVEB7mGiywZPRbtX5yHYOxTc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SZ9rDGoPAQxBLxrzpf4yvDWll1i/eO/aWoe72VJu9LGoMIItGGEdNOgCYvujq/zFlG4Cp+RiUCW43+npJeD6qfp4wisV1y8IxzFloCX2XwIBbuftzleUAoNZ00UcHUAtalzIZ8VUt4NA8ns9GgZOjsKunkbHvvIJyJKlkP8fVS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bjTLzlmy; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bjTLzlmy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710314761; x=1741850761; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jcR/tkubng7hsJ4ph6IZVEB7mGiywZPRbtX5yHYOxTc=; b=bjTLzlmyVwKGsTlrYtDJcbPIL1qDb0lRD7TUXT2BtqRwDSoP2KRhYEXf OewKbGbturBgQe6xLhnKac4WMxn5A75EC2daPbd1iUCwzSEoXIAQqETFh vluz1tUEdECLo8K1uFdVAqq/0oXvNP+wQLxJMIEaXmEv//BcFvG8SIM5v w3xeilDoM0ovXMDPXr0kvtFNk45Q254+ZJJ/IILIzszAIWUKMkqaze0uL JMSdAnysO8Gyihif7Cjb/JsQzEO5Z7h0+dAQ1sMbE3HDnO0B0xQMgM8NW M08J2OSkaSikpLftbT0umN56fXuQ/bCvp5Lg0SSyyBgtGO0dlyOfNMvb0 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11011"; a="22575630" X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="22575630" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 00:25:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,119,1708416000"; d="scan'208";a="42816466" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 00:25:51 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 73D431204F6; Wed, 13 Mar 2024 09:25:48 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Laurent Pinchart , tomi.valkeinen@ideasonboard.com, bingbu.cao@intel.com, hongju.wang@intel.com, hverkuil@xs4all.nl, Andrey Konovalov , Jacopo Mondi , Dmitry Perchanov , "Ng, Khai Wen" , Alain Volmat Subject: [PATCH v8 21/38] media: ccs: Move ccs_validate_csi_data_format up Date: Wed, 13 Mar 2024 09:24:59 +0200 Message-Id: <20240313072516.241106-22-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240313072516.241106-1-sakari.ailus@linux.intel.com> References: <20240313072516.241106-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ccs_validate_csi_data_format() will soon be needed elsewhere, above its current location. Move it up. Signed-off-by: Sakari Ailus Reviewed-by: Julien Massot Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ccs/ccs-core.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 0cd8ee957655..0efbc63534bc 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1979,6 +1979,20 @@ static int ccs_post_streamoff(struct v4l2_subdev *subdev) return pm_runtime_put(&client->dev); } +static const struct ccs_csi_data_format +*ccs_validate_csi_data_format(struct ccs_sensor *sensor, u32 code) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(ccs_csi_data_formats); i++) { + if (sensor->mbus_frame_fmts & (1 << i) && + ccs_csi_data_formats[i].code == code) + return &ccs_csi_data_formats[i]; + } + + return sensor->csi_format; +} + static int ccs_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -2114,20 +2128,6 @@ static void ccs_propagate(struct v4l2_subdev *subdev, } } -static const struct ccs_csi_data_format -*ccs_validate_csi_data_format(struct ccs_sensor *sensor, u32 code) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(ccs_csi_data_formats); i++) { - if (sensor->mbus_frame_fmts & (1 << i) && - ccs_csi_data_formats[i].code == code) - return &ccs_csi_data_formats[i]; - } - - return sensor->csi_format; -} - static int ccs_set_format_source(struct v4l2_subdev *subdev, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt)