Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp695302imm; Fri, 22 Jun 2018 03:51:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoG1Yy8vL2+bCDFLYICcTZHlKQyksQt1u0FPGgUBZtKHS4BmPdZvw0Cy+bMPX3UHT93pMw X-Received: by 2002:a65:4d08:: with SMTP id i8-v6mr936530pgt.427.1529664666193; Fri, 22 Jun 2018 03:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529664666; cv=none; d=google.com; s=arc-20160816; b=kayC1ldAYWSZ3K9es1ORIGue3h01tdSuJCUcjHSo7pfvmL+x/IibG9aZcA6hyuSSkz qL7bv8ViGCfEvn1oToUGuZ0tcdOQMcBRtq1+6Wo5nhtiH3g95m90aF9ewEC/fFHl+ncd z/4vh8SC4bXJ73pOZr835lt9Zu0ED9urp/xV/CfjeIbrdz2UNnT9fzsF+9G4xmbdWq4W 6qCoUDXi2iYHGYycT2KCy5srCHbsvXKKQyi6WyHr1R7W5U8xqfPuljbiv8qpId67GZyn Ae2lVr4bNyJRW/FA6vtLrDSSs2Rrl8cfL4gCvYWQL49Ot0XxmlZT7QB1ueJNdrLjOlFF CL+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=feoS6M8k19UkDh5gh9mCaYDWYHUn8d3zkjJJ6oh9BWM=; b=q3DA79cJKiqIGOoXt7GvIvIbk6Q23SAGDNYcmZWVaoe1oGnz0Hk/EAQ1EN0V9IWuPH aCYb8sPUNtg9FR/u+Aq7j/4kGM4UVl2iHdNglZi6fOOh7HNswQsmedhQcB8ClLeXcELH DjQbpQ/4St5nj3sCOWykW/8ewJjRIPzTHNy4GuJmwL2WX91YRrcfY9i+MvJ+FYvzq6hZ 5qCTiGAClCpsQvyyFA5Trr/joLv28ehcXTuqvbqzKOoYT8mYNTZzClcr7HGMLss2GjUj 08g3npdtc0CIqlEcgI+sKySw1HWK16q/K04szt5NeFlkjI1VAFPdMgtAxyaj6xrQdFgZ DdMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si7339420pfk.287.2018.06.22.03.50.51; Fri, 22 Jun 2018 03:51:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933630AbeFVKt7 (ORCPT + 99 others); Fri, 22 Jun 2018 06:49:59 -0400 Received: from mail.bootlin.com ([62.4.15.54]:49432 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933285AbeFVKt4 (ORCPT ); Fri, 22 Jun 2018 06:49:56 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 829C92092B; Fri, 22 Jun 2018 12:49:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AAubervilliers-681-1-50-153.w90-88.abo.wanadoo.fr [90.88.168.153]) by mail.bootlin.com (Postfix) with ESMTPSA id CF8C32092B; Fri, 22 Jun 2018 12:49:35 +0200 (CEST) From: Boris Brezillon To: Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann Cc: Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , linux-gpio@vger.kernel.org, Sekhar Nori , Przemyslaw Gaj , Boris Brezillon Subject: [PATCH v5 05/10] dt-bindings: i3c: Add macros to help fill I3C/I2C device's reg property Date: Fri, 22 Jun 2018 12:49:25 +0200 Message-Id: <20180622104930.32050-6-boris.brezillon@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180622104930.32050-1-boris.brezillon@bootlin.com> References: <20180622104930.32050-1-boris.brezillon@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reg property of devices connected to an I3C bus have 3 cells, and filling them manually is not trivial. Provides macros to help doing that. Signed-off-by: Boris Brezillon Reviewed-by: Rob Herring --- Changes in v5: - none --- include/dt-bindings/i3c/i3c.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/dt-bindings/i3c/i3c.h diff --git a/include/dt-bindings/i3c/i3c.h b/include/dt-bindings/i3c/i3c.h new file mode 100644 index 000000000000..97448c546649 --- /dev/null +++ b/include/dt-bindings/i3c/i3c.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2017 Cadence Design Systems Inc. + * + * Author: Boris Brezillon + */ + +#ifndef _DT_BINDINGS_I3C_I3C_H +#define _DT_BINDINGS_I3C_I3C_H + +#define IS_I2C_DEV 0x80000000 + +#define I2C_DEV(addr, lvr) \ + (addr) (IS_I2C_DEV | (lvr)) 0x0 + +#define I3C_PID(manufid, partid, instid, extrainfo) \ + ((manufid) << 1) \ + (((partid) << 16) | ((instid) << 12) | (extrainfo)) + +#define I3C_DEV_WITH_STATIC_ADDR(addr, manufid, partid, \ + instid, extrainfo) \ + (addr) I3C_PID(manufid, partid, instid, extrainfo) + +#define I3C_DEV(manufid, partid, instid, extrainfo) \ + I3C_DEV_WITH_STATIC_ADDR(0x0, manufid, partid, \ + instid, extrainfo) + +#endif -- 2.14.1