Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#43364 - 22/10/2001 23:07 Car sense in the kernel...
kimbotha
member

Registered: 30/08/2000
Posts: 157
Loc: London, UK
Hi,

my paper clip fix is getting annoying... and I trust my coding skills better than my soldering skills on something as complex and precious as my empeg...

I have been looking at arch/arm/special/empeg_power.c and I am wondering if there is a way of sensing the presence of the tuner module from within the kernel...? I am looking for something like EMPEG_EXTPOWER but for the tuner module...

Cheers

Kim


Top
#43365 - 29/10/2001 04:58 Re: Car sense in the kernel... [Re: kimbotha]
kimbotha
member

Registered: 30/08/2000
Posts: 157
Loc: London, UK
Still looking for some information on a way the kernel could detect the presence of the tuner...

it detects the lights via GPIO_GPIO22 (EMPEG_SERIALCTS), the external mute is detected via GPIO_GPIO27 (EMPEG_SERIALDCD)...

could the tuner be detected via GPIO_GPIO21 (EMPEG_SERIALDSR) ?

I will probably just build a kernel with a hack to test it later this week... but it would be nice to have some real info from someone who actually knows a way to detect the presence of the tuner from within the kernel...

Cheers

Kim

Top
#43366 - 29/10/2001 11:35 Re: Car sense in the kernel... [Re: kimbotha]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
No, the tuner is detected by sending it a packet and getting a reply. There are no control lines going to the tuner.

Hugo

Top
#43367 - 06/11/2001 08:39 Re: Car sense in the kernel... [Re: altman]
kimbotha
member

Registered: 30/08/2000
Posts: 157
Loc: London, UK
Any chance of getting a small snippet of code that could detect the presence of the tuner from user space...?

I could then detect the presence of the tuner in my custom init and call an ioctl to tell the kernel it is in the car before the player starts and blows my ears away...

Cheers

Kim

Top
#43368 - 06/11/2001 10:15 Re: Car sense in the kernel... [Re: kimbotha]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
No chance of any code, really - it's quite nasty doing it properly from kernel.

You need to send it 0x01 0x00 0x01 (enumerate command, turn led on - change the last byte to 0x00 to turn the LED off) and you should get a reply of 0x01 0x00 0x03 0x03 (soh, command echo, tuner_id of 3, checksum). It's 19200, 8, none, 1.

Hugo

Top
#43369 - 06/11/2001 10:49 Re: Car sense in the kernel... [Re: altman]
kimbotha
member

Registered: 30/08/2000
Posts: 157
Loc: London, UK
Thanks... that should be all I need to be able to write a small program to run from init before calling the player... It would have been nice to have the kernel be able to test for it directly as it would save having to have a custom init if this is the only fix needed... but as I personally intend on having a customised init anyway I will work on having it work from there...

I assume the player software uses /proc/empeg_power to work out whether it is in car or not, so if I can tell the kernel to override what it senses with an ioctl or such like then I should be able to get /proc/empeg_power looking correct and the player software should be none the wiser...

Many thanks for the info

Cheers

Kim

Top