From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760805AbdEOJqg (ORCPT ); Mon, 15 May 2017 05:46:36 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:44786 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756063AbdEOJqf (ORCPT ); Mon, 15 May 2017 05:46:35 -0400 Date: Mon, 15 May 2017 11:46:23 +0200 From: Alexandre Belloni To: Quentin Schulz Cc: nicolas.ferre@microchip.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, thomas.petazzoni@free-electrons.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: atmel-classd: sync regcache when resuming Message-ID: <20170515094623.sumkphak4g3cuj3j@piout.net> References: <20170515083617.16742-1-quentin.schulz@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515083617.16742-1-quentin.schulz@free-electrons.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/05/2017 at 10:36:17 +0200, Quentin Schulz wrote: > The PM functions used in this driver are the ones defined in > sounc/soc/soc-core.c. > > When suspending (using snd_soc_suspend), the regcache is marked dirty > but is never synced on resume. > > Sync regcache on resume of Atmel ClassD device. > > Signed-off-by: Quentin Schulz Acked-by: Alexandre Belloni > --- > sound/soc/atmel/atmel-classd.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c > index 7ae46c2647d4..b7ef8c59b49a 100644 > --- a/sound/soc/atmel/atmel-classd.c > +++ b/sound/soc/atmel/atmel-classd.c > @@ -301,6 +301,14 @@ static int atmel_classd_codec_probe(struct snd_soc_codec *codec) > return 0; > } > > +static int atmel_classd_codec_resume(struct snd_soc_codec *codec) > +{ > + struct snd_soc_card *card = snd_soc_codec_get_drvdata(codec); > + struct atmel_classd *dd = snd_soc_card_get_drvdata(card); > + > + return regcache_sync(dd->regmap); > +} > + > static struct regmap *atmel_classd_codec_get_remap(struct device *dev) > { > return dev_get_regmap(dev, NULL); > @@ -308,6 +316,7 @@ static struct regmap *atmel_classd_codec_get_remap(struct device *dev) > > static struct snd_soc_codec_driver soc_codec_dev_classd = { > .probe = atmel_classd_codec_probe, > + .resume = atmel_classd_codec_resume, > .get_regmap = atmel_classd_codec_get_remap, > .component_driver = { > .controls = atmel_classd_snd_controls, > -- > 2.11.0 > -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com