From patchwork Mon Feb 13 11:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 56221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2295328wrn; Mon, 13 Feb 2023 03:42:27 -0800 (PST) X-Google-Smtp-Source: AK7set/Mxxony4dUFlbY1cm/DJTbSmxin5rxpkOS9mxmToY9VyrUdDwura5R3qMPgk2ecGASYOvh X-Received: by 2002:a05:6a20:3d06:b0:bd:1058:29b2 with SMTP id y6-20020a056a203d0600b000bd105829b2mr30108572pzi.58.1676288547382; Mon, 13 Feb 2023 03:42:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676288547; cv=none; d=google.com; s=arc-20160816; b=vY974bpeRCjwT8vDjKQDna3KqNpzYk4vp26iiGoif1LfAGhP2vtsOYLaHj2zK9LCMI syBC1u9HZPbEUz2HJdn9JNRnWQzGh1gItcOoEsFYMLOE6OWTfg8JtJ0PW3rko0Vd9cU6 GqADIx+AznR3vZ+TZ4qqvOVp8UNf7tH+T0+HK/nBwtceJL5Dn8w9Z+xDgqbRkTJOLqso sbs8nAXyRgoJMtfpadmjCSE6xf2PVCdYY7flXS18skDlHnoWHaAlzfbOMSEs4sK2UG90 koeeUw2ErUWrQBrI+J4k/NaeT/uSwGKbGGNX+6CuAGE0XXQbJOxJPXT+IYS6np3YdkEZ +tNg== 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=RFc2kXyGhKN/m8vjZJfIM5lrB7klyye/0nhW1qzJxQb9+3sy2Hp7/lUwwt6jMoPwjE giPVYhkIm6Rp6KFLsEsSnHSO9B2RZCxb+84AtcIt5b7DRoup4PhFx0dP5AjNnYGLOpiM R/3CGlh4ifvy3aEmMgz0OfS+NjROKrrRV7MxpfUvvtTbVN2Z87qQobarmULa5pKcHYZG wuO4Nlh4CWB7LJ1kfL+NPErOteiLVoXYZbGN4QrNUojAZ87/4x7fRslQCZVR1uRd4tab 6zF4UBcKre5I4wR1pYs5IZQyRuISpy+f703QZKcOJveDKbhvr9OPpIzSUYcZ5vKr5QOR gVCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=vB8WykBa; 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 l6-20020a639846000000b004de8f355b03si3997151pgo.633.2023.02.13.03.42.15; Mon, 13 Feb 2023 03:42: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=vB8WykBa; 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 S231225AbjBMLix (ORCPT + 99 others); Mon, 13 Feb 2023 06:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbjBMLip (ORCPT ); Mon, 13 Feb 2023 06:38:45 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B3EE073 for ; Mon, 13 Feb 2023 03:38:44 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id p26so31019019ejx.13 for ; Mon, 13 Feb 2023 03:38:44 -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=vB8WykBafuRzRtDuguyc/Bo7sbY5f8z+gZOza7CCBeeEj6YTIzlIkJq/9c4EOPLl7C 50Ee1gHpVfORgKOsSDYfzA9WuJGCvSwAAoDVcifSXr8s+InCZw2mDiGTae7uUdOWm8mt BcwlQKCl4oQx9mHeAK/roUU2AtelFtJ1kXJcs17xzwpymr7zFiHP+KN0M75x2IlqAk/M ssRZdEBzWecwlqDwlqi+JTyG4CffD+U03W843WrTFJ1mrTO8AjS7o4FZY5RPo6GoX4rL jhy7au2YWjp5Xi3WlVC+hNIc9AsFm6lEABGBUScDZhtW/akwnOb9YHELHjQh64vW83It uo6w== 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=cArMI2JeX1MLD1OKwXT/d5v5YkzNz6V9BTu7dExEp1+nBDMkEWXkWQjlAR0fEYq4Di JvAxF5ioPNC+rUykf6yDPUFmKEKCAgrLOfbEsEjvCisLSi0qErEL8h+/QpoETlsp9284 f2QDtuw4FZOp8wK7IQom6rbAbEpOokZsXGZ4EJmMd9eRAZoFraX5Lsu4Cjcb09T4Yz1Z ePNdlP2uSMJvcAWimmAmqCrsB5xsmCQxxKWZo20sKH/TNandQMt4l/0I6wHzbd1HV0GY aZzEJ7HaSmaFtsD66nUI16PCVEQf1lCVaiQOu5S6SJRenXuniz1tTb7/xlS5zib77Tlh 8GTQ== X-Gm-Message-State: AO0yUKU80pkI84vLNXCTWpKA2fCosRWFqAwE4xhadx7btsG1HgIPpKlg J+4+MfCPF8OWlB07G+cffsWgig== X-Received: by 2002:a17:907:72cb:b0:8af:5750:917 with SMTP id du11-20020a17090772cb00b008af57500917mr12827958ejc.35.1676288322760; Mon, 13 Feb 2023 03:38:42 -0800 (PST) Received: from [127.0.0.1] (2a02-8440-d206-ae05-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:d206:ae05:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id s20-20020a170906061400b0088ba2de323csm6638792ejb.181.2023.02.13.03.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 03:38:42 -0800 (PST) From: Guillaume Ranquet Date: Mon, 13 Feb 2023 12:33:33 +0100 Subject: [PATCH v7 2/3] phy: phy-mtk-hdmi: Add generic phy configure callback MIME-Version: 1.0 Message-Id: <20220919-v7-2-b5b58c5ccc07@baylibre.com> References: <20220919-v7-0-b5b58c5ccc07@baylibre.com> In-Reply-To: <20220919-v7-0-b5b58c5ccc07@baylibre.com> To: Chunfeng Yun , Kishon Vijay Abraham I , 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=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?1757715940257653283?= X-GMAIL-MSGID: =?utf-8?q?1757715940257653283?= 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 {