| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Frame Interval Monitor. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2016 Mentor Graphics Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | #include <linux/delay.h> |
|---|
| 12 | 8 | #include <linux/irq.h> |
|---|
| .. | .. |
|---|
| 41 | 37 | #define FIM_CL_TOLERANCE_MAX_DEF 0 /* no max tolerance (unbounded) */ |
|---|
| 42 | 38 | |
|---|
| 43 | 39 | struct imx_media_fim { |
|---|
| 44 | | - struct imx_media_dev *md; |
|---|
| 45 | | - |
|---|
| 46 | 40 | /* the owning subdev of this fim instance */ |
|---|
| 47 | 41 | struct v4l2_subdev *sd; |
|---|
| 48 | 42 | |
|---|
| .. | .. |
|---|
| 420 | 414 | |
|---|
| 421 | 415 | spin_unlock_irqrestore(&fim->lock, flags); |
|---|
| 422 | 416 | } |
|---|
| 423 | | -EXPORT_SYMBOL_GPL(imx_media_fim_eof_monitor); |
|---|
| 424 | 417 | |
|---|
| 425 | 418 | /* Called by the subdev in its s_stream callback */ |
|---|
| 426 | 419 | int imx_media_fim_set_stream(struct imx_media_fim *fim, |
|---|
| .. | .. |
|---|
| 457 | 450 | v4l2_ctrl_unlock(fim->ctrl[FIM_CL_ENABLE]); |
|---|
| 458 | 451 | return ret; |
|---|
| 459 | 452 | } |
|---|
| 460 | | -EXPORT_SYMBOL_GPL(imx_media_fim_set_stream); |
|---|
| 461 | 453 | |
|---|
| 462 | 454 | int imx_media_fim_add_controls(struct imx_media_fim *fim) |
|---|
| 463 | 455 | { |
|---|
| 464 | 456 | /* add the FIM controls to the calling subdev ctrl handler */ |
|---|
| 465 | 457 | return v4l2_ctrl_add_handler(fim->sd->ctrl_handler, |
|---|
| 466 | | - &fim->ctrl_handler, NULL); |
|---|
| 458 | + &fim->ctrl_handler, NULL, false); |
|---|
| 467 | 459 | } |
|---|
| 468 | | -EXPORT_SYMBOL_GPL(imx_media_fim_add_controls); |
|---|
| 469 | 460 | |
|---|
| 470 | 461 | /* Called by the subdev in its subdev registered callback */ |
|---|
| 471 | 462 | struct imx_media_fim *imx_media_fim_init(struct v4l2_subdev *sd) |
|---|
| .. | .. |
|---|
| 477 | 468 | if (!fim) |
|---|
| 478 | 469 | return ERR_PTR(-ENOMEM); |
|---|
| 479 | 470 | |
|---|
| 480 | | - /* get media device */ |
|---|
| 481 | | - fim->md = dev_get_drvdata(sd->v4l2_dev->dev); |
|---|
| 482 | 471 | fim->sd = sd; |
|---|
| 483 | 472 | |
|---|
| 484 | 473 | spin_lock_init(&fim->lock); |
|---|
| .. | .. |
|---|
| 489 | 478 | |
|---|
| 490 | 479 | return fim; |
|---|
| 491 | 480 | } |
|---|
| 492 | | -EXPORT_SYMBOL_GPL(imx_media_fim_init); |
|---|
| 493 | 481 | |
|---|
| 494 | 482 | void imx_media_fim_free(struct imx_media_fim *fim) |
|---|
| 495 | 483 | { |
|---|
| 496 | 484 | v4l2_ctrl_handler_free(&fim->ctrl_handler); |
|---|
| 497 | 485 | } |
|---|
| 498 | | -EXPORT_SYMBOL_GPL(imx_media_fim_free); |
|---|