diff options
| author | Ahung Cheng <ahcheng@nvidia.com> | 2018-01-16 03:41:17 -0500 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-10-17 19:24:39 -0400 |
| commit | b0c4680557b92bef6a7c338b4f995ecf0483362c (patch) | |
| tree | ec7784382eed1e9a82d5dffd4158ca4ef15429f2 /include | |
| parent | b7dd1e66dcf16d88eefe59cbd680118d465fa884 (diff) | |
media: tegra: allocate video_device dynamically
Using initialized static video_device for video_register_device
during sensor re-bind will cause panic with following log.
-----------
kobject (ffffffc0794d70c0): tried to init an initialized object,
something is seriously wrong.
-----------
Hence, modify vi driver to use dynamic video_device
bug 2015230
bug 2719996
Change-Id: Ia7bfb5621e34b54a079c45b3f9aafeaa06407515
Reviewed-on: https://git-master.nvidia.com/r/1639229
Signed-off-by: Frank Chen <frankc@nvidia.com>
(cherry picked from commit 39b1a64a8ee9e40cd4f1a99c2d936e3310e5e8b9)
Reviewed-on: https://git-master.nvidia.com/r/2208308
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shan Neng Chen <snchen@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/mc_common.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/media/mc_common.h b/include/media/mc_common.h index f126ca798..01b034539 100644 --- a/include/media/mc_common.h +++ b/include/media/mc_common.h | |||
| @@ -152,7 +152,7 @@ struct tegra_vi_graph_entity { | |||
| 152 | struct tegra_channel { | 152 | struct tegra_channel { |
| 153 | int id; | 153 | int id; |
| 154 | struct list_head list; | 154 | struct list_head list; |
| 155 | struct video_device video; | 155 | struct video_device *video; |
| 156 | struct media_pad pad; | 156 | struct media_pad pad; |
| 157 | struct media_pipeline pipe; | 157 | struct media_pipeline pipe; |
| 158 | struct mutex video_lock; | 158 | struct mutex video_lock; |
| @@ -396,6 +396,9 @@ void enqueue_inflight(struct tegra_channel *chan, | |||
| 396 | struct tegra_channel_buffer *dequeue_inflight(struct tegra_channel *chan); | 396 | struct tegra_channel_buffer *dequeue_inflight(struct tegra_channel *chan); |
| 397 | int tegra_channel_set_power(struct tegra_channel *chan, bool on); | 397 | int tegra_channel_set_power(struct tegra_channel *chan, bool on); |
| 398 | 398 | ||
| 399 | int tegra_channel_init_video(struct tegra_channel *chan); | ||
| 400 | int tegra_channel_cleanup_video(struct tegra_channel *chan); | ||
| 401 | |||
| 399 | struct tegra_vi_fops { | 402 | struct tegra_vi_fops { |
| 400 | int (*vi_power_on)(struct tegra_channel *chan); | 403 | int (*vi_power_on)(struct tegra_channel *chan); |
| 401 | void (*vi_power_off)(struct tegra_channel *chan); | 404 | void (*vi_power_off)(struct tegra_channel *chan); |
