Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lirc_rpi module, possible bug in kernel > 3.6 #525

Closed
koromar opened this issue Feb 6, 2014 · 69 comments
Closed

lirc_rpi module, possible bug in kernel > 3.6 #525

koromar opened this issue Feb 6, 2014 · 69 comments

Comments

@koromar
Copy link

koromar commented Feb 6, 2014

Affected versions:
commit hashes newer than #8234d5148aded657760e9ecd622f324d140ae891

Details:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=62063

Sums it up best:
"by GeofP » Sun Feb 02, 2014 9:50 pm
...
My /etc/lirc/lircd.conf includes the following parameters:

........ pulse space

header 9590 4730
one 630 1755
zero 630 560
frequency was not defined but the default is 38KHz

The software version of the re-installed software is as follows:
Linux Geof-Pi-1 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013 armv6l GNU/Linux

Measurements on the storage oscilloscope were as follows:
Header pulse = 9.7ms
frequency = 38KHz
These measurements show the timing for lirc is now correct.

Before the install of the mrgrey software version, my version was:
Linux Geof-Pi-1 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux

Measurements on the storage oscilloscope were as follows:
Header pulse = 8.2ms
frequency = 45KHz
These measurements show the timing for lirc is wrong. ..."

@GeofP
Copy link

GeofP commented Feb 6, 2014

I have checked the lirc timing problem on a number of versions of software.
These produce the correct timing: versions 3.6.11+ #363 through to 3.6.11+ #557 (the last in the 3.6.xx series I could find)
These produce the wrong timing: versions 3.10.13+ #555 through to 3.10.28+ #634 (latest release at time of writing).
The wrong timing is faster then the correct timing by about 15%

@popcornmix
Copy link
Collaborator

This driver was provided as a pull request, so I don't know much about it.
I can't think of any that we have changed that would affect timing, but there are many upstream commits between 3.6 and 3.10 kernels.

Can you confirm if the issue only affect transmission, or is there a problem with reception?

@ar0n @cleverca22 You were involved in the original driver - any suggestions?

@koromar
Copy link
Author

koromar commented Feb 9, 2014

Receiving works, but irrecord spit out a slightly different lircd.conf:


Linux host1 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013 armv6l GNU/Linux

begin remote
  name OptSwitch
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9038  4443
  one           613  1632
  zero          613   510
  ptrail        612
  repeat       9038  2196
  pre_data_bits   16
  pre_data       0x61D6
  gap          107849
  toggle_bit_mask 0x0

      begin codes
          KEY_POWER                0x7887
          KEY_1                    0x40BF
          KEY_2                    0x609F
          KEY_3                    0x10EF
          KEY_4                    0x20DF
      end codes
end remote

Linux host2 3.10.28+ #634 PREEMPT Sun Feb 2 15:16:25 GMT 2014 armv6l GNU/Linux

begin remote
  name  OptSwitch
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9027  4452
  one           604  1642
  zero          604   519
  ptrail        600
  repeat       9030  2209
  pre_data_bits   16
  pre_data       0x61D6
  gap          107848
  toggle_bit_mask 0x0

      begin codes
          KEY_POWER                0x7887
          KEY_1                    0x40BF
          KEY_2                    0x609F
          KEY_3                    0x10EF
          KEY_4                    0x20DF
      end codes
end remote

@GeofP
Copy link

GeofP commented Feb 10, 2014

I performed the following experiment which confirms it is only a fault with the transmission. irrecord puts the correct parameters in the lircd.conf file for both 3.6.11 and 3.10.29. The timing produced in transmission is wrong in the 3.10.29 version. (which is the same as posted above, but I wanted to confirm the actual numbers and measurements.)

Starting with software version 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013

Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).

The header pulse was displayed as 8982
The header pulse measured 9.0ms on the oscilloscope (which is what is expected)

Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote
Output of irrecord as follows:

Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8981 4429
Found trail pulse: 589
Found repeat code: 8983 2214
Signals are space encoded.
Signal length is 32

