From patchwork Fri Jan 27 15:55:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 49477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp909857wrn; Fri, 27 Jan 2023 08:04:27 -0800 (PST) X-Google-Smtp-Source: AK7set8V86VbLdrbAwydFaWwW8oMkF4q7Eb3sSJWltxFuqoQsgtQMt7pmBUKz8VEerTdQvX+bEaD X-Received: by 2002:a17:906:171a:b0:878:686b:e756 with SMTP id c26-20020a170906171a00b00878686be756mr7053351eje.16.1674835467694; Fri, 27 Jan 2023 08:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674835467; cv=none; d=google.com; s=arc-20160816; b=jT8AH4mwTyzftBiKpQmt3gJtYINzJtGcLyc2fdy2pWj51hcCBxYGbks/CuBnSy0cGO FI2iQi59/NqwYPPBbXMxX521xt2PEMgrXFXaR5NuMXTeFAnef46x6QzIozygsz/cdZNn e7BJVds5vF2NwSDR5POxQFvq2AibA4wrDGB3bGTwsoG+3LBFpt0vdk1DBxkIaVhObCcL JF9bY7HaDCVM6aOrKpOM+20TkWia5etkZa2sK0Y54ps/5w6EMG6D1szrnpCA8ZZpHZpZ m6fyH4QDFWdDPjwbz42/AjaJELWBUj0h8TCxlq1U22Pq8cJkpmuJShpwoppRR11NekwI 5U6g== 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=bzJbuEpSorl6eoXYVPl93ynMwjEC1wNPzgQRRlVLFcc=; b=zrUMkKs93dWtYQOa1beDU8+Xq9WZW1OEKq/NqDwZvQaKKeUPkiCG3Zh0H2ZUH7iaxW tdHAe3U8klWQcThzLZiTXWs5UHDd9uDFjGZzlOeKuOUenfwUUOKL7VKa9Bahz4+jWXAw ACoEBY9wbAWpzV1rB1JhjzB6P0TfAtaSrSZ8sq0Ib8G5Ey58duSh1fhJGIReW/T3czTY xROIU9IVDjvuHTybplm/RJCvOGEt1prLrOwO6KgsLQRjTc0JjQFikTfA8+K5wejq9N71 z72DnHRdtD4Lbj2syDZPkM/IfsjrCfbDAPj5QZvwOcJeqSWZLkcayddwWTQqCNZi+eqz D+hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=UM1CmdhD; 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 fr35-20020a170906892300b00773db351c39si4742934ejc.64.2023.01.27.08.03.59; Fri, 27 Jan 2023 08:04:27 -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=UM1CmdhD; 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 S234436AbjA0QAS (ORCPT + 99 others); Fri, 27 Jan 2023 11:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234068AbjA0QAH (ORCPT ); Fri, 27 Jan 2023 11:00:07 -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 D8F1F82429 for ; Fri, 27 Jan 2023 08:00:03 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id z5so5378737wrt.6 for ; Fri, 27 Jan 2023 08:00:03 -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=bzJbuEpSorl6eoXYVPl93ynMwjEC1wNPzgQRRlVLFcc=; b=UM1CmdhDrD5/cs9Kn1JfLX/109YUd3P0NDK0KFLaXqbEeeV6VRoSh3GXf9NXpUqGS1 Fm1q9JcCWzFmyGKu2HUHQTLhdHrnl9JwtjToxAh1AZD23rO3CgOCMYEo96B45HdHudgD pCngAPF0X8mcULZCPC4sAfkdwpcjkZQ8V8CFQDlFOioSOWjTJB/Ve1dtpCXOdwq1XCvA dNTSr+/EyhpCj+0yQhKJiGVHS5jtlmJZShT/Q9TkE9BGTGZWjnNM+8HSXl+IYnIRehDf n89xd7OLLGGKJxSaDbCwwmfLgzRyv8EnZF/BusgcHoqSANXJSu6nXz2T7T/osDdX9ezr 2pEg== 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=bzJbuEpSorl6eoXYVPl93ynMwjEC1wNPzgQRRlVLFcc=; b=jCXWexTZ4+yY4plB9ShY7gfXrzpm+Z3tF1yEKKn2b2DMEPS4wAQMXuWuWwu1QtegBb PWO2DcD7bUdpkSUJFn6YBC8pVv/cNjNV6lxIe8wPJwZWh0EkeTFE3aJMOQFX5oZlE7e2 VqOpQKTMjqC4IY2E6owptCn/iQ2Vy2Jf35h0jNf+mfgyT4B+Mc3fNgw13GPvPnA2BN5j T/FmZFeWmz5k3ZPSKJOL4JDlyd8TKhCO3Xfh1kVnchVAGnWsShf/Y3mtbD0TZR9/lsBY nCO86oIfYcwOwieQ60+BdZR9cjdYOFo9CfgHS5xOkFIhlqFhDQDMGwKPNtHKcQIBlFoj 0ejQ== X-Gm-Message-State: AO0yUKV0jV4uyKh8TGD9Y627fPcqy3426E97wI2CiuzBKlkVgSjjEBoj eoHTKGwYWML6Hqe/VUR+FyeZTA== X-Received: by 2002:adf:cf08:0:b0:2bf:bbd1:1db3 with SMTP id o8-20020adfcf08000000b002bfbbd11db3mr9145215wrj.44.1674835202019; Fri, 27 Jan 2023 08:00:02 -0800 (PST) Received: from [127.0.0.1] ([2a01:cb19:85c2:1100:7fe1:513:212f:568e]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b002bfcc940014sm3171942wrj.82.2023.01.27.08.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:00:01 -0800 (PST) From: Guillaume Ranquet Date: Fri, 27 Jan 2023 16:55:09 +0100 Subject: [PATCH v5 2/3] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Message-Id: <20220919-v5-2-cfb0e5ad29b2@baylibre.com> References: <20220919-v5-0-cfb0e5ad29b2@baylibre.com> In-Reply-To: <20220919-v5-0-cfb0e5ad29b2@baylibre.com> To: Vinod Koul , Jitao shi , Kishon Vijay Abraham I , Daniel Vetter , Matthias Brugger , Chunfeng Yun , Chun-Kuang Hu , Krzysztof Kozlowski , David Airlie , Philipp Zabel , Rob Herring , CK Hu Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mac.shen@mediatek.com, Krzysztof Kozlowski , linux-phy@lists.infradead.org, Guillaume Ranquet , devicetree@vger.kernel.org, AngeloGioacchino Del Regno , stuart.lee@mediatek.com 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756192275262355747?= X-GMAIL-MSGID: =?utf-8?q?1756192275262355747?= 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 {