Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752579AbdFSWH7 (ORCPT ); Mon, 19 Jun 2017 18:07:59 -0400 Received: from mail-bn3nam01on0132.outbound.protection.outlook.com ([104.47.33.132]:51130 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752335AbdFSWHy (ORCPT ); Mon, 19 Jun 2017 18:07:54 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=maximintegrated.com; From: Ryan Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: ryan.lee.maxim@gmail.com Subject: [PATCH 7/7] staging: max98927: Added PM suspend and resume function Date: Mon, 19 Jun 2017 15:07:26 -0700 Message-Id: <1497910046-3369-7-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497910046-3369-1-git-send-email-ryans.lee@maximintegrated.com> References: <1497910046-3369-1-git-send-email-ryans.lee@maximintegrated.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [204.17.143.20] X-ClientProxiedBy: CY4PR2201CA0021.namprd22.prod.outlook.com (10.171.208.159) To BLUPR11MB0833.namprd11.prod.outlook.com (10.163.217.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddf4a51b-a225-436a-b63d-08d4b75f9c8e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:BLUPR11MB0833; X-Microsoft-Exchange-Diagnostics: 1;BLUPR11MB0833;3:o5/273gqrkfIIgobYlqwHBKi6Z+Ry5LCv+H/MAdQHi5lVNIOZ+YiR6UMAQIDEZH7nE2aPuRTkEG3tw87a28V+VGwXJWB3VZcrD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bvkZqS+sDZa3dP68dRgDAffB4xEz/FTv1s/gAlpvBK7RDCdxRvkgwQszuwXRIoARKP6VtR8OC4fXMiyLVVXaS/IIbTdoFXuhu3rd1G6WciRZx2RyLY5PfwKazAHlwg23KDm+3Rm+ePhYzAfAqZkYaTSUwWJCmk0bPP4tIR8qJ1LXrA+jIlUMjfbrRF/2WOtvVxOmnP1bDCcl7tjJmDuBMhxZt0i50azz+daYLXrjIlPcLlg0mxJdnTWPd0f0lJEXWwYRQONFuYHkiwYBo+AlDUGKCb8Xq+e/ZtZRVM6iZfFVn3PR3EV3rFutvOLdkDzKR1VoJuVULAOyK4OgbWudemxPkd8566oANI0kLipawp9RztfDnLP4SxpHzbIJ2XkKwxFcHv0bB7uw6pAJZQRx9Lm+16LVDkzkaeTpETsr11XH7jPF8AKQTC6kcIC4uhoHJB6Af6kWhCRpJ5ps1P X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(108721460000369); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BLUPR11MB0833;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BLUPR11MB0833; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR11MB0833;4:2+2nEH1LnNX0/tg2nj/NvgS92n8Ii000XwUDHYAG+e?= =?us-ascii?Q?Q97Q+GcWFD3/a3HwObjP2hZEJklzLpYnYitL7yYi9kUcn3sisgKR4cMqChYy?= =?us-ascii?Q?q/9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?us-ascii?Q?vNms5fkJOqcNFpNya40VcC3enA2ydc8Nk190SVD7/ZAAF5BU92/TQlQDrvyq?= =?us-ascii?Q?pDKC5FkhvW/BeUB12qDKp9QtrRkI74YyE1aa6pW7x821ZxgodOyVcXBEfeFS?= =?us-ascii?Q?9Z3pJ20AVkYOYrtPhU8MATIz30oez8BLPwSiQY3JODg/4cyo20MMT53qxxyI?= =?us-ascii?Q?gV7Dx8JaNBcOLmEIqFV3fL3EGVV7ZPjTPW?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(6486002)(53416004)(7736002)(42186005)(189998001)(81166006)(50226002)(8676002)(5003940100001)(86362001)(50466002)(5660300001)(53936002)(6512007)(2906002)(36756003)(305945005)(66066001)(4326008)(6666003)(110136004)(38730400002)(2950100002)(47776003)(478600001)(33646002)(3846002)(50986999)(76176999)(72206003)(25786009)(6506006);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR11MB0833;H:ryan-linux.maxim-ic.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR11MB0833;23:SIgjwv+7MZU89fm1jt2Cxz9u0ehzhjjc3JVTC1Zpn?= =?us-ascii?Q?XyA06dHQmCNBgQo/ZpKO839T2x3QBf0WfDy3HGAzmKonMFtMOZ1wLKuQeTiX?= =?us-ascii?Q?yGVkV5R2JGob2nBjIrP6dpb7F8Tn6NvFFCVCY0MOd3CZiGGEXMwTOjtoIg+x?= =?us-ascii?Q?FtyD1DFf09gguyv/h5tVWw2L/+oGElYA8sVcm1Odv5l+0v5dgnFYxgO+p0eh?= =?us-ascii?Q?pkLfykf77Nx6s6hTlGw/Obv7vzcbQw7Wf3yjEstNTFRgdMYtLs47R9hrlbEX?= =?us-ascii?Q?fKLkgra887MpEXrFCwkzAbe7gH8DWiS7MZCz6mhnCwj0IfWAy7q1BXekNfs+?= =?us-ascii?Q?xK4MV3TPdFpUwYJn8lOL9lMBvVEqBsMnedgIwhiYrj7i7rMyUmmiDcvj2M5P?= =?us-ascii?Q?Px+jlfz2+TLJKj5uOM7mII+cualX5SZ2qvbi2ZSTFYbjywKxwqOdX7z8DRC0?= =?us-ascii?Q?yFOWW9Fww7/7wQMXFqY6M86GwO5DcQl796WU5CTkezRCCdSiTaospyzMV3HI?= =?us-ascii?Q?O/RJw4XpUYn152TXb2D7D+urOFllrYpJ1GkoJacdJhmvmaRsWuNmbTowxATE?= =?us-ascii?Q?EpgCxeJSN39d/TFUSyDMUgrxiW1AI9AG7K0AKfuBb+7HBg6bDXEpwPDDyWLd?= =?us-ascii?Q?hN259GHL5d2G0FcKzobp19guWjmGRgniEDZeVTdwN+Y+XSrcDwDJ73YyW0SV?= =?us-ascii?Q?Cg6aAm0Jjon8ZZK7y8gkRTP4KAinJZqOrqcP6P29mg6dwtAkz8lAx7IDzt4N?= =?us-ascii?Q?qW1XNluR5XtpcGxF1HdeVJpc8Zb3naI0jqUW5c47L9/MIJrl7DxRRt3dauAg?= =?us-ascii?Q?hq2+I4UzCT8pjoBmsYLommydlOpiRgDhfnaWHMeuKwe4whYpgszIGy69Yl7W?= =?us-ascii?Q?DT+pUBE3uU3GEtq2C2FI1Gw75puYrJNwOX8o5bE/HtMukbVs4oX2syzFgJun?= =?us-ascii?Q?SqEpH1OAi8hprANhpn4ghAf+W/ls3eTLsTMYhdgvU1Nm7fuGA1Z7v9JOP0nM?= =?us-ascii?Q?m9jBfg6Zs/+pPf3nXX21Rub+srpjUMKiDRJGZzl1124sg=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR11MB0833;6:ez7ZEY+dw61cIaPH22da3cNufW852npvCIL4F0QCOb?= =?us-ascii?Q?yKmazHdFtKLb4+3tQBg7981uTniHjr1QvUkcGr7sDUfvovcVpnlxntVkf/gn?= =?us-ascii?Q?6fNDu5fiod44vV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QenCxZKRw?= =?us-ascii?Q?DmNHhE9GPLh/Ca0+f0c2CB?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR11MB0833;5:uxxvMUp6UmN0Osy2X4dWSDNJvFkIFUF2fGWLEFqZzD6v/bdz/43aSijySBeDimZ7/1Lgz322ZKyfK2wMSjcGN3Txo8NKo0yQcE+cfeLZ7UJgToswZiG/IIQlcpN42RfpVjoqcneKDhDZqbyLLSXAft6bPPgtup/K4MhurSNg9SDHfekH7Gqi9zH0lDOJlQLWO2XfT//+zW/IICIe2rY/0eoVH1ibJjja84H+o9FMmtMyKtzdsXqXVm1rSMAfrAGE7a829rNSi168ZUZFpFUNbb3BEatNuV5sjObahWTCLImLMqvIA6ancCb7cY3X3rynfG+Si1PPm0Madhx6TXi3mwvmI7W/yjmvOG+ctk2khtK8PVhX3ThUUn5rwV5lFuzfAX7BoVV4r0+QIgOCtnqRlpMGE8RU2ID1HoDnhbK2t0VPV2bMbHEoRDI13ibMnKjRBujD2YJfDNZIaO9aOK5k5AdK10IGHkPjDcHHVa74qpHDYC0tOH/DNv0otXDP9r34;24:fN1Qq2LvQEhFKnrSfGJnx1hkXtS7Y0w6PQripB2EdutZL0x2PLWCFNHkmRT2HstcgVq9pF4JbqUZJIo1LOpU2IaRU2liR/CRvmFnK89ZVhw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR11MB0833;7:YPFmtkJxDe++VkqZVxdMrXujJe5z9fp+Q0su2Qrj4a+j3It+k7AbQw5VF+5V3olxMTIcRyASFqLPs0J6MzyUb0B3DiL1tXFjGvPX6ckGe2xXbt9cc6Got4W73OhDEePpsCBut8zNh1DShK224o0xoPMRx2iZWKSLET14qX2wR+2G2yTNb7njs4vBLKrVxjQ8yyDfkrJEVGY9CkYouUk9fgrVd2FqbnWXoQOeyiEFQi48earkA8JFxNR/xN2Nf9hnepsH4YueXD5i1qY/7adu+Wv1axkXx3iEbDyeAYe7vDJOInp0EclALRP7KQz26Cz4qcMsi5O4b/SybCeX1Cujlt49CDcgWQgwsd8HpSJhLarKkTC9zvjEGxt2ic3P8lmhY4z+/t3CZpejmw7VdmDglJvFFAPGVJEPPyUPbNZ8sgVA9h9SAEzv8KMjoIUY3OFaJqElOQz5Qn3zPtkBPtOiq/yBeXDHaXhbfBGaYgk/FjuWpVHF5IlmkODiGGN8GFNmMtR8Msf+UJxFIqGTxOLbEhqKWbSnWX0KpyX9dhuwCCzLzUnsfNAmdtNkSU035j4RHU0M1coqrbYgF+v773TLYYvjMUrniEOXXYD3MpKVQIsTigsXbn7OzgkxIlbL0e3nk7OTdS8i69zdGurVLp7hyY6zg9IHuEZaMMtag9WYdRAaaoeQ5ZmRGhNBc9ZvOKM1oWoYTtc/9MoSJgCHX43wi9HMfjsAnG6mjWPizsmcdBCxg2yljvUQJmCpvh78f5/oZodJ3D3BcA0+3aEG7xZLIdGszcyMx/R2Ui6TinuQRRI= X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 22:07:43.4644 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR11MB0833 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1528 Lines: 52 Signed-off-by: Ryan Lee --- sound/soc/codecs/max98927.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index 36be29c..b744578 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -804,6 +804,31 @@ static int max98927_probe(struct snd_soc_codec *codec) return 0; } +#ifdef CONFIG_PM_SLEEP +static int max98927_suspend(struct device *dev) +{ + struct max98927_priv *max98927 = dev_get_drvdata(dev); + + regcache_cache_only(max98927->regmap, true); + regcache_mark_dirty(max98927->regmap); + return 0; +} +static int max98927_resume(struct device *dev) +{ + struct max98927_priv *max98927 = dev_get_drvdata(dev); + + regmap_write(max98927->regmap, + MAX98927_R0100_SOFT_RESET, MAX98927_SOFT_RESET); + regcache_cache_only(max98927->regmap, false); + regcache_sync(max98927->regmap); + return 0; +} +#endif + +static const struct dev_pm_ops max98927_pm = { + SET_SYSTEM_SLEEP_PM_OPS(max98927_suspend, max98927_resume) +}; + static const struct snd_soc_codec_driver soc_codec_dev_max98927 = { .probe = max98927_probe, .component_driver = { @@ -937,7 +962,7 @@ static struct i2c_driver max98927_i2c_driver = { .name = "max98927", .of_match_table = of_match_ptr(max98927_of_match), .acpi_match_table = ACPI_PTR(max98927_acpi_match), - .pm = NULL, + .pm = &max98927_pm, }, .probe = max98927_i2c_probe, .remove = max98927_i2c_remove, -- 2.7.4