diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-01-03 17:59:07 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-03 22:43:02 -0800 |
commit | eb781cc377fe8c5c2d1cb266b599c24e5e4e8cd5 (patch) | |
tree | 5f25bac94add44d00805ca2dd732407026f7ca55 /driver | |
parent | e358a5521d3dda93d9ca219352a4f27c20d49a18 (diff) | |
download | chrome-ec-eb781cc377fe8c5c2d1cb266b599c24e5e4e8cd5.tar.gz |
driver/bc12/pi3usb9281: Make a few functions static
Old oak boards that still use these functions have long been
deprecated, let's make the unneeded functions static.
BRANCH=none
BUG=b:35573263
TEST=make buildall -j => makes newsizes: up to 64 bytes saved on
a few boards.
Change-Id: I8f2503ce324e34b87b3bbfa3c509079357880c9e
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/848574
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/bc12/pi3usb9281.c | 11 | ||||
-rw-r--r-- | driver/pi3usb9281.h | 16 |
2 files changed, 6 insertions, 21 deletions
diff --git a/driver/bc12/pi3usb9281.c b/driver/bc12/pi3usb9281.c index b99be31d18..be1bfdee18 100644 --- a/driver/bc12/pi3usb9281.c +++ b/driver/bc12/pi3usb9281.c @@ -42,6 +42,7 @@ static int usb_switch_state[CONFIG_USB_PD_PORT_COUNT]; static struct mutex usb_switch_lock[CONFIG_USB_PD_PORT_COUNT]; static int pi3usb9281_reset(int port); +static int pi3usb9281_get_interrupts(int port); static void select_chip(int port) { @@ -139,7 +140,7 @@ static int pi3usb9281_set_interrupt_mask(int port, uint8_t mask) return pi3usb9281_write(port, PI3USB9281_REG_INT_MASK, ~mask); } -void pi3usb9281_init(int port) +static void pi3usb9281_init(int port) { uint8_t dev_id; @@ -164,7 +165,7 @@ int pi3usb9281_enable_interrupts(int port) return pi3usb9281_write_ctrl(port, ctrl & ~PI3USB9281_CTRL_INT_DIS); } -int pi3usb9281_disable_interrupts(int port) +static int pi3usb9281_disable_interrupts(int port) { uint8_t ctrl = pi3usb9281_read(port, PI3USB9281_REG_CONTROL); int rv; @@ -177,17 +178,17 @@ int pi3usb9281_disable_interrupts(int port) return rv; } -int pi3usb9281_get_interrupts(int port) +static int pi3usb9281_get_interrupts(int port) { return pi3usb9281_read(port, PI3USB9281_REG_INT); } -int pi3usb9281_get_device_type(int port) +static int pi3usb9281_get_device_type(int port) { return pi3usb9281_read(port, PI3USB9281_REG_DEV_TYPE) & 0x77; } -int pi3usb9281_get_charger_status(int port) +static int pi3usb9281_get_charger_status(int port) { return pi3usb9281_read(port, PI3USB9281_REG_CHG_STATUS) & 0x1f; } diff --git a/driver/pi3usb9281.h b/driver/pi3usb9281.h index fc642435c6..fe19f0e977 100644 --- a/driver/pi3usb9281.h +++ b/driver/pi3usb9281.h @@ -71,23 +71,7 @@ struct pi3usb9281_config { /* Configuration struct defined at board level */ extern struct pi3usb9281_config pi3usb9281_chips[]; -/* TODO: Make many of these functions static after Oak board changes. */ -/* Initialize chip and enable interrupts */ -void pi3usb9281_init(int port); - /* Enable interrupts. */ int pi3usb9281_enable_interrupts(int port); -/* Disable all interrupts. */ -int pi3usb9281_disable_interrupts(int port); - -/* Get and clear current interrupt status. */ -int pi3usb9281_get_interrupts(int port); - -/* Get attached device type. */ -int pi3usb9281_get_device_type(int port); - -/* Get attached charger status. */ -int pi3usb9281_get_charger_status(int port); - #endif /* __CROS_EC_PI3USB9281_H */ |