1. 14 1月, 2013 15 次提交
  2. 03 1月, 2013 1 次提交
    • J
      leds: leds-gpio: set devm_gpio_request_one() flags param correctly · 2d7c22f6
      Javier Martinez Canillas 提交于
      commit a99d76f9 leds: leds-gpio: use gpio_request_one
      
      changed the leds-gpio driver to use gpio_request_one() instead
      of gpio_request() + gpio_direction_output()
      
      Unfortunately, it also made a semantic change that breaks the
      leds-gpio driver.
      
      The gpio_request_one() flags parameter was set to:
      
      GPIOF_DIR_OUT | (led_dat->active_low ^ state)
      
      Since GPIOF_DIR_OUT is 0, the final flags value will just be the
      XOR'ed value of led_dat->active_low and state.
      
      This value were used to distinguish between HIGH/LOW output initial
      level and call gpio_direction_output() accordingly.
      
      With this new semantic gpio_request_one() will take the flags value
      of 1 as a configuration of input direction (GPIOF_DIR_IN) and will
      call gpio_direction_input() instead of gpio_direction_output().
      
      int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
      {
      ..
      	if (flags & GPIOF_DIR_IN)
      		err = gpio_direction_input(gpio);
      	else
      		err = gpio_direction_output(gpio,
      				(flags & GPIOF_INIT_HIGH) ? 1 : 0);
      ..
      }
      
      The right semantic is to evaluate led_dat->active_low ^ state and
      set the output initial level explicitly.
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reported-by: NArnaud Patard <arnaud.patard@rtp-net.org>
      Tested-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      2d7c22f6
  3. 02 1月, 2013 4 次提交
  4. 30 12月, 2012 7 次提交
  5. 27 12月, 2012 6 次提交
  6. 24 12月, 2012 1 次提交
    • R
      Partly revert "[media] uvcvideo: Set error_idx properly for extended controls API failures" · 9c016d61
      Rafael J. Wysocki 提交于
      Commit f0ed2ce8 ("[media] uvcvideo: Set error_idx properly for
      extended controls API failures") causes user space to behave incorrectly
      on one of my test machines (there is no sound under KDE 4.9.4 using
      pulseaudio and there is a knotify4 process occupying one of the CPU
      cores 100% of the time).  Reverting that commit entirely fixes the
      problem for me.
      
      However, commit f0ed2ce8 appears to do more than it follows from its
      changelog, because the changelog only says about the changes related to
      ctrls->error_idx, while the commit additionally changes error codes
      returned by various functions in uvc_ctrl.c and uvc_v4l2.c.  It turns
      out that the changes of the returned error codes confuse the user spce,
      so it is sufficient to revert the part of commit f0ed2ce8 not
      mentioned in its changelog to fix the problem.
      
      [ 'ENOENT' is not a valid error return from an ioctl to begin with, and
        I don't understand how anybody ever even thought it would be.  - Linus ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c016d61
  7. 23 12月, 2012 6 次提交