Skip to content

Commit 043cbc0

Browse files
author
Jamie C. Driver
committed
v2: add explicit calls to power usb device
1 parent ad67636 commit 043cbc0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

main/power/jadev20.inc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,20 @@ uint16_t power_get_iusb(void) { return 0; }
249249

250250
uint16_t power_get_temp(void) { return 0; }
251251

252+
void disable_usb_host(void)
253+
{
254+
JADE_SEMAPHORE_TAKE(i2c_mutex);
255+
I2C_LOG_ANY_ERROR(_power_write_command(PMIC_ADDR, PMIC_REG_OTG, 0x00));
256+
JADE_SEMAPHORE_GIVE(i2c_mutex);
257+
}
258+
259+
void enable_usb_host(void)
260+
{
261+
JADE_SEMAPHORE_TAKE(i2c_mutex);
262+
I2C_LOG_ANY_ERROR(_power_write_command(PMIC_ADDR, PMIC_REG_OTG, 0x01));
263+
JADE_SEMAPHORE_GIVE(i2c_mutex);
264+
}
265+
252266
bool usb_connected(void)
253267
{
254268
uint8_t usb_type;

main/power/minimal.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ uint16_t power_get_vusb(void) { return 0; }
2828
uint16_t power_get_iusb(void) { return 0; }
2929
uint16_t power_get_temp(void) { return 0; }
3030

31+
void disable_usb_host(void) {}
32+
void enable_usb_host(void) {}
33+
3134
bool usb_connected(void) { return true; }

0 commit comments

Comments
 (0)