drm: Add support for backlight control of eDP panel on ti-sn65dsi86 bridge
Subsystems (5)
v2 cover drm: Add support for backlight control of eDP panel on ti-sn65dsi86 bridge
The backlight level of an eDP panel can be controlled through the AUX channel using DPCD registers of the panel.
The capability for the Source device to adjust backlight characteristics within the panel, using the Sink device DPCD registers is indicated by the TCON_BACKLIGHT_ADJUSTMENT_CAPABLE bit in the EDP_GENERAL_CAPABILITY_1 register (DPCD Address 701h, bit0). In this configuration, the eDP TCON receives the backlight level information from the host, through the AUX channel.
Anderson's patch series [1] exposed the DDC bus from ti-sn65dsi86 bridge, that gives an option to move the backlight control out of the bridge and to create a separate backlight driver.
Changes in v2:
- Created a new DisplayPort aux backlight driver and moved the code from drm_dp_aux_backlight.c (v1) to the new driver.
- Removed the changes done in ti-sn65dsi86 bridge. (Rob Herring)
[1] https://lore.kernel.org/dri-devel/[email protected]/
Rajeev Nandan (2):
dt-bindings: backlight: add DisplayPort aux backlight
backlight: Add DisplayPort aux backlight driver
.../bindings/leds/backlight/dp-aux-backlight.yaml | 49 +++++ drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/dp_aux_backlight.c | 245 +++++++++++++++++++++ 4 files changed, 302 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml create mode 100644 drivers/video/backlight/dp_aux_backlight.c
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/2 dt-bindings: backlight: add DisplayPort aux backlight
Add bindings for DisplayPort aux backlight driver.
Changes in v2:
- New
--- .../bindings/leds/backlight/dp-aux-backlight.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml
Documentation/devicetree/bindings/leds/backlight/dp-aux-backlight.yaml new file +49 -0
@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/dp-aux-backlight.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: DisplayPort aux backlight driver bindings + +maintainers: + - Rajeev Nandan <[email protected]> + +description: + Backlight driver to control the brightness over DisplayPort aux channel. + +allOf: + - $ref: common.yaml# + +properties: + compatible: + const: dp-aux-backlight + + ddc-i2c-bus: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the system I2C controller connected to the DDC bus used + for the DisplayPort AUX channel. + + enable-gpios: + maxItems: 1 + description: GPIO specifier for backlight enable pin. + + max-brightness: true + +required: + - compatible + - ddc-i2c-bus + +additionalProperties: false + +examples: + - | + backlight { + compatible = "dp-aux-backlight"; + ddc-i2c-bus = <&sn65dsi86_bridge>; + enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + max-brightness = <2047>; + }; + +...
Signature · 1 line
2.7.4
PATCH v2 2/2 backlight: Add DisplayPort aux backlight driver
In reply to Rajeev NandanAdd backlight driver for the panels supporting backlight control using DPCD registers on the DisplayPort aux channel.
Changes in v2:
- New (most of the code reused from drm_dp_aux_backlight.c of v1)
--- drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/dp_aux_backlight.c | 245 +++++++++++++++++++++++++++++ 3 files changed, 253 insertions(+) create mode 100644 drivers/video/backlight/dp_aux_backlight.c
drivers/video/backlight/Kconfig +7 -0
@@ -456,6 +456,13 @@ config BACKLIGHT_LED If you have a LCD backlight adjustable by LED class driver, say Y to enable this driver. +config BACKLIGHT_DP_AUX + tristate "DisplayPort aux backlight driver" + depends on DRM && DRM_KMS_HELPER + help + If you have a panel backlight controlled by DPCD registers + on the DisplayPort aux channel, say Y to enable this driver. + endif # BACKLIGHT_CLASS_DEVICE endmenu
drivers/video/backlight/Makefile +1 -0
@@ -57,3 +57,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_DP_AUX) += dp_aux_backlight.o
drivers/video/backlight/dp_aux_backlight.c new file +245 -0
245 lines not on this page · raw message
Signature · 1 line
2.7.4
kernel test robot
build botRe: [v2 2/2] backlight: Add DisplayPort aux backlight driver
Thank you for the patch! Yet something to improve:
Hi Rajeev,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on drm-intel/for-linux-next drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next v5.12-rc8 next-20210423] [cannot apply to drm/drm-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Rajeev-Nandan/drm-Add-support-for-backlight-control-of-eDP-panel-on-ti-sn65dsi86-bridge/20210424-055607 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next config: mips-allmodconfig (attached as .config) compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8ecbdba09ae9869fe35ca8a17a76ef414eeb7edd
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Rajeev-Nandan/drm-Add-support-for-backlight-control-of-eDP-panel-on-ti-sn65dsi86-bridge/20210424-055607 git checkout 8ecbdba09ae9869fe35ca8a17a76ef414eeb7edd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=mips
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from include/linux/kallsyms.h:13,
from include/linux/ftrace.h:12,
from include/linux/kprobes.h:29,
from include/linux/kgdb.h:19,
from include/linux/fb.h:5,
from include/linux/backlight.h:13,
from drivers/video/backlight/dp_aux_backlight.c:6:
>> include/linux/module.h:241:1: error: expected ',' or ';' before 'extern'
241 | extern typeof(name) __mod_##type##__##name##_device_table \
| ^~~~~~
drivers/video/backlight/dp_aux_backlight.c:231:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
231 | MODULE_DEVICE_TABLE(of, dp_aux_bl_of_match_table);
| ^~~~~~~~~~~~~~~~~~~vim +241 include/linux/module.h
^1da177e4c3f41 Linus Torvalds 2005-04-16 237 cff26a51da5d20 Rusty Russell 2014-02-03 238 #ifdef MODULE cff26a51da5d20 Rusty Russell 2014-02-03 239 /* Creates an alias so file2alias.c can find device table. */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 240 #define MODULE_DEVICE_TABLE(type, name) \ 0bf8bf50eddc75 Matthias Kaehlcke 2017-07-24 @241 extern typeof(name) __mod_##type##__##name##_device_table \ cff26a51da5d20 Rusty Russell 2014-02-03 242 __attribute__ ((unused, alias(__stringify(name)))) cff26a51da5d20 Rusty Russell 2014-02-03 243 #else /* !MODULE */ cff26a51da5d20 Rusty Russell 2014-02-03 244 #define MODULE_DEVICE_TABLE(type, name) cff26a51da5d20 Rusty Russell 2014-02-03 245 #endif ^1da177e4c3f41 Linus Torvalds 2005-04-16 246
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [v2 2/2] backlight: Add DisplayPort aux backlight driver
In reply to Rajeev NandanQuoted 5 lines · Rajeev Nandan
Add backlight driver for the panels supporting backlight control using DPCD registers on the DisplayPort aux channel.
Changes in v2:
- New (most of the code reused fromdrm_dp_aux_backlight.cof v1)
Did you respond to Jani's feedback on the v1 posting (asking you to coordinate with Lyude's work on refactoring the i915 eDP helpers[1])? I can't find anything showing the outcome of that.
[1]: https://www.spinics.net/lists/dri-devel/msg295602.html
Quoted 4 lines
drivers/video/backlight/dp_aux_backlight.c new file +4
-0+static struct drm_dp_aux *i2c_to_aux (struct i2c_adapter *i2c) +{ + return container_of(i2c, struct drm_dp_aux, ddc); +}
[...]
drivers/video/backlight/dp_aux_backlight.c line 177
Quoted 13 lines
drivers/video/backlight/dp_aux_backlight.c new file +13
-0+ np =of_parse_phandle (pdev->dev.of_node,"ddc-i2c-bus" ,0 ); +if (!np) { +dev_err (&pdev->dev,"failed to get aux ddc I2C bus\n" ); +return -ENODEV ; + } + + ddc =of_find_i2c_adapter_by_node (np); +of_node_put (np); +if (!ddc) +return -EPROBE_DEFER ; + + aux_bl->aux =i2c_to_aux (ddc); +dev_dbg (&pdev->dev,"using dp aux %s\n" , aux_bl->aux->name);
It looks like this code "just knows" that the I2C controller it has looked up is a special one. That seems a little odd to me.
If we "just know" this then I'd hope that is could either be modelled in the devicetree or that it would be possible for the backlight driver to be registered (possibly using helpers) by whatever it is that is setting up struct drm_dp_aux in the first place.
Daniel.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel