From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: [PATCH] ASoC: core: Configure pin muxing via pinctrl when registering a DAI Date: Fri, 21 Sep 2012 16:16:26 +0300 Message-ID: <505C68AA.7080907@ti.com> References: <1348214066-28384-1-git-send-email-peter.ujfalusi@ti.com> <20120921111352.GA21524@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from na3sys009aog129.obsmtp.com (na3sys009aog129.obsmtp.com [74.125.149.142]) by alsa0.perex.cz (Postfix) with ESMTP id C71A2265D48 for ; Fri, 21 Sep 2012 15:15:30 +0200 (CEST) Received: by oagl20 with SMTP id l20so3141445oag.38 for ; Fri, 21 Sep 2012 06:15:29 -0700 (PDT) In-Reply-To: <20120921111352.GA21524@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: alsa-devel@alsa-project.org, Liam Girdwood List-Id: alsa-devel@alsa-project.org On 09/21/2012 02:13 PM, Mark Brown wrote: > On Fri, Sep 21, 2012 at 10:54:26AM +0300, Peter Ujfalusi wrote: >> pinctrl framework now becoming widely available for SoCs to configure pin >> multiplexing. >> Instead of adding the same code to all dai drivers the core can take care >> of this transparently. >> Do not make too much noise if pinctrl is not provided via DT for the dai >> but just use dev_info(). > = > Please fix your word wrapping, I've mentioned this to you before... I'll reformat it. BTW: The text is edited so it fits in the 'Commit Message' part of git gui. >> +/* >> + * Simple function to be used in snd_soc_dai_register_dai/s to set the = default >> + * pinmuxing for the dai. > = > I would be more inclined to do this on card init time, doing it at > registration seems wrong as systems typically have interfaces that > aren't used and share pins with other functions. By the time we are > setting up a card we've got a good idea we actually want to use the IP > but at probe time that's not the case. Make sense. My first candidate to do this is the soc_probe_link_dais() function and to call snd_soc_configure_dai_pins() for both the cpu_dai and codec_dai. > It also seems bad that we're ignoring errors, does the pinctl API not > stub itself out well enough. pinctrl_get_select() returns with a pointer to struct pinctrl. If the platf= orm does not have CONFIG_PINCTRL enabled it will return with NULL. If no pinctrl has been specified for the device it will return with error (-ENODEV). Neither of these cases should be considered as error. We do print out with dev_info() to notify the developer, but having pinctrl mux should not be mandatory. -- = P=E9ter