All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yifeng Li <tomli@tomli.me>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Yifeng Li <tomli@tomli.me>,
	stable@vger.kernel.org
Subject: [PATCH 2/8] fbdev: sm712fb: fix brightness control on reboot, don't set SR30.
Date: Sun, 17 Mar 2019 06:24:58 +0800	[thread overview]
Message-ID: <20190316222504.27170-3-tomli@tomli.me> (raw)
In-Reply-To: <20190316222504.27170-1-tomli@tomli.me>

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>
Cc: stable@vger.kernel.org  # v4.4+
---
 drivers/video/fbdev/sm712fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
index d05379affa32..a19655babf67 100644
--- a/drivers/video/fbdev/sm712fb.c
+++ b/drivers/video/fbdev/sm712fb.c
@@ -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]);
 
-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Yifeng Li <tomli@tomli.me>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Yifeng Li <tomli@tomli.me>,
	stable@vger.kernel.org
Subject: [PATCH 2/8] fbdev: sm712fb: fix brightness control on reboot, don't set SR30.
Date: Sat, 16 Mar 2019 22:24:58 +0000	[thread overview]
Message-ID: <20190316222504.27170-3-tomli@tomli.me> (raw)
In-Reply-To: <20190316222504.27170-1-tomli@tomli.me>

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>
Cc: stable@vger.kernel.org  # v4.4+
---
 drivers/video/fbdev/sm712fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
index d05379affa32..a19655babf67 100644
--- a/drivers/video/fbdev/sm712fb.c
+++ b/drivers/video/fbdev/sm712fb.c
@@ -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]);
 
-- 
2.20.1

  parent reply	other threads:[~2019-03-16 22:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16 22:24 [PATCH 0/8] fbdev: sm712fb: fix a series of lockups, crashes and gliches Yifeng Li
2019-03-16 22:24 ` Yifeng Li
2019-03-16 22:24 ` [PATCH 1/8] fbdev: sm712fb: fix white screen of death on reboot, don't set CR3B-CR3F Yifeng Li
2019-03-16 22:24   ` Yifeng Li
2019-03-31 12:18   ` Sudip Mukherjee
2019-03-31 12:18     ` Sudip Mukherjee
2019-03-31 12:18     ` Sudip Mukherjee
2019-03-16 22:24 ` Yifeng Li [this message]
2019-03-16 22:24   ` [PATCH 2/8] fbdev: sm712fb: fix brightness control on reboot, don't set SR30 Yifeng Li
2019-03-31 12:19   ` Sudip Mukherjee
2019-03-31 12:19     ` Sudip Mukherjee
2019-03-16 22:24 ` [PATCH 3/8] fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75 Yifeng Li
2019-03-16 22:24   ` Yifeng Li
2019-03-31 12:19   ` Sudip Mukherjee
2019-03-31 12:19     ` Sudip Mukherjee
2019-03-16 22:25 ` [PATCH 4/8] fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA Yifeng Li
2019-03-16 22:25   ` Yifeng Li
2019-03-31 12:19   ` Sudip Mukherjee
2019-03-31 12:19     ` Sudip Mukherjee
2019-03-16 22:25 ` [PATCH 5/8] fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM Yifeng Li
2019-03-16 22:25   ` Yifeng Li
2019-03-24 21:39   ` Sudip Mukherjee
2019-03-24 21:39     ` Sudip Mukherjee
2019-03-31 12:20   ` Sudip Mukherjee
2019-03-31 12:20     ` Sudip Mukherjee
2019-03-16 22:25 ` [PATCH 6/8] fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting Yifeng Li
2019-03-16 22:25   ` Yifeng Li
2019-03-31 12:20   ` Sudip Mukherjee
2019-03-31 12:20     ` Sudip Mukherjee
2019-03-16 22:25 ` [PATCH 7/8] fbdev: sm712fb: fix support for 1024x768-16 mode Yifeng Li
2019-03-16 22:25   ` Yifeng Li
2019-03-31 12:20   ` Sudip Mukherjee
2019-03-31 12:20     ` Sudip Mukherjee
2019-03-31 12:20     ` Sudip Mukherjee
2019-03-16 22:25 ` [PATCH 8/8] fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display Yifeng Li
2019-03-16 22:25   ` Yifeng Li
2019-03-31 12:21   ` Sudip Mukherjee
2019-03-31 12:21     ` Sudip Mukherjee
2019-03-31 12:21     ` Sudip Mukherjee
2019-03-31 12:18 ` [PATCH 0/8] fbdev: sm712fb: fix a series of lockups, crashes and gliches Sudip Mukherjee
2019-03-31 12:18   ` Sudip Mukherjee
2019-03-31 12:18   ` Sudip Mukherjee
2019-04-01 15:13   ` Bartlomiej Zolnierkiewicz
2019-04-01 15:13     ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190316222504.27170-3-tomli@tomli.me \
    --to=tomli@tomli.me \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.