summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBhanu Murthy V <bmurthyv@nvidia.com>2018-11-09 16:37:13 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2019-02-01 02:27:58 -0500
commitd67df23b0aa8740daee98386b6fe09ce0afc4ea5 (patch)
tree72a12b29f48e58bd44d7a39055d33a48c7bb3fd9 /include
parent3ef8b6a33d67d6a7e2d10ed0eede148d88c01152 (diff)
drivers: camera: Add sensor blob utilities
Add utilities for sensor blob creation and writing in CCPLEX. The blob creation will be common across platorms for sensor drivers. Blob writing in CCPLEX will be used based on the RCE support on the platform. Add version in camera common and tvcf supported apis to evaluate and verify blob support in sensor drivers. Bug 2433156 Change-Id: Ie395be7d4ad959ae0efab9e72d1373fa7bd39d27 Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1941462 (cherry picked from commit 187cb4926fbe68e653ba6e372b291da04605c946) Reviewed-on: https://git-master.nvidia.com/r/2006762 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>
Diffstat (limited to 'include')
-rw-r--r--include/media/camera_common.h1
-rw-r--r--include/media/tegracam_utils.h48
2 files changed, 49 insertions, 0 deletions
diff --git a/include/media/camera_common.h b/include/media/camera_common.h
index cf065aac6..be8f41b15 100644
--- a/include/media/camera_common.h
+++ b/include/media/camera_common.h
@@ -233,6 +233,7 @@ struct camera_common_data {
233 int sensor_mode_id; 233 int sensor_mode_id;
234 bool use_sensor_mode_id; 234 bool use_sensor_mode_id;
235 bool override_enable; 235 bool override_enable;
236 u32 version;
236}; 237};
237 238
238struct camera_common_focuser_data; 239struct camera_common_focuser_data;
diff --git a/include/media/tegracam_utils.h b/include/media/tegracam_utils.h
new file mode 100644
index 000000000..fe13a448e
--- /dev/null
+++ b/include/media/tegracam_utils.h
@@ -0,0 +1,48 @@
1/**
2 * tegracam_utils.h - tegra camera framework core utilities
3 *
4 * Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __TEGRACAM_UTILS_H__
20#define __TEGRACAM_UTILS_H__
21
22#include <media/camera_common.h>
23
24enum sensor_opcode {
25 SENSOR_OPCODE_DONE = 0,
26 SENSOR_OPCODE_READ = 1,
27 SENSOR_OPCODE_WRITE = 2,
28 SENSOR_OPCODE_SLEEP = 3,
29};
30
31int convert_table_to_blob(struct sensor_blob *pkt,
32 const struct reg_8 table[],
33 u16 wait_ms_addr, u16 end_addr);
34int write_sensor_blob(struct regmap *regmap, struct sensor_blob *blob);
35
36bool is_tvcf_supported(u32 version);
37
38void conv_u32_u8arr(u32 val, u8 *buf);
39void conv_u16_u8arr(u16 val, u8 *buf);
40
41int prepare_write_cmd(struct sensor_blob *pkt,
42 u32 size, u32 addr, u8 *buf);
43int prepare_read_cmd(struct sensor_blob *pkt,
44 u32 size, u32 addr);
45int prepare_sleep_cmd(struct sensor_blob *pkt, u32 time_in_us);
46int prepare_done_cmd(struct sensor_blob *pkt);
47
48#endif