From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH 11/19] ASoC: upd9976: add jack detection function Date: Wed, 4 May 2011 17:32:31 +0100 Message-ID: <20110504163231.GI10912@opensource.wolfsonmicro.com> References: <20110504133756.32443.6282.stgit@localhost> <20110504134550.32443.87977.stgit@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 1DDA31038E1 for ; Wed, 4 May 2011 18:33:04 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20110504134550.32443.87977.stgit@localhost> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Lu Guanqun Cc: Takashi Iwai , Koul Vinod , ALSA , Liam Girdwood , Wang Xingchao List-Id: alsa-devel@alsa-project.org On Wed, May 04, 2011 at 09:45:50PM +0800, Lu Guanqun wrote: > +void upd9976_jack_detection(struct snd_soc_jack *jack, u8 interrupt_status) > +{ > + int status = 0; > + unsigned int value = 0; > + struct snd_soc_codec *codec = jack->codec; > + int mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_HEADSET; > + > + if (interrupt_status & 0x3) > + value = snd_soc_read(codec, UPD9976_SAUXINT); > +EXPORT_SYMBOL_GPL(upd9976_jack_detection); > + I'd expect that the driver would also manage the work to do with handling the interrupt as well.