public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Headset driver detection problem during bootup
@ 2011-08-19 12:23 anish singh
  2011-08-20 13:21 ` anish singh
  2011-08-20 17:40 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: anish singh @ 2011-08-19 12:23 UTC (permalink / raw)
  To: linux-kernel-mail, Kernel-newbies; +Cc: broonie, Jonathan Cameron, Dave Hylands

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.
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?

After the device is powered up and then if we insert headset
then it is working fine by calling the interrupt handler and
everything goes fine.

linux -2.3.5
Android Device

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Headset driver detection problem during bootup
  2011-08-19 12:23 Headset driver detection problem during bootup anish singh
@ 2011-08-20 13:21 ` anish singh
  2011-08-23 13:52   ` Takashi Iwai
  2011-08-20 17:40 ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: anish singh @ 2011-08-20 13:21 UTC (permalink / raw)
  To: linux-kernel-mail, kernelnewbies
  Cc: alsa-devel, Edgar (gimli) Hucek, Tim Howe, Stephen Warren,
	Vince Weaver, Takashi Iwai, Jaroslav Kysela

adding more information and experts on alsa.

On Fri, Aug 19, 2011 at 9:23 PM, anish singh
<anish198519851985@gmail.com> 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.
>
> After the device is powered up and then if we insert headset
> then it is working fine by calling the interrupt handler and
> everything goes fine.
>
> linux -2.3.5
> Android Device
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Headset driver detection problem during bootup
  2011-08-19 12:23 Headset driver detection problem during bootup anish singh
  2011-08-20 13:21 ` anish singh
@ 2011-08-20 17:40 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-08-20 17:40 UTC (permalink / raw)
  To: anish singh
  Cc: linux-kernel-mail, Kernel-newbies, Jonathan Cameron, Dave Hylands

On Fri, Aug 19, 2011 at 09:23:13PM +0900, anish singh wrote:

> 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?

> After the device is powered up and then if we insert headset
> then it is working fine by calling the interrupt handler and
> everything goes fine.

The standard soc-jack code should already be reading the state of the
GPIO as part of its startup.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Headset driver detection problem during bootup
  2011-08-20 13:21 ` anish singh
@ 2011-08-23 13:52   ` Takashi Iwai
  2011-08-23 15:01     ` anish singh
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2011-08-23 13:52 UTC (permalink / raw)
  To: anish singh
  Cc: linux-kernel-mail, kernelnewbies, alsa-devel, Edgar (gimli) Hucek,
	Tim Howe, Stephen Warren, Vince Weaver, Jaroslav Kysela,
	Mark Brown, Liam Girdwood

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
> <anish198519851985@gmail.com> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Headset driver detection problem during bootup
  2011-08-23 13:52   ` Takashi Iwai
@ 2011-08-23 15:01     ` anish singh
  0 siblings, 0 replies; 5+ messages in thread
From: anish singh @ 2011-08-23 15:01 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: linux-kernel-mail, kernelnewbies, alsa-devel, Edgar (gimli) Hucek,
	Tim Howe, Stephen Warren, Vince Weaver, Jaroslav Kysela,
	Mark Brown, Liam Girdwood

On Tue, Aug 23, 2011 at 10:52 PM, Takashi Iwai <tiwai@suse.de> wrote:
> 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
>> <anish198519851985@gmail.com> 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.
Absolutely right.During bootup we check the gpio and if we find out
that the headset is inserted then we update the switch.In Android
updating the switch is nothing but updating some sysfs file and
generating uevent AFAIK.
>
>
> Takashi
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-23 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-19 12:23 Headset driver detection problem during bootup anish singh
2011-08-20 13:21 ` anish singh
2011-08-23 13:52   ` Takashi Iwai
2011-08-23 15:01     ` anish singh
2011-08-20 17:40 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox