From patchwork Wed Aug 16 23:50:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9904733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 37195603B5 for ; Wed, 16 Aug 2017 23:51:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21D40285EB for ; Wed, 16 Aug 2017 23:51:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15BF528A75; Wed, 16 Aug 2017 23:51:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, URIBL_SBL autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F9F1285EB for ; Wed, 16 Aug 2017 23:51:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 82A9C2675B3; Thu, 17 Aug 2017 01:51:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CCA5E2675B4; Thu, 17 Aug 2017 01:51:04 +0200 (CEST) Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com [74.125.83.52]) by alsa0.perex.cz (Postfix) with ESMTP id A4165266BF6 for ; Thu, 17 Aug 2017 01:51:02 +0200 (CEST) Received: by mail-pg0-f52.google.com with SMTP id t80so3261233pgb.5 for ; Wed, 16 Aug 2017 16:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uSJIJ+DmuLl4iw1F49Jj5JMqO8uIqOhtlKslKI3bj0I=; b=MhT7U3Msi67OU640TuN6xa0tLGWTn7pOsk7V/c8DfDcPgF7arQnXcdgDAjgoyR8joI 2xDvtEWX9shTdwo2OUKDz1uNBqh42xcSCqo3tsRigisxyW4dQXK5anBitF8FKq8Lv6TW wVn1wCpv3QhPK5jGP1OVyq3UUTZXSo0PsCunI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uSJIJ+DmuLl4iw1F49Jj5JMqO8uIqOhtlKslKI3bj0I=; b=ZJIwrOCAuQUGuH8vac/eYxZfJ/O0RHNoV1OXNcn+inZvto3ygFIOz2rXpuy6p6bZit /TYM+lN8QC0NpcWhqYvsdcgJpvR2GY67RRwHa0XWJftcmcsOKXNvxbPcRUJEl1lHv0T8 Ik54tu3tJ+1Qs3ksF/q/ThPNXCtOIQ3QpBizn0N63derXDPQvkUZrfWoc8/ahbifKLQY TBb8L0VDhHJ0u1DXRPwXxiHqHvf1ZchJyFokZ3RThBPBkqkirWVzIfm7a9J2DkNpjzkg pYTXysv6GjVpBtPZfzQJZ8dkP9I7S3onKatjWD7g53kA2ImubAKSf6ZZC9QHuHahDpLm iedw== X-Gm-Message-State: AHYfb5hxaLmdlRvdBq30VB+/d74THpeCNLMaqCsWSn4HGCkplkDlgBBo WnK/2UviEMjsh6fU X-Received: by 10.84.231.130 with SMTP id g2mr3653559plk.342.1502927460858; Wed, 16 Aug 2017 16:51:00 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:84b9:6302:d42:7396]) by smtp.gmail.com with ESMTPSA id 133sm3736776pgc.19.2017.08.16.16.50.59 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 Aug 2017 16:50:59 -0700 (PDT) Date: Wed, 16 Aug 2017 16:50:58 -0700 From: Matthias Kaehlcke To: jeffy Message-ID: <20170816235058.GA173745@google.com> References: <1502340898-28403-1-git-send-email-jeffy.chen@rock-chips.com> <1502340898-28403-2-git-send-email-jeffy.chen@rock-chips.com> <20170816215909.GC109008@google.com> <5994CD58.7030406@rock-chips.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5994CD58.7030406@rock-chips.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: alsa-devel@alsa-project.org, heiko@sntech.de, Liam Girdwood , briannorris@chromium.org, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Mark Brown , Takashi Iwai , dgreid@chromium.org, linux-arm-kernel@lists.infradead.org Subject: Re: [alsa-devel] [PATCH v2 1/3] ASoC: rockchip: Parse dai links from dts X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP El Thu, Aug 17, 2017 at 06:55:20AM +0800 jeffy ha dit: > hi matthias, > > thanks for your suggestion. > > On 08/17/2017 05:59 AM, Matthias Kaehlcke wrote: > >El Thu, Aug 10, 2017 at 12:54:56PM +0800 Jeffy Chen ha dit: > > > >>>Refactor rockchip_sound_probe, parse dai links from dts instead of > >>>hard coding them. > >Mark doesn't seem to be overly convinced that 'rockchip,codec-names' > >is a good idea (https://lkml.org/lkml/2017/8/10/511). > > > >How about using something like this instead: > > > >static const char *dailink_compat[] = { > > [DAILINK_MAX98357A] = "maxim,max98357a", > > [DAILINK_RT5514] = "realtek,rt5514", > > [DAILINK_DA7219] = "dlg,da7219", > >}; > i've thought about this too, but i'm working on converting rt5514 > dsp(spi) from codec name matching to of_node, and it would have the > same compatible with rt5514(i2c) Bummer! I wonder if a relatively inoffensive DT hack would be an appropriate solution in this case, since the conflicting compatible string is a somewhat special case and this change only affects the DT and the driver/glue of a specific device (family). The hack would consist in adding an additional 'compatible' entry to the DT entry of the codec, which is ignored by the rt5514 driver, and only used by the sound glue to identify it: Mark, would you prefer a hack like this over the list of codec names or do you have any other suggestions? Matthias --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi @@ -671,7 +671,7 @@ ap_i2c_mic: &i2c1 { i2c-scl-rising-time-ns = <300>; headsetcodec: rt5514@57 { - compatible = "realtek,rt5514"; + compatible = "realtek,rt5514", "realtek,rt5514-i2c"; And then use "realtek,rt5514-i2c" in dailink_compat.