The lircd.conf included the following line:
header 8981 4429

Changed the name in ~/lircd.conf to foxsat-hdr and copied the file to /etc/lirc

Started up lirc again with sudo /etc/init.d/lirc start
Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 9.0ms was measured on the oscilloscope.

Performed a sudo rpi-update to:
3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014

Checked the header pulse
irsend send_once foxsat-hdr key_power
lirc ir header pulse measures 7.7ms, (before the rpi-update it had read 9.0ms)

Repeated the above experiment of learning the remote, making a new lircd.conf file and measuring the new header pulse.

Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).

The header pulse was displayed as 8980, (before was 8982, so effectivily the same)
The header pulse measured 9.0ms on the oscilloscope

Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote.
Output of irrecord as follows: (this was effectively the same as before)

Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8983 4427
Found trail pulse: 588
Found repeat code: 8985 2213
Signals are space encoded.
Signal length is 32

The lircd.conf included the following line: (this was effectively the same as before)
header 8983 4427

Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 7.7ms was measured on the oscilloscope.

@ar0n
Copy link

ar0n commented Feb 16, 2014

I don't have the equipment to check this out now, but can somebody test it with this version: ar0n@69af0bf
This one directly writes the registers, so we can rule out a few things (but I think the problem is elsewhere). Thanks!

@GeofP
Copy link

GeofP commented Feb 17, 2014

I tried this a couple of weeks back and got a file not found error message.
My current software is : 3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014
Tried it again, this is the response:

sudo rpi-update 69af0bf
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** Performing self-update
--2014-02-17 07:45:09-- https://github.com/Hexxeh/rpi-update/raw/master/rpi-update
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/Hexxeh/rpi-update/master/rpi-update [following]
--2014-02-17 07:45:15-- https://raw.github.com/Hexxeh/rpi-update/master/rpi-update
Resolving raw.github.com (raw.github.com)... 185.31.18.133
Connecting to raw.github.com (raw.github.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7174 (7.0K) [text/plain]
Saving to: `/usr/bin/rpi-update.tmp'

100%[======================================>] 7,174 --.-K/s in 0.02s

2014-02-17 07:45:20 (397 KB/s) - `/usr/bin/rpi-update.tmp' saved [7174/7174]

*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** ARM/GPU split is now defined in /boot/config.txt using the gpu_mem option!
*** Downloading specific firmware revision (this will take a few minutes)
*** Decompressing downloaded firmware archive
--2014-02-17 07:45:20-- https://github.com/Hexxeh/rpi-firmware/tarball/69af0bf569f66fa3262f2b46e5e636742de48dcb
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-02-17 07:45:26 ERROR 404: Not Found.

@koromar
Copy link
Author

koromar commented Feb 20, 2014

finally set up a cross-compile toolchain to test the code aron mentioned. will post an update with my findings tonight.

@koromar
Copy link
Author

koromar commented Feb 20, 2014

@ar0n : doesn't work with ar0n@69af0bf

root@maggie:/etc/lirc> modinfo lirc_rpi
filename:       /lib/modules/3.10.30+/kernel/drivers/staging/media/lirc/lirc_rpi.ko
license:        GPL
author:         Aron Robert Szabo
description:    Infra-red receiver and blaster driver for Raspberry Pi GPIO.
srcversion:     EC5D51CA60B951B0F73222D
depends:        lirc_dev
staging:        Y
intree:         Y
vermagic:       3.10.30+ preempt mod_unload modversions ARMv6 p2v8
parm:           gpio_out_pin:GPIO output/transmitter pin number of the BCM processor. Valid pin number
s are: 0, 1, 4, 8, 7, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25, default 17 (int)
parm:           gpio_in_pin:GPIO input pin number of the BCM processor. Valid pin numbers are: 0, 1, 4
, 8, 7, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25, default 18 (int)
parm:           sense:Override autodetection of IR receiver circuit (0 = active high, 1 = active low )
 (bool)
parm:           softcarrier:Software carrier (0 = off, 1 = on, default on) (bool)

@jjmz
Copy link

jjmz commented Mar 4, 2014

I have the same kind of behavior with Raspbmc which is using a 3.10.24 kernel.
I am only using IR blasting, thus output only, and I have checked timing with a scope
When freq is 38khz, real output is almost 45Khz.
Timing off pulses is also shorter than expected (~480us instead of 533).
I came to the quick conclusion that it could be related to the overclocking factor (Raspbmc is using 800Mhz , whereas the regular RPi should run 700Mhz). Can someone confirm that ?

@GeofP
Copy link

GeofP commented Mar 4, 2014

I don't use Raspbmc and have not configured the Pi to be overclocked. Looking at my /boot/config.txt confirms the Pi is running at the default 700MHz. So, I think this not the cause of the problem.

@jjmz
Copy link

jjmz commented Mar 6, 2014

Ok, that's not the overclocking factor...

I made some tests replacing udelay (and rounding to nearest us) by ndelay in the code, and it seems to work pretty well

Here are the patched lines :

--- lirc_rpi.c-orig 2014-03-06 13:46:20.593073073 +0100
+++ lirc_rpi.c  2014-03-06 15:37:07.346448182 +0100
@@ -41,7 +41,7 @@

 #define LIRC_DRIVER_NAME "lirc_rpi"
 #define RBUF_LEN 256
-#define LIRC_TRANSMITTER_LATENCY 256
+#define LIRC_TRANSMITTER_LATENCY 20

 #ifndef MAX_UDELAY_MS
 #define MAX_UDELAY_US 5000
@@ -143,14 +143,13 @@
            gpiochip->set(gpiochip, gpio_out_pin, !invert);
            target += pulse_width;
        }
