shakti_uart.c (3c019339830affe7974b738e0c2b71bd28778ef0) shakti_uart.c (e3d0814368d00e7985c31edf5d0cfce45972d4be)
1/*
2 * SHAKTI UART
3 *
4 * Copyright (c) 2021 Vijai Kumar K <vijai@behindbytes.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 151 unchanged lines hidden (view full) ---

160static Property shakti_uart_properties[] = {
161 DEFINE_PROP_CHR("chardev", ShaktiUartState, chr),
162 DEFINE_PROP_END_OF_LIST(),
163};
164
165static void shakti_uart_class_init(ObjectClass *klass, void *data)
166{
167 DeviceClass *dc = DEVICE_CLASS(klass);
1/*
2 * SHAKTI UART
3 *
4 * Copyright (c) 2021 Vijai Kumar K <vijai@behindbytes.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 151 unchanged lines hidden (view full) ---

160static Property shakti_uart_properties[] = {
161 DEFINE_PROP_CHR("chardev", ShaktiUartState, chr),
162 DEFINE_PROP_END_OF_LIST(),
163};
164
165static void shakti_uart_class_init(ObjectClass *klass, void *data)
166{
167 DeviceClass *dc = DEVICE_CLASS(klass);
168 dc->reset = shakti_uart_reset;
168 device_class_set_legacy_reset(dc, shakti_uart_reset);
169 dc->realize = shakti_uart_realize;
170 device_class_set_props(dc, shakti_uart_properties);
171 set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
172}
173
174static const TypeInfo shakti_uart_info = {
175 .name = TYPE_SHAKTI_UART,
176 .parent = TYPE_SYS_BUS_DEVICE,
177 .instance_size = sizeof(ShaktiUartState),
178 .class_init = shakti_uart_class_init,
179 .instance_init = shakti_uart_instance_init,
180};
181
182static void shakti_uart_register_types(void)
183{
184 type_register_static(&shakti_uart_info);
185}
186type_init(shakti_uart_register_types)
169 dc->realize = shakti_uart_realize;
170 device_class_set_props(dc, shakti_uart_properties);
171 set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
172}
173
174static const TypeInfo shakti_uart_info = {
175 .name = TYPE_SHAKTI_UART,
176 .parent = TYPE_SYS_BUS_DEVICE,
177 .instance_size = sizeof(ShaktiUartState),
178 .class_init = shakti_uart_class_init,
179 .instance_init = shakti_uart_instance_init,
180};
181
182static void shakti_uart_register_types(void)
183{
184 type_register_static(&shakti_uart_info);
185}
186type_init(shakti_uart_register_types)