drivers: ddcci: upstream DDCCI driver
v9 cover drivers: ddcci: upstream DDCCI driver
This patch upstreams(adds) 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.
DDC/CI is a control protocol for monitor settings supported by most monitors since about 2005. A chardev and sysfs interface is provided. The seccond patch in this series provides a backlight driver using DDC/CI.
---
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.
v6: Change contact information to reference Christoph Grenz.
v7: Remove all instances of the unlikely() macro.
v8: Modify documentation to provide updated date and kernel documentation, fix SPDX lines, use isalpha instead of redefining logic, change maximum amount of bytes that can be written to be conformant with DDC/CI specification, prevent userspace from holding locks with the open file descriptor, remove ddcci_cdev_seek, dont refine sysfs_emit() logic, use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL, remove ddcci_device_remove_void, remove module paramaters and version, and split into 2 patches.
v9: Fix IS_ANY_ID matching for compilers and archs where char is unsigned char and use the cannonical patch format.
Patch 1: Add the main DDCCI component.
Patch 2: Add the backlight driver that utilizes DDCCI.
Patch 3: Add documentation for the DDCCI drivers.
Yusuf Khan (3):
drivers: ddcci: upstream DDCCI driver
drivers: ddcci: upstream DDCCI driver
drivers: ddcci: upstream DDCCI driver
Documentation/ABI/testing/sysfs-driver-ddcci | 57 + Documentation/driver-api/ddcci.rst | 122 ++ drivers/char/Kconfig | 11 + drivers/char/Makefile | 1 + drivers/char/ddcci.c | 1805 ++++++++++++++++++ drivers/video/backlight/Kconfig | 11 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/ddcci-backlight.c | 411 ++++ include/linux/ddcci.h | 163 ++ 9 files changed, 2582 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
Signature · 1 line
2.25.1
PATCH v9 1/3 drivers: ddcci: upstream DDCCI driver
This patch adds the main DDCCI driver.
--- drivers/char/Kconfig | 11 + drivers/char/Makefile | 1 + drivers/char/ddcci.c | 1805 +++++++++++++++++++++++++++++++++++++++++ include/linux/ddcci.h | 163 ++++ 4 files changed, 1980 insertions(+) create mode 100644 drivers/char/ddcci.c create mode 100644 include/linux/ddcci.h
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 +1805 -0
1,805 lines not on this page · raw message
include/linux/ddcci.h new file +163 -0
163 lines not on this page · raw message
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 5 lines · Yusuf Khan
This patch adds the main DDCCI driver.
Signed-off-by Yusuf Khan <[email protected]>Signed-off-by Christoph Grenz <[email protected]>---
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change.
- You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot
PATCH v9 2/3 drivers: ddcci: upstream DDCCI driver
In reply to Yusuf KhanThis patch adds the backlight driver that utilizes the DDCCI protocol to add backlight support.
--- drivers/video/backlight/Kconfig | 11 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/ddcci-backlight.c | 411 ++++++++++++++++++++++ 3 files changed, 423 insertions(+) create mode 100644 drivers/video/backlight/ddcci-backlight.c
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
Signature · 1 line
2.25.1
PATCH v9 3/3 drivers: ddcci: upstream DDCCI driver
In reply to Yusuf KhanThis patch adds Documentation for the DDCCI driver.
--- Documentation/ABI/testing/sysfs-driver-ddcci | 57 +++++++++ Documentation/driver-api/ddcci.rst | 122 +++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-ddcci create mode 100644 Documentation/driver-api/ddcci.rst
Documentation/ABI/testing/sysfs-driver-ddcci new file +57 -0
@@ -0,0 +1,57 @@ +What: /sys/bus/ddcci/ddcci<I²C bus number>i<hex address> +Date: March 2022 +KernelVersion: 5.18 +Contact: Christoph Grenz <[email protected]> +Description: This file is a user interface for an internal + dependent device on the I2C bus, it exports the same + information as the master device(/sys/bus/ddcci/ + ddcci<I²C bus number>) that is referenced in this + document. + +What: /sys/bus/ddcci/ddcci<I²C bus number>e<hex address> +Date: March 2022 +KernelVersion: 5.18 +Contact: Christoph Grenz <[email protected]> +Description: This file is a user interface for an external + dependent device on the I2C bus, it exports the same + information as the master device(/sys/bus/ddcci/ + ddcci<I²C bus number>) that is referenced in this + document. + +What: /sys/bus/ddcci/ddcci<I²C bus number> +Date: March 2022 +KernelVersion: 5.18 +Contact: Christoph Grenz <[email protected]> +Description: This file provides the user interface for the + master device on the I2C bus. It exports the following + peices of information: + - idProt + ACCESS.bus protocol supported by the device. Usually + "monitor". + + - idType + ACCESS.bus device subtype. Usually "LCD" or "CRT". + + - idModel + ACCESS.bus device model identifier. Usually a + shortened form of the device model name. + + - idVendor + ACCESS.bus device vendor identifier. Empty if the + Identification command is not supported. + + - idModule + ACCESS.bus device module identifier. Empty if the + Identification command is not supported. + + - idSerial + 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. + + - 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.
Documentation/driver-api/ddcci.rst new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 39 lines · Yusuf Khan
This patch upstreams(adds) 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.DDC/CI is a control protocol for monitor settings supported by most monitors since about 2005. A chardev and sysfs interface is provided. The seccond patch in this series provides a backlight driver using DDC/CI.
Signed-off-by Yusuf Khan <[email protected]>Signed-off-by Christoph Grenz <[email protected]>---
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.v6: Change contact information to reference Christoph Grenz.
v7: Remove all instances of the
unlikely()macro.v8: Modify documentation to provide updated date and kernel documentation, fix SPDX lines, use isalpha instead of redefining logic, change maximum amount of bytes that can be written to be conformant with DDC/CI specification, prevent userspace from holding locks with the open file descriptor, remove
ddcci_cdev_seek, dont refinesysfs_emit()logic, useEXPORT_SYMBOL_GPLinstead ofEXPORT_SYMBOL, removeddcci_device_remove_void, remove module paramaters and version, and split into 2 patches.
Quoted 3 lines
v9: Fix
IS_ANY_IDmatching for compilers and archs where char is unsigned char and use the cannonical patch format.Reported-by kernel test robot <[email protected]>
You sent 3 patches with all the same subject line, yet they did different things. That's not ok at all. Please read the kernel documentation for how to write proper subject lines.
thanks,
greg k-h