Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836AbcDUOT3 (ORCPT ); Thu, 21 Apr 2016 10:19:29 -0400 Received: from mail.kernel.org ([198.145.29.136]:36965 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbcDUOT1 (ORCPT ); Thu, 21 Apr 2016 10:19:27 -0400 Date: Thu, 21 Apr 2016 09:19:21 -0500 From: Rob Herring To: Xing Zheng Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, Adam.Thomson@diasemi.com, sugar.zhang@rock-chips.com, jay.xu@rock-chips.com, broonie@kernel.org, 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 Subject: Re: [PATCH 2/3] ASoC: simple-card: Add support jack detection via codec Message-ID: <20160421141921.GA25900@rob-hp-laptop> References: <1460967452-24574-1-git-send-email-zhengxing@rock-chips.com> <1460967452-24574-3-git-send-email-zhengxing@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460967452-24574-3-git-send-email-zhengxing@rock-chips.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 48 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. Rob