opnsense-src/sys/modules/linuxkpi/Makefile
Emmanuel Vadot 1961a14a47 linuxkpi: Add i2c support
Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
For every i2c_adapter added by i2c_bit_add_bus we add a child to the
device named "lkpi_iicbb". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
With the help of iic(4), this expose the i2c controller to userspace
allowing a user to query DDC information from a monitor.
e.g.: i2c -f /dev/iic0 -a 0x28 -c 128 -d r
will query the standard EDID from the monitor if plugged.

The bitbang part (lkpi_iicbb) isn't tested at all for now as I don't have
compatible hardware (all my hardware have native i2c controller).

Tested on:	Intel (SandyBridge, Skylake, ApolloLake)
Tested on:	AMD (Picasso, Polaris (amd64 and arm64))

MFC after:	1 month
Reviewed by:	hselasky
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33053
2022-01-25 16:15:39 +01:00

48 lines
929 B
Makefile

# $FreeBSD$
.PATH: ${SRCTOP}/sys/compat/linuxkpi/common/src
KMOD= linuxkpi
SRCS= linux_compat.c \
linux_current.c \
linux_devres.c \
linux_dmi.c \
linux_domain.c \
linux_firmware.c \
linux_fpu.c \
linux_hrtimer.c \
linux_idr.c \
linux_interrupt.c \
linux_i2c.c \
linux_i2cbb.c \
linux_kmod.c \
linux_kthread.c \
linux_lock.c \
linux_netdev.c \
linux_page.c \
linux_pci.c \
linux_radix.c \
linux_rcu.c \
linux_seq_file.c \
linux_schedule.c \
linux_shmemfs.c \
linux_shrinker.c \
linux_skbuff.c \
linux_slab.c \
linux_tasklet.c \
linux_usb.c \
linux_work.c \
linux_xarray.c
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
${MACHINE_CPUARCH} == "i386"
SRCS+= opt_acpi.h acpi_if.h linux_acpi.c
.endif
SRCS+= ${LINUXKPI_GENSRCS}
CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include
CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include
EXPORT_SYMS= YES
.include <bsd.kmod.mk>