From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbcDVBSF (ORCPT ); Thu, 21 Apr 2016 21:18:05 -0400 Received: from regular1.263xmail.com ([211.150.99.130]:44281 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751594AbcDVBSC (ORCPT ); Thu, 21 Apr 2016 21:18:02 -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: alsa-devel@alsa-project.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: zhengxing@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec To: Rob Herring , broonie@kernel.org References: <1460967452-24574-1-git-send-email-zhengxing@rock-chips.com> <1460967452-24574-3-git-send-email-zhengxing@rock-chips.com> <20160421141921.GA25900@rob-hp-laptop> Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, Adam.Thomson@diasemi.com, sugar.zhang@rock-chips.com, jay.xu@rock-chips.com, Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Arnaud Pouliquen , Aaro Koskinen , Andrew Lunn , Mengdong Lin , Jun Nie , Jyri Sarha , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org From: Xing Zheng Message-ID: <57197BBA.50304@rock-chips.com> Date: Fri, 22 Apr 2016 09:17:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160421141921.GA25900@rob-hp-laptop> 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月21日 22:19, Rob Herring wrote: > On Mon, Apr 18, 2016 at 04:17:31PM +0800, Xing Zheng wrote: >> In most cases, many codecs already supports jack detection, previouslly, >> we need to create a customized machine driver every time. >> >> Hence, the simple-card need to support use them dynamically via parse dts >> file for better flexibility. >> >> Signed-off-by: Xing Zheng >> --- >> >> .../devicetree/bindings/sound/simple-card.txt | 17 +++ >> sound/soc/generic/simple-card.c | 126 +++++++++++++++++++- >> 2 files changed, 140 insertions(+), 3 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt >> index cf3979e..d25c8eb 100644 >> --- a/Documentation/devicetree/bindings/sound/simple-card.txt >> +++ b/Documentation/devicetree/bindings/sound/simple-card.txt >> @@ -22,6 +22,23 @@ Optional properties: >> headphones are attached. >> - simple-audio-card,mic-det-gpio : Reference to GPIO that signals when >> a microphone is attached. >> +- simple-audio-card,codec-jack : A list of the codec supports jack detection. >> + The jack types which are supported refer to include/sound/jack.h. >> + All of the jack types: >> + "JACK_HEADPHONE", >> + "JACK_MICROPHONE", >> + "JACK_HEADSET", >> + "JACK_LINEOUT", >> + "JACK_MECHANICAL", >> + "JACK_VIDEOOUT", >> + "JACK_AVOUT", >> + "JACK_LINEIN", >> + "JACK_BTN_0", >> + "JACK_BTN_1", >> + "JACK_BTN_2", >> + "JACK_BTN_3", >> + "JACK_BTN_4", >> + "JACK_BTN_5". > simple-card is not so simple... > > I think this information be part of the codec node if the codec > provides the functionality. The binding should not be different whether > a codec is part of simple-card or not. Also, I would make all these just > boolean props. Yes, these things seem like make simple-card becomes more complicated, and the generic jack detection method is still a problem currently. Hi Mark, the other question here, how do we make sense to use the simple-card to call the "snd_soc_dai_set_pll" if the codec (like da7219) requires do this? Thanks. -- - Xing Zheng