This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: PWM issue in kernel v3.14

Part Number: AM3352

Tool/software: Linux

I am using VAR-SOM-AM33 device with kernel (3.14.26) and device tree provided by Varisce in Yocto Daisy image (Variscite FTP). My wish is to use PWM device with passive buzzer and for this I want to change device tree configuration for PWM-backlight and use buzzer on this PIN instead of backlight. What I can not understand is why PWM-backlight is not working immediately without any changes in device tree. I followed instructions for controlling backlight (AM335x_PWM_Driver's_Guide), output voltage on LCD connector j29 PIN #3 is 3V, but PWM  is not working (tested with oscilloscope).

Device tree Kernel 3.14.26:

		backlight_pins {
			pinctrl-single,pins = <0x19c 0x4>;
		};
	
	backlight {
		compatible = "pwm-backlight";
		pwms = <0x53 0x0 0xc350 0x1>;
		brightness-levels = <0x0 0x3a 0x3d 0x42 0x4b 0x5a 0x7d 0xaa 0xff>;
		default-brightness-level = <0x8>;
		power-supply = <0x54>;
	};
	
		epwmss@48304000 {
			compatible = "ti,am33xx-pwmss";
			reg = <0x48304000 0x10>;
			ti,hwmods = "epwmss2";
			#address-cells = <0x1>;
			#size-cells = <0x1>;
			status = "okay";
			ranges = <0x48304100 0x48304100 0x80 0x48304180 0x48304180 0x80 0x48304200 0x48304200 0x80>;

			ecap@48304100 {
				compatible = "ti,am33xx-ecap";
				#pwm-cells = <0x3>;
				reg = <0x48304100 0x80>;
				ti,hwmods = "ecap2";
				status = "okay";
				linux,phandle = <0x53>;
				phandle = <0x53>;
			};

			ehrpwm@48304200 {
				compatible = "ti,am33xx-ehrpwm";
				#pwm-cells = <0x3>;
				reg = <0x48304200 0x80>;
				ti,hwmods = "ehrpwm2";
				status = "disabled";
			};
		};
		
	fixedregulator@4 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_bl";
		gpio = <0x2f 0x2 0x0>;
		regulator-always-on;
		regulator-boot-on;
		enable-active-high;
		linux,phandle = <0x54>;
		phandle = <0x54>;
	};

If I do the same with new Yocto image and Kernel 4.4.19 output voltage on LCD connector j29 PIN #3 is 3V and PWM  is working without problem (tested with oscilloscope).

Device tree Kernel 4.4.19:

					backlight_pins {
						pinctrl-single,pins = <0x150 0x3>;
						linux,phandle = <0x4f>;
						phandle = <0x4f>;
					};

	backlight {
		compatible = "pwm-backlight";
		pwms = <0x61 0x0 0xc350 0x0>;
		brightness-levels = <0x0 0x3a 0x3d 0x42 0x4b 0x5a 0x7d 0xaa 0xff>;
		default-brightness-level = <0x8>;
	};
	
			epwmss@48300000 {
			compatible = "ti,am33xx-pwmss";
			reg = <0x48300000 0x10>;
			ti,hwmods = "epwmss0";
			#address-cells = <0x1>;
			#size-cells = <0x1>;
			status = "okay";
			ranges = <0x48300100 0x48300100 0x80 0x48300180 0x48300180 0x80 0x48300200 0x48300200 0x80>;

			ecap@48300100 {
				compatible = "ti,am33xx-ecap";
				#pwm-cells = <0x3>;
				reg = <0x48300100 0x80>;
				interrupts = <0x1f>;
				interrupt-names = "ecap0";
				status = "disabled";
			};

			pwm@48300200 {
				compatible = "ti,am33xx-ehrpwm";
				#pwm-cells = <0x3>;
				reg = <0x48300200 0x80>;
				clocks = <0x4e>;
				clock-names = "tbclk";
				status = "okay";
				pinctrl-names = "default";
				pinctrl-0 = <0x4f>;
				linux,phandle = <0x61>;
				phandle = <0x61>;
			};
		};

Could someone please help me to understand why PWM-Backlight with old device tree and kernel is not working and maybe give me some direction what I have to change in device tree to use passive buzzer on this PIN.

Thanks!

  • Hello Tadej,

    What is this hexadecimal indexing here default-brightness-level = <0x8>; it should be decimal.

    Best regards,
    Kemal

  • Hello Kemal,

    thank you for your answer.

    I have converted original DTB file to DTS with device-tree-compiler and I think that is why every values are represented as hexadecimal. Unfortunately I didn't get original DTS file with all include DTSI files together with Variscite Yocto_daisy_1.6_V37_no_touchscreen_calibration Linux image.

    I don't think that has something to do with not working PWM device. As you can see values from newer DTS file, that was included in Varicite Yocto-krogoth-2.1 Linux image, are also represented as hexadecimal and PWM device is working.

    Problem is that I have to use older kernel that was provided with Variscite Yocto_daisy_1.6_V37_no_touchscreen_calibration Linux image.

    Do you see maybe some other errors in Device tree for Linux kernel 3.14.26?

    Thanks!

  • The addresses are different, you are using epwmss2 in old kernel and epwmss0 in new kernel.