| // Copyright 2021 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 FUCHSIA_SDK_EXAMPLES_CC_EXAMPLE_DRIVER_H_ |
| #define FUCHSIA_SDK_EXAMPLES_CC_EXAMPLE_DRIVER_H_ |
| |
| #include <ddktl/device.h> |
| |
| namespace example_driver { |
| |
| class ExampleDriver; |
| using DeviceType = |
| ddk::Device<ExampleDriver, ddk::Initializable, ddk::Unbindable>; |
| class ExampleDriver : public DeviceType { |
| public: |
| explicit ExampleDriver(zx_device_t* parent) : DeviceType(parent) {} |
| virtual ~ExampleDriver() = default; |
| |
| static zx_status_t Bind(void* ctx, zx_device_t* dev); |
| zx_status_t Bind(); |
| void DdkInit(ddk::InitTxn txn); |
| void DdkUnbind(ddk::UnbindTxn txn); |
| void DdkRelease(); |
| }; |
| |
| } // namespace example_driver |
| |
| #endif // FUCHSIA_SDK_EXAMPLES_CC_EXAMPLE_DRIVER_H_ |
| |