Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5189813pxv; Wed, 28 Jul 2021 05:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWCdmWRJe23Wd7yKu9cUdJMZC7pkdIP/eDnkZeDjmra7t8IQHhI4Mfx6aqnFiPx/+V5iZe X-Received: by 2002:a05:6602:3404:: with SMTP id n4mr23900119ioz.31.1627475261009; Wed, 28 Jul 2021 05:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627475261; cv=none; d=google.com; s=arc-20160816; b=FlBCD1rHvDMwzQzfnpfdPhVbU4+en15+uvGIXPfigLC5BwLz6AiGEbD69nz4pCepEn A3StfKuJIKjI5SptzWzcl67McxPP4+r6wTd3DJwIen8lPoOvxq3Aheemz2RCQTWlEjI/ Zx9UBfwIVvxOyNLpEpOGBaIuGSJe47Ktmkz9KpWXiNE4EX8pzorb78I0QLEpdb1WlDSs ABubUse/jVmnBxhsfP6Izd9Oj90FAzLPrQiO4rnpDqS/LjjwCqgo6So3Rg7nqkrfBmQ7 d9i1wkBenoJUd0yfdfyk+9GneYobLYRNwV0nxejqEodasbP9ReL+OOYlFadCoF66HQZm su3w== 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=ggW256M3SIcZiGvGqGuspKz5dguh2TkojKgtWRP6iJo=; b=ahZzqvOQZrK7NW8qKXPEiLLRQberCJg0aoOUB3mqJiERvTQ9aQ8YZxK5+cYsQuhoGP OAy3ugTNBoP+JnhFcGCOMCIQqtA0YmzD4Eb9gB7cKUUk+CmNS+sdQXeDYwbv7IHi0zCB AlnvqCECQ3IFRtEehfojcr999Z/Od5SV8KKZE3C2hNNY3IABINHr5Z0hga7NE2t6oYCR urkkHywjx4od5ovpCAOhiiKwTeb7bU66+NJ7k4DYdgqxIHf+4YzhHSjUsLLHKaucZ9+p 5dn0SqMrLOnAUl7DQGFABztjDkol3rdw3/5amdYUAtewmB1QACLiWULTOGmNLLglu7lI lzfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HSmAocoU; 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 g24si6540504jaq.119.2021.07.28.05.27.29; Wed, 28 Jul 2021 05:27:40 -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=HSmAocoU; 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 S236220AbhG1M0g (ORCPT + 99 others); Wed, 28 Jul 2021 08:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235102AbhG1M0Y (ORCPT ); Wed, 28 Jul 2021 08:26:24 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C05BC061765; Wed, 28 Jul 2021 05:26:21 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id k7so1919295qki.11; Wed, 28 Jul 2021 05:26:21 -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=ggW256M3SIcZiGvGqGuspKz5dguh2TkojKgtWRP6iJo=; b=HSmAocoULMxqdBe+Mx9uXxKQ44OgPTgw7kvx+SHAGhr4/9dAqyMGgpcmq1mRetpVvx CXcABsudaaeuf+JB29+OKe4cn71JOzr3Ecobv/L6PKM1lv99VpS2iqTu0WNLJIZF3SvQ HdUhsMNN/ZiMya2WeSAW18mExVKEBjm9qP7tnO90431gM2s8qLFGRdXWw9ECD0n8Guxa hakJzONVvCpc+18DmsRbv1wdWYX5a0PgRapWfeYj9P6zfdGEFonkIElCOTqvu8+suHp0 0MPAs/Q48yAczoK5GZzCG/TIJBxc0d63gjKAP4Npm/9IUTQ9WJjzza2tY5lkMxqhVMio eBpA== 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=ggW256M3SIcZiGvGqGuspKz5dguh2TkojKgtWRP6iJo=; b=EBzQy6VqwnrMpDCLm9nAVYQP1NNA7qokumYFe+fSgt5Cy+HHqBJvUeeAzqLcD1KYvr 9hHGf2eCG69Z5fEPTWjvntjnNrk7DkbJ8vy5DAxz+mjgg1/D7X3ESH2szJp+Glyoeq4S bcNMnmOleSYsb3wOHlHJtYprQwYzVuvmHvrD3fB/0DXXPPAXBW3qNq3wrfLjBR8omOkK CbWQDY9q0yT0a9Yb88XAPLBAcsNSEPbjEMbNPiUHv26AUbJH462InNFIDm4X8cMdKXDt 0voex31QqyC+8g6RH3W/eOfaM6MKeAvqidq941DbYVjIF8MsxJveOyH3tDLc60iyogEv tg1A== X-Gm-Message-State: AOAM530+lZzB8JANhEKUieyXxf+vfnbgx2ZiGRQtJhlWCppF+E1uWLt6 vJQAR6ESxNj8oOUVSCGQaMg= X-Received: by 2002:a37:dcc2:: with SMTP id v185mr27461633qki.167.1627475180767; Wed, 28 Jul 2021 05:26:20 -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:20 -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 4/9] phy: phy-rockchip-inno-usb2: support #address_cells = 2 Date: Wed, 28 Jul 2021 08:26:01 -0400 Message-Id: <20210728122606.697619-5-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 usb phy nodes as standalone devices. These nodes have register nodes with #address_cells = 2, but only use 32 bit addresses. Adjust the driver to check if the returned address is "0", and adjust the index in that case. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index beacac1dd253..5d2916143df7 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1098,12 +1098,21 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) rphy->usbgrf = NULL; } - if (of_property_read_u32(np, "reg", ®)) { + if (of_property_read_u32_index(np, "reg", 0, ®)) { dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); return -EINVAL; } + /* support address_cells=2 */ + if (reg == 0) { + if (of_property_read_u32_index(np, "reg", 1, ®)) { + dev_err(dev, "the reg property is not assigned in %pOFn node\n", + np); + return -EINVAL; + } + } + rphy->dev = dev; phy_cfgs = match->data; rphy->chg_state = USB_CHG_STATE_UNDEFINED; -- 2.25.1