Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548911 > unrolled thread

Nokia N900 sound driver and ECI GPIOs

Started byPali Rohár <pali.rohar@gmail.com>
First post2017-01-01 21:00 +0100
Last post2017-01-02 22:10 +0100
Articles 19 — 6 participants

Back to article view | Back to linux.kernel


Contents

  Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-01 21:00 +0100
    Re: Nokia N900 sound driver and ECI GPIOs Pavel Machek <pavel@ucw.cz> - 2017-01-01 23:40 +0100
      Re: Nokia N900 sound driver and ECI GPIOs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2017-01-02 09:40 +0100
        Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 10:00 +0100
          Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 14:00 +0100
            Re: Nokia N900 sound driver and ECI GPIOs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2017-01-02 15:40 +0100
              Re: Nokia N900 sound driver and ECI GPIOs joerg Reisenweber <joerg@openmoko.org> - 2017-01-02 17:00 +0100
              Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 18:10 +0100
          Re: Nokia N900 sound driver and ECI GPIOs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2017-01-02 14:00 +0100
          Re: Nokia N900 sound driver and ECI GPIOs joerg Reisenweber <joerg@openmoko.org> - 2017-01-02 17:40 +0100
      Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 10:30 +0100
      Re: Nokia N900 sound driver and ECI GPIOs Jarkko Nikula <jarkko.nikula@bitmer.com> - 2017-01-02 10:40 +0100
        Re: Nokia N900 sound driver and ECI GPIOs Pavel Machek <pavel@ucw.cz> - 2017-01-02 10:40 +0100
        Re: Nokia N900 sound driver and ECI GPIOs joerg Reisenweber <joerg@openmoko.org> - 2017-01-02 17:10 +0100
    Re: Nokia N900 sound driver and ECI GPIOs Peter Ujfalusi <peter.ujfalusi@ti.com> - 2017-01-02 09:30 +0100
      Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 09:50 +0100
        Re: Nokia N900 sound driver and ECI GPIOs Aaro Koskinen <aaro.koskinen@iki.fi> - 2017-01-02 20:00 +0100
          Re: Nokia N900 sound driver and ECI GPIOs Pali Rohár <pali.rohar@gmail.com> - 2017-01-02 21:10 +0100
            Re: Nokia N900 sound driver and ECI GPIOs joerg Reisenweber <joerg@openmoko.org> - 2017-01-02 22:10 +0100

#1548911 — Nokia N900 sound driver and ECI GPIOs

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-01 21:00 +0100
SubjectNokia N900 sound driver and ECI GPIOs
Message-ID<sUUsq-4Ah-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi!

I'm looking at original Maemo N900 2.6.28 sound driver and GPIOs which
controls A/V jack detection.

For reference source code of that driver can be found e.g. at alsa-devel
ML [1] [2] or in my linux-n900 git tree, branch v2.6.28-nokia [3].

In that sound/soc/omap/rx51.c code is function rx51_set_eci_switches()
which configures 2 gpios: RX51_ECI_SWITCH_1_GPIO = gpio 178 and
RX51_ECI_SWITCH_2_GPIO = gpio 182 based on "eci mode" input parameter.

But in mainline kernel code [4] [5] there is no information about gpio 178
(as RX51_ECI_SWITCH_1_GPIO) and gpio 182 is called as just "eci-switch".
More interesting part is that "eci-switch" gpio is not used in whole
mainline code. It is just referenced in Nokia N900 DTS [4]. Looks like
sound driver in mainline kernel is incomplete.

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.

[1] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022033.html

[2] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022039.html

[3] - https://github.com/pali/linux-n900/blob/v2.6.28-nokia/sound/soc/omap/rx51.c

[4] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n900.dts#n128

[5] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/omap/rx51.c

[6] - https://wiki.maemo.org/N900_Hardware_Schematic

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [next] | [standalone]


#1548922

FromPavel Machek <pavel@ucw.cz>
Date2017-01-01 23:40 +0100
Message-ID<sUWXg-6gu-15@gated-at.bofh.it>
In reply to#1548911

[Multipart message — attachments visible in raw view] — view raw