-       d = (target - actual -
-            LIRC_TRANSMITTER_LATENCY + 128) >> 8;
+       d = ((target - actual - LIRC_TRANSMITTER_LATENCY) * 1000)/256;
        /*
         * Note - we've checked in ioctl that the pulse/space
         * widths are big enough so that d is > 0
         */
-       udelay(d);
-       actual += (d << 8) + LIRC_TRANSMITTER_LATENCY;
+       ndelay(d);  /* ns instead of us */
+       actual += (d*256)/1000 + LIRC_TRANSMITTER_LATENCY;
        flag = !flag;
    }
    return (actual-length) >> 8;

@popcornmix
Copy link
Collaborator

@jjmz interesting. First can you just call ndelay(d * 1000) rather than udelay(d) just to rule out an issue with udelay not being accurate.
If it's just an issue with quantising to 1us resolution is introducing the error (measured at about 18%) that would suggest the delays being called are ~5us - are they really that short?
Can anyone else repeat their tests with this patch?

@koromar
Copy link
Author

koromar commented Mar 6, 2014

@jjmz :
I've patched the original version of 3.10.30+ I used to test ar0n@69af0bf with. So far receiving works but sending doesn't work at all. Not even the TV responded (and it did work in all kernel versions until now). I'll check my hardware-setup again now ..

@koromar
Copy link
Author

koromar commented Mar 6, 2014

replugged/rewired what was possible: now it's working with jjmz's patch. =)

@GeofP
Copy link

GeofP commented Mar 7, 2014

If someone could tell me how to do the "cross-compile toolchain" mentioned earlier by koromar, I will try to incorporate this patch and measure the timings on my system.

@ghost
Copy link

ghost commented Mar 7, 2014

I also want to test,, but how to cross compile..

@koromar
Copy link
Author

koromar commented Mar 7, 2014

