[Gta04-owner] Jack bouncing: bugfix.
Denis 'GNUtoo' Carikli
GNUtoo at no-log.org
Thu Dec 27 20:26:05 CET 2012
On Wed, 26 Dec 2012 07:01:18 +1100
NeilBrown <neilb at suse.de> wrote:
> 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?
> 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);
> if (jack.open)
> schedule_delayed_work(&jack.jack_work, delay);
yes something like that.
More information about the Gta04-owner