Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion bluetooth/1.0/default/vendor_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,18 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
return true;
}

#include <fcntl.h>
#include <sys/ioctl.h>
static void hw_reset(bool reset) {
unsigned buf[8] = { 8 * 4, 0, 0x38041, 8, 8, 128, 0, 0};
buf[6] = reset ? 0 : 1;
int fd = open("/dev/vcio", 0);
if (fd >= 0) {
ioctl(fd, _IOWR(100, 0, char *), buf);
close(fd);
}
}

void VendorInterface::Close() {
// These callbacks may send HCI events (vendor-dependent), so make sure to
// StopWatching the file descriptor after this.
Expand Down Expand Up @@ -311,6 +323,10 @@ void VendorInterface::Close() {
delete firmware_startup_timer_;
firmware_startup_timer_ = nullptr;
}

hw_reset(true);
sleep(2);
hw_reset(false);
}

size_t VendorInterface::Send(uint8_t type, const uint8_t* data, size_t length) {
Expand Down Expand Up @@ -347,7 +363,7 @@ void VendorInterface::OnFirmwareConfigured(uint8_t result) {
lib_interface_->op(BT_VND_OP_GET_LPM_IDLE_TIMEOUT, &lpm_timeout_ms);
ALOGI("%s: lpm_timeout_ms %d", __func__, lpm_timeout_ms);

bt_vendor_lpm_mode_t mode = BT_VND_LPM_ENABLE;
bt_vendor_lpm_mode_t mode = BT_VND_LPM_DISABLE;
lib_interface_->op(BT_VND_OP_LPM_SET_MODE, &mode);

ALOGD("%s Calling StartLowPowerWatchdog()", __func__);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct ExternalCameraDeviceSession : public virtual RefBase,

static const int kMaxProcessedStream = 2;
static const int kMaxStallStream = 1;
static const uint32_t kMaxBytesPerPixel = 2;
static const uint32_t kMaxBytesPerPixel = 4;

class OutputThread : public android::Thread {
public:
Expand Down