1
0
Fork 0
Commit Graph

51 Commits (6084653541ac5fb619c4338e6fa6a9d5d4a51713)

Author SHA1 Message Date
Viresh Kumar 3b710ec06e greybus: audio: Rename Audio class and remove the unused one
There should be a single class macro for Audio and two protocol macros.
Rename class with value 0x12 as GREYBUS_CLASS_AUDIO and remove the other
unused class GREYBUS_CLASS_AUDIO_DATA.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-27 17:53:10 -08:00
Laurent Pinchart e61a2a7114 greybus: Add camera protocol definition
Define the camera data protocol ID and all the protocol operations data
structures.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-14 18:12:30 -08:00
Mark Greer 80ee842825 greybus: audio: Allocate protocol and class values
Allocate protocol and class values for the Audio Device Class
Protocol.  Two values of each type are allocated: one for Audio
Management Connections and one for Audio Data Connections.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-16 22:18:52 -08:00
Rui Miguel Silva 2724be0305 greybus: battery: move implementation to power_supply
Rename protocol to POWER_SUPPLY and implementation details from battery
to power_supply.

Also fix some tabs between define and macro name.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-12 16:08:40 -08:00
Mark Greer 357499df45 greybus: i2s: Remove deprecated I2S Bridged-PHY Protocol
The Greybus I2S Bridged-PHY Protocol is deprecated so remove
all support for it from the Greybus code.

CC: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04 20:30:47 -08:00
Viresh Kumar 90f1b617d8 greybus: Add firmware protocol driver
This adds firmware protocol driver based on the latest specs available
on mailing lists. This uses the firmware framework present in kernel.

Refer Documentation/firmware_class/README on how it works.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 22:12:59 -07:00
Viresh Kumar 948b3bd592 greybus: sync protocol and class definitions
Class types aren't in sync with protocol types, lets keep them in sync
for now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-22 10:11:05 -07:00
Viresh Kumar dccbe40ff9 greybus: define more greybus classes
There are new protocols defined which don't belong to any existing
class, add more classes to support them.

Reported-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-30 19:34:47 -07:00
Alex Elder 30c6d9d753 greybus: introduce SVC protocol
This patch adds support for the Greybus SVC protocol.  We may want
to rearrange protocol numbers at some point, since this is a pretty
fundamental protocol.

Note:  It has only been compile tested; no SVC CPorts have yet been
defined, so this code is not yet exercised.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-23 16:54:39 -07:00
Alex Elder 4441f4759c greybus: update copyrights
Update the copyright statements for recently-modified source files.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-23 16:47:56 -07:00
Greg Kroah-Hartman e806c7fb8e greybus: raw: add raw greybus kernel driver
This adds a driver that implements the greybus Raw protocol as
specified.

It preserves the message boundries by only allowing a read to receive
a "full" message, and any write() call also is passed in a single
greybus request.

Totally untested, given that we have no raw firmware or gbsim code yet.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
2015-05-19 11:00:44 -07:00
Rui Miguel Silva 563e6b97b8 greybus: manifest: be coherent with protocol name
remane protocol define from GREYBUS_PROTOCOL_LED to GREYBUS_PROTOCOL_LIGHTS to
be coherent with the specification.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-11 13:32:25 -07:00
Viresh Kumar f03eec8772 greybus: Move id-field before bundle-field in CPort Descriptor.
Note that this also makes sure the id-field is naturally aligned in case
we ever were to remove the __packed attribute.

Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-01 21:08:05 +02:00
Viresh Kumar 499ee955a1 greybus: Explicitly add pad-bytes to manifest descriptors
Explicitly add pad-bytes to manifest descriptors to match their layout
in greybus specification.

Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-01 21:08:05 +02:00
Viresh Kumar b022515ee6 greybus: Remove class descriptor
We carry this information as part of bundle descriptor now and this can
be removed.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-01 21:08:05 +02:00
Viresh Kumar 20f087ec5c greybus: manifest: drop interface-version field
It is not required anymore. Drop it.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-01 21:08:05 +02:00
Viresh Kumar 8a5286ed2a greybus: manifest: Remove vendor, product and unique-id from interface descriptor
These should come from control protocol instead.

For now, initialize this statically with a FIXME to not forget it later.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-01 21:08:05 +02:00
Viresh Kumar af6e8b4233 greybus: Explicitly mark structures as packed
These structures are already marked as __packed, as these are enclosed
within:

	#pragma pack(push, 1)
	#pragma pack(pop)

