From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Keepax Subject: Re: [PATCH v2 3/3] ASoC: TDA7802: Add turn-on diagnostic routine Date: Tue, 30 Jul 2019 15:18:22 +0100 Message-ID: <20190730141822.GI54126@ediswmail.ad.cirrus.com> References: <20190730120937.16271-1-thomas.preston@codethink.co.uk> <20190730120937.16271-4-thomas.preston@codethink.co.uk> <20190730124158.GH54126@ediswmail.ad.cirrus.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Thomas Preston Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Kuninori Morimoto , Kirill Marinushkin , Liam Girdwood , Mark Brown , Takashi Iwai , Marco Felsch , Annaliese McDermond , linux-kernel@vger.kernel.org, Paul Cercueil , Vinod Koul , Rob Herring , Srinivas Kandagatla , Jerome Brunet , Cheng-Yi Chiang List-Id: devicetree@vger.kernel.org On Tue, Jul 30, 2019 at 03:04:19PM +0100, Thomas Preston wrote: > On 30/07/2019 13:41, Charles Keepax wrote: > >> +static int tda7802_bulk_update(struct regmap *map, struct reg_update *update, > >> + size_t update_count) > >> +{ > >> + int i, err; > >> + > >> + for (i = 0; i < update_count; i++) { > >> + err = regmap_update_bits(map, update[i].reg, update[i].mask, > >> + update[i].val); > >> + if (err < 0) > >> + return err; > >> + } > >> + > >> + return i; > >> +} > > > > This could probably be removed using regmap_multi_reg_write. > > > > The problem is that I want to retain the state of the other bits in those > registers. Maybe I should make a copy of the backed up state, set the bits > I want to off-device, then either: > > 1. Write the changes with regmap_multi_reg_write > 2. Write all six regs again (if my device doesn't support the multi_reg) > Nah sorry my bad you are probably better off they way you are. Thanks, Charles