how to control the backlight

Hi everybody,

I have just started with LP zero after a long history with other ARM based systems, but mostly using very old kernels, like 2.6

I tried both an as-is downloaded image of the whole filesystem and have built one using buildroot. Kernel 4.14 with:
CONFIG_BACKLIGHT_PWM=y
CONFIG_PWM=y
CONFIG_PWM_SYSFS=y
CONFIG_PWM_SUN4I=y
I can load the lcd.ko module, but the directories /sys/class/pwm and /sys/class/backlight/ are empty with either kernel. The PWM is running at some level, started by u-boot, but how do I control it from Linux?
Thanks.

OK, a little more info. PWM was disabled in the device tree. So I have added stuff copied from sun8i-v3s-licheepi-zero-with-lcd.dtsi and rebuilt the dtb file. Now the driver loads, but as a result the backlight is turned off completely even though the value in /sys/devices/platform/backlight/backlight/backlight/actual_brightness is 6 - the maximum.
What am I doing wrong?