I've uploaded the kernel incl. modules. This way you can test without having to crosscompile:

  1. rpi-update to latest & reboot (this way you'll have a working 3.10.32+ setup if something goes wrong)
  2. download the kernel Image from https://www.dropbox.com/s/6be4213syg682hl/Image and copy it to /boot/kernel_new.img
  3. edit /boot/config.txt:
    add on top: kernel=kernel_new.img . Comment out "kernel=kernel.img" if it exists
  4. backup or rename /lib/firmware (and /lib/modules/3.10.31+ if it exists and you want to keep it)
  5. download and extract https://www.dropbox.com/s/3l5s0dcnnxmw9jh/lib-001.tar.gz and copy the unpacked directories to the correct location (e.g. if unpacked in /tmp, do a 'cp -r /tmp/lib/modules/3.10.30+ /lib/modules'). Same goes for the firmware directory..
  6. reboot

If the boot of the new kernel fails, power down the raspi, put the sd card in another machine and change the config.txt "kernel=kernel_new.img" to kernel=kernel.img. This should then boot your last kernel next time you start the rpi.
If it doesn't, restore your backuped /lib/firmware directory. I haven't had to do this, but just in case..

As for cross-compiling howtos, I've used those two:
https://raspberrypi.stackexchange.com/questions/192/how-do-i-cross-compile-the-kernel-on-a-ubuntu-host & http://elinux.org/RPi_Kernel_Compilation

one is missing the modules-part, the other has a better description of all the necessary steps.

@emmtte
Copy link

emmtte commented Mar 15, 2014

Same problem with 3.10.33+ updated this morning
Working with increase 1.15 factor header, one, zero, ptrail, repeat, gap in lircd.conf
I'm waiting a new firmware version...
Thanks

@GeofP
Copy link

GeofP commented Mar 18, 2014

Hi koromar. I tried using your kernel modules , my system was at 3.10.33+ #656. The system boots into 3.10.30+ #1 but I get 3 error lines ending with "......could not open moddep file '/lib/modules/3.10.30+/modules.dep.bin" and a "FAIL: unable to load LIRC kernal modules".
I have attached a screen shot showing the boot messages.
Can you suggest a cause of the problem?

dsc_6542a

@popcornmix
Copy link
Collaborator

@jjmz (and other testers)
I'd like to get this fixed in official kernel, but your patch seems to try three different things.
Can we identify which changes are required.

First, just change the latency:

-#define LIRC_TRANSMITTER_LATENCY 256
+#define LIRC_TRANSMITTER_LATENCY 20

Second, just change the rounding

-       d = (target - actual -
-            LIRC_TRANSMITTER_LATENCY + 128) >> 8;
+       d = (target - actual -
+           LIRC_TRANSMITTER_LATENCY) >> 8;

Third use ndelay rather than udelay

-       udelay(d);
+       ndelay(d * 1000);

Fourth just change the scaling

-       d = (target - actual -
-            LIRC_TRANSMITTER_LATENCY + 128) >> 8;
+       d = ((target - actual -
+            LIRC_TRANSMITTER_LATENCY + 128) * 1000) >> 8;
        /*
         * Note - we've checked in ioctl that the pulse/space
         * widths are big enough so that d is > 0
         */
-       udelay(d);
-       actual += (d << 8) + LIRC_TRANSMITTER_LATENCY;
+       ndelay(d);  /* ns instead of us */
+       actual += (d << 8)/1000 + LIRC_TRANSMITTER_LATENCY;
        flag = !flag;

@GeofP
Copy link

GeofP commented Mar 18, 2014

Where can I get the source code for this?

@koromar
Copy link
Author

koromar commented Mar 18, 2014

@GeofP : jjmz's second post has the patchlines.
I'm going to build a set of kernel modules. One for each segment (like popcornmix mentioned) and one for all the lines patched.
They'll be build against the latest (will post details) version of the kernel so one can easily test by replacing just the kernel modules (and not the whole kernel+modules+firmware).
Expect my update later tonight...

@koromar
Copy link
Author

koromar commented Mar 18, 2014

I've run into some strange errors compiling the latest version from github with a config from an up to date raspberry 3.10.33+ . The kernel won't boot and the lirc_rpi.ko kernel module has (at least) a different size (not sure if this is a part of the problem yet).
I'll try again as soon as I can make some spare time for it (maybe weekend). :/

@popcornmix
Copy link
Collaborator

To get that right config do:

make ARCH=arm bcmrpi_defconfig

Maybe try a make clean before building.

@koromar
Copy link
Author

koromar commented Mar 19, 2014

I was unable to build a module matching the latest one installed with rpi-update. So I did rpi-update on the pi and a git pull on the vm with the cross-compile env. again - still didn't work.

I then built a new kernel (with .config from bcmrpi_defconfig) and 5 different lirc_rpi.ko for that:
one vanilla build without modifications and one for each patch.

My results:

| kmod version         | result      | 
|----------------------|-------------|
| lirc_rpi.ko-vanilla  | not working |
| lirc_rpi.ko-latency  | working     |
| lirc_rpi.ko-rounding | not working |
| lirc_rpi.ko-ndelay   | not working |
| lirc_rpi.ko-scaling  | not working |

Download Link: https://www.dropbox.com/s/tvv2cn32761rlka/custom-3.10.33.tar.gz

The archive contains:

boot/kernel_new.img : new custom kernel image
        lib/modules : kernel modules with all custom lirc_rpi.ko's (see below for more info)
       lib/firmware : firmware
           src-kmod : copies of the modified .c files and compiled kernel modules

I also wrote a little howto and tried to be as exact as possible, but I guess it couldn't hurt to do an additional backup in your own accustomed way.
Please see this as a mere suggestion:

Download Files:

pi@pi:~> cd /tmp
pi@pi:/tmp> wget https://www.dropbox.com/s/tvv2cn32761rlka/custom-3.10.33.tar.gz

Unpack Files:

pi@pi:/tmp> tar vzxf custom-3.10.33.tar.gz
pi@pi:/tmp> cd custom-3.10.33

You should end up with something like this:

pi@pi:/tmp/custom-3.10.33> ls -la
total 20
drwxrwxr-x  5 chris chris 4096 Mar 19 09:07 ./
drwxrwxrwt 11 root  root  4096 Mar 19 09:17 ../
drwxrwxr-x  2 chris chris 4096 Mar 19 09:06 boot/
drwxrwxr-x  4 chris chris 4096 Mar 19 08:00 lib/
drwxrwxr-x  2 chris chris 4096 Mar 19 09:34 src-kmod/

get a root shell:

pi@pi:/tmp/custom-3.10.33> sudo bash
root@pi:/tmp/custom-3.10.33> 

Backup current modules+firmware

root@pi:/tmp/custom-3.10.33> mv /lib/modules /lib/modules-backup
root@pi:/tmp/custom-3.10.33> mv /lib/firmware /lib/firmware-backup

Copy custom kernel + modules, firmware

root@pi:/tmp/custom-3.10.33> mv lib/modules /lib/
root@pi:/tmp/custom-3.10.33> mv lib/firmware /lib/
root@pi:/tmp/custom-3.10.33> mv boot/kernel_new.img /boot/

Now edit /boot/config.txt, change "kernel= " to:

kernel=kernel_new.img
#kernel=kernel.img

You can reboot now to test if this worked for you. When you did do that, a "uname -a" should show:

... 3.10.33+ #1 PREEMPT ...

along with some other info.

To restore :

- plug you sd-card in another machine
- change back 'kernel=kernel.img' in boot/config.txt
- move away firmware and modules directories:

    user@host sdcard-root> mv lib/modules lib/modules-broken
    user@host sdcard-root> mv lib/firmware lib/firmware-broken

- move back last running modules + firmware:

    user@host sdcard-root> mv lib/modules-backup lib/modules
    user@host sdcard-root> mv lib/firmware-backup lib/firmware

Choose Kernel Module:

get a root shell (if you're not root anymore)

pi@pi:/home/pi/> sudo bash
root@pi:/home/pi/> 

switch working directory:

root@pi:/tmp/custom-3.10.33> cd /lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/
root@pi:/lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/> ll

total 208
drwxrwxr-x 2 pi   pi    4096 Mar 17 03:12 ./
drwxrwxr-x 4 pi   pi    4096 Mar 19  2014 ../
-rw-rw-r-- 1 pi   pi   12338 Mar 19  2014 lirc_igorplugusb.ko
-rw-rw-r-- 1 pi   pi   18781 Mar 19  2014 lirc_imon.ko
-rw-r--r-- 1 pi   pi   18120 Mar 17 03:43 lirc_rpi.ko
-rw-r--r-- 1 root root 18052 Mar 17 02:53 lirc_rpi.ko-latency
-rw-r--r-- 1 pi   pi   18084 Mar 17 03:06 lirc_rpi.ko-ndelay
-rw-r--r-- 1 root root 18056 Mar 17 03:01 lirc_rpi.ko-rounding
-rw-r--r-- 1 pi   pi   18120 Mar 17 03:11 lirc_rpi.ko-scaling
-rw-r--r-- 1 root root 18056 Mar 17 02:52 lirc_rpi.ko-vanilla
-rw-rw-r-- 1 pi   pi   17971 Mar 19  2014 lirc_sasem.ko
-rw-rw-r-- 1 pi   pi   23097 Mar 19  2014 lirc_serial.ko

stop lirc

root@pi:/lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/> service lirc stop
[ ok ] Stopping remote control daemon(s): LIRC:.

unload kernel modules:

root@pi:/lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/> rmmod lirc_rpi lirc_dev uinput evdev

select kernel module by copying:

root@pi:/lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/> cp lirc_rpi.ko-scaling lirc_rpi.ko

start lirc (will automatically load kernel modules)

root@pi:/lib/modules/3.10.33+/kernel/drivers/staging/media/lirc/> service lirc start
[ ok ] Loading LIRC modules:.
[ ok ] Starting remote control daemon(s) : LIRC :.

do your tests. repeat steps "stop lirc" to "start lirc" for other modules.

note:

  • lircd can automatically load your kernel modules, not sure if it's the default. the setting can be found in /etc/lirc/hardware.conf:

    #Try to load appropriate kernel modules
    LOAD_MODULES=true

  • a lot of those file operations can be done with copy or some even by linking. I didn't test this and to speed up the whole process I decided to just move everything.

Hope this will work.

@popcornmix
Copy link
Collaborator

@koromar
Excellent. That suggests a much smaller (and so less risky) fix can be implemented.
A key question is what is the LIRC_TRANSMITTER_LATENCY?

It looks like LIRC_TRANSMITTER_LATENCY is a 24.8 fixed point number of microseconds. i.e.
LIRC_TRANSMITTER_LATENCY = 256 => 1us
LIRC_TRANSMITTER_LATENCY = 20 => 78ns

It seems both these numbers are made up. Anyone know what value this should really have?

I guess by testing the frequency error (e.g. with a scope) of the "vanilla" and "latency" kernels, we can determine if 20 is correct, too high or too low, and predict what value would give the perfect frequency.

@ar0n
Copy link

ar0n commented Mar 19, 2014

@popcornmix

LIRC_TRANSMITTER_LATENCY has been copied from the original lirc serial module, where its defined as LIRC_SERIAL_TRANSMITTER_LATENCY. This is used to correct uart latency, on platforms without time stamp counter (RDTSC instruction). On platforms where the RDTSC instruction is available, the pulse widths are calculated in a more accurate way.

I don't know if we can rely on the timex.h get_cycles() (

#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
) on calculating the pulse widths, because that would be the best way to do this.

@popcornmix
Copy link
Collaborator

The rpi kernel has a 1us resolution timer available (see frc_clock_ticks32 in bcm2708.c) which is most likely what get_cycles() reads, so it should be possible to use that.

@ar0n
Copy link

ar0n commented Mar 19, 2014

@popcornmix
Thanks for the info! For a quick fix, we should do what you've suggested, and I will correct the code to use the cycle count.

@GeofP
Copy link

GeofP commented Mar 20, 2014

@ar0n
I don't think this is the solution.

I have carried out the trial as described by @koromar and taken some frequency measurements for the different kmod versions.
I repeated this for different frequency values set in the /etc/lirc/lircd.conf file.

lirc_rpi.ko-latency produces less error than all the others, although lirc_rpi.ko-scaling is also an improvement.

The measurement are taken with an oscilloscope on GPIO pin 17. See results in the following table.

image

popcornmix pushed a commit that referenced this issue Feb 12, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Feb 13, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
TiejunChina pushed a commit to TiejunChina/linux that referenced this issue Feb 14, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Feb 19, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Feb 23, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Feb 26, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 8, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 14, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 16, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 22, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 26, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Mar 29, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
kmarinushkin pushed a commit to kmarinushkin/linux that referenced this issue Mar 29, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Apr 3, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
raspbian-autopush pushed a commit to raspbian-packages/linux-4.9 that referenced this issue Apr 7, 2018
commit 30ee176
Author: Aron Szabo <aron@aron.ws>
Date:   Sat Jun 16 12:15:55 2012 +0200

    lirc: added support for RaspberryPi GPIO
    
    lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
    See: raspberrypi/linux#525
    
    lirc: Remove restriction on gpio pins that can be used with lirc
    
    Compute Module, for example could use different pins
    
    lirc_rpi: Add parameter to specify input pin pull
    
    Depending on the connected IR circuitry it might be desirable to change the
    gpios internal pull from it pull-down default behaviour. Add a module
    parameter to allow the user to set it explicitly.
    
    Signed-off-by: Julian Scheel <julian@jusst.de>
    
    lirc-rpi: Use the higher-level irq control functions
    
    This module used to access the irq_chip methods of the
    gpio controller directly, rather than going through the
    standard enable_irq/irq_set_irq_type functions. This
    caused problems on pinctrl-bcm2835 which only implements
    the irq_enable/disable methods and not irq_unmask/mask.
    
    lirc-rpi: Correct the interrupt usage
    
    1) Correct the use of enable_irq (i.e. don't call it so often)
    2) Correct the shutdown sequence.
    3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier
    
    lirc-rpi: use getnstimeofday instead of read_current_timer
    
    read_current_timer isn't guaranteed to return values in
    microseconds, and indeed it doesn't on a Pi2.
    
    Issue: linux#827
    
    lirc-rpi: Add device tree support, and a suitable overlay
    
    The overlay supports DT parameters that match the old module
    parameters, except that gpio_in_pull should be set using the
    strings "up", "down" or "off".
    
    lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode
    
    fix auto-sense in lirc_rpi driver
    
    On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
    interrupts and change it's low-active / high-active setting.
    When this happens, the IR remote control stops working.
    
    This patch disables this auto-detection if the 'sense' parameter
    was set in the device tree, making the driver robust to such
    spurious interrupts.


