diff options
author | paulhsia <paulhsia@chromium.org> | 2018-09-05 16:13:23 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-05 21:04:36 -0700 |
commit | a6758bdc8969b0fc3c4af394616d93d1af9c4337 (patch) | |
tree | 31efed29041545101774d80af808ff6dcbc541b9 | |
parent | 98f1499da5364697ec2155c6354f7aa7cc4a7b78 (diff) | |
download | adhd-a6758bdc8969b0fc3c4af394616d93d1af9c4337.tar.gz |
CRAS: Refactor comments and coding style in dev_io
Refactor comments and some style error related to larger block_size stream
support.
BUG=b:112860209
TEST=emerge-BOARD -v adhd
Change-Id: Ie9891720b03f067cb2e4c54898f345be9c5fc29e
Reviewed-on: https://chromium-review.googlesource.com/1206093
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
-rw-r--r-- | cras/src/server/dev_io.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cras/src/server/dev_io.c b/cras/src/server/dev_io.c index 0d22874a..e3931ea2 100644 --- a/cras/src/server/dev_io.c +++ b/cras/src/server/dev_io.c @@ -19,11 +19,6 @@ #include "dev_io.h" -/* The minimum wake time for a input device, which is 5ms */ -static const struct timespec min_input_dev_wake_ts = { - 0, 5 * 1000 * 1000 /* 5 ms. */ -}; - static const struct timespec playback_wake_fuzz_ts = { 0, 500 * 1000 /* 500 usec. */ }; @@ -253,6 +248,14 @@ static unsigned int get_stream_limit( } /* + * The minimum wake time for a input device, which is 5ms. It's only used by + * function get_input_dev_max_wake_ts. + */ +static const struct timespec min_input_dev_wake_ts = { + 0, 5 * 1000 * 1000 /* 5 ms. */ +}; + +/* * Get input device maximum sleep time, which is the approximate time that the * device will have hw_level = buffer_size / 2 samples. Some devices have * capture period = 2 so the audio_thread should wake up and consume some @@ -261,7 +264,6 @@ static unsigned int get_stream_limit( * * Returns: 0 on success negative error on device failure. */ - static int get_input_dev_max_wake_ts( struct open_dev *adev, unsigned int curr_level, @@ -352,8 +354,7 @@ static int set_input_dev_wake_ts(struct open_dev *adev) } if(adev->dev->active_node && - adev->dev->active_node->type != CRAS_NODE_TYPE_HOTWORD) - { + adev->dev->active_node->type != CRAS_NODE_TYPE_HOTWORD) { rc = get_input_dev_max_wake_ts(adev, curr_level, &dev_wake_ts); if(rc < 0) { syslog(LOG_ERR, |