media: i2c: mlx7502x ToF camera support
Subsystems (2)
v4 cover media: i2c: mlx7502x ToF camera support
Hello,
This series adds support for the Melexis 75026 and 75027 Time of Flight camera sensors, with DT bindings in patch 7/8 and a driver in patch 8/8. In patches 1/8, 2/8 and 3/8, I've add ToF controls as separate ToF control class.
v4:
- fix output mode
- forbid array for menu and warn if validate_new return an error
- add enums to custom control OUTPUT_MODE
- update doc
- minor fixes
v3:
- move FMOD, TINT, PHASE_SEQ to common V4L2 as ToF common controls
- FMOD and TINT became dynamic arrays
- remove PHASE_NUM, use dynamic_array for PHASE_SEQ, ctrl->new_elems pass number of phases
- remove leden-gpios, will be used gpio explicitly in library for now
- remade probe: use probe_new, no power on during probe
- remove autodetect and wildcard
- make all supplies to be required
- remove trigger ioctl, will add in separate patch series
- remove temperature ioctl, will add in separate patch series
- add documentation about custom ioctl
- style: 80 cols
- minor fixes device tree
v2:
- added external clock to the sensor
- added all regulators required by the sensor
- added posibility to choose sensor type in device tree
- added prefixes to all custom types in device tree and driver as well
- style fixes
Volodymyr Kharuk (8):
media: uapi: ctrls: Add Time of Flight class controls
media: v4l: ctrls: Fill V4L2_CID_TOF_CLASS controls
media: Documentation: v4l: Add TOF class controls
media: v4l: ctrls-api: Allow array update in __v4l2_ctrl_modify_range
media: v4l: ctrls: Add user control base for mlx7502x
media: uapi: Add mlx7502x header file
media: dt-bindings: Add mlx7502x camera sensor
media: i2c: Add driver for mlx7502x ToF sensor
.../bindings/media/i2c/melexis,mlx7502x.yaml | 126 ++ .../userspace-api/media/drivers/index.rst | 1 + .../userspace-api/media/drivers/mlx7502x.rst | 28 + .../userspace-api/media/v4l/common.rst | 1 + .../userspace-api/media/v4l/ext-ctrls-tof.rst | 56 + MAINTAINERS | 11 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/mlx7502x.c | 1747 +++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls-api.c | 25 +- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 20 + include/uapi/linux/mlx7502x.h | 28 + include/uapi/linux/v4l2-controls.h | 14 + 13 files changed, 2059 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml create mode 100644 Documentation/userspace-api/media/drivers/mlx7502x.rst create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst create mode 100644 drivers/media/i2c/mlx7502x.c create mode 100644 include/uapi/linux/mlx7502x.h
base-commit: a7bab6f8b73fe15a6181673149734a2756845dae
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 1/8 media: uapi: ctrls: Add Time of Flight class controls
Define Time of Flight class controls.
Also add most common TOF controls:
- phase sequence
- time integration
- frequency modulation
--- include/uapi/linux/v4l2-controls.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/uapi/linux/v4l2-controls.h +8 -0
@@ -68,6 +68,7 @@#define V4L2_CTRL_CLASS_DETECT 0x00a30000/* Detection controls */ #define V4L2_CTRL_CLASS_CODEC_STATELESS 0x00a40000/* Stateless codecs controls */ #define V4L2_CTRL_CLASS_COLORIMETRY 0x00a50000/* Colorimetry controls */ +#define V4L2_CTRL_CLASS_TOF 0x00a60000/* Time of flight camera controls */ /* User-class control IDs */
@@ -2788,6 +2789,13 @@ struct v4l2_ctrl_vp9_compressed_hdr {struct v4l2_vp9_mv_probs mv; }; +#define V4L2_CID_TOF_CLASS_BASE (V4L2_CTRL_CLASS_TOF | 0x900) +#define V4L2_CID_TOF_CLASS (V4L2_CTRL_CLASS_TOF | 1) + +#define V4L2_CID_TOF_PHASE_SEQ (V4L2_CID_TOF_CLASS_BASE + 0) +#define V4L2_CID_TOF_FREQ_MOD (V4L2_CID_TOF_CLASS_BASE + 1) +#define V4L2_CID_TOF_TIME_INTEGRATION (V4L2_CID_TOF_CLASS_BASE + 2) +/* MPEG-compression definitions kept for backwards compatibility */ #ifndef __KERNEL__#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 2/8 media: v4l: ctrls: Fill V4L2_CID_TOF_CLASS controls
In reply to Volodymyr KharukDefine names, flags and types of TOF controls. *dims* is driver specific. It also means, that it is not possible to use new_std for arrays.
--- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls-defs.c +20 -0
@@ -1196,6 +1196,13 @@ const char *v4l2_ctrl_get_name(u32 id)case V4L2_CID_COLORIMETRY_CLASS :return "Colorimetry Controls" ;case V4L2_CID_COLORIMETRY_HDR10_CLL_INFO :return "HDR10 Content Light Info" ;case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY :return "HDR10 Mastering Display" ; + +/* Time of light camera controls */ +/* Keep the order of the 'case's the same as in v4l2-controls.h! */ +case V4L2_CID_TOF_CLASS :return "Time of Flight Camera Controls" ; +case V4L2_CID_TOF_PHASE_SEQ :return "TOF Phase Sequence" ; +case V4L2_CID_TOF_FREQ_MOD :return "TOF Frequency Modulation" ; +case V4L2_CID_TOF_TIME_INTEGRATION :return "TOF Time Integration" ;default :return NULL ; }
@@ -1403,6 +1410,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,case V4L2_CID_DETECT_CLASS :case V4L2_CID_CODEC_STATELESS_CLASS :case V4L2_CID_COLORIMETRY_CLASS : +case V4L2_CID_TOF_CLASS : *type =V4L2_CTRL_TYPE_CTRL_CLASS ;/* You can neither read nor write these */ *flags |=V4L2_CTRL_FLAG_READ_ONLY |V4L2_CTRL_FLAG_WRITE_ONLY ;
@@ -1541,6 +1549,18 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY : *type =V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY ;break ; +case V4L2_CID_TOF_PHASE_SEQ : + *type =V4L2_CTRL_TYPE_U16 ; + *flags |=V4L2_CTRL_FLAG_DYNAMIC_ARRAY ; +break ; +case V4L2_CID_TOF_FREQ_MOD : + *type =V4L2_CTRL_TYPE_U8 ; + *flags |=V4L2_CTRL_FLAG_DYNAMIC_ARRAY ; +break ; +case V4L2_CID_TOF_TIME_INTEGRATION : + *type =V4L2_CTRL_TYPE_U16 ; + *flags |=V4L2_CTRL_FLAG_DYNAMIC_ARRAY ; +break ;default : *type =V4L2_CTRL_TYPE_INTEGER ;break ;
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 3/8 media: Documentation: v4l: Add TOF class controls
In reply to Volodymyr KharukAdd description about V4L2_CID_TOF_PHASE_SEQ, V4L2_CID_TOF_FMOD and V4L2_CID_TOF_TINT.
Also updated MAINTAINERS with new ext-ctrls-tof file.
--- .../userspace-api/media/v4l/common.rst | 1 + .../userspace-api/media/v4l/ext-ctrls-tof.rst | 56 +++++++++++++++++++ MAINTAINERS | 7 +++ 3 files changed, 64 insertions(+) create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst
Documentation/userspace-api/media/v4l/common.rst +1 -0
@@ -52,6 +52,7 @@ applicable to all devices. ext-ctrls-fm-rx ext-ctrls-detect ext-ctrls-colorimetry + ext-ctrls-tof fourcc format planar-apis
Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst new file +56 -0
56 lines not on this page · raw message
MAINTAINERS +7 -0
@@ -13111,6 +13111,13 @@ S: Supported W: http://www.melexis.com F: drivers/iio/temperature/mlx90632.c +MELEXIS MLX7502X DRIVER +M: Volodymyr Kharuk <[email protected]> +L: [email protected] +S: Supported +W: http://www.melexis.com +F: Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst + MELFAS MIP4 TOUCHSCREEN DRIVER M: Sangwon Jee <[email protected]> S: Supported
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 4/8 media: v4l: ctrls-api: Allow array update in __v4l2_ctrl_modify_range
In reply to Volodymyr KharukFor V4L2_CID_TOF_TINT, which is dynamic array, it is required to use __v4l2_ctrl_modify_range. So the idea is to use type_ops instead of u64 from union. It will allow to work with any type.
--- drivers/media/v4l2-core/v4l2-ctrls-api.c | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/media/v4l2-core/v4l2-ctrls-api.c +13 -12
@@ -933,17 +933,18 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,lockdep_assert_held (ctrl->handler->lock);switch (ctrl->type) { +case V4L2_CTRL_TYPE_MENU : +case V4L2_CTRL_TYPE_INTEGER_MENU : +if (ctrl->is_array) +return -EINVAL ; + fallthrough;case V4L2_CTRL_TYPE_INTEGER :case V4L2_CTRL_TYPE_INTEGER64 :case V4L2_CTRL_TYPE_BOOLEAN : -case V4L2_CTRL_TYPE_MENU : -case V4L2_CTRL_TYPE_INTEGER_MENU :case V4L2_CTRL_TYPE_BITMASK :case V4L2_CTRL_TYPE_U8 :case V4L2_CTRL_TYPE_U16 :case V4L2_CTRL_TYPE_U32 : -if (ctrl->is_array) -return -EINVAL ; ret =check_range (ctrl->type, min, max, step, def);if (ret)return ret;
@@ -961,16 +962,16 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, }cur_to_new (ctrl);if (validate_new (ctrl, ctrl->p_new)) { -if (ctrl->type ==V4L2_CTRL_TYPE_INTEGER64 ) - *ctrl->p_new.p_s64 = def; -else - *ctrl->p_new.p_s32 = def; +WARN_ON (ctrl->is_array);/* This shouldn't happen, as +* INTEGER/Ux/BOOLEAN/BITMASK will not +* return an error. +* In case it happened, all array will +* set to default value +*/ + ctrl->type_ops->init (ctrl,0 , ctrl->p_new); } -if (ctrl->type ==V4L2_CTRL_TYPE_INTEGER64 ) - value_changed = *ctrl->p_new.p_s64 != *ctrl->p_cur.p_s64; -else - value_changed = *ctrl->p_new.p_s32 != *ctrl->p_cur.p_s32; + value_changed = !ctrl->type_ops->equal (ctrl, ctrl->p_cur, ctrl->p_new);if (value_changed) ret =set_ctrl (NULL , ctrl,V4L2_EVENT_CTRL_CH_RANGE );else if (range_changed)
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 5/8 media: v4l: ctrls: Add user control base for mlx7502x
In reply to Volodymyr KharukAdd a control base for mlx7502x and reserve 16 controls.
--- include/uapi/linux/v4l2-controls.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/uapi/linux/v4l2-controls.h +6 -0
@@ -238,6 +238,12 @@ enum v4l2_colorfx {*/ #define V4L2_CID_USER_ASPEED_BASE (V4L2_CID_USER_BASE + 0x11a0) +/* +* The base for Melexis ToF 7502x driver controls. +* We reserve 16 controls for this driver. +*/ +#define V4L2_CID_USER_MLX7502X_BASE (V4L2_CID_USER_BASE + 0x11b0) +/* MPEG-class control IDs */ /* The MPEG controls are applicable to all codec controls * and the 'MPEG' part of the define is historical */
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 6/8 media: uapi: Add mlx7502x header file
In reply to Volodymyr KharukDefine user controls for mlx7502x driver, add its documentation and update MAINTAINERS
--- .../userspace-api/media/drivers/index.rst | 1 + .../userspace-api/media/drivers/mlx7502x.rst | 28 +++++++++++++++++++ MAINTAINERS | 2 ++ include/uapi/linux/mlx7502x.h | 28 +++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 Documentation/userspace-api/media/drivers/mlx7502x.rst create mode 100644 include/uapi/linux/mlx7502x.h
Documentation/userspace-api/media/drivers/index.rst +1 -0
@@ -38,5 +38,6 @@ For more details see the file COPYING in the source distribution of Linux. imx-uapi max2175 meye-uapi + mlx7502x omap3isp-uapi uvcvideo
Documentation/userspace-api/media/drivers/mlx7502x.rst new file +28 -0
@@ -0,0 +1,28 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Melexis mlx7502x ToF camera sensor driver +========================================= + +The mlx7502x driver implements the following driver-specific controls: + +``V4L2_CID_MLX7502X_OUTPUT_MODE (menu)`` +---------------------------------------- + The sensor has two taps, which gather reflected light: A and B. + The control sets the way data should be put in a buffer. The most + common output mode is A-B which provides the best sunlight robustness. + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + :widths: 1 4 + + * - ``V4L2_MLX7502X_OUTPUT_MODE_A_MINUS_B`` + - tap A minus tap B + * - ``V4L2_MLX7502X_OUTPUT_MODE_A_PLUS_B`` + - tap A plus tap B + * - ``V4L2_MLX7502X_OUTPUT_MODE_A`` + - only tap A + * - ``V4L2_MLX7502X_OUTPUT_MODE_B`` + - only tap B + * - ``V4L2_MLX7502X_OUTPUT_MODE_A_AND_B`` + - tap A and tap B (this config will change PAD format)
MAINTAINERS +2 -0
@@ -13116,7 +13116,9 @@ M: Volodymyr Kharuk <[email protected]> L: [email protected] S: Supported W: http://www.melexis.com +F: Documentation/userspace-api/media/drivers/mlx7502x.rst F: Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst +F: include/uapi/linux/mlx7502x.h MELFAS MIP4 TOUCHSCREEN DRIVER M: Sangwon Jee <[email protected]>
include/uapi/linux/mlx7502x.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* +* Melexis 7502x ToF cameras driver. +* +* Copyright (C) 2021 Melexis N.V. +* +*/ + +#ifndef __UAPI_MLX7502X_H_ +#define __UAPI_MLX7502X_H_ + +#include <linux/v4l2-controls.h> + +/* +* this is related to the taps in ToF cameras, +* usually A minus B is the best option +*/ +enum v4l2_mlx7502x_output_mode { +V4L2_MLX7502X_OUTPUT_MODE_A_MINUS_B =0 , +V4L2_MLX7502X_OUTPUT_MODE_A_PLUS_B , +V4L2_MLX7502X_OUTPUT_MODE_A , +V4L2_MLX7502X_OUTPUT_MODE_B , +V4L2_MLX7502X_OUTPUT_MODE_A_AND_B ,/* output frame size doubles */ +}; + +#define V4L2_CID_MLX7502X_OUTPUT_MODE (V4L2_CID_USER_MLX7502X_BASE + 0) + +#endif /* __UAPI_MLX7502X_H_ */
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 7/8 media: dt-bindings: Add mlx7502x camera sensor
In reply to Volodymyr KharukAdd device tree binding of the mlx7502x and update MAINTAINERS
--- .../bindings/media/i2c/melexis,mlx7502x.yaml | 126 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 127 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml
Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml new file +126 -0
@@ -0,0 +1,126 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/melexis,mlx7502x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Melexis ToF 7502x MIPI CSI-2 Sensor + +maintainers: + - Volodymyr Kharuk <[email protected]> + +description: |- + Melexis ToF 7502x sensors has a CSI-2 output. It supports 2 and 4 lanes, + and mipi speeds are 300, 600, 704, 800, 904, 960Mbs. Supported format is RAW12. + Sensor 75026 is QVGA, while 75027 is VGA sensor. + +properties: + compatible: + enum: + - melexis,mlx75026 + - melexis,mlx75027 + + reg: + maxItems: 1 + + clocks: + description: Clock frequency 8MHz + maxItems: 1 + + vdda-supply: + description: + Analog power supply(2.7V). + + vddif-supply: + description: + Interface power supply(1.8V). + + vddd-supply: + description: + Digital power supply(1.2V). + + vdmix-supply: + description: + Mixed driver power supply(1.2V). + + reset-gpios: + maxItems: 1 + description: Reset Sensor GPIO Control (active low) + + port: + description: MIPI CSI-2 transmitter port + $ref: /schemas/graph.yaml#/$defs/port-base + + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + oneOf: + - items: + - const: 1 + - const: 2 + - items: + - const: 1 + - const: 2 + - const: 3 + - const: 4 + + required: + - data-lanes + - link-frequencies + +required: + - compatible + - reg + - clocks + - port + - vdda-supply + - vddif-supply + - vddd-supply + - vdmix-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + mlx7502x: camera@57 { + compatible = "melexis,mlx75027"; + reg = <0x57>; + clocks = <&mlx7502x_clk>; + + assigned-clocks = <&mlx7502x_clk>; + assigned-clock-parents = <&mlx7502x_clk_parent>; + assigned-clock-rates = <8000000>; + + vdda-supply = <®_2v7>; + vddif-supply = <®_1v8>; + vddd-supply = <®_1v2>; + vdmix-supply = <®_1v2>; + + reset-gpios = <&gpio_exp 6 GPIO_ACTIVE_HIGH>; + + port { + mlx7502x_out_mipi_csi2: endpoint { + remote-endpoint = <&mipi_csi2_from_mlx7502x>; + data-lanes = <1 2 3 4>; + link-frequencies = /bits/ 64 < 960000000 + 904000000 + 800000000 + 704000000 + 600000000 + 300000000 >; + }; + }; + }; + }; + +...
MAINTAINERS +1 -0
@@ -13116,6 +13116,7 @@ M: Volodymyr Kharuk <[email protected]> L: [email protected] S: Supported W: http://www.melexis.com +F: Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml F: Documentation/userspace-api/media/drivers/mlx7502x.rst F: Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst F: include/uapi/linux/mlx7502x.h
Signature · 2 lines
BR, Volodymyr Kharuk
PATCH v4 8/8 media: i2c: Add driver for mlx7502x ToF sensor
In reply to Volodymyr KharukMelexis ToF 7502x sensors has a CSI-2 output. It supports 2 and 4 lanes, and mipi speeds are 300, 600, 704, 800, 904, 960Mbs. Supported format is RAW12.
Sensor 75026 is QVGA, while 75027 is VGA sensor.
The driver supports:
- Digital binning and cropping
- Horizontal and vertical flip
- phase shifts(up to 8)
- frequency modulation
- time integration
--- MAINTAINERS | 1 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/mlx7502x.c | 1747 ++++++++++++++++++++++++++++++++++ 4 files changed, 1762 insertions(+) create mode 100644 drivers/media/i2c/mlx7502x.c
MAINTAINERS +1 -0
@@ -13119,6 +13119,7 @@ W: http://www.melexis.com F: Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml F: Documentation/userspace-api/media/drivers/mlx7502x.rst F: Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst +F: drivers/media/i2c/mlx7502x.c F: include/uapi/linux/mlx7502x.h MELFAS MIP4 TOUCHSCREEN DRIVER
drivers/media/i2c/Kconfig +13 -0
@@ -231,6 +231,19 @@ config VIDEO_IMX412 config VIDEO_MAX9271_LIB tristate +config VIDEO_MLX7502X + tristate "Melexis ToF 75026 and 75027 sensors support" + depends on I2C && VIDEO_DEV + select MEDIA_CONTROLLER + select VIDEO_V4L2_SUBDEV_API + select V4L2_FWNODE + help + This is a V4L2 sensor driver for the Melexis 75026 and 75027 + ToF sensors. + + To compile this driver as a module, choose M here: the + module will be called mlx7502x. + config VIDEO_MT9M001 tristate "mt9m001 support" depends on I2C && VIDEO_DEV
drivers/media/i2c/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_VIDEO_M5MOLS) += m5mols/ obj-$(CONFIG_VIDEO_MAX9271_LIB) += max9271.o obj-$(CONFIG_VIDEO_MAX9286) += max9286.o obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o +obj-$(CONFIG_VIDEO_MLX7502X) += mlx7502x.o obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o obj-$(CONFIG_VIDEO_MT9M001) += mt9m001.o obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o
drivers/media/i2c/mlx7502x.c new file +1747 -0
1,747 lines not on this page · raw message
Signature · 2 lines
BR, Volodymyr Kharuk
Hi All,
This is a gentle reminder about the patch series for ToF camera.
Thanks.
Quoted 72 lines · Volodymyr Kharuk
Hello,
This series adds support for the Melexis 75026 and 75027 Time of Flight camera sensors, with DT bindings in patch 7/8 and a driver in patch 8/8. In patches 1/8, 2/8 and 3/8, I've add ToF controls as separate ToF control class.
v4:
- fix output mode
- forbid array for menu and warn ifvalidate_newreturn an error
- add enums to custom controlOUTPUT_MODE
- update doc
- minor fixesv3:
- move FMOD, TINT,PHASE_SEQto common V4L2 as ToF common controls
- FMOD and TINT became dynamic arrays
- removePHASE_NUM, usedynamic_arrayforPHASE_SEQ,ctrl->new_elemspass number of phases
- remove leden-gpios, will be used gpio explicitly in library for now
- remade probe: useprobe_new, no power on during probe
- remove autodetect and wildcard
- make all supplies to be required
- remove trigger ioctl, will add in separate patch series
- remove temperature ioctl, will add in separate patch series
- add documentation about custom ioctl
- style: 80 cols
- minor fixes device treev2:
- added external clock to the sensor
- added all regulators required by the sensor
- added posibility to choose sensor type in device tree
- added prefixes to all custom types in device tree and driver as well
- style fixesVolodymyr Kharuk (8):
media: uapi: ctrls: Add Time of Flight class controls
media: v4l: ctrls: FillV4L2_CID_TOF_CLASScontrols
media: Documentation: v4l: Add TOF class controls
media: v4l: ctrls-api: Allow array update in__v4l2_ctrl_modify_range
media: v4l: ctrls: Add user control base for mlx7502x
media: uapi: Add mlx7502x header file
media: dt-bindings: Add mlx7502x camera sensor
media: i2c: Add driver for mlx7502x ToF sensor.../bindings/media/i2c/melexis,mlx7502x.yaml | 126 ++ .../userspace-api/media/drivers/index.rst | 1 + .../userspace-api/media/drivers/mlx7502x.rst | 28 + .../userspace-api/media/v4l/common.rst | 1 + .../userspace-api/media/v4l/ext-ctrls-tof.rst | 56 + MAINTAINERS | 11 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/mlx7502x.c | 1747 +++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls-api.c | 25 +- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 20 + include/uapi/linux/mlx7502x.h | 28 + include/uapi/linux/v4l2-controls.h | 14 + 13 files changed, 2059 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml create mode 100644 Documentation/userspace-api/media/drivers/mlx7502x.rst create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst create mode 100644 drivers/media/i2c/mlx7502x.c create mode 100644 include/uapi/linux/mlx7502x.hbase-commit:
a7bab6f8b73fe15a6181673149734a2756845daeSignature · 2 lines
BR, Volodymyr Kharuk
Signature · 2 lines
-- Volodymyr Kharuk
Benjamin Mugnier
Acked-byHi Volodomyr,
I'm not sure I'm relevant, but since we discussed a bit about controls in the first version feel free to add my tag for patch 1, 2, and 3:
Thank you for your work.
Quoted 80 lines · Volodymyr Kharuk
Hi All,
This is a gentle reminder about the patch series for ToF camera.
Thanks.
Quoted 72 lines · Volodymyr Kharuk
Hello,
This series adds support for the Melexis 75026 and 75027 Time of Flight camera sensors, with DT bindings in patch 7/8 and a driver in patch 8/8. In patches 1/8, 2/8 and 3/8, I've add ToF controls as separate ToF control class.
v4:
- fix output mode
- forbid array for menu and warn ifvalidate_newreturn an error
- add enums to custom controlOUTPUT_MODE
- update doc
- minor fixesv3:
- move FMOD, TINT,PHASE_SEQto common V4L2 as ToF common controls
- FMOD and TINT became dynamic arrays
- removePHASE_NUM, usedynamic_arrayforPHASE_SEQ,ctrl->new_elemspass number of phases
- remove leden-gpios, will be used gpio explicitly in library for now
- remade probe: useprobe_new, no power on during probe
- remove autodetect and wildcard
- make all supplies to be required
- remove trigger ioctl, will add in separate patch series
- remove temperature ioctl, will add in separate patch series
- add documentation about custom ioctl
- style: 80 cols
- minor fixes device treev2:
- added external clock to the sensor
- added all regulators required by the sensor
- added posibility to choose sensor type in device tree
- added prefixes to all custom types in device tree and driver as well
- style fixesVolodymyr Kharuk (8):
media: uapi: ctrls: Add Time of Flight class controls
media: v4l: ctrls: FillV4L2_CID_TOF_CLASScontrols
media: Documentation: v4l: Add TOF class controls
media: v4l: ctrls-api: Allow array update in__v4l2_ctrl_modify_range
media: v4l: ctrls: Add user control base for mlx7502x
media: uapi: Add mlx7502x header file
media: dt-bindings: Add mlx7502x camera sensor
media: i2c: Add driver for mlx7502x ToF sensor.../bindings/media/i2c/melexis,mlx7502x.yaml | 126 ++ .../userspace-api/media/drivers/index.rst | 1 + .../userspace-api/media/drivers/mlx7502x.rst | 28 + .../userspace-api/media/v4l/common.rst | 1 + .../userspace-api/media/v4l/ext-ctrls-tof.rst | 56 + MAINTAINERS | 11 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/mlx7502x.c | 1747 +++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls-api.c | 25 +- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 20 + include/uapi/linux/mlx7502x.h | 28 + include/uapi/linux/v4l2-controls.h | 14 + 13 files changed, 2059 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml create mode 100644 Documentation/userspace-api/media/drivers/mlx7502x.rst create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst create mode 100644 drivers/media/i2c/mlx7502x.c create mode 100644 include/uapi/linux/mlx7502x.hbase-commit:
a7bab6f8b73fe15a6181673149734a2756845daeSignature · 2 lines
BR, Volodymyr Kharuk
Signature · 3 lines
Regards, Benjamin
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): Y9E+hJ604i/ss/[email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Benjamin,
Quoted 1 line
By the way, was the mailing list dropped from cc by mistake ?
No, I just wanted to send a remind about the patch to Sakari and Laurent. Now it looks that this thread became more technical, so I am adding cc again.
Quoted 12 lines
Quoted 12 lines
Quoted 4 lines
I took a glance already and the driver seems reasonably good but I'm concerned of the interface. How generic is it? I can't say to be an expert on these devices and we don't have any other ToF cameras yet. Is the precision (8 bits) of the control values enough?
Fairly, that it is an interesting question.
The frequency modulation defines the maximum range of object detection.
1 MHz precision is what we need usually, as the maximum range is from 1.5m(100Mhz) till 150(1MHz) meters then.
Usually, user applications use 60-80MHz(max range is 1.8 - 2.5meters). Also, it is possible to have smaller step then 1 MHz, but it is not that practical. I am ok switch to Hz and use u32. In that case we will not be limited for generic case.
Quoted 5 lines
Quoted 1 line
Benjamin, what precision is better for frequency modulation in your case?
Good catch, we do require Hz precision for some frequencies we use. In other systems we use floats expressed as Mhz for this. As Linux only supports integers, switching it to u32 and express it as Hz is a good idea.
Ok, then I'll redo in next version.
Signature · 3 lines
-- BR, Volodymyr Kharuk