From patchwork Wed Mar 21 04:05:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10298519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D231460349 for ; Wed, 21 Mar 2018 04:21:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD6CE28D29 for ; Wed, 21 Mar 2018 04:21:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E2BD28D5D; Wed, 21 Mar 2018 04:21:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4167E28D29 for ; Wed, 21 Mar 2018 04:21:04 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 82383267380; Wed, 21 Mar 2018 05:21:02 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 033A626739E; Wed, 21 Mar 2018 05:20:59 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0062.outbound.protection.outlook.com [104.47.34.62]) by alsa0.perex.cz (Postfix) with ESMTP id D72A526731A for ; Wed, 21 Mar 2018 05:20:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LJuy9Yicgn5ky1xoMJlyJRJXXO163pRA0qEbW6/RCDI=; b=oD7WfqcNSmSD28/RE0bYAlZFrkiTdvcWi4RCsJhEqFSC0fMqTG3DYl/LbyI3G6j74E7aTWYvy3gU/izhyqMjUvGVCF9GDAOixPOZ3mVvLlyRxlDdmPZ/e+t0SxnsFqrizRawdfqhXyVtU1xep0jWeQnras1nE7B7aEDBinkT40c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by MWHPR1201MB0192.namprd12.prod.outlook.com (2603:10b6:301:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Wed, 21 Mar 2018 04:20:49 +0000 From: Akshu Agrawal To: broonie@kernel.org, alsa-devel@alsa-project.org Date: Wed, 21 Mar 2018 09:35:03 +0530 Message-Id: <1521605103-13574-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: PN1PR01CA0097.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::13) To MWHPR1201MB0192.namprd12.prod.outlook.com (2603:10b6:301:56::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 89fc92dc-ea3b-45bb-103e-08d58ee321a9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR1201MB0192; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0192; 3:ttBabraJjnRKcQ3hAxdCGww1F7OhkZ3cCJ55uwUa3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JkqQB4m88SImmP90rPx+UX1MRqbStNzVbUzmf6hvr7m0N40wYDC539ILDI1mYzW3iJfe9pkZWfabKq+1/Z/gRRBstw/+CmoqG0kdiCw9YlnWnvS/MtoDdQJob+c/sfd8VDBLFhv33p0BWDWRMQMg7dSqPk3Pf0DwIO7Y/0DZksgpxx+GmcDI6z4R+xpg8QbRNIXKCz5a8vliBQjEGyoQ9yY9wP2zZ4nyLQtvSPAwm+u8m3aIaCttKwuH3V6l6nTCcw/qdTQn/rlFefsRTWwK+lElnxExRz433TZOkDZpjiWvrMsEABhW; 4:K8a+CjIGMzfzfLlsI3p5yQk+k3LeSNQROF8aPJl/Z92YeSLkmuX3QknJqxFl+Bgdg09ERbcFtT0zH0K/I4ODfTaW31wb5T1lbd3a+5+36AugQbIErqjRi2Cr5cWDE+8fespHp4PR3wWF2hUsIvROLbyjExdOZ8IycsgYpifxze0BCU/IfcNCrEMVFs4j2RJsQ7lMCaOtleN61S7shxD7kqNYmw+DP6gHuNWjAP5a9kM0HrKL1+vP5r05JO3L9aGgbX89AjX2OqAdqcROkl2Z5I1zFPPtwZAhPazCyRreVVVitQqiqiGwTLEV55cBfOMk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501244)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR1201MB0192; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB0192; X-Forefront-PRVS: 0618E4E7E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(39380400002)(39860400002)(199004)(189003)(48376002)(316002)(478600001)(36756003)(26005)(72206003)(7736002)(305945005)(186003)(16526019)(97736004)(47776003)(68736007)(50226002)(8676002)(81156014)(86362001)(81166006)(8936002)(59450400001)(106356001)(7696005)(2906002)(52116002)(3846002)(51416003)(6116002)(386003)(6486002)(25786009)(5660300001)(16586007)(4326008)(50466002)(53936002)(39060400002)(53416004)(105586002)(66066001)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0192; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR1201MB0192; 23:PTlKilDCWoNHBlvjPI2TorkrhQqF8O8DcYK+2V6?= =?us-ascii?Q?paf42Lxl/5AGZVqfp13e4WyBwz2KpD6CqwNpHyU4IszwEF4iqW3fr0goOGdk?= =?us-ascii?Q?rEs9QhoBs/8U94Er5kP683pgrHNTcu9DTS8wkRm4gKys+H2A6yWNgeqkvNiS?= =?us-ascii?Q?aqvtagYaO0e8/ll9Xb60/NZulqvTIYQCuz4ukwBV7kCeum23rpP14RZAMG3F?= =?us-ascii?Q?cUA91MCnmixgb/50XbhOKuNQjCDiqfujvML8waZjV0VS0ZeFa8yOHV1t6xqU?= =?us-ascii?Q?fCftNgBKmqDGhSrvXYhN83DtlqtC+i7Fq6QuYcEqmTxkQd8uHR0akQP2PwWF?= =?us-ascii?Q?C8gMcw0LRqZOnYOQT8lP+Ke0pHVEvU2wCTMM/78Csne03gyV39ZQK8N10UJF?= =?us-ascii?Q?4g8Zrjva6wATMBJdu38y3MfhX2r7JrWh+XsOnPlPktJRphCqaJIuPB8sO3rw?= =?us-ascii?Q?rHiA0naPrEZstNeNKAPUOzvrewbuhTvIENU+LSUXAdKk5Mw2of2W3DKgwscA?= =?us-ascii?Q?+RqcvuYY5jofwRk84hmEFxkNd/N6F3qczIDgFXKVRW1G8JRUBji1VJqMAFiQ?= =?us-ascii?Q?UZXmx+f3/eqfQ+XNTUl98UU3h2Iu0/Wg3e/zorh5xyhyXv/ihAjE/jzXCs/l?= =?us-ascii?Q?6S6E1v4jXcRffIU6aOXK6ci2CGn7MEgMjU6HhOzruWsnFn7Cc//4OjNbF03B?= =?us-ascii?Q?olgIqlvC0AZBhbY2FzVzTVFtcO77rbn3faWtHb9JEvA16gjp2Abxzzf6ZtQW?= =?us-ascii?Q?Hl/uQMh3NhQgEE5Af5OYwuKK0KVnh+TcOXS21pldCklHLweM5CdBu3b1zBPx?= =?us-ascii?Q?Se/DOmG2SlnYgXtBWA5OYTKwGz88DxAaaB7BXmLLdu7euNECceCT/JnyyHQZ?= =?us-ascii?Q?hHjEmOve5GDtxWBFDWNCk+MtMUBRaztZ/ulTHHpER7snAWpn9qb8CemL+0S8?= =?us-ascii?Q?iU1mhPsoxzu0uOMVfSyQ8aiPBySOlDuwKQo8VXPUPaDfFfLF4lA7J7U9sc8m?= =?us-ascii?Q?HGgWHQ/G3Wl/J+gFKmlwhQCSWwSxyGIxAZKeNddxvX/3MYSgqh9ysuPEOPHe?= =?us-ascii?Q?sOJsfsp4PbHKODL5JJ0U5SJmkXJyybik8igi1zfVM6Rap+3ye5iWQbdvetZ0?= =?us-ascii?Q?ScciQxJtjlAc=3D?= X-Microsoft-Antispam-Message-Info: KTFqAJg+EorKlf9lJhXbSiAqdlB9J5ZNDY27X59xQLHRpWy6+NgteP5/J+qJrHlAgpkMQMnLxRPc677wNIIckHux/OwZpSG0hmK3ZYNPot7uwWQfZ+iiqwneJymACwqX2Tdio82NuGDtMGYqC0tqJkQIGxQ+C68NTFKuQV3v05+2xItht01J2d/AIKg2MOah X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0192; 6:aL17Dr4966ymcsNYfPiahpgkGZZ90b0IIdopjWf56dW/ZVJZrSVvB9Sungta1CdZTnlsdx04yqjAuUi33erLQ6ipgQGLmvN6kKikGw5OMGh6yNzj1Lcb7Pt3LbjAclSSSqmV7h7H3pbx3WWvn6l/7Ek8vAJSMF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JG9jZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 04:20:49.5772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89fc92dc-ea3b-45bb-103e-08d58ee321a9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0192 Cc: tiwai@suse.de, lgirdwood@gmail.com, djkurtz@chromium.org, akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH v3] ASoC: AMD: Enable/Disable auxiliary clock via common clock framework X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This enables/disables and sets auxiliary clock at 25Mhz. It uses common clock framework for proper ref counting. This approach will save power in comparison to keeping it always On in firmware. V2: Correcting the pin to OSCOUT1 from OSCOUT2 V3: Fix error/warnings from kbuild test TEST= aplay -vv check register to see clock enabled kill aplay check register to see clock disabled Signed-off-by: Akshu Agrawal --- sound/soc/amd/acp-da7219-max98357a.c | 135 ++++++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index 99c6b5c..baea370 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -30,10 +30,13 @@ #include #include #include +#include +#include #include #include #include #include +#include #include "../codecs/da7219.h" #include "../codecs/da7219-aad.h" @@ -41,6 +44,18 @@ #define CZ_PLAT_CLK 24000000 #define MCLK_RATE 24576000 #define DUAL_CHANNEL 2 +#define CLKDRVSTR2 0x28 +#define MISCCLKCNTL1 0x40 +#define OSCCLKENB 2 +#define OSCOUT1CLK25MHZ 16 + +struct cz_clock { + const char* acp_clks_name; + struct clk_hw acp_clks_hw; + struct clk_lookup *acp_clks_lookup; + struct clk *acp_clks; + void __iomem *res_base; +}; static struct snd_soc_jack cz_jack; struct clk *da7219_dai_clk; @@ -91,6 +106,8 @@ static int cz_da7219_hw_params(struct snd_pcm_substream *substream, { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_card *card = rtd->card; + struct clk *acpd7219_clk; ret = clk_prepare_enable(da7219_dai_clk); if (ret < 0) { @@ -98,13 +115,27 @@ static int cz_da7219_hw_params(struct snd_pcm_substream *substream, return ret; } + acpd7219_clk = clk_get(card->dev, "acpd7219-clks"); + ret = clk_prepare_enable(acpd7219_clk); + if (ret < 0) { + dev_err(rtd->dev, "can't enable oscillator clock %d\n", ret); + return ret; + } + return ret; } static int cz_da7219_hw_free(struct snd_pcm_substream *substream) { + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_card *card = rtd->card; + struct clk *acpd7219_clk; + clk_disable_unprepare(da7219_dai_clk); + acpd7219_clk = clk_get(card->dev, "acpd7219-clks"); + clk_disable_unprepare(acpd7219_clk); + return 0; } @@ -237,9 +268,106 @@ static int cz_fe_startup(struct snd_pcm_substream *substream) .num_controls = ARRAY_SIZE(cz_mc_controls), }; +static int acpd7219_clks_prepare(struct clk_hw *hw) +{ + u32 reg_val; + struct cz_clock *cz_clock_obj = + container_of(hw, struct cz_clock, acp_clks_hw); + void __iomem *base = cz_clock_obj->res_base; + + reg_val = readl(base + MISCCLKCNTL1); + reg_val &= ~(0x1 << OSCCLKENB); + writel(reg_val, base + MISCCLKCNTL1); + reg_val = readl(base + CLKDRVSTR2); + reg_val |= (0x1 << OSCOUT1CLK25MHZ); + writel(reg_val, base + CLKDRVSTR2); + + return 0; +} + +static void acpd7219_clks_unprepare(struct clk_hw *hw) +{ + u32 reg_val; + struct cz_clock *cz_clock_obj = + container_of(hw, struct cz_clock, acp_clks_hw); + void __iomem *base = cz_clock_obj->res_base; + + reg_val = readl(base + MISCCLKCNTL1); + reg_val |= (0x1 << OSCCLKENB); + writel(reg_val, base + MISCCLKCNTL1); +} + +static int acpd7219_clks_is_enabled(struct clk_hw *hw) +{ + u32 reg_val; + struct cz_clock *cz_clock_obj = + container_of(hw, struct cz_clock, acp_clks_hw); + void __iomem *base = cz_clock_obj->res_base; + + reg_val = readl(base + MISCCLKCNTL1); + + return !(reg_val & OSCCLKENB); +} + +const struct clk_ops acpd7219_clks_ops = { + .prepare = acpd7219_clks_prepare, + .unprepare = acpd7219_clks_unprepare, + .is_enabled = acpd7219_clks_is_enabled, +}; + +static int register_acpd7219_clocks(struct platform_device *pdev) +{ + struct clk_init_data init = {}; + struct clk *acp_clks; + struct clk_lookup *acp_clks_lookup; + struct cz_clock *cz_clock_obj; + struct resource *res; + struct device dev = pdev->dev; + + cz_clock_obj = kzalloc(sizeof(struct cz_clock), GFP_KERNEL); + if (!cz_clock_obj) + return -ENOMEM; + + cz_clock_obj->acp_clks_name = "acpd7219-clks"; + + init.parent_names = NULL; + init.num_parents = 0; + init.name = cz_clock_obj->acp_clks_name; + init.ops = &acpd7219_clks_ops; + cz_clock_obj->acp_clks_hw.init = &init; + + acp_clks = devm_clk_register(&dev, &cz_clock_obj->acp_clks_hw); + if (IS_ERR(acp_clks)) + { + dev_err(&dev, "Failed to register DAI clocks: %ld\n", + PTR_ERR(acp_clks)); + return -EINVAL; + } + cz_clock_obj->acp_clks = acp_clks; + + acp_clks_lookup = clkdev_create(acp_clks, cz_clock_obj->acp_clks_name, + "%s", dev_name(&dev)); + if (!acp_clks_lookup) + dev_warn(&dev, "Failed to create DAI clkdev"); + else + cz_clock_obj->acp_clks_lookup = acp_clks_lookup; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "Failed to get misc io resource.\n"); + return -EINVAL; + } + cz_clock_obj->res_base = devm_ioremap_nocache(&pdev->dev, res->start, + resource_size(res)); + if (!cz_clock_obj->res_base) + return -ENOMEM; + + return 0; +} + static int cz_probe(struct platform_device *pdev) { - int ret; + int ret = 0; struct snd_soc_card *card; card = &cz_card; @@ -252,7 +380,10 @@ static int cz_probe(struct platform_device *pdev) cz_card.name, ret); return ret; } - return 0; + + ret = register_acpd7219_clocks(pdev); + + return ret; } static const struct acpi_device_id cz_audio_acpi_match[] = {