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: 5517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp392344wrn; Thu, 16 Feb 2023 08:20:05 -0800 (PST) X-Google-Smtp-Source: AK7set8+2A5SnxE4vZElUBAO/j0ChI7xHDaI/gYRzp1+3XKmn0NIsp8pj/Nbj4HSrUYGXWnq9o2+ X-Received: by 2002:a05:6a20:a111:b0:b9:817e:2ff2 with SMTP id q17-20020a056a20a11100b000b9817e2ff2mr7563572pzk.57.1676564405185; Thu, 16 Feb 2023 08:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676564405; cv=none; d=google.com; s=arc-20160816; b=Boy8M7evJ5EnCh2MhPFm52BpCHat+6m+Gp6m/R41ZbJ4NqQyaGFRdrYN2/kFiwFUaP IO4PWfacvvhU1EfS228daumbQqgXnEgsIptSopq67BmcN9828ILicTTin1GaUdcShZf1 I5+1H8b7WhkjMcfluMAZZK5IsKSFogGSlTKsvpoBErxCqeaN6Ia5MIJbXQDmwBIOpY0E T0cTSbRISqAva96qcabQz5YvRfW0JxsUAboQEN86AA3qiW+UZLMwB0R1fHfcldkEjWJF peD+6E9JvLHQZiEma5UbCyPb+xx28SN5g9dTETHfEPJzeEFozUCSJTG9ATzZo1iiI1oy t80Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=9lFXqhOt2OsAjZlN9q24biXqlMln9UilMimz3k+ZbCE=; b=zXja7vxVUtBxICEvEQAy766ud7V4oyO6ECBuSdNdCxIG0YW19YTeLXWBjr/C0Q+sXq MN2ZE5bVMlR3gBIjcDNP6kM3TcKITg70G8ICkjpFZ+1OX917sFWpuaewP6CLiJSp5Hsr Km8WaavzDZFkfxsQnGCuNNPZRb8VdOtA7VzobJbAJ6HsZwLUZ19Ilsk33XPer+Vn+EAw qfrCs+1g9WjrTwZuipQDLiZrh4xO0onHqbwaXaGX8W8InozB/6J0loBmyY95tXzWiI9c gDizFqblEfPUnpZkfAugg2QA747V1e4rGvzZcOn2lcyf3SSDy0C4RyQU0Ht1sXhfFI08 SnFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=L0sVkWCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i126-20020a639d84000000b004da13f2c14fsi2293402pgd.338.2023.02.16.08.19.47; Thu, 16 Feb 2023 08:20:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=L0sVkWCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjBPQMU (ORCPT + 99 others); Thu, 16 Feb 2023 11:12:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjBPQMS (ORCPT ); Thu, 16 Feb 2023 11:12:18 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D42A4E5D1 for ; Thu, 16 Feb 2023 08:12:17 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id m14so2320757wrg.13 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=e4dNdgpolJogNqKRapp9ueXZMFzz42alEtKhgaCzeyRU3o38LjLGJoMpV4E8lbLg3j fzGAIf8ojzVMlgX6rM/WeZwAO7kxe1RUY1/W+LwwHJwzhh56DBCrxmoSP/tXv5Hzutu2 cDZ/PuP6n2o6WDUoAVkY2h8lKz7+pmArBZvLe1kdAqRw2tnDYjPGS7c1254wwmKjt0Aw hMhN+eHSnfGnU9iVms1u4feCZb0IUoQe3VbCC9xzjCYYBAIf2akxRcyQ1gXGv2+xoWgp gBw9rhvgH+7ZRwHweavm614kLvLibIk4gsa1zRnT+hCtD49AMv1Pcw4qjqXGK5nk/BnF 9Jxw== X-Gm-Message-State: AO0yUKUuloViipt5OEIyrvzpzxPUOpe6dEqxw3eqQjGYdwiFukLDZE3w SgTMd0kJ2IWVrdHkoGw1ykQcgQ== 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758005197363390985?= X-GMAIL-MSGID: =?utf-8?q?1758005197363390985?= 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,