mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 05:33:09 +00:00
staging/fbtft : Add missing whitespace around operators
Add blank spaces around operators where recommended by checkpatch.pl Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1014c2ce08
commit
94c0a54427
@ -139,7 +139,7 @@ static int set_var(struct fbtft_par *par)
|
||||
OP0 OP1 CP0 CP1 CP2 CP3 CP4 MP0 MP1 MP2 MP3 MP4 MP5 CGM0 CGM1
|
||||
ON0 ON1 CN0 CN1 CN2 CN3 CN4 MN0 MN1 MN2 MN3 MN4 MN5 XXXX GC
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
|
@ -103,7 +103,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
|
||||
VRP0 VRP1 VRP2 VRP3 VRP4 VRP5 PRP0 PRP1 PKP0 PKP1 PKP2 PKP3 PKP4 CGM
|
||||
VRN0 VRN1 VRN2 VRN3 VRN4 VRN5 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 CGM
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
|
@ -227,7 +227,7 @@ static int set_var(struct fbtft_par *par)
|
||||
}
|
||||
|
||||
#ifdef GAMMA_ADJ
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int gamma_adj(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
@ -240,7 +240,7 @@ static int gamma_adj(struct fbtft_par *par, unsigned long *curves)
|
||||
|
||||
for (i = 0; i < GAMMA_NUM; i++)
|
||||
for (j = 0; j < GAMMA_LEN; j++)
|
||||
CURVE(i, j) &= mask[i*par->gamma.num_values + j];
|
||||
CURVE(i, j) &= mask[i * par->gamma.num_values + j];
|
||||
|
||||
write_reg(par, CMD_PGAMMAC,
|
||||
CURVE(0, 0),
|
||||
|
@ -224,7 +224,7 @@ static int set_var(struct fbtft_par *par)
|
||||
VRP0 VRP1 RP0 RP1 KP0 KP1 KP2 KP3 KP4 KP5
|
||||
VRN0 VRN1 RN0 RN1 KN0 KN1 KN2 KN3 KN4 KN5
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
@ -238,7 +238,7 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
/* apply mask */
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
CURVE(i, j) &= mask[i*par->gamma.num_values + j];
|
||||
CURVE(i, j) &= mask[i * par->gamma.num_values + j];
|
||||
|
||||
write_reg(par, 0x0030, CURVE(0, 5) << 8 | CURVE(0, 4));
|
||||
write_reg(par, 0x0031, CURVE(0, 7) << 8 | CURVE(0, 6));
|
||||
|
@ -221,7 +221,7 @@ static int set_var(struct fbtft_par *par)
|
||||
VRP0 VRP1 RP0 RP1 KP0 KP1 KP2 KP3 KP4 KP5
|
||||
VRN0 VRN1 RN0 RN1 KN0 KN1 KN2 KN3 KN4 KN5
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
@ -235,7 +235,7 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
/* apply mask */
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
CURVE(i, j) &= mask[i*par->gamma.num_values + j];
|
||||
CURVE(i, j) &= mask[i * par->gamma.num_values + j];
|
||||
|
||||
write_reg(par, 0x0030, CURVE(0, 5) << 8 | CURVE(0, 4));
|
||||
write_reg(par, 0x0031, CURVE(0, 7) << 8 | CURVE(0, 6));
|
||||
|
@ -105,7 +105,7 @@ static int set_var(struct fbtft_par *par)
|
||||
break;
|
||||
case 270:
|
||||
write_reg(par, 0x36,
|
||||
(1<<MEM_V) | (1 << MEM_L) | (par->bgr << MEM_BGR));
|
||||
(1 << MEM_V) | (1 << MEM_L) | (par->bgr << MEM_BGR));
|
||||
break;
|
||||
case 180:
|
||||
write_reg(par, 0x36, (1 << MEM_Y) | (par->bgr << MEM_BGR));
|
||||
@ -124,7 +124,7 @@ static int set_var(struct fbtft_par *par)
|
||||
Positive: Par1 Par2 [...] Par15
|
||||
Negative: Par1 Par2 [...] Par15
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
int i;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define DRVNAME "fb_pcd8544"
|
||||
#define WIDTH 84
|
||||
#define HEIGHT 48
|
||||
#define TXBUFLEN (84*6)
|
||||
#define TXBUFLEN (84 * 6)
|
||||
#define DEFAULT_GAMMA "40" /* gamma controls the contrast in this driver */
|
||||
|
||||
static unsigned tc;
|
||||
@ -125,14 +125,15 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
for (y = 0; y < 6; y++) {
|
||||
*buf = 0x00;
|
||||
for (i = 0; i < 8; i++)
|
||||
*buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i;
|
||||
*buf |= (vmem16[(y * 8 + i) * 84 + x] ?
|
||||
1 : 0) << i;
|
||||
buf++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write data */
|
||||
gpio_set_value(par->gpio.dc, 1);
|
||||
ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
|
||||
ret = par->fbtftops.write(par, par->txbuf.buf, 6 * 84);
|
||||
if (ret < 0)
|
||||
dev_err(par->info->device, "write failed and returned: %d\n",
|
||||
ret);
|
||||
|
@ -186,10 +186,10 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
|
||||
write_reg(par, 0x31, (xs & 0xFF00) >> 8);
|
||||
write_reg(par, 0x32, ys & 0x00FF);
|
||||
write_reg(par, 0x33, (ys & 0xFF00) >> 8);
|
||||
write_reg(par, 0x34, (xs+xe) & 0x00FF);
|
||||
write_reg(par, 0x35, ((xs+xe) & 0xFF00) >> 8);
|
||||
write_reg(par, 0x36, (ys+ye) & 0x00FF);
|
||||
write_reg(par, 0x37, ((ys+ye) & 0xFF00) >> 8);
|
||||
write_reg(par, 0x34, (xs + xe) & 0x00FF);
|
||||
write_reg(par, 0x35, ((xs + xe) & 0xFF00) >> 8);
|
||||
write_reg(par, 0x36, (ys + ye) & 0x00FF);
|
||||
write_reg(par, 0x37, ((ys + ye) & 0xFF00) >> 8);
|
||||
|
||||
/* Set_Memory_Write_Cursor */
|
||||
write_reg(par, 0x46, xs & 0xff);
|
||||
|
@ -133,7 +133,7 @@ static int set_var(struct fbtft_par *par)
|
||||
PKP0 PKP1 PKP2 PKP3 PKP4 PKP5 PKP6 PKP7 PKP8 PKP9 PKP10 PKP11 VRP0 VRP1
|
||||
PKN0 PKN1 PKN2 PKN3 PKN4 PKN5 PKN6 PKN7 PRN8 PRN9 PRN10 PRN11 VRN0 VRN1
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
@ -148,7 +148,7 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
/* apply mask */
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < 14; j++)
|
||||
CURVE(i, j) &= mask[i*par->gamma.num_values + j];
|
||||
CURVE(i, j) &= mask[i * par->gamma.num_values + j];
|
||||
|
||||
write_reg(par, 0x0030, CURVE(0, 1) << 8 | CURVE(0, 0));
|
||||
write_reg(par, 0x0031, CURVE(0, 3) << 8 | CURVE(0, 2));
|
||||
|
@ -139,7 +139,7 @@ static int set_var(struct fbtft_par *par)
|
||||
VRP0 VRP1 PRP0 PRP1 PKP0 PKP1 PKP2 PKP3 PKP4 PKP5
|
||||
VRN0 VRN1 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 PKN5
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
unsigned long mask[] = {
|
||||
@ -153,7 +153,7 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
/* apply mask */
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
CURVE(i, j) &= mask[i*par->gamma.num_values + j];
|
||||
CURVE(i, j) &= mask[i * par->gamma.num_values + j];
|
||||
|
||||
write_reg(par, 0x0030, CURVE(0, 5) << 8 | CURVE(0, 4));
|
||||
write_reg(par, 0x0031, CURVE(0, 7) << 8 | CURVE(0, 6));
|
||||
|
@ -175,7 +175,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
for (y = 0; y < par->info->var.yres/8; y++) {
|
||||
*buf = 0x00;
|
||||
for (i = 0; i < 8; i++)
|
||||
*buf |= (vmem16[(y*8+i)*par->info->var.xres+x] ? 1 : 0) << i;
|
||||
*buf |= (vmem16[(y * 8 + i) *
|
||||
par->info->var.xres + x] ?
|
||||
1 : 0) << i;
|
||||
buf++;
|
||||
}
|
||||
}
|
||||
@ -183,7 +185,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
/* Write data */
|
||||
gpio_set_value(par->gpio.dc, 1);
|
||||
ret = par->fbtftops.write(par, par->txbuf.buf,
|
||||
par->info->var.xres*par->info->var.yres/8);
|
||||
par->info->var.xres * par->info->var.yres /
|
||||
8);
|
||||
if (ret < 0)
|
||||
dev_err(par->info->device, "write failed and returned: %d\n",
|
||||
ret);
|
||||
|
@ -137,7 +137,7 @@ static int set_var(struct fbtft_par *par)
|
||||
VRF0P VOS0P PK0P PK1P PK2P PK3P PK4P PK5P PK6P PK7P PK8P PK9P SELV0P SELV1P SELV62P SELV63P
|
||||
VRF0N VOS0N PK0N PK1N PK2N PK3N PK4N PK5N PK6N PK7N PK8N PK9N SELV0N SELV1N SELV62N SELV63N
|
||||
*/
|
||||
#define CURVE(num, idx) curves[num*par->gamma.num_values + idx]
|
||||
#define CURVE(num, idx) curves[num * par->gamma.num_values + idx]
|
||||
static int set_gamma(struct fbtft_par *par, unsigned long *curves)
|
||||
{
|
||||
int i, j;
|
||||
|
@ -102,7 +102,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
|
||||
fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__);
|
||||
|
||||
for (y = 0; y < HEIGHT/8; y++) {
|
||||
for (y = 0; y < HEIGHT / 8; y++) {
|
||||
u8 *buf = par->txbuf.buf;
|
||||
/* The display is 102x68 but the LCD is 84x48. Set
|
||||
the write pointer at the start of each row. */
|
||||
@ -113,9 +113,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
for (x = 0; x < WIDTH; x++) {
|
||||
u8 ch = 0;
|
||||
|
||||
for (i = 0; i < 8*WIDTH; i += WIDTH) {
|
||||
for (i = 0; i < 8 * WIDTH; i += WIDTH) {
|
||||
ch >>= 1;
|
||||
if (vmem16[(y*8*WIDTH)+i+x])
|
||||
if (vmem16[(y * 8 * WIDTH) + i + x])
|
||||
ch |= 0x80;
|
||||
}
|
||||
*buf++ = ch;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define DRVNAME "fb_uc1701"
|
||||
#define WIDTH 102
|
||||
#define HEIGHT 64
|
||||
#define PAGES (HEIGHT/8)
|
||||
#define PAGES (HEIGHT / 8)
|
||||
|
||||
/* 1: Display on/off */
|
||||
#define LCD_DISPLAY_ENABLE 0xAE
|
||||
@ -116,7 +116,7 @@ static int init_display(struct fbtft_par *par)
|
||||
|
||||
/* advanced program control */
|
||||
write_reg(par, LCD_ADV_PROG_CTRL);
|
||||
write_reg(par, LCD_ADV_PROG_CTRL2|LCD_TEMPCOMP_HIGH);
|
||||
write_reg(par, LCD_ADV_PROG_CTRL2 | LCD_TEMPCOMP_HIGH);
|
||||
|
||||
/* enable display */
|
||||
write_reg(par, LCD_DISPLAY_ENABLE | 1);
|
||||
@ -155,13 +155,15 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
for (x = 0; x < WIDTH; x++) {
|
||||
*buf = 0x00;
|
||||
for (i = 0; i < 8; i++)
|
||||
*buf |= (vmem16[((y*8*WIDTH)+(i*WIDTH))+x] ? 1 : 0) << i;
|
||||
*buf |= (vmem16[((y * 8 * WIDTH) +
|
||||
(i * WIDTH)) + x] ?
|
||||
1 : 0) << i;
|
||||
buf++;
|
||||
}
|
||||
/* LCD_PAGE_ADDRESS | ((page) & 0x1F),
|
||||
(((col)+SHIFT_ADDR_NORMAL) & 0x0F),
|
||||
LCD_COL_ADDRESS | ((((col)+SHIFT_ADDR_NORMAL)>>4) & 0x0F) */
|
||||
write_reg(par, LCD_PAGE_ADDRESS|(u8)y);
|
||||
write_reg(par, LCD_PAGE_ADDRESS | (u8)y);
|
||||
/* LCD_PAGE_ADDRESS | ((page) & 0x1F),
|
||||
(((col)+SHIFT_ADDR_NORMAL) & 0x0F),
|
||||
LCD_COL_ADDRESS | ((((col)+SHIFT_ADDR_NORMAL)>>4) & 0x0F) */
|
||||
|
@ -38,7 +38,7 @@ void func(struct fbtft_par *par, int len, ...) \
|
||||
*buf = modifier((type)va_arg(args, unsigned int)); \
|
||||
if (par->gpio.dc != -1) \
|
||||
gpio_set_value(par->gpio.dc, 0); \
|
||||
ret = par->fbtftops.write(par, par->buf, sizeof(type)+offset); \
|
||||
ret = par->fbtftops.write(par, par->buf, sizeof(type) + offset); \
|
||||
if (ret < 0) { \
|
||||
va_end(args); \
|
||||
dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret); \
|
||||
@ -56,7 +56,8 @@ void func(struct fbtft_par *par, int len, ...) \
|
||||
} \
|
||||
if (par->gpio.dc != -1) \
|
||||
gpio_set_value(par->gpio.dc, 1); \
|
||||
ret = par->fbtftops.write(par, par->buf, len * (sizeof(type)+offset)); \
|
||||
ret = par->fbtftops.write(par, par->buf, \
|
||||
len * (sizeof(type) + offset)); \
|
||||
if (ret < 0) { \
|
||||
va_end(args); \
|
||||
dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret); \
|
||||
@ -214,7 +215,7 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)
|
||||
txbuf16[i] = 0x0100 | ioread8(vmem8 + i);
|
||||
#endif
|
||||
vmem8 = vmem8 + to_copy;
|
||||
ret = par->fbtftops.write(par, par->txbuf.buf, to_copy*2);
|
||||
ret = par->fbtftops.write(par, par->txbuf.buf, to_copy * 2);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
remain -= to_copy;
|
||||
|
@ -385,7 +385,7 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned start_line,
|
||||
|
||||
if (par->fbtftops.set_addr_win)
|
||||
par->fbtftops.set_addr_win(par, 0, start_line,
|
||||
par->info->var.xres-1, end_line);
|
||||
par->info->var.xres - 1, end_line);
|
||||
|
||||
offset = start_line * par->info->fix.line_length;
|
||||
len = (end_line - start_line + 1) * par->info->fix.line_length;
|
||||
@ -785,7 +785,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
|
||||
info->fix.xpanstep = 0;
|
||||
info->fix.ypanstep = 0;
|
||||
info->fix.ywrapstep = 0;
|
||||
info->fix.line_length = width*bpp/8;
|
||||
info->fix.line_length = width * bpp / 8;
|
||||
info->fix.accel = FB_ACCEL_NONE;
|
||||
info->fix.smem_len = vmem_size;
|
||||
|
||||
@ -981,12 +981,12 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)
|
||||
par->txbuf.len >> 10, par->txbuf.dma ? "DMA " : "");
|
||||
if (spi)
|
||||
sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num,
|
||||
spi->chip_select, spi->max_speed_hz/1000000);
|
||||
spi->chip_select, spi->max_speed_hz / 1000000);
|
||||
dev_info(fb_info->dev,
|
||||
"%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n",
|
||||
fb_info->fix.id, fb_info->var.xres, fb_info->var.yres,
|
||||
fb_info->fix.smem_len >> 10, text1,
|
||||
HZ/fb_info->fbdefio->delay, text2);
|
||||
HZ / fb_info->fbdefio->delay, text2);
|
||||
|
||||
#ifdef CONFIG_FB_BACKLIGHT
|
||||
/* Turn on backlight if available */
|
||||
@ -1168,7 +1168,7 @@ int fbtft_init_display(struct fbtft_par *par)
|
||||
"missing delimiter at position %d\n", i);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (par->init_sequence[i+1] < 0) {
|
||||
if (par->init_sequence[i + 1] < 0) {
|
||||
dev_err(par->info->device,
|
||||
"missing value after delimiter %d at position %d\n",
|
||||
par->init_sequence[i], i);
|
||||
|
@ -103,8 +103,8 @@ sprintf_gamma(struct fbtft_par *par, unsigned long *curves, char *buf)
|
||||
for (i = 0; i < par->gamma.num_curves; i++) {
|
||||
for (j = 0; j < par->gamma.num_values; j++)
|
||||
len += scnprintf(&buf[len], PAGE_SIZE,
|
||||
"%04lx ", curves[i*par->gamma.num_values + j]);
|
||||
buf[len-1] = '\n';
|
||||
"%04lx ", curves[i * par->gamma.num_values + j]);
|
||||
buf[len - 1] = '\n';
|
||||
}
|
||||
mutex_unlock(&par->gamma.lock);
|
||||
|
||||
|
@ -1202,7 +1202,7 @@ static void adafruit18_green_tab_set_addr_win(struct fbtft_par *par,
|
||||
}
|
||||
|
||||
/* used if gpios parameter is present */
|
||||
static struct fbtft_gpio fbtft_device_param_gpios[MAX_GPIOS+1] = { };
|
||||
static struct fbtft_gpio fbtft_device_param_gpios[MAX_GPIOS + 1] = { };
|
||||
|
||||
static void fbtft_device_pdev_release(struct device *dev)
|
||||
{
|
||||
@ -1216,7 +1216,7 @@ static int spi_device_found(struct device *dev, void *data)
|
||||
struct spi_device *spi = container_of(dev, struct spi_device, dev);
|
||||
|
||||
pr_info(DRVNAME": %s %s %dkHz %d bits mode=0x%02X\n",
|
||||
spi->modalias, dev_name(dev), spi->max_speed_hz/1000,
|
||||
spi->modalias, dev_name(dev), spi->max_speed_hz / 1000,
|
||||
spi->bits_per_word, spi->mode);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user