From patchwork Thu Feb 16 16:02:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 58163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp392480wrn; Thu, 16 Feb 2023 08:20:18 -0800 (PST) X-Google-Smtp-Source: AK7set8GEIp+k88NGOz/uDJCMYWuoNOZtSrpUvD+s/m0mLUdEFxhGrmCDLeQJfkUN7BbQ8RKpi2u X-Received: by 2002:a17:902:e741:b0:19a:7882:c1a9 with SMTP id p1-20020a170902e74100b0019a7882c1a9mr7395385plf.63.1676564418588; Thu, 16 Feb 2023 08:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676564418; cv=none; d=google.com; s=arc-20160816; b=ZIVaWNe6MMfCBRh5sOTglxyheSLJMA3pPfKIQAvtWpc2XDuZi01eOAGuak1RlwHJdm SlyjEqLAjZbSW4nmb4tZjfP3gZS7hol0suElabkvr0zAB7K/5F/3P22iUoauWiRlEG7w UYK0g+PUw19/CYBGcBfDwGBq288zBEVcc+1nYCD+iNJZD30zgG0Rs4pYt5wFynLFIiJV 8m6xWzrjijuGGgGexB+9twC+DaQh4zuqN9VAsSWprkJOl84wmy2zVN2LJfY6gdfh8TmQ KcfnL56lb8loyn+F9lYzOgP5GK0AHhdmx/D6eXshd++icMx3LH8mL8o0Fohy6Oy6yiQy MMLA== 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=op30N8VplB3ypI088BE1DuG6HdC3ZVERGlwL+v56hF8=; b=GqO9TZr3TPv1Oo4SxoaD4UBEwg4MOEijFjYJ/kp2aRxBWia3MJOsFkQZXtViDEiggq x95rK42R3bD8OsbsW5UCJVnteuoN1K5EVKlDms/xXMzaa9+y4KVVQecDrCsbN/urgl9W jvbGptl+pxKMPxSuY4BjYqc0ZBjnRkN8eKFK6VCFba1rP7CA8S0FAdIlCevVUgiiwUv+ k0Osb5g1mSs+fOloBNiAhhlOXx4PucRBMQcljcNRgybIS5UihTK0BtehpaJlo1GM84FM 7DvDXu6+lBfjmJ60g8E9JXvzKtNe8dEQ0DjNhDpjO+N7EKZV6d36hF5Y90W6vtzDzJk+ U1CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=jgEXZWlf; 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 143-20020a630595000000b004fc26875cd5si606574pgf.372.2023.02.16.08.20.02; Thu, 16 Feb 2023 08:20:18 -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=jgEXZWlf; 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 S229769AbjBPQMY (ORCPT + 99 others); Thu, 16 Feb 2023 11:12:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjBPQMV (ORCPT ); Thu, 16 Feb 2023 11:12:21 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567BA4E5ED for ; Thu, 16 Feb 2023 08:12:19 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id d4so2277770wrj.1 for ; Thu, 16 Feb 2023 08:12:19 -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=jgEXZWlfDe4qtHQuf4Jd+qS29NFxdCuq99gX2oiiomDmkUZCmAcArwOHwSs5Mzn/Zq tw6EtSU0kn3JCd/gaeg879yxoUrkkQImAHoishjoNLUj136ChpytIYKH8S6t5/5fvxz/ hm5Nfc8mjClJTK0zlD7h9LWNLOc5bdZJ57z1LFhTgYNwrWFuL3g9n1Sqz/Vsq7c4A6Ms sn+hhJ3dl7YYFMH42vKkBmoUL0Dwe5inEgawgt8QdgRlLUtK8m1z18OVqnv+jG4ReuFz tKIHfitIXwG+jDhP2hRrroCjiUlONtCkUugswqX3mz2VIrhoMFczqVRLoxqVKFNf2GH5 3vDQ== 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=PU43z2M0CZmB8SG79zqI7i+067ADi0P+24U0cYkN3xqDWtcmf5K70rfC8oDiGi7p74 C+O/QjvJdP81vAaWFA8VJnBpegSyYGKckEn9ZknlJV0W5fmb+27YLJ5AR7HjlgPORhAB jTF58rdzzhTxi53q3ZgG+m2f5Iik7NoBvdqMN0006hKsqUxlkXf97rdhBvDFgr9NldTQ JALuLtpJpirq9rstHbIjwuRRWeRGExa+FJO6fkIcXt3dCDvGPXU9/gJ71A9DFnrWYTIs s7oIiXUgd90ArUKawsjIe0GOs5tBJ+iJVg2fK4jrJ0GTd2wM7tpu+KLMF7UX99ZlwYmQ rGFA== X-Gm-Message-State: AO0yUKUb8wCiQ6locTzCB0ddA9stxTrXx9+Qaorjloqr/+03l6GNyPEZ nazEn79GbvXu3FRI0avEfDOwdg== X-Received: by 2002:a5d:518b:0:b0:2bd:d9b5:8191 with SMTP id k11-20020a5d518b000000b002bdd9b58191mr5262191wrv.61.1676563937909; Thu, 16 Feb 2023 08:12:17 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 08:12:17 -0800 (PST) From: Guillaume Ranquet Date: Thu, 16 Feb 2023 17:02:26 +0100 Subject: [PATCH v8 2/3] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Message-Id: <20220919-v8-2-a84c80468fe9@baylibre.com> References: <20220919-v8-0-a84c80468fe9@baylibre.com> In-Reply-To: <20220919-v8-0-a84c80468fe9@baylibre.com> 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758005212025407835?= X-GMAIL-MSGID: =?utf-8?q?1758005212025407835?= 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 {