summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/control.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-04-13 19:19:01 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-04-21 10:06:00 +0900
commit1ed8cdef405806c246b62a1ba926e0251fdaa531 (patch)
tree17ab7570b85324b9b0066ac3e15571b91e036d5f /drivers/staging/greybus/control.c
parenta530a8be395ff2df384ca729013890f3f040cf99 (diff)
downloadop-kernel-dev-1ed8cdef405806c246b62a1ba926e0251fdaa531.zip
op-kernel-dev-1ed8cdef405806c246b62a1ba926e0251fdaa531.tar.gz
greybus: control: move timesync-operation functions
Move the timesync-operation functions above the control-object management functions, which is where all other operation implementations reside. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/control.c')
-rw-r--r--drivers/staging/greybus/control.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c
index 91a7fca..3c1f664 100644
--- a/drivers/staging/greybus/control.c
+++ b/drivers/staging/greybus/control.c
@@ -177,6 +177,42 @@ int gb_control_get_interface_version_operation(struct gb_interface *intf)
return 0;
}
+int gb_control_timesync_enable(struct gb_control *control, u8 count,
+ u64 frame_time, u32 strobe_delay, u32 refclk)
+{
+ struct gb_control_timesync_enable_request request;
+
+ request.count = count;
+ request.frame_time = cpu_to_le64(frame_time);
+ request.strobe_delay = cpu_to_le32(strobe_delay);
+ request.refclk = cpu_to_le32(refclk);
+ return gb_operation_sync(control->connection,
+ GB_CONTROL_TYPE_TIMESYNC_ENABLE, &request,
+ sizeof(request), NULL, 0);
+}
+
+int gb_control_timesync_disable(struct gb_control *control)
+{
+ return gb_operation_sync(control->connection,
+ GB_CONTROL_TYPE_TIMESYNC_DISABLE, NULL, 0,
+ NULL, 0);
+}
+
+int gb_control_timesync_authoritative(struct gb_control *control,
+ u64 *frame_time, u8 count)
+{
+ struct gb_control_timesync_authoritative_request request;
+ int i;
+
+ for (i = 0; i < GB_TIMESYNC_MAX_STROBES; i++)
+ request.frame_time[i] = cpu_to_le64(frame_time[i]);
+
+ return gb_operation_sync(control->connection,
+ GB_CONTROL_TYPE_TIMESYNC_AUTHORITATIVE,
+ &request, sizeof(request),
+ NULL, 0);
+}
+
struct gb_control *gb_control_create(struct gb_interface *intf)
{
struct gb_control *control;
@@ -240,39 +276,3 @@ void gb_control_destroy(struct gb_control *control)
gb_connection_destroy(control->connection);
kfree(control);
}
-
-int gb_control_timesync_enable(struct gb_control *control, u8 count,
- u64 frame_time, u32 strobe_delay, u32 refclk)
-{
- struct gb_control_timesync_enable_request request;
-
- request.count = count;
- request.frame_time = cpu_to_le64(frame_time);
- request.strobe_delay = cpu_to_le32(strobe_delay);
- request.refclk = cpu_to_le32(refclk);
- return gb_operation_sync(control->connection,
- GB_CONTROL_TYPE_TIMESYNC_ENABLE, &request,
- sizeof(request), NULL, 0);
-}
-
-int gb_control_timesync_disable(struct gb_control *control)
-{
- return gb_operation_sync(control->connection,
- GB_CONTROL_TYPE_TIMESYNC_DISABLE, NULL, 0,
- NULL, 0);
-}
-
-int gb_control_timesync_authoritative(struct gb_control *control,
- u64 *frame_time, u8 count)
-{
- struct gb_control_timesync_authoritative_request request;
- int i;
-
- for (i = 0; i < GB_TIMESYNC_MAX_STROBES; i++)
- request.frame_time[i] = cpu_to_le64(frame_time[i]);
-
- return gb_operation_sync(control->connection,
- GB_CONTROL_TYPE_TIMESYNC_AUTHORITATIVE,
- &request, sizeof(request),
- NULL, 0);
-}
OpenPOWER on IntegriCloud