From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754853Ab1HWNxA (ORCPT ); Tue, 23 Aug 2011 09:53:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42448 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754579Ab1HWNww (ORCPT ); Tue, 23 Aug 2011 09:52:52 -0400 Date: Tue, 23 Aug 2011 15:52:47 +0200 Message-ID: From: Takashi Iwai To: anish singh Cc: linux-kernel-mail , kernelnewbies , alsa-devel@alsa-project.org, "Edgar (gimli) Hucek" , Tim Howe , Stephen Warren , Vince Weaver , Jaroslav Kysela , Mark Brown , Liam Girdwood Subject: Re: Headset driver detection problem during bootup In-Reply-To: References: User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Sat, 20 Aug 2011 22:21:10 +0900, anish singh wrote: > > adding more information and experts on alsa. > > On Fri, Aug 19, 2011 at 9:23 PM, anish singh > wrote: > > I need some suggestions for below situation: > > > > Headset if it is inserted before the device is powered up is > > now detected by forcefully calling the interrupt handler in > > the probe function of the headset driver. > Headset is detected in our andorid device by using a detect gpio > which is turned on when headset is inserted.If the headset > is inserted right from very beginging i.e. before device is even > turned on then we forcefully call the handler and thereby in > handler we check if gpio is turned on or not and do the rest > of things. > > > Once the handler is called then we find out if the headset > > is there or not using gpio and then normal detection happens > > > > Is it the right way to detect the device during power-up? > Does not linux have any other way of doing this which i may > be missing? How this is handled in the case of ALSA jack i.e. > the jack drivers which is using alsa framework for detection? > Android doesn't use ALSA framework for reporting JACK. Judging from the source code, the likely problem is that the driver doesn't initialize the switch-state in input device. The switch-state is updated only when GPIO IRQ comes up. Takashi