Hi!

> I'm looking at original Maemo N900 2.6.28 sound driver and GPIOs which
> controls A/V jack detection.
> 
> For reference source code of that driver can be found e.g. at alsa-devel
> ML [1] [2] or in my linux-n900 git tree, branch v2.6.28-nokia [3].
> 
> In that sound/soc/omap/rx51.c code is function rx51_set_eci_switches()
> which configures 2 gpios: RX51_ECI_SWITCH_1_GPIO = gpio 178 and
> RX51_ECI_SWITCH_2_GPIO = gpio 182 based on "eci mode" input parameter.
> 
> But in mainline kernel code [4] [5] there is no information about gpio 178
> (as RX51_ECI_SWITCH_1_GPIO) and gpio 182 is called as just "eci-switch".
> More interesting part is that "eci-switch" gpio is not used in whole
> mainline code. It is just referenced in Nokia N900 DTS [4]. Looks like
> sound driver in mainline kernel is incomplete.
> 
> 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.

What does "ECI" mean?

I'd like to get detection of headset button presses to work in recent
kernels, but could not figure it out :-(.

Are there multi-button headsets compatible with N900?

Best regards,
									Pavel


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [prev] | [next] | [standalone]


#1549028

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2017-01-02 09:40 +0100
Message-ID<sV6jU-4bE-19@gated-at.bofh.it>
In reply to#1548922

On 01/02/2017 12:36 AM, Pavel Machek wrote:
> Hi!
> 
>> I'm looking at original Maemo N900 2.6.28 sound driver and GPIOs which
>> controls A/V jack detection.
>>
>> For reference source code of that driver can be found e.g. at alsa-devel
>> ML [1] [2] or in my linux-n900 git tree, branch v2.6.28-nokia [3].
>>
>> In that sound/soc/omap/rx51.c code is function rx51_set_eci_switches()
>> which configures 2 gpios: RX51_ECI_SWITCH_1_GPIO = gpio 178 and
>> RX51_ECI_SWITCH_2_GPIO = gpio 182 based on "eci mode" input parameter.
>>
>> But in mainline kernel code [4] [5] there is no information about gpio 178
>> (as RX51_ECI_SWITCH_1_GPIO) and gpio 182 is called as just "eci-switch".
>> More interesting part is that "eci-switch" gpio is not used in whole
>> mainline code. It is just referenced in Nokia N900 DTS [4]. Looks like
>> sound driver in mainline kernel is incomplete.
>>
>> 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.
> 
> What does "ECI" mean?

ECI = Enhancement Control Interface

apart from buttons (play/pause/skip forward/reverse, etc) the
accessories can contain memory to store parameters, like audio tuning
data, etc.

> 
> I'd like to get detection of headset button presses to work in recent
> kernels, but could not figure it out :-(.
> 
> Are there multi-button headsets compatible with N900?

Not sure if n900 is capable of handling ECI communication, n9 was. In n9
the PMIC/Audio chip had an ECI core integrated afaik


> Best regards,
> 									Pavel
> 
> 

-- 
Péter

[toc] | [prev] | [next] | [standalone]


#1549036

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 10:00 +0100
Message-ID<sV6Df-4iu-9@gated-at.bofh.it>
In reply to#1549028
On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
> On 01/02/2017 12:36 AM, Pavel Machek wrote:
> > Are there multi-button headsets compatible with N900?
> 
> Not sure if n900 is capable of handling ECI communication, n9 was. In n9
> the PMIC/Audio chip had an ECI core integrated afaik

In N9 it is handled by twl5030 chip? Is there documentation for that
ECI/ACI part? N900 has twl4030 so we need some chip documentation for
adding support for N900...

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549154

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 14:00 +0100
Message-ID<sVanv-6UV-17@gated-at.bofh.it>
In reply to#1549036
On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
> On 01/02/2017 10:51 AM, Pali Rohár wrote:
> > On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
> >> On 01/02/2017 12:36 AM, Pavel Machek wrote:
> >>> Are there multi-button headsets compatible with N900?
> >>
> >> Not sure if n900 is capable of handling ECI communication, n9 was. In n9
> >> the PMIC/Audio chip had an ECI core integrated afaik
> > 
> > In N9 it is handled by twl5030 chip? Is there documentation for that
> > ECI/ACI part? N900 has twl4030 so we need some chip documentation for
> > adding support for N900...
> 
> n9 has twl5031 and the documentation is not public. But the kernel
> source from Nokia have the driver under drivers/mfd/twl5031-aci.c It is
> using the ECI stack to report the changes.
> twl4030 and twl5030 does not have support for ECI, only twl5031.

Ok, so Nokia N900's audio chip (twl4030) does not have support for ECI.

But still as Jarkko wrote there could be an option to supports ECI via
GPIO and ADC.

And there is still mysterious gpio 178 (RX51_ECI_SWITCH_1_GPIO) which
could help us?

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549229

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2017-01-02 15:40 +0100
Message-ID<sVbWh-7ZQ-15@gated-at.bofh.it>
In reply to#1549154

On 01/02/2017 02:58 PM, Pali Rohár wrote:
> On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
>> On 01/02/2017 10:51 AM, Pali Rohár wrote:
>>> On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
>>>> On 01/02/2017 12:36 AM, Pavel Machek wrote:
>>>>> Are there multi-button headsets compatible with N900?
>>>>
>>>> Not sure if n900 is capable of handling ECI communication, n9 was. In n9
>>>> the PMIC/Audio chip had an ECI core integrated afaik
>>>
>>> In N9 it is handled by twl5030 chip? Is there documentation for that
>>> ECI/ACI part? N900 has twl4030 so we need some chip documentation for
>>> adding support for N900...
>>
>> n9 has twl5031 and the documentation is not public. But the kernel
>> source from Nokia have the driver under drivers/mfd/twl5031-aci.c It is
>> using the ECI stack to report the changes.
>> twl4030 and twl5030 does not have support for ECI, only twl5031.
> 
> Ok, so Nokia N900's audio chip (twl4030) does not have support for ECI.

TLV320AIC34 (two of them) on n900 to be precise, n9 uses twl5031 and
tlv320dac33.

> But still as Jarkko wrote there could be an option to supports ECI via
> GPIO and ADC.

Yes, there is the option, but w/o documentation on the ECI protocol it
is not going to be easy. And I'm sure there were a (good) reason the
n900 does not support ECI. If it could be done in a stable way the
product would have support for it.

> And there is still mysterious gpio 178 (RX51_ECI_SWITCH_1_GPIO) which
> could help us?

Yeah, that is something I have no idea what it is for. It could be that
the schema is using different pin mode for it? It might worth looking at
the TRM on which pin the gpio_178 can go out and look for the possible
modes? Most likely waste of time...

> 

-- 
Péter

[toc] | [prev] | [next] | [standalone]


#1549268

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2017-01-02 17:00 +0100
Message-ID<sVdbH-uc-9@gated-at.bofh.it>
In reply to#1549229

[Multipart message — attachments visible in raw view] — view raw

On Mon 02 January 2017 16:36:38 Peter Ujfalusi wrote:
> On 01/02/2017 02:58 PM, Pali Rohár wrote:
> > On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
> >> On 01/02/2017 10:51 AM, Pali Rohár wrote:
> >>> On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
> >>>> On 01/02/2017 12:36 AM, Pavel Machek wrote:
> >>>>> Are there multi-button headsets compatible with N900?
> >>>> 
> >>>> Not sure if n900 is capable of handling ECI communication, n9 was. In
> >>>> n9
> >>>> the PMIC/Audio chip had an ECI core integrated afaik
> >>> 
> >>> In N9 it is handled by twl5030 chip? Is there documentation for that
> >>> ECI/ACI part? N900 has twl4030 so we need some chip documentation for
> >>> adding support for N900...
> >> 
> >> n9 has twl5031 and the documentation is not public. But the kernel
> >> source from Nokia have the driver under drivers/mfd/twl5031-aci.c It is
> >> using the ECI stack to report the changes.
> >> twl4030 and twl5030 does not have support for ECI, only twl5031.
> > 
> > Ok, so Nokia N900's audio chip (twl4030) does not have support for ECI.
> 
> TLV320AIC34 (two of them) on n900 to be precise, n9 uses twl5031 and
> tlv320dac33.
> 
> > But still as Jarkko wrote there could be an option to supports ECI via
> > GPIO and ADC.
> 
> Yes, there is the option, but w/o documentation on the ECI protocol it
> is not going to be easy. And I'm sure there were a (good) reason the
> n900 does not support ECI. If it could be done in a stable way the
> product would have support for it.

Don't you think the missing docs and the missing support in N900 might have 
the same reason: copyright issues that forbid both in FOSS?

maybe my little investigation you find at http://neo900.org/stuff/joerg/ECI/ 
might help re protocol low level.

> 
> > And there is still mysterious gpio 178 (RX51_ECI_SWITCH_1_GPIO) which
> > could help us?
> 
> Yeah, that is something I have no idea what it is for. It could be that
> the schema is using different pin mode for it? It might worth looking at
> the TRM on which pin the gpio_178 can go out and look for the possible
> modes? Most likely waste of time...

We did this, the pin is mot listed in schematics under none of the possible 
names or pin number (AA3)
Looks to me like a R&D change done late, similar to the USB PHY.

jOERG
-- 
()  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)

[toc] | [prev] | [next] | [standalone]


#1549301

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 18:10 +0100
Message-ID<sVehr-1Fm-1@gated-at.bofh.it>
In reply to#1549229

[Multipart message — attachments visible in raw view] — view raw

On Monday 02 January 2017 15:36:38 Peter Ujfalusi wrote:
> On 01/02/2017 02:58 PM, Pali Rohár wrote:
> > On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
> >> On 01/02/2017 10:51 AM, Pali Rohár wrote:
> >>> On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
> >>>> On 01/02/2017 12:36 AM, Pavel Machek wrote:
> >>>>> Are there multi-button headsets compatible with N900?
> >>>> 
> >>>> Not sure if n900 is capable of handling ECI communication, n9
> >>>> was. In n9 the PMIC/Audio chip had an ECI core integrated afaik
> >>> 
> >>> In N9 it is handled by twl5030 chip? Is there documentation for
> >>> that ECI/ACI part? N900 has twl4030 so we need some chip
> >>> documentation for adding support for N900...
> >> 
> >> n9 has twl5031 and the documentation is not public. But the kernel
> >> source from Nokia have the driver under drivers/mfd/twl5031-aci.c
> >> It is using the ECI stack to report the changes.
> >> twl4030 and twl5030 does not have support for ECI, only twl5031.
> > 
> > Ok, so Nokia N900's audio chip (twl4030) does not have support for
> > ECI.
> 
> TLV320AIC34 (two of them) on n900 to be precise, n9 uses twl5031 and
> tlv320dac33.
> 
> > But still as Jarkko wrote there could be an option to supports ECI
> > via GPIO and ADC.
> 
> Yes, there is the option, but w/o documentation on the ECI protocol
> it is not going to be easy.

Is there documentation?

> And I'm sure there were a (good) reason the n900 does not support ECI.

What was that (good) reason? I would like to know it.

> If it could be done in a stable way the product would have support for it.

Hm... I would rather not to speak about decisions of product managers :-)
 
