| 155 | === Troubleshooting Backlight Portion === |
| 156 | In some cases the device tree node used by the linux {{{pwm-backlight}}} driver may need to be adjusted if |
| 157 | "flickering" exists ([https://i.stack.imgur.com/LF3Y4.jpg example]). This phenomenon is caused by a pwm frequency setting that is too low for the connected display's backlight which creates a visual artifact that may be detectable by the human eye. |
| 158 | |
| 159 | As described in the pwm device tree bindings [https://raw.githubusercontent.com/torvalds/linux/master/Documentation/devicetree/bindings/pwm/pwm.txt documentation], the backlight node of the device tree has a property labelled {{{pwms}}}. This property has includes the {{{pwm-specifier}}} which typically encodes the chip-relative PWM number and the PWM |
| 160 | period in nanoseconds. |
| 161 | {{{ |
| 162 | backlight { |
| 163 | compatible = "pwm-backlight"; |
| 164 | pwms = <&pwm1 0 5000000>; /* 1 / (5000000 / 1000000000) = 200 Hz */ |
| 165 | brightness-levels = < |
| 166 | 0 1 2 3 4 5 6 7 8 9 |
| 167 | 10 11 12 13 14 15 16 17 18 19 |
| 168 | 20 21 22 23 24 25 26 27 28 29 |
| 169 | 30 31 32 33 34 35 36 37 38 39 |
| 170 | 40 41 42 43 44 45 46 47 48 49 |
| 171 | 50 51 52 53 54 55 56 57 58 59 |
| 172 | 60 61 62 63 64 65 66 67 68 69 |
| 173 | 70 71 72 73 74 75 76 77 78 79 |
| 174 | 80 81 82 83 84 85 86 87 88 89 |
| 175 | 90 91 92 93 94 95 96 97 98 99 |
| 176 | 100 |
| 177 | >; |
| 178 | default-brightness-level = <100>; |
| 179 | }; |
| 180 | }}} |
| 181 | |
| 182 | If you want to make an adjustment to this frequency, you can use the {{{fixfdt}}} script in the bootloader. For example, to change the backlight frequency to {{{10kHz}}} you would run the following command from the bootloader: |
| 183 | {{{#!bash |
| 184 | # The third value of the pwms property is in nanoseconds so to convert to Hz: |
| 185 | # 1 / (100000 / 1000000000) = 10 kHz |
| 186 | setenv fixfdt "fdt addr ${fdt_addr}; fdt set /backlight pwms <0x3d 0 100000>" |
| 187 | }}} |
| 188 | |