Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3971118imm; Wed, 5 Sep 2018 08:44:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdahA923U64SxNkrYWatG1FZFPMU1XVcHY0npI1mTWzoQHBRrNHfrv0OS6LlO2lx4v3y+6DO X-Received: by 2002:a17:902:7794:: with SMTP id o20-v6mr36329754pll.116.1536162253071; Wed, 05 Sep 2018 08:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536162253; cv=none; d=google.com; s=arc-20160816; b=Cu3aJtxF+25zXhoMw+cCUHdq9xI+vkA+4MaBQD3q4RK54x/HvlXs29LdaR60czRMDH EZqEqrkdMHEqCx8P24Q32nYZmyXIYQp7g9FQNjTMC9ZROH8aqeEx+zuQ4ud4/O+jpqnr Kdy+DvNfiF4ZmHAP0klU1fAOj9N5vwMRB1YX1NvmDG4/Z98j2pIgN3VaCICnqgyeo5rA ZiyQesauhmbfOmbPXAdzZgr1JonfZUZhtVbykgarpvgG0fKrfxWbQ0o5UQKHIC5aSdvk KLh6nZxXnPagWvi/fTyvjFnxN1w14W61IUVes6d98ESRWw5aLF7PDV9VdRw3fTQ4S5ef IV4A== 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; bh=feoS6M8k19UkDh5gh9mCaYDWYHUn8d3zkjJJ6oh9BWM=; b=zS+ZFYTXnaBSz/5HRIZ8cf3BE7DrM9ezLXS9XUC9z3f/qQ9cIa+oZwdjo6kIcPR025 8OoPtzr9SoWLvMrT7cH/ZEE5uFU6QXFB4ifspOq+B28PpQHvVrT43LN9MKOl85vJpLfI LKaSofzz8Wu6ndG76PRMOTT9WeQB/H0DN1EGFB6u6xzQyjojxeTMg3jN+QVuWSp19XD1 UncWEfu/Z0rHzlk6T6zRCAXhIXttg2nW1zdAb17VfCfYvnATAThKQMEV5aO4vheiGXPp XIJj8D9Qt1Rs8jxTM9y2goJcsXNyZHaBYbA2firWawvMmv/Q81WA51SIx4iRH068zwl7 aiyA== 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 q20-v6si2223687pll.10.2018.09.05.08.43.57; Wed, 05 Sep 2018 08:44:13 -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 S1727952AbeIEUM7 (ORCPT + 99 others); Wed, 5 Sep 2018 16:12:59 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54539 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbeIEUMC (ORCPT ); Wed, 5 Sep 2018 16:12:02 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C75062079D; Wed, 5 Sep 2018 17:41:16 +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 shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AAubervilliers-681-1-92-107.w90-88.abo.wanadoo.fr [90.88.33.107]) by mail.bootlin.com (Postfix) with ESMTPSA id 228712071E; Wed, 5 Sep 2018 17:41:16 +0200 (CEST) From: Boris Brezillon To: Wolfram Sang , linux-i2c@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann Cc: Jonathan Corbet , linux-doc@vger.kernel.org, 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 , Peter Rosin , Mike Shettel , Stephen Boyd , Boris Brezillon Subject: [PATCH v7 05/10] dt-bindings: i3c: Add macros to help fill I3C/I2C device's reg property Date: Wed, 5 Sep 2018 17:41:03 +0200 Message-Id: <20180905154108.20770-6-boris.brezillon@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180905154108.20770-1-boris.brezillon@bootlin.com> References: <20180905154108.20770-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