From patchwork Thu Jul 28 11:40:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erling Ljunggren X-Patchwork-Id: 594230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFC80C04A68 for ; Thu, 28 Jul 2022 11:42:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237411AbiG1LmK (ORCPT ); Thu, 28 Jul 2022 07:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236093AbiG1Llt (ORCPT ); Thu, 28 Jul 2022 07:41:49 -0400 Received: from aer-iport-3.cisco.com (aer-iport-3.cisco.com [173.38.203.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6839861D9C for ; Thu, 28 Jul 2022 04:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1012; q=dns/txt; s=iport; t=1659008508; x=1660218108; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lvmHJ9jtLLryVxiYm2IVCMtruhj+XGzUj7ksUrsmL4s=; b=PON841IeoPYrllvmuHu6RzFYz/eB8A411y04r6g2EErA39/mxbmHtbSt YyNIS3EDgjvCsIvOL2t+CU/Rq2Hx6tXqYblZacxQqfVetbRwN88wlFX8l 43UQnHKp/0EgnVJB6M2o67XwUbYjxnzwhZQcJndy6PtRXeZR70XJ1v7Xz s=; X-IronPort-AV: E=Sophos;i="5.93,198,1654560000"; d="scan'208";a="3244143" Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 28 Jul 2022 11:40:43 +0000 Received: from office-260.rd.cisco.com ([10.47.77.162]) by aer-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id 26SBegI2010979; Thu, 28 Jul 2022 11:40:42 GMT From: Erling Ljunggren To: linux-media@vger.kernel.org Cc: Erling Ljunggren Subject: [PATCH 1/5] media: videodev2.h: add V4L2_CAP_EDID_MEMORY Date: Thu, 28 Jul 2022 13:40:46 +0200 Message-Id: <20220728114050.2400475-2-hljunggr@cisco.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728114050.2400475-1-hljunggr@cisco.com> References: <20220728114050.2400475-1-hljunggr@cisco.com> MIME-Version: 1.0 X-Outbound-SMTP-Client: 10.47.77.162, [10.47.77.162] X-Outbound-Node: aer-core-1.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add capability flag to indicate that the device is an EDID memory device. Signed-off-by: Erling Ljunggren --- include/uapi/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 3768a0a80830..3f771e883460 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -451,6 +451,7 @@ struct v4l2_capability { #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ +#define V4L2_CAP_EDID_MEMORY 0x00000008 /* Is an EDID memory only device */ #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ From patchwork Thu Jul 28 11:40:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erling Ljunggren X-Patchwork-Id: 594228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A1D4C04A68 for ; Thu, 28 Jul 2022 11:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236650AbiG1LmV (ORCPT ); Thu, 28 Jul 2022 07:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236734AbiG1Llv (ORCPT ); Thu, 28 Jul 2022 07:41:51 -0400 Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243142641 for ; Thu, 28 Jul 2022 04:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1436; q=dns/txt; s=iport; t=1659008510; x=1660218110; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DLEp0o3Tg9b97BEPc9VE4jjf3IOnWujLqJ4rv8kbZVk=; b=HPup/33B3G0EHwyhrlr7eZSm8ifwIBjvPvVAxsK46TDqcZpc/bPocTDW 9x9l+QL9mNEXyWuJwD6vecZw5/rfyyK/j5709OdUqS1wKGMdL6apbVuQR sOjPpg6VYhHPKSNKDjOJe6Wj491e5pPJd0DUSk55CBfbbr/JqGdfwkbtv Y=; X-IronPort-AV: E=Sophos;i="5.93,198,1654560000"; d="scan'208";a="3279439" Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 28 Jul 2022 11:40:43 +0000 Received: from office-260.rd.cisco.com ([10.47.77.162]) by aer-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id 26SBegI4010979; Thu, 28 Jul 2022 11:40:43 GMT From: Erling Ljunggren To: linux-media@vger.kernel.org Cc: Erling Ljunggren , devicetree@vger.kernel.org Subject: [PATCH 3/5] dt-bindings: media: add cat24c208 bindings Date: Thu, 28 Jul 2022 13:40:48 +0200 Message-Id: <20220728114050.2400475-4-hljunggr@cisco.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728114050.2400475-1-hljunggr@cisco.com> References: <20220728114050.2400475-1-hljunggr@cisco.com> MIME-Version: 1.0 X-Outbound-SMTP-Client: 10.47.77.162, [10.47.77.162] X-Outbound-Node: aer-core-1.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add devicetree bindings for new cat24c208 EDID EEPROM driver. Signed-off-by: Erling Ljunggren --- .../bindings/media/i2c/onnn,cat24c208.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/onnn,cat24c208.yaml diff --git a/Documentation/devicetree/bindings/media/i2c/onnn,cat24c208.yaml b/Documentation/devicetree/bindings/media/i2c/onnn,cat24c208.yaml new file mode 100644 index 000000000000..e1c861335538 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/onnn,cat24c208.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/onnn,cat24c208.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ON Semiconductor CAT24C208 EDID EEPROM driver + +maintainers: + - Hans Verkuil + +description: | + CAT24C208 is a dual port i2c EEPROM designed for EDID storage. + + +properties: + compatible: + const: onnn,cat24c208 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + lens@e { + compatible = "onnn,cat24c208"; + reg = <0x31>; + }; + }; +... From patchwork Thu Jul 28 11:40:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erling Ljunggren X-Patchwork-Id: 594229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC579C19F29 for ; Thu, 28 Jul 2022 11:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236709AbiG1LmR (ORCPT ); Thu, 28 Jul 2022 07:42:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236852AbiG1Llw (ORCPT ); Thu, 28 Jul 2022 07:41:52 -0400 Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1F9643D for ; Thu, 28 Jul 2022 04:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1478; q=dns/txt; s=iport; t=1659008512; x=1660218112; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZV27oEQ0c4Bf39zyMjYO91SIh+6idpUgvNeumAP+Kwc=; b=T7fWrQ1XWZnq5iIsE3ngDLSoYFCiRmpzpGLKp0bc/X/8/EHq0tyQSRbB 1eBC+F85pSPpOdZTMAfzM9H1SBgx4fz6PBYBPnZqq7StQ4eDh+KYYx489 WnyM+pyQC0s35JdcTs5xowDEjihyS1+TBEDDy103/aAuOr7AbEpZD59Me k=; X-IronPort-AV: E=Sophos;i="5.93,198,1654560000"; d="scan'208";a="3279440" Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 28 Jul 2022 11:40:45 +0000 Received: from office-260.rd.cisco.com ([10.47.77.162]) by aer-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id 26SBegI6010979; Thu, 28 Jul 2022 11:40:44 GMT From: Erling Ljunggren To: linux-media@vger.kernel.org Cc: Erling Ljunggren Subject: [PATCH 5/5] media: v4l2-dev: handle V4L2_CAP_EDID_MEMORY Date: Thu, 28 Jul 2022 13:40:50 +0200 Message-Id: <20220728114050.2400475-6-hljunggr@cisco.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220728114050.2400475-1-hljunggr@cisco.com> References: <20220728114050.2400475-1-hljunggr@cisco.com> MIME-Version: 1.0 X-Outbound-SMTP-Client: 10.47.77.162, [10.47.77.162] X-Outbound-Node: aer-core-1.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When the V4L2_CAP_EDID_MEMORY capability flag is set, ioctls for enum inputs and get/set edid are automatically set. Signed-off-by: Erling Ljunggren --- drivers/media/v4l2-core/v4l2-dev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index d00237ee4cae..39437911edcc 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -556,6 +556,7 @@ static void determine_valid_ioctls(struct video_device *vdev) bool is_rx = vdev->vfl_dir != VFL_DIR_TX; bool is_tx = vdev->vfl_dir != VFL_DIR_RX; bool is_io_mc = vdev->device_caps & V4L2_CAP_IO_MC; + bool is_edid_mem = vdev->device_caps & V4L2_CAP_EDID_MEMORY; bitmap_zero(valid_ioctls, BASE_VIDIOC_PRIVATE); @@ -778,6 +779,13 @@ static void determine_valid_ioctls(struct video_device *vdev) SET_VALID_IOCTL(ops, VIDIOC_S_TUNER, vidioc_s_tuner); SET_VALID_IOCTL(ops, VIDIOC_S_HW_FREQ_SEEK, vidioc_s_hw_freq_seek); } + if (is_edid_mem) { + SET_VALID_IOCTL(ops, VIDIOC_G_EDID, vidioc_g_edid); + SET_VALID_IOCTL(ops, VIDIOC_S_EDID, vidioc_s_edid); + SET_VALID_IOCTL(ops, VIDIOC_ENUMINPUT, vidioc_enum_input); + SET_VALID_IOCTL(ops, VIDIOC_G_INPUT, vidioc_g_input); + SET_VALID_IOCTL(ops, VIDIOC_S_INPUT, vidioc_s_input); + } bitmap_andnot(vdev->valid_ioctls, valid_ioctls, vdev->valid_ioctls, BASE_VIDIOC_PRIVATE);