lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1541170556-75032-2-git-send-email-michal.vokac@ysoft.com>
Date:   Fri, 2 Nov 2018 14:56:35 +0000
From:   Vokáč Michal <Michal.Vokac@...ft.com>
To:     Rob Herring <robh+dt@...nel.org>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
CC:     "linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Jyri Sarha <jsarha@...com>,
        Vokáč Michal <Michal.Vokac@...ft.com>
Subject: [PATCH fbdev-for-next 2/2] video: ssd1307fb: Add support for the
 reset-active-low property

The SSD130x OLED display reset signal is active low. Now the reset
sequence is implemented in such a way that DTS authors are forced to
define the reset-gpios property with GPIO_ACTIVE_HIGH to make the reset
work.

Add the reset-active-low property so the signal is inverted once again
and the GPIO_ACTIVE_LOW work as expected.

Signed-off-by: Michal Vokáč <michal.vokac@...ft.com>
---
 drivers/video/fbdev/ssd1307fb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index e7ae135..790f1c4 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -608,6 +608,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 	struct fb_deferred_io *ssd1307fb_defio;
 	u32 vmem_size;
 	struct ssd1307fb_par *par;
+	bool reset_active_low;
 	u8 *vmem;
 	int ret;
 
@@ -671,6 +672,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 	par->com_seq = of_property_read_bool(node, "solomon,com-seq");
 	par->com_lrremap = of_property_read_bool(node, "solomon,com-lrremap");
 	par->com_invdir = of_property_read_bool(node, "solomon,com-invdir");
+	reset_active_low = of_property_read_bool(node, "reset-active-low");
 
 	par->contrast = 127;
 	par->vcomh = par->device_info->default_vcomh;
@@ -728,9 +730,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
 
 	if (par->reset) {
 		/* Reset the screen */
-		gpiod_set_value_cansleep(par->reset, 0);
+		gpiod_set_value_cansleep(par->reset, reset_active_low);
 		udelay(4);
-		gpiod_set_value_cansleep(par->reset, 1);
+		gpiod_set_value_cansleep(par->reset, !reset_active_low);
 		udelay(4);
 	}
 
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