From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbdLNJd5 (ORCPT ); Thu, 14 Dec 2017 04:33:57 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:40160 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750992AbdLNJdz (ORCPT ); Thu, 14 Dec 2017 04:33:55 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Date: Thu, 14 Dec 2017 09:32:44 +0000 From: Charles Keepax To: Steven Eckhoff CC: Mark Brown , , , Takashi Iwai , Liam Girdwood Subject: Re: [alsa-devel] [PATCH v5] ASoC: TSCS42xx: Add support for Tempo Semiconductor's TSCS42xx audio CODEC Message-ID: <20171214093244.udrjwgfvpxpc3jq7@localhost.localdomain> References: <20171211195403.3irxp7g3n326ub3g@localhost.localdomain> <20171212163254.GL16323@sirena.org.uk> <20171212213114.n5pcgy6q6m3qu5s4@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20171212213114.n5pcgy6q6m3qu5s4@localhost.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=923 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712140134 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 12, 2017 at 03:31:16PM -0600, Steven Eckhoff wrote: > On Tue, Dec 12, 2017 at 04:32:54PM +0000, Mark Brown wrote: > > On Mon, Dec 11, 2017 at 01:54:25PM -0600, Steven Eckhoff wrote: > > > +static int tscs42xx_probe(struct snd_soc_codec *codec) > > > +{ > > > + int i; > > > + int ret; > > > + > > > + for (i = 0; i < ARRAY_SIZE(r_inits); ++i) { > > > + ret = snd_soc_write(codec, r_inits[i].reg, r_inits[i].def); > > > + if (ret < 0) { > > > + dev_err(codec->dev, > > > + "Failed to write codec defaults (%d)\n", ret); > > > + return ret; > > > + } > > > + } > > > > I'd expect the driver to just reset the CODEC (it appears to have that > > feature) and the regmap. > > > These init values were meant to be driver defaults that differed from > the device defaults. In hindsight this was a bad idea. I am removing > them in the next revision and will have the machine driver setup the > codec appropriately. > Not sure what you mean here but setting up CODEC registers directly from the machine driver is probably not ideal. You should probably be looking into regmap_register_patch this lets you apply a bunch of register settings to the chip every time you do a regmap_cache_sync. This is useful for situations like the chip has terrible register defaults you want to correct. Thanks, Charles