summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorBhanu Murthy V <bmurthyv@nvidia.com>2018-08-29 18:21:55 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-01-09 03:17:04 -0500
commit0e15664e4eda6e09c799d1d0fb7c791fb59b257c (patch)
treee337d7ecc5882975b101fe95f296749cc9a79143 /include/media
parent647118deb4c0682d1205e4707c4bc6759e05c2ff (diff)
drivers: camera: Move v4l2 subdev ops to tegracam
Move all v4l2 initialization to common framework, ensures most of the duplicated code in sensor drivers reduced. Now sensor drivers will have control and core ops for all operations. New ops - set_mode, start_streaming and stop_streaming are added to modularize sensor drivers. Update current sensor drivers with the new modifications. Bug 2101376 Change-Id: Ic4070bde28f3dce61430af9ecded0541cda2f6fe Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1810324 (cherry picked from commit e5801b45ee0ca88a4d3ea6e98ac24800f1971806) Reviewed-on: https://git-master.nvidia.com/r/1961293 Tested-by: Vincent Chung <vincentc@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: Frank Chen <frankc@nvidia.com> Reviewed-by: Frank Chen <frankc@nvidia.com> Reviewed-by: David Bang <dbang@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/camera_common.h4
-rw-r--r--include/media/tegracam_core.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/include/media/camera_common.h b/include/media/camera_common.h
index cad44c220..ec1503e7b 100644
--- a/include/media/camera_common.h
+++ b/include/media/camera_common.h
@@ -173,6 +173,9 @@ struct camera_common_sensor_ops {
173 int (*power_put)(struct tegracam_device *tc_dev); 173 int (*power_put)(struct tegracam_device *tc_dev);
174 int (*get_framesync)(struct camera_common_data *s_data, 174 int (*get_framesync)(struct camera_common_data *s_data,
175 struct camera_common_framesync *vshs); 175 struct camera_common_framesync *vshs);
176 int (*set_mode)(struct tegracam_device *tc_dev);
177 int (*start_streaming)(struct tegracam_device *tc_dev);
178 int (*stop_streaming)(struct tegracam_device *tc_dev);
176}; 179};
177 180
178 181
@@ -336,6 +339,7 @@ const struct camera_common_colorfmt *camera_common_find_pixelfmt(
336 unsigned int pix_fmt); 339 unsigned int pix_fmt);
337 340
338/* common control layer init */ 341/* common control layer init */
342int tegracam_ctrl_set_overrides(struct tegracam_ctrl_handler *handler);
339int tegracam_ctrl_handler_init(struct tegracam_ctrl_handler *handler); 343int tegracam_ctrl_handler_init(struct tegracam_ctrl_handler *handler);
340int tegracam_init_ctrl_ranges_by_mode( 344int tegracam_init_ctrl_ranges_by_mode(
341 struct tegracam_ctrl_handler *handler, 345 struct tegracam_ctrl_handler *handler,
diff --git a/include/media/tegracam_core.h b/include/media/tegracam_core.h
index 3ad2869e7..5725cb437 100644
--- a/include/media/tegracam_core.h
+++ b/include/media/tegracam_core.h
@@ -1,7 +1,7 @@
1/** 1/**
2 * tegracam_core.h - tegra camera framework core utilities 2 * tegracam_core.h - tegra camera framework core utilities
3 * 3 *
4 * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. 4 * Copyright (c) 2017-2018, NVIDIA Corporation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -39,6 +39,8 @@ struct tegracam_device {
39 void *priv; 39 void *priv;
40}; 40};
41 41
42struct tegracam_device *to_tegracam_device(struct camera_common_data *data);
43
42void tegracam_set_privdata(struct tegracam_device *tc_dev, void *priv); 44void tegracam_set_privdata(struct tegracam_device *tc_dev, void *priv);
43void *tegracam_get_privdata(struct tegracam_device *tc_dev); 45void *tegracam_get_privdata(struct tegracam_device *tc_dev);
44 46