From patchwork Thu Feb 16 16:02:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 13143570 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDC5FC636D7 for ; Thu, 16 Feb 2023 17:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bhWpcPjRzHA/2erRc+57PfEe81GPVEhBPZM+fNTzCpI=; b=Cg+CAukmLnZ0dN xRcJf6iysXjokhNNB5Wmz+vCDroWPQCydAT03CMsY0Xm57XzrBXP4FFhNtFgZH/IdRIR0yDTN5aYA 4Vb2ZzTnQpAHXWtfZQgx017Dgd0ffnZNDGvikVCbzyMiGPDLJdkWp9iLZ9DnPfRqwL0wd0ZyeQtnm Pcuoita+aGoKbsS2A5AQYDOPwqj4eVpFJc3E0JBv2/F946TSufySssK9m63/3N3OZrCGtXqVYD2f7 UhM+DG0sFWAAo0XAn3N3+bUhLDkZzUIXfeNI8djvMNITuqcPLIUgneuFb3ZmuaDdAy6HQIEW3R3tJ 7dcY/M+IROi853SDr8qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pShrN-00BJFo-Fh; Thu, 16 Feb 2023 17:15:53 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSgrs-00B6Sl-94 for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2023 16:12:25 +0000 Received: by mail-wr1-x443.google.com with SMTP id d4so2277699wrj.1 for ; Thu, 16 Feb 2023 08:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=9lFXqhOt2OsAjZlN9q24biXqlMln9UilMimz3k+ZbCE=; b=L0sVkWCeH5g7Y1SN9yP507VBDypXN55J/yXZKy5ne+L5Zy1kHCp1Kj+tL+6mSj5H2d Qvyl5gTe2zGLS3cXoRhnibKk3SzJSDifV12O+6PXYb9KiC5olmaeDwQd/YlojJ+leF2i VwfdJn9HiWl+waQTF2siGDa0oII4sQp7flT/SOb8dU13EHDt5XNM5FiUPi9oc3Wr1PcJ 2OFoLOety3Fetv4cSosf1x9KLuCz8UpDV72gD6M+jnFkOymTW6HCEC0hbtYdgRDFcAgu /5XEUKrKLEsINNiqkO/JxDcLVRmmoUI6W+JEAnKYgHc2xDCEe3gjeotvDWDPkWkec3dc LzBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9lFXqhOt2OsAjZlN9q24biXqlMln9UilMimz3k+ZbCE=; b=N/wdY/HGRXVZfG3kas81OfMazWfwOApZjrv4+VHAGCKWjuiZAPIcaoUizwH1Cei/tU 6zucHP3r2McQ10280WM/t5HtWRfM6Mk+aQ4qaKm4tFC7t9GXUDWMhU1ZtK7vP3GCZBWK pyjfKO8Xf+lo/AVqT+QDnByb7QHachU5x/fbfmwQvAO9yPLuELHadJYZdJUc6zP2gU2U AnAFcZjF+4/+O4Sn27BrLbGzFZwBpi66tSBsU9Fbzxy00/jOuoc6QG5Pi/HNWV4yRwvD f71bJx4uUwkhY3W83VZ2KLMEiJmi4W76WIaTFPXAkSi67nwmHpt60cN/xTStcpTff0kb TGgw== X-Gm-Message-State: AO0yUKUW0aEdssXXxaR5LudG6SA6cayDfHh43N/JtgjKdNn58qeKO5fe ggaMjNqgBBHApVww9WNIXmIQvQ== X-Google-Smtp-Source: AK7set9HfpJ/WtYQfwUA/WaYWlKP16uqXWuqMuHS3egf3HT7MZs2MM9vbGhFeIU7EHTCRrVrA+8KpA== X-Received: by 2002:a5d:55cb:0:b0:2c5:4154:9f32 with SMTP id i11-20020a5d55cb000000b002c541549f32mr5049388wrw.65.1676563935831; Thu, 16 Feb 2023 08:12:15 -0800 (PST) Received: from [127.0.0.1] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id m16-20020adff390000000b002c56a1a5a95sm1845586wro.30.2023.02.16.08.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 08:12:15 -0800 (PST) From: Guillaume Ranquet Subject: [PATCH v8 0/3] Add MT8195 HDMI phy support Date: Thu, 16 Feb 2023 17:02:24 +0100 Message-Id: <20220919-v8-0-a84c80468fe9@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJBT7mMC/23PS2rEMAwG4KsMXjfFlmXH7qr3KMMQy3Zjmgc40 8Aw5O5VuymYrMQv9AnpKbZUS9rE2+UpatrLVtaFg3u5CBqH5TN1JXIWIAGkV74b41xu8/1L8EQ YttSFOiw08szyPU3cHMt2X+vjb+OuuHz84111skOH6JQl76R7D8NjKqGmV1pncWW+Q0OAiUPlI 2XM0scTohuimQxO6gzWSgX9CcGGIJMQCVRSWvbJnxDTEMMka7SIGAjNGbENsUwgW1SEABTsCek b0v8eZoJxZIhItr8cx/EDtv41ScQBAAA= To: Chunfeng Yun , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , CK Hu , Jitao shi Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , AngeloGioacchino Del Regno , mac.shen@mediatek.com, stuart.lee@mediatek.com, Guillaume Ranquet X-Mailer: b4 0.13-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230216_081220_620931_96781060 X-CRM114-Status: GOOD ( 14.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for HDMI phy on MT8195. This is based on top of next-20230213 I'm sending v8 despite a pending question from Vinod [1] regarding some odd register writes for impendance. I'm trying to get some feedback from MediaTeK regarding the content of thse registers, but It may take some time... [1] : https://lore.kernel.org/all/Y+upK4nCCYlg+4dU@matsya/ Signed-off-by: Guillaume Ranquet --- Changes in v8: - Used GIGA / MEGA macros where applicable - Link to v7: https://lore.kernel.org/r/20220919-v7-0-b5b58c5ccc07@baylibre.com Changes in v7: - Removed lkp reported-by trailer - Fixed checkpatch --strict warnings/checks (besides two lines at 102 chars instead of 100) - Used constants where applicable as suggested by Vinod in v6 review - Link to v6: https://lore.kernel.org/r/20220919-v6-0-2f641c422cb6@baylibre.com Changes in v6: - Adapt clock bit ratio when TMDS is over 340M - Used sized integers for register read/writes - Removed useless comments - Shortened function names - Link to v5: https://lore.kernel.org/r/20220919-v5-0-f346444bc459@baylibre.com Changes in v5: - Fix compilation errors on 32 bits platform with no support for __udivdi3. Compile tested on mips with gcc-12 - Link to v4: https://lore.kernel.org/r/20220919-v4-0-bdc21e1307e9@baylibre.com Changes in v4: - Dedicated series for HDMI phy support (without the drm/ related changes) - Removed useless variable initializations in phy driver - Link to v3: https://lore.kernel.org/r/20220919-v3-0-a803f2660127@baylibre.com Changes in v3: - phy: Grouped register and bit definition together to add clarity - dt-bindings: Addressed comments - Link to v2: https://lore.kernel.org/r/20220919-v2-0-8419dcf4f09d@baylibre.com Changes in v2: - Removed syscon requirement from the hdmi node - Use as much as possible bit FIELD_PREP/FIELD_GET macros across all the patches - Make cec optional dynamically instead of hardcoded with a flag - Renamed hdmi variants to v1 (legacy) and v2 (mt8195) while waiting for a better name - Rework hdmi v2 code to use a connector (same as v1) - Remove "magic" 0x43 addr special handling in hdmi ddc code - Link to v1: https://lore.kernel.org/r/20220919-v1-0-4844816c9808@baylibre.com --- Guillaume Ranquet (3): dt-bindings: phy: mediatek: hdmi-phy: Add mt8195 compatible phy: phy-mtk-hdmi: Add generic phy configure callback phy: mediatek: add support for phy-mtk-hdmi-mt8195 .../devicetree/bindings/phy/mediatek,hdmi-phy.yaml | 1 + drivers/phy/mediatek/Makefile | 1 + drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 495 +++++++++++++++++++++ drivers/phy/mediatek/phy-mtk-hdmi-mt8195.h | 113 +++++ drivers/phy/mediatek/phy-mtk-hdmi.c | 15 + drivers/phy/mediatek/phy-mtk-hdmi.h | 3 + 6 files changed, 628 insertions(+) --- base-commit: 09e41676e35ab06e4bce8870ea3bf1f191c3cb90 change-id: 20220919-hdmi_mtk Best regards,