summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fbtft/fb_pcd8544.c
diff options
context:
space:
mode:
authorCláudio Maia <crrm@isep.ipp.pt>2015-03-20 16:31:46 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 13:06:54 +0100
commit4178549e4c477502e33e0cede28678faff44ad3e (patch)
tree25e54f13d236f93865ad3a09de1b60cfe19361b8 /drivers/staging/fbtft/fb_pcd8544.c
parent14cf23b155a343631adace6d41e5ace3cefb8339 (diff)
downloadlinux-stable-4178549e4c477502e33e0cede28678faff44ad3e.tar.gz
linux-stable-4178549e4c477502e33e0cede28678faff44ad3e.tar.bz2
linux-stable-4178549e4c477502e33e0cede28678faff44ad3e.zip
Staging: fbtft: fb_pcd8544: Fix comments style
This patch fixes the following errors by refactoring the comments' style: WARNING: line over 80 characters ERROR: code indent should use tabs where possible Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft/fb_pcd8544.c')
-rw-r--r--drivers/staging/fbtft/fb_pcd8544.c107
1 files changed, 59 insertions, 48 deletions
diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c
index 2d56213f1187..15da0ec77513 100644
--- a/drivers/staging/fbtft/fb_pcd8544.c
+++ b/drivers/staging/fbtft/fb_pcd8544.c
@@ -34,7 +34,7 @@
#define WIDTH 84
#define HEIGHT 48
#define TXBUFLEN (84*6)
-#define DEFAULT_GAMMA "40" /* gamma is used to control contrast in this driver */
+#define DEFAULT_GAMMA "40" /* gamma controls the contrast in this driver */
static unsigned tc;
module_param(tc, uint, 0);
@@ -51,43 +51,50 @@ static int init_display(struct fbtft_par *par)
par->fbtftops.reset(par);
- /* Function set */
- write_reg(par, 0x21); /* 5:1 1
- 2:0 PD - Powerdown control: chip is active
- 1:0 V - Entry mode: horizontal addressing
- 0:1 H - Extended instruction set control: extended
- */
-
- /* H=1 Temperature control */
- write_reg(par, 0x04 | (tc & 0x3)); /*
- 2:1 1
- 1:x TC1 - Temperature Coefficient: 0x10
- 0:x TC0
- */
-
- /* H=1 Bias system */
- write_reg(par, 0x10 | (bs & 0x7)); /*
- 4:1 1
- 3:0 0
- 2:x BS2 - Bias System
- 1:x BS1
- 0:x BS0
- */
-
- /* Function set */
- write_reg(par, 0x22); /* 5:1 1
- 2:0 PD - Powerdown control: chip is active
- 1:1 V - Entry mode: vertical addressing
- 0:0 H - Extended instruction set control: basic
- */
-
- /* H=0 Display control */
- write_reg(par, 0x08 | 4); /*
- 3:1 1
- 2:1 D - DE: 10=normal mode
- 1:0 0
- 0:0 E
- */
+ /* Function set
+ *
+ * 5:1 1
+ * 2:0 PD - Powerdown control: chip is active
+ * 1:0 V - Entry mode: horizontal addressing
+ * 0:1 H - Extended instruction set control: extended
+ */
+ write_reg(par, 0x21);
+
+ /* H=1 Temperature control
+ *
+ * 2:1 1
+ * 1:x TC1 - Temperature Coefficient: 0x10
+ * 0:x TC0
+ */
+ write_reg(par, 0x04 | (tc & 0x3));
+
+ /* H=1 Bias system
+ *
+ * 4:1 1
+ * 3:0 0
+ * 2:x BS2 - Bias System
+ * 1:x BS1
+ * 0:x BS0
+ */
+ write_reg(par, 0x10 | (bs & 0x7));
+
+ /* Function set
+ *
+ * 5:1 1
+ * 2:0 PD - Powerdown control: chip is active
+ * 1:1 V - Entry mode: vertical addressing
+ * 0:0 H - Extended instruction set control: basic
+ */
+ write_reg(par, 0x22);
+
+ /* H=0 Display control
+ *
+ * 3:1 1
+ * 2:1 D - DE: 10=normal mode
+ * 1:0 0
+ * 0:0 E
+ */
+ write_reg(par, 0x08 | 4);
return 0;
}
@@ -97,16 +104,20 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
__func__, xs, ys, xe, ye);
- /* H=0 Set X address of RAM */
- write_reg(par, 0x80); /* 7:1 1
- 6-0: X[6:0] - 0x00
- */
-
- /* H=0 Set Y address of RAM */
- write_reg(par, 0x40); /* 7:0 0
- 6:1 1
- 2-0: Y[2:0] - 0x0
- */
+ /* H=0 Set X address of RAM
+ *
+ * 7:1 1
+ * 6-0: X[6:0] - 0x00
+ */
+ write_reg(par, 0x80);
+
+ /* H=0 Set Y address of RAM
+ *
+ * 7:0 0
+ * 6:1 1
+ * 2-0: Y[2:0] - 0x0
+ */
+ write_reg(par, 0x40);
}
static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)