linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Nokia N900 sound driver and ECI GPIOs
@ 2017-01-01 19:54 Pali Rohár
  2017-01-01 22:36 ` Pavel Machek
  2017-01-02  8:23 ` Peter Ujfalusi
  0 siblings, 2 replies; 21+ messages in thread
From: Pali Rohár @ 2017-01-01 19:54 UTC (permalink / raw)
  To: Jarkko Nikula, Tony Lindgren, Peter Ujfalusi, Eduardo Valentin
  Cc: Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov,
	joerg Reisenweber, linux-omap, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1806 bytes --]

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

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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  9:01   ` Jarkko Nikula
  2017-01-02  8:23 ` Peter Ujfalusi
  1 sibling, 2 replies; 21+ messages in thread
From: Pavel Machek @ 2017-01-01 22:36 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jarkko Nikula, Tony Lindgren, Peter Ujfalusi, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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:23 ` Peter Ujfalusi
  2017-01-02  8:44   ` Pali Rohár
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Ujfalusi @ 2017-01-02  8:23 UTC (permalink / raw)
  To: Pali Rohár, Jarkko Nikula, Tony Lindgren, Eduardo Valentin
  Cc: Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov,
	joerg Reisenweber, linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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  9:01   ` Jarkko Nikula
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Ujfalusi @ 2017-01-02  8:34 UTC (permalink / raw)
  To: Pavel Machek, Pali Rohár
  Cc: Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel



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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02  8:23 ` Peter Ujfalusi
@ 2017-01-02  8:44   ` Pali Rohár
  2017-01-02 18:49     ` Aaro Koskinen
  0 siblings, 1 reply; 21+ messages in thread
From: Pali Rohár @ 2017-01-02  8:44 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov,
	joerg Reisenweber, linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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 15:45       ` joerg Reisenweber
  0 siblings, 2 replies; 21+ messages in thread
From: Pali Rohár @ 2017-01-02  8:51 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-01 22:36 ` Pavel Machek
  2017-01-02  8:34   ` Peter Ujfalusi
@ 2017-01-02  9:01   ` Jarkko Nikula
  2017-01-02  9:29     ` Pali Rohár
                       ` (2 more replies)
  1 sibling, 3 replies; 21+ messages in thread
From: Jarkko Nikula @ 2017-01-02  9:01 UTC (permalink / raw)
  To: Pavel Machek, Pali Rohár
  Cc: Tony Lindgren, Peter Ujfalusi, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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
  2 siblings, 0 replies; 21+ messages in thread
From: Pali Rohár @ 2017-01-02  9:29 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Pavel Machek, Tony Lindgren, Peter Ujfalusi, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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
  2 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-01-02  9:33 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Pali Rohár, Tony Lindgren, Peter Ujfalusi, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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 15:45       ` joerg Reisenweber
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Ujfalusi @ 2017-01-02 12:53 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel



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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 12:53       ` Peter Ujfalusi
@ 2017-01-02 12:58         ` Pali Rohár
  2017-01-02 14:36           ` Peter Ujfalusi
  0 siblings, 1 reply; 21+ messages in thread
From: Pali Rohár @ 2017-01-02 12:58 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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
  0 siblings, 2 replies; 21+ messages in thread
From: Peter Ujfalusi @ 2017-01-02 14:36 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel



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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02  8:51     ` Pali Rohár
  2017-01-02 12:53       ` Peter Ujfalusi
@ 2017-01-02 15:45       ` joerg Reisenweber
  1 sibling, 0 replies; 21+ messages in thread
From: joerg Reisenweber @ 2017-01-02 15:45 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Peter Ujfalusi, Pavel Machek, Jarkko Nikula, Tony Lindgren,
	Eduardo Valentin, Lars-Peter Clausen, Aaro Koskinen,
	Nishanth Menon, Sebastian Reichel, Ivaylo Dimitrov, linux-omap,
	linux-kernel

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

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)

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 14:36           ` Peter Ujfalusi
@ 2017-01-02 15:51             ` joerg Reisenweber
  2017-01-02 17:02             ` Pali Rohár
  1 sibling, 0 replies; 21+ messages in thread