Gbp-Pq: Topic rpi
Gbp-Pq: Name rpi_1043_30ee17664d47b0befc0e3221dd445798dd97425c.patch
popcornmix pushed a commit that referenced this issue Apr 9, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue Apr 16, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
popcornmix pushed a commit that referenced this issue May 5, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
pelwell pushed a commit that referenced this issue May 20, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: #525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
sasikrishna2014 pushed a commit to sasikrishna2014/ubuntu-bionic that referenced this issue Aug 7, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
APokorny pushed a commit to ubports/ubuntu_kernel_xenial that referenced this issue Oct 11, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode
bluegray pushed a commit to bluegray/ubuntu-bionic that referenced this issue Oct 17, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
raspbian-autopush pushed a commit to raspbian-packages/linux-4.9 that referenced this issue Nov 11, 2018
commit 30ee176
Author: Aron Szabo <aron@aron.ws>
Date:   Sat Jun 16 12:15:55 2012 +0200

    lirc: added support for RaspberryPi GPIO
    
    lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
    See: raspberrypi/linux#525
    
    lirc: Remove restriction on gpio pins that can be used with lirc
    
    Compute Module, for example could use different pins
    
    lirc_rpi: Add parameter to specify input pin pull
    
    Depending on the connected IR circuitry it might be desirable to change the
    gpios internal pull from it pull-down default behaviour. Add a module
    parameter to allow the user to set it explicitly.
    
    Signed-off-by: Julian Scheel <julian@jusst.de>
    
    lirc-rpi: Use the higher-level irq control functions
    
    This module used to access the irq_chip methods of the
    gpio controller directly, rather than going through the
    standard enable_irq/irq_set_irq_type functions. This
    caused problems on pinctrl-bcm2835 which only implements
    the irq_enable/disable methods and not irq_unmask/mask.
    
    lirc-rpi: Correct the interrupt usage
    
    1) Correct the use of enable_irq (i.e. don't call it so often)
    2) Correct the shutdown sequence.
    3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier
    
    lirc-rpi: use getnstimeofday instead of read_current_timer
    
    read_current_timer isn't guaranteed to return values in
    microseconds, and indeed it doesn't on a Pi2.
    
    Issue: linux#827
    
    lirc-rpi: Add device tree support, and a suitable overlay
    
    The overlay supports DT parameters that match the old module
    parameters, except that gpio_in_pull should be set using the
    strings "up", "down" or "off".
    
    lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode
    
    fix auto-sense in lirc_rpi driver
    
    On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
    interrupts and change it's low-active / high-active setting.
    When this happens, the IR remote control stops working.
    
    This patch disables this auto-detection if the 'sense' parameter
    was set in the device tree, making the driver robust to such
    spurious interrupts.


