From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80D2CC77B60 for ; Fri, 28 Apr 2023 18:30:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8067985F85; Fri, 28 Apr 2023 20:30:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nkYZn/LX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E1D785EF5; Fri, 28 Apr 2023 20:29:05 +0200 (CEST) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E1C885D99 for ; Fri, 28 Apr 2023 20:29:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=inindev@gmail.com Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-5f95cedb135so1607246d6.1 for ; Fri, 28 Apr 2023 11:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682706542; x=1685298542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rA/FM0dt6tohSrgUm2EFYyBDw6SNr14/vcKw3MgbwuU=; b=nkYZn/LXQ/ddw40luNPNj3vS3gPmfU4m/E2+0FJDqiSeIuXTUVXbesI0+5l9say5tt ZePGZhLZtFMBNNnbQ+ScE1MKE5LkMnZqOv9O8voKouRQCHKkEbBsNU0x09nwHuH2li07 qxuJVTbALoAuuWi76KKIPR9ocKfaQJHDRQzjQaamy7UreqYezqKbi7uvRjtV74fOaC9k 8eeTI40Jt26PuInfxSntByKW2hZxvIJPQENarDu5JcLTkEiG+BBbR0jmqZ6R2zcP7kHR Sy0guLtQQyA7lmYzi1eY9qxm4uKbk9U1Hs5iYpp3OO+T+z6HBVYyqn09ZZM3DKgZOU8c xYFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682706542; x=1685298542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rA/FM0dt6tohSrgUm2EFYyBDw6SNr14/vcKw3MgbwuU=; b=ffHUXovllRIuEAQlzpW30ijLRTaj9nVPzX85IdBTYUTyxyewYifn3fp+ZTpjy3Ml9x keheLJdGBUMdN8g6KUbj30UVNRrAN2DBGyv70OqE+11AimZ4d6lGYhaklJ87neCvgTWR uzmIJj9Iv3SqR3hEgJF2/o6x8XlrLiqfHS5dpeInzpsUCI2Qoq3kMzNopDE9KYnXPaRc jE5U61Popi0kQRheklaziPq+Q0sbVbHXb9kPgypipnZGY/xb2nwGlvtM6/nQCxXiTLnU gNctHexaAlWl3qTvo8TkGHayzGcARyChhL+JsqdqLnjE4UhunFNORibVzzagbePH4MZ6 EQtQ== X-Gm-Message-State: AC+VfDyTtSOHAJ0T8LeGowCgKw2ybAILQ1Ds4Bnz3hgtxTvqA0ZzCwtk 3kahBNJ/ASu9fUwYOJfzAi8= X-Google-Smtp-Source: ACHHUZ6MWKm43PaxqwooJ9NM5LboELHhSE+vviW0g0Bvif22qBIvWfSz4yj4YZB/SrXZg46uEsL1Bg== X-Received: by 2002:a05:6214:29cc:b0:616:58f1:284b with SMTP id gh12-20020a05621429cc00b0061658f1284bmr8120717qvb.33.1682706541724; Fri, 28 Apr 2023 11:29:01 -0700 (PDT) Received: from localhost.localdomain (cpe-98-26-34-222.nc.res.rr.com. [98.26.34.222]) by smtp.googlemail.com with ESMTPSA id y19-20020a05622a121300b003e390b48958sm4516042qtx.55.2023.04.28.11.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 11:29:01 -0700 (PDT) From: John Clark To: Kever Yang , Philipp Tomsich , Simon Glass Cc: u-boot@lists.denx.de, John Clark Subject: [PATCH 1/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type Date: Fri, 28 Apr 2023 14:28:46 -0400 Message-Id: <20230428182846.37414-2-inindev@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230428182846.37414-1-inindev@gmail.com> References: <20230428182846.37414-1-inindev@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 28 Apr 2023 20:30:13 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean If the regulator is fixed, the call to regulator_set_value will fail with -ENOSYS as fixed regulators do not support dm_regulator_ops->set_value. see: regulator-uclass.c, regulator_set_value(), ops->set_value This patch ignores -ENOSYS and enables the regulator via regulator_set_enable which should be suitable for all regulator types. Signed-off-by: John Clark --- drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 9322e735b9..a30fb45222 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -289,6 +289,13 @@ static int rockchip_pcie_init_port(struct udevice *dev) /* Set power and maybe external ref clk input */ if (priv->vpcie3v3) { ret = regulator_set_value(priv->vpcie3v3, 3300000); + if (ret && ret != -ENOSYS) { + dev_err(priv->dw.dev, + "failed to set vpcie3v3 value (ret=%d)\n", ret); + return ret; + } + + ret = regulator_set_enable(priv->vpcie3v3, true); if (ret) { dev_err(priv->dw.dev, "failed to enable vpcie3v3 (ret=%d)\n", ret); -- 2.39.2 (Apple Git-143)