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: 9904735 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 2045E600CA for ; Wed, 16 Aug 2017 23:51:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10DD5285EB for ; Wed, 16 Aug 2017 23:51:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0573828A73; Wed, 16 Aug 2017 23:51:29 +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 899CD285EB for ; Wed, 16 Aug 2017 23:51:28 +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=FyvTcremWN9YbLCq7dTa6em/7ijIoIFXUzzjn8u4tHU=; b=R6+K+TiDSaqP7S 1hBY+Y0cWzdM8+XwttPWKd1sr3w7VvTSvRXPoaPG/1qcZNz4FVxr2zA1G1PRokqzRDiRRieXIegyp ax9fKQsocGjgbt8EnAGwS2vQO2D8pl36iIWNrIMwbdDHV+0cUTWitZO4iCmsiBQRMB85ra+/FaGqi Wc64+fg7hFvxqU60QFMZSU/9v+gzVJe0v0MUeSWXA2pjmLVzKnlznK3z5dGNhNmtI90gdZ0dfzKSS DBC9CEXb/OPQ0zA9O6+WlcgkCrKbWeOQKt74k4wkEZmoIYbR+7dPvB4Xnt0KT5R1vw5r2iZFJ6Tm7 VpdYoUOM4x51drED5EKg==; 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 1di85u-00059E-EF; Wed, 16 Aug 2017 23:51:26 +0000 Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1di85q-000539-S6 for linux-rockchip@lists.infradead.org; Wed, 16 Aug 2017 23:51:24 +0000 Received: by mail-pg0-x234.google.com with SMTP id t80so3261184pgb.5 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=M9tOYvKp4voSmiehggyPMdmKfjzaJR8txWK5bPOEGKV5JHYg31lqdTZJb3j5ZEElhr XRSP0Lg3SLh5oheDcqbSP55xVOve2lXGwhDoLThkS1tK7RVIkfxjxUmBMBaXGa7y3nwh oJHV6hzyWfr/w26sA5r0gE80Z0xU9WlTHOQ0vFjEXkxzKlkX2s5svt8tJZghE73oyw0X dTgMREhQmTgoXav7rpXwbIejebtdZY6mbNHC7YyRtbF537+VEpdhBkThewYtZ9H2OWie oIH7aEivnfmjrSstvGLJrRVAeDJ3akegwdF2jJd7Auube8Zj+6TONdZzqgy9sU5ipEmb qpkA== X-Gm-Message-State: AHYfb5j3sVQsK6zZ/1+TEurZRCuHUsRIlRMTHv0uuaOcUQf9zJUvmJet I0yOTQ5JLxRDBpnr 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_942838_BF974D3F X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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.