viacuda: self-registration with the device registry.

This commit is contained in:
Maxim Poliakovski 2022-07-17 05:28:05 +02:00
parent 9056d53474
commit 66debbc730
2 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <devices/common/adb/adb.h>
#include <devices/common/hwinterrupt.h>
#include <devices/common/viacuda.h>
#include <devices/deviceregistry.h>
#include <loguru.hpp>
#include <machines/machinebase.h>
#include <memaccess.h>
@ -709,3 +710,9 @@ void ViaCuda::i2c_comb_transaction(
this->is_open_ended = true;
}
}
static const DeviceDescription ViaCuda_Descriptor = {
ViaCuda::create, {}, {}
};
REGISTER_DEVICE(ViaCuda, ViaCuda_Descriptor);

View File

@ -156,6 +156,10 @@ public:
ViaCuda();
~ViaCuda() = default;
static std::unique_ptr<HWComponent> create() {
return std::unique_ptr<ViaCuda>(new ViaCuda());
}
// HWComponent methods
int device_postinit();