From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752902Ab3IQNYF (ORCPT ); Tue, 17 Sep 2013 09:24:05 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:48459 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692Ab3IQNYE (ORCPT ); Tue, 17 Sep 2013 09:24:04 -0400 Date: Tue, 17 Sep 2013 22:23:58 +0900 X-IronPort-AV: E=Sophos;i="4.90,923,1371049200"; d="scan'208";a="140438608" Message-id: From: Kuninori Morimoto To: Mark Brown Cc: Greg Kroah-Hartman , Linux-ALSA , Liam Girdwood , Kuninori Morimoto , Simon , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] ASoC: rsnd: use regmap instead of original register mapping method In-reply-to: <20130917130402.GE21013@sirena.org.uk> References: <87sixrre8r.wl%kuninori.morimoto.gx@renesas.com> <87mwnvsy7a.wl%kuninori.morimoto.gx@renesas.com> <87hae3sxt2.wl%kuninori.morimoto.gx@renesas.com> <20130917130402.GE21013@sirena.org.uk> User-Agent: Wanderlust/2.15.7 Emacs/22.3 Mule/5.0 MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mark > > +void rsnd_write(struct rsnd_priv *priv, > > + struct rsnd_mod *mod, > > + enum rsnd_reg reg, u32 data) > > +{ > > + struct rsnd_gen *gen = rsnd_priv_to_gen(priv); > > + > > + if (regmap_fields_enable(gen->regs[reg])) > > + regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data); > > + else > > + regmap_field_write(gen->regs[reg], data); > > +} > > Ah, sorry - I see you are actually using fields_enable(). I must've > searched for the wrong thing. However looking at this I'm not sure that > this is a good use anyway, it seems like the caller should know if the > register it is writing to is in one of the repeated blocks. Can you > provide a bit more detail as to what's going on here? Hmm... rsnd_write/read() care about it (block/non-block), and caller don't care it, is nice point of this function... For example, SSI device have many ports (0-8), but ADG is only 1 device. On this driver, all devices are using rsnd_write/read() to access register. I can re-check it, but it will be next week Thank you Best regards -- Kuninori Morimoto