From patchwork Fri Jul 20 06:38:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10536025 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 492D0602CA for ; Fri, 20 Jul 2018 06:40:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EC8A29184 for ; Fri, 20 Jul 2018 06:40:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32B99291BF; Fri, 20 Jul 2018 06:40:52 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable 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 3D84429184 for ; Fri, 20 Jul 2018 06:40:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C6E262675D4; Fri, 20 Jul 2018 08:40:48 +0200 (CEST) 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 7C8BA26770A; Fri, 20 Jul 2018 08:40:46 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0082.outbound.protection.outlook.com [104.47.40.82]) by alsa0.perex.cz (Postfix) with ESMTP id B591826733D for ; Fri, 20 Jul 2018 08:40:41 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=1wSDVhVhZHL7sSIDm48TvnK+/C8wW72kUoCYy0JP/Uo=; b=1jks6jpIesWpfG/jrVUuol0fLGiIWKa3deZTT2mEWQCp/pz4inVVl7HP/K4z9N94+mdkCq3Z76ce9Y3DjC3QRNuZEGdQy317uRuIzsIrlgI2aVj9cymFf+URVgVzgAVDwfepzxIU2nekVdQBfjcgQS39468UHiK/kgRJakGVYvI= 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 DM5PR12MB2359.namprd12.prod.outlook.com (2603:10b6:4:b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Fri, 20 Jul 2018 06:39:10 +0000 From: Akshu Agrawal To: Date: Fri, 20 Jul 2018 14:38:11 +0800 Message-Id: <1532068715-2992-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: MAXPR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::22) To DM5PR12MB2359.namprd12.prod.outlook.com (2603:10b6:4:b4::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19f90ec7-9890-4237-1554-08d5ee0b857b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600067)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2359; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2359; 3:ZvyKNGOczItSSQgTx5x22Xuvg+dqbrAWI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q1n21MVW90mUyNR4AQP9/1GwMLADPHziv7Z6uJRvhO1czVm/nZL4MV+0nUFWWgTcCdqaE193jqBXV+b6VA9jPg5Nq/rxgb5hrwjRsfmNx7gWIVpER5o/AcnqeRjLBXzTvncZ4Xxz7P2ZjB+hyJ7OTCTzVd/dFttrguKzJlDGDBC+Wh03hfTJoCN9MB0Pko9vELmuwNiX9oZXRqZ2cTtIfHXQBPXttmUbwgFYPnQ47wlX4AkyFmmncWYZQzY49t5Mc9fgiWbAAGrcJxjJXZnNMNHSNHxIIT4lYlGoX9Ld+/yc1z5; 4:GORny0QXd+Ei7Ukj3hTY7ZeuuPEeJ2W33pxNQmOH2ggDlVQ1I5ykIoj53yWlGSD1HWUCfV7RoyUqLE5Ua7tRDzu70ZiCx2HGq7SDgJyKtAyx6uckvpPD6aFlEzwpAmhPY2rLiyml/b9cgB5WYkwC5ccR1voAoC8U2+UJPljtcC6POpHXgZ6GyGjU2V4DW3TPyy+EyiMDj5SY9HnJGR69Qo3ALXp6W8VPmHLdjAlmBAk3w/J+B7fIQqFdaSJnxUGTOt2UffsHUolY9QPZUNz4gldiZehuzl6Bl++DmkNcElF8m1UHYlCmadU0TBmlERxT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM5PR12MB2359; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2359; X-Forefront-PRVS: 073966E86B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(39860400002)(376002)(199004)(189003)(53936002)(51416003)(7736002)(4326008)(478600001)(16586007)(26005)(39060400002)(109986005)(186003)(16526019)(305945005)(72206003)(386003)(316002)(2906002)(7416002)(81156014)(8676002)(53416004)(106356001)(6116002)(7696005)(52116002)(8936002)(97736004)(105586002)(3846002)(81166006)(25786009)(5660300001)(47776003)(486006)(36756003)(44832011)(2616005)(956004)(66066001)(68736007)(50226002)(476003)(48376002)(1857600001)(50466002)(6486002)(1671002)(86362001)(54906003)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB2359; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB2359; 23:hPnWsviuuZO1CpCdme+cu3w6PGGK1KUpKlIF+K4Db?= =?us-ascii?Q?kF+uacDc92exgMObj1YQ6OfAnFXshYcrzVlkq7yQ/1q3m4zoxgtblAWnRvye?= =?us-ascii?Q?KUQQFpVI/h9y6e9AYfEjvbcCfxziuDTwsSmYSdkW0J8JxKU4D2V5Ry6SBlL0?= =?us-ascii?Q?+5poX6NCRiit0TQphInxEmdAxuAQ2EQVY0xBaGTyV5EyZBpaGZ8TDCk4aB07?= =?us-ascii?Q?AsG2F2lyPqTPnSlwVBwQfqYUQ7SXk8TdbdkpOS1Cg/HlH6ZtmJWSjC/O0ZqH?= =?us-ascii?Q?xh1Q8Lki4xpsgjt++1vEjQRBuoBcpYvYs8qTaDCnAn1SLQ7/JpnxJ3Ix87lB?= =?us-ascii?Q?gHIuXiBy9GIVth9D7tsLvz4+hIQXX6+V++sCqcPrwlYDhfLABz9DmhoGz7Xe?= =?us-ascii?Q?V2XQcz2gjHxFqGRxkQh7dsna667zgCRKcLn5P69FrcSjTSy+QMN0/Ra9KtFi?= =?us-ascii?Q?FoMdbRYQI/MBnpUIbPerLT96NYL1Us5985D7swYM7mKVUjuZ4YfOasLnuDdY?= =?us-ascii?Q?JFln07BSlf80HRJnhGw3cxKi8eU7gjttjCQhu3iZadsakdJXY/FkKHTJraHK?= =?us-ascii?Q?Fk71IRoio+9R8MrHlmco94b6fHU3CGPSG6a8mQHJ8jDsVIWu3K9TXw22curR?= =?us-ascii?Q?U+rDKVJc9hlbehFMQAH2nuMXImnjvjm5+oj71HEGaeqXgMoVLeMZMGQebgMO?= =?us-ascii?Q?T15u8kXjjAzRys4j3VlnTSaLDS4p9kpG9oa3pO9u98KeHHSzhSbxGymBgEtw?= =?us-ascii?Q?TeTb0oWzXeDeGGiaUzGPtyaU6L79aiWyfnT8D97hywWmUpWbutwoKkolA0Uz?= =?us-ascii?Q?uO6lXHA8u1vy6zoUAJRSxvY7mh8M+bytH4l/vzVhqlPEWNDdxYRho2tmKcZU?= =?us-ascii?Q?DNQrcXoP3UEsAuwcZaoo87CIYNv1maq5iGRoTDymv5dcdyg8GqxitxDPYS1x?= =?us-ascii?Q?gFynWG5Kl/HxbNQNykqUNp0UaJoKWv0TfE0dgkDPbwIS2G2IxyZOkktX+9m3?= =?us-ascii?Q?RiZIPZghGb96KkJ/zGh3W/DCzVExhMI8Xyx64OVJJv11oqwTF2qz1ofRNtD8?= =?us-ascii?Q?tgxYsL75K0ZNnws5QHp7S9G/ZrwSAFDzNt0bod3bVe4/IfkObsLtivMxzhvG?= =?us-ascii?Q?7FFtiVb972yblvFv9MPpPJEanaNoZguza7S1FaJFYe7aU1mUPKIPrWN79bkW?= =?us-ascii?Q?9GmAt17BU497L2OgigElPv8Gc4GK7yVWKGh8LY2a6KbxxdF3uI6FmPTOypbD?= =?us-ascii?Q?hI8agID3gsF+k9fDoMyWk3BCpuDHkEFfmnuRDme?= X-Microsoft-Antispam-Message-Info: U9XeSOqbAxxlohzrFyXjokEPmwnl616bNXQGozWMhXLQMSAdeUPg1LrtxEMU9/2zYhSRJiAR95BwUIVLWxXIjr7I4xadfzDXj3LEqhJkdHzF6GLw9JDI677iSGXlBpGM6lDnUkncW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ft-Exchange-Diagnostics: 1; DM5PR12MB2359; 7:lkXAwjvuV9YDLLtweJtJUgBYfUDirE+FR0aRBMcxTOm9+G5fpEvVYOCLI/ZOcY/l5IHAojcLM1CmjwDLi5ePRwemJMgZWE61vFRM0M3tp/i+8171p1vLIM0FjoM8Z2qPiqXyaSOw1khRULfdf8S9JrhZikNrWKlkHO4s1juBDrZT17X/li8m2nsL8afKONRL7kqveXpJVAlJO+X2OCaRqimBwQ24YqrSwLv87Gx/uvd7/NODBbXXU83qxk1wjyv+; 20:x2KfXTCrxwbfSl9Yys51Z/moJyQDmv28ufKHPRuEx4EFEesQNhiSdNguduz651nT8TV7fqHf16dyvljaaDan/vLhI3C7+NBQSLEVp/Xsy4+n1bnRiR2Yee7gpAc4fI/PRsI/3oiPWU+5fRN3RRsc7h+mgLex/e/Ly50dX2BU1b8ZqTHPA4JQkmZg6Jat/moJlnURxELOGWKZTfF3XLVfdUwjiXpHO6/fnslxLkcvUxzTpzntsNBGu3PbZdVadJIN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2018 06:39:10.4816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19f90ec7-9890-4237-1554-08d5ee0b857b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2359 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, Mark Brown , Wei Yongjun , "Mukunda, Vijendar" , Alex Deucher , Dylan Reid , akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002 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 DA7219 for our platform need to be configured for 1.8V. Hence, we add a fixed volatge regulator with supplies of 1.8V in the machine driver. Signed-off-by: Akshu Agrawal --- sound/soc/amd/Kconfig | 2 ++ sound/soc/amd/acp-da7219-max98357a.c | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 6cbf9cf..c447a51 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -8,6 +8,8 @@ config SND_SOC_AMD_CZ_DA7219MX98357_MACH select SND_SOC_DA7219 select SND_SOC_MAX98357A select SND_SOC_ADAU7002 + select REGULATOR + select REGULATOR_FIXED_VOLTAGE depends on SND_SOC_AMD_ACP && I2C help This option enables machine driver for DA7219 and MAX9835. diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index f42606e..fdf8972 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -31,7 +31,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -320,11 +323,53 @@ static void cz_dmic_shutdown(struct snd_pcm_substream *substream) .num_controls = ARRAY_SIZE(cz_mc_controls), }; +static struct regulator_consumer_supply acp_da7219_supplies[] = { + REGULATOR_SUPPLY("VDD", "i2c-DLGS7219:00"), + REGULATOR_SUPPLY("VDDMIC", "i2c-DLGS7219:00"), + REGULATOR_SUPPLY("VDDIO", "i2c-DLGS7219:00"), + REGULATOR_SUPPLY("IOVDD", "ADAU7002:00"), +}; + +static struct regulator_init_data acp_da7219_data = { + .constraints = { + .always_on = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(acp_da7219_supplies), + .consumer_supplies = acp_da7219_supplies, +}; + +static struct fixed_voltage_config acp_da7219 = { + .supply_name = "reg-fixed-1.8V", + .microvolts = 1800000, /* 1.8V */ + .gpio = -EINVAL, + .enabled_at_boot = 1, + .init_data = &acp_da7219_data, +}; + +static struct platform_device acp_da7219_regulator = { + .name = "reg-fixed-voltage", + .id = PLATFORM_DEVID_AUTO, + .dev = { + .platform_data = &acp_da7219, + }, +}; + static int cz_probe(struct platform_device *pdev) { int ret; struct snd_soc_card *card; struct acp_platform_info *machine; + static bool regulators_registered; + + if (!regulators_registered) { + ret = platform_device_register(&acp_da7219_regulator); + if (ret) { + dev_err(&pdev->dev, "Failed to register regulator: %d\n", + ret); + return ret; + } + regulators_registered = true; + } machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info), GFP_KERNEL);