From patchwork Mon Feb 28 22:39:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 547619 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 65157C433EF for ; Mon, 28 Feb 2022 22:39:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbiB1WkI (ORCPT ); Mon, 28 Feb 2022 17:40:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231480AbiB1WkG (ORCPT ); Mon, 28 Feb 2022 17:40:06 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A0F312558E; Mon, 28 Feb 2022 14:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087967; x=1677623967; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Z3cuSidlSplrkPzS0iAKkjA4oiCL66X8tnB9pZSBsV4=; b=fLUPhKYbsdkGxitMzipIio+TUVfL+xwBF+qY09i5DDEtTkClzSS8nDB+ ScHl2VR0VMqm1maWk/ZlA1CSmSwEJq+ebkIXqRf5e+qvOzpxDFuOBQ0PW Zznv1Uh2W7M0yQzRboqfw67fFVLdZjRRYbfFduPFK16xwoOtIba4Vpk1Z /nwE4z2MgtpAx5MEL3s8FDIrty3z57Ao6yBwiEgqNQg3+IJzTn2+fRlOD BEyrAE1p2W3SzbvdYzH2phncsk+j8L2XK69HyB46vjV6KfXfKVYS36ddw c1y+q62Ae4Da+xSOrMU1eRsoy7sUnpZyLx5QcmL4PphQwzToA5oW6Tc/g Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="251835914" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="251835914" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="629799062" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 28 Feb 2022 14:39:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 08036142; Tue, 1 Mar 2022 00:39:41 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 1/7] ACPI: enumeration: Discourage to use custom _DSM methods Date: Tue, 1 Mar 2022 00:39:30 +0200 Message-Id: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Since we have _DSD established and specified (ACPI v5.1+) there is no need to use custom _DSM methods. Rewrite documentation to use _DSD. Fixes: f60e7074902a ("misc: at25: Make use of device property API") Signed-off-by: Andy Shevchenko --- .../firmware-guide/acpi/enumeration.rst | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index d0022567c022..3b221cc9ff5f 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -227,43 +227,37 @@ to at25 SPI eeprom driver (this is meant for the above ACPI snippet):: }; Note that this driver actually needs more information like page size of the -eeprom etc. but at the time writing this there is no standard way of -passing those. One idea is to return this in _DSM method like:: +eeprom, etc. This information can be passed via _DSD method like:: Device (EEP0) { ... - Method (_DSM, 4, NotSerialized) + Name (_DSD, Package () { - Store (Package (6) + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { - "byte-len", 1024, - "addr-mode", 2, - "page-size, 32 - }, Local0) - - // Check UUIDs etc. - - Return (Local0) - } - -Then the at25 SPI driver can get this configuration by calling _DSM on its -ACPI handle like:: - - struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; - struct acpi_object_list input; - acpi_status status; + Package () { "size", 1024 }, + Package () { "pagesize", 32 }, + Package () { "address-width", 16 }, + } + }) + } - /* Fill in the input buffer */ +Then the at25 SPI driver can get this configuration by calling device property +APIs during ->probe() phase like:: - status = acpi_evaluate_object(ACPI_HANDLE(&spi->dev), "_DSM", - &input, &output); - if (ACPI_FAILURE(status)) - /* Handle the error */ + err = device_property_read_u32(dev, "size", &size); + if (err) + ...error handling... - /* Extract the data here */ + err = device_property_read_u32(dev, "pagesize", &page_size); + if (err) + ...error handling... - kfree(output.pointer); + err = device_property_read_u32(dev, "address-width", &addr_width); + if (err) + ...error handling... I2C serial bus support ====================== From patchwork Mon Feb 28 22:39:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 546729 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 129E6C433F5 for ; Mon, 28 Feb 2022 22:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231516AbiB1WkH (ORCPT ); Mon, 28 Feb 2022 17:40:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230488AbiB1WkG (ORCPT ); Mon, 28 Feb 2022 17:40:06 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6203512552D; Mon, 28 Feb 2022 14:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087966; x=1677623966; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7KW5r5qAfPKAahouBoRxbP98/SFsYhZNNzFD4JTPQyQ=; b=Pg3Hszf/wEHWGlSgE8HsE4Bpb7g1FYERLyQ1CydHkh3PWQ4t2PYrSSsm X++3nP+/+PM0JqLnirbM0/m7wdHVaOUltOhDLTqf7eANKc49yVzTovJIA X3G3+SkWS+5eRJOpRo1WQ9wDF7Y+LN1qm9IzYgg+uqPajhm6AlonaJtIb xCQwwK4rlg+Coa87Z548qP6bJdy3E5mgpW5GN0tygLfUCDC/7tz8X/JxY 09a3ItuDGVmto3rY9QqrsPmJv27hQQhU6ccTz15Yvkim334l5tqnjB6gj lNn5OYi1SmkPhjPNajwfBXDi3OlR/8ZWP+dC0omBmfUwwLPNbGBoSBQsm w==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="251835911" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="251835911" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="593387226" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 28 Feb 2022 14:39:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 13E5442; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 2/7] ACPI: enumeration: Update UART serial bus resource documentation Date: Tue, 1 Mar 2022 00:39:31 +0200 Message-Id: <20220228223936.54310-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org In some cases UART serial bus resource may be represented by struct serdev_device. Fixes: 53c7626356c7 ("serdev: Add ACPI support") Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index 3b221cc9ff5f..f4bb5ddca528 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -19,16 +19,17 @@ possible we decided to do following: platform devices. - Devices behind real busses where there is a connector resource - are represented as struct spi_device or struct i2c_device - (standard UARTs are not busses so there is no struct uart_device). + are represented as struct spi_device or struct i2c_device. Note + that standard UARTs are not busses so there is no struct uart_device, + although some of them may be represented by sturct serdev_device. As both ACPI and Device Tree represent a tree of devices (and their resources) this implementation follows the Device Tree way as much as possible. -The ACPI implementation enumerates devices behind busses (platform, SPI and -I2C), creates the physical devices and binds them to their ACPI handle in -the ACPI namespace. +The ACPI implementation enumerates devices behind busses (platform, SPI, +I2C, and in some cases UART), creates the physical devices and binds them +to their ACPI handle in the ACPI namespace. This means that when ACPI_HANDLE(dev) returns non-NULL the device was enumerated from ACPI namespace. This handle can be used to extract other From patchwork Mon Feb 28 22:39:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 546728 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 BE110C433FE for ; Mon, 28 Feb 2022 22:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231523AbiB1WkI (ORCPT ); Mon, 28 Feb 2022 17:40:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiB1WkG (ORCPT ); Mon, 28 Feb 2022 17:40:06 -0500 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E4F125580; Mon, 28 Feb 2022 14:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087967; x=1677623967; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I/xzPQYPViZYmQiFHdTjC1qJcKT4z40XLV6xEE2jUmU=; b=bPEj2W6S6AOoj9CA5BM3EOBFFtILfYxU5zz0U8mhsFa98XnNK1c78OfL zpQct25IRCSF2IhSv71jTDR6vVdEtJnV2FzVuyoP/R86rMQpzrEyMBTE0 Rm+IeLZcvKDpKw4Ed2R8Aa2Sv8xNNSNilGhR77efkqSR1CIPNiH/5v8+A UukCfsJU0njwjBV5vn2Qa7kKwtw5ciyQ/ixO3Xhvzpy/CGgCEiMQoWvcm TC2DHyLMl0OkL+pFIyx5RvjwEQW5lGV3e3WroxvWYLm1Z8lekr8J6j57s pg0OeFzqQDTy91JbWRKf7wLh4kMDK2BJayypnWxGLehCbfeJhEzSni+2x Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="313724231" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="313724231" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="685501808" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2022 14:39:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2372F14A; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 3/7] ACPI: enumeration: Remove redundant .owner assignment Date: Tue, 1 Mar 2022 00:39:32 +0200 Message-Id: <20220228223936.54310-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The owner member of the struct i2c_driver is assigned by a corresponding macro. No need to assign it explicitly. Fixes: 59c3987805a9 ("ACPI: add documentation about ACPI 5 enumeration") Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index f4bb5ddca528..c7dbf79d45b0 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -282,7 +282,6 @@ input driver:: static struct i2c_driver mpu3050_i2c_driver = { .driver = { .name = "mpu3050", - .owner = THIS_MODULE, .pm = &mpu3050_pm, .of_match_table = mpu3050_of_match, .acpi_match_table = ACPI_PTR(mpu3050_acpi_match), @@ -291,6 +290,7 @@ input driver:: .remove = mpu3050_remove, .id_table = mpu3050_ids, }; + module_i2c_driver(mpu3050_i2c_driver); Reference to PWM device ======================= From patchwork Mon Feb 28 22:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 546727 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 5DB23C433FE for ; Mon, 28 Feb 2022 22:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231529AbiB1WkJ (ORCPT ); Mon, 28 Feb 2022 17:40:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231519AbiB1WkH (ORCPT ); Mon, 28 Feb 2022 17:40:07 -0500 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3554A12559C; Mon, 28 Feb 2022 14:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087968; x=1677623968; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sxPkQmC4SHUxeAYkXMXlFFqEMODjBZBuzvHgbKNXCYo=; b=JnmrdEgr9w2odENEiVRd52MxtKlBDt+GSbsqMgxRImwIv0do74jxk8+6 RIRdvKJ9XyGhQAwuGK2vWxXDMRjOzDegmir0tdPduAW7HLSgUNNqWNjog mj18uAqwiVPQoYzE0+rsqUQTrYE/gVLbOxvToTqsnGJTPqqk7S62RJpRc qeMLY/Jpc6ludGOw7dk37hOa01Dj82nsIsyKrAHw5xF+aVYErbMpoEx6Q HkuXn4QIYaVYUOZPKypl5WVvaGXeGoctair8NZyPY1QhqIUSAKHaTboFB NRTIOlLxrcT2kFpCHrWsGl3rMjAFBF/0i9ZXlL/DyWXqW9d/ULiO85H/g w==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="313724233" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="313724233" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="685501809" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2022 14:39:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2C2A0183; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 4/7] ACPI: enumeration: Amend PWM enumeration ASL example Date: Tue, 1 Mar 2022 00:39:33 +0200 Message-Id: <20220228223936.54310-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Drop blank line and add a closing curly brace to make ASL example closer to the reality. Fixes: ef3d13b86763 ("docs: firmware-guide: ACPI: Add a PWM example") Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index c7dbf79d45b0..96179d2a8871 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -316,9 +316,9 @@ introduced, i.e.:: } } } - }) ... + } In the above example the PWM-based LED driver references to the PWM channel 0 of \_SB.PCI0.PWM device with initial period setting equal to 600 ms (note that From patchwork Mon Feb 28 22:39:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 547620 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 C68BEC433EF for ; Mon, 28 Feb 2022 22:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbiB1WkH (ORCPT ); Mon, 28 Feb 2022 17:40:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbiB1WkG (ORCPT ); Mon, 28 Feb 2022 17:40:06 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EB9124C2C; Mon, 28 Feb 2022 14:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087966; x=1677623966; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YLC9rgC4ZBM6Z/PdSXcXp2iSqN22GTMuevEcbQk15QU=; b=IMpHbmNqg3DYPVGHBkylvekpJHq0N4ouwZ2jBcMs4elsBLlDvvOPCvGL S4ccNZZdOrbqKus/KWMsLg/5Zhna48CHm+ul0L8nJDYzz6DUNsMyF3eyt QTb3iWLQpDNwt1IOf37A2deaN64sDQ1fvJd6EVzptfmh5/CLC7dF/ui1X yyRJnV1QhzcxcZ2LazR0IiPFg9Ce61D3VSa7+0WaDm4qG7ctrqde26Jr2 JQxRdakGcztl9HQ1cXj/5zu0EMDV8Em9HdI8FqmuLcO5YZxqFJ19emi0e pP+7BftAOgpIl/OSEtNt498Y472yCXcEb6Q2cXUgtzkXG/pQtX9u81kME w==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="236511704" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="236511704" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="550445547" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 28 Feb 2022 14:39:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 346711C9; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 5/7] ACPI: enumeration: Drop ugly ifdeffery from the examples Date: Tue, 1 Mar 2022 00:39:34 +0200 Message-Id: <20220228223936.54310-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The ifdeffery around ACPI ID tables are ugly and in some cases even less valuable than plain definitions. Drop them for good to avoid spreading rather bad pattern. Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index 96179d2a8871..93fdc04de9c3 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -47,18 +47,16 @@ some minor changes. Adding ACPI support for an existing driver should be pretty straightforward. Here is the simplest example:: - #ifdef CONFIG_ACPI static const struct acpi_device_id mydrv_acpi_match[] = { /* ACPI IDs here */ { } }; MODULE_DEVICE_TABLE(acpi, mydrv_acpi_match); - #endif static struct platform_driver my_driver = { ... .driver = { - .acpi_match_table = ACPI_PTR(mydrv_acpi_match), + .acpi_match_table = mydrv_acpi_match, }, }; @@ -212,18 +210,16 @@ The SPI device drivers only need to add ACPI IDs in a similar way than with the platform device drivers. Below is an example where we add ACPI support to at25 SPI eeprom driver (this is meant for the above ACPI snippet):: - #ifdef CONFIG_ACPI static const struct acpi_device_id at25_acpi_match[] = { { "AT25", 0 }, { }, }; MODULE_DEVICE_TABLE(acpi, at25_acpi_match); - #endif static struct spi_driver at25_driver = { .driver = { ... - .acpi_match_table = ACPI_PTR(at25_acpi_match), + .acpi_match_table = at25_acpi_match, }, }; @@ -271,20 +267,18 @@ registered. Below is an example of how to add ACPI support to the existing mpu3050 input driver:: - #ifdef CONFIG_ACPI static const struct acpi_device_id mpu3050_acpi_match[] = { { "MPU3050", 0 }, { }, }; MODULE_DEVICE_TABLE(acpi, mpu3050_acpi_match); - #endif static struct i2c_driver mpu3050_i2c_driver = { .driver = { .name = "mpu3050", .pm = &mpu3050_pm, .of_match_table = mpu3050_of_match, - .acpi_match_table = ACPI_PTR(mpu3050_acpi_match), + .acpi_match_table = mpu3050_acpi_match, }, .probe = mpu3050_probe, .remove = mpu3050_remove, From patchwork Mon Feb 28 22:39:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 546726 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 1185FC433F5 for ; Mon, 28 Feb 2022 22:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231532AbiB1WkU (ORCPT ); Mon, 28 Feb 2022 17:40:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbiB1WkI (ORCPT ); Mon, 28 Feb 2022 17:40:08 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 609C6125C84; Mon, 28 Feb 2022 14:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087969; x=1677623969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gs5S60D5Gva7TQIgAcoMKq8XEKYr+M9gys943f6RNt8=; b=lzBM+l3suF2ilW8kMY/iVGgnaBdlqsDUaq0wpzejCGPlgnTkPScGnDrJ C/WfV+JAL0PJ4l11WFly/Zn6aH9yUlPgjDWomZkJso366kFU6WSxIMWn2 TAD70otaFG1f6u39p1jY0xUjfAvRMp2ocfvK/WvlJos4/gxvmh3zR8qDB RcO+5psQJzS3NU/lXvTSejPL1yJBBV7nfGhJDQg+nITLt0kWXlyX1TXDD N2dXLoR55guVngRL5qOz2BStoSM4w7WPaLLZtr2o60jut8RvKCgkkl4qB jdX488GjD5fLH21ruRpg+RPIAUL9JAvmu232AVtfc7RdIJaEt0pnM82Sh Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="316219519" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="316219519" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="639150677" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 28 Feb 2022 14:39:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3D08A24C; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 6/7] ACPI: enumeration: Unify Package () for properties Date: Tue, 1 Mar 2022 00:39:35 +0200 Message-Id: <20220228223936.54310-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Unify Package () representation for properties: - make them one line where it's possible - add spaces between parentheses and curly braces - drop the explicit size of package Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index 93fdc04de9c3..2e0cffb88d67 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -167,8 +167,7 @@ The table below shows an example of its usage:: Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { - Package () {"interrupt-names", - Package (2) {"default", "alert"}}, + Package () { "interrupt-names", Package () { "default", "alert" } }, } ... }) @@ -193,7 +192,7 @@ Here is what the ACPI namespace for a SPI slave might look like:: Device (EEP0) { Name (_ADR, 1) - Name (_CID, Package() { + Name (_CID, Package () { "ATML0025", "AT25", }) @@ -365,8 +364,8 @@ For example:: ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { - Package () {"power-gpios", Package() {^DEV, 0, 0, 0 }}, - Package () {"irq-gpios", Package() {^DEV, 1, 0, 0 }}, + Package () { "power-gpios", Package () { ^DEV, 0, 0, 0 } }, + Package () { "irq-gpios", Package () { ^DEV, 1, 0, 0 } }, } }) ... @@ -488,10 +487,10 @@ namespace link:: Device (TMP0) { Name (_HID, "PRP0001") - Name (_DSD, Package() { + Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { - Package (2) { "compatible", "ti,tmp75" }, + Package () { "compatible", "ti,tmp75" }, } }) Method (_CRS, 0, Serialized) From patchwork Mon Feb 28 22:39:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 547618 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 89CBCC433EF for ; Mon, 28 Feb 2022 22:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbiB1WkT (ORCPT ); Mon, 28 Feb 2022 17:40:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbiB1WkI (ORCPT ); Mon, 28 Feb 2022 17:40:08 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265291255B5; Mon, 28 Feb 2022 14:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646087969; x=1677623969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hNJS2dybVBvsAe13swYPd/L/NI9k6ucKP/1EvDuTvmM=; b=C9fqA8UXkrmZn61x/wJBDAg1TpcEx3Q7YAOllSqrXnBJnDhHHoSwOw1k QHQbkx/Q3ZKgwc32p5uixReQ3zY0xRY6mUXdw+4oy7OUUvcLxNmExNZmW QXWtyO3yvgd4xOE7lGv3wNsNj56eRfshBMj1Oki+2lVn0MIRLFWHhS1sw c5XrhcVn5UKftZ/MSIxsojey6+1z4f6s1Pg6iBZ40RtY8Vlup2QdmBZYd fgWUc8/Y0DY7jpt2v57KuoZUVfqJ/KBHwDUBlPfoP4HXjanCX5YWvZuTP dRQlxB2w+vlkgIX2rYwvm3Kp3AFDbvISQle8Ayqbw3dhFDFpE1qLFRVgY A==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="252736711" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="252736711" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 14:39:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="641046919" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 28 Feb 2022 14:39:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4584124D; Tue, 1 Mar 2022 00:39:42 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 7/7] ACPI: enumeration: Drop comma for terminator entry Date: Tue, 1 Mar 2022 00:39:36 +0200 Message-Id: <20220228223936.54310-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> References: <20220228223936.54310-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Drop comma for terminator entry to avoid copy'n'paste of this pattern. Signed-off-by: Andy Shevchenko --- Documentation/firmware-guide/acpi/enumeration.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst index 2e0cffb88d67..8c9e758f6e9b 100644 --- a/Documentation/firmware-guide/acpi/enumeration.rst +++ b/Documentation/firmware-guide/acpi/enumeration.rst @@ -211,7 +211,7 @@ to at25 SPI eeprom driver (this is meant for the above ACPI snippet):: static const struct acpi_device_id at25_acpi_match[] = { { "AT25", 0 }, - { }, + { } }; MODULE_DEVICE_TABLE(acpi, at25_acpi_match); @@ -268,7 +268,7 @@ input driver:: static const struct acpi_device_id mpu3050_acpi_match[] = { { "MPU3050", 0 }, - { }, + { } }; MODULE_DEVICE_TABLE(acpi, mpu3050_acpi_match);