From: joerg Reisenweber @ 2017-01-02 15:51 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Pali Rohár, Pavel Machek, Jarkko Nikula, Tony Lindgren,
	Eduardo Valentin, Lars-Peter Clausen, Aaro Koskinen,
	Nishanth Menon, Sebastian Reichel, Ivaylo Dimitrov, linux-omap,
	linux-kernel

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

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)

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  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
  2 siblings, 0 replies; 21+ messages in thread
From: joerg Reisenweber @ 2017-01-02 16:07 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Pavel Machek, Pali Rohár, Tony Lindgren, Peter Ujfalusi,
	Eduardo Valentin, Lars-Peter Clausen, Aaro Koskinen,
	Nishanth Menon, Sebastian Reichel, Ivaylo Dimitrov, linux-omap,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 14:36           ` Peter Ujfalusi
  2017-01-02 15:51             ` joerg Reisenweber
@ 2017-01-02 17:02             ` Pali Rohár
  1 sibling, 0 replies; 21+ messages in thread
From: Pali Rohár @ 2017-01-02 17:02 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Aaro Koskinen, Nishanth Menon,
	Sebastian Reichel, Ivaylo Dimitrov, joerg Reisenweber,
	linux-omap, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 2445 bytes --]

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

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02  8:44   ` Pali Rohár
@ 2017-01-02 18:49     ` Aaro Koskinen
  2017-01-02 20:01       ` Pali Rohár
  0 siblings, 1 reply; 21+ messages in thread
From: Aaro Koskinen @ 2017-01-02 18:49 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Peter Ujfalusi, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Nishanth Menon, Sebastian Reichel,
	Pavel Machek, Ivaylo Dimitrov, joerg Reisenweber, linux-omap,
	linux-kernel

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.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 18:49     ` Aaro Koskinen
@ 2017-01-02 20:01       ` Pali Rohár
  2017-01-02 21:05         ` joerg Reisenweber
  0 siblings, 1 reply; 21+ messages in thread
From: Pali Rohár @ 2017-01-02 20:01 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Peter Ujfalusi, Jarkko Nikula, Tony Lindgren, Eduardo Valentin,
	Lars-Peter Clausen, Nishanth Menon, Sebastian Reichel,
	Pavel Machek, Ivaylo Dimitrov, joerg Reisenweber, linux-omap,
	linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1213 bytes --]

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

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 20:01       ` Pali Rohár
@ 2017-01-02 21:05         ` joerg Reisenweber
  2017-01-04 22:27           ` Aaro Koskinen
  0 siblings, 1 reply; 21+ messages in thread
From: joerg Reisenweber @ 2017-01-02 21:05 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Aaro Koskinen, Peter Ujfalusi, Jarkko Nikula, Tony Lindgren,
	Eduardo Valentin, Lars-Peter Clausen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov, linux-omap,
	linux-kernel

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

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)

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-02 21:05         ` joerg Reisenweber
@ 2017-01-04 22:27           ` Aaro Koskinen
  2017-01-04 22:41             ` Pali Rohár
  0 siblings, 1 reply; 21+ messages in thread
From: Aaro Koskinen @ 2017-01-04 22:27 UTC (permalink / raw)
  To: joerg Reisenweber
  Cc: Pali Rohár, Peter Ujfalusi, Jarkko Nikula, Tony Lindgren,
	Eduardo Valentin, Lars-Peter Clausen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov, linux-omap,
	linux-kernel

Hi,

On Mon, Jan 02, 2017 at 10:05:39PM +0100, joerg Reisenweber wrote:
> 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.

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.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Nokia N900 sound driver and ECI GPIOs
  2017-01-04 22:27           ` Aaro Koskinen
@ 2017-01-04 22:41             ` Pali Rohár
  0 siblings, 0 replies; 21+ messages in thread
From: Pali Rohár @ 2017-01-04 22:41 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: joerg Reisenweber, Peter Ujfalusi, Jarkko Nikula, Tony Lindgren,
	Eduardo Valentin, Lars-Peter Clausen, Nishanth Menon,
	Sebastian Reichel, Pavel Machek, Ivaylo Dimitrov, linux-omap,
	linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 3042 bytes --]

On Wednesday 04 January 2017 23:27:49 Aaro Koskinen wrote:
> Hi,
> 
> On Mon, Jan 02, 2017 at 10:05:39PM +0100, joerg Reisenweber wrote:
> > 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.
> 
> 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...

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

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

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-01-04 22:41 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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