1. 16 Feb, 2022 2 commits
    • Danilo Krummrich's avatar
      Input: ps2-gpio - use ktime for IRQ timekeeping · 2fa9c57a
      Danilo Krummrich authored
      Using jiffies for the IRQ timekeeping is not sufficient for two reasons:
      
      (1) Usually jiffies have a resolution of 1ms to 10ms. The IRQ intervals
          based on the clock frequency of PS2 protocol specification (10kHz -
          16.7kHz) are between ~60us and 100us only. Therefore only those IRQ
          intervals can be detected which are either at the end of a transfer
          or are overly delayed. While this is sufficient in most cases, since
          we have quite a lot of ways to detect faulty transfers, it can
          produce false positives in rare cases: When the jiffies value
          changes right between two interrupt that are in time, we wrongly
          assume that we missed one or more clock cycles.
      
      (2) Some gpio controllers (e.g. the one in the bcm283x chips) may generate
          spurious IRQs when processing interrupts in the frequency given by PS2
          devices.
      
      Both issues can be fixed by using ktime resolution for IRQ timekeeping.
      
      However, it is still possible to miss clock cycles without detecting
      them. When the PS2 device generates the falling edge of the clock signal
      we have between ~30us and 50us to sample the data line, because after
      this time we reach the next rising edge at which the device changes the
      data signal already. But, the only thing we can detect is whether the
      IRQ interval is within the given period. Therefore it is possible to
      have an IRQ latency greater than ~30us to 50us, sample the wrong bit on
      the data line and still be on time with the next IRQ. However, this can
      only happen when within a given transfer the IRQ latency increases
      slowly.
      
      ___            ______            ______            ______            ___
         \          /      \          /      \          /      \          /
          \        /        \        /        \        /        \        /
           \______/          \______/          \______/          \______/
      
          |-----------------|                 |--------|
               60us/100us                      30us/50us
      Signed-off-by: default avatarDanilo Krummrich <danilokrummrich@dk-develop.de>
      Link: https://lore.kernel.org/r/20220215160208.34826-3-danilokrummrich@dk-develop.deSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      2fa9c57a
    • Danilo Krummrich's avatar
      Input: ps2-gpio - refactor struct ps2_gpio_data · 0dde5f82
      Danilo Krummrich authored
      Refactor struct ps2_gpio_data in order to clearly separate RX and TX
      state data.
      
      This change intends to increase code readability and does not bring any
      functional change.
      Signed-off-by: default avatarDanilo Krummrich <danilokrummrich@dk-develop.de>
      Link: https://lore.kernel.org/r/20220215160208.34826-2-danilokrummrich@dk-develop.deSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      0dde5f82
  2. 08 Feb, 2022 3 commits
  3. 18 Jan, 2022 1 commit
  4. 10 Jan, 2022 1 commit
  5. 09 Jan, 2022 10 commits
  6. 08 Jan, 2022 5 commits
  7. 07 Jan, 2022 11 commits
  8. 06 Jan, 2022 7 commits