[alsa-devel] ASoC: 88pm860x: Question about pm860x_set_dai_sysclk implementation

Axel Lin axel.lin at ingics.com
Mon Jun 29 04:27:26 CEST 2015


2015-06-29 10:02 GMT+08:00 Haojian Zhuang <haojian.zhuang at linaro.org>:
> 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.


More information about the Alsa-devel mailing list