> > And there is still mysterious gpio 178 (RX51_ECI_SWITCH_1_GPIO)
> > which could help us?
> 
> Yeah, that is something I have no idea what it is for. It could be
> that the schema is using different pin mode for it? It might worth
> looking at the TRM on which pin the gpio_178 can go out and look for
> the possible modes? Most likely waste of time...

According to omap trm GPIO_178 is connected to mcspi2_clk. But
mcspi2_clk is missing in RX51 schematic too.

To verify that omap trm is correct: GPIO_177 (in omap trm) is connected
to mcspi1_cs3. And in RX51 schematic HEADPH_IND (gpio 177) is connected
to mcspi1_cs3. So looks like omap trm is correct there.

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549156

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2017-01-02 14:00 +0100
Message-ID<sVanv-6UV-19@gated-at.bofh.it>
In reply to#1549036

On 01/02/2017 10:51 AM, Pali Rohár wrote:
> On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
>> On 01/02/2017 12:36 AM, Pavel Machek wrote:
>>> Are there multi-button headsets compatible with N900?
>>
>> Not sure if n900 is capable of handling ECI communication, n9 was. In n9
>> the PMIC/Audio chip had an ECI core integrated afaik
> 
> In N9 it is handled by twl5030 chip? Is there documentation for that
> ECI/ACI part? N900 has twl4030 so we need some chip documentation for
> adding support for N900...

