diff options
author | Tim Lin <tim2.lin@ite.corp-partner.google.com> | 2022-05-11 08:36:15 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-16 17:03:35 +0000 |
commit | 4a82d74855a109dcc04f7b252e5f2c817d94db6f (patch) | |
tree | 38c7d0bdf86388bb743b4cb45af45b60e1d75679 | |
parent | a3849dc81bd7d6607a62e405c1da734334c38729 (diff) | |
download | chrome-ec-4a82d74855a109dcc04f7b252e5f2c817d94db6f.tar.gz |
zephyr: it8xxx2: Remove shim of pinmux
The pinctrl driver has been added, pinmux.c can be removed.
BUG=b:223258787
BRANCH=none
TEST=none
Cq-Depend: chromium:3577329
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: I11102db9eff9f5c718869b02684e5768ecfe6b64
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3640983
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
-rw-r--r-- | zephyr/boards/riscv/it8xxx2/it8xxx2_defconfig | 4 | ||||
-rw-r--r-- | zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig | 4 | ||||
-rw-r--r-- | zephyr/shim/chip/it8xxx2/CMakeLists.txt | 1 | ||||
-rw-r--r-- | zephyr/shim/chip/it8xxx2/pinmux.c | 101 |
4 files changed, 0 insertions, 110 deletions
diff --git a/zephyr/boards/riscv/it8xxx2/it8xxx2_defconfig b/zephyr/boards/riscv/it8xxx2/it8xxx2_defconfig index a070a1bcee..740910d5ab 100644 --- a/zephyr/boards/riscv/it8xxx2/it8xxx2_defconfig +++ b/zephyr/boards/riscv/it8xxx2/it8xxx2_defconfig @@ -52,10 +52,6 @@ CONFIG_SOC_FLASH_ITE_IT8XXX2=y CONFIG_I2C=y CONFIG_I2C_ITE_IT8XXX2=y -# Pinmux Driver -CONFIG_PINMUX=y -CONFIG_PINMUX_ITE_IT8XXX2=y - # Power Button CONFIG_PLATFORM_EC_POWER_BUTTON=y diff --git a/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig b/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig index b04eaf0834..d757532d61 100644 --- a/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig +++ b/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig @@ -21,10 +21,6 @@ CONFIG_SHELL_TAB=y CONFIG_SHELL_TAB_AUTOCOMPLETION=y CONFIG_SHELL_HISTORY=y -# Pinmux Driver -CONFIG_PINMUX=y -CONFIG_PINMUX_ITE_IT8XXX2=y - # PWM CONFIG_PWM=y CONFIG_PWM_SHELL=n diff --git a/zephyr/shim/chip/it8xxx2/CMakeLists.txt b/zephyr/shim/chip/it8xxx2/CMakeLists.txt index 5da8748178..539fd9f029 100644 --- a/zephyr/shim/chip/it8xxx2/CMakeLists.txt +++ b/zephyr/shim/chip/it8xxx2/CMakeLists.txt @@ -7,6 +7,5 @@ cros_ec_library_include_directories(include) zephyr_library_sources(clock.c) zephyr_library_sources(gpio.c) zephyr_library_sources_ifdef(CONFIG_CROS_EC system.c) -zephyr_library_sources_ifdef(CONFIG_CROS_EC pinmux.c) zephyr_library_sources_ifdef(CONFIG_CROS_KB_RAW_ITE keyboard_raw.c) zephyr_library_sources_ifdef(CONFIG_PM_POLICY_CUSTOM power_policy.c) diff --git a/zephyr/shim/chip/it8xxx2/pinmux.c b/zephyr/shim/chip/it8xxx2/pinmux.c deleted file mode 100644 index 92e2996e32..0000000000 --- a/zephyr/shim/chip/it8xxx2/pinmux.c +++ /dev/null @@ -1,101 +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. - */ - -#include <zephyr/init.h> -#include <zephyr/drivers/pinmux.h> -#include <zephyr/dt-bindings/pinctrl/it8xxx2-pinctrl.h> -#include <soc.h> - -#define SCL 0 -#define SDA 1 -#define IT8XXX2_DT_I2C_ALT_ITEMS(node_id) { \ - .clk_pinctrls = DEVICE_DT_GET(DT_PHANDLE( \ - DT_PINCTRL_BY_IDX(node_id, 0, SCL), pinctrls)), \ - .dat_pinctrls = DEVICE_DT_GET(DT_PHANDLE( \ - DT_PINCTRL_BY_IDX(node_id, 0, SDA), pinctrls)), \ - .clk_pin = DT_PHA( \ - DT_PINCTRL_BY_IDX(node_id, 0, SCL), pinctrls, pin), \ - .dat_pin = DT_PHA( \ - DT_PINCTRL_BY_IDX(node_id, 0, SDA), pinctrls, pin), \ - .clk_alt = DT_PHA( \ - DT_PINCTRL_BY_IDX(node_id, 0, SCL), pinctrls, alt_func), \ - .dat_alt = DT_PHA( \ - DT_PINCTRL_BY_IDX(node_id, 0, SDA), pinctrls, alt_func), \ -}, - -struct i2c_alts_cfg { - /* Pinmux control group */ - const struct device *clk_pinctrls; - const struct device *dat_pinctrls; - /* GPIO pin */ - uint8_t clk_pin; - uint8_t dat_pin; - /* Alternate function */ - uint8_t clk_alt; - uint8_t dat_alt; -}; - -static struct i2c_alts_cfg i2c_alts[] = { - DT_FOREACH_STATUS_OKAY(ite_it8xxx2_i2c, IT8XXX2_DT_I2C_ALT_ITEMS) -}; - -#ifdef CONFIG_I2C_ITE_ENHANCE -static struct i2c_alts_cfg i2c_alts_enhance[] = { - DT_FOREACH_STATUS_OKAY(ite_enhance_i2c, IT8XXX2_DT_I2C_ALT_ITEMS) -}; -#endif - -static int it8xxx2_pinmux_init(const struct device *dev) -{ - ARG_UNUSED(dev); - -#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmuxb), okay) && \ - DT_NODE_HAS_STATUS(DT_NODELABEL(uart1), okay) - const struct device *portb = DEVICE_DT_GET(DT_NODELABEL(pinmuxb)); - - /* SIN0 */ - pinmux_pin_set(portb, 0, IT8XXX2_PINMUX_FUNC_3); - /* SOUT0 */ - pinmux_pin_set(portb, 1, IT8XXX2_PINMUX_FUNC_3); -#endif - - return 0; -} -SYS_INIT(it8xxx2_pinmux_init, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY); - -/* - * Init priority is behind CONFIG_PLATFORM_EC_GPIO_INIT_PRIORITY to overwrite - * GPIO_INPUT setting of i2c ports. - */ -static int it8xxx2_pinmux_init_latr(const struct device *dev) -{ - ARG_UNUSED(dev); - - for (int inst = 0; inst < ARRAY_SIZE(i2c_alts); inst++) { - /* I2C CLK */ - pinmux_pin_set(i2c_alts[inst].clk_pinctrls, - i2c_alts[inst].clk_pin, - i2c_alts[inst].clk_alt); - /* I2C DAT */ - pinmux_pin_set(i2c_alts[inst].dat_pinctrls, - i2c_alts[inst].dat_pin, - i2c_alts[inst].dat_alt); - } - -#ifdef CONFIG_I2C_ITE_ENHANCE - for (int inst = 0; inst < ARRAY_SIZE(i2c_alts_enhance); inst++) { - /* I2C CLK */ - pinmux_pin_set(i2c_alts_enhance[inst].clk_pinctrls, - i2c_alts_enhance[inst].clk_pin, - i2c_alts_enhance[inst].clk_alt); - /* I2C DAT */ - pinmux_pin_set(i2c_alts_enhance[inst].dat_pinctrls, - i2c_alts_enhance[inst].dat_pin, - i2c_alts_enhance[inst].dat_alt); - } -#endif - return 0; -} -SYS_INIT(it8xxx2_pinmux_init_latr, POST_KERNEL, 52); |