Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5190917pxv; Wed, 28 Jul 2021 05:29:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw3yZro2CbrNuFYZ5pM0di+7dhXMSRaw9oK1zJcwdi9BiRhTePhTjUv0bc4GiNPi2rEk4J X-Received: by 2002:a05:6e02:dc4:: with SMTP id l4mr21083730ilj.94.1627475353309; Wed, 28 Jul 2021 05:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627475353; cv=none; d=google.com; s=arc-20160816; b=updNBG3maClM7jQx9T/FVyyMJUwiQn8tjsIX7Ig4VK79KTGMwtFyWSIcVrjFTlzMKO 4MDYdSnexqxkTErmp1gATf9zBOT7UfpPOrSItokGMwGMUtgHsfok8e6gezf4RkeG48jz oaQhWGFptvvsLtv5K74p6Js+o2ORxplx+D/l8sg6gpPOHWWf+7YXvi9IGri7sf4fP+H4 6rWJJXnh4Jd3Iw9t/+giGSeiHKTA2spoNkyn1FC8jqpyO1f64J2TMwiv8nr+z37kea8p yhv2jiBdVzjgO+iE5IC8inEWA8vLC1Vz4wnCHWu/mO1dM6cJDykI5uXFRHnmdINI5KJW /qVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yXImnqZERav+3w/cyHb8wggYxQXzQW+9n8PpB8P0B2M=; b=ssOHY2ovfpqpW1viBtLs5D4Orelu+P4Zfj3ve2n2TJsU3mwY/MQAsSx9LzugHfc+Ys lgGViDAy87AFZVmZvMhXatrGylrVwUZJoR28ci6U80HAJbTHiKbXKsdCulvLDTCy9x25 H84WBpDgaG0TrB8Klvw/Y3XSwHpaPY74acA8AEDr3lMajajIH1EJEQpdfCCx0DZ+5Fas LcFS9YH7CWJRE5o1V2AVfwFbIIqWK+sCOmejVjRFFVFFRjxr7GQjGxueuE0JvxxVoj5A GZ5TrzRvr0bDlWlbtncEYP+Edp36efpOWFFv89dSGOBxFa+MxEHQ81KbP7Eiw7LpHH1S qSnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nTf1Rh+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si6662095iln.160.2021.07.28.05.28.38; Wed, 28 Jul 2021 05:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nTf1Rh+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236214AbhG1M0k (ORCPT + 99 others); Wed, 28 Jul 2021 08:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235159AbhG1M0Y (ORCPT ); Wed, 28 Jul 2021 08:26:24 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E36FC061798; Wed, 28 Jul 2021 05:26:22 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id h27so1150794qtu.9; Wed, 28 Jul 2021 05:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yXImnqZERav+3w/cyHb8wggYxQXzQW+9n8PpB8P0B2M=; b=nTf1Rh+IBTk37Ypl1bqpBx/ym8f/2c2cD3boqnDXbg49T69of7n1FZDMO2lodZfo+a FKJNsHP0XHimKRL+HQlTOcMoynXQ9O+9daG3gi72aE2zeB6DLbbU9JfsyBgQyxC9VB6f daLU/ljVyIzhnLLbfiJuAcZBXCUx5tVouRLb24L2gqz46/YJ6e7yizBxeBmp5N1+WXn6 5e0AMP9nmpTRllygLdkCHbRhcvDHefqLLp2+jUUQCum5pdeCxrzjOavdKnkqf2kQq6xM /TzWidxzOB7B6Q8oMYlBvLZ6uH0P9VaJGMKCmjefY85M1JWvC/SmORGEvlx4TGkOQnkG WhzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yXImnqZERav+3w/cyHb8wggYxQXzQW+9n8PpB8P0B2M=; b=NsUDoB4BMstO1VNum3byAz1H4L3x9hrUTN4xRYcGB/sLgd+c9zH8UBCM0DcNnLZyY8 vFzhCQv6KgvK9gdeQ5Z+nmX00yVE4EEXuWqkl2jXj36shsNtSgu6qPc2YVrTn9Q4YZMD LBT4VMIRsV8JuGI+VzxC+NT7lGYLt9Q6yNjCwL+8z5AjuU0NXKKaMiq9IsfT8I1Z3Jk0 bSp+VHxceIFvO3bAqdOLr4b8nxUMXXXbNqyG3/nuV7Adl6q1KO3nehITpcdeU8KZTXR4 LAMhIHXPtATSqDR+/f4ER22KVHuc1RvXSrDrqlUBgwEjqo7gAc9fwsplFYGdKJntNWCe hSMA== X-Gm-Message-State: AOAM530iGujl9whS0zZ3Q2vCX6cgNmtLPucab/dAoW5b96EjTM5Urous IWyuhYgxbQORtnKsGrnHKJw= X-Received: by 2002:ac8:5210:: with SMTP id r16mr16895190qtn.344.1627475181525; Wed, 28 Jul 2021 05:26:21 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:b58:2ae8:d75f:660a]) by smtp.gmail.com with ESMTPSA id z9sm2842972qtn.54.2021.07.28.05.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 05:26:21 -0700 (PDT) From: Peter Geis To: Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Peter Geis Subject: [RFC PATCH 5/9] phy: phy-rockchip-inno-usb2: support standalone phy nodes Date: Wed, 28 Jul 2021 08:26:02 -0400 Message-Id: <20210728122606.697619-6-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210728122606.697619-1-pgwipeout@gmail.com> References: <20210728122606.697619-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org New Rockchip devices have the usb2 phy devices as standalone nodes instead of children of the grf node. Allow the driver to find the grf node from a phandle. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 5d2916143df7..84a0c1d697da 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1081,12 +1081,19 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) return -EINVAL; } - if (!dev->parent || !dev->parent->of_node) - return -EINVAL; + if (!dev->parent || !dev->parent->of_node) { + rphy->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf"); + if (IS_ERR(rphy->grf)) { + dev_err(dev, "failed to locate usbgrf\n"); + return PTR_ERR(rphy->grf); + } + } - rphy->grf = syscon_node_to_regmap(dev->parent->of_node); - if (IS_ERR(rphy->grf)) - return PTR_ERR(rphy->grf); + else { + rphy->grf = syscon_node_to_regmap(dev->parent->of_node); + if (IS_ERR(rphy->grf)) + return PTR_ERR(rphy->grf); + } if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy")) { rphy->usbgrf = -- 2.25.1