summaryrefslogtreecommitdiff
path: root/driver/ppc/sn5s330.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-11-27 10:19:09 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-05 18:00:36 -0800
commit0a5e908467b5f5169a7197bbe7b327e06432d4cf (patch)
treea3927ccf65f15ca6095296a897ed4ebd5c800249 /driver/ppc/sn5s330.h
parent864b0b661642836f26e3b7426f701283bc0a069d (diff)
downloadchrome-ec-0a5e908467b5f5169a7197bbe7b327e06432d4cf.tar.gz
ppc: sn5s330: Add API to determine if FET is on.
It will be useful to determine if a FET is enabled or not. For example, to determine if we are sourcing power to a downstream device. This commit simply adds an API to check if a FET is enabled or not. BUG=None BRANCH=None TEST=`make -j buildall` Change-Id: I1f8198342cf225ce9a10d218607bcfbe6aef618c Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/791498 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/ppc/sn5s330.h')
-rw-r--r--driver/ppc/sn5s330.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/driver/ppc/sn5s330.h b/driver/ppc/sn5s330.h
index b3d6c45bee..f1bea3da46 100644
--- a/driver/ppc/sn5s330.h
+++ b/driver/ppc/sn5s330.h
@@ -107,17 +107,25 @@ enum sn5s330_pp_idx {
#define SN5S330_VSAFE0V_MASK (1 << 3)
/*
- * INT_MASK_RISE_EDGE_1
+ * INT_MASK_RISE/FALL_EDGE_1
*
* The ILIM_PP1 bit indicates an overcurrent condition when sourcing on power
* path 1. For rising edge registers, this indicates an overcurrent has
* occured; similarly for falling edge, it means the overcurrent condition is no
* longer present.
*/
-#define SN5S330_ILIM_PP1_RISE_MASK (1 << 4)
+#define SN5S330_ILIM_PP1_MASK (1 << 4)
-/* INT_MASK_FALL_EDGE_1 */
-#define SN5S330_ILIM_PP1_FALL_MASK (1 << 4)
+/**
+ * Determine if a PP FET is enabled or not.
+ *
+ * @param chip_idx: The index into the sn5s330_chips[] table.
+ * @param pp: The power path index (PP1 or PP2).
+ * @param is_enabled: 1 to turn on the FET, 0 to turn off.
+ * @return EC_SUCCESS if i2c access worked, otherwise an error.
+ */
+int sn5s330_is_pp_fet_enabled(uint8_t chip_idx, enum sn5s330_pp_idx pp,
+ int *is_enabled);
/**
* Turn on/off the PP1 or PP2 FET.