Commit graph

1038 commits

Author SHA1 Message Date
Viresh Kumar a404504a86 greybus: vibrator: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 0a12a187fd greybus: usb: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar a94e144864 greybus: uart: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 3fb0c8f516 greybus: spi: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 7071ca1df5 greybus: sdio: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar f06eda1b17 greybus: raw: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 2e93d02c18 greybus: pwm: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 47d3cfbbad greybus: loopback: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar d8886f4a06 greybus: i2c: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 2dad338c9c greybus: hid: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 03490fdbe7 greybus: gpio: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 507d75c4f4 greybus: control: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar f8cbc30de0 greybus: battery: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 9937a60a06 greybus: audio: Drop get_version support
This is done from a common place now, no need to replicate it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 19:33:05 -07:00
Viresh Kumar 7ba26a8ced greybus: connection: request protocol version before initializing connection
This can (should) be done from a common place as its required for most
of the protocols. Do it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:53:43 -07:00
Viresh Kumar d653f4b191 greybus: connection: Save major/minor supported by module
Save major/minor number supported by the module inside connection
structure, as this can be used later.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:53:43 -07:00
Viresh Kumar 2b11a45d29 greybus: define greybus wide protocol request numbers
Some request numbers (like invalid and get_version) are same across all
protocols. Create common macros for them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:48:32 -07:00
Viresh Kumar 1869065902 greybus: connection: disconnect connection on failures during initialization
Its possible for connection_init() to fail, in such cases the
disconnected event must be sent to the module.

It is missing currently, fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:48:32 -07:00
Viresh Kumar 0c32d2a5b2 greybus: svc: error out only for smaller payloads received
!= was used in place of <, while comparing expected and actual payload
size. The module may be running a higher version of the protocol and
might have some extra fields (towards the end) in the structure, and the
AP needs to ignore them.

This also updates the print (expected-payload-size <
actual-payload-size), when the size doesn't match for requests received
by the module. This gives more details required for debugging.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:46:57 -07:00
Viresh Kumar 10c7ae04e3 greybus: audio: Add '<' to the print message for short messages
This increases readability a bit more, as it tells which value is actual
size and which one is expected size.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:46:57 -07:00
Viresh Kumar 33f06a75ee greybus: svc: Remove FIXME for firmware download
Its handled by the firmware driver now, drop the FIXME comment from svc
code.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11 17:46:57 -07:00
Viresh Kumar f0a1698f18 greybus: vibrator: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar f514b5c314 greybus: usb: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 9475fb5c5a greybus: uart: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 7549219d4e greybus: spi: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 3fb97e43ba greybus: pwm: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar bbd80cc166 greybus: i2c: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 34ec36457f greybus: hid: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 8590ed30be greybus: gpio: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar 8cbd20aa0d greybus: battery: Use (already defined) major/minor macros
We already have macros for these, use them instead of writing fixed
values.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:46 -07:00
Viresh Kumar d79ae495e2 greybus: hid: spell fix (s/infomation/information)
Minor spell fix.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:40:45 -07:00
Viresh Kumar f1f6fa44ae greybus: sdio: error out only for smaller payloads received
!= was used in place of <, while comparing expected and actual payload
size. The module may be running a higher version of the protocol and
might have some extra fields (towards the end) in the structure, and the
AP needs to ignore them.

This also updates the print (expected-payload-size <
actual-payload-size), when the size doesn't match for requests received
by the module. This gives more details required for debugging.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:36:55 -07:00
Viresh Kumar 782c3b7328 greybus: gpio: Print expected/actual payload size on mismatch
Print (expected-payload-size actual-payload-size), when the size doesn't
match for requests received by the module. This gives more details
required for debugging the issue.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:28:30 -07:00
Viresh Kumar 7fea641c94 greybus: raw: Print expected/actual payload size on mismatch
Print (expected-payload-size actual-payload-size), when the size doesn't
match for requests received by the module. This gives more details
required for debugging the issue.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-10 17:28:30 -07:00
Alex Elder 47a96858b5 greybus: kernel_ver.h: define U32_MAX and U64_MAX
These were not defined, and I just posted patches that use them.

Signed-off-by: Alex Elder <elder@linaro.org>
Tested-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-04 12:46:37 -07:00
Alex Elder 1fb807cf6d greybus: loopback: fix connection cleanup paths
The error paths in gb_loopback_connection_init() are kind of screwed
up--not in proper order, and the label naming convention seems a
little inconsistent.

Fix this, ensuring each error cleans up the setup that's been done
up to that point.  Use the convention that the label indicates the
first thing that needs to be cleaned up.

Reorder the statements in gb_loopback_connection_exit() to match
the order of cleanup in gb_loopback_connection_init().

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:13:19 -07:00
Alex Elder ff71d395f3 greybus: loopback: compute average stats on demand only
Stop recording and updating the average every time a sample
is recorded.  Instead, compute it from the sum and count only
when it's required.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:12:50 -07:00
Alex Elder 7a135a965c greybus: loopback: use separate attribute macro for average
Define a separate macro for displaying the average of the samples
collected.  This will be used so we can calculate the average only
when requested, rather than every time a new value gets recorded.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:12:50 -07:00
Alex Elder 19c2a443c9 greybus: loopback: all read-only attributes are unsigned
The only values passed to the gb_loopback_ro_attr() macro are
unsigned 32-bit values.  So there's no need to pass a "type"
format specifier.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:12:50 -07:00
Alex Elder b937aa9e2a greybus: loopback: error is an unsigned attribute
The error count is unsigned, so fix the format specifier used in its
attribute definition.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:12:50 -07:00
Alex Elder e13fc28f72 greybus: loopback: use a 32-bit count
The count of statistical samples recorded is currently a 64-bit
value.  32 bits is sufficient, and in fact anything more than
that won't work for the do_div() call it's pass to anyway.  So make
the count field be 32 bits.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder e051c82b2b greybus: loopback: record 32-bit min and max
The minimum and maximum values for stats values are always 32 bits.
Change the type for these fields to reflect this.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder a6e7e53548 greybus: loopback: use u32 for stats update
The only values supplied to gb_loopback_update_stats() are 32-bits,
so change the type of the second argument to reflect that.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder 3320e78455 greybus: loopback: use U64_MAX for initialization
Use the largest representable value when initializing the "min"
field when resetting loopback statistics.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder 3f12c3ed21 greybus: loopback: drop unneeded casts for void pointers
There is no need to cast a void pointer to a particular type.
Drop the casts used in this way, mainly in the attribute definition
macros.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder 006335a026 greybus: looback: fix two typos
Fix two misspellings.  And add spaces around a '%' operator.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:49 -07:00
Alex Elder bfb287a17e greybus: interface: declare gb_interface_destroy()
Add a public declaration for gb_interface_destroy(), matching
gb_interface_create().

It's not yet used outside "interface.c" but I suppose it
could be, and its scope is currently public.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:11:48 -07:00
Johan Hovold 5b559e6457 greybus: greybus_protocols: use only type attributes for message packing
For consistency reasons, use only type attributes for message packing.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:00:41 -07:00
Johan Hovold 8bbd9edcb7 greybus: sdio: fix message packing
Add missing packed attributes to prevent implicit structure padding.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:00:41 -07:00
Johan Hovold cfc5f2c6de greybus: uart: fix message packing
Add missing packed attributes to prevent implicit structure padding.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-03 20:00:41 -07:00