1. 22 Oct, 2014 5 commits
  2. 21 Oct, 2014 8 commits
  3. 20 Oct, 2014 15 commits
  4. 18 Oct, 2014 1 commit
  5. 17 Oct, 2014 11 commits
    • Alex Elder's avatar
      greybus: update gbuf status for completion handlers · bedfdf30
      Alex Elder authored
      Currently, if a USB urb completes with an error, that error status
      is not transferred back to the gbuf that it's associated with.  For
      inbound data there's not a lot we can do about an error, but for
      outbound data, this means there is no notification to the submitter
      that something went wrong.
      
      For outbound data copy the urb status directly back to the gbuf as
      its status.  Follow USB's lead and set the status to -EINPROGRESS
      while a gbuf is "in flight."  Assign a gbuf an initial status value
      of -EBADR to help identify use of never-set status values.
      
      When an inbound urb fails (SVC or CPort), currently the urb is just
      leaked, more or less (i.e., we lose an urb posted to receive
      incoming data).  Change that so such an error is reported, but
      then re-submitted.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      bedfdf30
    • Alex Elder's avatar
      greybus: add write retry support for i2c · d7528685
      Alex Elder authored
      It is expected that i2c writes may fail, and in that case the driver
      simply retries some number of times before actually treating it as a
      failure.  Define a GB_OP_RETRY status, which is interpreted by the
      i2c driver as an indication a retry is in order.  We just translate
      that into an EAGAIN error passed back to the i2c core.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      d7528685
    • Alex Elder's avatar
      greybus: initial operations-based GPIO driver · bb2e1c96
      Alex Elder authored
      First cut.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      bb2e1c96
    • Alex Elder's avatar
      greybus: add i2c driver · ed8800dc
      Alex Elder authored
      This patch adds the i2c driver, based on the use of Greybus operations
      over Greybus connections.  It basically replaces almost all of what
      was previously found in "i2c-gb.c".
      
      When gb_connection_device_init(connection) is called, any connection
      that talks the GREYBUS_PROTOCOL_I2C is passed to gb_i2c_device_init()
      to be initialized.
      
      Initialization involves verifying the code is able to support the
      version of the protocol.  For I2C, we then query the functionality
      mask, and set the retry count and timeout to default values.
      
      After that, we set up the i2c device and associate it with the
      connection.  The i2c_algorithm methods are then implemented
      by translating them into Greybus operations.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      ed8800dc
    • Alex Elder's avatar
      greybus: kill old cport handlers · 98d35ba2
      Alex Elder authored
      The original CPort message handlers are not needed.  All incoming
      data is passed to handlers based on the protocol used over the
      connection over which the data was transferred.  So get rid of the
      old CPort handler code.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      98d35ba2
    • Alex Elder's avatar
      greybus: kill off gbuf work queue · c149f8ff
      Alex Elder authored
      At this point all incoming messages are handled by the operation
      code, so this obviates the need for the gbuf workqueue.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      c149f8ff
    • Alex Elder's avatar
      greybus: add device initialization · 574341c6
      Alex Elder authored
      Set up the infrastructure for initializing connections based on
      their protocol.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      574341c6
    • Alex Elder's avatar
      greybus: move receive handling to operation layer · 2eb585f8
      Alex Elder authored
      Create a work queue to do the bulk of processing of received
      operation request or response messages.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      2eb585f8
    • Alex Elder's avatar
      greybus: let operation layer examine incoming data · d90c25b0
      Alex Elder authored
      Give the operation layer a chance to examine incoming data so that
      it can handle it appropriately.
      
      Treat the data as an operation message header.  If it's a response,
      look up the operation it's associated with.  If it's not, create a
      new operation.  Copy the incoming data into the request or response
      buffer.  The next patch adds a work queue to pick up handling
      the request or response from there.
      
      Get rid of gb_operation_submit().  Instead, we have two functions,
      one for sending an operation's request message, the other for
      sending an operation's response message.
      
      Not fully functional yet, still just filling things in...
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      d90c25b0
    • Alex Elder's avatar
      greybus: add gb_operation_find() · 84d148b1
      Alex Elder authored
      Add a red-black tree indexed by operation id to a connection to
      allow pending operations (whose requests are in-flight) to be
      found when their matching response is recieved.
      
      Assign the id at the time an operation is inserted, and update
      the operation's message header(s) to include it.
      
      Rename gb_connection_op_id() to be more consistent with the
      naming conventions being used elsewhere.
      
      (Noting now that this may switch to a simple list implementation
      based on Greg's assertion that lists are faster than red-black trees
      for up to a few hundred entries.)
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      84d148b1
    • Alex Elder's avatar
      greybus: add response buffer to an operation · 22b320f4
      Alex Elder authored
      We need to track both request messages and response messages in
      operations.  So add another gbuf (and payload pointer) field to
      the operation structure, and rename them to indicate which one
      is which.  Allow the creator specify the size of the response
      buffer; just leave it a null pointer if the size is 0.
      
      Define a new helper function gb_operation_gbuf_create() to
      encapsulate creating either a request or a response buffer.
      
      Any buffer associated with a connection will (eventually) have been
      created as part of an operation.  So stash the operation pointer in
      the gbuf as the context pointer.  Whether a buffer is for the
      request or the response can be determined by pointer comparison.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      22b320f4