diff options
author | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2016-06-05 14:03:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-06-06 20:50:08 -0700 |
commit | 4a4484274f7431c68e104a66b497639e1ac9022c (patch) | |
tree | dcbfee4f8cb5700cf650f66ab84c93dffc7cc8fd /drivers/staging/greybus/core.c | |
parent | 970dc85bd95d931def5926ae81b5aa84ef14fb7c (diff) |
greybus: timesync: Bind TimeSync into Greybus
TimeSync needs to bind into Greybus in a few places.
- core.c
To initialize its internal state and tear-down its internal state.
To schedule a timesync to a newly added Bundle after probe() completes.
- svc.c
To get access to the SVC and enable/disable timesync as well as
extracting the authoritative time from the SVC to subsequently
disseminate to other entities in the system.
- interface.c
To get access to an Interface in order to inform APBx of timesync
enable/disable and authoritative operations.
This patch adds those bindings into Greybus core.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Acked-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r-- | drivers/staging/greybus/core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 7350c5eba7e9..c8129068001d 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -178,6 +178,8 @@ static int greybus_probe(struct device *dev) return retval; } + gb_timesync_schedule_asynchronous(bundle->intf); + return 0; } @@ -267,8 +269,15 @@ static int __init gb_init(void) goto error_bootrom; } + retval = gb_timesync_init(); + if (retval) { + pr_err("gb_timesync_init failed\n"); + goto error_timesync; + } return 0; /* Success */ +error_timesync: + gb_bootrom_exit(); error_bootrom: gb_operation_exit(); error_operation: @@ -284,6 +293,7 @@ module_init(gb_init); static void __exit gb_exit(void) { + gb_timesync_exit(); gb_bootrom_exit(); gb_operation_exit(); gb_hd_exit(); |