From patchwork Wed Feb 14 09:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13556108 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 9301310A35 for ; Wed, 14 Feb 2024 09:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902292; cv=none; b=aFg6UKzs8Q+OcHUIYOa3HqR4pSy5H5Oh1ZkBSeda6CA8DQUIai/PgG21YF7yTe+0FWsX6jmF1DBc732CeMP9d4vkdnllN2A9K+6flULfKmnW4zuZ8CRhN5ivrsJO6YGQidiqkoEP0O5znQgg2piy5bOnlq1yd2uMRXcZ2IXjjbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902292; c=relaxed/simple; bh=dOhCsLh7yVfNpfTWyJKGunc8t7LfAL+lYrcSkF0ZIdM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Epy2r3sF1sOL7sxHVW5kBq1Zp0cT6cwnm1dFS7T/+Zf3EfVzqkFCLPwFrRlZSpSvX0MwS4cedPOAvfijNTXeZLWFRH071FKfzqxC6bm8XfMV5/itHcf9MtGFg/y9EwZw2nFs/LqegjvX7r6iQIEZNq3mX5q9cZIAZrWXCpXrO8I= 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=DSgunlxE; arc=none smtp.client-ip=192.198.163.16 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="DSgunlxE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707902290; x=1739438290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dOhCsLh7yVfNpfTWyJKGunc8t7LfAL+lYrcSkF0ZIdM=; b=DSgunlxE4iYjh5hoPklzC/vzzX2ObnZXu3fcOESof5CJ+j14rsF4TacY O2Y7w43YLiQy8EoXXWFumoTPqJALiCP3yKCdaJ+hq7koimSASiRn6vbCe byt8e19DazPtxs1mjkyJr2SsB9wqQFiZQnk2w+NDxAV1V7C5TL50e7msI tPsXsvKtvS2jW+w9vZgBiAblf79YvtABcBQndzn9NaqeckQkBYV35y1py 53KR+iWKaOQv8OqWGF5H1OSuRgp9vzOSMzXoQmVwioReL6TLwTGx8wjR4 pEXmkBFxcwU3Bi6w6XGy7h0lbbUcqmDOr6wbpEEeuCFf0WW66CYkvNL8Q w==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="2301708" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="2301708" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935605011" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="935605011" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:04 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 5CE2D11FA12; Wed, 14 Feb 2024 11:17:55 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v3 1/5] media: ipu-bridge: Add ov01a10 in Dell XPS 9315 Date: Wed, 14 Feb 2024 11:17:50 +0200 Message-Id: <20240214091754.399340-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240214091754.399340-1-sakari.ailus@linux.intel.com> References: <20240214091754.399340-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 Add Omnivision ov01a10 sensor used in Dell XPS 9315, and use the driver default frequency. Signed-off-by: Sakari Ailus Reviewed-by: Daniel Scally --- drivers/media/pci/intel/ipu-bridge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index f980e3125a7b..b2cf80d62ba2 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -60,6 +60,8 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = { IPU_SENSOR_CONFIG("OVTIDB10", 1, 560000000), /* GalaxyCore GC0310 */ IPU_SENSOR_CONFIG("INT0310", 0), + /* Omnivision ov01a10 */ + IPU_SENSOR_CONFIG("OVTI01A0", 1, 400000000), }; static const struct ipu_property_names prop_names = { From patchwork Wed Feb 14 09:17:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13556109 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 7D7C611CB1 for ; Wed, 14 Feb 2024 09:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902293; cv=none; b=CHAmKWvzLD1pkrMlkeM53S1S0HdlKJW8W5CXrx8ZOUnjV0AhWDTTMe/su17ebYstu0limXi9JpifdB9l3wNTEcx8W7tWQcmp+HZrCwsTKI4NqgFD0ASF8hcOlLMRlSgzt0KKsbXygKJZUiwreO+ziChTfErXRadNjZtFWQH6k4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902293; c=relaxed/simple; bh=KvMGG0kB9pqr2p4BYVbUwIPfJ1m/0Jfv3Pq8WhIcHuI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uqdjrNrF+m8mksEFhYBeSvT11c3mOXhUNACwvsObU4/h/vZSHROMccwKugZkono9CqGHDwYhAT3ImxmXgVzZ9Jkqy3tg7Av5OhreSD22BCVHV2NL3ZjEWXDBzhk+pIwO1CAWxNQacapds88cG0UyEtx99i3sqLbjuJKoQGP8GqE= 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=YO8iG1Lk; arc=none smtp.client-ip=192.198.163.16 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="YO8iG1Lk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707902290; x=1739438290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KvMGG0kB9pqr2p4BYVbUwIPfJ1m/0Jfv3Pq8WhIcHuI=; b=YO8iG1LkBG/vcm8Av6iOaIaRgL19q21Ua2usXJzTQTeumH/tKgaw3BWW Ip8Z+9nyN36ZM6Zy6aU9cP0hn/z//oixIOmUfLouo3RZY3UIDFwoGgpzg CbDsGc0j0SEVfC1vUXuba9+iY362fUFpaJikRxdRUgMF2C5BCgx53gYef CCm69ay1bmMNV3yKQy9KR7uXp24ByYPQV0vw5cTn+HGuY36A+a+sWNKjj tcmVkOPp8cQ3OnY14GB+iHRDMOJmM5ZRrGD+xoiJ7+U9cURMe+WTy1QaN 9zDndzuKGWV+R71sKKOCDH+waIyhYhWLsgHNziKWfm6W3fdq2wlluxZFJ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="2301711" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="2301711" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935605009" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="935605009" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:03 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id E87A31202AA; Wed, 14 Feb 2024 11:17:55 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v3 2/5] media: ipu-bridge: Move graph checking to IPU bridge Date: Wed, 14 Feb 2024 11:17:51 +0200 Message-Id: <20240214091754.399340-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240214091754.399340-1-sakari.ailus@linux.intel.com> References: <20240214091754.399340-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 Move checking the graph to the IPU bridge. This way the caller won't need to do it. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu-bridge.c | 20 +++++++++++++++ drivers/media/pci/intel/ipu3/ipu3-cio2.c | 31 +++--------------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index b2cf80d62ba2..735c62c37c22 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -2,6 +2,7 @@ /* Author: Dan Scally */ #include +#include #include #include #include @@ -749,6 +750,22 @@ static int ipu_bridge_ivsc_is_ready(void) return ready; } +static int ipu_bridge_check_fwnode_graph(struct fwnode_handle *fwnode) +{ + struct fwnode_handle *endpoint; + + if (IS_ERR_OR_NULL(fwnode)) + return -EINVAL; + + endpoint = fwnode_graph_get_next_endpoint(fwnode, NULL); + if (endpoint) { + fwnode_handle_put(endpoint); + return 0; + } + + return ipu_bridge_check_fwnode_graph(fwnode->secondary); +} + int ipu_bridge_init(struct device *dev, ipu_parse_sensor_fwnode_t parse_sensor_fwnode) { @@ -757,6 +774,9 @@ int ipu_bridge_init(struct device *dev, unsigned int i; int ret; + if (!ipu_bridge_check_fwnode_graph(dev_fwnode(dev))) + return 0; + if (!ipu_bridge_ivsc_is_ready()) return -EPROBE_DEFER; diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index 83e29c56fe33..c42adc5a408d 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1667,29 +1667,12 @@ static void cio2_queues_exit(struct cio2_device *cio2) cio2_queue_exit(cio2, &cio2->queue[i]); } -static int cio2_check_fwnode_graph(struct fwnode_handle *fwnode) -{ - struct fwnode_handle *endpoint; - - if (IS_ERR_OR_NULL(fwnode)) - return -EINVAL; - - endpoint = fwnode_graph_get_next_endpoint(fwnode, NULL); - if (endpoint) { - fwnode_handle_put(endpoint); - return 0; - } - - return cio2_check_fwnode_graph(fwnode->secondary); -} - /**************** PCI interface ****************/ static int cio2_pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) { struct device *dev = &pci_dev->dev; - struct fwnode_handle *fwnode = dev_fwnode(dev); struct cio2_device *cio2; int r; @@ -1698,17 +1681,9 @@ static int cio2_pci_probe(struct pci_dev *pci_dev, * if the device has no endpoints then we can try to build those as * software_nodes parsed from SSDB. */ - r = cio2_check_fwnode_graph(fwnode); - if (r) { - if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) { - dev_err(dev, "fwnode graph has no endpoints connected\n"); - return -EINVAL; - } - - r = ipu_bridge_init(dev, ipu_bridge_parse_ssdb); - if (r) - return r; - } + r = ipu_bridge_init(dev, ipu_bridge_parse_ssdb); + if (r) + return r; cio2 = devm_kzalloc(dev, sizeof(*cio2), GFP_KERNEL); if (!cio2) From patchwork Wed Feb 14 09:17:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13556111 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 13668125C3 for ; Wed, 14 Feb 2024 09:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902294; cv=none; b=sAtLm41SGebVNo3CvztX4sBJfO4g0TuhmFBhBEjm76u1leePfpmALGEyx56oIifi+LhMTldi0qKXPxf9pJ3hYF3ub6Qq5Tj/lkitjiqufmKJMfZDQQ5b/FJlV2v2JPmC0EFoyX1GtL9Jbo9qj/HMNaLMFouRKZtb0d7+bLZVWXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902294; c=relaxed/simple; bh=Uhh3mxWZGmejQJ96IaMaKBX24BqSqQCwgOvIMSvGj3Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nLjfSFkBK0FP4zS60K9LnVQ3+scEOME/cVvgyUAIxPDmp84bk5qehnU2I3i2YwziV2NcIX649A0grI08EXCEI/fzfL2uC1u/Ej62xgMJzUPUyesOXhlbuIMxo5RVSiHwD5ZgvaA1Owuycn4rrN9Xzo3RNvO/Y+ol35bOqFChxaE= 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=ePH8HDEE; arc=none smtp.client-ip=192.198.163.16 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="ePH8HDEE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707902292; x=1739438292; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uhh3mxWZGmejQJ96IaMaKBX24BqSqQCwgOvIMSvGj3Y=; b=ePH8HDEE7TxQgsXpdunp+IjUD+sRbxN9a8LJYqvYLKNVeNLmR9TAJbwF PPDf9PKbo1KUaf2fsbRkBbuH/sT7JkUP+TjqMJbLjgygKU/zzhVO/GDBY 9KtjX7/G9pt5UDa3rW6YQyVFSrs2PpNtEkjf31JrVtfI3tu1a2H/5Mtk/ vyUGndyBQyXF/aJkwWIIL4oD9MTDtQ3si0YmnFdWL+UGGjIWr/f6ni2TU yR5LmgxqMwRmuCEbDA0g+RHKxgHxPIbTNfY/NlKK78WhhXzXqnsrcf8LT VAh7Gdw/q46NbZyvZpoh9Bq5q04mI5qmz8kh8iKFklxE81VVXl/GmAtIm w==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="2301717" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="2301717" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935605013" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="935605013" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:04 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 926EC1204F8; Wed, 14 Feb 2024 11:17:56 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v3 3/5] media: ipu-bridge: Serialise calls to IPU bridge init Date: Wed, 14 Feb 2024 11:17:52 +0200 Message-Id: <20240214091754.399340-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240214091754.399340-1-sakari.ailus@linux.intel.com> References: <20240214091754.399340-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 The IPU bridge initialisation will be called from multiple locations in the future. Serialise the access to devices' fwnodes in this context. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu-bridge.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 735c62c37c22..e994db4f4d91 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -766,6 +766,8 @@ static int ipu_bridge_check_fwnode_graph(struct fwnode_handle *fwnode) return ipu_bridge_check_fwnode_graph(fwnode->secondary); } +static DEFINE_MUTEX(ipu_bridge_mutex); + int ipu_bridge_init(struct device *dev, ipu_parse_sensor_fwnode_t parse_sensor_fwnode) { @@ -774,6 +776,8 @@ int ipu_bridge_init(struct device *dev, unsigned int i; int ret; + guard(mutex)(&ipu_bridge_mutex); + if (!ipu_bridge_check_fwnode_graph(dev_fwnode(dev))) return 0; From patchwork Wed Feb 14 09:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13556110 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 5CF43125AD for ; Wed, 14 Feb 2024 09:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902293; cv=none; b=M0MYONb/Rg2QrRkZRDrY5+Z1BG9xWBT/pA55fwH3mjBr7La2iW3Y3nNLqIxrnont5mEZzEHo0C21F29Y6COHYil5xs8bLJjERcf/l+ajvDSVuKicAA5GdeZDv4AMFhJamTyWYryNzPLKHQEKRU7rm3cUzOK2sT9zOUjxmKu83ZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902293; c=relaxed/simple; bh=BHyynvrMazyltXmlk9qK/qV+rORusvUP2HcyTkdl310=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nu95/rTRnEzFn/DJlStJqP94q3th9PBYGLjn35tRZJctjovvkbUtLfEOje1U6rEVDbkmycscz0QH5YaC81Tbvdu3PjataBspf9LfOog8l6XyYIuXI93xSWzu55GZ1+kuHbkuW3ckVfgke+O9FJEIK6VnS6RLmfj5xPicpmT7RyQ= 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=Bv4/JSM1; arc=none smtp.client-ip=192.198.163.16 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="Bv4/JSM1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707902291; x=1739438291; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BHyynvrMazyltXmlk9qK/qV+rORusvUP2HcyTkdl310=; b=Bv4/JSM1PeIX90dZAgbsz7i8+x4TCtqj563+t3m4nPqo9qdf5I05FmKZ p1nVj1EIE43FOVgw75g8JTp6X4PunrT/nQUs2kQ8ImHu0ox5dJT7bxoKF ShVTgsAmEF4ljLKAeSCCONSlUQ6jT9+NJ//EimPgtb5oxfdgPxMq6/M5/ 61BanYy/YgT7LwiK9TUSN+JgQlrFEHJmKhKjXLFcrwsGPhtMaNRlIC9N+ q35SADlnO0CQ2vQ3eTK+H2diOTQzcZZXiuh/52aNtAM/4OmyZ+7MJBFs5 kmdZArE6VWh7s6THs/F7KGAGNynNp/SFz87mRMW5IZDHR8n7nIWJpKamo g==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="2301720" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="2301720" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935605015" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="935605015" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:04 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 2A08B1204FB; Wed, 14 Feb 2024 11:17:57 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v3 4/5] media: ipu6: Add PCI device table header Date: Wed, 14 Feb 2024 11:17:53 +0200 Message-Id: <20240214091754.399340-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240214091754.399340-1-sakari.ailus@linux.intel.com> References: <20240214091754.399340-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 Add a header for the PCI device table of all IPU6 devices. This will be used by the IPU bridge as well so place the table in a header. Signed-off-by: Sakari Ailus --- include/media/ipu6-pci-table.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/media/ipu6-pci-table.h diff --git a/include/media/ipu6-pci-table.h b/include/media/ipu6-pci-table.h new file mode 100644 index 000000000000..40208785398a --- /dev/null +++ b/include/media/ipu6-pci-table.h @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2024 Intel Corporation + */ + +#ifndef __IPU6_PCI_TBL_H__ +#define __IPU6_PCI_TBL_H__ + +#include + +#define PCI_DEVICE_ID_INTEL_IPU6 0x9a19 +#define PCI_DEVICE_ID_INTEL_IPU6SE 0x4e19 +#define PCI_DEVICE_ID_INTEL_IPU6EP_ADLP 0x465d +#define PCI_DEVICE_ID_INTEL_IPU6EP_ADLN 0x462e +#define PCI_DEVICE_ID_INTEL_IPU6EP_RPLP 0xa75d +#define PCI_DEVICE_ID_INTEL_IPU6EP_MTL 0x7d19 + +static const struct pci_device_id ipu6_pci_tbl[] = { + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6SE) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_ADLP) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_ADLN) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_RPLP) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IPU6EP_MTL) }, + { } +}; + +#endif /* __IPU6_PCI_TBL_H__ */ From patchwork Wed Feb 14 09:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13556112 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 33A9710A35 for ; Wed, 14 Feb 2024 09:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902294; cv=none; b=tAnszx6++d4stN6sCVOXi6DdUwV9cV5DD8q2aclINDnLagrvDQuEDYdMUjHQl8Evc36ti0JVfsQxSlbSAKOF2SyS1sHlLs6MzaNQnhtnXWY4tTSenvwNSN18fWo2FlEdwKwrCkJuQgeCKvFENpIEOyPp8OxdFTcNb2ukAKGY7aM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707902294; c=relaxed/simple; bh=GhQ4v9FKklhnme+bSakScBV6O1udJH7XQ5qP4SPESvE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ApSC6gt3GkyBUioHpchzDDJO5ZfSBU68mM2gAUxKWV+VmME1Qtdh3gG/bnkYWAhypPh4E22zxpq1DkNIw8ZZ6auVCpDFRmyu0AlAdEpWPy39PbW4AcN/xvms5IYfts18rjSsYhSC+02ZTh2E+LDK+WbYFTi0axz5ZhQ+gGhaVYA= 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=UCXkKkE6; arc=none smtp.client-ip=192.198.163.16 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="UCXkKkE6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707902292; x=1739438292; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GhQ4v9FKklhnme+bSakScBV6O1udJH7XQ5qP4SPESvE=; b=UCXkKkE6hKlT/74EBDnlza+LAIcfKu9HA9u9fRAixpO8AfEYS1rKi/0A 4GvlCdxC2feTjO4jGW36Nhh2CyMd1hEoB/zK/ggBsOGhlklHUtIH4vdng NAUDYVNI002p1VFrsb2wtOV0zYZRG8XPg3fa7b8IDqCYUlUsuQaLMOj1k cV27M/GNdXOSfeNo9MgSfkRsbHL+yxovZA3GC2lzNEp2oVnOvVEMomZad sehMUhSNsgu4K0ecLaoxc1e/75GQN0zq2q9MMHiZAkVGu+Nzkg6B7eufZ K3fCuqdTAYrceM7/QKUxjDeepP4q6Ur8xeqxB9fvGQvVaKQGF8s4WNYyk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="2301724" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="2301724" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935605021" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="935605021" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 01:18:07 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id B45F212055E; Wed, 14 Feb 2024 11:17:57 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v3 5/5] media: ivsc: csi: Use IPU bridge Date: Wed, 14 Feb 2024 11:17:54 +0200 Message-Id: <20240214091754.399340-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240214091754.399340-1-sakari.ailus@linux.intel.com> References: <20240214091754.399340-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 Use IPU bridge to instantiate software nodes for IPU6 related devices. If the IPU6 device is probed before the MEI CSI device is created, neither will probe unless there are further devices probed successfully which triggers re-probe of both IPU6 and MEI CSI. This patch ensures the necessary software nodes are in place when the MEI CSI driver is probed. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ivsc/mei_csi.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index 15b905f66ab7..b3f39c9a60d2 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -19,12 +19,15 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -716,11 +719,23 @@ static int mei_csi_probe(struct mei_cl_device *cldev, const struct mei_cl_device_id *id) { struct device *dev = &cldev->dev; + struct pci_dev *ipu; struct mei_csi *csi; + unsigned int i; int ret; - if (!dev_fwnode(dev)) - return -EPROBE_DEFER; + for (i = 0, ipu = NULL; !ipu && ipu6_pci_tbl[i].vendor; i++) + ipu = pci_get_device(ipu6_pci_tbl[i].vendor, + ipu6_pci_tbl[i].device, NULL); + + if (!ipu) + return -ENODEV; + + ret = ipu_bridge_init(&ipu->dev, ipu_bridge_parse_ssdb); + if (ret < 0) + return ret; + if (WARN_ON(!dev_fwnode(dev))) + return -ENXIO; csi = devm_kzalloc(dev, sizeof(struct mei_csi), GFP_KERNEL); if (!csi) @@ -841,6 +856,7 @@ static struct mei_cl_driver mei_csi_driver = { module_mei_cl_driver(mei_csi_driver); +MODULE_IMPORT_NS(INTEL_IPU_BRIDGE); MODULE_AUTHOR("Wentong Wu "); MODULE_AUTHOR("Zhifeng Wang "); MODULE_DESCRIPTION("Device driver for IVSC CSI");