Gbp-Pq: Topic rpi
Gbp-Pq: Name rpi_1043_30ee17664d47b0befc0e3221dd445798dd97425c.patch
Cyndent pushed a commit to Cyndent/ubuntu-core-4.15 that referenced this issue Dec 11, 2018
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
chongpohkit pushed a commit to chongpohkit/ubuntu-bionic that referenced this issue Feb 18, 2019
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
big-henry pushed a commit to big-henry/mirror_ubuntu-bionic-kernel that referenced this issue Feb 17, 2020
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
YadongQi pushed a commit to YadongQi/ubuntu-bionic that referenced this issue Mar 10, 2020
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
hisenyiu2015 pushed a commit to hisenyiu2015/msm-4.14 that referenced this issue May 20, 2021
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.
Clome pushed a commit to Clome/ubuntu-kernel that referenced this issue Jul 2, 2024
lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
See: raspberrypi/linux#525

lirc: Remove restriction on gpio pins that can be used with lirc

Compute Module, for example could use different pins

lirc_rpi: Add parameter to specify input pin pull

Depending on the connected IR circuitry it might be desirable to change the
gpios internal pull from it pull-down default behaviour. Add a module
parameter to allow the user to set it explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>

lirc-rpi: Use the higher-level irq control functions

This module used to access the irq_chip methods of the
gpio controller directly, rather than going through the
standard enable_irq/irq_set_irq_type functions. This
caused problems on pinctrl-bcm2835 which only implements
the irq_enable/disable methods and not irq_unmask/mask.

lirc-rpi: Correct the interrupt usage

1) Correct the use of enable_irq (i.e. don't call it so often)
2) Correct the shutdown sequence.
3) Avoid a bcm2708_gpio driver quirk by setting the irq flags earlier

lirc-rpi: use getnstimeofday instead of read_current_timer

read_current_timer isn't guaranteed to return values in
microseconds, and indeed it doesn't on a Pi2.

Issue: linux#827

lirc-rpi: Add device tree support, and a suitable overlay

The overlay supports DT parameters that match the old module
parameters, except that gpio_in_pull should be set using the
strings "up", "down" or "off".

lirc-rpi: Also support pinctrl-bcm2835 in non-DT mode

fix auto-sense in lirc_rpi driver

On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
interrupts and change it's low-active / high-active setting.
When this happens, the IR remote control stops working.

This patch disables this auto-detection if the 'sense' parameter
was set in the device tree, making the driver robust to such
spurious interrupts.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants