From patchwork Tue Feb 13 13:08:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13555102 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 3EDC950A6F for ; Tue, 13 Feb 2024 13:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829714; cv=none; b=mUF9oPX1CzzlP88yO5vNHz+Mh69R/XLhduDEL+d895iNUvYI/a7lp6hb0upxffS3Kej6LMPAeGqmCookyPVhVG5nwKlme0j64vaU/9j6UAcyH97VNKGAYI2J88kYObEok1a31mjbTzYdFcMrIlUyx7vzTm7JF0PPi+6oFhgBqqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829714; c=relaxed/simple; bh=dOhCsLh7yVfNpfTWyJKGunc8t7LfAL+lYrcSkF0ZIdM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mOFGqm6hi/0NOTUw623bf68+8zKqRMPk+0XyEMdIlcyQaMW1vm9mkt1PX8+9Sbyf2xPuhM2WAA6dxWpgbJ2QPWhN+aQaFSbDU7nlsJwY7Yxwy6jDrhHAuvzUz/j9ZmArPbn8TAxeDyZswfeuCcwpn5vICeZM/Hm0Ef+eRMapUQo= 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=bi8eVLqG; arc=none smtp.client-ip=198.175.65.21 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="bi8eVLqG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707829713; x=1739365713; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dOhCsLh7yVfNpfTWyJKGunc8t7LfAL+lYrcSkF0ZIdM=; b=bi8eVLqGiW017ywTU4LItFpjhvkpLRQn/AGKE88vsNokI550/Az5vUuQ sU7nD0oM8qyR+J31UqzP0dSSsIUTqNYMit/xRiuU6FZYmidhkh/29b2O/ KKG+01kxx8daR133tNnk5gxHMEmZfKfUkWhImYqvTGcyZNFGfx0fezuwU Qu6hcit3Cub1LahIHgmSPJ/09twRfH7oNgAJ3QQbmP6f1+ZLU23vnNHAR AfSUP0kP+5pkfN5K7P+iuoDsH+zFHJuvcwixp304C1qpt92SrRrKkiqRt fHmD99NS1S6/r3qQ1OZoTUPbsDjirISev7mRVb2pb2D9YzB7TKwfVzofB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1739940" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="1739940" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="26061687" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:20 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 2AE1E11F855; Tue, 13 Feb 2024 15:08:17 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v2 1/4] media: ipu-bridge: Add ov01a10 in Dell XPS 9315 Date: Tue, 13 Feb 2024 15:08:12 +0200 Message-Id: <20240213130815.382792-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213130815.382792-1-sakari.ailus@linux.intel.com> References: <20240213130815.382792-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 Tue Feb 13 13:08:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13555103 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 A392D50A83 for ; Tue, 13 Feb 2024 13:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829715; cv=none; b=T2wYYTr+OOpzVlcGwBB8Fdftft7i1pwlkUIWHl9WNrojZo8/3TAMrNsFX0RuYXYH2HaFs4Iz23pQrz/UJiVMnuxybol1TYSgHywkJ5vrxw0uFF18Qw5PmxLdkAbKY6pcADnj4ptu1RRjFBe39Byxl7IFHxtIRmLpWwR/Ll6fXnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829715; c=relaxed/simple; bh=IFKGi5sIDa/R7CytUtDFXXP4bC8QD9mJHKMZFwnaFUQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IP4XYJYjz1lbA/dwWpxkBdxNvoVdNcOu0Uql67Y1nL8DeFDDlRWLriI/XI3Dx4ne6rPntWWNNRo3/Ff9AWCWtzre3gb6wQW3OHJW3604QUe7I6ppPIhbCREqS0/x/dqNe1uitoZxHvVa1Xcm634Q88a/VD6FgDmGKqUtClDYzsU= 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=Y5KlwIg4; arc=none smtp.client-ip=198.175.65.21 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="Y5KlwIg4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707829713; x=1739365713; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IFKGi5sIDa/R7CytUtDFXXP4bC8QD9mJHKMZFwnaFUQ=; b=Y5KlwIg4atks5oWCl1btCBuE2hm6BFtN1NeU2ZZrYHtx/u1LMv8QcHcr fuNeD9pJ2uwcWOqTaVo1THTEZ7m05unk4ffTAHPQ8p+yHx5FAepLsZnSu 0HlMu7J8QB/bVcou/rv88YDEChmcPvPQEUQlwNxZICLaKJ/ChoW1Jh69/ QixhjmWkW9ZSuyvB91sD4nYYAs2QPCm8WoggMtVqMLxdmJdBYZLeZiPlx MZXfNrcyvanBMGSg90OOS4o4JC37hanfCDJixwCCqrX1gU9SPz64bwZ0u KAmqxsLmWOrQPewKzQ5wZNDqu5JLfD9EYmiNmximrZjTdIhiqHYn8t2C7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1739945" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="1739945" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="26061691" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:20 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id C05DE11F871; Tue, 13 Feb 2024 15:08:17 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v2 2/4] media: ipu-bridge: Move graph checking to IPU bridge Date: Tue, 13 Feb 2024 15:08:13 +0200 Message-Id: <20240213130815.382792-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213130815.382792-1-sakari.ailus@linux.intel.com> References: <20240213130815.382792-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 | 30 +++--------------------- 2 files changed, 23 insertions(+), 27 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..df6a9308559a 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1667,22 +1667,6 @@ 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, @@ -1698,17 +1682,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 Tue Feb 13 13:08:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13555104 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 DC9A251020 for ; Tue, 13 Feb 2024 13:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829716; cv=none; b=t8hTwdCjSqlk2yb/5vya/jTT1DyUejyL/vnUYGqFWFOXbPVFZ6t4e/M9bZnCu7tE5AzoM1rSSv559d6AlcgjhiB391onIl8HHr6BnztKCKqvG2gFKdfGTVdZqVdns6JhfRgxVkuDUUDjXz2J2OR+unZ9f42yDUKP+KYIBXjimKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829716; c=relaxed/simple; bh=Uhh3mxWZGmejQJ96IaMaKBX24BqSqQCwgOvIMSvGj3Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WOgkxq2EzhV9CsZplbUVmGpLEFGF54vXr2+Gber5md4+zBJeEe4vLyNcaEjvvkTFYidHU97mldYDAOrgpB/AHfj3kAGZpzoPLZIgBcgGIRqTyrK+D2v40Icq+bhVeRth4tmmFs+gS++9mP/2XlepmN6n/BVQ4oRh/ZRusGAEhKE= 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=i2zu4E5A; arc=none smtp.client-ip=198.175.65.21 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="i2zu4E5A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707829715; x=1739365715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uhh3mxWZGmejQJ96IaMaKBX24BqSqQCwgOvIMSvGj3Y=; b=i2zu4E5ABZ7bB58M55MXtbI1J4bS3KTr9tCuHeCHL0g4RVWXvomq4hWL yDFLdEyrnSM3iBblnHe8cbjjRtm6S/2/QLygZFkDxpLf38nI32k7VLQ3l l39pNeqJB/Lt99tdP+VapsUIBHF3E8oG5j7Kydi/KTJT+e8iBEkfXk+ha tryhP+LmWeugkKnwAQgPziJ3cLdkTXc3PxEDsSikj58jeNDJJ3xVzhaU0 +OY7YGN1D7obNLaZR0tswyPC45ql0J663qg/l30hXJHDqQH1rSa+LaXZa +x9/oz3GYuLW5lWz+Q55ptMtpI5WjEUuWa3HzcoI+0do/6hUIQdKPDrJd A==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1739950" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="1739950" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="26061694" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:21 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 73A0C11FA58; Tue, 13 Feb 2024 15:08:18 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v2 3/4] media: ipu-bridge: Serialise calls to IPU bridge init Date: Tue, 13 Feb 2024 15:08:14 +0200 Message-Id: <20240213130815.382792-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213130815.382792-1-sakari.ailus@linux.intel.com> References: <20240213130815.382792-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 Tue Feb 13 13:08:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13555105 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 3D38D4CB22 for ; Tue, 13 Feb 2024 13:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829716; cv=none; b=mGrhcqjKWtT6lqnHhcrrLTFfK9D+EUMxa+0WIRKWSt2pKCO885Y4asZciZCZMmI/KZOQRi/M1Yrj7v9qEvw8iAGFxyGf9MUK+TFJCPrC4YkdHtFXgxu3iQXTVgUjnh0JkzhsrgNRsuHNgfTtBU1sjaKcqsH5SWF07z+z3oHx2o8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829716; c=relaxed/simple; bh=5x1uQFU/utZ+omLoh5VeYQrzrTgwlyOMHI0cIqHl1ZE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KIXmcXoLRGFmU3a6V2MUM8/2JMQR/iC8Na4AuclAWr522lSqXvx+agshHPbAI6dxfMYFf8Sk3iX9+BNTqaX5QvT+xjcn7Ls18Otpoh4dW4XVOquOzumP50esydbjueQhugLDZZHxKXb1S08Q2MVmoebyjEIRkHk6SLUjQQAVIuQ= 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=PIukKUC4; arc=none smtp.client-ip=198.175.65.21 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="PIukKUC4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707829715; x=1739365715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5x1uQFU/utZ+omLoh5VeYQrzrTgwlyOMHI0cIqHl1ZE=; b=PIukKUC4669XbkYsvkoFwpcxR81GBGi5SRdJPPAsB3/N8IO5S89KAy9G mvNSPdqkjgblNpd1/vTRFdV52NMb4l8Wdo8K1neFmuMCMZlzLOtP05lCC BSWeX6u0SZUFTTpqzUxKVxHXLPPI1lUS0kihvyzIIDdjLzrscXyGrdNY8 Y3F91UZ2mZJNUW+FC2wskcX9ibyitiyl+QTeTaxHTugR507EmYCaMQnMi FeSIESmufzu8yOBP2A4Up+Se9NU6NIRp5WaoGzsAWxpFZ67LDEeKDXvUq y0RtL2Ysivt9RiQaVBEPiVDX1zQGknYvcxcrAuiTEICXHVDQ0RIruujoC g==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1739959" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="1739959" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="26061699" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:08:22 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 57D821202B6; Tue, 13 Feb 2024 15:08:19 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Hans de Goede , Daniel Scally , Bingbu Cao Subject: [PATCH v2 4/4] media: ivsc: csi: Use IPU bridge Date: Tue, 13 Feb 2024 15:08:15 +0200 Message-Id: <20240213130815.382792-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213130815.382792-1-sakari.ailus@linux.intel.com> References: <20240213130815.382792-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..b97f341318fe 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; + unsigned int i; + struct pci_dev *ipu; struct mei_csi *csi; 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");