[Gta04-owner] Jack bouncing: bugfix.

NeilBrown neilb at suse.de
Tue Dec 25 21:01:18 CET 2012


On Tue, 25 Dec 2012 11:28:08 +0100 Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
wrote:

> Hi,
> 
> Here:
> http://git.neil.brown.name/git?p=gta04.git;a=blob;f=sound/soc/omap/gta04-audio.c;h=804bce9745eeddba5b0d1f238ea46d2b4b197fd1;hb=refs/heads/3.5-gta04#l176
> The value of twl4030_get_madc_conversion(7) could be negative(in case
> of errors, which do happen), which would made the driver report that
> there is no jack plugged in, instead of not reporting anything.
> 
> I've already fixed it in my GTA04 3.4 SHR tree.
> 
> The jack detection still bounce during the beginning of calls with that
> fix, but it may bounce less.
> 
> Denis.

Thanks for the report - but ENOPATCH :-)

Is this what you had in mind?

NeilBrown

diff --git a/sound/soc/omap/gta04-audio.c b/sound/soc/omap/gta04-audio.c
index f49877c..31c4e34 100644
--- a/sound/soc/omap/gta04-audio.c
+++ b/sound/soc/omap/gta04-audio.c
@@ -167,6 +167,8 @@ static void gta04_audio_jack_work(struct work_struct *work)
 		delay = msecs_to_jiffies(50);
 
 	val = twl4030_get_madc_conversion(7);
+	if (val < 0)
+		got out;
 	/* On my device:
 	 * open circuit = around 20
 	 * short circuit = around 800
@@ -199,6 +201,7 @@ static void gta04_audio_jack_work(struct work_struct *work)
 	snd_soc_jack_report(&jack.hs_jack, jackbits,
 			    SND_JACK_HEADSET | SND_JACK_BTN_0);
 
+out:
 	if (jack.open)
 		schedule_delayed_work(&jack.jack_work, delay);
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20121226/4437e294/attachment.bin>


More information about the Gta04-owner mailing list