Index: sys/compat/linuxkpi/common/include/linux/device.h =================================================================== --- sys/compat/linuxkpi/common/include/linux/device.h +++ sys/compat/linuxkpi/common/include/linux/device.h @@ -52,6 +52,7 @@ struct device; struct fwnode_handle; +struct device_node; struct class { const char *name; @@ -119,6 +120,7 @@ unsigned int irq_end; const struct attribute_group **groups; struct fwnode_handle *fwnode; + struct device_node *of_node; struct cdev *backlight_dev; struct backlight_device *bd; Index: sys/compat/linuxkpi/common/include/linux/of.h =================================================================== --- /dev/null +++ sys/compat/linuxkpi/common/include/linux/of.h @@ -0,0 +1,85 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_OF_H +#define _LINUXKPI_LINUX_OF_H + +struct device_node { + void *__dummy; +}; + +static inline const void * +of_get_property(const struct device_node *node, const char *name, + int *len) +{ + + return (NULL); +} + +static inline int +of_property_read_string(const struct device_node *node, const char *prop, + const char **buf) +{ + + return (-EINVAL); +} + +static inline int +of_property_read_string_index(const struct device_node *node, const char *prop, + int idx, const char **buf) +{ + + return (-EINVAL); +} + +static inline int +of_property_read_u8_array(const struct device_node *node, const char *prop, + uint8_t *buf, size_t buflen) +{ + + return (-EINVAL); +} + +static inline int +of_property_read_u8(const struct device_node *node, const char *prop, + uint8_t *buf) +{ + + return (of_property_read_u8_array(node, prop, buf, sizeof(*buf))); +} + +static inline int +of_property_read_u32(const struct device_node *node, const char *prop, + uint32_t *buf) +{ + + return (-EINVAL); +} + +#endif /* _LINUXKPI_LINUX_OF_H */