28 #include <linux/slab.h>
38 static void h3a_aewb_setup_regs(
struct ispstat *aewb,
void *
priv)
104 static int h3a_aewb_busy(
struct ispstat *aewb)
120 win_count += (win_count + 7) / 8;
125 static int h3a_aewb_validate_params(
struct ispstat *aewb,
void *new_conf)
176 buf_size = h3a_aewb_get_buf_size(user_cfg);
192 static void h3a_aewb_set_params(
struct ispstat *aewb,
void *new_conf)
250 cur_cfg->
buf_size = h3a_aewb_get_buf_size(cur_cfg);
264 unsigned long *en =
arg;
273 .validate_params = h3a_aewb_validate_params,
274 .set_params = h3a_aewb_set_params,
275 .setup_regs = h3a_aewb_setup_regs,
276 .enable = h3a_aewb_enable,
277 .busy = h3a_aewb_busy,
281 .ioctl = h3a_aewb_ioctl,
291 .core = &h3a_aewb_subdev_core_ops,
292 .video = &h3a_aewb_subdev_video_ops,
305 aewb_cfg = kzalloc(
sizeof(*aewb_cfg),
GFP_KERNEL);
309 memset(aewb, 0,
sizeof(*aewb));
310 aewb->
ops = &h3a_aewb_ops;
311 aewb->
priv = aewb_cfg;
317 aewb_recover_cfg = kzalloc(
sizeof(*aewb_recover_cfg),
GFP_KERNEL);
318 if (!aewb_recover_cfg) {
319 dev_err(aewb->
isp->dev,
"AEWB: cannot allocate memory for "
320 "recover configuration.\n");
322 goto err_recover_alloc;
336 if (h3a_aewb_validate_params(aewb, aewb_recover_cfg)) {
337 dev_err(aewb->
isp->dev,
"AEWB: recover configuration is "
343 aewb_recover_cfg->
buf_size = h3a_aewb_get_buf_size(aewb_recover_cfg);
353 kfree(aewb_recover_cfg);