Commit Graph

3 Commits

Author SHA1 Message Date
Nick Sanders
750b4525da servo_micro: add USB I2C interface
Add a usb endpoint and class for i2c control via USB.
Used for servo micro and servo_v4 to export USB control
through servod.

BUG=chromium:571477
BRANCH=None
TEST=updated servod is able to control gpio extender on servo_micro

Signed-off-by: Nick Sanders <nsanders@google.com>

Change-Id: Id44096f8c9e2da917c0574d28dfcbcc0adf31950
Reviewed-on: https://chromium-review.googlesource.com/329322
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-03-15 21:49:35 -07:00
Bill Richardson
9167ce0232 usb: Put HID descriptor in the correct order
From the "Device Class Definition for Human Interface Devices" spec:

  When a Get_Descriptor(Configuration) request is issued, it
  returns the Configuration descriptor, all Interface
  descriptors, all Endpoint descriptors, and the HID descriptor
  for each interface. It shall not return the String descriptor,
  HID Report descriptor or any of the optional HID class
  descriptors. The HID descriptor shall be interleaved between
  the Interface and Endpoint descriptors for HID Interfaces. That
  is, the order shall be:

  Configuration descriptor
    Interface descriptor (specifying HID Class)
      HID descriptor (associated with above Interface)
        Endpoint descriptor (for HID Interrupt In Endpoint)
        Optional Endpoint descriptor (for HID Interrupt Out Endpoint)

This makes that happen.

BUG=chrome-os-partner:34893
BRANCH=none
TEST=manual

"make buildall" works, this image seems to work on the Cr50.

Also, before this CL, I see this:

  0x00060f5c 0x00000000       .rodata    g  NOTYPE __usb_desc
  0x00060f5c 0x00000009       .rodata    g  OBJECT usb_desc_conf
  0x00060f65 0x00000009       .rodata    g  OBJECT usb_desc_iface0_0iface
  0x00060f6e 0x00000007       .rodata    g  OBJECT usb_desc_iface0_1ep0
  0x00060f75 0x00000007       .rodata    g  OBJECT usb_desc_iface0_1ep1
  0x00060f7c 0x00000009       .rodata    g  OBJECT usb_desc_iface1_0iface
  0x00060f85 0x00000007       .rodata    g  OBJECT usb_desc_iface1_1ep81
  0x00060f8c 0x00000009       .rodata    g  OBJECT usb_desc_iface1_2hid
  0x00060f95 0x00000000       .rodata    g  NOTYPE __usb_desc_end

and after, this:

  0x00060f5c 0x00000000       .rodata    g  NOTYPE __usb_desc
  0x00060f5c 0x00000009       .rodata    g  OBJECT usb_desc_conf
  0x00060f65 0x00000009       .rodata    g  OBJECT usb_desc_iface0_0iface
  0x00060f6e 0x00000007       .rodata    g  OBJECT usb_desc_iface0_2ep0
  0x00060f75 0x00000007       .rodata    g  OBJECT usb_desc_iface0_2ep1
  0x00060f7c 0x00000009       .rodata    g  OBJECT usb_desc_iface1_0iface
  0x00060f85 0x00000009       .rodata    g  OBJECT usb_desc_iface1_1hid
  0x00060f8e 0x00000007       .rodata    g  OBJECT usb_desc_iface1_2ep81
  0x00060f95 0x00000000       .rodata    g  NOTYPE __usb_desc_end

The HID descriptor comes before the endpoint.

Change-Id: I8035a4cc884d8bb900bc1eb25fd3e4e9aba05bf8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/314832
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-12-01 18:52:52 -08:00
Shawn Nematbakhsh
6f4595ff7a cleanup: Rename usb.h to usb_descriptor.h
Rename usb.h to usb_descriptor.h to prevent conflict with a
commonly-used libusb header.

BUG=chromium:552006
BRANCH=None
TEST=`make buildall -j`

Change-Id: I6145ce120e1fda41bc5c4d4da0313272e76839c7
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311429
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-08 17:31:11 -08:00