diff options
| author | Bhanu Murthy V <bmurthyv@nvidia.com> | 2018-10-30 18:58:29 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-02-01 02:27:46 -0500 |
| commit | b4ca17dc535de02dbd31e1dee5b7d19fa2592a97 (patch) | |
| tree | 020256473801a934211daa75be26e432ffe0877e | |
| parent | 89c28ed8b7cd24ad9470bce81a6f91d2820b8969 (diff) | |
drivers: camera: Add versioning to tvcf
Add version information to identify the right
combination of features enabled in the camera
framework.
Bug 2433156
Change-Id: I2d69308f707a03b8439e6c5ca458680e3babd96d
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1941461
(cherry picked from commit cbe334bde5ad8492973608d8cfda17d3765ad6e9)
Reviewed-on: https://git-master.nvidia.com/r/2006759
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Tested-by: Ian Kaszubski <ikaszubski@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/media/platform/tegra/camera/tegracam_core.c | 18 | ||||
| -rw-r--r-- | include/media/tegracam_core.h | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/drivers/media/platform/tegra/camera/tegracam_core.c b/drivers/media/platform/tegra/camera/tegracam_core.c index 6765f96ad..6e5249c1d 100644 --- a/drivers/media/platform/tegra/camera/tegracam_core.c +++ b/drivers/media/platform/tegra/camera/tegracam_core.c | |||
| @@ -19,6 +19,17 @@ | |||
| 19 | #include <media/tegra-v4l2-camera.h> | 19 | #include <media/tegra-v4l2-camera.h> |
| 20 | #include <media/tegracam_core.h> | 20 | #include <media/tegracam_core.h> |
| 21 | 21 | ||
| 22 | /* use semantic versioning convention */ | ||
| 23 | #define TEGRACAM_MAJOR_VERSION 2 | ||
| 24 | #define TEGRACAM_MINOR_VERSION 0 | ||
| 25 | #define TEGRACAM_PATCH_VERSION 0 | ||
| 26 | |||
| 27 | u32 tegracam_version(u8 major, u8 minor, u8 patch) | ||
| 28 | { | ||
| 29 | return ((major << 16) | (minor << 8) | patch); | ||
| 30 | } | ||
| 31 | EXPORT_SYMBOL_GPL(tegracam_version); | ||
| 32 | |||
| 22 | struct tegracam_device *to_tegracam_device(struct camera_common_data *data) | 33 | struct tegracam_device *to_tegracam_device(struct camera_common_data *data) |
| 23 | { | 34 | { |
| 24 | /* fix this by moving subdev to base struct */ | 35 | /* fix this by moving subdev to base struct */ |
| @@ -119,6 +130,13 @@ int tegracam_device_register(struct tegracam_device *tc_dev) | |||
| 119 | s_data->frmfmt[mode_idx].size.height; | 130 | s_data->frmfmt[mode_idx].size.height; |
| 120 | s_data->def_clk_freq = signal_props->mclk_freq * 1000; | 131 | s_data->def_clk_freq = signal_props->mclk_freq * 1000; |
| 121 | 132 | ||
| 133 | /* add version info to identify the right feature set */ | ||
| 134 | tc_dev->version = tegracam_version(TEGRACAM_MAJOR_VERSION, | ||
| 135 | TEGRACAM_MINOR_VERSION, TEGRACAM_PATCH_VERSION); | ||
| 136 | dev_info(dev, "tegracam sensor driver:%s_v%d.%d.%d\n", | ||
| 137 | tc_dev->name, TEGRACAM_MAJOR_VERSION, | ||
| 138 | TEGRACAM_MINOR_VERSION, TEGRACAM_PATCH_VERSION); | ||
| 139 | |||
| 122 | return 0; | 140 | return 0; |
| 123 | } | 141 | } |
| 124 | EXPORT_SYMBOL_GPL(tegracam_device_register); | 142 | EXPORT_SYMBOL_GPL(tegracam_device_register); |
diff --git a/include/media/tegracam_core.h b/include/media/tegracam_core.h index 5725cb437..8a7cdb9d0 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-2018, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2017-2019, 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, |
| @@ -24,6 +24,7 @@ | |||
| 24 | struct tegracam_device { | 24 | struct tegracam_device { |
| 25 | struct camera_common_data *s_data; | 25 | struct camera_common_data *s_data; |
| 26 | struct media_pad pad; | 26 | struct media_pad pad; |
| 27 | u32 version; | ||
| 27 | /* variables to be filled by the driver to register */ | 28 | /* variables to be filled by the driver to register */ |
| 28 | char name[32]; | 29 | char name[32]; |
| 29 | struct i2c_client *client; | 30 | struct i2c_client *client; |
| @@ -39,6 +40,7 @@ struct tegracam_device { | |||
| 39 | void *priv; | 40 | void *priv; |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 43 | u32 tegracam_version(u8 major, u8 minor, u8 patch); | ||
| 42 | struct tegracam_device *to_tegracam_device(struct camera_common_data *data); | 44 | struct tegracam_device *to_tegracam_device(struct camera_common_data *data); |
| 43 | 45 | ||
| 44 | void tegracam_set_privdata(struct tegracam_device *tc_dev, void *priv); | 46 | void tegracam_set_privdata(struct tegracam_device *tc_dev, void *priv); |