n9 has twl5031 and the documentation is not public. But the kernel
source from Nokia have the driver under drivers/mfd/twl5031-aci.c It is
using the ECI stack to report the changes.
twl4030 and twl5030 does not have support for ECI, only twl5031.


-- 
Péter

[toc] | [prev] | [next] | [standalone]


#1549283

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2017-01-02 17:40 +0100
Message-ID<sVdOp-19V-3@gated-at.bofh.it>
In reply to#1549036

[Multipart message — attachments visible in raw view] — view raw

On Mon 02 January 2017 09:51:50 Pali Rohár wrote:
> On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
> > On 01/02/2017 12:36 AM, Pavel Machek wrote:
> > > Are there multi-button headsets compatible with N900?
> > 
> > Not sure if n900 is capable of handling ECI communication, n9 was. In n9
> > the PMIC/Audio chip had an ECI core integrated afaik
> 
> In N9 it is handled by twl5030 chip? Is there documentation for that
> ECI/ACI part? N900 has twl4030 so we need some chip documentation for
> adding support for N900...

No, N9 has TPS65951, not TPS65950 aka TWL4030 as in N900, the ECI is one of 
the differences between the two chips afaik

jOERG
-- 
()  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)

[toc] | [prev] | [next] | [standalone]


#1549065

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 10:30 +0100
Message-ID<sV76h-4Jj-17@gated-at.bofh.it>
In reply to#1548922
On Monday 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.
> 
> 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 know about two gpio switches (TVOUT_EN and ECI_SWITCH=182). But
nothing about gpio 178, which looks like third switch. That statically
driven is gpio 182.

