From patchwork Fri Jan 27 16:11:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 647716 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 CDD17C61DA4 for ; Fri, 27 Jan 2023 16:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234780AbjA0QQh (ORCPT ); Fri, 27 Jan 2023 11:16:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234739AbjA0QQb (ORCPT ); Fri, 27 Jan 2023 11:16:31 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374247D2A6 for ; Fri, 27 Jan 2023 08:16:20 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso3847373wmq.5 for ; Fri, 27 Jan 2023 08:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=op30N8VplB3ypI088BE1DuG6HdC3ZVERGlwL+v56hF8=; b=SZmfIny3U/S8qG+e/WnJPW4Ssp//fHLsfmZRnuGKIjQTiMoUmWHXcxyZjYy1KVA7QS oaCB2QrEooTl9JsCGk5BX2yDzWNkkiEWfQKklWElFXvT5LuTZ8bl6PA8gvRxnJiuFQCQ ys/gWBK0HZXF0WohL0y6qH1/kbm86bd0lvIE5rIwCVnNwBXpou+1efVA4qJxT0PBMkNz uUqCAIDiXkYYJoRn+34edZorjJOJ8YWGQ7jt1oNyZ1865LL63dXK3s4fGMeaRKCwlFFL WzgoOyT8vV2UQ4rOZYkBaUxxGTudg8Ca3ay0+6v2g4tpfg5b0E8kHpd1HDjOaU0sE3o9 uxpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=op30N8VplB3ypI088BE1DuG6HdC3ZVERGlwL+v56hF8=; b=ArKXW3tsEczYz29OPtKyvtMGIdxINbd2cLu1j0P0N4hCjUxx3m+I/T0JRBZDMfrzsQ 8j/PRp7+syCMbjkMnar1W9bXDCxdDqsdA2xNFSPqDlM+H7Mg3v5PgafkPz6i9N9kBibQ IWgBmgU4z0SFZuTldWsxIvEP0ngt2tv4+DcIXGgthLvmZVE5x/iMkemxoblzcAObnizN HygIDsK5ZGZ8G8ZpxpNKPjmI4c/6ZfkOv+wMVSkeOTZ81eMrdERllq6MWHcR4MbjbG15 FH6v7t9YaaLwwf5/+VPcfpnH5AOgxaBMzKhSU83kp2KISMJr5PkpZZt0aAjOGMfNTjgi UcrA== X-Gm-Message-State: AFqh2kqfYhSYKU1ruj00l8peoEhmHfdI0T9kg9wa1O8Hm2RB2va0PiUY F37LreRE8kKnqIy1rZ/pfYyldw== X-Google-Smtp-Source: AMrXdXuordLziVYmuuVYBeA7Bkt5b1HbFTqNvAAo/MRucQWcpaadudaJmH5tq/D7Ta4P+ZjFAaTv7A== X-Received: by 2002:a05:600c:21c4:b0:3da:fcf1:d4cc with SMTP id x4-20020a05600c21c400b003dafcf1d4ccmr40404327wmj.30.1674836178781; Fri, 27 Jan 2023 08:16:18 -0800 (PST) Received: from [127.0.0.1] ([2a01:cb19:85c2:1100:7fe1:513:212f:568e]) by smtp.gmail.com with ESMTPSA id e19-20020a05600c439300b003cfd4e6400csm4744566wmn.19.2023.01.27.08.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:16:18 -0800 (PST) From: Guillaume Ranquet Date: Fri, 27 Jan 2023 17:11:35 +0100 Subject: [PATCH v6 2/3] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Message-Id: <20220919-v6-2-2f641c422cb6@baylibre.com> References: <20220919-v6-0-2f641c422cb6@baylibre.com> In-Reply-To: <20220919-v6-0-2f641c422cb6@baylibre.com> To: David Airlie , Philipp Zabel , CK Hu , Chunfeng Yun , Matthias Brugger , Krzysztof Kozlowski , Jitao shi , Rob Herring , Daniel Vetter , Chun-Kuang Hu , Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, stuart.lee@mediatek.com, Guillaume Ranquet , mac.shen@mediatek.com, kernel test robot , devicetree@vger.kernel.org, linux-phy@lists.infradead.org X-Mailer: b4 0.11.0-dev Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some phys, such as mt8195, needs to have a configure callback defined. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Signed-off-by: Guillaume Ranquet --- drivers/phy/mediatek/phy-mtk-hdmi.c | 12 ++++++++++++ drivers/phy/mediatek/phy-mtk-hdmi.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-hdmi.c b/drivers/phy/mediatek/phy-mtk-hdmi.c index b16d437d6721..32f713301768 100644 --- a/drivers/phy/mediatek/phy-mtk-hdmi.c +++ b/drivers/phy/mediatek/phy-mtk-hdmi.c @@ -8,10 +8,12 @@ static int mtk_hdmi_phy_power_on(struct phy *phy); static int mtk_hdmi_phy_power_off(struct phy *phy); +static int mtk_hdmi_phy_configure(struct phy *phy, union phy_configure_opts *opts); static const struct phy_ops mtk_hdmi_phy_dev_ops = { .power_on = mtk_hdmi_phy_power_on, .power_off = mtk_hdmi_phy_power_off, + .configure = mtk_hdmi_phy_configure, .owner = THIS_MODULE, }; @@ -43,6 +45,16 @@ static int mtk_hdmi_phy_power_off(struct phy *phy) return 0; } +static int mtk_hdmi_phy_configure(struct phy *phy, union phy_configure_opts *opts) +{ + struct mtk_hdmi_phy *hdmi_phy = phy_get_drvdata(phy); + + if (hdmi_phy->conf->hdmi_phy_configure) + return hdmi_phy->conf->hdmi_phy_configure(phy, opts); + + return 0; +} + static const struct phy_ops * mtk_hdmi_phy_dev_get_ops(const struct mtk_hdmi_phy *hdmi_phy) { diff --git a/drivers/phy/mediatek/phy-mtk-hdmi.h b/drivers/phy/mediatek/phy-mtk-hdmi.h index c7fa65cff989..f5aac9d352d8 100644 --- a/drivers/phy/mediatek/phy-mtk-hdmi.h +++ b/drivers/phy/mediatek/phy-mtk-hdmi.h @@ -24,6 +24,7 @@ struct mtk_hdmi_phy_conf { const struct clk_ops *hdmi_phy_clk_ops; void (*hdmi_phy_enable_tmds)(struct mtk_hdmi_phy *hdmi_phy); void (*hdmi_phy_disable_tmds)(struct mtk_hdmi_phy *hdmi_phy); + int (*hdmi_phy_configure)(struct phy *phy, union phy_configure_opts *opts); }; struct mtk_hdmi_phy {