Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15172750rwb; Mon, 28 Nov 2022 08:40:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf5OC4Zg3iOdpmnvFTLGZkJODXoTPMYzRL45vDFBLBGpeN8qaE/ifNHCiyopMbkJRkBOOCHa X-Received: by 2002:a05:6402:1814:b0:46a:b1ba:22b8 with SMTP id g20-20020a056402181400b0046ab1ba22b8mr16168237edy.316.1669653647938; Mon, 28 Nov 2022 08:40:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669653647; cv=none; d=google.com; s=arc-20160816; b=FOZwBfJirmgw5Qyh1fZzWFDB5ppxEuHrM55/+lY2mMFEFLAqSbITyORzXdomhsn4+k ATjG+ihFJiSwlzwMSFLLqNnas5uJlI3Q0sWPvYhZEBd0Ie+kSM5P+Jdg69BH6RaQOLQ+ 8g6L8lnqN6zQMqCYoSQXmvzSlquuUveqyEaEtpwGMWL+z5UOM0BBiya5aVsmjJllxYrb dS65l58Z0X/58hkfQ21kuPn4tWBtZ2PCNSJ7NrwCDpQHW9d3J2bcA7yER8eEIOPnLmpc Lrb+c9YQUYKgqsOC/Mtqg5U3CmFUfE7cEfUAB5kJ/lpHDR58j9DYNaZ+uhvIYKkhy0Lb +t1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=A0OXxX4BN+JC/Hy+vtoYftLVfMwhN/RiALx1B4QXUlc=; b=mZjbQc9oD6z2vMU1gU+Y/WTbBedP5FmiM9F7AIEy4xxHnpNbm8ttf17/KS7VpnoQIc iP8xbNHhAAAgr+JlVy974dPjtDALXlLcIbymsfNkyqylfRlRMYaxZ88fWibliDxs+5gZ RpSSoVJ52i9pFGwm3xjhXkM5h5VSDL0k8xpiLH8vsbhAn7oZI3sWl06Ukz+Z1VMLU3yE 9SsLrGb3AYsraJrCiZwtdUpLVItmObFI67lQDZCFOP+BmMxLsF6D/nErcUCI0X7aEi1l T0u0+0gF7QUyKGNMTpIM6fw8FwdG36KkhcG4AbShWOBLeQbUqlQzby4mcTtUqH2Lg3cw vm9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=SlkrWf3S; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js18-20020a17090797d200b0078dd7383ed8si10847949ejc.414.2022.11.28.08.40.26; Mon, 28 Nov 2022 08:40:47 -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=SlkrWf3S; 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 S232716AbiK1QV5 (ORCPT + 84 others); Mon, 28 Nov 2022 11:21:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiK1QVt (ORCPT ); Mon, 28 Nov 2022 11:21:49 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D74013E86 for ; Mon, 28 Nov 2022 08:21:48 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id x17so17699373wrn.6 for ; Mon, 28 Nov 2022 08:21:48 -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=A0OXxX4BN+JC/Hy+vtoYftLVfMwhN/RiALx1B4QXUlc=; b=SlkrWf3SnnGDpb675mkRP6lf4nLIT1ljnSs811QXoTIpKGIr6nkO1robz4uvX+3hel emJjd5A2yCCTjR0LXKEjLdGYNb2o2zsvcHdQ1nXfW9oFv0bIePuY9EEF+wvSQ1jpJpfe uYlNtXWlsAQakgdO/rq4yHkCGTL/bSh4cUCBhsM2mfP/FtZp0bXgE/HPcGJU/oRl3i2l zPL3lW+z6Kap+h6fgLOacZBtOL/HD9TJ6ShxhljgFYgVd4/L6A/2W0q8oT/Juz8T/7qv qlVqVlXVA5+/JbXKOjRIX+Nb72oLRueixKPJUM69A14modQclXgDP110z0Dye0vX0jdJ cvZg== 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=A0OXxX4BN+JC/Hy+vtoYftLVfMwhN/RiALx1B4QXUlc=; b=0SQL6eOr1DqOtayspfAl8Ru9UjhY7v8qF/IfSUP1F5XJ/FXzZScpXl7WCVXJDaoXwB sWF8GbyCXCmeo0P+SHQ8E+cC7T09IPmftcxRkiP27jYEsIw972lmxciHi/8stdQ6ecJq /v+Fo7ICnhSD02ZFYlK2BPaPeJMY40HnkwpsPa0CNDC9rYBchmFP9qaHPjapsvsYJD4W L6loeWw61AZblM2Zn7WQtO/Ht1Ls01/Px2Wm9DkR49oTld91FXgV2wW+SCMafxrzXrHo Wd9ap+g2lJ8jyN2u9Z8cTOR3jI36V8lugjIUxWLygllmxAF4n6hyKnnqpaQqYLlmjmHv 0DfA== X-Gm-Message-State: ANoB5pkysmuRXCSeyWJttgIS3rvnkbBZRmIrz4Fw5aCMpyHhngi2Sfnq l2S1hqmT/qXyhNQ3V56iQOz5gA== X-Received: by 2002:a05:6000:128c:b0:236:e512:1a9e with SMTP id f12-20020a056000128c00b00236e5121a9emr23151843wrx.416.1669652506887; Mon, 28 Nov 2022 08:21:46 -0800 (PST) Received: from [127.0.0.1] (2a02-8440-6340-f657-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6340:f657:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id s10-20020a1cf20a000000b003cfe1376f68sm15311450wmc.9.2022.11.28.08.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:21:46 -0800 (PST) From: Guillaume Ranquet Date: Mon, 28 Nov 2022 17:17:37 +0100 Subject: [PATCH v5 2/3] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220919-v5-2-f346444bc459@baylibre.com> References: <20220919-v5-0-f346444bc459@baylibre.com> In-Reply-To: <20220919-v5-0-f346444bc459@baylibre.com> To: Chunfeng Yun , Krzysztof Kozlowski , David Airlie , Matthias Brugger , Philipp Zabel , Rob Herring , Kishon Vijay Abraham I , Daniel Vetter , Vinod Koul , Chun-Kuang Hu , CK Hu , Jitao shi Cc: mac.shen@mediatek.com, Guillaume Ranquet , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, stuart.lee@mediatek.com, kernel test robot , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org X-Mailer: b4 0.11.0-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 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 { -- 2.38.1