From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbcDRKUV (ORCPT ); Mon, 18 Apr 2016 06:20:21 -0400 Received: from regular1.263xmail.com ([211.150.99.134]:41469 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751394AbcDRKUT (ORCPT ); Mon, 18 Apr 2016 06:20:19 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-KSVirus-check: 0 X-RL-SENDER: zhengxing@rock-chips.com X-FST-TO: broonie@kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zhengxing@rock-chips.com X-UNIQUE-TAG: <0c1aa0a75acb76ab6aa192dbd5bb48e3> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5714B4D0.90406@rock-chips.com> Date: Mon, 18 Apr 2016 18:20:00 +0800 From: Xing Zheng User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 To: Mark Brown CC: linux-rockchip@lists.infradead.org, heiko@sntech.de, Adam.Thomson@diasemi.com, sugar.zhang@rock-chips.com, jay.xu@rock-chips.com, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] ASoC: jack: Add a jack detect callback via codec References: <1460967452-24574-1-git-send-email-zhengxing@rock-chips.com> <1460967452-24574-2-git-send-email-zhengxing@rock-chips.com> <20160418092218.GL3217@sirena.org.uk> <5714AC57.2070901@rock-chips.com> <20160418095302.GN3217@sirena.org.uk> <5714B0D4.7080506@rock-chips.com> In-Reply-To: <5714B0D4.7080506@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016年04月18日 18:03, Xing Zheng wrote: > HI Mark, > > On 2016年04月18日 17:53, Mark Brown wrote: >> On Mon, Apr 18, 2016 at 05:43:51PM +0800, Xing Zheng wrote: >> >>> The patch_1/3 add an export of a function that calls the _detect_jack_ >>> function >>> when a codec supports jack detection and fill the _detect_jack_ >>> function in >>> the >>> struct snd_soc_codec_driver. >> But why would anything ever call this function? How is this supposed to >> be used? > In my opinion, this function is mainly to provide simple-card > (patch_2/3). > > This function will call and initialize jack detection if a codec > supports it and fill the detect_jack function (patch_3/3 use it), > and, we don't need to create a customized machine driver to call the > codec jack detection, the simple-card is able to > parse them. > > Thanks. > The dts usage like this: sound { ...... simple-audio-card,dai-link@0 { format = "i2s"; cpu { sound-dai = <&i2s0>; }; codec { sound-dai = <&codec>; simple-audio-card,codec-jack = "JACK_HEADSET", "JACK_BTN_0", "JACK_BTN_1", "JACK_BTN_2", "JACK_BTN_3"; }; }; ...... }; -- - Xing Zheng