From patchwork Wed Jul 25 09:00:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10543721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84E27139A for ; Wed, 25 Jul 2018 09:02:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C5829BA5 for ; Wed, 25 Jul 2018 09:02:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66B3E29BB1; Wed, 25 Jul 2018 09:02:13 +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=ham 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 B595029BA5 for ; Wed, 25 Jul 2018 09:02:11 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9A81F26774A; Wed, 25 Jul 2018 11:02:05 +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 8767826774B; Wed, 25 Jul 2018 11:02:03 +0200 (CEST) Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700044.outbound.protection.outlook.com [40.107.70.44]) by alsa0.perex.cz (Postfix) with ESMTP id 831D826739D for ; Wed, 25 Jul 2018 11:01:59 +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=CYubvhcD0H5/SeQYg8iWu6YTEqc+a1LI+zNSVlbfgOU=; b=eAAd4HLOUSTNzzvHgVdkiXjnveM847r0+Q6J2T6JHOCuo294e6Ymg0LkDdm0VkmJQRWivQgjAarcwT6t+uW1KDnRz6aCHn11TeQ49vi+lCEC2g4jbyMitDMsfYgTulVVD4Ht19NGVpxWmP2Nr1L5QotnD2aSoELM3j9Lo182N9I= 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 SN1PR12MB2368.namprd12.prod.outlook.com (2603:10b6:802:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Wed, 25 Jul 2018 09:01:37 +0000 From: Akshu Agrawal To: Date: Wed, 25 Jul 2018 17:00:59 +0800 Message-Id: <1532509274-8280-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: MA1PR01CA0087.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00::27) To SN1PR12MB2368.namprd12.prod.outlook.com (2603:10b6:802:25::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ad6909d-c2a4-4774-df8c-08d5f20d421c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2368; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2368; 3:40iOVdacaASA7A7XUfg16JIyGw3sMmJt/7q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FmX5g5Myv+20FIq3T92lC8tXg8YBHXOfL95noxXCRcftEzXn8JSxyDzJ2vxW77PhB6uYdkbnf4iXTAcJX9kPdhcXK5S8zmQ/zjCx1L4DvYO8Ur6I/EJGs6JCD6xhlH68XAZexMnmQjGbIQAJyylrPjkOEmwBLj5tocKcE0qPeHJA7xeOIyQn9putvMRJXQEy9zvcDhorXYNU14u9f9ijIKGiiyw0mrIwPrjJO16cEc6kvIa0eVwGtHmmzOgf2wO5RvaTKFTfOYQR8u9FrVYj4jHscavl5aSUUGOflsp0kp6UE4fJgmhAU19PkgC+9JntW5; 4:s59g4AWL7ETkj4sxYP1Z1WcVtCJb8+y0VMlZjgbgYel4ZNvOagR8bcG0kvyTv9pbnMUK0UosBkcwN/cLKxxC9Yk/mloIS86IgvD8EemDp03i0VlcfXWEjOriFkTtuxZj5cgFpBi2oI0dJTAts6Pt15llexJwQ8ic/fTNJHvkswUeW/a4BXx7Cle3LpYyT1qRxnYyZVKin25JKQXK1y3cwnmfCwei+TFp7qAdIWjL/FTdjS8pK5j2G1f1WTXoGUf580WFY+GrzSDwbZz4dqrIc4CWdfO4393nJJQP+xltwN1EWqk4Ox3V3uf0tNzjnLfy 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)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2368; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2368; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(136003)(39860400002)(199004)(189003)(186003)(66066001)(26005)(386003)(1671002)(50466002)(81156014)(81166006)(68736007)(53936002)(16586007)(7416002)(54906003)(316002)(48376002)(105586002)(7696005)(52116002)(51416003)(8936002)(53416004)(97736004)(4326008)(109986005)(50226002)(2906002)(3846002)(72206003)(36756003)(6116002)(39060400002)(8676002)(6486002)(106356001)(47776003)(7736002)(16526019)(478600001)(6666003)(44832011)(2616005)(305945005)(486006)(476003)(956004)(86362001)(25786009)(5660300001)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2368; 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; SN1PR12MB2368; 23:k512v4sZf6rhY642M/QQ6g2uDHwqOetrb7nWTPVev?= wsvxLjIhDnz3wIgpmyQpkFWMqycVIzAu4o0WlgUdqhKc+vdaABj4Jxe2ImuMjwJnU8xHorpTMQJBpZvNOQcFl8jfBntOMzEsskT0cFF83Rc4KL/8pHls37V3jrVOoAiledg4k+DwMzIGL/EdgUF6gR5Vyx0yFRQhOpsoYEQHIcig/o9CHOT8YYGaHfVMocVWw0yiBIkP4QNU7ptjar3LNvnfW9w4Cx9SYb+JzNYqgb4cTIvkOq7QIdWwFP8DvDHBI29GhPWfJoAW3TsrcjBSF0fWZ0FV+Xi/p6qbXlmpK19J+20Ld0Zf5lez3hEIRW2ebRUwPtX0tIbqTH/Miv81B7N2NWtdj9UDilyVYDlL9zPffYF50aZKU2UFByXV3p1nUBdJNx5iOHaKbRYzsQST7WQEdMaykqE5AjRSwYdg2tov3laC/fn3Sg8vIMhUqNrCLBmYS4i0lgxI+MWTgvEH2wafMwiD72BdSomyBi6udH5RTrAKQ1ITCCo6snpkiPTjh7mE5fQRYLNvT9/cAhtTATef5nGJMqoksNwoNnOjxt8hIBKtxaCjtNmFy0wLuyvDISm3reFMa79lm8A3j4m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DadFc189xzTPR/jwrUVOJCFdP6EP/xkmaQdy5AC75c++MwNuVm7u/Q9B0tKwTHTDHdIkdCxpwRkILHMXqktsHqtKQGBuB13hLecMSbn+2XN1fCy6I8ACfGFn0rdY4tT4oYu3ImAIPvx8nz4q6G/kbKc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 09:01:37.3445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ad6909d-c2a4-4774-df8c-08d5f20d421c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2368 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, akshu.agrawal@amd.com, Mark Brown , Wei Yongjun , "Mukunda, Vijendar" , Alex Deucher , Adam Thomson Subject: [alsa-devel] [PATCH v2] 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 volatge regulator with supplies of 1.8V in the machine driver. Signed-off-by: Adam Thomson Signed-off-by: Akshu Agrawal --- sound/soc/amd/Kconfig | 1 + sound/soc/amd/acp-da7219-max98357a.c | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 6cbf9cf..58c1dcb 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -8,6 +8,7 @@ config SND_SOC_AMD_CZ_DA7219MX98357_MACH select SND_SOC_DA7219 select SND_SOC_MAX98357A select SND_SOC_ADAU7002 + select REGULATOR 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..cd3cf6e 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -320,11 +322,52 @@ 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 regulator_config acp_da7219_cfg = { + .init_data = &acp_da7219_data, +}; + +static struct regulator_ops acp_da7219_ops = { +}; + +static struct regulator_desc acp_da7219_desc = { + .name = "reg-fixed-1.8V", + .type = REGULATOR_VOLTAGE, + .owner = THIS_MODULE, + .ops = &acp_da7219_ops, + .fixed_uV = 1800000, /* 1.8V */ + .n_voltages = 1, +}; + static int cz_probe(struct platform_device *pdev) { int ret; struct snd_soc_card *card; struct acp_platform_info *machine; + struct regulator_dev *rdev; + + acp_da7219_cfg.dev = &pdev->dev; + rdev = devm_regulator_register(&pdev->dev, &acp_da7219_desc, + &acp_da7219_cfg); + if (IS_ERR(rdev)) { + dev_err(&pdev->dev, "Failed to register regulator: %d\n", + ret); + return -EINVAL; + } machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info), GFP_KERNEL);