Rockbox

Tasklist

FS#11120 - Use AS3514_IRQ_ENRD0 for usb detection on ams sansas

Attached to Project: Rockbox
Opened by Tobias Diedrich (ranma) - Wednesday, 17 March 2010, 16:48 GMT
Last edited by Tobias Diedrich (ranma) - Tuesday, 23 March 2010, 09:08 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To Tobias Diedrich (ranma)
Operating System Sansa c200
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Since I can't find a gpio for usb detection on my C200v2 variant, use as3514 irq_enrd0 usb status bit instead, which should work across all models.
Tested on my C200v2, needs testing on all other AMS based models.
This task depends upon

Closed by  Tobias Diedrich (ranma)
Tuesday, 23 March 2010, 09:08 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed by  FS#11131 
Comment by Thomas Martitz (kugel.) - Wednesday, 17 March 2010, 18:12 GMT
Why a thread, and not for example a tick task?
Comment by Tobias Diedrich (ranma) - Wednesday, 17 March 2010, 18:34 GMT
A tick task doesn't work since ascodec_read takes a lock.
Comment by Thomas Martitz (kugel.) - Wednesday, 17 March 2010, 18:37 GMT
Ah yes. Makes sense then. The stack size is probably a bit bigger than needed.

Does this also fix the problem that plain wall charger trigger the usb detection?
Comment by Rafaël Carré (funman) - Wednesday, 17 March 2010, 19:08 GMT
do the linux patches give some clue on how to use interrupts with i2c ?

that would remove the need for a thread, though if this patch works then it should be committed and if a cleaner (smaller) solution is found later it would be better.
Comment by Tobias Diedrich (ranma) - Wednesday, 17 March 2010, 19:17 GMT
Alternatively, if there is a function to check wether the lock is already taken or not, and only run the read if the ascodec is not locked.
The not so nice thing about that is that ascodec_read is much slower than a gpio read anyway, so calling it 100 times a second from tick might be not be the best thing either.
Comment by Thomas Martitz (kugel.) - Wednesday, 17 March 2010, 19:43 GMT
I see a sleep(HZ/10) which would be 10 times a second, we can live with that :)

Didn't bertrik work in i2c interrupts once?
Comment by Tobias Diedrich (ranma) - Thursday, 18 March 2010, 03:22 GMT
> Does this also fix the problem that plain wall charger trigger the usb detection?

Likely not, I was hoping so since the bit is called usb status, but if I put tape on the data pins it still gets detected that way.

Loading...