summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-28 15:08:38 +1300
committerCommit Bot <commit-bot@chromium.org>2021-03-31 05:20:11 +0000
commitac49fac880808e7c2e27adb55a6adb0c2b72c8ca (patch)
tree05ce3e9b21de04d8b5d7b1e18bf4142dda4f5663
parent3dc67ced44871bbfbfaa57adfde070fa18fce348 (diff)
downloadchrome-ec-ac49fac880808e7c2e27adb55a6adb0c2b72c8ca.tar.gz
Add a common header for board_is_sourcing_vbus()
This function prototype is defined in lots of files, none of which is visible to Zephyr. Add a prototype in one place and remove the others. BUG=b:183296099 BRANCH=none TEST=make buildall Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ia324327a69b117483ab9ee5c85eba93c0fb5ad9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789799 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--board/blipper/board.h2
-rw-r--r--board/boten/board.h1
-rw-r--r--board/burnet/board.h1
-rw-r--r--board/cerise/board.h1
-rw-r--r--board/cheza/board.h2
-rw-r--r--board/coachz/board.h2
-rw-r--r--board/cret/board.h2
-rw-r--r--board/damu/board.h1
-rw-r--r--board/drawcia/board.h2
-rw-r--r--board/fennel/board.h1
-rw-r--r--board/galtic/board.h2
-rw-r--r--board/homestar/board.h2
-rw-r--r--board/icarus/board.h1
-rw-r--r--board/jacuzzi/board.h1
-rw-r--r--board/kakadu/board.h1
-rw-r--r--board/kappa/board.h1
-rw-r--r--board/katsu/board.h1
-rw-r--r--board/kodama/board.h1
-rw-r--r--board/kracko/board.h1
-rw-r--r--board/kukui/board.h1
-rw-r--r--board/lantis/board.h2
-rw-r--r--board/lazor/board.h2
-rw-r--r--board/madoo/board.h2
-rw-r--r--board/magolor/board.h1
-rw-r--r--board/makomo/board.h1
-rw-r--r--board/marzipan/board.h2
-rw-r--r--board/metaknight/board.h2
-rw-r--r--board/pompom/board.h2
-rw-r--r--board/sasuke/board.h2
-rw-r--r--board/sasukette/board.h2
-rw-r--r--board/stern/board.h1
-rw-r--r--board/storo/board.h2
-rw-r--r--board/trogdor/board.h2
-rw-r--r--board/waddledee/board.h2
-rw-r--r--board/waddledoo/board.h2
-rw-r--r--board/wheelie/board.h2
-rw-r--r--board/willow/board.h1
-rw-r--r--include/usb_charge.h10
38 files changed, 10 insertions, 57 deletions
diff --git a/board/blipper/board.h b/board/blipper/board.h
index 37a360e817..2d736c6ca5 100644
--- a/board/blipper/board.h
+++ b/board/blipper/board.h
@@ -106,8 +106,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/boten/board.h b/board/boten/board.h
index 5121bcdf60..f4cf889edd 100644
--- a/board/boten/board.h
+++ b/board/boten/board.h
@@ -134,7 +134,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
void pen_detect_interrupt(enum gpio_signal s);
#endif /* !__ASSEMBLER__ */
diff --git a/board/burnet/board.h b/board/burnet/board.h
index f180562ff7..ee57daef75 100644
--- a/board/burnet/board.h
+++ b/board/burnet/board.h
@@ -142,7 +142,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger */
int board_get_charger_i2c(void);
diff --git a/board/cerise/board.h b/board/cerise/board.h
index 97fe823454..1fc1a23741 100644
--- a/board/cerise/board.h
+++ b/board/cerise/board.h
@@ -146,7 +146,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger */
int board_get_charger_i2c(void);
diff --git a/board/cheza/board.h b/board/cheza/board.h
index 3583bb2c84..b9ab17ce78 100644
--- a/board/cheza/board.h
+++ b/board/cheza/board.h
@@ -211,8 +211,6 @@ enum pwm_channel {
PWM_CH_COUNT
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/coachz/board.h b/board/coachz/board.h
index 1eb0aa7601..d31101c801 100644
--- a/board/coachz/board.h
+++ b/board/coachz/board.h
@@ -107,8 +107,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/cret/board.h b/board/cret/board.h
index b4de76adcb..431610a969 100644
--- a/board/cret/board.h
+++ b/board/cret/board.h
@@ -177,7 +177,5 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/damu/board.h b/board/damu/board.h
index c7c798a308..ba80b800d6 100644
--- a/board/damu/board.h
+++ b/board/damu/board.h
@@ -139,7 +139,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger */
int board_get_charger_i2c(void);
diff --git a/board/drawcia/board.h b/board/drawcia/board.h
index 0479234318..04c2fcc70f 100644
--- a/board/drawcia/board.h
+++ b/board/drawcia/board.h
@@ -147,8 +147,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#ifdef CONFIG_KEYBOARD_FACTORY_TEST
extern const int keyboard_factory_scan_pins[][2];
extern const int keyboard_factory_scan_pins_used;
diff --git a/board/fennel/board.h b/board/fennel/board.h
index 169d27202d..2aa53b89d6 100644
--- a/board/fennel/board.h
+++ b/board/fennel/board.h
@@ -148,7 +148,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
diff --git a/board/galtic/board.h b/board/galtic/board.h
index cd9cf8c176..352f11c0cd 100644
--- a/board/galtic/board.h
+++ b/board/galtic/board.h
@@ -138,8 +138,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/homestar/board.h b/board/homestar/board.h
index f1a2ffb49c..7c8f814ca4 100644
--- a/board/homestar/board.h
+++ b/board/homestar/board.h
@@ -101,8 +101,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/icarus/board.h b/board/icarus/board.h
index ce8d5fe9ec..e4644d97c2 100644
--- a/board/icarus/board.h
+++ b/board/icarus/board.h
@@ -139,7 +139,6 @@ void emmc_ap_jump_to_bl(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
diff --git a/board/jacuzzi/board.h b/board/jacuzzi/board.h
index 6e28d9926d..4af817f961 100644
--- a/board/jacuzzi/board.h
+++ b/board/jacuzzi/board.h
@@ -154,7 +154,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
diff --git a/board/kakadu/board.h b/board/kakadu/board.h
index 69ef8d0217..2dd4ff2c5d 100644
--- a/board/kakadu/board.h
+++ b/board/kakadu/board.h
@@ -113,7 +113,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
void pogo_adc_interrupt(enum gpio_signal signal);
int board_discharge_on_ac(int enable);
diff --git a/board/kappa/board.h b/board/kappa/board.h
index e6eb66f72f..354692d0f8 100644
--- a/board/kappa/board.h
+++ b/board/kappa/board.h
@@ -135,7 +135,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger */
int board_get_charger_i2c(void);
diff --git a/board/katsu/board.h b/board/katsu/board.h
index 6cbd2b4073..44d6e9de59 100644
--- a/board/katsu/board.h
+++ b/board/katsu/board.h
@@ -113,7 +113,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
void pogo_adc_interrupt(enum gpio_signal signal);
int board_discharge_on_ac(int enable);
diff --git a/board/kodama/board.h b/board/kodama/board.h
index 9bd2254d78..2b5c850389 100644
--- a/board/kodama/board.h
+++ b/board/kodama/board.h
@@ -117,7 +117,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
void pogo_adc_interrupt(enum gpio_signal signal);
int board_discharge_on_ac(int enable);
/* returns the i2c port number of battery */
diff --git a/board/kracko/board.h b/board/kracko/board.h
index 3343a5564b..7cec59ce41 100644
--- a/board/kracko/board.h
+++ b/board/kracko/board.h
@@ -150,7 +150,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
#ifdef CONFIG_KEYBOARD_FACTORY_TEST
extern const int keyboard_factory_scan_pins[][2];
diff --git a/board/kukui/board.h b/board/kukui/board.h
index bbd13c18bf..28f0c80cf1 100644
--- a/board/kukui/board.h
+++ b/board/kukui/board.h
@@ -150,7 +150,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
void pogo_adc_interrupt(enum gpio_signal signal);
int board_discharge_on_ac(int enable);
diff --git a/board/lantis/board.h b/board/lantis/board.h
index e7c20a5a71..72734e82c0 100644
--- a/board/lantis/board.h
+++ b/board/lantis/board.h
@@ -140,8 +140,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#ifdef CONFIG_KEYBOARD_FACTORY_TEST
extern const int keyboard_factory_scan_pins[][2];
extern const int keyboard_factory_scan_pins_used;
diff --git a/board/lazor/board.h b/board/lazor/board.h
index af65f9e900..58080c4957 100644
--- a/board/lazor/board.h
+++ b/board/lazor/board.h
@@ -116,8 +116,6 @@ enum battery_type {
int board_is_clamshell(void);
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/madoo/board.h b/board/madoo/board.h
index 5739697c45..0006c33f77 100644
--- a/board/madoo/board.h
+++ b/board/madoo/board.h
@@ -163,7 +163,5 @@ enum fw_config_keyboard_type {
CUST_UK2_KB = 1,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/magolor/board.h b/board/magolor/board.h
index 69880e491d..f2b9c476c9 100644
--- a/board/magolor/board.h
+++ b/board/magolor/board.h
@@ -197,7 +197,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
void motion_interrupt(enum gpio_signal signal);
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/makomo/board.h b/board/makomo/board.h
index 1376d6386e..946bf117f4 100644
--- a/board/makomo/board.h
+++ b/board/makomo/board.h
@@ -148,7 +148,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
diff --git a/board/marzipan/board.h b/board/marzipan/board.h
index 135dc04081..c1d1505908 100644
--- a/board/marzipan/board.h
+++ b/board/marzipan/board.h
@@ -100,8 +100,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/metaknight/board.h b/board/metaknight/board.h
index eb80251fbb..80f38a8ac0 100644
--- a/board/metaknight/board.h
+++ b/board/metaknight/board.h
@@ -185,8 +185,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
void motion_interrupt(enum gpio_signal signal);
#endif /* !__ASSEMBLER__ */
diff --git a/board/pompom/board.h b/board/pompom/board.h
index 81457fc5af..67ba34e155 100644
--- a/board/pompom/board.h
+++ b/board/pompom/board.h
@@ -97,8 +97,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/sasuke/board.h b/board/sasuke/board.h
index 3276bbb848..0b7c9c8b6f 100644
--- a/board/sasuke/board.h
+++ b/board/sasuke/board.h
@@ -167,7 +167,5 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/sasukette/board.h b/board/sasukette/board.h
index 3b1526c46d..8e84201af3 100644
--- a/board/sasukette/board.h
+++ b/board/sasukette/board.h
@@ -93,8 +93,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/stern/board.h b/board/stern/board.h
index 72b5814236..a353857b61 100644
--- a/board/stern/board.h
+++ b/board/stern/board.h
@@ -139,7 +139,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger */
int board_get_charger_i2c(void);
diff --git a/board/storo/board.h b/board/storo/board.h
index 6e2ccc6c8b..a6bc89c44f 100644
--- a/board/storo/board.h
+++ b/board/storo/board.h
@@ -137,8 +137,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/trogdor/board.h b/board/trogdor/board.h
index 636b3dfead..9552486be5 100644
--- a/board/trogdor/board.h
+++ b/board/trogdor/board.h
@@ -81,8 +81,6 @@ enum pwm_channel {
PWM_CH_COUNT
};
-/* Custom function to indicate if sourcing VBUS */
-int board_is_sourcing_vbus(int port);
/* Enable VBUS sink for a given port */
int board_vbus_sink_enable(int port, int enable);
/* Reset all TCPCs. */
diff --git a/board/waddledee/board.h b/board/waddledee/board.h
index 5540fdcbe7..aad6683ad8 100644
--- a/board/waddledee/board.h
+++ b/board/waddledee/board.h
@@ -143,8 +143,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/waddledoo/board.h b/board/waddledoo/board.h
index 9a6465548a..ec4812dd9d 100644
--- a/board/waddledoo/board.h
+++ b/board/waddledoo/board.h
@@ -180,7 +180,5 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/wheelie/board.h b/board/wheelie/board.h
index 7c680545c0..a87761e894 100644
--- a/board/wheelie/board.h
+++ b/board/wheelie/board.h
@@ -138,8 +138,6 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
-int board_is_sourcing_vbus(int port);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/willow/board.h b/board/willow/board.h
index 785aea70ba..b9531b0805 100644
--- a/board/willow/board.h
+++ b/board/willow/board.h
@@ -148,7 +148,6 @@ void emmc_cmd_interrupt(enum gpio_signal signal);
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
-int board_is_sourcing_vbus(int port);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
diff --git a/include/usb_charge.h b/include/usb_charge.h
index 7a102dac4c..8217b0f52c 100644
--- a/include/usb_charge.h
+++ b/include/usb_charge.h
@@ -183,4 +183,14 @@ static inline int usb_charger_ramp_max(int port, int supplier, int sup_curr)
*/
void usb_charger_reset_charge(int port);
+/**
+ * Check if a particular port is sourcing VBUS
+ *
+ * This function is typically defined in the board file
+ *
+ * @param port port number
+ * @return 0 if not source, non-zero if sourcing
+ */
+int board_is_sourcing_vbus(int port);
+
#endif /* __CROS_EC_USB_CHARGE_H */