|
From: Jarod W. <ja...@wi...> - 2011-02-28 22:19:13
|
On Feb 28, 2011, at 6:29 AM, Dave Treacy wrote: ... > Hi Jarod / all > > Short story: So I've got it working. Changed CIR_WAKE_FIFO_LEN to 65 > in nuvoton-cir.h Rock. > Long story: > I've been poking about in the code for a week or so now, without any > luck - until last night. I've compiled a copy of openelec.tv for my > asrock minus the nuvoton-cir module so I could compile the module > separately for testing. > While putting everything back in the lounge room (so that everything > is working for the morning), I accidentally booted this custom > openelec. So naturally I shut it down & removed the media. Then for > some reason I hit the power button on the remote. Now I'm not sure > why I did that - It was late. But it booted. > > So tonight, I commented out all instances of > nvt_cir_wake_regs_init(nvt), and nvt_enable_wake(nvt) and it works. > Perfectly. Powers on and resumes from suspend perfectly. After > thinking about it, it makes sense, you want your gear to power on > after a power outage! > > so I ran the module working and not working with debugging enabled and > the differences are: > > Working: > nuvoton_cir: * IRSTS: 0x41 > nuvoton_cir: * FIFO CMP DEEP: 0x41 > nuvoton_cir: * RD FIFO ONLY: 0x89 > nuvoton_cir: * RD FIFO ONLY IDX: 0x7 > > not working: > nuvoton_cir: * IRSTS: 0x1 > nuvoton_cir: * FIFO CMP DEEP: 0x43 > nuvoton_cir: * RD FIFO ONLY: 0x11 > nuvoton_cir: * RD FIFO ONLY IDX: 0x8 > > I found some references to 0x41 in the nuvoton lirc code, and saw that > they are setting the FIFO CMP DEEP register to 65 (0x41) instead of 67 > (0x43). > > Changed CIR_WAKE_FIFO_LEN to 65 in nuvoton-cir.h, removed comments, > complied and its all working again! Crap, not sure how I missed that. The spec sheet has 67 as the default value, but clearly, the lirc driver was using 65. Good catch! > Not sure why IRSTS is also set to > 0x41, doesn't seem to matter. Mostly unrelated, those are the currently triggered IRQ flags. > Sorry for the long story :) Jarod, I hope this helps - at least its > removed 1 thing off your seemingly infinite TODO list! Yes, very very helpful, thank you. :) > I've also no > idea how to get this fix into/onto/patch/svn/git etc or anything. :) I've got a patch together in my local git tree that I'll send along to Mauro shortly, might still make 2.6.38. If not, it'll go into 2.6.39, and 2.6.38.1. -- Jarod Wilson ja...@wi... |