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: 9904737 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 445AC600CA for ; Wed, 16 Aug 2017 23:51:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35C05285EB for ; Wed, 16 Aug 2017 23:51:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A80528A73; Wed, 16 Aug 2017 23:51:40 +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=-1.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,URIBL_SBL autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D4B5D285EB for ; Wed, 16 Aug 2017 23:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+GZ9UJ4B172euYdYr8OUSm68n8JwlMqND8UtQylZ0sQ=; b=KFe/y2LxwCjUvm PPBr8zHwnlrPbpGKFSrxd4reDLT/T85IPRsLuGHjK6FiVyH4SYtORqWvNkyDQCjQehCIV/ZPo2tGI naLwLXzSdqHLnRnoV4vDTyqnpv9yOoEcvCM5euj+PIUNAC2t13hGFPQvSVPx8JPxG6B8HDEC/r6i5 9cpNrnH8CswpbdvWHaLEV89OG6iakAwnsd9eehOcQCrrijf+6qI1aq7g+0ozfqKWa3avFHQZfpXSh du0UOvNnYiGQZEid7DnFH52kAm7yc0bqUJcA0W5y/U0jaFSB4nrqJDw9gBRMDlkOo2DaBJ3jQBu1f REMJz5UxI22nHksaTJew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1di85v-00059p-M3; Wed, 16 Aug 2017 23:51:27 +0000 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1di85q-00053A-Sr for linux-arm-kernel@lists.infradead.org; Wed, 16 Aug 2017 23:51:24 +0000 Received: by mail-pg0-x22c.google.com with SMTP id v189so30801004pgd.2 for ; Wed, 16 Aug 2017 16:51:01 -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=WPbr1JT6TJ/UszxdUsfjsStVKMvbWYhjye7fOTfpkE8e74kvb4uZCOnjAhgEIskl6L 1RRk0a4UL59YbRTqd+m3puFfpRXo0VIKxxis9wrVNRnAbaajZqOiavDaK2B5Q/gjpc+I cPaqRT6QpyTkk5QFT1/82gf+2tjt+8acxwSPuT8JrUyi98AhBV9FeQ0egcpgx73ozmeb 33UD7vJ9JqCosWQEbE7HVTPqrC8Wepafq3a9SAksa5yATlKmijL8QPztzdBhsQgvmJ7h P4fnch+8HCYJHEIC/x3Cp5KsbDHpysvMORWuRBcSLtCv4c+w73xgm3sklza5drS4SoX1 FB0Q== X-Gm-Message-State: AHYfb5hR2CWebVVIH6vX0zgeertP4JhMRN6T9DWkZNGfkKauGSs5QwhI w05ALVa5s3rnQQET 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 Subject: Re: [PATCH v2 1/3] ASoC: rockchip: Parse dai links from dts 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170816_165122_973297_BAA7FA37 X-CRM114-Status: GOOD ( 15.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, Jaroslav Kysela , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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.