From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753878AbbDTUt2 (ORCPT ); Mon, 20 Apr 2015 16:49:28 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:38886 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751745AbbDTUtX (ORCPT ); Mon, 20 Apr 2015 16:49:23 -0400 Date: Mon, 20 Apr 2015 21:48:49 +0100 From: Mark Brown To: Sascha Hauer Cc: Koro Chen , robh+dt@kernel.org, matthias.bgg@gmail.com, perex@perex.cz, tiwai@suse.de, srv_heupstream@mediatek.com, linux-mediatek@lists.infradead.org, galak@codeaurora.org, lgirdwood@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Message-ID: <20150420204849.GJ14892@sirena.org.uk> References: <1428653649-38200-1-git-send-email-koro.chen@mediatek.com> <1428653649-38200-2-git-send-email-koro.chen@mediatek.com> <20150418173407.GE26185@sirena.org.uk> <20150420043747.GH6325@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dMdWWqg3F2Dv/qfw" Content-Disposition: inline In-Reply-To: <20150420043747.GH6325@pengutronix.de> X-Cookie: Everyone hates me because I'm paranoid. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dMdWWqg3F2Dv/qfw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote: > On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote: > > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote: > > > +Each external interface (called "IO" in this driver) is presented as a > > > +DAI to ASoC. An IO must be connected via the interconnect to a memif. > > > +The connection paths are configured through the device tree. > > Why are these connection paths configured via device tree? I would > > expect that either there would be runtime configurability of these > > things (particularly if loopback configurations within the hardware are > > possible) or we'd just allocate memory interfaces to DAIs automatically > > as DAIs come into use. > There is a crossbar switch between the memory interfaces and the DAIs. > Not every connection is possible, so not every memory interface can be > used for every DAI. An algorithm choosing a suitable memory interface > must be quite clever, complicated and also SoC dependent (the same but > different hardware is used on MT8135 aswell), so I thought offering a > static configuration via device tree is a good start. Should there be > runtime configuration possible later the device tree settings could > provide a good default. What exactly do the restrictions look like and how often do they vary in practice (can we get away with just doing a single static setup in the driver)? I'd have thought it should be fairly straightforward to have a table of valid mappings and just pick the first free memory interface? I'd rather not get stuck with the tables in the DT. It's partly to avoid setting bad precendents, we really don't want everyone coming along hard coding this stuff, and partly because the hardware you described didn't seem that hard to handle. > > > +- mem-interface-playback: > > > + mem-interface-capture: property of memif, format is: ; > > > + memif: which memif to be used > > > + (defined in include/dt-bindings/sound/mtk-afe.h) > > > + irq: which irq to be used > > > + (defined in include/dt-bindings/sound/mtk-afe.h) > > > + use_sram: 1 is yes, 0 is no > > Again, this looks like stuff we should be able to figure out at runtime > > - the use of SRAM in particular looks like something we might want to > > change depending on use case. Assuming it adds buffering then for a > > VoIP application we might not want to use SRAM to minimize latency but > > during music playback we might want to enable SRAM to minimize power > > consumption. > That's exactly the usecase. How could such a runtime configurability > look like? sysfs? Or something based on the buffer sizes? Yeah, one of those :) but probably an ALSA control is going to be the easiest for applications. --dMdWWqg3F2Dv/qfw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVNWYwAAoJECTWi3JdVIfQocUH/i0YtpgbDbRUlDhK+nQdG44T sGKcAMHbptmWZFydNlmNwmo/d2ldEB0Dy/G5KLvTj879sHGEUVYOpHGcH1/e+cTq 0PwuL6n/Tpm4mKhD8GNSLk3II7LuNmN/DsEE3o30BNpKbpaKdaruVDTRg6tJ3g8s WVdKTthsJkDSI0rh/Kx2N6+/Li/o8LLPjUonmzcECbuOU2d2N/UWE+y/dskRKxoD LH6p28k9wPf1cEq3EVSRrEqgFOADqiU1sCqAlp7xFIDGdiiYz/C1CCLT9tISzfJ7 HlvurW9Dde0KBUocdo/j5IPqCjnIDAVRLipoO/fB4taT/cYBiC5LV3DHMEE6iY8= =VzDC -----END PGP SIGNATURE----- --dMdWWqg3F2Dv/qfw--