From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbbJHDMz (ORCPT ); Wed, 7 Oct 2015 23:12:55 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:38128 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbbJHDMy (ORCPT ); Wed, 7 Oct 2015 23:12:54 -0400 Message-ID: <5615DEE2.6000906@mentor.com> Date: Thu, 8 Oct 2015 12:11:30 +0900 From: Jiada Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mark Brown CC: , , , , , Subject: Re: [PATCH 2/2] ASoC: Codec: wm8962: declare ALC Coefficients as 4 separate registers References: <1444115215-4388-1-git-send-email-jiada_wang@mentor.com> <1444115215-4388-3-git-send-email-jiada_wang@mentor.com> <20151006110114.GN12635@sirena.org.uk> In-Reply-To: <20151006110114.GN12635@sirena.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 10/06/2015 08:01 PM, Mark Brown wrote: > On Tue, Oct 06, 2015 at 04:06:55PM +0900, Jiada Wang wrote: > >> As ALC2 register is volatile, declare it as one of ALC Coefficients >> register together with other non-volatile registers will cause issue, >> in case wm8962 has enter suspend mode, and cache_only flag is set, >> any attempt to read from ALC2 will fail. > >> Instead of declaring one ALC Coefficients register which contains >> ALC1 ~ ALC3 and Noise Gate, this patch declares 4 separate registers, >> so that regmap can handle these registers differently based on their >> classification. > > I don't understand this commit log. Why does regmap care how these > registers are presented to userspace, and how does splitting the > controls up address the problem with one of the registers being volatile? > Surely that register still has the same problem? > .get callback function will call regmap_raw_read() to read register value from these registers, when these 4 regsters are declared as one "ALC coefficient" register, condition check of regmap_volatile_range() will return false, thus regmap will go word by word for the cache from each register of "ALC Coefficient", the failure scenario is, when wm8962 is in suspend mode (cache_only flag is set), as ALC2 doesn't have cached value, then any attempt to read from it fails, By splitting these registers, regmap can handle ALC2 as a single volatile register, and always read from HW Thanks, Jiada