]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.179/fbdev-sm712fb-fix-brightness-control-on-reboot-don-t-set-sr30.patch
Linux 4.9.179
[thirdparty/kernel/stable-queue.git] / releases / 4.9.179 / fbdev-sm712fb-fix-brightness-control-on-reboot-don-t-set-sr30.patch
CommitLineData
b0d5dadb
GKH
1From 5481115e25e42b9215f2619452aa99c95f08492f Mon Sep 17 00:00:00 2001
2From: Yifeng Li <tomli@tomli.me>
3Date: Mon, 1 Apr 2019 17:46:58 +0200
4Subject: fbdev: sm712fb: fix brightness control on reboot, don't set SR30
5
6From: Yifeng Li <tomli@tomli.me>
7
8commit 5481115e25e42b9215f2619452aa99c95f08492f upstream.
9
10On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with
11sm712fb framebuffer driver would cause the role of brightness up/down
12button to swap.
13
14Experiments showed the FPR30 register caused this behavior. Moreover,
15even if this register don't have side-effect on other systems, over-
16writing it is also highly questionable, since it was originally
17configurated by the motherboard manufacturer by hardwiring pull-down
18resistors to indicate the type of LCD panel. We should not mess with
19it.
20
21Stop writing to the SR30 (a.k.a FPR30) register.
22
23Signed-off-by: Yifeng Li <tomli@tomli.me>
24Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
25Cc: Teddy Wang <teddy.wang@siliconmotion.com>
26Cc: <stable@vger.kernel.org> # v4.4+
27Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30---
31 drivers/video/fbdev/sm712fb.c | 4 ++--
32 1 file changed, 2 insertions(+), 2 deletions(-)
33
34--- a/drivers/video/fbdev/sm712fb.c
35+++ b/drivers/video/fbdev/sm712fb.c
36@@ -1144,8 +1144,8 @@ static void sm7xx_set_timing(struct smtc
37
38 /* init SEQ register SR30 - SR75 */
39 for (i = 0; i < SIZE_SR30_SR75; i++)
40- if ((i + 0x30) != 0x62 && (i + 0x30) != 0x6a &&
41- (i + 0x30) != 0x6b)
42+ if ((i + 0x30) != 0x30 && (i + 0x30) != 0x62 &&
43+ (i + 0x30) != 0x6a && (i + 0x30) != 0x6b)
44 smtc_seqw(i + 0x30,
45 vgamode[j].init_sr30_sr75[i]);
46