1
0
Fork 0
Commit Graph

21 Commits (7c154711a6705bbc3036d8f64944e8882fe3fd84)

Author SHA1 Message Date
Gjorgji Rosikopulos 7c154711a6 greybus: camera: add semiplanar and planar formats
This change adds missing planar and semiplanar
formats from gb specification.

Mbus to Gb format map:
V4L2_MBUS_FMT_NV12_1x8 -> 0x12
V4L2_MBUS_FMT_NV21_1x8 -> 0x13
V4L2_MBUS_FMT_YV12_1x8 -> 0x16
V4L2_MBUS_FMT_YU12_1x8 -> 0x17

Change depends on:
"media: add new mediabus format enums for ara camera"

Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-22 15:47:27 -08:00
Gjorgji Rosikopulos 5b0327103f greybus: camera: Update configure stream based on new interface
Interface has been changed.
return code will not return number of configured streams but
just error code.
Number of streams is passed as pointer and if operation result
is changed number of streams will be updated.

Flags are also used for information regarding configure stream
operation result.

Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Acked-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-17 11:16:46 -08:00
Greg Kroah-Hartman b55d9431d6 greybus: Revert "camera: Fix backword compatibility in configure streams"
This reverts commit 48cc91e52dba9abad4c9b56f911994c65071bfc4 as the
caller should be changed instead.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-15 14:41:02 -08:00
Gjorgji Rosikopulos 11ca550c22 greybus: camera: Fix backword compatibility in configure streams
Configure streams ret code should be number of streams in
gb operation exported to HOST camera.
Until gb operation is migrated to new interface return
number of streams in ret code.

Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-15 14:32:00 -08:00
Laurent Pinchart 4068487ce3 greybus: camera: Return the result flags from the configure_streams response
And return the response num_streams field through a pointer variable
instead of using the return value of the function as both an error code
and a positive number of streams, it makes the API more consistent.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-14 16:53:10 -08:00
Gjorgji Rosikopulos 3a8dba4e57 greybus: camera: HACK: Register gb camera to the HOST camera
This change implements gb camera interface and register
gb camera to the HOST driver.
This implementation need to be reworked after the demo.

Tested with db3 with two camera modules.

Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Acked-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-13 15:29:59 -08:00
Greg Kroah-Hartman e527338104 greybus: APBridge: move APBridge request protocol to a common .h file
This moves all of the APBridge request protocol commands that are
currently used to a common .h file for everyone to be able to use them
in the future, where needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Tested-by: Mark Greer <mgreer@animalcreek.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
2016-01-12 11:12:25 -08:00
Greg Kroah-Hartman ed4596e9b1 greybus: host: provide "generic" apbridge output calls
Provide a new function, gb_hd_output() to send data to the apbridge.
This is useful for the camera and audio drivers that need to do this
type of messaging.

The camera driver is converted to use this new function, the audio
driver can use it when it gets merged later.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Tested-by: Mark Greer <mgreer@animalcreek.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
2016-01-12 11:11:49 -08:00
Jacopo Mondi b787d413e0 greybus: camera: Add support for flags to stream_configure
Add support for the flags field of the stream configure request that was
recently added to the camera protocol and update the debugfs arguments
parsing accordingly. The stream configure response layout is also
updated to the latest protocol specification.

Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-08 22:47:07 -08:00
Laurent Pinchart aab4a1a368 greybus: svc: Replace link config hack with standard operation
The link config operation was a hack only designed to fulfill the camera
driver's needs. Now that a standard operation is defined for the same
purpose, implement it and remove the hack.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-08 22:14:08 -08:00
Laurent Pinchart 1f67ee5c04 greybus: camera: Raise the CSI-2 bandwidth
Use 4 lanes at 960MHz to support camera modules requiring higher
bandwidths until we implement support for dynamic bandwidth calculation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-06 17:43:09 -08:00
Johan Hovold 41c2395855 greybus: camera: destroy data connection on link-config errors
Make sure to tear down the data connection also on failure to configure
the link by setting the data_connected flag immediately after creating
the connection.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-30 13:16:06 -08:00
Johan Hovold b9f71bc854 greybus: camera: fix memory leak in capture-request handler
Fix memory leak in capture-request handler by making sure to release the
operation request buffer after sending the request.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-30 13:16:06 -08:00
Johan Hovold 12c8b0dcc8 greybus: camera: fix memory leak in configure-streams error path
Fix memory leak in configure-streams error path by making sure to
release the operation buffers before returning.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-30 13:16:06 -08:00
Laurent Pinchart 98ce3b0a71 greybus: camera: Fix remaining endian conversion issues
Convert all Greybus operation fields between CPU and protocol
endianness.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-21 18:22:43 -08:00
Laurent Pinchart b1c7d67e88 greybus: camera: Set link power mode to HS-G2 with 2 lanes
HS-G1 isn't enough for all camera modules. The gear will need to be
computed dynamically, but for now hardcode it to 2 with 2 lanes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-21 16:38:23 -08:00
Laurent Pinchart 142b21fee0 greybus: camera: Configure the bridge CSI transmitter
Start or stop the CSI transmitter when configuring and unconfiguring the
streams respectively. The CSI configuration parameters are currently
hardcoded.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-21 16:35:27 -08:00
Laurent Pinchart bcc050be96 greybus: camera: Configure link speed for the data connection
Hardcode the speed to HS-G1 for now.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-21 16:34:46 -08:00
Laurent Pinchart c6622216ff greybus: camera: Fix endian conversion issues
Convert all Greybus operation fields between CPU and protocol
endianness.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reported-by: Rui Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-21 16:34:46 -08:00
Greg Kroah-Hartman 4dda744c2a greybus: Camera: remove f_dentry usage
On newer kernels f_dentry is gone, so use f_path.dentry instead.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-14 18:33:19 -08:00
Laurent Pinchart 3265edaf0d greybus: Add driver for the camera class protocol
Integration with the V4L2 camera drivers isn't available yet, a debugfs
interface is exposed instead to call the camera Greybus operations.

The debugfs interface will be kept for module testing purpose in order
to exercise all the protocol operations with various valid and invalid
parameters.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-14 18:12:30 -08:00