From patchwork Tue Mar 28 10:13:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 668160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4461FC77B62 for ; Tue, 28 Mar 2023 10:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231570AbjC1KOY (ORCPT ); Tue, 28 Mar 2023 06:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbjC1KOI (ORCPT ); Tue, 28 Mar 2023 06:14:08 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AAF9A4; Tue, 28 Mar 2023 03:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679998445; x=1711534445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d41bXUASvUdMimuMBcCpF2HXIPKRE8fC9XN80/His4Q=; b=NJuJR7ZNPxDxZDLsZpGyDDmLow4LjOtVIvk90MiI4yNVdIhi1/mayeQA EWgti9+Xs0kxOR/RnaDfiIo8BqTCx5ivdldoWuVi1tZMLQQVc552FMZbN eJcWqnzF30CnG6YCe5XOseeLuZhx5gZdx11GmFnpoXZoTAEOtMuogNQoc blfzfuK7X9Lx+P23+5w7kjZxt+EaZnnK43q0jqUDFoxENHg/ehllWMiPb l5ADwQ75/JBsIHko6xoXvSYkXFRmrjXGHNHnjCJ52pfxaN1zFRtvYqzim YlzhPa9hiY9s4c3MQ+BrNG17NJfv7kcLcpGMl+LNuBOzWvWiHbfVxSBSi A==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="328985361" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="328985361" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 03:13:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="827432729" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="827432729" 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; 28 Mar 2023 03:13:17 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 9DBBB11F937; Tue, 28 Mar 2023 13:13:14 +0300 (EEST) From: Sakari Ailus To: linux-acpi@vger.kernel.org Cc: linux-media@vger.kernel.org, rafael@kernel.org, andriy.shevchenko@linux.intel.com, heikki.krogerus@linux.intel.com Subject: [PATCH v7 10/10] ACPI: property: Document _CRS CSI-2 and DisCo for Imaging support Date: Tue, 28 Mar 2023 13:13:03 +0300 Message-Id: <20230328101303.1458570-11-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230328101303.1458570-1-sakari.ailus@linux.intel.com> References: <20230328101303.1458570-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Document how ACPI _CRS CSI-2 and DisCo for Imaging works. It's non-trivial so such documentation can be useful. Signed-off-by: Sakari Ailus --- drivers/acpi/mipi.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/acpi/mipi.c b/drivers/acpi/mipi.c index ae6bdc487363..3800e6c9bc10 100644 --- a/drivers/acpi/mipi.c +++ b/drivers/acpi/mipi.c @@ -9,6 +9,43 @@ * Also see . * * Copyright (C) 2023 Intel Corporation + * + * _CRS CSI-2 descriptors, as defined starting from ACPI 6.4 [1], contain + * information on cross-device CSI-2 bus configuration. The descriptors are + * located under transmitter devices, and the receiver devices have no direct + * way to access them even if the information in these descriptors is equally + * important for receivers. This information is amended with MIPI DisCo for + * Imaging [2] specification that defines _DSD data nodes and properties. + * + * The support for these is based on two-fold approach, firstly renaming + * properties where semantics matches and secondly gathering information to + * generate properties using information gathered from various sources. The + * former is trivial (see acpi_properties_prepare_mipi() at the end of the + * file) whereas the latter requires a more elaborate explanation. + * + * acpi_bus_scan_crs_csi2() scans an ACPI bus for devices with _CRS CSI-2 + * descriptors and stores them to a linked list. This is done as traversing just + * this list is much smaller task than the entire DSDT. This list is then used + * to figure out how much memory is needed for swnodes related to a given ACPI + * device (handle). Further on, the same function sets the property values for + * the properties the values of which are obtained from the _CRS CSI-2 + * descriptor. The information is stored into another list where the information + * can be looked up based on device's acpi_handle as the struct acpi_device + * isn't available yet at this point (and could not, as cross-device references + * need to be set up before the devices are available for drivers to probe). + * + * For each struct acpi_device, acpi_init_swnodes() further obtains information + * required to find out the values for the rest of the properties needed by + * drivers. This includes all port and endpoint properties as the node + * structures used by DT graphs and DisCo for Imaging are different. Finally the + * function registers software nodes for the device and sets the secondary + * pointer for the ACPI device's fwnode. + * + * Access to data the structures is serialised using acpi_scan_lock in scan.c. + * + * [1] https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf + * + * [2] https://www.mipi.org/specifications/mipi-disco-imaging */ #include