> > 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 :-(

In Maemo 2.6.28 kernel is detection of pressing one button headset. It
is implemented in nokia-av.c and rx51.c files.

I started porting that code to mainline kernel, but I stopped at that
unknown gpio 178.

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549070

FromJarkko Nikula <jarkko.nikula@bitmer.com>
Date2017-01-02 10:40 +0100
Message-ID<sV76h-4Jj-19@gated-at.bofh.it>
In reply to#1548922
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.

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 :-(

-- 
Jarkko

[toc] | [prev] | [next] | [standalone]


#1549071

FromPavel Machek <pavel@ucw.cz>
Date2017-01-02 10:40 +0100
Message-ID<sV7fY-4MF-19@gated-at.bofh.it>
In reply to#1549070

[Multipart message — attachments visible in raw view] — view raw

Hi!

> > 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 :-(

Another GPIO, as far as I can tell. There was some delay logic in 2.6
kernel (it removed false events happening when jack was inserted),
other that that it should be quite simple. (But I did not yet figure
it out in 4.x kernel).

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [prev] | [next] | [standalone]


#1549274

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2017-01-02 17:10 +0100
Message-ID<sVdlo-MV-23@gated-at.bofh.it>
In reply to#1549070

[Multipart message — attachments visible in raw view] — view raw

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)

[toc] | [prev] | [next] | [standalone]


#1549017

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2017-01-02 09:30 +0100
Message-ID<sV6ae-48p-7@gated-at.bofh.it>
In reply to#1548911
Hi,

On 01/01/2017 09:54 PM, Pali Rohár wrote:
> Hi!
> 
> I'm looking at original Maemo N900 2.6.28 sound driver and GPIOs which
> controls A/V jack detection.
> 
> For reference source code of that driver can be found e.g. at alsa-devel
> ML [1] [2] or in my linux-n900 git tree, branch v2.6.28-nokia [3].
> 
> In that sound/soc/omap/rx51.c code is function rx51_set_eci_switches()
> which configures 2 gpios: RX51_ECI_SWITCH_1_GPIO = gpio 178 and
> RX51_ECI_SWITCH_2_GPIO = gpio 182 based on "eci mode" input parameter.
> 
> But in mainline kernel code [4] [5] there is no information about gpio 178
> (as RX51_ECI_SWITCH_1_GPIO) and gpio 182 is called as just "eci-switch".
> More interesting part is that "eci-switch" gpio is not used in whole
> mainline code. It is just referenced in Nokia N900 DTS [4]. Looks like
> sound driver in mainline kernel is incomplete.
> 
> 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].

GPIO_182 is to select where to route the MIC line from the jack for the
ECI core to handle (when the TVOUT is disabled). I have no idea what the
gpio_178 should have been used for. It might be only needed for early
protos but not in production devices?

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

Not sure if n900 had full support for ECI, afaik n9 did supported it.
The ECI input driver was sent upstream, but can not recall the reason
why it is not in mainline:

https://patchwork.kernel.org/patch/450811/

> 
> [1] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022033.html
> 
> [2] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022039.html
> 
> [3] - https://github.com/pali/linux-n900/blob/v2.6.28-nokia/sound/soc/omap/rx51.c
> 
> [4] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n900.dts#n128
> 
> [5] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/omap/rx51.c
> 
> [6] - https://wiki.maemo.org/N900_Hardware_Schematic
> 

-- 
Péter

[toc] | [prev] | [next] | [standalone]


#1549032

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 09:50 +0100
Message-ID<sV6tz-4f8-11@gated-at.bofh.it>
In reply to#1549017
On Monday 02 January 2017 10:23:23 Peter Ujfalusi wrote:
> Hi,
> 
> On 01/01/2017 09:54 PM, Pali Rohár wrote:
> > Hi!
> > 
> > I'm looking at original Maemo N900 2.6.28 sound driver and GPIOs which
> > controls A/V jack detection.
> > 
> > For reference source code of that driver can be found e.g. at alsa-devel
> > ML [1] [2] or in my linux-n900 git tree, branch v2.6.28-nokia [3].
> > 
> > In that sound/soc/omap/rx51.c code is function rx51_set_eci_switches()
> > which configures 2 gpios: RX51_ECI_SWITCH_1_GPIO = gpio 178 and
> > RX51_ECI_SWITCH_2_GPIO = gpio 182 based on "eci mode" input parameter.
> > 
> > But in mainline kernel code [4] [5] there is no information about gpio 178
> > (as RX51_ECI_SWITCH_1_GPIO) and gpio 182 is called as just "eci-switch".
> > More interesting part is that "eci-switch" gpio is not used in whole
> > mainline code. It is just referenced in Nokia N900 DTS [4]. Looks like
> > sound driver in mainline kernel is incomplete.
> > 
> > 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].
> 
> GPIO_182 is to select where to route the MIC line from the jack for the
> ECI core to handle (when the TVOUT is disabled).

