1. 24 Aug, 2018 2 commits
    • spiiroin's avatar
      [usb_moded] Normalize multiline comments · 7a386e38
      spiiroin authored
      Just to make it easier for editor to handle automatic indentation, make
      all C comment continuation lines start with whitespace followed by '*'.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [usb_moded] Add configfs support. Fixes JB#42083 · 692c2cb3
      spiiroin authored
      Add custom Makefile for faster smoke-test rebuilds without spending time
      in configure, autotools, document generation and/or rolling rpm packages.
      Add multiple include protection to all header files.
      Move function prototypes away from header files that included in the
      development package.
      Mass rename functions to have a prefix giving context for the function.
      For the most part the prefix is derived from the name of the compilation
      module containing the function.
      Mass normalize indentation to four spaces in all source files.
      Augment author lists on each source file based on git committers.
      Remove "inline" attributes from not-really-inlineable functions.
      Remove .gitignore.
      Remove unused modules-android.c source file.
      Define _GNU_SOURCE for whole build rather than in individual files.
      Fix resource leaks here and there.
      Try to avoid hard-coding android usb paths.
      Add configfs backend for usb cadget configuration.
      Probe supported backends (configfs, android usb, or kmod) on usb-moded
      startup and make them mutually exclusive with each other.
      Allow configfs and android usb control structures some time to show up
      if usb-moded is started during device bootup.
      Refactor udev event listener to utilize a state machine. Simplifies
      book keeping and makes pc/charger detection heuristics easier to control.
      Refactor mode selection to utilize three interconnected mini state machines.
      Allows separating logically wanted mode from mode programmed to usb and
      mode exposed over D-Bus.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  2. 28 Mar, 2018 2 commits
  3. 01 Dec, 2017 2 commits
    • spiiroin's avatar
      [udev] Do not exit if cable state can't be determined · 22bcd9f4
      spiiroin authored
      If usb-moded exits when it can't deduce cable connect state, it will
      be restarted by systemd. As the usb-moded restarts are not going to
      change how the udev status looks like, this repeats until systemd
      moves the usb-moded service to failed state.
      Do not exit and assume no usb-cable is connected. In addition to not
      triggering restart spree, this has the additional benefit that the
      usb-moded dbus interface stays available and signaling not-connected
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [udev] Suppress repetitive property warnings. Fixes JB#40394 · 0d5a10b7
      spiiroin authored
      Usb-moded expects to see POWER_SUPPLY_PRESENT and POWER_SUPPLY_TYPE
      properties defined for usb power-supply devices. When this is not
      the case, it emits warnings and applies various fallbacks. Since the
      properties get re-evaluated periodically, this also leads to the
      same warnings being repeated.
      Refactor the code so that in default verbosity the property warnings
      are emitted only during what looks like cable connect / disconnect.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  4. 14 Nov, 2017 1 commit
  5. 13 Mar, 2017 1 commit
  6. 18 Oct, 2016 1 commit
    • spiiroin's avatar
      [udev] Cancel mode selection when charger is detected. Fixes MER#1677 · b1d7a18f
      spiiroin authored
      When charger is connected, usb-moded can see first "USB" (=cable)
      connection event from udev followed by "USB_CDP" (=charger) event.
      Due to cached something-connected flag usb moded still behaves as
      if pc cable were connected - which leaves ui thinking mode selection
      can/should be done etc.
      If dedicated charger is reported after pc cable, clear the low level
      something-connected flag before acting on charger connected info.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  7. 07 Jul, 2016 2 commits
    • spiiroin's avatar
      [udev] Fix udev iowatch issues · 6ec3a730
      spiiroin authored
      The io watch source id is not cleared when it is going to be implicitly
      removed - which can lead to unsuccessful removal attempt when/if
      hwal_cleanup() function is called later on.
      Clear watch_id when return value from the callback function is going
      to cause it to be implicitly removed.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [cleanup] Do not use const for pointers used for storing dynamic data · a9cab1f5
      spiiroin authored
      Probably in attempt to hide compilation warnings due to storing dynamically
      allocated data in const pointers, there are multiple places where releasing
      of dynamic memory uses casts. Some of these casts are incorrect and there
      are still compilation issues.
      Remove const attribute from pointers that are used to store dynamically
      allocated data and remove the unnecessary casts at free() / g_free().
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  8. 26 Apr, 2016 2 commits
    • spiiroin's avatar
      [udev] Suspend proof event reading and processing. Fixes JB#34440 · c982d3b4
      spiiroin authored
      Depending on kernel side usb drivers and charging logic, it is possible
      that device suspends immediately after reporting usb connect / disconnect
      while display is off and autosuspend enabled. That can delay the actions
      that should be made on usb connection state changes.
      Acquire a wakelock for the duration of udev event input processing.
      Hold a wakelock for a while when usb connection state changes occur.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [udev] Try to ignore false positive cable connects. Contributes to JB#34547 · 2fa5781b
      spiiroin authored
      When connecting charger to usb port, it is sometimes initially detected as
      a pc cable instead of charger. This leads to usb mode selection dialog
      popping up in a situation where mode selection is not possible.
      Optionally, when cable connect is seen based on udev events, wait a while
      to see if it gets identified as dedicated charger before invoking actions
      relevant to pc cable connection only.
      It is assumed that data reported by udev on usb-moded startup is stable
      and pc cable connection is accepted without delay.
      By default usb-moded reacts immediately to pc cable connect events.
      If needed, the default delay can be adjusted via usb-moded command
      line argument -m/--max-cable-delay=<ms>.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  9. 25 Apr, 2016 1 commit
  10. 22 Apr, 2016 1 commit
  11. 17 Dec, 2014 1 commit
  12. 07 Nov, 2014 1 commit
  13. 29 Oct, 2013 1 commit
  14. 23 Oct, 2013 1 commit
  15. 22 Oct, 2013 1 commit
  16. 26 Jun, 2013 1 commit
  17. 10 May, 2013 1 commit
  18. 12 Dec, 2012 1 commit
  19. 13 Jan, 2012 1 commit
  20. 17 Aug, 2011 1 commit
  21. 21 Jul, 2011 2 commits
  22. 29 Jun, 2011 1 commit
  23. 16 May, 2011 1 commit
  24. 10 May, 2011 1 commit
  25. 21 Apr, 2011 6 commits
  26. 20 Apr, 2011 3 commits
  27. 12 Apr, 2011 1 commit