devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Vokáč Michal" <Michal.Vokac@ysoft.com>
To: Rob Herring <robh+dt@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: "linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Jyri Sarha" <jsarha@ti.com>,
	"Vokáč Michal" <Michal.Vokac@ysoft.com>
Subject: [PATCH fbdev-for-next 2/2] video: ssd1307fb: Add support for the reset-active-low property
Date: Fri, 2 Nov 2018 14:56:35 +0000	[thread overview]
Message-ID: <1541170556-75032-2-git-send-email-michal.vokac@ysoft.com> (raw)
In-Reply-To: <1541170556-75032-1-git-send-email-michal.vokac@ysoft.com>

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@ysoft.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


  reply	other threads:[~2018-11-02 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 14:56 [PATCH fbdev-for-next 1/2] dt-bindings: display: ssd1307fb: Add reset-active-low property Vokáč Michal
2018-11-02 14:56 ` Vokáč Michal [this message]
2018-11-12 16:55   ` [PATCH fbdev-for-next 2/2] video: ssd1307fb: Add support for the " Rob Herring
2018-11-19 15:12     ` Vokáč Michal
2018-11-19 22:32       ` Rob Herring
2018-11-26 12:25         ` Vokáč Michal
2018-11-26 13:49           ` Rob Herring
2018-11-26 14:20             ` Vokáč Michal

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=1541170556-75032-2-git-send-email-michal.vokac@ysoft.com \
    --to=michal.vokac@ysoft.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jsarha@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).