Skip to content
  1. Feb 04, 2023
  2. Jan 30, 2023
  3. Jan 28, 2023
  4. Jan 21, 2023
  5. Jan 11, 2023
    • Jeff LaBundy's avatar
      Input: iqs269a - do not poll during ATI · b08134eb
      Jeff LaBundy authored
      After initial start-up, the driver triggers ATI (calibration) with
      the newly loaded register configuration in place. Next, the driver
      polls a register field to ensure ATI completed in a timely fashion
      and that the device is ready to sense.
      
      However, communicating with the device over I2C while ATI is under-
      way may induce noise in the device and cause ATI to fail. As such,
      the vendor recommends not to poll the device during ATI.
      
      To solve this problem, let the device naturally signal to the host
      that ATI is complete by way of an interrupt. A completion prevents
      the device from successfully probing until this happens.
      
      As an added benefit, initial switch states are now reported in the
      interrupt handler at the same time ATI status is checked. As such,
      duplicate code that reports initial switch states has been removed
      from iqs269_input_init().
      
      The former logic that scaled ATI timeout and filter settling delay
      is not carried forward with the new implementation, as it produces
      overly conservative delays at the lower clock rate.
      
      Rather, a single timeout that covers both clock rates is used. The
      filter settling delay does not happen to be necessary and has been
      removed as well.
      
      Fixes: 04e49867
      
       ("Input: add support for Azoteq IQS269A")
      Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
      Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      Link: https://lore.kernel.org/r/Y7RtB2T7AF9rYMjK@nixie71
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      b08134eb
    • Jeff LaBundy's avatar
      Input: iqs269a - do not poll during suspend or resume · 18ab69c8
      Jeff LaBundy authored
      Polling the device while it transitions from automatic to manual
      power mode switching may keep the device from actually finishing
      the transition. The process appears to time out depending on the
      polling rate and the device's core clock frequency.
      
      This is ultimately unnecessary in the first place; instead it is
      sufficient to write the desired mode during initialization, then
      disable automatic switching at suspend. This eliminates the need
      to ensure the device is prepared for a manual change and removes
      the 'suspend_mode' variable.
      
      Similarly, polling the device while it transitions from one mode
      to another under manual control may time out as well. This added
      step does not appear to be necessary either, so drop it.
      
      Fixes: 04e49867
      
       ("Input: add support for Azoteq IQS269A")
      Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
      Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      Link: https://lore.kernel.org/r/Y7Rs+eEXlRw4Vq57@nixie71
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      18ab69c8
    • Jeff LaBundy's avatar
      Input: iqs269a - configure device with a single block write · 3689abfc
      Jeff LaBundy authored
      Unless it is being done as part of servicing a soft reset interrupt,
      configuring channels on-the-fly (as is the case when writing to the
      ati_trigger attribute) may cause GPIO3 (which reflects the state of
      touch for a selected channel) to be inadvertently asserted.
      
      To solve this problem, follow the vendor's recommendation and write
      all channel configuration as well as the REDO_ATI register field as
      part of a single block write. This ensures the device has been told
      to re-calibrate itself following an I2C stop condition, after which
      sensing resumes and GPIO3 may be asserted.
      
      Fixes: 04e49867
      
       ("Input: add support for Azoteq IQS269A")
      Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
      Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      Link: https://lore.kernel.org/r/Y7Rs8GyV7g0nF5Yy@nixie71
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      3689abfc
    • Jeff LaBundy's avatar
      Input: iqs269a - increase interrupt handler return delay · e023cc4a
      Jeff LaBundy authored
      The time the device takes to deassert its RDY output following an
      I2C stop condition scales with the core clock frequency.
      
      To prevent level-triggered interrupts from being reasserted after
      the interrupt handler returns, increase the time before returning
      to account for the worst-case delay (~140 us) plus margin.
      
      Fixes: 04e49867
      
       ("Input: add support for Azoteq IQS269A")
      Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
      Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      Link: https://lore.kernel.org/r/Y7Rs484ypy4dab5G@nixie71
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      e023cc4a
    • Jeff LaBundy's avatar
      Input: iqs269a - drop unused device node references · 59bc9cb3
      Jeff LaBundy authored
      Each call to device/fwnode_get_named_child_node() must be matched
      with a call to fwnode_handle_put() once the corresponding node is
      no longer in use. This ensures a reference count remains balanced
      in the case of dynamic device tree support.
      
      Currently, the driver does not call fwnode_handle_put() on nested
      event nodes. This patch solves this problem by adding the missing
      instances of fwnode_handle_put().
      
      As part of this change, the logic which parses each channel's key
      code is gently refactored in order to reduce the number of places
      from which fwnode_handle_put() is called.
      
      Fixes: 04e49867
      
       ("Input: add support for Azoteq IQS269A")
      Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
      Link: https://lore.kernel.org/r/Y7Rsx68k/gvDVXAt@nixie71
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      59bc9cb3