diff options
author | Yuval Peress <peress@chromium.org> | 2021-03-23 01:24:03 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-08 07:39:45 +0000 |
commit | f48f2ee331ead2bf641279d37ee091217e0d141c (patch) | |
tree | a98177440f53292e19b68c87d0292d19e27d29d4 /zephyr/projects/trogdor/lazor | |
parent | 8d70ee4c035e949d5e59655d93c43ebd81060c87 (diff) | |
download | chrome-ec-f48f2ee331ead2bf641279d37ee091217e0d141c.tar.gz |
zephyr: i2c mapping using an enum
Currently, every project will need to provide a custom mapping header
for i2c as well as gpios. We'd like to move that overhead to the dts
files, which will make the board dts a lot more reusable as well as
clean up the bringup of new boards.
Add to the i2c_ports enum from the dts named i2c port list. Each enum
is only added if a node exists using that enum. This also allowes for
verifying that the enum is only used once.
BRANCH=none
BUG=b:184786824
TEST=build and flashed volteer
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I42cc098a9badac57a3781fa9dfaf32c0ec0c5aca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780838
Diffstat (limited to 'zephyr/projects/trogdor/lazor')
-rw-r--r-- | zephyr/projects/trogdor/lazor/include/i2c_map.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/zephyr/projects/trogdor/lazor/include/i2c_map.h b/zephyr/projects/trogdor/lazor/include/i2c_map.h deleted file mode 100644 index 23f63aaaab..0000000000 --- a/zephyr/projects/trogdor/lazor/include/i2c_map.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef __ZEPHYR_I2C_MAP_H -#define __ZEPHYR_I2C_MAP_H - -#include <devicetree.h> - -#include "i2c/i2c.h" - -#define I2C_PORT_BATTERY I2C_PORT_POWER -#define I2C_PORT_VIRTUAL I2C_PORT_BATTERY -#define I2C_PORT_CHARGER I2C_PORT_POWER -#define I2C_PORT_ACCEL I2C_PORT_SENSOR - -#define I2C_PORT_POWER NAMED_I2C(power) -#define I2C_PORT_TCPC0 NAMED_I2C(tcpc0) -#define I2C_PORT_TCPC1 NAMED_I2C(tcpc1) -#define I2C_PORT_WLC NAMED_I2C(wlc) -#define I2C_PORT_EEPROM NAMED_I2C(eeprom) -#define I2C_PORT_SENSOR NAMED_I2C(sensor) - -#endif /* __ZEPHYR_I2C_MAP_H */ |