Commit 1700507d authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

greybus: lights: default value for v4l2 flash controls

V4l2 flash will return erro ERANGE if val(which is the default value)
is not defined. Just set it to the max value reported by the module.
Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent d644181f
......@@ -702,6 +702,7 @@ static int __gb_lights_flash_led_register(struct gb_channel *channel)
fset->min = channel->intensity_uA.min;
fset->max = channel->intensity_uA.max;
fset->step = channel->intensity_uA.step;
fset->val = channel->intensity_uA.max;
/* Only the flash mode have the timeout constraints settings */
if (channel->mode & GB_CHANNEL_MODE_FLASH) {
......@@ -709,6 +710,7 @@ static int __gb_lights_flash_led_register(struct gb_channel *channel)
fset->min = channel->timeout_us.min;
fset->max = channel->timeout_us.max;
fset->step = channel->timeout_us.step;
fset->val = channel->timeout_us.max;
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment