Message ID | 20180323110020.19080-7-boris.brezillon@bootlin.com |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | Add the I3C subsystem | expand |
On Fri, Mar 23, 2018 at 12:00:15PM +0100, Boris Brezillon wrote: > 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 <boris.brezillon@bootlin.com> > --- > include/dt-bindings/i3c/i3c.h | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 include/dt-bindings/i3c/i3c.h Reviewed-by: Rob Herring <robh@kernel.org> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 <boris.brezillon@bootlin.com> + */ + +#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
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 <boris.brezillon@bootlin.com> --- include/dt-bindings/i3c/i3c.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/dt-bindings/i3c/i3c.h