From patchwork Fri Nov 4 14:09:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 15575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp429826wru; Fri, 4 Nov 2022 07:16:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69Xf7GwFNaNiCzRobhNijdE6l6GbCkp8M5gW0rv+r69K/LquHwgGyr6d6r83ygYLj4EaHC X-Received: by 2002:a05:6402:440d:b0:450:de54:3fcf with SMTP id y13-20020a056402440d00b00450de543fcfmr35118670eda.312.1667571367497; Fri, 04 Nov 2022 07:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667571367; cv=none; d=google.com; s=arc-20160816; b=TDS0JhjVhtVSoLdHfxRsIWDnvPj3IlMS/aLUb2klUNIs0TrGwuc57UYuEif9sLrly0 HZxsUYnWInOc8fWAoE14EMOlzA6YdE89m2+JL9uUJrIWm879TqOklGUKmr0oPiyZp4Gx /d52nZ4Om5PtuDco9PE6u+CxhVkxVi9ykY9cGojKIMdKgS5Z9hvinH5/s5vWFVAThiC3 uf/ZRkqfAkKa0fUhyO8Gi8PbzyxrMKhG58LIjRupQFB8DhjnQHJfQOSsPyQsYRUupVhj lv4LggyZ/bdwhfuP5a/QLVUm0frPnv33v3HGkNS3Gf9VHcIjPj1u7omYMgv5aBivEOYN 9daA== 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=seJzd30ti7Mk1hc/ROSAbdFTqxsV+C+4zAD5LZ03UGFEAVenlSWo7B5IDjXXmdqI2i L9A8wfQVu/JGz9KkLCaZHvXRlATmJNKR/wAPtp2yG7pSXPij5hZYaLRE6N8rlYsPBBwA QeL3tyOSEpLk+SoMWB6t2+rhRZVJNLXncEDJnWeJCBO+EhgE+Dg+nY8Z4fpE9rMiFB9N CQD6vEqslflNuor7E52fO38MGWvi+OF8u318l2mYdc0LYs764ni0SUfnzMxIPKotT8CI dsfGPNYsOXatR0w1+fN+nPjNlZP7ZKpfOVGBDUlBAbu6N0R7xQZDns/mZW0iKrLc87Wp ioYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=vaZQ6TBo; 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 fy15-20020a1709069f0f00b00770d9e664f8si4073568ejc.152.2022.11.04.07.15.43; Fri, 04 Nov 2022 07:16:07 -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=vaZQ6TBo; 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 S231751AbiKDOOy (ORCPT + 99 others); Fri, 4 Nov 2022 10:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbiKDOOb (ORCPT ); Fri, 4 Nov 2022 10:14:31 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C9C27B3A for ; Fri, 4 Nov 2022 07:14:25 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id j15so7260958wrq.3 for ; Fri, 04 Nov 2022 07:14:25 -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=vaZQ6TBoKkbx6TGxCcFW+YH+RxWS+kSPBpJm20J0qkLGMHIEa0T1ZM2r2Zqy6pJ5gF 1q5R0qy6Cx33RKk0/W4UYWCc3HAqeVlyBulwzqdGQ4r6019aq24y6lYW/8hd/8C8ynqL xIl4S6/k4pj9slu3IkHzLkj6jHAp3cWFHdS3XbU8OHjl/IpRC8JmYlVRpIqlyV0wVP+Z 0141hvtRLwVgnNzOCE+ahZzOOgGzGq2BLnrRBJlONSwoGtZVYYdEri//pLry3Cf7ibyT meRI7L/rIoGsKpR3HROJLlLhdp8PBdIUk8AyBYOqpoyNk1lHRar4rDHdxG++TFo4zafr HhAw== 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=eVSQKS1WoG6HGepfK1agds/+JllG/kUV8TRGchBvfr+E5NH1jFhP7pXKrSlJ9Uq7lU a4ggyupYkxFXp7oVn97w47GOuQtk+ZFyZURKl9ADu5F0AZtbY8emKTLcGYonIlBffp4l BJ8DlTZySXMTrsmUnptVH2eSGYjUFn8oe3fc/TOW2cWKvHqUKXXi5DCnxix7oA3JxpnX VASIbVVJccqxkjnrpDKiodSyxiS1zl4p5VdVis2BCBmj6RJQEP3h5x2T6u5qQToocolH k2slzZwRPxDm76LY+ABAYj8tA9lc8IrgTLxC50LqsJe8aTbwE1FF5h3SzWwkDXPwnukt wIRg== X-Gm-Message-State: ACrzQf2eA9j70yZxGlfENCDU4Btr70QjQb46uryiS5a3XXotPzc96IEd 2LcfiMWb2tLT63qA5Csm8eNDAQ== X-Received: by 2002:a05:6000:1c08:b0:236:e52d:b0d7 with SMTP id ba8-20020a0560001c0800b00236e52db0d7mr215846wrb.46.1667571264124; Fri, 04 Nov 2022 07:14:24 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6440-7fff-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6440:7fff:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id bj9-20020a0560001e0900b002365cd93d05sm3594512wrb.102.2022.11.04.07.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 07:14:23 -0700 (PDT) From: Guillaume Ranquet Date: Fri, 04 Nov 2022 15:09:55 +0100 Subject: [PATCH v3 09/12] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Message-Id: <20220919-v3-9-a803f2660127@baylibre.com> References: <20220919-v3-0-a803f2660127@baylibre.com> In-Reply-To: <20220919-v3-0-a803f2660127@baylibre.com> To: Rob Herring , Chun-Kuang Hu , Chunfeng Yun , Jitao shi , Matthias Brugger , Vinod Koul , CK Hu , Daniel Vetter , David Airlie , Krzysztof Kozlowski , Philipp Zabel , Kishon Vijay Abraham I Cc: Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, stuart.lee@mediatek.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, Guillaume Ranquet , mac.shen@mediatek.com, linux-phy@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=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?1748575314656566036?= X-GMAIL-MSGID: =?utf-8?q?1748575314656566036?= 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 {