Panel unable to use atmel,hlcdc-pwm for backlight

Peter Rosin peda at axentia.se
Mon Sep 26 19:35:43 UTC 2016


Hi!

I'm trying to attach a simpel-panel to an atmel,sama5d3-hlcdc
controller. See below for the parts of my .dts that I find
relevant.

When I boot with this, I run into a problem. What I think
happens is that the hlcdc probe fails because the panel
probe fails because the backlight probe fails because the
pwm probe fails because the hlcdc probe hasn't completed
yet. I.e. a circular dependency.

I get this in log (twice, with some other stuff in between): 

atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to create HLCDC outputs: -517
atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to initialize mode setting

-517 is of course -EPROBE_DEFER

If I comment out the problematic backlight line from the
panel node (and fiddle with the devices that control the
backlight manually in sysfs) I can get things to work. But
that's not very elegant.

Would it be possible to have the hlcdc code somehow "publish"
the hlcdc-pwm before it tries to fire up the output panel?
Assuming my analysis is correct, of course...

Cheers,
Peter

/dts-v1/;

#include "sama5d3.dtsi"
#include "sama5d3_lcd.dtsi"

/ {
	panel_reg: panel-regulator {
		compatible = "regulator-fixed";
		regulator-name = "panel-VCC";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};
		
	bl_reg: backlight-regulator {
		compatible = "regulator-fixed";
		regulator-name = "panel-VDD";
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
	};

	/*
	 * the panel has a backlight that needs 12V, and a pwm
	 * controls the intensity. A gpio (PD0) is used to enable it.
	 */
	panel_bl: backlight {
		compatible = "pwm-backlight";
		pwms = <&hlcdc_pwm 0 1000000 0>;

		brightness-levels = <0 20 40 60 80 100>;
		default-brightness-level = <2>;

		power-supply = <&bl_reg>;
		enable-gpios = <&pioD 0 GPIO_ACTIVE_HIGH>;
	};

	panel: panel {
		compatible = "some-simple-panel-with-pwm-backlight";
/* problem */	backlight = <&panel_bl>;
		power-supply = <&panel_reg>;

		port {
			panel_input: endpoint {
				remote-endpoint = <&hlcdc_panel_output>;
			};
		};
	};
};

&hlcdc {
	status = "okay";
};

&hlcdc_panel_output {
	remote-endpoint = <&panel_input>;
};


More information about the dri-devel mailing list