From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbdHQEp1 (ORCPT ); Thu, 17 Aug 2017 00:45:27 -0400 Received: from regular1.263xmail.com ([211.150.99.133]:35905 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbdHQEpW (ORCPT ); Thu, 17 Aug 2017 00:45:22 -0400 X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: mka@chromium.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <2c311911d95e508ececc05b6020681c8> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <59951F59.3010101@rock-chips.com> Date: Thu, 17 Aug 2017 12:45:13 +0800 From: jeffy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Matthias Kaehlcke CC: linux-kernel@vger.kernel.org, dgreid@chromium.org, heiko@sntech.de, briannorris@chromium.org, dianders@chromium.org, Jaroslav Kysela , alsa-devel@alsa-project.org, linux-rockchip@lists.infradead.org, Mark Brown , Takashi Iwai , Liam Girdwood , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/3] ASoC: rockchip: Parse dai links from dts 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> <20170816235058.GA173745@google.com> In-Reply-To: <20170816235058.GA173745@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthias, On 08/17/2017 07:50 AM, Matthias Kaehlcke wrote: > 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: > > --- 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. this should work, i'll do that in new version, thanks. > > Mark, would you prefer a hack like this over the list of codec names > or do you have any other suggestions? > > Matthias > > >