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");