Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2835235rwb; Mon, 19 Sep 2022 10:38:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uJu+h0+AmWQOgMlB28TY9LLPCXe7WDKsMh0Qrh9yFbNn7wIt/DsHXrqKOSbP2WqaDeSJY X-Received: by 2002:a17:907:6297:b0:72f:9aad:fcb with SMTP id nd23-20020a170907629700b0072f9aad0fcbmr13465950ejc.161.1663609118550; Mon, 19 Sep 2022 10:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663609118; cv=none; d=google.com; s=arc-20160816; b=AwiQNOVPIcvE+KQNgKt2CH26yr/N9TGTjNmtmdC9OrDOL7xP/WPv+EOxVxZibJPwLo 1TIprLwWNURy9NauQ3teC+Q957sW4oWFPn+qooYHF20wFRDdivw9tv5T9wmaZwE3ZeQd pXNeo9Ea5I1+YyKQdc/VJqGBRwPrJ/fw2oY2dJT5Su2vqyB9tU1EaZsZPu3hQPzyiZq+ YckMljl7yqAWBbJrLZGUSqRBNH5wpCGkoItVd9/Q36qHLdFSzBa/oEOtvmKWEtgBvqmO h5armQvKCKilovIo/fl2pbnbWQoj/SReLJaUk8w263uHkFctv2kS3jWyhOcodQI/T+ql S25A== 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=23EqGi3gFXXOB6EHxNrULl8XJT9OcS+TsgqB/BHqbHw=; b=at8RvvCodY9kjG621y3mmJp9FoTeX4jUm3242W69qPmeb6R+0tUASQ1g2wAH0GaJpM 5UmKASCdO33tUBd9AxybgxG9pSXr0UuTuOB4pI46gK4kMIPt2fqacVScwcWr0QDHD3jg ROzKEBoMMttAFjOpHPN9b4iRSkbmR7Z+3OisSeRrfvDrIiwGiN40rBvK+q3eHocTrpb4 ZkXNRpbvLUeunwBMxFA5TLIj7pM0zHSAZaX1nnMdqLsqmiKWtmf8hys4grexrguWT3eF CQi+YtmLmbbFu9Cu49vXJeMIbm4yV7yWy7FGXIC8SaMtjl3+huA4SMmytlP2kuBsaZM1 5QJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=cn9iS0q0; 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 c18-20020a05640227d200b0044dea5e0262si12488373ede.402.2022.09.19.10.38.12; Mon, 19 Sep 2022 10:38:38 -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=cn9iS0q0; 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 S230473AbiISRBE (ORCPT + 99 others); Mon, 19 Sep 2022 13:01:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbiISRAo (ORCPT ); Mon, 19 Sep 2022 13:00:44 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB81C3ECC4 for ; Mon, 19 Sep 2022 10:00:17 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id y3so183964ejc.1 for ; Mon, 19 Sep 2022 10:00:17 -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; bh=23EqGi3gFXXOB6EHxNrULl8XJT9OcS+TsgqB/BHqbHw=; b=cn9iS0q0xgkjHJD+ds6dZQH5Wy9i/TPkeNeu1+g/E8IpAhA+7/wzTwuy7sZV3qHvfQ GC/lUWWZJ92voqvSw2+0phX12M4JLdIbDHkhE+jM7LKwpctaymK9eaAv17XKtP6uRqnn 4kqirP8cJnH0CPHjDEkXydaKMjHfFtUdgLMpTup6zuKcOicQQ6jeMHFPeHK/Gl4qLwah yrKgsk45GGW17HRqO1FIk3NnwzwIkgCbTq8T7p/Hje+0dxGUVe6op7iQ0gRQsLeYldiI 1q+9QKpoYBPCHArfwScqBaDWwBgERHtGHIRSLAdz/VQBZyeHVoC4Yqz5qDa4kvYw6HMe LwbA== 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; bh=23EqGi3gFXXOB6EHxNrULl8XJT9OcS+TsgqB/BHqbHw=; b=RHgNfBIF57LRHiQMfxn7OREn2SxjpbosPGdq9thtd98qOE3AYY9KNKO0b4T+3G3XmL RsVzRzstnE1pkpVNPgzabpzCPBnnOusug69Ms9u37GyOuwLWDLof4KBSXdYiPEloc8G+ sjYVJTbVSo9SpokDaSAjd0RjY6h/6Lx5UQTV8PgC5AjNWP7lVDH6qrRwIjJlJuFGqTYQ wTVaoeOr9XdONufcv4Quaz7CLLea0kdlB686QjJL0U/U6zzqRAb8dcNFp7F++MX1wE1l TBdfD3zAHY3thT584AKcti1tmPOSFsL7Zyz5fdvx9l4YFEy4NF1iBvLx6sdF/YNm1gjB Xdzw== X-Gm-Message-State: ACrzQf2uJUdpA5b1CXY3gvJlOqeV/w2cxnRe8eaJFN/R5XdxUC1jPMgK ChSVixNNQ0oYCVahn2/Xo/s98A== X-Received: by 2002:a17:907:728d:b0:77e:1942:f772 with SMTP id dt13-20020a170907728d00b0077e1942f772mr13919231ejc.222.1663606815174; Mon, 19 Sep 2022 10:00:15 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6340-f287-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6340:f287:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id cf16-20020a0564020b9000b0044fc3c0930csm20424246edb.16.2022.09.19.10.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:00:14 -0700 (PDT) From: Guillaume Ranquet Date: Mon, 19 Sep 2022 18:56:11 +0200 Subject: [PATCH v1 13/17] 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-v1-13-4844816c9808@baylibre.com> References: <20220919-v1-0-4844816c9808@baylibre.com> In-Reply-To: <20220919-v1-0-4844816c9808@baylibre.com> To: Vinod Koul , Stephen Boyd , David Airlie , Rob Herring , Philipp Zabel , Krzysztof Kozlowski , Daniel Vetter , Chunfeng Yun , CK Hu , Jitao shi , Chun-Kuang Hu , Michael Turquette , Kishon Vijay Abraham I , Matthias Brugger Cc: linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Pablo Sun , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Mattijs Korpershoek , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, Guillaume Ranquet , devicetree@vger.kernel.org X-Mailer: b4 0.10.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. Signed-off-by: Guillaume Ranquet diff --git a/drivers/phy/mediatek/phy-mtk-hdmi.c b/drivers/phy/mediatek/phy-mtk-hdmi.c index d4bd419abc3c..af46472237e0 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, }; @@ -76,6 +78,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 dcf9bb13699b..05de93f63a61 100644 --- a/drivers/phy/mediatek/phy-mtk-hdmi.h +++ b/drivers/phy/mediatek/phy-mtk-hdmi.h @@ -25,6 +25,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.10.0-dev