summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJonathan Sachs <jsachs@nvidia.com>2020-08-24 13:23:15 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2020-08-30 15:23:38 -0400
commitcbb2711e952b18d5b671d491bb79ae70dfd3aa25 (patch)
tree82624341ad85a20d4f8be4e38a8e055f00c697b1 /include
parent01423fb2c3a7f555437ec3cdd0800538f8339684 (diff)
[Docs] Add Doxygen commments
Add Doxygen comments to gmsl-link.h, max9295.h, & max9296.h. Bug 3053489 Signed-off-by: Jonathan Sachs <jsachs@nvidia.com> Change-Id: I37320f1af3440b79f2058e0c7669cc32814d4089 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2403126 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Kathy Stone <kstone@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include')
-rw-r--r--include/media/gmsl-link.h62
-rw-r--r--include/media/max9295.h67
-rw-r--r--include/media/max9296.h121
3 files changed, 237 insertions, 13 deletions
diff --git a/include/media/gmsl-link.h b/include/media/gmsl-link.h
index 94df6bf3f..4d565e951 100644
--- a/include/media/gmsl-link.h
+++ b/include/media/gmsl-link.h
@@ -14,7 +14,23 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17/**
18 * @file <b>GMSL API: Gigabit Multimedia Serial Link protocol</b>
19 *
20 * @b Description: Defines elements used to set up and use a GMSL link.
21 */
22
17#ifndef __GMSL_LINK_H__ 23#ifndef __GMSL_LINK_H__
24/**
25 * \defgroup GMSL Gigabit Multimedia Serial Link (GMSL)
26 *
27 * Defines the interface used to control the MAX9295 serializer and
28 * MAX9296 deserializer modules.
29 *
30 * @ingroup serdes_group
31 * @{
32 */
33
18#define __GMSL_LINK_H__ 34#define __GMSL_LINK_H__
19 35
20#define GMSL_CSI_1X4_MODE 0x1 36#define GMSL_CSI_1X4_MODE 0x1
@@ -39,29 +55,49 @@
39 55
40#define GMSL_ST_ID_UNUSED 0xFF 56#define GMSL_ST_ID_UNUSED 0xFF
41 57
58/**
59 * Maximum number of data streams (\ref gmsl_stream elements) in a GMSL link
60 * (\ref gmsl_link_ctx).
61 */
42#define GMSL_DEV_MAX_NUM_DATA_STREAMS 4 62#define GMSL_DEV_MAX_NUM_DATA_STREAMS 4
43 63
64/**
65 * Holds information about a data stream in a GMSL link (\ref gmsl_link_ctx).
66 */
44struct gmsl_stream { 67struct gmsl_stream {
45 __u32 st_id_sel; 68 __u32 st_id_sel;
46 __u32 st_data_type; 69 __u32 st_data_type;
47 __u32 des_pipe; 70 __u32 des_pipe;
48}; 71};
49 72
73/**
74 * Holds the configuration of the GMSL links from a sensor to its serializer to
75 * its deserializer.
76 */
50struct gmsl_link_ctx { 77struct gmsl_link_ctx {
51 __u32 st_vc; 78 __u32 st_vc; /**< Default sensor virtual channel. */
52 __u32 dst_vc; 79 __u32 dst_vc; /**< Destination virtual channel (user-defined). */
53 __u32 src_csi_port; 80 __u32 src_csi_port; /**< Sensor to serializer CSI port connection. */
54 __u32 dst_csi_port; 81 __u32 dst_csi_port; /**< Deserializer to Jetson CSI port connection. */
55 __u32 serdes_csi_link; 82 __u32 serdes_csi_link; /**< GMSL link between serializer and deserializer
56 __u32 num_streams; 83 devices. */
57 __u32 num_csi_lanes; 84 __u32 num_streams; /**< Number of active streams to be mapped
58 __u32 csi_mode; 85 from sensor. */
59 __u32 ser_reg; 86 __u32 num_csi_lanes; /**< Sensor's CSI lane configuration. */
60 __u32 sdev_reg; 87 __u32 csi_mode; /**< Deserializer CSI mode. */
61 __u32 sdev_def; 88 __u32 ser_reg; /**< Serializer slave address. */
62 bool serdev_found; 89 __u32 sdev_reg; /**< Sensor proxy slave address. */
90 __u32 sdev_def; /**< Sensor default slave address. */
91 bool serdev_found; /**< Indicates whether the serializer device for
92 the specified sensor source was found. Set by
93 the serializer driver during setup; used by
94 the deserializer driver to choose certain
95 configuration settings during setup. */
63 struct gmsl_stream streams[GMSL_DEV_MAX_NUM_DATA_STREAMS]; 96 struct gmsl_stream streams[GMSL_DEV_MAX_NUM_DATA_STREAMS];
64 struct device *s_dev; 97 /*< An array of information about the data streams in the link. */
98 struct device *s_dev; /**< Sensor device handle. */
65}; 99};
66 100
101/** @} */
102
67#endif /* __GMSL_LINK_H__ */ 103#endif /* __GMSL_LINK_H__ */
diff --git a/include/media/max9295.h b/include/media/max9295.h
index bfdd75a33..c8ca6b589 100644
--- a/include/media/max9295.h
+++ b/include/media/max9295.h
@@ -14,19 +14,86 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17/**
18 * @file <b>MAX9295 API: For Maxim Integrated MAX9295 serializer.</b>
19 *
20 * @b Description: Defines elements used to set up and use a
21 * Maxim Integrated MAX9295 serializer.
22 */
23
17#ifndef __MAX9295_H__ 24#ifndef __MAX9295_H__
18#define __MAX9295_H__ 25#define __MAX9295_H__
19 26
20#include <media/gmsl-link.h> 27#include <media/gmsl-link.h>
28/**
29 * \defgroup max9295 MAX9295 serializer driver
30 *
31 * Controls the MAX9295 serializer module.
32 *
33 * @ingroup serdes_group
34 * @{
35 */
36
21 37
38/**
39 * @brief Powers on a serializer device and performs the I2C overrides
40 * for sensor and serializer devices.
41 *
42 * The I2C overrides include setting proxy I2C slave addresses for the devices.
43 *
44 * Before the client calls this function it must ensure that
45 * the deserializer device is in link_ex exclusive link mode
46 * by calling the deserializer driver's max9296_setup_link() function.
47 *
48 * @param [in] dev The serializer device handle.
49 *
50 * @return 0 for success, or -1 otherwise.
51 */
22int max9295_setup_control(struct device *dev); 52int max9295_setup_control(struct device *dev);
23 53
54/**
55 * Reverts I2C overrides and resets a serializer device.
56 *
57 * @param [in] dev The serializer device handle.
58 *
59 * @return 0 for success, or -1 otherwise.
60 */
24int max9295_reset_control(struct device *dev); 61int max9295_reset_control(struct device *dev);
25 62
63/**
64 * @brief Pairs a sensor device with a serializer device.
65 *
66 * To be called by sensor client driver.
67 *
68 * @param [in] dev The deserializer device handle.
69 * @param [in] g_ctx The @ref gmsl_link_ctx structure handle.
70 *
71 * @return 0 for success, or -1 otherwise.
72 */
26int max9295_sdev_pair(struct device *dev, struct gmsl_link_ctx *g_ctx); 73int max9295_sdev_pair(struct device *dev, struct gmsl_link_ctx *g_ctx);
27 74
75/**
76 * @brief Unpairs a sensor device from a serializer device.
77 *
78 * To be called by sensor client driver.
79 *
80 * @param [in] dev The serializer device handle.
81 * @param [in] s_dev The sensor device handle.
82 *
83 * @return 0 for success, or -1 otherwise.
84 */
28int max9295_sdev_unpair(struct device *dev, struct device *s_dev); 85int max9295_sdev_unpair(struct device *dev, struct device *s_dev);
29 86
87/**
88 * Sets up the serializer device's internal pipeline for a specified
89 * sensor/serializer pair.
90 *
91 * @param [in] dev The serializer device handle.
92 *
93 * @return 0 for success, or -1 otherwise.
94 */
30int max9295_setup_streaming(struct device *dev); 95int max9295_setup_streaming(struct device *dev);
31 96
97/** @} */
98
32#endif /* __MAX9295_H__ */ 99#endif /* __MAX9295_H__ */
diff --git a/include/media/max9296.h b/include/media/max9296.h
index 014af0af2..d7ea6178d 100644
--- a/include/media/max9296.h
+++ b/include/media/max9296.h
@@ -14,29 +14,150 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17/**
18 * @file <b>MAX9296 API: For Maxim Integrated MAX9295 deserializer.</b>
19 *
20 * @b Description: Defines elements used to set up and use a
21 * Maxim Integrated MAX9296 deserializer.
22 */
23
17#ifndef __MAX9296_H__ 24#ifndef __MAX9296_H__
18#define __MAX9296_H__ 25#define __MAX9296_H__
19 26
20#include <media/gmsl-link.h> 27#include <media/gmsl-link.h>
28/**
29 * \defgroup max9296 MAX9296 deserializer driver
30 *
31 * Controls the MAX9296 deserializer module.
32 *
33 * @ingroup serdes_group
34 * @{
35 */
21 36
37/**
38 * Puts a deserializer device in single exclusive link mode, so link-specific
39 * I2C overrides can be performed for sensor and serializer devices.
40 *
41 * @param [in] dev The deserializer device handle.
42 * @param [in] s_dev The sensor device handle.
43 *
44 * @return 0 for success, or -1 otherwise.
45 */
22int max9296_setup_link(struct device *dev, struct device *s_dev); 46int max9296_setup_link(struct device *dev, struct device *s_dev);
23 47
48/**
49 * @brief Sets up a deserializer link's control pipeline.
50 *
51 * Puts the deserializer in dual splitter mode. You must call this function
52 * during device boot, after max9296_setup_link().
53 *
54 * @param [in] dev The deserializer device handle.
55 * @param [in] s_dev The sensor device handle.
56 *
57 * @return 0 for success, or -1 otherwise.
58 */
24int max9296_setup_control(struct device *dev, struct device *s_dev); 59int max9296_setup_control(struct device *dev, struct device *s_dev);
25 60
61/**
62 * @brief Resets a deserializer device's link control pipeline.
63 *
64 * The deserializer driver internally decrements the reference count and
65 * resets the deserializer device if all the source sensor devices are
66 * powered off, resetting all control and streaming configuration.
67 *
68 * @param [in] dev The deserializer device handle.
69 * @param [in] s_dev The sensor device handle.
70 *
71 * @return 0 for success, or -1 otherwise.
72 */
26int max9296_reset_control(struct device *dev, struct device *s_dev); 73int max9296_reset_control(struct device *dev, struct device *s_dev);
27 74
75/**
76 * @brief Registers a source sensor device with a deserializer device.
77 *
78 * The deserializer driver internally checks all perquisites and compatibility
79 * factors. If it finds that the registration request is valid,
80 * it stores the source's @ref gmsl_link_ctx context handle in the source list
81 * maintained by the deserializer driver instance.
82 *
83 * @param [in] dev The deserializer device handle.
84 * @param [in] g_ctx A @c gmsl_link_ctx structure handle.
85 *
86 * @return 0 for success, or -1 otherwise.
87 */
28int max9296_sdev_register(struct device *dev, struct gmsl_link_ctx *g_ctx); 88int max9296_sdev_register(struct device *dev, struct gmsl_link_ctx *g_ctx);
29 89
90/**
91 * Unregisters a source sensor device from its deserializer device.
92 *
93 * @param [in] dev The deserializer device handle.
94 * @param [in] s_dev The sensor device handle.
95 *
96 * @return 0 for success, or -1 otherwise.
97 */
30int max9296_sdev_unregister(struct device *dev, struct device *s_dev); 98int max9296_sdev_unregister(struct device *dev, struct device *s_dev);
31 99
100/**
101 * Performs internal pipeline configuration for a link in context to set up
102 * streaming, and puts the deserializer link in ready-to-stream state.
103 *
104 * @param [in] dev The deserializer device handle.
105 * @param [in] s_dev The sensor device handle.
106 *
107 * @return 0 or success, or -1 otherwise.
108 */
32int max9296_setup_streaming(struct device *dev, struct device *s_dev); 109int max9296_setup_streaming(struct device *dev, struct device *s_dev);
33 110
111/**
112 * @brief Enables streaming.
113 *
114 * This function is to be called by the sensor client driver.
115 *
116 * @param [in] dev The deserializer device handle.
117 * @param [in] s_dev The sensor device handle.
118 *
119 * @return 0 for success, or -1 otherwise.
120 */
34int max9296_start_streaming(struct device *dev, struct device *s_dev); 121int max9296_start_streaming(struct device *dev, struct device *s_dev);
35 122
123/**
124 * @brief Disables streaming.
125 *
126 * This function is to be called by the sensor client driver.
127 *
128 * @note Both @c max9296_start_streaming and @c max9296_stop_streaming
129 * are mainly added to enable and disable sensor streaming on the fly
130 * while other sensors are active.
131 *
132 * @param [in] dev The deserializer device handle.
133 * @param [in] s_dev The sensor device handle.
134 *
135 * @return 0 for success, or -1 otherwise.
136 */
36int max9296_stop_streaming(struct device *dev, struct device *s_dev); 137int max9296_stop_streaming(struct device *dev, struct device *s_dev);
37 138
139/**
140 * @brief Powers on the max9296 deserializer module.
141 *
142 * Asserts shared reset GPIO and powers on the regulator;
143 * maintains the reference count internally for source devices.
144 *
145 * @param [in] dev The deserializer device handle.
146 *
147 * @return 0 for success, or -1 otherwise.
148 */
38int max9296_power_on(struct device *dev); 149int max9296_power_on(struct device *dev);
39 150
151/**
152 * @brief Powers off the max9296 deserializer module.
153 *
154 * Deasserts the shared reset GPIO and powers off the regulator based on
155 * the reference count.
156 *
157 * @param [in] dev The deserializer device handle.
158 */
40void max9296_power_off(struct device *dev); 159void max9296_power_off(struct device *dev);
41 160
161/** @} */
162
42#endif /* __MAX9296_H__ */ 163#endif /* __MAX9296_H__ */