fbdev: sm712fb: fix brightness control on reboot, don't set SR30
authorYifeng Li <tomli@tomli.me>
Mon, 1 Apr 2019 15:46:58 +0000 (17:46 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 1 Apr 2019 15:46:58 +0000 (17:46 +0200)
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with
sm712fb framebuffer driver would cause the role of brightness up/down
button to swap.

Experiments showed the FPR30 register caused this behavior. Moreover,
even if this register don't have side-effect on other systems, over-
writing it is also highly questionable, since it was originally
configurated by the motherboard manufacturer by hardwiring pull-down
resistors to indicate the type of LCD panel. We should not mess with
it.

Stop writing to the SR30 (a.k.a FPR30) register.

Signed-off-by: Yifeng Li <tomli@tomli.me>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/sm712fb.c

index d05379affa322cfc1dc6c896edfab4fb60b8e8f6..a19655babf670592be30e86bd64c82cb7426968a 100644 (file)
@@ -1145,8 +1145,8 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
 
                /* init SEQ register SR30 - SR75 */
                for (i = 0; i < SIZE_SR30_SR75; i++)
-                       if ((i + 0x30) != 0x62 && (i + 0x30) != 0x6a &&
-                           (i + 0x30) != 0x6b)
+                       if ((i + 0x30) != 0x30 && (i + 0x30) != 0x62 &&
+                           (i + 0x30) != 0x6a && (i + 0x30) != 0x6b)
                                smtc_seqw(i + 0x30,
                                          vgamode[j].init_sr30_sr75[i]);