From patchwork Wed Feb 23 23:56:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12757719 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 68C62C433F5 for ; Wed, 23 Feb 2022 23:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245087AbiBWX4j (ORCPT ); Wed, 23 Feb 2022 18:56:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233982AbiBWX4j (ORCPT ); Wed, 23 Feb 2022 18:56:39 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024FB5D657; Wed, 23 Feb 2022 15:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645660571; x=1677196571; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=K28DReeIhznAH38GKKop75KLShcLLga3wrGWpjXOAd0=; b=ESzwuFyxMffP8l0jLXDx3ruwn19yZZLvliqKhwLFYUNYMbHnkI3heFJ6 O+vm4sB5Vkn7RLvvzoAcQz9d6SHlrVIv42j5qWJrUxcBlJz5cLBhK0r5c 6kvbRLdbd88xlaDa33Jm/9HD53s2GIo+YM/b3QLIzNG2VM9KG2w6tQUR/ UAr8uYEVMGVV+0P5W545mTZMbf1NJcE0g5/Xg7st5L3RfWdTdFDzQ73CP wjWaIKnU5rsNMS/SawYvgx0XuWbK/ins7SF2rovPDtrD/x7qeidyaOlIV etYCpEHpn3Wt6XzJuFjiFVtAWuzNCFZUJD++EVeJS+pf6t9EHzo6bS2Jw A==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="250938106" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="250938106" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 15:56:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="776865742" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2022 15:56:09 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D409C94; Thu, 24 Feb 2022 01:56:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Date: Thu, 24 Feb 2022 01:56:20 +0200 Message-Id: <20220223235622.19555-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 Properties are not and should not be changed in the callee, hence constify properties parameter in acpi_create_platform_device(). Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_platform.c | 2 +- include/linux/acpi.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 78d621290a35..de3cbf152dee 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -95,7 +95,7 @@ static void acpi_platform_fill_resource(struct acpi_device *adev, * Name of the platform device will be the same as @adev's. */ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, - struct property_entry *properties) + const struct property_entry *properties) { struct platform_device *pdev = NULL; struct platform_device_info pdevinfo; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6274758648e3..9ac545379447 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -691,7 +691,7 @@ int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); int acpi_device_modalias(struct device *, char *, int); struct platform_device *acpi_create_platform_device(struct acpi_device *, - struct property_entry *); + const struct property_entry *); #define ACPI_PTR(_ptr) (_ptr) static inline void acpi_device_set_enumerated(struct acpi_device *adev) @@ -930,7 +930,7 @@ static inline int acpi_device_modalias(struct device *dev, static inline struct platform_device * acpi_create_platform_device(struct acpi_device *adev, - struct property_entry *properties) + const struct property_entry *properties) { return NULL; } From patchwork Wed Feb 23 23:56:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12757721 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 B7628C433EF for ; Wed, 23 Feb 2022 23:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245102AbiBWX4r (ORCPT ); Wed, 23 Feb 2022 18:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245097AbiBWX4q (ORCPT ); Wed, 23 Feb 2022 18:56:46 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 049405E746; Wed, 23 Feb 2022 15:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645660578; x=1677196578; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FJCs9Jv1mjb1vjFstuh0NUAf3NVCWQZ6Hb8AlB7++jA=; b=KwAzHsWDGBol5cHo5ouxJ105uKe2xrPNCLn2SqdBZNtVZaPOSNzT3rUV yPtooSeaa7e5z7I1zcmcx0HNicGKH3g+kppvrL7pBNZ2IOHUj8UOPGNV5 t3AGadCImZKwr04aHJ94aq0pOwmFL6wo1hEW7bshjTh7K7eGRXM/dYzMa ppud4+uv3MFAm3c7K4Avmpy/s7C51nYBFoQmTWydJKI7QOk8s/LRQDPcT j4SfkMjFBw/z/U1PduCvEHaSVqa8bfSmmMmVAY5hekOKfkKAb2h6riGMS +klP+hORB78G/s1ECn+i0+BVIvATX3WG4vSFeCS6In8QFRZ/zS+OdQL95 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="232084070" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="232084070" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 15:56:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="506114602" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 23 Feb 2022 15:56:09 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DF51873; Thu, 24 Feb 2022 01:56:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc Date: Thu, 24 Feb 2022 01:56:21 +0200 Message-Id: <20220223235622.19555-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223235622.19555-1-andriy.shevchenko@linux.intel.com> References: <20220223235622.19555-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The properties are static and not supposed to be modified, constify them. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index bcae0f03572b..c28954411af9 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -82,7 +82,7 @@ struct lpss_device_desc { const char *clk_con_id; unsigned int prv_offset; size_t prv_size_override; - struct property_entry *properties; + const struct property_entry *properties; void (*setup)(struct lpss_private_data *pdata); bool resume_from_noirq; }; From patchwork Wed Feb 23 23:56:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12757720 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 12455C433EF for ; Wed, 23 Feb 2022 23:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245091AbiBWX4k (ORCPT ); Wed, 23 Feb 2022 18:56:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245053AbiBWX4j (ORCPT ); Wed, 23 Feb 2022 18:56:39 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 402EF5DE4B; Wed, 23 Feb 2022 15:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645660571; x=1677196571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F89N5cDix69I9AbMbC/5C8QfuzPxnaxankQDwbVbuXQ=; b=J6QUS17JLQJAnKXJEsWqkFRbsST78XpYZX1mR+vD+StNY1Fl9A1oT7WI tiCl8WqUAl/Y5FlXSAexDClAEtuhOW38rzuCILxcmqwOEjSBdX7wNaMI7 BHksvCs5vn21cUwsVPNe9YJx6/UhR3H3R6pT6n+9BgPGs1a1qZ82aEbBZ klaFthi2l3jM4pgQ0DsghYA/MPS/vczIKPWhky8/O1/tIUUGDw7O/SD/n 00Q1/ebozkVw5DVxzCHtqTk+P2KpPldZIOcvsHISZsZ8iJB9xo5cstGzt tZD+NxnMNLItn5OJCNR2fJTGlyK6JvUxiRfB8lFeoITh65Ciw/pJ1EO0Q g==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="315335962" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="315335962" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 15:56:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="574018500" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 23 Feb 2022 15:56:09 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E9F4F3F9; Thu, 24 Feb 2022 01:56:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 3/3] ACPI: lpss: Provide an SSP type to the driver Date: Thu, 24 Feb 2022 01:56:22 +0200 Message-Id: <20220223235622.19555-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223235622.19555-1-andriy.shevchenko@linux.intel.com> References: <20220223235622.19555-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The SPI driver wants to know the exact type of the controller. Provide this information to it, hence allow to fix Intel Wildcat Point case in the future. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index c28954411af9..fbe0756259c5 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -219,10 +220,16 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata) pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup)); } -static const struct lpss_device_desc lpt_dev_desc = { +static const struct property_entry lpt_spi_properties[] = { + PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_LPT_SSP), + { } +}; + +static const struct lpss_device_desc lpt_spi_dev_desc = { .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR | LPSS_SAVE_CTX, .prv_offset = 0x800, + .properties = lpt_spi_properties, }; static const struct lpss_device_desc lpt_i2c_dev_desc = { @@ -282,9 +289,15 @@ static const struct lpss_device_desc bsw_uart_dev_desc = { .properties = uart_properties, }; +static const struct property_entry byt_spi_properties[] = { + PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_BYT_SSP), + { } +}; + static const struct lpss_device_desc byt_spi_dev_desc = { .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX, .prv_offset = 0x400, + .properties = byt_spi_properties, }; static const struct lpss_device_desc byt_sdio_dev_desc = { @@ -305,11 +318,17 @@ static const struct lpss_device_desc bsw_i2c_dev_desc = { .resume_from_noirq = true, }; +static const struct property_entry bsw_spi_properties[] = { + PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_BSW_SSP), + { } +}; + static const struct lpss_device_desc bsw_spi_dev_desc = { .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX | LPSS_NO_D3_DELAY, .prv_offset = 0x400, .setup = lpss_deassert_reset, + .properties = bsw_spi_properties, }; static const struct x86_cpu_id lpss_cpu_ids[] = { @@ -329,8 +348,8 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { { "INTL9C60", LPSS_ADDR(lpss_dma_desc) }, /* Lynxpoint LPSS devices */ - { "INT33C0", LPSS_ADDR(lpt_dev_desc) }, - { "INT33C1", LPSS_ADDR(lpt_dev_desc) }, + { "INT33C0", LPSS_ADDR(lpt_spi_dev_desc) }, + { "INT33C1", LPSS_ADDR(lpt_spi_dev_desc) }, { "INT33C2", LPSS_ADDR(lpt_i2c_dev_desc) }, { "INT33C3", LPSS_ADDR(lpt_i2c_dev_desc) }, { "INT33C4", LPSS_ADDR(lpt_uart_dev_desc) }, @@ -356,8 +375,8 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { { "808622C1", LPSS_ADDR(bsw_i2c_dev_desc) }, /* Broadwell LPSS devices */ - { "INT3430", LPSS_ADDR(lpt_dev_desc) }, - { "INT3431", LPSS_ADDR(lpt_dev_desc) }, + { "INT3430", LPSS_ADDR(lpt_spi_dev_desc) }, + { "INT3431", LPSS_ADDR(lpt_spi_dev_desc) }, { "INT3432", LPSS_ADDR(lpt_i2c_dev_desc) }, { "INT3433", LPSS_ADDR(lpt_i2c_dev_desc) }, { "INT3434", LPSS_ADDR(lpt_uart_dev_desc) }, @@ -366,7 +385,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { { "INT3437", }, /* Wildcat Point LPSS devices */ - { "INT3438", LPSS_ADDR(lpt_dev_desc) }, + { "INT3438", LPSS_ADDR(lpt_spi_dev_desc) }, { } };