Yes, already figured out from schematic.

> I have no idea what the
> gpio_178 should have been used for. It might be only needed for early
> protos but not in production devices?

I do not know, reason why I'm asking.

> > 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.
> 
> Not sure if n900 had full support for ECI, afaik n9 did supported it.
> The ECI input driver was sent upstream, but can not recall the reason
> why it is not in mainline:
> 
> https://patchwork.kernel.org/patch/450811/

That driver is just kernel input glue for some unknown (audio?) chip.
Nothing useful for Nokia N900. To work it is needed another driver which
fill data to that input one.

> > 
> > [1] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022033.html
> > 
> > [2] - http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022039.html
> > 
> > [3] - https://github.com/pali/linux-n900/blob/v2.6.28-nokia/sound/soc/omap/rx51.c
> > 
> > [4] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap3-n900.dts#n128
> > 
> > [5] - https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/omap/rx51.c
> > 
> > [6] - https://wiki.maemo.org/N900_Hardware_Schematic
> > 
> 

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549359

FromAaro Koskinen <aaro.koskinen@iki.fi>
Date2017-01-02 20:00 +0100
Message-ID<sVfZT-2Eg-1@gated-at.bofh.it>
In reply to#1549032
Hi,

On Mon, Jan 02, 2017 at 09:44:32AM +0100, Pali Rohár wrote:
> On Monday 02 January 2017 10:23:23 Peter Ujfalusi wrote:
> > GPIO_182 is to select where to route the MIC line from the jack for the
> > ECI core to handle (when the TVOUT is disabled).
> 
> Yes, already figured out from schematic.
> 
> > I have no idea what the
> > gpio_178 should have been used for. It might be only needed for early
> > protos but not in production devices?
> 
> I do not know, reason why I'm asking.

