Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp783705rwi; Fri, 14 Oct 2022 08:31:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kJsmr4Vt9gtpyZ5pReRqL1+CsLPmzZwhRFdggCXOcrbzj4dYr2dllE+/AV9K7fapQzvU/ X-Received: by 2002:a17:907:3d91:b0:78d:f675:5659 with SMTP id he17-20020a1709073d9100b0078df6755659mr3996481ejc.92.1665761515781; Fri, 14 Oct 2022 08:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665761515; cv=none; d=google.com; s=arc-20160816; b=Ob1ZyoAoLvDcNQcU1sPkKAbJaR7SEaKE4gaEDhdzu07P70j3rhCBeC6xunFJ4FSY6S 9M3OrfZEUlJeY115WFUqBMu6xzt6mQu+ggefleY6zBn/4sisOjmrwmnUQ2DkBKReeXYC iCVCm3359lpXY5EI1ccLc/0QKG0atdy8JRSoNAHB+c7rg4P4nyYv4NKAWZOvpMaYxOJn BTfMwDO0J5Fj/jo4ZFBMF4FMxGrG1ACoL8B7nCP2m5rQ5lcAE34ITfE/OXuAqGeIHrJv SRd0GrgrwC5YwjbgiWfadoG/gryoQnnmROi5/oF6Rre0C33wY4AdYlyk0V+XhYdbsprh iRlw== 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=7ZMIvZlN2RweJkUN5B//uFf7tgMLArGLgtt1G8UfvMA=; b=Ov16XSxGqkMzSKTfzjix4d/NHDmsa0KWACi4Q9MSOH+JB2RtjKtwPKkl1rrNyqT7fJ UW953B1NHMZaX81x8GCaxtsUGgdgU9n+b3+VPT/2J4pQ4TsBpvcEJS11pce/mb5ajXh7 7VLKP0zKw2HU8DCKM1vV7NAWInF51vwwHnLwL/KimD0AjiZYVgBsO3eSzf3Tlsn/Khi0 THgxjTd6lWGtKw6ZPEm1pLKlbpewgVRFxPUpx4627PhdTJVwfAMykP9lgrz1ECyRWUZt wuR8gnSAPvNQ57x7j3jCfBeiZaN43qBKdq+5bp+aYdrD4Fg2uKj+EtEma+LyLpFEGRXU eXFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=vyYoDAHl; 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 hz5-20020a1709072ce500b0078dfd359c52si2377977ejc.602.2022.10.14.08.31.29; Fri, 14 Oct 2022 08:31:55 -0700 (PDT) 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=vyYoDAHl; 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 S230372AbiJNPVL (ORCPT + 99 others); Fri, 14 Oct 2022 11:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbiJNPUV (ORCPT ); Fri, 14 Oct 2022 11:20:21 -0400 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 F1BD334727 for ; Fri, 14 Oct 2022 08:20:19 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id n12so8058129wrp.10 for ; Fri, 14 Oct 2022 08:20:19 -0700 (PDT) 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=7ZMIvZlN2RweJkUN5B//uFf7tgMLArGLgtt1G8UfvMA=; b=vyYoDAHlbaol64KHta05nB/feVbxAif5WWgpsifdznUOiy0di03Ab/Co8SnivrMsJs TwcHLdlOhXHiuwhAm5ola2rnegGShmaT4jbbjQ93+WA3p1XCn5a9Ruyj+sz68Tfe+iRH MooqlXsU+aozyTmQ3Z4B6Ufgu/0EhNKBypN88exKPsOTRLTzqMjEiZ+I64/zDYzS2ZFv glMduOTKNrBE1uMiSknPb47QKvQ1Fslp3lVWBD5eaY7Xh9sEgdiMpgnqf+1LMMxWDfXx DjkIHq6i/wFHokwDziPOcQ1XKYJtfqe1Q56wbHlY9yLMkutYHgzh5J0cgVlrC5zcqe/j DqZw== 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=7ZMIvZlN2RweJkUN5B//uFf7tgMLArGLgtt1G8UfvMA=; b=kULiNKzT8V3GFXtFjIq6erT6qM1n3Ds9Gynhia7Ry9NDajIg+B2py/A9qfbS7L89gl JKSGKnjDhFShhljT0HUvzhkFYS1alKSamP8tF/Bb8WiXMTozFwCWLZkkqvtg6m8KVqhC sdlQAv8C1mBVHQCL4aumXsWemGt4oomW2iz1/bq6ymOH2r8VlvAiQSx3ayiWYr1Vs1BJ b89h03oSQ/SZnZdec+GXCGroHw2FPPqMCIR0Nfw7wBfm6unhymW9xUtbzufz7hUzKhxd 8nHSyLmntMDxBGZp2Yo5ALz7h3aCVMEFmdTbLJrY9TZDKi3SIRk87MIfzqL1cjoxhAjf grNQ== X-Gm-Message-State: ACrzQf2iQhUb/S0AeZMgvCrKMYv/HpZVS6B9lrBEcnmqWdgy3fA84UMK B9EM//J82ud8o6tAla6hYDxIAQ== X-Received: by 2002:adf:b646:0:b0:221:76eb:b3ba with SMTP id i6-20020adfb646000000b0022176ebb3bamr3687815wre.237.1665760818451; Fri, 14 Oct 2022 08:20:18 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6241-7429-3074-96af-9642-0004.rev.sfr.net. [2a02:8440:6241:7429:3074:96af:9642:4]) by smtp.gmail.com with ESMTPSA id z11-20020a05600c0a0b00b003c6bd91caa5sm2818223wmp.17.2022.10.14.08.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 08:20:18 -0700 (PDT) From: Guillaume Ranquet Date: Fri, 14 Oct 2022 17:16:02 +0200 Subject: [PATCH v2 09/12] 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-v2-9-8419dcf4f09d@baylibre.com> References: <20220919-v2-0-8419dcf4f09d@baylibre.com> In-Reply-To: <20220919-v2-0-8419dcf4f09d@baylibre.com> To: Chunfeng Yun , David Airlie , Philipp Zabel , Jitao shi , CK Hu , Rob Herring , Krzysztof Kozlowski , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , Daniel Vetter , Chun-Kuang Hu Cc: Guillaume Ranquet , stuart.lee@mediatek.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , mac.shen@mediatek.com, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.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=unavailable 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 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 { -- b4 0.11.0-dev