drivers: ddcci: upstream DDCCI driver
PATCH v5 1/1 drivers: ddcci: upstream DDCCI driver
This patch upstreams the DDCCI driver by Christoph Grenz into the kernel. The original gitlab page is loacted at https://gitlab
.com/ddcci-driver-linux/ddcci-driver-linux/-/tree/master.
---
v2: Fix typos.
v3: Add documentation, move files around, replace semaphores with mutexes, and replaced <asm-generic/fcntl.h> with <linux/fcntl.h>. "imirkin"(which due to his involvement in the dri-devel irc channel I cant help but assume to be a DRM developer) said that the DDC/CI bus does not intefere with the buses that DRM is involved with.
v4: Move some documentation, fix grammer mistakes, remove usages of likely(), and clarify some documentation.
v5: Fix grammer mistakes, remove usages of likely(), and clarify some documentation.
--- Documentation/ABI/testing/sysfs-driver-ddcci | 37 + Documentation/driver-api/ddcci.rst | 107 + drivers/char/Kconfig | 11 + drivers/char/Makefile | 1 + drivers/char/ddcci.c | 1887 ++++++++++++++++++ drivers/video/backlight/Kconfig | 11 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/ddcci-backlight.c | 411 ++++ include/linux/ddcci.h | 164 ++ 9 files changed, 2630 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-ddcci create mode 100644 Documentation/driver-api/ddcci.rst create mode 100644 drivers/char/ddcci.c create mode 100644 drivers/video/backlight/ddcci-backlight.c create mode 100644 include/linux/ddcci.h
Documentation/ABI/testing/sysfs-driver-ddcci new file +37 -0
@@ -0,0 +1,37 @@ +What: /sys/bus/ddcci/ddcci<I²C bus number>i<hex address> +Date: February 2022 +KernelVersion: 5.17 +Contact: Yusuf Khan <[email protected]> +Description: This file is a internal dependent device on the I2C bus, + it exports the same data that the main device exports. + +What: /sys/bus/ddcci/ddcci<I²C bus number>e<hex address> +Date: February 2022 +KernelVersion: 5.17 +Contact: Yusuf Khan <[email protected]> +Description: This file is a external dependent device on the I2C bus, + it exports the same data that the main device exports. + +What: /sys/bus/ddcci/ddcci<I²C bus number> +Date: February 2022 +KernelVersion: 5.17 +Contact: Yusuf Khan <[email protected]> +Description: This file is the main device on the I2C bus, it exports + the following peices of information about the device, capabilities + which is a full ACCESS.bus capabilities string(see the ACCESS.bus + specification for more info), idProt, which is a full ACCESS.bus + protocol supported by the device(Usually "monitor"), idType, + a ACCESS.buss device subtype(Usually "LCD" or "CRT"), idModel, a + ACCESS.bus device model identifier(Usually a shortened form of the + device model name), idVendor, a ACCESS.bus device vendor identifier + (Empty if the Identification command is not supported), idModule, + a ACCESS.bus device module identifier(Empty if the Identification + command is not supported), idSerial, a 32 bit device number + a fixed serial number if it's positive, a temporary serial number + if negative and zero if the Identification command is not supported, + and modalias, a combined identifier for driver selection, + it has the form ddcci:<idProt>-<idType>-<idModel>-<idVendor>-<idModule>, + All non-alphanumeric characters (including whitespace) in the model, + vendor or module parts are replaced by underscores to prevent issues + with software like systemd-udevd. See Documentation/misc-devices/ddcci.rst + for more information on DDC/CI.
Documentation/driver-api/ddcci.rst new file +107 -0
107 lines not on this page · raw message
drivers/char/Kconfig +11 -0
@@ -451,4 +451,15 @@ config RANDOM_TRUST_BOOTLOADER pool. Otherwise, say N here so it will be regarded as device input that only mixes the entropy pool. +config DDCCI + tristate "DDCCI display protocol support" + depends on I2C + help + Display Data Channel Command Interface is an + interface that allows the kernel to "talk" + to most displays made after 2005. Check your + display's specification to see if it has + support for this. This depends on I2C to + compile. + endmenu
drivers/char/Makefile +1 -0
@@ -3,6 +3,7 @@ # Makefile for the kernel character device drivers. # +obj-$(CONFIG_DDCCI) += ddcci.o obj-y += mem.o random.o obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o obj-y += misc.o
drivers/char/ddcci.c new file +1887 -0
1,887 lines not on this page · raw message
drivers/video/backlight/Kconfig +11 -0
@@ -289,6 +289,17 @@ config BACKLIGHT_QCOM_WLED If you have the Qualcomm PMIC, say Y to enable a driver for the WLED block. Currently it supports PM8941 and PMI8998. +config BACKLIGHT_DDCCI + tristate "DDCCI Backlight Driver" + depends on DDCCI + help + If you have a DDC/CI supporing monitor, say Y to enable a driver + to control its backlight using DDC/CI. This could be useful if + your monitor does not include a backlight driver. For this to be + useful you need to enable DDCCI support which can be found in + Device Drivers -> Character devices and that further depends on + I2C. + config BACKLIGHT_RT4831 tristate "Richtek RT4831 Backlight Driver" depends on MFD_RT4831
drivers/video/backlight/Makefile +1 -0
@@ -58,3 +58,4 @@ obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o obj-$(CONFIG_BACKLIGHT_RAVE_SP) += rave-sp-backlight.o obj-$(CONFIG_BACKLIGHT_LED) += led_bl.o +obj-$(CONFIG_BACKLIGHT_DDCCI) += ddcci-backlight.o
drivers/video/backlight/ddcci-backlight.c new file +411 -0
411 lines not on this page · raw message
include/linux/ddcci.h new file +164 -0
164 lines not on this page · raw message
Signature · 1 line
2.25.1