mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Merge "msm: camera: fd: Check detected faces limit"
This commit is contained in:
commit
fba1d790f6
1 changed files with 8 additions and 1 deletions
|
@ -258,10 +258,17 @@ static inline void msm_fd_hw_srst(struct msm_fd_device *fd)
|
|||
int msm_fd_hw_get_face_count(struct msm_fd_device *fd)
|
||||
{
|
||||
u32 reg;
|
||||
u32 value;
|
||||
|
||||
reg = msm_fd_hw_read_reg(fd, MSM_FD_IOMEM_CORE, MSM_FD_RESULT_CNT);
|
||||
|
||||
return reg & MSM_FD_RESULT_CNT_MASK;
|
||||
value = reg & MSM_FD_RESULT_CNT_MASK;
|
||||
if (value > MSM_FD_MAX_FACES_DETECTED) {
|
||||
dev_warn(fd->dev, "Face count %d out of limit\n", value);
|
||||
value = MSM_FD_MAX_FACES_DETECTED;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue