1. 19 6月, 2017 2 次提交
    • R
      usb: gadget: add f_uac1 variant based on a new u_audio api · 0591bc23
      Ruslan Bilovol 提交于
      This patch adds a new function 'f_uac1'
      (f_uac1 with virtual "ALSA card") that
      uses recently created u_audio API. Comparing
      to legacy f_uac1 function implementation it
      doesn't require any real Audio codec to be
      present on the device. In f_uac1 audio
      streams are simply sinked to and sourced
      from a virtual ALSA sound card created
      using u_audio API.
      
      Legacy f_uac1 approach is to write audio
      samples directly to existing ALSA sound
      card
      
      f_uac1 approach is more generic/flexible
      one - create an ALSA sound card that
      represents USB Audio function and allows to
      be used by userspace application that
      may choose to do whatever it wants with the
      data received from the USB Host and choose
      to provide whatever it wants as audio data
      to the USB Host.
      
      f_uac1 also has capture support (gadget->host)
      thanks to easy implementation via u_audio.
      By default, capture interface has 48000kHz/2ch
      configuration, same as playback channel has.
      
      f_uac1 descriptors naming convention
      uses f_uac2 driver naming convention that
      makes it more common and meaningful.
      
      Comparing to f_uac1_legacy, the f_uac1 doesn't
      have volume/mute functionality. This is because
      the f_uac1 volume/mute feature unit was dummy
      implementation since that driver creation (2009)
      and never had any real volume control or mute
      functionality, so there is no any difference
      here.
      
      Since f_uac1 functionality, exposed
      interface to userspace (virtual ALSA card),
      input parameters are so different comparing
      to f_uac1_legacy, that there is no any
      reason to keep them in the same file/module,
      and separate function was created.
      
      g_audio can be built using one of existing
      UAC functions (f_uac1, f_uac1_legacy or f_uac2)
      Signed-off-by: NRuslan Bilovol <ruslan.bilovol@gmail.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      0591bc23
    • R
      usb: gadget: function: make current f_uac1 implementation legacy · d355339e
      Ruslan Bilovol 提交于
      Before introducing new f_uac1 function (with virtual
      ALSA card) make current implementation legacy.
      
      This includes renaming of existing files, some
      variables, config options and documentation
      Signed-off-by: NRuslan Bilovol <ruslan.bilovol@gmail.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d355339e
  2. 11 6月, 2017 1 次提交
  3. 09 6月, 2017 5 次提交
  4. 03 6月, 2017 2 次提交
  5. 27 5月, 2017 1 次提交
  6. 26 5月, 2017 1 次提交
    • P
      kobject: support passing in variables for synthetic uevents · f36776fa
      Peter Rajnoha 提交于
      This patch makes it possible to pass additional arguments in addition
      to uevent action name when writing /sys/.../uevent attribute. These
      additional arguments are then inserted into generated synthetic uevent
      as additional environment variables.
      
      Before, we were not able to pass any additional uevent environment
      variables for synthetic uevents. This made it hard to identify such uevents
      properly in userspace to make proper distinction between genuine uevents
      originating from kernel and synthetic uevents triggered from userspace.
      Also, it was not possible to pass any additional information which would
      make it possible to optimize and change the way the synthetic uevents are
      processed back in userspace based on the originating environment of the
      triggering action in userspace. With the extra additional variables, we are
      able to pass through this extra information needed and also it makes it
      possible to synchronize with such synthetic uevents as they can be clearly
      identified back in userspace.
      
      The format for writing the uevent attribute is following:
      
          ACTION [UUID [KEY=VALUE ...]
      
      There's no change in how "ACTION" is recognized - it stays the same
      ("add", "change", "remove"). The "ACTION" is the only argument required
      to generate synthetic uevent, the rest of arguments, that this patch
      adds support for, are optional.
      
      The "UUID" is considered as transaction identifier so it's possible to
      use the same UUID value for one or more synthetic uevents in which case
      we logically group these uevents together for any userspace listeners.
      The "UUID" is expected to be in "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      format where "x" is a hex digit. The value appears in uevent as
      "SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" environment variable.
      
      The "KEY=VALUE" pairs can contain alphanumeric characters only. It's
      possible to define zero or more more pairs - each pair is then delimited
      by a space character " ". Each pair appears in synthetic uevents as
      "SYNTH_ARG_KEY=VALUE" environment variable. That means the KEY name gains
      "SYNTH_ARG_" prefix to avoid possible collisions with existing variables.
      To pass the "KEY=VALUE" pairs, it's also required to pass in the "UUID"
      part for the synthetic uevent first.
      
      If "UUID" is not passed in, the generated synthetic uevent gains
      "SYNTH_UUID=0" environment variable automatically so it's possible to
      identify this situation in userspace when reading generated uevent and so
      we can still make a difference between genuine and synthetic uevents.
      Signed-off-by: NPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f36776fa
  7. 17 5月, 2017 1 次提交
    • S
      iio: hid-sensor-hub: Implement batch mode · 138bc796
      Srinivas Pandruvada 提交于
      HID sensor hubs using Integrated Senor Hub (ISH) has added capability to
      support batch mode. This allows host processor to go to sleep for extended
      duration, while the sensor hub is storing samples in its internal buffers.
      
      'Commit f4f4673b ("iio: add support for hardware fifo")' implements
      feature in IIO core to implement such feature. This feature is used in
      bmc150-accel-core.c to implement batch mode. This implementation allows
      software device buffer watermark to be used as a hint to adjust hardware
      FIFO.
      
      But HID sensor hubs don't allow to change internal buffer size of FIFOs.
      Instead an additional usage id to set "maximum report latency" is defined.
      This allows host to go to sleep upto this latency period without getting
      any report. Since there is no ABI to set this latency, a new attribute
      "hwfifo_timeout" is added so that user mode can specify a latency.
      
      This change checks presence of usage id to get/set maximum report latency
      and if present, it will expose hwfifo_timeout.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      138bc796
  8. 07 5月, 2017 2 次提交
  9. 20 4月, 2017 1 次提交
  10. 14 4月, 2017 3 次提交
  11. 13 4月, 2017 2 次提交
  12. 11 4月, 2017 1 次提交
    • Y
      usb: gadget: udc: renesas_usb3: add support for usb role swap · cc995c9e
      Yoshihiro Shimoda 提交于
      This patch adds support for usb role swap via sysfs "role".
      
      For example:
       1) Connect a usb cable using 2 Salvator-X boards.
        - For A-Device, the cable is connected to CN11 (USB3.0 ch0).
        - For B-Device, the cable is connected to CN9 (USB2.0 ch0).
       2) On A-Device, you input the following command:
        # echo peripheral > /sys/devices/platform/soc/ee020000.usb/role
       3) On B-Device, you input the following command:
        # echo host > /sys/devices/platform/soc/ee080200.usb-phy/role
      
      Then, the A-Device acts as a peripheral and the B-Device acts as
      a host. Please note that A-Device must input the following command
      if you want the board to act as a host again.
       # echo host > /sys/devices/platform/soc/ee020000.usb/role
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      cc995c9e
  13. 09 4月, 2017 3 次提交
  14. 26 3月, 2017 1 次提交
  15. 23 3月, 2017 1 次提交
  16. 09 3月, 2017 1 次提交
  17. 08 3月, 2017 1 次提交
    • J
      livepatch: change to a per-task consistency model · d83a7cb3
      Josh Poimboeuf 提交于
      Change livepatch to use a basic per-task consistency model.  This is the
      foundation which will eventually enable us to patch those ~10% of
      security patches which change function or data semantics.  This is the
      biggest remaining piece needed to make livepatch more generally useful.
      
      This code stems from the design proposal made by Vojtech [1] in November
      2014.  It's a hybrid of kGraft and kpatch: it uses kGraft's per-task
      consistency and syscall barrier switching combined with kpatch's stack
      trace switching.  There are also a number of fallback options which make
      it quite flexible.
      
      Patches are applied on a per-task basis, when the task is deemed safe to
      switch over.  When a patch is enabled, livepatch enters into a
      transition state where tasks are converging to the patched state.
      Usually this transition state can complete in a few seconds.  The same
      sequence occurs when a patch is disabled, except the tasks converge from
      the patched state to the unpatched state.
      
      An interrupt handler inherits the patched state of the task it
      interrupts.  The same is true for forked tasks: the child inherits the
      patched state of the parent.
      
      Livepatch uses several complementary approaches to determine when it's
      safe to patch tasks:
      
      1. The first and most effective approach is stack checking of sleeping
         tasks.  If no affected functions are on the stack of a given task,
         the task is patched.  In most cases this will patch most or all of
         the tasks on the first try.  Otherwise it'll keep trying
         periodically.  This option is only available if the architecture has
         reliable stacks (HAVE_RELIABLE_STACKTRACE).
      
      2. The second approach, if needed, is kernel exit switching.  A
         task is switched when it returns to user space from a system call, a
         user space IRQ, or a signal.  It's useful in the following cases:
      
         a) Patching I/O-bound user tasks which are sleeping on an affected
            function.  In this case you have to send SIGSTOP and SIGCONT to
            force it to exit the kernel and be patched.
         b) Patching CPU-bound user tasks.  If the task is highly CPU-bound
            then it will get patched the next time it gets interrupted by an
            IRQ.
         c) In the future it could be useful for applying patches for
            architectures which don't yet have HAVE_RELIABLE_STACKTRACE.  In
            this case you would have to signal most of the tasks on the
            system.  However this isn't supported yet because there's
            currently no way to patch kthreads without
            HAVE_RELIABLE_STACKTRACE.
      
      3. For idle "swapper" tasks, since they don't ever exit the kernel, they
         instead have a klp_update_patch_state() call in the idle loop which
         allows them to be patched before the CPU enters the idle state.
      
         (Note there's not yet such an approach for kthreads.)
      
      All the above approaches may be skipped by setting the 'immediate' flag
      in the 'klp_patch' struct, which will disable per-task consistency and
      patch all tasks immediately.  This can be useful if the patch doesn't
      change any function or data semantics.  Note that, even with this flag
      set, it's possible that some tasks may still be running with an old
      version of the function, until that function returns.
      
      There's also an 'immediate' flag in the 'klp_func' struct which allows
      you to specify that certain functions in the patch can be applied
      without per-task consistency.  This might be useful if you want to patch
      a common function like schedule(), and the function change doesn't need
      consistency but the rest of the patch does.
      
      For architectures which don't have HAVE_RELIABLE_STACKTRACE, the user
      must set patch->immediate which causes all tasks to be patched
      immediately.  This option should be used with care, only when the patch
      doesn't change any function or data semantics.
      
      In the future, architectures which don't have HAVE_RELIABLE_STACKTRACE
      may be allowed to use per-task consistency if we can come up with
      another way to patch kthreads.
      
      The /sys/kernel/livepatch/<patch>/transition file shows whether a patch
      is in transition.  Only a single patch (the topmost patch on the stack)
      can be in transition at a given time.  A patch can remain in transition
      indefinitely, if any of the tasks are stuck in the initial patch state.
      
      A transition can be reversed and effectively canceled by writing the
      opposite value to the /sys/kernel/livepatch/<patch>/enabled file while
      the transition is in progress.  Then all the tasks will attempt to
      converge back to the original patch state.
      
      [1] https://lkml.kernel.org/r/20141107140458.GA21774@suse.czSigned-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NMiroslav Benes <mbenes@suse.cz>
      Acked-by: Ingo Molnar <mingo@kernel.org>        # for the scheduler changes
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d83a7cb3
  18. 05 3月, 2017 1 次提交
  19. 25 2月, 2017 1 次提交
    • H
      leds: class: Add new optional brightness_hw_changed attribute · b8c5099b
      Hans de Goede 提交于
      Some LEDs may have their brightness level changed autonomously
      (outside of kernel control) by hardware / firmware. This commit
      adds support for an optional brightness_hw_changed attribute to
      signal such changes to userspace (if a driver can detect them):
      
      What:		/sys/class/leds/<led>/brightness_hw_changed
      Date:		January 2017
      KernelVersion:	4.11
      Description:
      		Last hardware set brightness level for this LED. Some LEDs
      		may be changed autonomously by hardware/firmware. Only LEDs
      		where this happens and the driver can detect this, will
      		have this file.
      
      		This file supports poll() to detect when the hardware
      		changes the brightness.
      
      		Reading this file will return the last brightness level set
      		by the hardware, this may be different from the current
      		brightness.
      
      Drivers which want to support this, simply add LED_BRIGHT_HW_CHANGED to
      their flags field and call led_classdev_notify_brightness_hw_changed()
      with the hardware set brightness when they detect a hardware / firmware
      triggered brightness change.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJacek Anaszewski <jacek.anaszewski@gmail.com>
      b8c5099b
  20. 23 2月, 2017 1 次提交
  21. 15 2月, 2017 1 次提交
  22. 11 2月, 2017 3 次提交
  23. 01 2月, 2017 1 次提交
  24. 31 1月, 2017 1 次提交
  25. 30 1月, 2017 2 次提交
    • S
      [media] rc: change wakeup_protocols to list all protocol variants · 0751d33c
      Sean Young 提交于
      For IR wakeup, a driver has to program the hardware to wakeup at a
      specific IR sequence, so it makes no sense to allow multiple wakeup
      protocols to be selected. In the same manner the sysfs interface only
      allows one scancode to be provided.
      
      In addition, we need to know the specific variant of the protocol.
      
      In short, these changes are made to the wakeup_protocols sysfs entry:
       - list all the protocol variants rather than the protocol groups,
         e.g. "nec nec-x nec-32" rather than just "nec".
       - only allow one protocol variant to be selected rather than multiple
       - wakeup_filter can only be set once a protocol has been selected in
         wakeup_protocols.
      
      This is an API change, however the only user of this API is the img-ir,
      but the wakeup code was never merged to mainline, so it was never used.
      Signed-off-by: NSean Young <sean@mess.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Sifan Naeem <sifan.naeem@imgtec.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      0751d33c
    • H
      leds: class: Add new optional brightness_hw_changed attribute · 0cb8eb30
      Hans de Goede 提交于
      Some LEDs may have their brightness level changed autonomously
      (outside of kernel control) by hardware / firmware. This commit
      adds support for an optional brightness_hw_changed attribute to
      signal such changes to userspace (if a driver can detect them):
      
      What:		/sys/class/leds/<led>/brightness_hw_changed
      Date:		January 2017
      KernelVersion:	4.11
      Description:
      		Last hardware set brightness level for this LED. Some LEDs
      		may be changed autonomously by hardware/firmware. Only LEDs
      		where this happens and the driver can detect this, will
      		have this file.
      
      		This file supports poll() to detect when the hardware
      		changes the brightness.
      
      		Reading this file will return the last brightness level set
      		by the hardware, this may be different from the current
      		brightness.
      
      Drivers which want to support this, simply add LED_BRIGHT_HW_CHANGED to
      their flags field and call led_classdev_notify_brightness_hw_changed()
      with the hardware set brightness when they detect a hardware / firmware
      triggered brightness change.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJacek Anaszewski <jacek.anaszewski@gmail.com>
      0cb8eb30