The schematic shows ECI(5:0), but only 3 are connected/used. There were
3 other GPIOs reserved but not used in the final product.

A.

[toc] | [prev] | [next] | [standalone]


#1549380

FromPali Rohár <pali.rohar@gmail.com>
Date2017-01-02 21:10 +0100
Message-ID<sVh5E-3K3-11@gated-at.bofh.it>
In reply to#1549359

[Multipart message — attachments visible in raw view] — view raw

On Monday 02 January 2017 19:49:45 Aaro Koskinen wrote:
> Hi,
> 
> On Mon, Jan 02, 2017 at 09:44:32AM +0100, Pali Rohár wrote:
> > On Monday 02 January 2017 10:23:23 Peter Ujfalusi wrote:
> > > GPIO_182 is to select where to route the MIC line from the jack
> > > for the ECI core to handle (when the TVOUT is disabled).
> > 
> > Yes, already figured out from schematic.
> > 
> > > I have no idea what the
> > > gpio_178 should have been used for. It might be only needed for
> > > early protos but not in production devices?
> > 
> > I do not know, reason why I'm asking.
> 
> The schematic shows ECI(5:0), but only 3 are connected/used. There
> were 3 other GPIOs reserved but not used in the final product.

Are you sure that this is truth (maybe you have some information)? Or 
you just looked at schematic and deduced this observation (as other 
people too)?

Joerg already told us that RX51 schematic does not 100% match production 
N900 and e.g. there is missing UART3 pins...

What we know that gpio 178 is *already* controlled and changed by 
production Nokia kernel running on production N900 devices (as I wrote 
in first email).

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1549394

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2017-01-02 22:10 +0100
Message-ID<sVi1I-4ma-19@gated-at.bofh.it>
In reply to#1549380

[Multipart message — attachments visible in raw view] — view raw

On Mon 02 January 2017 21:01:01 Pali Rohár wrote:
> On Monday 02 January 2017 19:49:45 Aaro Koskinen wrote:
> > The schematic shows ECI(5:0), but only 3 are connected/used. There
> > were 3 other GPIOs reserved but not used in the final product.
> 
> Are you sure that this is truth (maybe you have some information)? Or
> you just looked at schematic and deduced this observation (as other
> people too)?
> 
> Joerg already told us that RX51 schematic does not 100% match production
> N900 and e.g. there is missing UART3 pins...

We found this, see https://irclog.whitequark.org/neo900/2017-01-01 (has a lot 
of possibly useful references/links)
The question is if pin AA3 aka GPIO_178 is actually NotConnected in N900 or 
it's just an omission in schematics and there's actually some more 'stealth 
hardware' in N900 that doesn't show up in docs, just like the testpoint UART 
console http://wiki.maemo.org/N900_Hardware_Hacking#Debug_ports which also are 
missing in schematics.


> What we know that gpio 178 is *already* controlled and changed by
> production Nokia kernel running on production N900 devices (as I wrote
> in first email).

I could use one of the unpopulated N900 PCB and solder a wire to the OMAP AA3 
pad, then try to make sure it's not connected to anything, or if it is then 
find out about the details of this.
But I'm reluctant to do this, since it's an error prone and (in case of N/C) 
not verifiable procedure, so I'd appreciate any further info, whether from 
historical anecdote or from sourcecode review and conclusions, regarding that.

cheers
jOERG
-- 
()  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)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web