Skip to contentSkip to conversation

Nokia N900 sound driver and ECI GPIOs

DISCUSSION Pali Rohár 6 participants 21 messages Jan 1, 2017 – Jan 4, 2017

lore
Share & tools
lore
#0 lore 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

Signature · 2 lines
Pali Rohár
[email protected]
#1 lore raw

Hi!

Quoted 16 lines

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.

Quoted 8 lines

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

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
Quoted 23 lines · Pavel Machek

Hi!

Quoted 21 lines

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

Quoted 5 lines
Quoted 3 lines

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.

Quoted 5 lines

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

Quoted 4 lines

Best regards,
Pavel

Signature · 1 line
Péter
#3 lore raw
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Signature · 2 lines
Pali Rohár
[email protected]
#4 lore raw
Quoted 10 lines · Pali Rohár
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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.

Signature · 1 line
Péter
#5 lore raw
Quoted 8 lines · On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
Quoted 7 lines · Pali Rohár
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Quoted 8 lines
Quoted 3 lines

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?

Signature · 2 lines
Pali Rohár
[email protected]
#6 lore raw
Quoted 13 lines · Pali Rohár
Quoted 12 lines · On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
Quoted 10 lines · Pali Rohár
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Quoted 6 lines
Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 2 lines

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

Quoted 1 line
Signature · 1 line
Péter
#7 lore raw
Quoted 25 lines · On Mon 02 January 2017 16:36:38 Peter Ujfalusi wrote:
Quoted 14 lines · Pali Rohár
Quoted 13 lines · On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
Quoted 11 lines · Pali Rohár
Quoted 6 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Quoted 6 lines
Quoted 4 lines

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.

Quoted 7 lines
Quoted 2 lines

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.

Quoted 8 lines
Quoted 3 lines

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

Signature · 7 lines
()  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)
#8 lore raw
In reply to Peter Ujfalusi
Quoted 22 lines · On Monday 02 January 2017 15:36:38 Peter Ujfalusi wrote:
Quoted 13 lines · Pali Rohár
Quoted 12 lines · On Monday 02 January 2017 14:53:44 Peter Ujfalusi wrote:
Quoted 10 lines · Pali Rohár
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Quoted 7 lines
Quoted 4 lines

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.

Quoted 8 lines

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

Quoted 2 lines

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?

Quoted 1 line

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.

Quoted 1 line

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

Quoted 7 lines
Quoted 2 lines

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.

Signature · 2 lines
Pali Rohár
[email protected]
#9 lore raw
In reply to Pali Rohár
Quoted 10 lines · On Mon 02 January 2017 09:51:50 Pali Rohár wrote:
Quoted 5 lines · On Monday 02 January 2017 10:34:34 Peter Ujfalusi wrote:
Quoted 1 line · Pavel Machek

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

Signature · 7 lines
()  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)
#10 lore raw
In reply to Pavel Machek

Hi

Quoted 9 lines · Pavel Machek
Quoted 8 lines

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")

Quoted 3 lines

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

Signature · 1 line
Jarkko
#11 lore raw
Quoted 20 lines · On Monday 02 January 2017 11:01:48 Jarkko Nikula wrote:

Hi

Quoted 9 lines · Pavel Machek
Quoted 8 lines

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.

Quoted 5 lines

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.

Quoted 7 lines
Quoted 3 lines

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.

Signature · 2 lines
Pali Rohár
[email protected]
#12 lore raw
In reply to Jarkko Nikula

Hi!

Quoted 7 lines
Quoted 3 lines

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

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#13 lore raw
In reply to Jarkko Nikula
Quoted 12 lines · On Mon 02 January 2017 11:01:48 Jarkko Nikula wrote:

Hi

Quoted 8 lines · Pavel Machek
Quoted 8 lines

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.

Quoted 7 lines

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

Quoted 14 lines

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")

Quoted 2 lines

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

Signature · 7 lines
()  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)
#14 lore raw
In reply to Pali Rohár

Hi,

Quoted 18 lines · Pali Rohár

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.

Quoted 4 lines

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?

Quoted 3 lines

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/

Quoted 13 lines

[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

Signature · 1 line
Péter
#15 lore raw
Quoted 21 lines · On Monday 02 January 2017 10:23:23 Peter Ujfalusi wrote:

Hi,

Quoted 18 lines · Pali Rohár

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.

Quoted 7 lines
Quoted 4 lines

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.

Quoted 3 lines

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.

Quoted 9 lines
Quoted 3 lines

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.

Quoted 14 lines
Quoted 13 lines

[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

Signature · 2 lines
Pali Rohár
[email protected]
#16 lore raw

Hi,

Quoted 11 lines · Pali Rohár
Quoted 2 lines · 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.

Quoted 3 lines

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.

#17 lore raw
Quoted 9 lines · On Monday 02 January 2017 19:49:45 Aaro Koskinen wrote:

Hi,

Quoted 6 lines · Pali Rohár
Quoted 2 lines · 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.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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

Signature · 2 lines
Pali Rohár
[email protected]
#18 lore raw
Quoted 10 lines · On Mon 02 January 2017 21:01:01 Pali Rohár wrote:
Quoted 2 lines · 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.

Quoted 3 lines

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

Signature · 7 lines
()  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)
#19 lore raw

Hi,

Quoted 25 lines · joerg Reisenweber
Quoted 10 lines · On Mon 02 January 2017 21:01:01 Pali Rohár wrote:
Quoted 2 lines · 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.

Quoted 3 lines

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

Quoted 6 lines

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.

Even if the published production kernel source controls GPIO 178, it does not mean the production device has it connected, as the same kernel also supported many older in-house prototype versions of the hardware (and some of those had it connected).

Probably the easiest test would be to take the final published source, and then comment out all the GPIO 178 related code and build and run the kernel on the production device. Then see if you can observe any difference in behaviour.

A.

#20 lore raw
Quoted 37 lines · On Wednesday 04 January 2017 23:27:49 Aaro Koskinen wrote:

Hi,

Quoted 26 lines · joerg Reisenweber
Quoted 11 lines · On Mon 02 January 2017 21:01:01 Pali Rohár wrote:
Quoted 3 lines · 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.

Quoted 3 lines

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

Quoted 7 lines

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.

Quoted 4 lines

Even if the published production kernel source controls GPIO 178, it does not mean the production device has it connected, as the same kernel also supported many older in-house prototype versions of the hardware (and some of those had it connected).

Yes, seems reasonable. Also in production kernel source there is on some places check for prototype hw revision and acts differently...

Quoted 4 lines

Probably the easiest test would be to take the final published source, and then comment out all the GPIO 178 related code and build and run the kernel on the production device. Then see if you can observe any difference in behaviour.

Current mainline kernel does not control GPIO 178, so looks like audio somehow working... Jarkko sent driver to mainline so I asked in this thread if does not know something... But A/V cable detection is not in mainline (yet).

We can do that test to verify if production Maemo system is working as before. But result "nothing visible" does not prove that GPIO does not control anything. With this test we can just prove if system stops working as before.

Signature · 2 lines
Pali Rohár
[email protected]