From patchwork Wed Oct 4 07:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Kharuk X-Patchwork-Id: 730912 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36A0110F8 for ; Wed, 4 Oct 2023 07:20:01 +0000 (UTC) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BC7AC for ; Wed, 4 Oct 2023 00:19:58 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5334d78c5f6so3085586a12.2 for ; Wed, 04 Oct 2023 00:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=melexis.com; s=google; t=1696403997; x=1697008797; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ew1c9NXug8ctY4MLl60wGEzXYZjlRdO90T8KbwkWmwo=; b=SN4SASU2IrcaUNcqb1Yrkf2oKD+c8Kxpy2ClJDx/LXjqUFCg7dufsYD3pmYXrsqsuQ LxFc/UUaG+kWVHhqCKHjmA7JsBj6VT/T3IxpXJRFic/J6iBubZM2F6vwaHvAjKGK9rcy AZ2RnDJOCsoeGP24FviJazHZcu29nrZIGEfJvnZlkqFrgW4vnGs6XwT+9gtBJFrl0oYF zHMfYOepwzmPEJLsDKOJw1JparQEDDth1OGeEOHijwOBIX8r2Z2fTbpEcoEAzU7uWcEe 2Km0c+5QmRoDBFCkJpOF+PQdQUf9K8qTktE4xVL34MprVOhSI5SDQIUGxqBhfYjJ9qwm 5DLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696403997; x=1697008797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ew1c9NXug8ctY4MLl60wGEzXYZjlRdO90T8KbwkWmwo=; b=UKTNW6GU0FS9crzbvP1SvIUg84H9zgLBw/j0s3/EP+uk7MSSGPDEd+33BAnhyd8Vv9 Rf54K0X3ogbGc5xaxFAX9Y/lQu+7/0yh2YeZrxNSWKm9heQAihDoEtxSQ2uEnh/DBxo2 5uVZt4i982oebtCPfb98PNY8bI8U7ivYJsvlDpRtFCMDu+fGNqCJbGL4Lo7cqNkmdwlM gt1Jd/Ts5qO9PNVRQoprm/MdIXizaYOZ/+44Dagwp32I9j4/4KuZJI/I0Gh7SZi+a4+u eHFLrCebWCGirK4+JMhIE6G8JRZAAkgT6UrYfzAmFgh7RuE6IBdsCGCsfz9WstSSczd6 Cvxg== X-Gm-Message-State: AOJu0YwUDydXqouCPp5Z33QNwyhpa6mezhWw2XucMSWqRDnDKA1uJxMt +jvibApeYYGzuSSbzZOPhAQMVw== X-Google-Smtp-Source: AGHT+IGTV+fX27y5K0VvWm4l1aaWyZkbH6zZ5AACaUBxJ1PXxAQRmjzelUSeasRbsRczHLFso00LUg== X-Received: by 2002:a17:906:3081:b0:9ae:73ca:bbad with SMTP id 1-20020a170906308100b009ae73cabbadmr1182656ejv.43.1696403997208; Wed, 04 Oct 2023 00:19:57 -0700 (PDT) Received: from melexis ([91.192.181.19]) by smtp.gmail.com with ESMTPSA id sa18-20020a170906edb200b009adc77330ebsm2313242ejb.199.2023.10.04.00.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 00:19:56 -0700 (PDT) From: Volodymyr Kharuk To: Cc: Andrii Kyselov , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Laurent Pinchart , devicetree@vger.kernel.org, Hans Verkuil , Sakari Ailus , Benjamin Mugnier , Volodymyr Kharuk Subject: [PATCH v5 1/8] media: uapi: ctrls: Add Time of Flight class controls Date: Wed, 4 Oct 2023 10:19:40 +0300 Message-Id: <3d1a6a49790a699980dc02450ebdbac2a03ebb51.1696347109.git.vkh@melexis.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Define Time of Flight class controls. Also add most common TOF controls: - phase sequence - time integration - frequency modulation Signed-off-by: Volodymyr Kharuk Acked-by: Benjamin Mugnier --- include/uapi/linux/v4l2-controls.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index c3604a0a3e30..92b3957d5720 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -30,6 +30,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 */ @@ -3479,6 +3480,13 @@ struct v4l2_ctrl_av1_film_grain { __u8 reserved[4]; }; +#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 From patchwork Wed Oct 4 07:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Kharuk X-Patchwork-Id: 730911 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD54D6FC4 for ; Wed, 4 Oct 2023 07:20:05 +0000 (UTC) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D4C5AC for ; Wed, 4 Oct 2023 00:20:03 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9ad8a822508so325466666b.0 for ; Wed, 04 Oct 2023 00:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=melexis.com; s=google; t=1696404002; x=1697008802; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=imCZDPmKhvVM5uCss54/MVO/bMAfcXA+npTIcf/0h0w=; b=iBRyId7TO5HeRByR58oUeIYOaPX/X1NcxR3yr/EtkGS+cfdkG+bK2kD0vJq9Xy4Esr bxQG12E7ajBKgPxXUMRL0IQPZhYwVzg2hje++Oz32jfRLR5ecmwuCgByjpTqXLsJD0dU KMFdg6QkioAZHI7LukwZZC4/2Ul2UlSHzGCoD/nizoR4T1JUUO6Z9PWTr1ezXXfOphWd 4aW7n8k7DEN03SV3UqQJcbitXupCxFPGQD4gw2inu9yyvfWfOvNRMHhto292CSMJbsw4 xTSBO2tBX/Jlzgq43EOpHtCXhhkGn0B639faR/KxtE/V2RhSNKmZpOmH7pSW5/5cWTdo /XzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696404002; x=1697008802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=imCZDPmKhvVM5uCss54/MVO/bMAfcXA+npTIcf/0h0w=; b=QKq6u/crnd3u3uI6XliGBXYeWJv/MHZ5750rx9s+an6iA2Fuv1uzG/ePMB8PFU7hFb hwEuCsKjjslpvSHKXlB7GQ3gY84+2NpPsfIcDd9OzMpChGFOCc94dyJhtncxfA7AOgfA 7ctqcVXqvASc5j7hyK//PF4qQhTxg5kbp44FGJ4FEO6VCCjyjkx+GJBvi7Lm/2T1JjeB JO3xxgnS2xAwBVtIQIKiuTyKhWX3+0mawyDEaSj7/G8LX3lkWWJ8uT0LQIhNFfF48tf1 uNu5/scQygo1XkCTpgGM4kD4tpvoC3bhRYKsWPvOfWPV6+QyEzlT2dBF4vhexKgI/OPG xflQ== X-Gm-Message-State: AOJu0YyT3+CgVwjAT9Gj1Co3Hu8ZZTiHmssdGYJ4Rsu+zNewBFNuvSHG MkCEUT8Q/8SDQp8V9UKFqLIutw== X-Google-Smtp-Source: AGHT+IFMm8w0C4PCwzMFMnjGndx3ZM5io7F841AB/gBJW5UhU2tXXwWRKLFJ62oDLGZU4EhQcnmaDw== X-Received: by 2002:a17:906:1ba9:b0:9ae:57b8:ad1b with SMTP id r9-20020a1709061ba900b009ae57b8ad1bmr1194421ejg.21.1696404001814; Wed, 04 Oct 2023 00:20:01 -0700 (PDT) Received: from melexis ([91.192.181.19]) by smtp.gmail.com with ESMTPSA id 11-20020a170906058b00b009add084a00csm2285935ejn.36.2023.10.04.00.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 00:20:01 -0700 (PDT) From: Volodymyr Kharuk To: Cc: Andrii Kyselov , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Laurent Pinchart , devicetree@vger.kernel.org, Hans Verkuil , Sakari Ailus , Benjamin Mugnier , Volodymyr Kharuk Subject: [PATCH v5 3/8] media: Documentation: v4l: Add TOF class controls Date: Wed, 4 Oct 2023 10:19:42 +0300 Message-Id: <4f8f84b835e15c17e2277f1f76f073aa3901ed73.1696347109.git.vkh@melexis.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Add 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. Signed-off-by: Volodymyr Kharuk Acked-by: Benjamin Mugnier --- .../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 diff --git a/Documentation/userspace-api/media/v4l/common.rst b/Documentation/userspace-api/media/v4l/common.rst index ea0435182e44..1ea79e453066 100644 --- a/Documentation/userspace-api/media/v4l/common.rst +++ b/Documentation/userspace-api/media/v4l/common.rst @@ -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 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst new file mode 100644 index 000000000000..fd8969d3d354 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst @@ -0,0 +1,56 @@ +.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later + +.. _tof-controls: + +*************************************** +Time of Flight Camera Control Reference +*************************************** + +The Time of Flight class includes controls for digital features +of the TOF sensor. + +TOF sensor is a receiver chip. Each pixel in the sensor measures the travel time +of light to that pixel and hence the distance to the object seen by that pixel. +There are different types of TOF sensors. Direct TOF sensors (also known +as Lidars) send a single pulse and measure direct time of flight. +Another type of TOF is indirect TOF sensors, which emit continuous wave +(could be radio or infrared) and then measure phase shift of reflected light. +The sensor modulates outgoing light and then collects reflected photons +as an electric charge with modulated pattern. Knowing the frequency of +the pattern you can calculate the real distance. + +For more information about TOF sensors see +`TOF `__ from Wikipedia. +Also, there are other nice explanations from vendors about indirect TOF: +`Microsoft `__, +`Melexis `__, +`TI `__. + +.. _tof-control-id: + +Time of Flight Camera Control IDs +================================= + +``V4L2_CID_TOF_CLASS (class)`` + The TOF class descriptor. Calling :ref:`VIDIOC_QUERYCTRL` for + this control will return a description of this control class. + +``V4L2_CID_TOF_PHASE_SEQ (dynamic array u16)`` + Change the shift between illumination and sampling for each phase + in degrees. The distance / amplitude (confidence) pictures are obtained + by merging 3..8 captures of the same scene using different phase shifts + (some TOF sensors use different frequency modulations). + + The size of dynamic array specify the number of captures. + Also driver may decide whether V4L2_CID_TOF_FREQ_MOD and + V4L2_CID_TOF_TIME_INTEGRATION should change the number + of captures or rely on V4L2_CID_TOF_PHASE_SEQ control. + The maximum size of the array is driver specific. + +``V4L2_CID_TOF_FREQ_MOD (dynamic array u32)`` + The control sets the modulation frequency (in Hz) for each phase. + The maximum array size is driver specific. + +``V4L2_CID_TOF_TIME_INTEGRATION (dynamic array u16)`` + The control sets the integration time (in us) for each phase. + The maximum array size is driver specific. diff --git a/MAINTAINERS b/MAINTAINERS index 90f13281d297..83e325e273dc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13557,6 +13557,13 @@ S: Supported W: http://www.melexis.com F: drivers/iio/temperature/mlx90632.c +MELEXIS MLX7502X DRIVER +M: Volodymyr Kharuk +L: linux-media@vger.kernel.org +S: Supported +W: http://www.melexis.com +F: Documentation/userspace-api/media/v4l/ext-ctrls-tof.rst + MELFAS MIP4 TOUCHSCREEN DRIVER M: Sangwon Jee S: Supported From patchwork Wed Oct 4 07:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Kharuk X-Patchwork-Id: 730910 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CC006FCF for ; Wed, 4 Oct 2023 07:20:10 +0000 (UTC) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57905B8 for ; Wed, 4 Oct 2023 00:20:09 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9ad8d47ef2fso317716166b.1 for ; Wed, 04 Oct 2023 00:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=melexis.com; s=google; t=1696404008; x=1697008808; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o4ZgBmHteA4wHsLrCFexpXA7K7drP5ZEJIQkSB/aVxY=; b=DID62vkPq/VUnxOpfFxAi/VHOlGNhCBgZwIH01rEgXpebAha4q7zIXt/O6KwcHYEhV qwT9DIp3oApxmv62u98bIOVz/RXwCOgp0orbsgZJxN5Ck1i2TLcawSj8V28hnUymMdKM fH0A75k/Nyk2IKhFihdsIC+UbKZZgCogdiIDtgfN8g53MaAz5tKfAHqkz9Sv/9LIP/7B JYMXADrthpM4dAIUIP34HSPR7i32gwRMXDV9SZHGrOlnzfO18EQRJQcbuMPQTljuKDan dq+F0Ddnh/iinRzzOnObKaKQcaeLKSntu1xqbDdPx52BhspAeGCTTn0WNsQu2zc3rCmA 3vvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696404008; x=1697008808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o4ZgBmHteA4wHsLrCFexpXA7K7drP5ZEJIQkSB/aVxY=; b=fK4oP5lwk1kJnLP/LvP8wIJUFNvQubKInvq5q4uTlY5jTFnQiDxU73sS2IVECOplL6 LKHp6SKvrKyLRz+24JRp92p0Ag6mkUJB2uTpCqj1FMLtYPJscqSspm1ApA21RZ826sYI d1VyrziX+Vu82Yt0PkRLs92C2vZ1h0c9yzH8TKw3CAOxZt4AN4/IPjEHD8H5g4DL5F73 Dv73DdUdGNgp+JHmb1QWHDuqSdk1nqrN9A978xQc5XS2rnLcmTSB2EDU7/ad+9OlPDhp Xxz1Y1nnmXYyekKETMVnt4W9XWu/tarcdBS9xqHljhsdVzxdyWFM1TnOxuQMH06GvYsj G42g== X-Gm-Message-State: AOJu0YwprMcR3ODNC77PUSl+RkWwrRt0KA5tJcnMDcU/ANc0hhZTk2qp vpsx+YAJTvZlpCU40jSfu9qGAw== X-Google-Smtp-Source: AGHT+IHjaQnPJiOBXT2srG6qiWyWozTCOtRExhfL43SYkbnCTGkV0QlIu7hyxYuUdHGNL7GoroyFCw== X-Received: by 2002:a17:906:259:b0:9ad:c763:c3fd with SMTP id 25-20020a170906025900b009adc763c3fdmr1282878ejl.28.1696404007907; Wed, 04 Oct 2023 00:20:07 -0700 (PDT) Received: from melexis ([91.192.181.19]) by smtp.gmail.com with ESMTPSA id h14-20020a170906590e00b0099e12a49c8fsm2295468ejq.173.2023.10.04.00.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 00:20:07 -0700 (PDT) From: Volodymyr Kharuk To: Cc: Andrii Kyselov , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Laurent Pinchart , devicetree@vger.kernel.org, Hans Verkuil , Sakari Ailus , Benjamin Mugnier , Volodymyr Kharuk Subject: [PATCH v5 5/8] media: v4l: ctrls: Add user control base for mlx7502x Date: Wed, 4 Oct 2023 10:19:44 +0300 Message-Id: <825edc1f9ed194a8478ca1432edd9a26c7a11934.1696347109.git.vkh@melexis.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Add a control base for mlx7502x and reserve 16 controls. Signed-off-by: Volodymyr Kharuk --- include/uapi/linux/v4l2-controls.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 92b3957d5720..28af0b3e2240 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -204,6 +204,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 */ From patchwork Wed Oct 4 07:19:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Kharuk X-Patchwork-Id: 730909 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20B4D6FDC for ; Wed, 4 Oct 2023 07:20:17 +0000 (UTC) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ECF4BD for ; Wed, 4 Oct 2023 00:20:14 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9936b3d0286so321322266b.0 for ; Wed, 04 Oct 2023 00:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=melexis.com; s=google; t=1696404012; x=1697008812; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bTpsAPBi5GKu/J1Fc/6++nPykYaaAvbzc3zwdXb4wDg=; b=pqMVwO9Zp+hquPo4VkRW1t87EKzJ2jjJu27JTgi/oMKr/Cbd03x6tE/PM2R+ZNG6R3 wdAbx1vkBh5zUsGdeABbIatwQnsTti1dCQPG2pA/1UTnUVsrkwd7TqbMOqbBkMIyeDX0 iA+FPMrJLfgpJdZa4uH8N52cCIqfeJ1mFtsil5+PpDm5p0ia0WADG2fqiZLLPJYxFWj7 fAsH4o09YUB2WPGdnxhNsg3zXxYRVQgpZJoEwspD5iSQ7N7FsGL7Aj9GA/hHCvo2K2Ri qifTjlBM9obtIUjT4CABfWk3isWmcHclKwUDoJvSidzWWsSK55QbNZNwhH//8sZtyUDC znEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696404012; x=1697008812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bTpsAPBi5GKu/J1Fc/6++nPykYaaAvbzc3zwdXb4wDg=; b=m86jrfrlrCY+yaY0fFUEpM18q9nH9xaxahfxw0E0QyTmN5NhZaAUBs8N78nJSSHHR4 fHSpyN/XIvIpgE1XYoTa98UzXaismV4FNjWvp4aQchKFxxcRtS4QvRu+PRE2cAqPDmjt BRsy6RnLVPjmr1mdCeMug42iirphMuxih3Cyq4reaDOCKLgYADoP68xZCG8FngxY/mIQ HckkTnfsZkUOGYVcwViDcWxZbgZJFafv2PUugA8VnLDqIQdDHUYVTDOzAN8Gk+0qUb4l oBBbh3KIMJJ/S6UHHKauozQbyZrZeSoMAB7zbiyI6su9tzO3QwfqawxSvwLCUUlYn/oZ n6Hw== X-Gm-Message-State: AOJu0Yz2viuZ2sx4aDokBe1lpf9QV/bXN4mOe94sP8gwiR2jinGxXqAD 4e52RAmVB28JIZy6rlCNBh03DA== X-Google-Smtp-Source: AGHT+IFhzJQFUC8Ywe5pnbymojVwOeQD6C6f3/FA8U+MP7KdSZHH+Cb1O6x8LO6gixC/otHBghhk2w== X-Received: by 2002:a17:906:8b:b0:9b2:b149:b81a with SMTP id 11-20020a170906008b00b009b2b149b81amr1684846ejc.64.1696404012705; Wed, 04 Oct 2023 00:20:12 -0700 (PDT) Received: from melexis ([91.192.181.19]) by smtp.gmail.com with ESMTPSA id o13-20020a170906358d00b0099bc8db97bcsm2265910ejb.131.2023.10.04.00.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 00:20:12 -0700 (PDT) From: Volodymyr Kharuk To: Cc: Andrii Kyselov , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Laurent Pinchart , devicetree@vger.kernel.org, Hans Verkuil , Sakari Ailus , Benjamin Mugnier , Volodymyr Kharuk , Krzysztof Kozlowski Subject: [PATCH v5 7/8] media: dt-bindings: Add mlx7502x camera sensor Date: Wed, 4 Oct 2023 10:19:46 +0300 Message-Id: X-Mailer: git-send-email 2.38.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Add device tree binding of the mlx7502x and update MAINTAINERS Signed-off-by: Volodymyr Kharuk Reviewed-by: Krzysztof Kozlowski --- .../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 diff --git a/Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml b/Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml new file mode 100644 index 000000000000..7b86b6c5b151 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/melexis,mlx7502x.yaml @@ -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 + +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 + + 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 >; + }; + }; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index 49cc44fe8ec4..c9da47ff2652 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13562,6 +13562,7 @@ M: Volodymyr Kharuk L: linux-media@vger.kernel.org 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