blob: e33981f997ec9b376edb6f6f541b0af76855b269 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ZIRCON_SYSTEM_DEV_BOARD_AS370_AS370_H_
#define ZIRCON_SYSTEM_DEV_BOARD_AS370_AS370_H_
#include <threads.h>
#include <ddktl/device.h>
#include <ddktl/protocol/gpioimpl.h>
#include <ddktl/protocol/platform/bus.h>
namespace board_as370 {
// BTI IDs for our devices
enum {
BTI_BOARD,
BTI_USB,
BTI_AUDIO_DHUB,
};
class As370 : public ddk::Device<As370> {
public:
As370(zx_device_t* parent, const ddk::PBusProtocolClient& pbus,
const pdev_board_info_t& board_info)
: ddk::Device<As370>(parent), pbus_(pbus), board_info_(board_info) {}
static zx_status_t Create(void* ctx, zx_device_t* parent);
void DdkRelease() { delete this; }
private:
zx_status_t Start();
int Thread();
zx_status_t GpioInit();
zx_status_t I2cInit();
zx_status_t UsbInit();
zx_status_t AudioInit();
zx_status_t ClockInit();
zx_status_t LightInit();
zx_status_t NandInit();
const ddk::PBusProtocolClient pbus_;
const pdev_board_info_t board_info_;
ddk::GpioImplProtocolClient gpio_impl_;
thrd_t thread_;
};
} // namespace board_as370
#endif // ZIRCON_SYSTEM_DEV_BOARD_AS370_AS370_H_