From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haojian Zhuang Subject: Re: ASoC: 88pm860x: Question about pm860x_set_dai_sysclk implementation Date: Mon, 29 Jun 2015 10:49:10 +0800 Message-ID: <1435546150.1744.2.camel@linaro.org> References: <1435503659.6929.1.camel@ingics.com> <1435543330.1744.1.camel@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 0C42E26518B for ; Mon, 29 Jun 2015 04:49:08 +0200 (CEST) Received: by pdcu2 with SMTP id u2so107973750pdc.3 for ; Sun, 28 Jun 2015 19:49:06 -0700 (PDT) In-Reply-To: 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: Axel Lin Cc: "alsa-devel@alsa-project.org" , Mark Brown , Liam Girdwood List-Id: alsa-devel@alsa-project.org On Mon, 2015-06-29 at 10:27 +0800, Axel Lin wrote: > 2015-06-29 10:02 GMT+08:00 Haojian Zhuang : > > On Sun, 2015-06-28 at 23:00 +0800, Axel Lin wrote: > >> Hi Haojian, > >> In sound/soc/codecs/88pm860x-codec.c (pm860x_set_dai_sysclk): > >> When dir != PM860X_CLK_DIR_OUT, current code set > >> pm860x->dir = PM860X_CLK_DIR_IN; and then return -EINVAL. > >> This looks confusion. > >> Since there is no comment for that, I'm wondering if the > >> return -EINVAL is intentional or not. > >> > >> Regards, > >> Axel > >> > > > > Hi Axel, > > > > Since we didn't support slave mode in our solution, I just return > > -EINVAL for PM860X_CLK_DIR_IN. I'm sorry to add the confused code. > > Could you help to format a patch to add the comments? > > The main confusion part is current code actually *changes* pm860x->dir setting > when return -EINVAL in pm860x_set_dai_sysclk. > (And the pm860x->dir is used in pm860x_pcm_set_dai_fmt.) > so I'm wondering if it make sense to just return -EINVAL without setting > pm860x->dir = PM860X_CLK_DIR_IN; in pm860x_set_dai_sysclk. It's fine to return -EINVAL directly without setting pm680x->dir. Regards Haojian