Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp184263pxb; Thu, 12 Aug 2021 13:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuTWfQBqRGVZAEeT/J37SWi+K0Q1Z1zijFUvt9DPSC7rG7b7gXXzJNDKSU/dXlwEvTus4B X-Received: by 2002:aa7:c457:: with SMTP id n23mr7833204edr.89.1628801586280; Thu, 12 Aug 2021 13:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628801586; cv=none; d=google.com; s=arc-20160816; b=CkvWpvuxGJ/Cr4CV9FV4lV5NWL1rrxn12i6y6aPILqnEkE0AzWiValpN2skFhRJMG9 4BOTHct6emfhkGzCilCtCPABv7lzi3lLV0VOPVpUdY1JIWgWgULnXz4E57eOT+lVZUzY u7sNBVqtOLTRSkDxmI4XPUaTAkxxKlECn3WUJA1QqkYJ9IvU6C5BxZP7mRNblIWFcF8C //SBNXhlpfBWiCBQKFKOv+VuSpJ6tdctgrvYAGgYGb23TR8gTHl294kFSKvXW1zQHr3V NX3bib3y+Xs2WpzaWL8MMrI4BnhTjdPyGVLJyobH48hP7ZX5ONQSNRIteJX61czat/Im tkhw== 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=QrF/TZIAm7oq18QatNSdM3RTbxguefZpn4zD8fbZEOVhJzvnT9huNhae0X7yyyExOF uqf05zRdtiG+I+0nfqK3Nn7Hn7DaxbNZu+EIhV0qgG3Y5uRSGhn8RLqYJJr1yr5d0wFl 7N6T7ZQ7c7y7pZ7BEvER0owRoQL6WxQJIlYesd2z+8eGKXRDpsNBBE6bDh/Ocjl047TF eo+aIlci43/bqeZWpz6Rfk8w0vZFA+GwUSwzSimj+nwQqQ6j4FfR9i9qOdMPt4qQfWQR 0gq3Een2rphMqZLuIckj/+UXW4VJ5qWVVlVwyanfwNtgNlPYQTjT2USl67pagL9it0Ts 81vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t1W1hIvV; 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 p31si4708138edb.554.2021.08.12.13.52.43; Thu, 12 Aug 2021 13:53:06 -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=t1W1hIvV; 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 S237899AbhHLUme (ORCPT + 99 others); Thu, 12 Aug 2021 16:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237894AbhHLUm0 (ORCPT ); Thu, 12 Aug 2021 16:42:26 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E91C8C0617AD for ; Thu, 12 Aug 2021 13:42:00 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id t66so8327132qkb.0 for ; Thu, 12 Aug 2021 13:42:00 -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=t1W1hIvV0te5vPrxMds68WtR52qT21pqllsiWQ4EdrsevpXRuUZnxXIl5qHRbeUKud 9PN6GoVqsYPuDsx7pi32SNuSqOfURq9S31XUJV/AlJd0iywelRrQmbl/OkkSbSIU9aj1 Mtb23C5te0dfzD8gkBPfn7Zn7O1BmMZZ2Vj2ptM9z69YebxBooi4wimZ4liyXX2ddbch OrYgutQBIxSZfehRX8I8oI6UUch0Re8p5DMgGbrbTH6AehG0dHunC65FbcJV2TSgrxQc RbHAseLHF2JwHcI2FEDLV18o9MijWzchENcsVLda2q16CcVzVCETsEAeHlmbl+LQ+vxn Es2A== 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=gmMFLbJTZfNVZxwa5eRdWqdKfuOHMutyz5ALJGAyMO0M0lpXXPYZXYw0vFWkB4SGWB ToVFTtqBbFQOkPmJWfUUt8DYnMrffZElMGO/4XuHLm7+3UlTSbRiJQQoDJ1y/p1TF6O8 ip6fMcDZbarYzmLqK/1FnTcJdmtT+yqCHEgztTV/YfQmWVQ6AM2PXxzyBMwN6XXF2kWS 2jtQYErZ20zDLQuL7jvtPMO8LBC3LBRExqBjFfr1MkMf2enLODkfBaxDL5SSkqnvw/j7 aKEtMd6MBeG+i1NCK0mmpl/YyVG2w5KFocNAkXANw2YgbTEuKNbZxhmd6OvRwqBiiv3b ZbZQ== X-Gm-Message-State: AOAM531+ZZ04wR1Sa/I3QrJjemyL8HliQ9Kib0pZ8IOUtXqpjn+m8Wuc GWItLONH6QjesKW2fhMunmc= X-Received: by 2002:a37:9643:: with SMTP id y64mr6224821qkd.213.1628800920037; Thu, 12 Aug 2021 13:42:00 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:41:59 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/8] phy: phy-rockchip-inno-usb2: support #address_cells = 2 Date: Thu, 12 Aug 2021 16:41:11 -0400 Message-Id: <20210812204116.2303617-4-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-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