-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSO-18376 D4XX HWMC UVC LibRealSense compatibility #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several minor changes requested
+ | ||
+ ds5_raw_read_with_check(state, DS5_HWMC_DATA, data, tmp_len); | ||
+ | ||
+ /* This is needed for librealsense, to align there code with UVC, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines could have been exported to a separate function, in order to make it reusable, and to make the code more readable - but up to you to export it or let it this way.
break; | ||
+ case DS5_CAMERA_CID_HWMC_RW: | ||
+ if (ctrl->p_new.p_u8) { | ||
+ u16 size = *((u8*)ctrl->p_new.p_u8 + 1) << 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment for the "<<8" - changing the "8" to some const could be also better.
.name = "HWMC", | ||
.type = V4L2_CTRL_TYPE_U8, | ||
- .dims = {1028}, | ||
+ .dims = {DS5_HWMC_BUFFER_SIZE + 4}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment for the "size+4" - consider changing the "4" to a const number - its name could be self-explained and avoid the comment.
+ .elem_size = sizeof(u8), | ||
+ .min = 0, | ||
+ .max = 0xFFFFFFFF, | ||
+ .def = 240, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment for the "def = 240" - consider changing the "240" to a const number - its name could be self-explained and avoid the comment.
+ memset(data, 0, DS5_HWMC_BUFFER_SIZE); | ||
+ | ||
+ do { | ||
+ msleep_range(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls refactor to apply the sleep in all but the first iteration
- added new volatile CID (offset 32) for set/get HWMC - Addressing https://rsjira.intel.com/browse/DSO-18376 [D457][MIPI] Make HWMC work in USB-compatible manner Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
292c202
to
4a249b5
Compare
[D457][MIPI] Make HWMC work in USB-compatible manner
[D457] Enable Unsigned FW update via MIPI https://rsjira.intel.com/browse/LRS-472
[D457] Enable DFU via MIPI https://rsjira.intel.com/browse/LRS-453
Signed-off-by: Dmitry Perchanov dmitry.perchanov@intel.com