linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: joerg Reisenweber <joerg@openmoko.org>
To: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: "Pavel Machek" <pavel@ucw.cz>,
	"Pali Rohár" <pali.rohar@gmail.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Peter Ujfalusi" <peter.ujfalusi@ti.com>,
	"Eduardo Valentin" <edubezval@gmail.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Aaro Koskinen" <aaro.koskinen@iki.fi>,
	"Nishanth Menon" <nm@ti.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Nokia N900 sound driver and ECI GPIOs
Date: Mon, 02 Jan 2017 17:07:13 +0100	[thread overview]
Message-ID: <18543398.ETO0VDvrVl@saturn> (raw)
In-Reply-To: <4f150265-aa9b-c1f3-4634-9df8b320836b@bitmer.com>

[-- Attachment #1: Type: text/plain, Size: 2806 bytes --]

On Mon 02 January 2017 11:01:48 Jarkko Nikula wrote:
> Hi
> 
> On 01/02/2017 12:36 AM, Pavel Machek wrote:
> >> Jarkko, you are listed as original author of that driver. Do you (or
> >> anybody else) remember what that rx51_set_eci_switches() function is
> >> doing? And what gpio 178 controls? I was even not able to find gpio 178
> >> in RX-51 Schematics [6].
> >> 
> >> And do you know something about Nokia ECI headsets supports for Nokia
> >> N900. Looks like there is already some kernel code but support for ECI
> >> bus or multibuttons headset is missing.
> 
> Multibutton ECI headset support using GPIO was planned during early in
> HW design phase but wasn't implemented for the actual product. I don't
> remember was it due no actual product requirement for it or GPIO based
> implementation was not reliable. If I remember correctly ECI protocol
> carries information by shorting mic bias to ground at some 1 kHz rate so
> trying to detect those pulses by SW won't work too well without hard
> real-time OS.

I think it's perfectly feasible with an IRQ handler that detects inbound ECI 
data from edges on ECI0 pin (slightly out of spec for ECI, the Schmitt Trigger 
has threshold 0.5V, for ECI it ideally had 1.1V). The IRQ handler needs to 
push timestamps onto a stack for a worker thread to analyze and decode, and 
provide data to userland. Even an *occasional* glitch in data is not exactly a 
catastrophic failure, user can press same button again to make the intended 
action happen.
ECI data-send to be implemented via TVOUT_EN while TVOUT at 0. You could even 
lock IRQs during the short (only a few milliseconds) data bursts, to achieve 
accurate timing.

http://neo900.org/stuff/joerg/ECI/

cheers
jOERG


> 
> Even ECI is not implemented in final product the production HW still has
> two switches to route mic bias to voltage detection circuit, tv-out or
> codec. One of the switches is statically driven because only codec or
> tv-out route is needed. See commit 31164c7cf119 ("ASoC: omap: rx51: Add
> headset support")
> 
> > I'd like to get detection of headset button presses to work in recent
> > kernels, but could not figure it out :-(.
> 
> My vague memory doesn't tell how basic button press detection was
> implemented in Maemo kernel. Was it codec, same voltage detection
> circuit than ECI or some another GPIO? I don't even remember did we
> implement it for the MeeGo N900 developer edition :-(

-- 
()  ascii ribbon campaign
/\  
against html e-mail - against proprietary attachments
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2017-01-02 16:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01 19:54 Nokia N900 sound driver and ECI GPIOs Pali Rohár
2017-01-01 22:36 ` Pavel Machek
2017-01-02  8:34   ` Peter Ujfalusi
2017-01-02  8:51     ` Pali Rohár
2017-01-02 12:53       ` Peter Ujfalusi
2017-01-02 12:58         ` Pali Rohár
2017-01-02 14:36           ` Peter Ujfalusi
2017-01-02 15:51             ` joerg Reisenweber
2017-01-02 17:02             ` Pali Rohár
2017-01-02 15:45       ` joerg Reisenweber
2017-01-02  9:01   ` Jarkko Nikula
2017-01-02  9:29     ` Pali Rohár
2017-01-02  9:33     ` Pavel Machek
2017-01-02 16:07     ` joerg Reisenweber [this message]
2017-01-02  8:23 ` Peter Ujfalusi
2017-01-02  8:44   ` Pali Rohár
2017-01-02 18:49     ` Aaro Koskinen
2017-01-02 20:01       ` Pali Rohár
2017-01-02 21:05         ` joerg Reisenweber
2017-01-04 22:27           ` Aaro Koskinen
2017-01-04 22:41             ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18543398.ETO0VDvrVl@saturn \
    --to=joerg@openmoko.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=edubezval@gmail.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=peter.ujfalusi@ti.com \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).