From patchwork Fri Jul 31 13:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 11694993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41F50138A for ; Fri, 31 Jul 2020 13:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23DCB21744 for ; Fri, 31 Jul 2020 13:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="Ti2cu2G+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730814AbgGaNgy (ORCPT ); Fri, 31 Jul 2020 09:36:54 -0400 Received: from mail-bn8nam11on2045.outbound.protection.outlook.com ([40.107.236.45]:9312 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730813AbgGaNgx (ORCPT ); Fri, 31 Jul 2020 09:36:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mDq85AUT9w50a4m0kwgw/u8un0anub7Iv5naMJzEdu23/aC69mcvnt7rpLJKl6RrzwZCsviPXF9AvNOodlCU4vI8gxIj3lSjur8ch56eh5MM25gbtW9i03vlMw9+CRokJdiHD0mOdElNeIhIQtHG83sAWj0FSJGlzSCQip08yEmrZ62HF9QwKgWwdu/yU3Kv9EWeSj21iddyDwuIRd7+w4ZAuCYyc+fTWEVINitpzuMxQZezTvIhIUeCvaQJWw30iMpm4Clnse6vwpoj6RSDa+A/PzKEj1f7wnqHveFv6oWwk8whfV4Yj9WIzII/eFLTsDYsbpgZ6mf07ByZdDFKMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnuoHU51xAjQLYJR40DSwaV9lNK8v+NXJXNfmGodU1I=; b=ca+JXFfoyj2jmVkv3NppdhY+vUTddGDwQ7rT+LzgP9IUTZsPIujeNzIXPqYzBPSyoDGftBeJRNSTdJUDV6Q5UPE4pHOIpiG1ELqhjzTzDWZw/dF501/JM5v9nOOvhJ2WPzMokf5ihjERaow6HQ01fQB1nP2F5qXc21fpAmnlo0yj0RUj2r+7IXR6tcC9wsOI8pGhLGuNpS19752BL34iZu8IU6psjnUwUFGcFxmxTQLSLAMdKcn04hMoawDMJ8B+AOBgRd18JpuuHwyi5ymnPY1ZSNya7NU0HKShvd3QDeXSnXJjEFSprlM1+6IohqoFyanx0bzScTkIbkQnf7WCXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnuoHU51xAjQLYJR40DSwaV9lNK8v+NXJXNfmGodU1I=; b=Ti2cu2G+e2ys/xUgzIpF3H9kI6CkUU7iWgf2r98+mwP9PgGGbFYemlOGlweGqUT28Ij7gZWDp0g8GYbnuPM7j9Vdr+WINlRuJuP39R7HptXFpIW4lxGcSNQJC3vP4XuN0AfzXjFXn3utqwr4RG0wspBNd0v6+YjOMpmeMYN6N8A= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) by DM6PR12MB3257.namprd12.prod.outlook.com (2603:10b6:5:184::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Fri, 31 Jul 2020 13:36:50 +0000 Received: from DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c]) by DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c%7]) with mapi id 15.20.3239.020; Fri, 31 Jul 2020 13:36:50 +0000 From: Akshu Agrawal To: akshu.agrawal@amd.com Cc: sboyd@kernel.org, rafael@kernel.org, rjw@rjwysocki.net, lenb@kernel.org, mturquette@baylibre.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, rahul.tanwar@linux.intel.com Subject: [v2 1/4] ACPI: APD: Change name from ST to FCH Date: Fri, 31 Jul 2020 19:06:01 +0530 Message-Id: <20200731133604.12512-2-akshu.agrawal@amd.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731133604.12512-1-akshu.agrawal@amd.com> References: <20200731133604.12512-1-akshu.agrawal@amd.com> X-ClientProxiedBy: MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) To DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from local.mshome.net (122.179.42.211) by MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Fri, 31 Jul 2020 13:36:47 +0000 X-Mailer: git-send-email 2.20.1 X-Originating-IP: [122.179.42.211] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cb8aa7a7-f2f7-4120-bd8d-08d83556c78f X-MS-TrafficTypeDiagnostic: DM6PR12MB3257: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MQHrbkl6i+oHBAx2vvy9skPd+99DMji9B1CRkFvaBm+6f+9bWvOVm12/Ui5Be56q2hdzlH8qzptCpKEqoKMfioqa+Lnt1mwXUAtVmjgQXQRtbe65zylTvWyr5QLUjo1uYHLrk5hD6JjM12Hciub2dhy1iN6Z4Go4umbfYW94CMgcrQXpA6VOpmiSwE1UFZh2Tb0rfq5jF1Rp50BGcSULVI79H+TwKa5KkU4IkMPu/+qVLZAE3hZ/Ji+O8wOr+hX9+GeTZaqnEaHJv7AcueJMEuqcQYu98jd1ZRc+rcoI5UQZeUWGtwWNPONNo98MgiFrBzJOYHnTb6hOFcBJ2w632A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1201MB0188.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(66476007)(66556008)(66946007)(4326008)(44832011)(52116002)(36756003)(6506007)(34206002)(2616005)(316002)(956004)(186003)(26005)(16526019)(37006003)(1076003)(6486002)(478600001)(6666004)(2906002)(8676002)(83380400001)(5660300002)(8936002)(86362001)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bpqvIYW8V9PyJ7gJz+XlWhv4qSO24421nlFem425N0AjQix9FARDWquiEv6Flb2GJkyWHp2SjiVMWAH+JVjvE+7NKCdUJrLMJ+u23N0hzSHYGJ3seuQ5t+kBZmHADWqIzyMg0/uPKnd2EPNgp48Ci79itVkbCq+JJkYO/EeEHd/4sO3r8Hzwet4pCd6uDSZN2dc+XMZq3hrbS1oewG69y5CYeIMCYBYVxcP7LeFA+QiMhF8vFp2rDuh+HJuZoUhF2Z/mUBjScDQ/2TMj96RarNjbNuVrWG2GJpztDvvKW9elAWEgKOZRhbiGChbixja71MBA+xoPryhEVvTHHoIx2L7MPjsDhbomAilXY9Xklzu1hZy0sZqR4u9ERuN4JmDxKCa1tnyzQLv9iYIRKjxcyuNp0QrmwQsv4DAsNfyqZaRdwtTpvy349eEq5Qa06vdbV25BZ86ryhFtefx8tlb5P5gMvZZ8jvSt2P1WfNjuydO+ong+AVEfxrs+cDD/AlRNt2FIqNgMeg1Z3P459qFPvzbhKhHjqK5BBkxfZovy+wJb6c+KGdq79z2arU6fbVwF4NcvB81NnP3hVaHRo7y1aK0sx4s5TLY92Y33R0zmV7lfBkop1v3dc51e8GU6mS30nBb3oLrBbUuz+t779RZ1EQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb8aa7a7-f2f7-4120-bd8d-08d83556c78f X-MS-Exchange-CrossTenant-AuthSource: DM5PR1201MB0188.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2020 13:36:50.7409 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5gAd35MVCtCTJ0Mc4gK5h546jBl7HdD5awz761oDJyeSxMTiM43Em5enKUn0Zmy3s1ceA1ZP2V1vw709I5BBQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3257 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org AMD SoC general pupose clk is present in new platforms with same MMIO mappings. We can reuse the same clk handler support for other platforms. Hence, changing name from ST(SoC) to FCH(IP) Signed-off-by: Akshu Agrawal Acked-by: Stephen Boyd --- v2: pulled in clk changes so that patch compiles individually drivers/acpi/acpi_apd.c | 14 +++++++------- drivers/clk/x86/clk-st.c | 4 ++-- .../linux/platform_data/{clk-st.h => clk-fch.h} | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) rename include/linux/platform_data/{clk-st.h => clk-fch.h} (53%) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index ba2612e9a0eb..2d99e46add1a 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include @@ -79,11 +79,11 @@ static int misc_check_res(struct acpi_resource *ares, void *data) return !acpi_dev_resource_memory(ares, &res); } -static int st_misc_setup(struct apd_private_data *pdata) +static int fch_misc_setup(struct apd_private_data *pdata) { struct acpi_device *adev = pdata->adev; struct platform_device *clkdev; - struct st_clk_data *clk_data; + struct fch_clk_data *clk_data; struct resource_entry *rentry; struct list_head resource_list; int ret; @@ -106,7 +106,7 @@ static int st_misc_setup(struct apd_private_data *pdata) acpi_dev_free_resource_list(&resource_list); - clkdev = platform_device_register_data(&adev->dev, "clk-st", + clkdev = platform_device_register_data(&adev->dev, "clk-fch", PLATFORM_DEVID_NONE, clk_data, sizeof(*clk_data)); return PTR_ERR_OR_ZERO(clkdev); @@ -135,8 +135,8 @@ static const struct apd_device_desc cz_uart_desc = { .properties = uart_properties, }; -static const struct apd_device_desc st_misc_desc = { - .setup = st_misc_setup, +static const struct apd_device_desc fch_misc_desc = { + .setup = fch_misc_setup, }; #endif @@ -239,7 +239,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = { { "AMD0020", APD_ADDR(cz_uart_desc) }, { "AMDI0020", APD_ADDR(cz_uart_desc) }, { "AMD0030", }, - { "AMD0040", APD_ADDR(st_misc_desc)}, + { "AMD0040", APD_ADDR(fch_misc_desc)}, #endif #ifdef CONFIG_ARM64 { "APMC0D0F", APD_ADDR(xgene_i2c_desc) }, diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index 25d4b97aff9b..c2438874d9f2 100644 --- a/drivers/clk/x86/clk-st.c +++ b/drivers/clk/x86/clk-st.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include /* Clock Driving Strength 2 register */ @@ -31,7 +31,7 @@ static struct clk_hw *hws[ST_MAX_CLKS]; static int st_clk_probe(struct platform_device *pdev) { - struct st_clk_data *st_data; + struct fch_clk_data *st_data; st_data = dev_get_platdata(&pdev->dev); if (!st_data || !st_data->base) diff --git a/include/linux/platform_data/clk-st.h b/include/linux/platform_data/clk-fch.h similarity index 53% rename from include/linux/platform_data/clk-st.h rename to include/linux/platform_data/clk-fch.h index 7cdb6a402b35..850ca776156d 100644 --- a/include/linux/platform_data/clk-st.h +++ b/include/linux/platform_data/clk-fch.h @@ -1,17 +1,17 @@ /* SPDX-License-Identifier: MIT */ /* - * clock framework for AMD Stoney based clock + * clock framework for AMD misc clocks * * Copyright 2018 Advanced Micro Devices, Inc. */ -#ifndef __CLK_ST_H -#define __CLK_ST_H +#ifndef __CLK_FCH_H +#define __CLK_FCH_H #include -struct st_clk_data { +struct fch_clk_data { void __iomem *base; }; -#endif /* __CLK_ST_H */ +#endif /* __CLK_FCH_H */ From patchwork Fri Jul 31 13:36:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 11694997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02C48138A for ; Fri, 31 Jul 2020 13:37:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9039208E4 for ; Fri, 31 Jul 2020 13:37:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="tmCK6XBM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731446AbgGaNhD (ORCPT ); Fri, 31 Jul 2020 09:37:03 -0400 Received: from mail-dm6nam12on2058.outbound.protection.outlook.com ([40.107.243.58]:45665 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730217AbgGaNhC (ORCPT ); Fri, 31 Jul 2020 09:37:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kSB3zchcrAjIjy0JpDH4k7mGkyl6GGNTVCX1crXQKOhIIOdDDcMWx9qXafAXdvbaCr31N0/067ZqudPavUZcJMMaI8excI1AW11r2Y2fuJbrAwrfTla6PCYbaFhpSEBwlWYY2z0yIOAWI42py/sz+4ZVOZasW2hYS+6CqKSnaUAZHOdZYo5V57VBImjOglC/An60Bz7kvXq1xQccw00gLUgAEPgY+58WcKTCfoMx3Pba6QgwHh4TeyUAz3+qvDPi7Fd8Eq55dY8VjG5A0enS6+4MWtkVxmdrq62QCIFOcokoW3yn+qZonUOa3aCPVJDl06Dj3yxIku3+AZsxlEBvwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eBaD3iHZZPWwO0VoGKbQTkFJK9ABMhMBpljlvkTVTj8=; b=JZDwJNaFHU1vMZxhVio6La9l60MPsa+AlztiZWf7IWU9hcVyqH0MxLTl69AC5PenUtq7KcsGB4OGk8641ANg5P/6HIkl4Hs/ZYeFyRM6mYV+wRz6nsIztcxNxaI4SQexx0Bazi6eCPpW7maM4W7W4uObVK4qxAv/cn7bi6wM1eFnVGBvFV98lVQCyK6SsS/28soXl4MgyijCknjdf623Kcj7pZQTkp0XTXeCF9uNFAIdCbD+ItTdGngifsJRSijHS13cEtFiRzxxLcggIPXda0FGbpHxgxAlf74hJbj6sImPw0MkUjRirr9Y8/NyyIGyMwD+qFh6j75863NqexoA7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eBaD3iHZZPWwO0VoGKbQTkFJK9ABMhMBpljlvkTVTj8=; b=tmCK6XBMU7zf6Gta+hXqIDMWxx1Fu4VyNrVayVuTMqG/yGGnx1Tl5NVAY7r86XHhE69rqmzFyfLNWqtC7nyY3ZTB49IrRtywmY86OD6sQu90sSeYid3wm37oVmTXQ25/i6XOoyImviOex6FQTIFF5M7vY4hGj3PB+gxcaKt/1Q8= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) by DM6PR12MB3257.namprd12.prod.outlook.com (2603:10b6:5:184::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Fri, 31 Jul 2020 13:36:59 +0000 Received: from DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c]) by DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c%7]) with mapi id 15.20.3239.020; Fri, 31 Jul 2020 13:36:59 +0000 From: Akshu Agrawal To: akshu.agrawal@amd.com Cc: sboyd@kernel.org, rafael@kernel.org, rjw@rjwysocki.net, lenb@kernel.org, mturquette@baylibre.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, rahul.tanwar@linux.intel.com Subject: [v2 2/4] clk: x86: Change name from ST to FCH Date: Fri, 31 Jul 2020 19:06:02 +0530 Message-Id: <20200731133604.12512-3-akshu.agrawal@amd.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731133604.12512-1-akshu.agrawal@amd.com> References: <20200731133604.12512-1-akshu.agrawal@amd.com> X-ClientProxiedBy: MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) To DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from local.mshome.net (122.179.42.211) by MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Fri, 31 Jul 2020 13:36:56 +0000 X-Mailer: git-send-email 2.20.1 X-Originating-IP: [122.179.42.211] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2b9fb0bb-e495-4f56-6871-08d83556cca6 X-MS-TrafficTypeDiagnostic: DM6PR12MB3257: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wCTJ1M2QzsePhXkBYrO6caObwsB9W2aJLl7C0mPUfCtIyfpgiWkBdA/Wm9tro4ZlUkSMzV0inqoJ/g0gKMfePk/KZwwJMn+B1ot9RiLHyiEDPaME7T3F5Hcst0CsolkurYN+l+L6eh6eNbAFHZAsP/Rk6y5O2cPvNyisMXI5JuV4wIvE8le/0tDBArie6u62mOx7MOM60Ak2OXIOi/cwzB/tEYuXUxTq+hK3vaQBS0aJqfhKFWDmqvZCC44XIrJGG1AWjROo5J0YO+TWPEi8JzYXVcb6OoYbkW1nUbJCpGnWZzOnHb0p1xvsbK1htKgFrP1j1Ul8m80aDGIjI/oeuw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1201MB0188.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(66476007)(66556008)(66946007)(4326008)(44832011)(52116002)(36756003)(6506007)(34206002)(2616005)(316002)(956004)(186003)(26005)(16526019)(37006003)(1076003)(6486002)(478600001)(6666004)(2906002)(8676002)(83380400001)(5660300002)(8936002)(86362001)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: QFgvD8TaQH8SMQqW27QsggXrJ7+kXy4Pn1ZIRufqHgh92/pF3GCYbmV4miEINbCWe6cFQzRsjunGDux+VvlYMJqYuF6kRYebkVM5FUN4gKOz6IbDZYOwGym6rjhfItHsEGQIkfH15Q9S2su2AfS345AsS84SLfahQGNjVXAUQKYpZ9c9kJpkVkxm2ZrlE7AOQNi6lkwrmTp919gyGK5gn7MWFvmY+3cpD8b8uxbr+l4rkpwLvGw6f0BG49NvVp/aS8RlcJ5XPdJp29b1sIlFMPpJz267ZUQdDP3s6i56uzgb6h6FpAYc0QS+OIZfuV+6UhEhMoaQVmu9qO3UEDzU+68z8dlEdN2HltV57YvLUqbKUKKoxrOsu1Oz1PO1FvOChXrpVZqa5vlGa1scaaiMei79XNAGdIK1s0z9qlJIzY0NpgK+CmbwzL+rvFzncbdNGx1KRRia+LgRMDz/lpaVHLJYyWzfrixsED6YDHesqmNaxk/DP92/YOG7sBT4VfM6Eo7ziyBnwdzvMEIdaXQtcZ7sqqW/5i24wwyJH49cnLD0cxOg65ZAfSTs/J3w46E0lR9G/BLFbnrK9nEx3vSagnzF882k3L2Lt6YnttgdTX1rX5LMD3zAxEj3T0ws/tnPcL06xa7ZX7005tYxFcVyTQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9fb0bb-e495-4f56-6871-08d83556cca6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR1201MB0188.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2020 13:36:59.2101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AvMSlpWNAJqo8Daz2OlyUgEvYu7fst34WBg1icgWv29SkhqMYNW6HKvIRU+gjNBdzuSWVDAqk1dw5v3HvA5W6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3257 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org AMD SoC general pupose clk is present in new platforms with minor differences. We can reuse the same clk driver for other platforms. Hence, changing name from ST(SoC) to FCH(IP) Signed-off-by: Akshu Agrawal Reviewed-by: Stephen Boyd --- v2: Moved some changes to acp:apd patch so that individual patches compile drivers/clk/x86/Makefile | 2 +- drivers/clk/x86/{clk-st.c => clk-fch.c} | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) rename drivers/clk/x86/{clk-st.c => clk-fch.c} (75%) diff --git a/drivers/clk/x86/Makefile b/drivers/clk/x86/Makefile index 7c774ea7ddeb..18564efdc651 100644 --- a/drivers/clk/x86/Makefile +++ b/drivers/clk/x86/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_PMC_ATOM) += clk-pmc-atom.o -obj-$(CONFIG_X86_AMD_PLATFORM_DEVICE) += clk-st.o +obj-$(CONFIG_X86_AMD_PLATFORM_DEVICE) += clk-fch.o clk-x86-lpss-objs := clk-lpt.o obj-$(CONFIG_X86_INTEL_LPSS) += clk-x86-lpss.o obj-$(CONFIG_CLK_LGM_CGU) += clk-cgu.o clk-cgu-pll.o clk-lgm.o diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-fch.c similarity index 75% rename from drivers/clk/x86/clk-st.c rename to drivers/clk/x86/clk-fch.c index c2438874d9f2..b252f0cf0628 100644 --- a/drivers/clk/x86/clk-st.c +++ b/drivers/clk/x86/clk-fch.c @@ -29,12 +29,12 @@ static const char * const clk_oscout1_parents[] = { "clk48MHz", "clk25MHz" }; static struct clk_hw *hws[ST_MAX_CLKS]; -static int st_clk_probe(struct platform_device *pdev) +static int fch_clk_probe(struct platform_device *pdev) { - struct fch_clk_data *st_data; + struct fch_clk_data *fch_data; - st_data = dev_get_platdata(&pdev->dev); - if (!st_data || !st_data->base) + fch_data = dev_get_platdata(&pdev->dev); + if (!fch_data || !fch_data->base) return -EINVAL; hws[ST_CLK_48M] = clk_hw_register_fixed_rate(NULL, "clk48MHz", NULL, 0, @@ -44,12 +44,12 @@ static int st_clk_probe(struct platform_device *pdev) hws[ST_CLK_MUX] = clk_hw_register_mux(NULL, "oscout1_mux", clk_oscout1_parents, ARRAY_SIZE(clk_oscout1_parents), - 0, st_data->base + CLKDRVSTR2, OSCOUT1CLK25MHZ, 3, 0, NULL); + 0, fch_data->base + CLKDRVSTR2, OSCOUT1CLK25MHZ, 3, 0, NULL); clk_set_parent(hws[ST_CLK_MUX]->clk, hws[ST_CLK_48M]->clk); hws[ST_CLK_GATE] = clk_hw_register_gate(NULL, "oscout1", "oscout1_mux", - 0, st_data->base + MISCCLKCNTL1, OSCCLKENB, + 0, fch_data->base + MISCCLKCNTL1, OSCCLKENB, CLK_GATE_SET_TO_DISABLE, NULL); devm_clk_hw_register_clkdev(&pdev->dev, hws[ST_CLK_GATE], "oscout1", @@ -58,7 +58,7 @@ static int st_clk_probe(struct platform_device *pdev) return 0; } -static int st_clk_remove(struct platform_device *pdev) +static int fch_clk_remove(struct platform_device *pdev) { int i; @@ -67,12 +67,12 @@ static int st_clk_remove(struct platform_device *pdev) return 0; } -static struct platform_driver st_clk_driver = { +static struct platform_driver fch_clk_driver = { .driver = { - .name = "clk-st", + .name = "clk-fch", .suppress_bind_attrs = true, }, - .probe = st_clk_probe, - .remove = st_clk_remove, + .probe = fch_clk_probe, + .remove = fch_clk_remove, }; -builtin_platform_driver(st_clk_driver); +builtin_platform_driver(fch_clk_driver); From patchwork Fri Jul 31 13:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 11695003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE822161F for ; Fri, 31 Jul 2020 13:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6AE722B3F for ; Fri, 31 Jul 2020 13:37:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="q4mqn9Ym" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732231AbgGaNhH (ORCPT ); Fri, 31 Jul 2020 09:37:07 -0400 Received: from mail-bn8nam11on2040.outbound.protection.outlook.com ([40.107.236.40]:19681 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730367AbgGaNhH (ORCPT ); Fri, 31 Jul 2020 09:37:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kvYR4S6Y4nw4qoisKQ3bjepEa6w+4n8HESywBq9qYlyByZahcDGVT4tIyAS0Ph7ae9ZG2SbyH90kElb2qUCooxM1NoKtUD1YRR6AmXZjvT4S+ygiNniU/ZXNFglsdIv39jp0wJTtsILEmQ+VQ9UTX9LCYAeJvLDDjkh13W0vlftPlmAGoXfWgZtbCbDYosgX+4aSR0YSBIpZA2j81vSjqdalDw3MXHEqEsz1XhSAo7iUm5aX8t2fu3Q/Y0NpPEk6I8pE6ATbphMjsrQi3tEy3tVnBBZ/FB0eM6400TZu9ROBZmC2R+D+/TB49a3iL1y/EnFmgpD0QTmG3s3x41RDZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wfCk201FvWlIusiJ20M931+ZD+2bvTDB4nRyCEUoB8M=; b=irR++mohqsKyrl7yNFfCmNm2dbHQqdqk2kAPSF7ZIfdGpeidDje6QpJMiN4yM7VbxQn5y2ZZcxilbXycioREn+7oNxgRPnOt+hbVNXyO3KQx+LbN+sgO1GKMqL0VXESYJp9cdLHes65EywnTMPSSKQYtP+YsOva1rBuDGiY2I37TrfmAPp/iB/gpg/P6rSAsYhKsyHJNWpVZYjF2koEONo70HwOhV+ZfT2vIOiJ/98F4g1FHiQTma0AjxbB63GNdyvrsSd1Ahv+OSWB5JcJ2vsnzcwlLmCJ5Pwc4W8FQjuTXpjJB8M+ljVclv7/OYMb/MEUzs7UldvnMWHHw+tGBIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wfCk201FvWlIusiJ20M931+ZD+2bvTDB4nRyCEUoB8M=; b=q4mqn9YmPTZKS9qzdpoDV2l97m8EF80lIxuDeYxZ6sXIdKc7j/q2GxlLnKOMfus90exv7WQiz/BULP+SCP/N58Lyw2z3GwqyzOSKBEmQrSRf4jZtftTPet3UW/CrNwPjv4z91dZ8ucxjXec3ZcYU9JkXlUYDus6BRflEv2ubRwk= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) by DM6PR12MB3257.namprd12.prod.outlook.com (2603:10b6:5:184::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Fri, 31 Jul 2020 13:37:05 +0000 Received: from DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c]) by DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c%7]) with mapi id 15.20.3239.020; Fri, 31 Jul 2020 13:37:05 +0000 From: Akshu Agrawal To: akshu.agrawal@amd.com Cc: sboyd@kernel.org, rafael@kernel.org, rjw@rjwysocki.net, lenb@kernel.org, mturquette@baylibre.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, rahul.tanwar@linux.intel.com Subject: [3/4] ACPI: APD: Add a fmw property is_raven Date: Fri, 31 Jul 2020 19:06:03 +0530 Message-Id: <20200731133604.12512-4-akshu.agrawal@amd.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731133604.12512-1-akshu.agrawal@amd.com> References: <20200731133604.12512-1-akshu.agrawal@amd.com> X-ClientProxiedBy: MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) To DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from local.mshome.net (122.179.42.211) by MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Fri, 31 Jul 2020 13:37:01 +0000 X-Mailer: git-send-email 2.20.1 X-Originating-IP: [122.179.42.211] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 94870b12-acf2-47fa-c3ef-08d83556d01d X-MS-TrafficTypeDiagnostic: DM6PR12MB3257: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LPuVVRe9X91B81fzbeF6zZ3VqILv9yHGVGCnVRFpOfDtu+wIRRmc79iWMPEw0B9fcNEMQrO1wsWOjNTExNICRfGT2EfAdsEFkOEodwm94Jtv4+Abv3vhTJxS71bRE2GqtCWF0J8Ud2kjwRpliZUS4OD8meBOWCXYZfy7Rm7HHawHS50ZoEypq21bttCqSo3K3dLO7ahUQfy2XwXwRXvSj3Q8rg3fk84zqhiim478n8+R/OcU+uj8zawu9aTjHJ13b0mMQ0/Ifkdr3FpQ20mwC+7F7EZEJMARf4pI7/yirg9wjuuXb3ok1dkvEXb+Fum+PLuRntv9iYoL9OtCwy5Rfw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1201MB0188.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(66476007)(66556008)(66946007)(4326008)(44832011)(52116002)(36756003)(6506007)(34206002)(2616005)(316002)(956004)(186003)(26005)(16526019)(37006003)(1076003)(6486002)(478600001)(2906002)(8676002)(5660300002)(8936002)(86362001)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tpnddP4hLQI66P0JKxSLR104FT8Pv11o0U19MOgM8Wu45F2Agqrp04CE/MupRJVI/GOgsla542szIw3B8zSJjgJe7bJMif46QcBH5t1jtlc88SEjVv+ebhX/cLXaeEa9Q8scM44XO9jVS4fEpMJAkIK3f4b4EiSaCGjBL/M0tcAkaVJbu0jVZMjr97CTSvTAhB4Z57sWoKO4JPX9qK2QL8Sv+sVxjRBYZcL4aGRd9dQh8Esn2NHMvrrW55y0LguAdaCpOYYD4P8jJCqvLI+fW5P2PfVob40VCPJY9Yko8rfWGBDtF86YzX/NRM4manE/hd9R31HM3q+YKm617WJYclqlkVX8DL2gTrMIkl6VIlOw09Mt5U1EM59n4Hp9sRlj1R2VNVmeICZGb5rTVqNDpeYjKjhpfW0xfDk98vPxlyyOczL6Se6NH4O6/bsJ6n5RxThuQZTZmEaUgoX+GfUFbnBxU1gTk5T4bK9UAeL0BEYmCaJjUkh+C5brFwwlwrOZ7YaU7+CUnPsBumP/IzRLEQnFGG+4lhqa4Ie8GnumBF5BAT+4a/WMTJpzRKx3ldj2qt/sGrM86OGVshrs+9F5FGrVEmLqrDVWjK3jIRx2a7e29LORW3TjyPfjmZTej9mrj5dWr0USYoECVPyp67dnYQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94870b12-acf2-47fa-c3ef-08d83556d01d X-MS-Exchange-CrossTenant-AuthSource: DM5PR1201MB0188.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2020 13:37:05.0355 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rBxBAWK8JIoghB0dwkxbExz9k0izMV+eXp0u8Ihn1cBCazbJygAFO5/y/5sptdpap6ZT4mUMRla5Nq0bsbloIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3257 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Since there is slight difference in AMD RV based soc in misc clk architecture. The fmw property will help in differentiating the SoCs. Signed-off-by: Akshu Agrawal --- drivers/acpi/acpi_apd.c | 4 ++++ include/linux/platform_data/clk-fch.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 2d99e46add1a..d879ba28826c 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -82,6 +82,7 @@ static int misc_check_res(struct acpi_resource *ares, void *data) static int fch_misc_setup(struct apd_private_data *pdata) { struct acpi_device *adev = pdata->adev; + const union acpi_object *obj; struct platform_device *clkdev; struct fch_clk_data *clk_data; struct resource_entry *rentry; @@ -98,6 +99,9 @@ static int fch_misc_setup(struct apd_private_data *pdata) if (ret < 0) return -ENOENT; + acpi_dev_get_property(adev, "is-rv", ACPI_TYPE_INTEGER, &obj); + clk_data->is_rv = obj->integer.value; + list_for_each_entry(rentry, &resource_list, node) { clk_data->base = devm_ioremap(&adev->dev, rentry->res->start, resource_size(rentry->res)); diff --git a/include/linux/platform_data/clk-fch.h b/include/linux/platform_data/clk-fch.h index 850ca776156d..b9f682459f08 100644 --- a/include/linux/platform_data/clk-fch.h +++ b/include/linux/platform_data/clk-fch.h @@ -12,6 +12,7 @@ struct fch_clk_data { void __iomem *base; + u32 is_rv; }; #endif /* __CLK_FCH_H */ From patchwork Fri Jul 31 13:36:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 11695005 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0DD2913 for ; Fri, 31 Jul 2020 13:37:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3462208E4 for ; Fri, 31 Jul 2020 13:37:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="yYLCQF+9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730367AbgGaNhZ (ORCPT ); Fri, 31 Jul 2020 09:37:25 -0400 Received: from mail-co1nam11on2083.outbound.protection.outlook.com ([40.107.220.83]:4769 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732960AbgGaNhX (ORCPT ); Fri, 31 Jul 2020 09:37:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xdc3w9HGqlF6cHS6To6Bjs7Ea7H/SwCwBE0qXFXlwelP4ozvCP1VgZXF91YRKrMS7qPjXu+NdvOw2KA8N1po0p7WE3OtMt8JTryODjivCUCONqn0qTqlTRY16R17cxt7kxf6HHXOnEqSclts+ob33eHJ+gjEuLloQPRjU2EgDkbAjTZuW9M1HNngPyGBpmTWkoRdArjxO3+DsrMJAob6ZEoPnZotXoTf5/xwgjmEUsNQ3f3SSfOAboTdQnSSSX4FKDJ90fdmITISu5+RGEPLgmeQetRisren874LyCE5uV2Bhxo8kNw4ZR0sIqBCq5oY1TBzE+bTPAy6KuEb4K2Frg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gn85Wiauar3poXs7cSoMvgrcXdVDOE/b8d9C0hrUyfI=; b=DcwczakMT42QVDsGmnmN5rqIY7BOutwd+Gw5E6Hf7TjvZpXPBizTbVO/7tNHtX3SnWVCdktoDZUB51GyNH/SClIm99zABr/bkdST0iPxtA5xSPblZSX91eB6jzI9WShv/gTuc909p17J/zgWJ4dhJ5CuOmynK3PtLLx4f54uWZ630JQzE6gsPxS3LeEcmm5aMo7kTkBD2eRvDWpNmJgz3fEI3owWWoA6JhFRbXyDAl0aF+uzLf4E7b53151mOhkg+WWALpb/GPU+jRucm3x2rYk9/pDcqiWhL/nEjlOcxEofvFNSerSEoufLBr0PA+4q6yePd2y+P3XEQr8/hcmxUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gn85Wiauar3poXs7cSoMvgrcXdVDOE/b8d9C0hrUyfI=; b=yYLCQF+9fgvMSgAPCb5oeuMe0eyFro8YHnNBVjbLb/O8jOW73VrBeX/0HHf/FiZIj/y05c/oowcMjR6ly9Ii+8YpkwCyHZn1gly24YGMZMqCadXJYw3kJ9FCRXsUghKb9LnMLgeLhTPGDFdlwYem9q9WBEdSYieC5XDLqbwyp8o= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) by DM6PR12MB3257.namprd12.prod.outlook.com (2603:10b6:5:184::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Fri, 31 Jul 2020 13:37:20 +0000 Received: from DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c]) by DM5PR1201MB0188.namprd12.prod.outlook.com ([fe80::4df1:4ad8:38cd:128c%7]) with mapi id 15.20.3239.020; Fri, 31 Jul 2020 13:37:20 +0000 From: Akshu Agrawal To: akshu.agrawal@amd.com Cc: sboyd@kernel.org, rafael@kernel.org, rjw@rjwysocki.net, lenb@kernel.org, mturquette@baylibre.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, rahul.tanwar@linux.intel.com Subject: [v3 4/4] clk: x86: Support RV architecture Date: Fri, 31 Jul 2020 19:06:04 +0530 Message-Id: <20200731133604.12512-5-akshu.agrawal@amd.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731133604.12512-1-akshu.agrawal@amd.com> References: <20200731133604.12512-1-akshu.agrawal@amd.com> X-ClientProxiedBy: MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) To DM5PR1201MB0188.namprd12.prod.outlook.com (2603:10b6:4:56::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from local.mshome.net (122.179.42.211) by MAXPR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Fri, 31 Jul 2020 13:37:17 +0000 X-Mailer: git-send-email 2.20.1 X-Originating-IP: [122.179.42.211] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 916615d1-edf8-45bf-167b-08d83556d94c X-MS-TrafficTypeDiagnostic: DM6PR12MB3257: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: djyR0lS1cQmiagkTJs16QVFchfrhNyRVOiTg3SFiNm8PUuYYRQyzsWjsSIFvTm+rcRqoQWvV0mFn7Gu7Jnj86E42LghImcmXwn3DXmpdaQQs71j+5FOGSftVD7eTX+BQrMqJYi4hU6QkkOS1ievMtD3XCZE5O012OrVz39XiV1EwCw3iiIEB3nzPXlUildpOOSp+dYMTDr8vh3Su9ZW+bJ57UH6eow9YhG8Ds+5cCKDx3/FHNw4nIBTdYzi61EJXi7eP3isalL2GXWyTjM492kPvPOdJ/nuZnQuHs/cg0fP8sQy5QjOiiix+icKGG4iEOMKWUckgXgduUN/5RqDWKA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1201MB0188.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(66476007)(66556008)(66946007)(4326008)(44832011)(52116002)(36756003)(6506007)(34206002)(2616005)(316002)(956004)(186003)(26005)(16526019)(37006003)(1076003)(6486002)(478600001)(6666004)(2906002)(8676002)(83380400001)(5660300002)(8936002)(86362001)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oSlsZYx0SwrmXSAwT5SBwxGOS6BjSN+0psxKFS91+27C4ZjvY4qrv6ZMuepl2e4OVCU38pTQgKEPogYjDqzOLAj7mLtgRxjHeFnxA0AWF41PZDX69XOeqgqio8B4u1tdIkwP9z4b56KMtkopVVQSOKMyXvW/+wVQuq3z2RtMAc4hGVFPa6Ob135Ai30w/Tv+q/Gdi1CfrkWU7RJEYDaNlROLmjzFC7WZU9zGYSmpigIXsBY2tlt8AEe5IUYuyCbqt/yQI34iGSG/U6+/Tg7y+qiCtlLzdbMnJYZuCqd8G2MX34r/GjpoHywSnrH3qsOsZMovSFpsmPspW1DDUnpK3AchPm/i9TeG2Y3LVvpdAcjHAUWQz1g3Xi4hCyPGTeV8at7acCu0TX4drKnOO3FcA6Nf6ahUkrlzQiXDqavWn7OSJa4Ig6eTFYb3BIEBQsafX5ha3Jq4f19BlUsknv7sq0aAW2Kpo1VPlYf7wDAVJh/gu5Ra31QWPs60fFGx47EIzglEGzS1Xve7yIIdHKzSLftfviUuOniiaVw231+A6RTmU54GqVQfeplKmz7FbQ45sJA/n7EBdyPX3IaqgyFjMETKXz6DPnCtn/4+AUwvfR9KjTOOG5hdHYMtCbDwp38PbgHPcj4LrPchoiYnSNwSyg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 916615d1-edf8-45bf-167b-08d83556d94c X-MS-Exchange-CrossTenant-AuthSource: DM5PR1201MB0188.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2020 13:37:20.4496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CZ549pTZWoESQ4i0G8/Ionq36cQNS3zIJ+o5+Myl8SnGETQF6uZYAs1+JI2EUt9500Rn624YV/2I3dY6Y44Llw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3257 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org There is minor difference between previous family of SoC and the current one. Which is the there is only 48Mh fixed clk. There is no mux and no option to select another freq as there in previous. Signed-off-by: Akshu Agrawal Reviewed-by: Stephen Boyd --- v2: Consolidated the loops in remove. v3: Removed negation in condition to make it simple drivers/clk/x86/clk-fch.c | 53 ++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/drivers/clk/x86/clk-fch.c b/drivers/clk/x86/clk-fch.c index b252f0cf0628..8f7c5142b0f0 100644 --- a/drivers/clk/x86/clk-fch.c +++ b/drivers/clk/x86/clk-fch.c @@ -26,6 +26,10 @@ #define ST_CLK_GATE 3 #define ST_MAX_CLKS 4 +#define RV_CLK_48M 0 +#define RV_CLK_GATE 1 +#define RV_MAX_CLKS 2 + static const char * const clk_oscout1_parents[] = { "clk48MHz", "clk25MHz" }; static struct clk_hw *hws[ST_MAX_CLKS]; @@ -37,33 +41,52 @@ static int fch_clk_probe(struct platform_device *pdev) if (!fch_data || !fch_data->base) return -EINVAL; - hws[ST_CLK_48M] = clk_hw_register_fixed_rate(NULL, "clk48MHz", NULL, 0, - 48000000); - hws[ST_CLK_25M] = clk_hw_register_fixed_rate(NULL, "clk25MHz", NULL, 0, - 25000000); + if (!fch_data->is_rv) { + hws[ST_CLK_48M] = clk_hw_register_fixed_rate(NULL, "clk48MHz", + NULL, 0, 48000000); + hws[ST_CLK_25M] = clk_hw_register_fixed_rate(NULL, "clk25MHz", + NULL, 0, 25000000); + + hws[ST_CLK_MUX] = clk_hw_register_mux(NULL, "oscout1_mux", + clk_oscout1_parents, ARRAY_SIZE(clk_oscout1_parents), + 0, fch_data->base + CLKDRVSTR2, OSCOUT1CLK25MHZ, 3, 0, + NULL); - hws[ST_CLK_MUX] = clk_hw_register_mux(NULL, "oscout1_mux", - clk_oscout1_parents, ARRAY_SIZE(clk_oscout1_parents), - 0, fch_data->base + CLKDRVSTR2, OSCOUT1CLK25MHZ, 3, 0, NULL); + clk_set_parent(hws[ST_CLK_MUX]->clk, hws[ST_CLK_48M]->clk); - clk_set_parent(hws[ST_CLK_MUX]->clk, hws[ST_CLK_48M]->clk); + hws[ST_CLK_GATE] = clk_hw_register_gate(NULL, "oscout1", + "oscout1_mux", 0, fch_data->base + MISCCLKCNTL1, + OSCCLKENB, CLK_GATE_SET_TO_DISABLE, NULL); - hws[ST_CLK_GATE] = clk_hw_register_gate(NULL, "oscout1", "oscout1_mux", - 0, fch_data->base + MISCCLKCNTL1, OSCCLKENB, - CLK_GATE_SET_TO_DISABLE, NULL); + devm_clk_hw_register_clkdev(&pdev->dev, hws[ST_CLK_GATE], + "oscout1", NULL); + } else { + hws[RV_CLK_48M] = clk_hw_register_fixed_rate(NULL, "clk48MHz", + NULL, 0, 48000000); - devm_clk_hw_register_clkdev(&pdev->dev, hws[ST_CLK_GATE], "oscout1", - NULL); + hws[RV_CLK_GATE] = clk_hw_register_gate(NULL, "oscout1", + "clk48MHz", 0, fch_data->base + MISCCLKCNTL1, + OSCCLKENB, CLK_GATE_SET_TO_DISABLE, NULL); + + devm_clk_hw_register_clkdev(&pdev->dev, hws[RV_CLK_GATE], + "oscout1", NULL); + } return 0; } static int fch_clk_remove(struct platform_device *pdev) { - int i; + int i, clks; + struct fch_clk_data *fch_data; - for (i = 0; i < ST_MAX_CLKS; i++) + fch_data = dev_get_platdata(&pdev->dev); + + clks = fch_data->is_rv ? RV_MAX_CLKS : ST_MAX_CLKS; + + for (i = 0; i < clks; i++) clk_hw_unregister(hws[i]); + return 0; }