From 8246d63871a5bd9e6653d3735dc443cd958ee674 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Fri, 3 Dec 2021 15:10:54 -0800 Subject: zephyr: brya: Enable PMIC mp2964 configuration This enables the configuration for power management IC MP2964. BUG=b:209023139 BRANCH=none TEST=make configure -B ~/tmp/brya/ brya -b Signed-off-by: Rajesh Kumar Change-Id: I2bf39eea0db05103ca82e096cba07941b2f23ee4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3315227 Reviewed-by: Jack Rosenthal --- zephyr/boards/arm/brya/brya.dts | 10 ++++++++++ zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml | 1 + zephyr/dts/bindings/pmic/mps,mp2964.yaml | 9 +++++++++ zephyr/projects/brya/brya/prj.conf | 4 ++++ zephyr/shim/include/config_chip.h | 2 ++ 5 files changed, 26 insertions(+) create mode 100644 zephyr/dts/bindings/pmic/mps,mp2964.yaml diff --git a/zephyr/boards/arm/brya/brya.dts b/zephyr/boards/arm/brya/brya.dts index 515cfa7b57..4ffb512f4c 100644 --- a/zephyr/boards/arm/brya/brya.dts +++ b/zephyr/boards/arm/brya/brya.dts @@ -59,6 +59,10 @@ i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_CHARGER"; }; + mp2964 { + i2c-port = <&i2c7_0>; + enum-name = "I2C_PORT_MP2964"; + }; }; named-pwms { @@ -223,6 +227,12 @@ &i2c7_0 { status = "okay"; clock-frequency = ; + + pmic_mp2964: pmic_mp2964@20 { + compatible = "mps,mp2964"; + reg = <0x20>; + label = "I2C_ADDR_MP2964_FLAGS"; + }; }; &i2c_ctrl7 { diff --git a/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml b/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml index c676adbe5f..e4981c2dc5 100644 --- a/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml +++ b/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml @@ -28,6 +28,7 @@ properties: - I2C_PORT_EVB_2 - I2C_PORT_EVB_3 - I2C_PORT_EVB_7 + - I2C_PORT_MP2964 - I2C_PORT_OPT_4 - I2C_PORT_POWER - I2C_PORT_PPC0 diff --git a/zephyr/dts/bindings/pmic/mps,mp2964.yaml b/zephyr/dts/bindings/pmic/mps,mp2964.yaml new file mode 100644 index 0000000000..db35aa07b2 --- /dev/null +++ b/zephyr/dts/bindings/pmic/mps,mp2964.yaml @@ -0,0 +1,9 @@ +# 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. + +description: MPS MP2964 Power Management IC + +compatible: "mps,mp2964" + +include: i2c-device.yaml diff --git a/zephyr/projects/brya/brya/prj.conf b/zephyr/projects/brya/brya/prj.conf index e4aac713a9..aa99096dd0 100644 --- a/zephyr/projects/brya/brya/prj.conf +++ b/zephyr/projects/brya/brya/prj.conf @@ -49,6 +49,10 @@ CONFIG_PLATFORM_EC_THERMISTOR=y # Miscellaneous configs CONFIG_PLATFORM_EC_HIBERNATE_PSL=y +# PMIC +CONFIG_PLATFORM_EC_PMIC=y +CONFIG_PLATFORM_EC_MP2964=y + # Keyboard CONFIG_PLATFORM_EC_KEYBOARD=y CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042=y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 9d9e402f3c..6844128d96 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -1937,6 +1937,8 @@ #undef CONFIG_MP2964 #ifdef CONFIG_PLATFORM_EC_MP2964 #define CONFIG_MP2964 +#define I2C_ADDR_MP2964_FLAGS \ + DT_REG_ADDR(DT_NODELABEL(pmic_mp2964)) #endif #undef CONFIG_ACCELGYRO_ICM_COMM_SPI -- cgit v1.2.1