> > Christoph, I don't think the approach you've chosen for part 2 will
> > work. Scenario: the last interrupt received before standby is pulse (I
> > am not even sure if this makes any difference, it can probably be space
> > just as well),
> It does not make any difference because pulse/space detection only
> relies on the current state of DCD, not the previous state.
Line 808: dcd=(status & hardware[type].signal_pin) ? 1:0;
It does rely on the previous state
> > then, after resume (which is very possible, even if the
> > box is being woken up by IR, by the time kernel is initialized and we
> > could process our interrupt, any IR activity will be gone), lasttv is
> > reset with gettimeofday, however, if no interrupt is received in the
> > next 15 seconds, the sense flag will still be flipped.
> If there is no activity the next 15 seconds, then the next signal
> received definitely is a space and must be recognized that way.
Then the next signal definitely is a _pulse_ of course, right? How can
you get a space when there was no activity?
> > Why do you insist on keeping that code, I just don't see under what
> > conditions it could be useful to "change our mind" on what type of
> > receiver is being used, especially if it was passed as module parameter.
> If this condition still occurs, then it shows that there still is a bug
> somewhere else or we do not understand what is really going on.
What about the simple case when this is configured as module parameter?
Why do we switch it in that case? In this driver, "sense" is not really
a variable, it's a configuration parameter, it should either be set as
module parameter, or autodetected during initialization, it's harmful to
try to change it later.
I've tested it, it fixed a real problem - I couldn't understand what was
going on until I saw inverted output from xmode2.
This autodetection code does not work properly in any case: once in that
"inverted" state, the driver would not easily revert back to normal
mode. If you insist on having "on-the-fly" autodetection, this is not
how it should be done. If that's your intention, let me know, I'll work