Commit 3c588452 authored by Anton Gerasimov's avatar Anton Gerasimov Committed by Greg Kroah-Hartman

staging: fbtft: split long strings

Split long function declarations, function calls, comments etc.
Signed-off-by: default avatarAnton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35e606de
...@@ -73,7 +73,9 @@ static int init_display(struct fbtft_par *par) ...@@ -73,7 +73,9 @@ static int init_display(struct fbtft_par *par)
fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
"%s()\n", __func__); "%s()\n", __func__);
fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
"display size %dx%d\n", par->info->var.xres, par->info->var.yres); "display size %dx%d\n",
par->info->var.xres,
par->info->var.yres);
par->fbtftops.reset(par); par->fbtftops.reset(par);
...@@ -101,7 +103,8 @@ static int init_display(struct fbtft_par *par) ...@@ -101,7 +103,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x0E); write_reg(par, 0x1D, 0x0E);
write_reg(par, 0x1E, 0x00); write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x02); write_reg(par, 0x1F, 0x02);
} else if ((par->info->var.xres == 480) && (par->info->var.yres == 272)) { } else if ((par->info->var.xres == 480) &&
(par->info->var.yres == 272)) {
/* PLL clock frequency */ /* PLL clock frequency */
write_reg(par, 0x88, 0x0A); write_reg(par, 0x88, 0x0A);
write_reg(par, 0x89, 0x02); write_reg(par, 0x89, 0x02);
...@@ -125,7 +128,8 @@ static int init_display(struct fbtft_par *par) ...@@ -125,7 +128,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x07); write_reg(par, 0x1D, 0x07);
write_reg(par, 0x1E, 0x00); write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x09); write_reg(par, 0x1F, 0x09);
} else if ((par->info->var.xres == 640) && (par->info->var.yres == 480)) { } else if ((par->info->var.xres == 640) &&
(par->info->var.yres == 480)) {
/* PLL clock frequency */ /* PLL clock frequency */
write_reg(par, 0x88, 0x0B); write_reg(par, 0x88, 0x0B);
write_reg(par, 0x89, 0x02); write_reg(par, 0x89, 0x02);
...@@ -149,7 +153,8 @@ static int init_display(struct fbtft_par *par) ...@@ -149,7 +153,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x0E); write_reg(par, 0x1D, 0x0E);
write_reg(par, 0x1E, 0x00); write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x01); write_reg(par, 0x1F, 0x01);
} else if ((par->info->var.xres == 800) && (par->info->var.yres == 480)) { } else if ((par->info->var.xres == 800) &&
(par->info->var.yres == 480)) {
/* PLL clock frequency */ /* PLL clock frequency */
write_reg(par, 0x88, 0x0B); write_reg(par, 0x88, 0x0B);
write_reg(par, 0x89, 0x02); write_reg(par, 0x89, 0x02);
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
#define WIDTH 84 #define WIDTH 84
#define HEIGHT 48 #define HEIGHT 48
#define TXBUFLEN WIDTH #define TXBUFLEN WIDTH
#define DEFAULT_GAMMA "40" /* gamma is used to control contrast in this driver */
/* gamma is used to control contrast in this driver */
#define DEFAULT_GAMMA "40"
static unsigned bs = 4; static unsigned bs = 4;
module_param(bs, uint, 0); module_param(bs, uint, 0);
...@@ -51,7 +53,8 @@ static int init_display(struct fbtft_par *par) ...@@ -51,7 +53,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x21); /* 5:1 1 write_reg(par, 0x21); /* 5:1 1
2:0 PD - Powerdown control: chip is active 2:0 PD - Powerdown control: chip is active
1:0 V - Entry mode: horizontal addressing 1:0 V - Entry mode: horizontal addressing
0:1 H - Extended instruction set control: extended 0:1 H - Extended instruction set control:
extended
*/ */
/* H=1 Bias system */ /* H=1 Bias system */
...@@ -83,7 +86,9 @@ static int init_display(struct fbtft_par *par) ...@@ -83,7 +86,9 @@ static int init_display(struct fbtft_par *par)
static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) 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); 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 */ /* H=0 Set X address of RAM */
write_reg(par, 0x80); /* 7:1 1 write_reg(par, 0x80); /* 7:1 1
......
...@@ -1063,7 +1063,8 @@ static struct fbtft_device_display displays[] = { ...@@ -1063,7 +1063,8 @@ static struct fbtft_device_display displays[] = {
.display = { .display = {
.buswidth = 8, .buswidth = 8,
.backlight = 1, .backlight = 1,
.init_sequence = waveshare32b_init_sequence, .init_sequence =
waveshare32b_init_sequence,
}, },
.bgr = true, .bgr = true,
.gpios = (const struct fbtft_gpio []) { .gpios = (const struct fbtft_gpio []) {
......
...@@ -134,9 +134,12 @@ static int ssd1351_init[] = { -1,0xfd,0x12,-1,0xfd,0xb1,-1,0xae,-1,0xb3,0xf1,-1, ...@@ -134,9 +134,12 @@ static int ssd1351_init[] = { -1,0xfd,0x12,-1,0xfd,0xb1,-1,0xae,-1,0xb3,0xf1,-1,
/* ili9320, ili9325 */ /* ili9320, ili9325 */
static void flexfb_set_addr_win_1(struct fbtft_par *par, int xs, int ys, int xe, int ye) static void flexfb_set_addr_win_1(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); fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par,
"%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
__func__, xs, ys, xe, ye);
switch (par->info->var.rotate) { switch (par->info->var.rotate) {
/* R20h = Horizontal GRAM Start Address */ /* R20h = Horizontal GRAM Start Address */
/* R21h = Vertical GRAM Start Address */ /* R21h = Vertical GRAM Start Address */
...@@ -161,9 +164,12 @@ static void flexfb_set_addr_win_1(struct fbtft_par *par, int xs, int ys, int xe, ...@@ -161,9 +164,12 @@ static void flexfb_set_addr_win_1(struct fbtft_par *par, int xs, int ys, int xe,
} }
/* ssd1289 */ /* ssd1289 */
static void flexfb_set_addr_win_2(struct fbtft_par *par, int xs, int ys, int xe, int ye) static void flexfb_set_addr_win_2(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); fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par,
"%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
__func__, xs, ys, xe, ye);
switch (par->info->var.rotate) { switch (par->info->var.rotate) {
/* R4Eh - Set GDDRAM X address counter */ /* R4Eh - Set GDDRAM X address counter */
...@@ -191,9 +197,12 @@ static void flexfb_set_addr_win_2(struct fbtft_par *par, int xs, int ys, int xe, ...@@ -191,9 +197,12 @@ static void flexfb_set_addr_win_2(struct fbtft_par *par, int xs, int ys, int xe,
} }
/* ssd1351 */ /* ssd1351 */
static void set_addr_win_3(struct fbtft_par *par, int xs, int ys, int xe, int ye) static void set_addr_win_3(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); fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par,
"%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__,
xs, ys, xe, ye);
write_reg(par, 0x15, xs, xe); write_reg(par, 0x15, xs, xe);
write_reg(par, 0x75, ys, ye); write_reg(par, 0x75, ys, ye);
...@@ -205,7 +214,8 @@ static int flexfb_verify_gpios_dc(struct fbtft_par *par) ...@@ -205,7 +214,8 @@ static int flexfb_verify_gpios_dc(struct fbtft_par *par)
fbtft_par_dbg(DEBUG_VERIFY_GPIOS, par, "%s()\n", __func__); fbtft_par_dbg(DEBUG_VERIFY_GPIOS, par, "%s()\n", __func__);
if (par->gpio.dc < 0) { if (par->gpio.dc < 0) {
dev_err(par->info->device, "Missing info about 'dc' gpio. Aborting.\n"); dev_err(par->info->device,
"Missing info about 'dc' gpio. Aborting.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -235,7 +245,9 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par) ...@@ -235,7 +245,9 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par)
num_db=buswidth/2; num_db=buswidth/2;
for (i=0;i < num_db;i++) { for (i=0;i < num_db;i++) {
if (par->gpio.db[i] < 0) { if (par->gpio.db[i] < 0) {
dev_err(par->info->device, "Missing info about 'db%02d' gpio. Aborting.\n", i); dev_err(par->info->device,
"Missing info about 'db%02d' gpio. Aborting.\n",
i);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -245,7 +257,8 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par) ...@@ -245,7 +257,8 @@ static int flexfb_verify_gpios_db(struct fbtft_par *par)
static struct fbtft_display flex_display = { }; static struct fbtft_display flex_display = { };
static int flexfb_probe_common(struct spi_device *sdev, struct platform_device *pdev) static int flexfb_probe_common(struct spi_device *sdev,
struct platform_device *pdev)
{ {
struct device *dev; struct device *dev;
struct fb_info *info; struct fb_info *info;
...@@ -260,7 +273,8 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device * ...@@ -260,7 +273,8 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device *
else else
dev = &pdev->dev; dev = &pdev->dev;
fbtft_init_dbg(dev, "%s(%s)\n", __func__, sdev ? "'SPI device'" : "'Platform device'"); fbtft_init_dbg(dev, "%s(%s)\n", __func__,
sdev ? "'SPI device'" : "'Platform device'");
if (chip) { if (chip) {
...@@ -403,7 +417,9 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device * ...@@ -403,7 +417,9 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device *
par->fbtftops.write_register = fbtft_write_reg16_bus8; par->fbtftops.write_register = fbtft_write_reg16_bus8;
break; break;
default: default:
dev_err(dev, "argument 'regwidth': %d is not supported.\n", regwidth); dev_err(dev,
"argument 'regwidth': %d is not supported.\n",
regwidth);
return -EINVAL; return -EINVAL;
} }
...@@ -483,7 +499,8 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device * ...@@ -483,7 +499,8 @@ static int flexfb_probe_common(struct spi_device *sdev, struct platform_device *
par->fbtftops.set_addr_win = set_addr_win_3; par->fbtftops.set_addr_win = set_addr_win_3;
break; break;
default: default:
dev_err(dev, "argument 'setaddrwin': unknown value %d.\n", setaddrwin); dev_err(dev, "argument 'setaddrwin': unknown value %d.\n",
setaddrwin);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment