The pattern generator should be enabled while camera is not running.
So, a checking state is added if pattern generator can be enable or not.
Change-Id: I0664949d7c31c69d52cfcc68bfbfc7d8928201b4
Signed-off-by: Wooki Min <wooki.min@samsung.com>
{
int ret = 0;
unsigned long cmd;
+ struct fimc_is_core *core =
+ (struct fimc_is_core *)platform_get_drvdata(to_platform_device(dev));
ret = kstrtoul(buf, 0, &cmd);
if (ret)
switch (cmd) {
case 0:
case 1:
- sysfs_debug.pattern_en = cmd;
+ if (atomic_read(&core->rsccount))
+ pr_warn("%s: patter generator cannot be enabled while camera is running.\n", __func__);
+ else
+ sysfs_debug.pattern_en = cmd;
break;
default:
pr_warn("%s: invalid paramter (%lu)\n", __func__, cmd);