[PATCHv5 09/11] fbdev: ssd1307fb: Add module parameter to set the initial contrast

From: Thomas NiederprÃm
Date: Tue Mar 24 2015 - 17:21:30 EST


This patch adds the module parameter "contrast" to determine the
contrast value that is used to initialize the display. This
setting applies to all instances of the driver.

Signed-off-by: Thomas NiederprÃm <niederp@xxxxxxxxxxxxxxxx>
---
drivers/video/fbdev/ssd1307fb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 6149827..d5aec5c 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -43,6 +43,9 @@
static u_int refreshrate = REFRESHRATE;
module_param(refreshrate, uint, 0);

+static u_int contrast = 127;
+module_param(contrast, uint, S_IRUGO);
+
struct ssd1307fb_par;

struct ssd1307fb_deviceinfo {
@@ -525,7 +528,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
par->com_lrremap = of_property_read_bool(node, "solomon,com-lrremap");
par->com_invdir = of_property_read_bool(node, "solomon,com-invdir");

- par->contrast = 127;
+ par->contrast = contrast;
par->vcomh = par->device_info->default_vcomh;

/* Setup display timing */
--
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/