From patchwork Wed Jul 15 00:51:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Howe, Tim" X-Patchwork-Id: 6790771 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 839639F3E6 for ; Wed, 15 Jul 2015 00:52:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9F3D206E3 for ; Wed, 15 Jul 2015 00:52:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7926E206BD for ; Wed, 15 Jul 2015 00:52:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A3157265736; Wed, 15 Jul 2015 02:52:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F27F6265713; Wed, 15 Jul 2015 02:51:53 +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 38B0D265716; Wed, 15 Jul 2015 02:51:53 +0200 (CEST) Received: from m0077474.ppops.net (mx0b-001ae601.pphosted.com [67.231.152.168]) by alsa0.perex.cz (Postfix) with ESMTP id 9D7D5265711 for ; Wed, 15 Jul 2015 02:51:45 +0200 (CEST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by m0077474.ppops.net (8.15.0.59/8.14.7) with SMTP id t6F0n621010684; Tue, 14 Jul 2015 19:51:43 -0500 Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 1vmydkh0mn-1; Tue, 14 Jul 2015 19:51:43 -0500 Received: from ex3.ad.cirrus.com (ex3.ad.cirrus.com [141.131.36.34]) by mail1.cirrus.com (Postfix) with ESMTP id C89FB34036; Tue, 14 Jul 2015 19:51:43 -0500 (CDT) Received: from EX1.ad.cirrus.com ([fe80::24e5:cfdd:13b1:95ac]) by ex3.ad.cirrus.com ([::1]) with mapi id 14.03.0174.001; Tue, 14 Jul 2015 19:51:42 -0500 From: "Howe, Tim" To: "alsa-devel@alsa-project.org" Thread-Topic: [PATCH v2] ASoC: cs4349: Add support for Cirrus Logic CS4349 Thread-Index: AQHQvpdiisXqIqjhNEKRpwCZ6VhUJp3bs3vA Date: Wed, 15 Jul 2015 00:51:41 +0000 Message-ID: References: <55a5ace1.6267320a.46fe.ffff95ab@mx.google.com> In-Reply-To: <55a5ace1.6267320a.46fe.ffff95ab@mx.google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.131.104.58] MIME-Version: 1.0 X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com ip4:141.131.128.20 ip4:141.131.3.20 ip4:213.128.236.230 ip4:87.246.98.25 ip4:87.246.78.26 -all X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-07-15_01:2015-07-14, 2015-07-14, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1506180000 definitions=main-1507150009 Cc: "Austin, Brian" , "broonie@kernel.org" , "lgirdwood@gmail.com" Subject: Re: [alsa-devel] [PATCH v2] ASoC: cs4349: Add support for Cirrus Logic CS4349 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 Sorry sent the wrong patch. Resending soon. Tim -----Original Message----- From: timothyc.howe@gmail.com [mailto:timothyc.howe@gmail.com] Sent: Tuesday, July 14, 2015 7:44 PM To: alsa-devel@alsa-project.org Cc: lgirdwood@gmail.com; broonie@kernel.org; Austin, Brian; Howe, Tim Subject: [PATCH v2] ASoC: cs4349: Add support for Cirrus Logic CS4349 From: Tim Howe Signed-off-by: Tim Howe --- sound/soc/codecs/cs4349.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) -- 2.4.5 diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c index c9a96b6..ee6b676 100644 --- a/sound/soc/codecs/cs4349.c +++ b/sound/soc/codecs/cs4349.c @@ -305,19 +305,8 @@ static int cs4349_i2c_probe(struct i2c_client *client, return ret; } - if (pdata) { + if (pdata) cs4349->pdata = *pdata; - } else { - pdata = devm_kzalloc(&client->dev, - sizeof(struct cs4349_platform_data), - GFP_KERNEL); - if (!pdata) { - dev_err(&client->dev, - "could not allocate pdata\n"); - return -ENOMEM; - } - cs4349->pdata = *pdata; - } /* Reset the Device */ cs4349->reset_gpio = devm_gpiod_get_optional(&client->dev, @@ -330,9 +319,6 @@ static int cs4349_i2c_probe(struct i2c_client *client, i2c_set_clientdata(client, cs4349); - dev_info(&client->dev, - "Cirrus Logic CS4349\n"); - return snd_soc_register_codec(&client->dev, &soc_codec_dev_cs4349, &cs4349_dai, 1); } @@ -357,14 +343,17 @@ static int cs4349_runtime_suspend(struct device *dev) struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); int ret; - /* Hold down reset */ - if (cs4349->reset_gpio) - gpiod_set_value_cansleep(cs4349->reset_gpio, 0); - ret = snd_soc_update_bits(rtd->codec, CS4349_MISC, PWR_DWN, 1); if (ret < 0) return ret; + regcache_cache_only(cs4349->regmap, true); + regcache_sync(cs4349->regmap); + + /* Hold down reset */ + if (cs4349->reset_gpio) + gpiod_set_value_cansleep(cs4349->reset_gpio, 0); + return 0; }