blob: efb55d293380b49a41ae3a906670d4c96cf0d888 [file] [log] [blame]
// Copyright 2022 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 SRC_DA7219_DRIVER_DA7219_H_
#define SRC_DA7219_DRIVER_DA7219_H_
#include <fidl/fuchsia.hardware.audio/cpp/wire.h>
#include <lib/driver/component/cpp/driver_cpp.h>
#include "i2c_channel.h"
namespace audio {
class Da7219Driver : public fdf::DriverBase {
public:
Da7219Driver(fdf::DriverStartArgs start_args,
fdf::UnownedSynchronizedDispatcher driver_dispatcher)
: fdf::DriverBase("da7219", std::move(start_args),
std::move(driver_dispatcher)) {}
virtual ~Da7219Driver() = default;
zx::result<> Start() override;
private:
zx::result<> SetupI2cChannel();
void Serve(fidl::ServerEnd<fuchsia_hardware_audio::Codec> request);
std::shared_ptr<I2cChannel> i2c_channel_;
};
} // namespace audio
#endif // SRC_DA7219_DRIVER_DA7219_H_