Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] fbdev: ssd1307fb: Fix activating the charge pump on ssd1306
@ 2016-02-01 15:03 Kai Ruhnau
  2016-02-02  8:43 ` Kai Ruhnau
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Ruhnau @ 2016-02-01 15:03 UTC (permalink / raw)
  To: linux-fbdev

The charge pump is activated by sending 0x14 where the higher bit is
always 1 and the lower bit actually toggles it.

Signed-off-by: Kai Ruhnau <kai.ruhnau@target-sg.com>
---
 drivers/video/fbdev/ssd1307fb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index fa34808..20d249f 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -285,7 +285,7 @@ static void ssd1307fb_deferred_io(struct fb_info *info,
 static int ssd1307fb_init(struct ssd1307fb_par *par)
 {
        int ret;
-       u32 precharge, dclk, com_invdir, compins;
+       u32 precharge, dclk, com_invdir, compins, chargepump;

        if (par->device_info->need_pwm) {
                par->pwm = pwm_get(&par->client->dev, NULL);
@@ -388,8 +388,8 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
        if (ret < 0)
                return ret;

-       ret = ssd1307fb_write_cmd(par->client,
-               (par->device_info->need_chargepump & 0x1 << 2) & 0x14);
+       chargepump = 0x10 | (par->device_info->need_chargepump & 0x1) << 2;
+       ret = ssd1307fb_write_cmd(par->client, chargepump);
        if (ret < 0)
                return ret;

--
2.4.3

--
Kai Ruhnau
Software Manager
T:+49 202 769302 19

Target Systemelektronik GmbH & Co. KG
Heinz-Fangman-Straße 4
42287 Wuppertal

Amtsgericht Wuppertal HRA 23898
Persönlich haftende Gesellschafterin
Target Systemelektronik Beteiligungs GmbH
Heinz-Fangman-Straße 4, 42287 Wuppertal
Amtsgericht Wuppertal HRB 25346
Geschäftsführer: Jürgen Stein
--

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-02  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-01 15:03 [PATCH] fbdev: ssd1307fb: Fix activating the charge pump on ssd1306 Kai Ruhnau
2016-02-02  8:43 ` Kai Ruhnau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox