[Letux-kernel] FYI: backlight pwm issues

H. Nikolaus Schaller hns at goldelico.com
Wed May 11 17:21:33 CEST 2016


Just FYI, a known issue (http://projects.goldelico.com/p/gta04-kernel/issues/689/):

there seems to be something wrong with the dmtimer pwm backlight driver.

If we have brightness 10 (100%) the display panel backlight is approx. half the intensity of
setting the pin to gpio and "1".

This means max. backlight brightness does not permanently turn on the pwm output.

I see the same effect on OMAP3 GTA04.

BR,
Nikolaus

New script to test backlight on Pyra in pwm or gpio mode:

To notice the difference, type:
/root/bl 1
/root/bl -g 1

#
# /root/bl: turn on/off backlight power
# -g: use gpio mode
# 1: turn on
# 0: turn off
#
# intensity can be controlled in non-gpio mode through
#    /sys/class/backlight/backlight/brightness
#

BL=/sys/class/backlight/backlight/bl_power	# just turn completely on/off instead of writing backlight intensity
ON=0
OFF=1

case $(cat /proc/device-tree/model) in
	Pyra-Handheld* )
		[ "$(which devmem2)" ] || apt-get install -y --force-yes devmem2
		if [ "$1" = -g ]
			then
			shift
			devmem2 0x4a0028f6 h 0x011e >/dev/null	# switch to gpio mode
			echo 190 > /sys/class/gpio/export 2>/dev/null
			echo out > /sys/class/gpio/gpio190/direction
			BL=/sys/class/gpio/gpio190/value
			ON=1
			OFF=0
		else
			if [ -r /sys/class/gpio/gpio190 ]
			then
				echo in > /sys/class/gpio/gpio190/direction
				echo 190 > /sys/class/gpio/unexport 2>/dev/null
			fi
			devmem2 0x4a0028f6 h 0x0118 >/dev/null	# switch to timer9_pwm mode
		fi
		;;
esac

if [ "$1" = 1 ]
then
	echo $ON >$BL
else
	echo $OFF >$BL
fi



More information about the Letux-kernel mailing list