From: Takashi Iwai Subject: Re: [PATCH] Revert "ASoC: core: Try to use regmap if the driver doesn't set up any I/O" Date: Wed, 01 Aug 2012 18:13:28 +0200 Message-ID: References: <1343829022-23259-1-git-send-email-peter.ujfalusi@ti.com> <20120801152248.GZ11892@opensource.wolfsonmicro.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E3D16265E5A for ; Wed, 1 Aug 2012 18:13:26 +0200 (CEST) In-Reply-To: <20120801152248.GZ11892@opensource.wolfsonmicro.com> 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 To: Mark Brown Cc: Peter Ujfalusi , alsa-devel@alsa-project.org, Liam Girdwood List-Id: alsa-devel@alsa-project.org At Wed, 1 Aug 2012 16:22:48 +0100, Mark Brown wrote: > > On Wed, Aug 01, 2012 at 04:50:22PM +0300, Peter Ujfalusi wrote: > > Some codec driver can not have regmap implementation so core should not > > assume that codecs without control_data have implemented regmap of it's > > own. > > > > This reverts commit 38cbf9598feba97de9f9b43efa9153fd7c1a2ec9. > > No, this isn't constructive - it just shoves things onto the drivers > that are relying on the implicit functionality. Why not just change the > criteria we use to check, for example looking for the ops instead? Well, the NULL check of dev_get_regmap() looks necessary, but I find it was done in a wrong place in Peter's first patch, too. It could be rather in the caller side, e.g. /* If the driver didn't set I/O up try regmap */ if (!codec->control_data) { codec->control_data = dev_get_regmap(codec->dev, NULL); if (codec->control_data) snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP); } Takashi