From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753628AbbJZLUE (ORCPT ); Mon, 26 Oct 2015 07:20:04 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:45154 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbbJZLUC (ORCPT ); Mon, 26 Oct 2015 07:20:02 -0400 Date: Mon, 26 Oct 2015 11:02:57 +0000 From: Charles Keepax To: Robert Jarzmik CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , , , Subject: Re: [PATCH v2] ASoC: wm9713: convert to regmap Message-ID: <20151026110257.GH10520@ck-lbox> References: <1445722627-28854-1-git-send-email-robert.jarzmik@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1445722627-28854-1-git-send-email-robert.jarzmik@free.fr> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-10-26_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1510260195 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 24, 2015 at 11:37:07PM +0200, Robert Jarzmik wrote: > Convert the Wolfson WM9713 to regmap API. This will leverage all the > regmap functions (debug, registers update, etc ...). > > As a bonus, this will pave the path to gpio chip introduction, and > devicetree support. > > Signed-off-by: Robert Jarzmik > --- > Since v1: fix suspend/resume (that specific part is not tested yet) > --- > sound/soc/codecs/Kconfig | 1 + > sound/soc/codecs/wm9713.c | 296 +++++++++++++++++++++++----------------------- > 2 files changed, 152 insertions(+), 145 deletions(-) > @@ -1156,16 +1165,17 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec, > > static int wm9713_soc_suspend(struct snd_soc_codec *codec) > { > - u16 reg; > + regcache_cache_only(codec->component.regmap, true); > + snd_soc_cache_sync(codec); I am assuming we don't want to be doing a cache_sync just after we have marked the regmap as cache only. > > /* Disable everything except touchpanel - that will be handled > * by the touch driver and left disabled if touch is not in > * use. */ > - reg = ac97_read(codec, AC97_EXTENDED_MID); > - ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff); > - ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); > - ac97_write(codec, AC97_POWERDOWN, 0x6f00); > - ac97_write(codec, AC97_POWERDOWN, 0xffff); > + snd_soc_update_bits(codec, AC97_EXTENDED_MID, 0x7fff, > + 0x7fff); > + snd_soc_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); > + snd_soc_write(codec, AC97_POWERDOWN, 0x6f00); > + snd_soc_write(codec, AC97_POWERDOWN, 0xffff); Also as you have already marked the regmap as cache only these writes won't go to the hardware. Thanks, Charles