1. 23 May, 2014 6 commits
  2. 20 May, 2014 11 commits
  3. 16 May, 2014 2 commits
  4. 15 May, 2014 8 commits
  5. 14 May, 2014 13 commits
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: configfs: OS Extended Properties descriptors support · 7419485f
      Andrzej Pietrasiewicz authored
      Add handling of OS Extended Properties descriptors from configfs interface.
      One kind of "OS Descriptors" are "Extended Properties" descriptors, which
      need to be specified per interface or per group of interfaces described
      by an IAD. This patch adds support for creating subdirectories
      in interface.<n> directory located in the function's directory.
      Names of subdirectories created become names of properties.
      Each property contains two attributes: "type" and "data".
      The type can be a numeric value 1..7 while data is a blob interpreted
      depending on the type specified.
      The types are:
      1 - unicode string
      2 - unicode string with environment variables
      3 - binary
      4 - little-endian 32-bit
      5 - big-endian 32-bit
      6 - unicode string with a symbolic link
      7 - multiple unicode strings
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7419485f
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: f_rndis: OS Descriptors configfs support · a747b095
      Andrzej Pietrasiewicz authored
      Added handling of OS Descriptors support for f_rndis.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      a747b095
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: configfs: OS Extended Compatibility descriptors support · da424314
      Andrzej Pietrasiewicz authored
      Add handling of OS Extended Compatibility descriptors from configfs interface.
      Hosts which expect the "OS Descriptors" ask only for configurations @ index 0,
      but linux-based USB devices can provide more than one configuration.
      This patch adds marking one of gadget's configurations the configuration
      to be reported at index 0, regardless of the actual sequence of usb_add_config
      invocations used for adding the configurations. The configuration is selected
      by creating a symbolic link pointing to it from the "os_desc" directory
      located at the top of a gadget's directory hierarchy.
      
      One kind of "OS Descriptors" are "Extended Compatibility Descriptors",
      which need to be specified per interface. This patch adds interface.<n>
      directory in function's configfs directory to represent each interface
      defined by the function. Each interface's directory contains two attributes:
      "compatible_id" and "sub_compatible_id", which represent 8-byte
      strings to be reported to the host as the "Compatible ID" and "Sub Compatible
      ID".
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      da424314
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: configfs: OS String support · 87213d38
      Andrzej Pietrasiewicz authored
      Add handling of OS String extension from the configfs interface.
      A directory "os_desc" is added at the top level of a gadget's
      directories hierarchy. In the "os_desc" directory there are
      three attributes: "use", "b_vendor_code" and "qw_sign".
      If "use" contains "0" the OS string is not reported to the host.
      "b_vendor_code" contains a one-byte value which is used
      for custom per-device and per-interface requests.
      "qw_sign" contains an identifier to be reported as the "OS String"
      proper.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      87213d38
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: f_rndis: OS descriptors support · de7a8d2d
      Andrzej Pietrasiewicz authored
      In order for usb functions to expose OS descriptors they
      need to be made aware of OS descriptors. This involves
      extending the "options" structure and setting up
      appropriate associations.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      de7a8d2d
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: OS Feature Descriptors support · 37a3a533
      Andrzej Pietrasiewicz authored
      There is a custom (non-USB IF) extension to the USB standard:
      
      http://msdn.microsoft.com/library/windows/hardware/gg463182
      
      They grant permission to use the specification - there is
      "Microsoft OS Descriptor Specification License Agreement"
      under the link mentioned above, and its Section 2 "Grant
      of License", letter (b) reads:
      
      "Patent license. Microsoft hereby grants to You a nonexclusive,
      royalty-free, nontransferable, worldwide license under Microsoft’s
      patents embodied solely within the Specification and that are owned
      or licensable by Microsoft to make, use, import, offer to sell,
      sell and distribute directly or indirectly to Your Licensees Your
      Implementation. You may sublicense this patent license to Your
      Licensees under the same terms and conditions."
      
      The said extension is maintained by Microsoft for Microsoft.
      
      Yet it is fairly common for various devices to use it, and a
      popular proprietary operating system expects devices to provide
      "OS descriptors", so Linux-based USB gadgets whishing to be able
      to talk to a variety of operating systems should be able to provide
      the "OS descriptors".
      
      This patch adds optional support for gadgets whishing to expose
      the so called "OS Feature Descriptors", that is "Extended Compatibility ID"
      and "Extended Properties".
      
      Hosts which do request "OS descriptors" from gadgets do so during
      the enumeration phase and before the configuration is set with
      SET_CONFIGURATION. What is more, those hosts never ask for configurations
      at indices other than 0. Therefore, gadgets whishing to provide
      "OS descriptors" must designate one configuration to be used with
      this kind of hosts - this is what os_desc_config is added for in
      struct usb_composite_dev. There is an additional advantage to it:
      if a gadget provides "OS descriptors" and designates one configuration
      to be used with such non-USB-compliant hosts it can invoke
      "usb_add_config" in any order because the designated configuration
      will be reported to be at index 0 anyway.
      
      This patch also adds handling vendor-specific requests addressed
      at device or interface and related to handling "OS descriptors".
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      37a3a533
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: OS String support · 19824d5e
      Andrzej Pietrasiewicz authored
      There is a custom (non-USB IF) extension to the USB standard:
      
      http://msdn.microsoft.com/library/windows/hardware/gg463182
      
      They grant permission to use the specification - there is
      "Microsoft OS Descriptor Specification License Agreement"
      under the link mentioned above, and its Section 2 "Grant
      of License", letter (b) reads:
      
      "Patent license. Microsoft hereby grants to You a nonexclusive,
      royalty-free, nontransferable, worldwide license under Microsoft’s
      patents embodied solely within the Specification and that are owned
      or licensable by Microsoft to make, use, import, offer to sell,
      sell and distribute directly or indirectly to Your Licensees Your
      Implementation. You may sublicense this patent license to Your
      Licensees under the same terms and conditions."
      
      The said extension is maintained by Microsoft for Microsoft.
      
      Yet it is fairly common for various devices to use it, and a
      popular proprietary operating system expects devices to provide
      "OS descriptors", so Linux-based USB gadgets whishing to be able
      to talk to a variety of operating systems should be able to provide
      the "OS descriptors".
      
      This patch adds optional support for gadgets whishing to expose
      the so called "OS String" under index 0xEE of language 0.
      The contents of the string is generated based on the qw_sign
      array and b_vendor_code.
      
      Interested gadgets need to set the cdev->use_os_string flag,
      fill cdev->qw_sign with appropriate values and fill cdev->b_vendor_code
      with a value of their choice.
      
      This patch does not however implement responding to any vendor-specific
      USB requests.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      19824d5e
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: FunctionFS: share VLA macros with all usb gadget files · 74d48466
      Andrzej Pietrasiewicz authored
      Variable Length Array macros allow portable (compilable with both gcc
      and clang) way of allocating a number of structures using a single
      memory chunk. They can be useful for files other than f_fs.c,
      so move them to a header file.
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      74d48466
    • Dan Carpenter's avatar
      usb: phy: msm: change devm_ioremap() to devm_ioremap_resource() · 10f0577a
      Dan Carpenter authored
      There are several issues here:
      1) platform_get_resource() can return NULL and that wasn't handled.
      2) We should request the memory before we remap it, and
         devm_ioremap_resource() does that.
      3) devm_ioremap() returns a NULL but we were checking for IS_ERR().
      
      Fixes: 6b99c68e ('usb: phy: msm: Migrate to Managed Device Resource allocation')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      10f0577a
    • Arnd Bergmann's avatar
      usb: phy: msm: reset controller is mandatory now · c5ab571f
      Arnd Bergmann authored
      Commit a2734543 "usb: phy: msm: Use reset framework for LINK
      and PHY resets" introduced a mandatory call to reset_control_get
      into the msm usb phy driver, which means we have to add a Kconfig
      dependency on the API to avoid this build error:
      
      phy/phy-msm-usb.c: In function 'msm_otg_read_dt':
      phy/phy-msm-usb.c:1461:2: error: implicit declaration of function 'devm_reset_control_get' [-Werror=implicit-function-declaration]
        motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
        ^
      
      Since the usb-ehci-msm driver currently selects the OTG driver,
      we could still get a broken dependency here. To solve that,
      this patch also removes the 'select', which turns out to be
      unnecessary.
      Reviewed-by: default avatarIvan T. Ivanov <iivanov@mm-sol.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c5ab571f
    • Arnd Bergmann's avatar
      usb: musb: omap2plus bus glue needs USB host support · a8d191c8
      Arnd Bergmann authored
      The musb/omap2430.c bus glue driver calls usb_hcd_poll_rh_status,
      which is only available if CONFIG_USB is also set, i.e. we
      are building USB host mode and not just endpoint mode.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      a8d191c8
    • Arnd Bergmann's avatar
      usb: musb: tusb-dma can't be built-in if tusb is not · 70c1ff4b
      Arnd Bergmann authored
      A configuration with CONFIG_USB_MUSB_HDRC=y, CONFIG_USB_TUSB_OMAP_DMA=y
      and CONFIG_USB_MUSB_TUSB6010=m causes a link failure because of the
      dependency on the tusb_get_revision symbol:
      
      (.text+0x154ce8): undefined reference to `tusb_get_revision'
      
      This patch ensures that either MUSB_HDRC and MUSB_TUSB6010 are
      both modules or both built-in, which are the valid configurations.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      70c1ff4b
    • Arnd Bergmann's avatar
      usb: gadget: s3c2410_udc: don't use pr_debug return value · 64890edb
      Arnd Bergmann authored
      pr_debug() may be defined as "do { } while (0)" in some configurations,
      which means one cannot rely on the return value to be available.
      
      In the dprintk function in this driver, we can work around the
      resulting build error trivially by returning the length that
      this function already knows and ignoring the return value of
      pr_debug.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: linux-samsung-soc@vger.kernel.org
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      64890edb