From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933334AbdEOM7C (ORCPT ); Mon, 15 May 2017 08:59:02 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:25108 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932948AbdEOM7B (ORCPT ); Mon, 15 May 2017 08:59:01 -0400 X-IronPort-AV: E=Sophos;i="5.38,345,1491289200"; d="scan'208";a="2831073" Subject: Re: [PATCH] ASoC: atmel-classd: sync regcache when resuming To: Quentin Schulz , , , , References: <20170515083617.16742-1-quentin.schulz@free-electrons.com> CC: , , , From: Nicolas Ferre Organization: microchip Message-ID: Date: Mon, 15 May 2017 14:59:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170515083617.16742-1-quentin.schulz@free-electrons.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/05/2017 à 10:36, Quentin Schulz a écrit : > 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: Nicolas Ferre Thanks > --- > 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, > -- Nicolas Ferre