Lets mark them __packed explicitly.

Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-29 15:51:38 +02:00
Viresh Kumar 88e6d37c44 greybus: bundle: s/class_type/class
Alex suggested to name it class instead of class type.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 12:47:06 +02:00
Viresh Kumar 8e2e22d783 greybus: drop module descriptors
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 12:07:30 +02:00
Viresh Kumar a93db2d1f6 greybus: manifest: Use interface descriptor instead of module descriptor to get information
A module can have more than one interfaces and we get hotplug events or
manifests for interfaces, not modules. Details like version, vendor,
product id, etc. can be different for different interfaces within the
same module and so shall be fetched from interface descriptor instead of
module descriptor.

So what we have been doing for module descriptors until now must be done
for interface descriptors. There can only be one interface descriptor in
the manifest. Module descriptor isn't used anymore and probably most of
its fields can be removed now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 12:05:58 +02:00
Viresh Kumar 83a0cb593b greybus: Add bundle descriptor type
A bundle corresponds to a device and a greybus driver binds to it. This patch
adds a type and descriptor for bundle.

This also shuffles the values of 'enum greybus_descriptor_type' to align
them with Greybus Specifications.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-05 18:12:04 +02:00
Mark Greer 045235f118 greybus: Initial I2S definitions
These are definitions from Mark that I've consolidated into
one header file. I'd like to get these merged at some point
soon, so the audio driver and gbsim work can avoid having
out-of-tree dependencies.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-04 20:31:30 +02:00
Alexandre Bailon 355a705815 greybus: Add loopback protocol
Add a simple Greybus protocol in order to stress USB and Greybus.
This protocol currently support 2 requests: ping and transfer.

ping request is useful to measure latency.
Kernel send a ping request and firmware should respond with a ping.

The transfer request request is useful to stress Greybus and USB.
Kernel can send data from 0 to 4k and the firmware must send back the data to kernel.

This behaviour of gb-loopback module is controlled via sysfs.
Curently, connection sysfs folder is updated with new entries:
- type: Type of loopback message to send
  * 0 => Don't send message
  * 1 => Send ping message continuously (message without payload)
  * 2 => Send transer message continuously (message with payload)
- size: Size of transfer message payload: 0-4096 bytes
- ms_wait: Time to wait between two messages: 0-1024 ms

Module also export some statistics about connection:
- latency: Time to send and receive one message
- frequency: Number of packet sent per second on this cport
- throughput: Quantity of data sent and received on this cport
- error
All this statistics are cleared everytime type, size or ms_wait entries are updated.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2015-03-31 22:53:59 +02:00
Greg Kroah-Hartman 1db0a5ff3a greybus: bundle: s/gb_interface/gb_bundle/g
Rename struct gb_interface to struct gb_bundle

It's a lot of renaming, some structures got renamed and also some
fields, but the goal was to rename things to make sense with the new
naming of how the system is put together in the 'driver model' view.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-13 13:37:49 -05:00
Alex Elder a46e96719d greybus: add Linaro copyrights
I was asked to add a Linaro copyright to all Greybus source files
that anyone at Linaro has modified.  This patch does that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-12 14:15:55 -05:00
Greg Kroah-Hartman 5f474d4943 greybus: greybus_manifest.h: add FIXME for version
The version field is going to go away, but after the demo, not before.
Note that in the header file.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-09 14:57:04 -05:00
Greg Kroah-Hartman 68190676b7 greybus: greybus_manifest.h: update with full list of protocols
The protocol values had gotten out of sync with the Greybus Protocol
specification document, so bring them back into sync by changing a few
values, and adding the missing values.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-11-17 15:19:14 -08:00
Matt Porter 34c6507ca8 greybus: add pwm protocol driver
Add a PWM driver that implements the Greybus PWM protocol.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-11-14 13:10:21 -08:00
Alex Elder 19d03decd3 greybus: register preallocated protocols
Set up protocol structures as static objects in each protocol source
file.  Pass the address of that in--rather than the protocol id and
version information--to the protocol registration routine.  Call a
central routine to register all our pre-defined protocols.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-11-05 14:23:50 -08:00
Alex Elder 7fba0079ad greybus: use protocol_id for numeric values
Switch to using "protocol_id" to refer to a byte-sized numeric
protocol number.  A "protocol" will represent a protocol structure
(created in the next patch).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-29 08:42:17 +08:00
Greg Kroah-Hartman 42d4a22d6b greybus: add LED protocol numbers 2014-10-20 16:02:56 +08:00
Greg Kroah-Hartman 2bb7eae8be greybus: battery: some hooking up to the greybus core
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-20 15:24:57 +08:00
Greg Kroah-Hartman 6ce3e03f71 greybus: greybus_manifest.h: fix up class protocol numbers to match the spec.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-20 13:27:42 +08:00
Greg Kroah-Hartman 9b60aa02ba greybus: greybus_manifest.h: add BSD license so that firmware can share it. 2014-10-06 20:37:53 -07:00
Alex Elder 063e6ec221 greybus: fix greybus_class_type symbol names
These were inadvertently not fixed when the type name was changed.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-03 19:00:10 -07:00
Alex Elder 63cc932b02 greybus: October 1 updates
Update the definitions in "greybus_manifest.h" to reflect the
changes to the Greybus specification made on October 1.

