1. 18 Dec, 2015 31 commits
  2. 12 Dec, 2015 1 commit
  3. 04 Dec, 2015 4 commits
  4. 03 Dec, 2015 4 commits
    • Arnd Bergmann's avatar
      [media] staging: media: lirc: Replace timeval with ktime_t in lirc_parallel.c · 0dbf41a3
      Arnd Bergmann authored
      'struct timeval tv' and 'struct timeval now' is used to calculate the
      elapsed time. 'LIRC_SFH506_DELAY' is a delay t_phl in usecs.
      
      32-bit systems using 'struct timeval' will break in the year 2038,
      so we have to replace that code with more appropriate types.
      This patch changes the lirc_parallel.c file of  media: lirc driver
      to use ktime_t.
      
      ktime_get() is  better than using do_gettimeofday(),
      because it uses the monotonic clock. ktime_sub is used
      to subtract two ktime variables. ktime_to_us() is used to
      convert ktime to microsecond.
      
      New ktime_t variable timeout, is added in lirc_off(),to improve
      clarity. Introduced a new ktime_t variable in lirc_lirc_irq_handler()
      function, to avoid the use of signal variable for storing
      seconds in the first part of this function as later it uses
      a time unit that is defined by the global "timer" variable.
      This makes it more clear.
      
      ktime_set() is used to set a value in seconds to a value in
      nanosecond so that ktime_compare() can be used appropriately.
      ktime_compare() is used to compare two ktime values.
      ktime_add_ns() is used to increment a ktime value by 1 sec.
      
      One comment is also shifted a line up, as it was creating a 80
      character warning.
      
      Build tested it. Also tested it with sparse.
      Signed-off-by: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0dbf41a3
    • Arnd Bergmann's avatar
      [media] staging: media: lirc: Replace timeval with ktime_t in lirc_sasem.c · f07c73fe
      Arnd Bergmann authored
      'struct timeval presstime' and 'struct timeval tv' is used to
      calculate the time since the last button press.
      
      32-bit systems using 'struct timeval' will break in the year 2038,
      so we have to replace that code with more appropriate types.
      This patch changes the media: lirc driver to use ktime_t.
      
      ktime_get() is  better than using do_gettimeofday(), because it uses
      the monotonic clock. ktime_sub() are used to subtract two ktime
      variables. 'ms' is only used to check how much time has passed by comparing
      to 250. So instead of using expensive ktime_to_ms() call, it has been
      changed to hold nanoseconds by using ktime_to_ns().
      
      Build tested it. Tested with sparse too.
      Signed-off-by: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      f07c73fe
    • Arnd Bergmann's avatar
      [media] staging: media: lirc: Replace timeval with ktime_t in lirc_serial.c · 84595032
      Arnd Bergmann authored
      'struct timeval tv' is used to get current time.
      'static struct timeval lasttv' is used to get last interrupt time.
      
      32-bit systems using 'struct timeval' will break in the year 2038,
      so we have to replace that code with more appropriate types.
      This patch changes the lirc_serial.c file of media: lirc to use
      ktime_t.
      
      ktime_get() is  better than using do_gettimeofday(),
      because it uses the monotonic clock. ktime_sub is used
      to subtract two ktime variables. The check to test time
      going backwards is also removed. Intialization to static
      variable is also removed. ktime_to_us() is used to convert
      ktime_t to microsecond value. deltv is changed to delkt, a
      ktime_t type varibale from long to assign the ktime_sub value
      directly. ktime_compare is used to compare delkt with 15
      seconds, which is changed to a nanosecond value by using
      ktime_set().
      
      Build tested it.
      Signed-off-by: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      84595032
    • Joseph Marrero's avatar
      [media] radio-bcm2048: fix code indent · 21312f6d
      Joseph Marrero authored
      Fixes a warning message found by checkpatch.pl WARNING:
      	suspect code indent for conditional statements
      Signed-off-by: default avatarJoseph Marrero <jmarrero@gmail.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      21312f6d