summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernardo Perez Priego <bernardo.perez.priego@intel.com>2022-11-21 18:29:11 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-23 15:02:26 +0000
commit75beb51819aa90f110ff32a1bef54b97205a7c9a (patch)
treee9548595fa293027eb127d072f288463815d5f7b
parentc5d3eb4a6bd65eb78fe01ebddadac73b2cab3233 (diff)
downloadchrome-ec-75beb51819aa90f110ff32a1bef54b97205a7c9a.tar.gz
zephyr: mtlrvp: Add DC jack present GPIO interrupt
When DC jack is providing power, it takes higher supplier priority and inhibits system from charging using any other Type-C port. This CL will enable detecting DC jack connection during run time and not only initialization time. BUG=None BRANCH=None TEST=Boot MTL RVP with DC jack connected Disconnect DC jack Connect Type-C charger Type-C should charge MTL RVP Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com> Change-Id: I13b292658bbcc28e11585679f60d5c014d3da302 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4045034 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/interrupts.dts5
-rw-r--r--zephyr/program/intelrvp/mtlrvp/src/mtlrvp.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/interrupts.dts b/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/interrupts.dts
index b120f6c05e..ad928fd593 100644
--- a/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/interrupts.dts
+++ b/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/interrupts.dts
@@ -56,5 +56,10 @@
flags = <GPIO_INT_EDGE_BOTH>;
handler = "board_connect_c0_sbu";
};
+ int_dc_jack_present: dc_jack_present {
+ irq-pin = <&std_adp_prsnt>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "board_dc_jack_interrupt";
+ };
};
};
diff --git a/zephyr/program/intelrvp/mtlrvp/src/mtlrvp.c b/zephyr/program/intelrvp/mtlrvp/src/mtlrvp.c
index d6bd0f85b7..e73995337a 100644
--- a/zephyr/program/intelrvp/mtlrvp/src/mtlrvp.c
+++ b/zephyr/program/intelrvp/mtlrvp/src/mtlrvp.c
@@ -275,6 +275,9 @@ static void board_int_init(void)
/* Enable CCD Mode interrupt */
gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_ccd_mode));
+
+ /* Enable DC jack interrupt */
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_dc_jack_present));
}
static int board_pre_task_peripheral_init(const struct device *unused)