They are:
    - renaming "device" to be "interface"
    - renumbering greybus descriptor type
    - eliminating the notion of a "function"
    - defining a CPort's protocol in the CPort descriptor
    - having a "class" take on the types previously used for "function"
    - renaming "serial number" to be "unique id" (for now)
    - relying on an interface's maximum cport id to determine how
      much device+cport address space the interface consumes
    - adding a simple class descriptor
    - renaming gb_interface->interface_id to be gb_interface->id

This also reorders some things to match ordering in the document,
and adds some commentary for the various structures.

Since greybus_function_type is gone, we eliminate the "type" field
from a function structure.  (Functions are going away, next.)

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-02 21:22:04 -07:00
Alex Elder ecf7d57971 greybus: descriptor type updates
Some more updates to the definition of a manifest descriptor.
    - We get rid of function descriptors.  The type of function is
      easily specified with the CPort it uses.
    - Add a new interface descriptor type.
    - Clean up the CPort descriptor structure, eliminating fields
      that serve no purpose and adding the function id field

The sysfs stuff will be updated a little later to add entries
for the Greybus interfaces associated with modules.

Rearrange the order of a few things in "greybus_manifest.h".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-02 21:17:20 -07:00
Matt Porter 7a57479b1d greybus: remove additional unused fields from the cport descriptor
The Greybus spec was updated to remove some unused fields from the
CPort descriptor definition. Remove them from the structure so
we don't fail manifest parsing.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-10-01 12:16:30 -07:00
Alex Elder 72b0ffc019 greybus: descriptor type is 1 byte
The spec was changed to require only one byte to represent the
type of a module descriptor.  Update our data type and the values
used to reflect that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:07:22 -07:00
Alex Elder 1dd7f58f8e greybus: fix the guard in "greybus_manifest.h"
The tag in the #ifndef guard surrounding the content of
"greybus_manifest.h" needs to be updated to reflect the
actual name of the file.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:06:27 -07:00
Alex Elder cb705e0dd0 greybus: fix document version number
Two spots use the old "0.draft" version number for the Greybus
protocol specification.  We've updated that to be 0.1.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:01:40 -07:00
Alex Elder 908a85d7dd greybus: update a few header file comments
Add a GPLv2 tag and reword some comments at the top of "greybus_desc.h"
and "svc_msg.h".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:01:40 -07:00
Alex Elder 0db32a6d5e greybus: some more renames
This patch renames of symbols, for better clarity and consistency.

    cport -> cport_id (when it represents a cport *number*)
    send_svc_msg -> submit_svc (like submit_gbuf)
    greybus_cport_in_data -> greybus_cport_in
    gb_new_ap_msg -> greybus_svc_in (like greybus_cport_in)
    cport->number -> cport->id (like cport_id)

Making the svc and cport message stuff more similar is done with an
eye toward having SVC messages and messages exchanged with other
modules use some more common communication mechanisms.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:00:55 -07:00
Matt Porter c41a366773 greybus: update descriptor type enums to match renumbering in spec
Greybus spec updated the descriptor type values and added an
additional class descriptor type. Change the enum accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:58:08 -07:00
Matt Porter cbd0fd7b9b greybus: update string descriptor length field to __u8 type to match spec
Greybus spec was updated to make the length field a single byte. Update
the type and remove endian handling of that field in the core.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:33 -07:00
Matt Porter 097724c2fb greybus: remove unused function descriptor fields and change class->function_type
Greybus spec was updated to remove a number of unused function descriptor
fields. In addition, the class field was change to function_type to avoid
confusion with the concept of high-level class drivers.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:33 -07:00
Matt Porter 4fc645494f greybus: remove serial number descriptor to match spec
Greybus spec was updated to remove the serial number descriptor and
move the serial number field to the, now mandatory, module descriptor.
Change everything accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:06 -07:00
Matt Porter 6d63ff7a2d greybus: update descriptor module_id->module to match spec
Greybus spec was updated to change the name of the Module ID descriptor
to simply Module descriptor. Change everything accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:54:08 -07:00
Alex Elder badad68e3a greybus: define struct greybus_manifest
Define a structure that describes the entire greybus manifest.
Adjust greybus_new_module() to use that, making it explicit that
it's not just a header that's being provided to that function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:07:42 -07:00