Style Fixes on fbtft
Subsystems (2)
cover Style Fixes on fbtft
I did some style fixes on staging/fbtft using scripts/checkpatch.pl.
Please feel free to suggest any changes.
Leonardo Brás (11):
staging: fbtft: Changes udelay(n) to usleep_range(n, n + 1). - Style
staging: fbtft: Puts macro arguments in parenthesis to avoid
precedence issues - Style
staging: fbtft: Fixes some alignment and line > 80 char issues - Style
staging: fbtft: Adjust some empty-line problems - Style
staging: fbtft: Erases some repetitive usage of function name - Style
staging: fbtft: Fixes some defines styles - Style
staging: fbtft: Includes description to mutex and spinlock - Style
staging: fbtft: Add spaces around / - Style
staging: fbtft: Corrects long index line - Style
staging: fbtft: Replaces (1 << n) for macro BIT(n) - Style
staging: fbtft: Includes parenthesis around macro parameters and
avoids multiple usage of macro parameter - Style
drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- drivers/staging/fbtft/fb_hx8347d.c | 2 +- drivers/staging/fbtft/fb_ili9163.c | 2 +- drivers/staging/fbtft/fb_ili9320.c | 2 +- drivers/staging/fbtft/fb_ili9325.c | 2 +- drivers/staging/fbtft/fb_ili9341.c | 2 +- drivers/staging/fbtft/fb_ra8875.c | 4 +- drivers/staging/fbtft/fb_s6d02a1.c | 1 - drivers/staging/fbtft/fb_s6d1121.c | 3 +- drivers/staging/fbtft/fb_sh1106.c | 2 +- drivers/staging/fbtft/fb_ssd1289.c | 9 +- drivers/staging/fbtft/fb_ssd1306.c | 5 +- drivers/staging/fbtft/fb_ssd1325.c | 2 +- drivers/staging/fbtft/fb_ssd1331.c | 11 ++- drivers/staging/fbtft/fb_ssd1351.c | 43 ++++++--- drivers/staging/fbtft/fb_st7735r.c | 21 ++-- drivers/staging/fbtft/fb_st7789v.c | 13 ++- drivers/staging/fbtft/fb_tinylcd.c | 2 +- drivers/staging/fbtft/fb_uc1611.c | 2 +- drivers/staging/fbtft/fb_upd161704.c | 19 ++-- drivers/staging/fbtft/fb_watterott.c | 33 ++++--- drivers/staging/fbtft/fbtft-bus.c | 31 +++--- drivers/staging/fbtft/fbtft-core.c | 65 ++++++++----- drivers/staging/fbtft/fbtft-io.c | 17 ++-- drivers/staging/fbtft/fbtft-sysfs.c | 10 +- drivers/staging/fbtft/fbtft.h | 129 +++++++++++++++---------- drivers/staging/fbtft/fbtft_device.c | 46 ++++----- drivers/staging/fbtft/flexfb.c | 46 +++++---- 28 files changed, 317 insertions(+), 209 deletions(-)
Signature · 1 line
2.18.0
PATCH 1/11 staging: fbtft: Changes udelay(n) to usleep_range(n, n + 1). - Style
--- drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- drivers/staging/fbtft/fb_ra8875.c | 4 ++-- drivers/staging/fbtft/fb_tinylcd.c | 2 +- drivers/staging/fbtft/fb_upd161704.c | 19 +++++++++---------- drivers/staging/fbtft/fb_watterott.c | 4 ++-- 5 files changed, 15 insertions(+), 16 deletions(-)
drivers/staging/fbtft/fb_agm1264k-fl.c +1 -1
@@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)dev_dbg (par->info->device,"%s()\n" , __func__);gpio_set_value (par->gpio.reset,0 ); -udelay (20 ); +usleep_range (20 ,21 );gpio_set_value (par->gpio.reset,1 );mdelay (120 ); }
drivers/staging/fbtft/fb_ra8875.c +2 -2
@@ -217,7 +217,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) } len--; -udelay (100 ); +usleep_range (100 ,101 );if (len) { buf = (u8 *)par->buf;
@@ -238,7 +238,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)/* restore user spi-speed */ par->fbtftops.write = fbtft_write_spi; -udelay (100 ); +usleep_range (100 ,101 ); }static int write_vmem16_bus8 (struct fbtft_par *par,size_t offset,size_t len)
drivers/staging/fbtft/fb_tinylcd.c +1 -1
@@ -41,7 +41,7 @@ static int init_display(struct fbtft_par *par) 0x00, 0x35, 0x33, 0x00, 0x00, 0x00);write_reg (par,MIPI_DCS_SET_PIXEL_FORMAT ,0x55 );write_reg (par,MIPI_DCS_EXIT_SLEEP_MODE ); -udelay (250 ); +usleep_range (250 ,251 );write_reg (par,MIPI_DCS_SET_DISPLAY_ON );return 0 ;
drivers/staging/fbtft/fb_upd161704.c +9 -10
@@ -36,27 +36,26 @@ static int init_display(struct fbtft_par *par)/* oscillator start */ write_reg (par,0x003A ,0x0001 );/*Oscillator 0: stop, 1: operation */ -udelay (100 ); - +usleep_range (100 ,101 );/* y-setting */ write_reg (par,0x0024 ,0x007B );/* amplitude setting */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0025 ,0x003B );/* amplitude setting */ write_reg (par,0x0026 ,0x0034 );/* amplitude setting */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0027 ,0x0004 );/* amplitude setting */ write_reg (par,0x0052 ,0x0025 );/* circuit setting 1 */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0053 ,0x0033 );/* circuit setting 2 */ write_reg (par,0x0061 ,0x001C );/* adjustment V10 positive polarity */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0062 ,0x002C );/* adjustment V9 negative polarity */ write_reg (par,0x0063 ,0x0022 );/* adjustment V34 positive polarity */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0064 ,0x0027 );/* adjustment V31 negative polarity */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0065 ,0x0014 );/* adjustment V61 negative polarity */ -udelay (10 ); +usleep_range (10 ,11 );write_reg (par,0x0066 ,0x0010 );/* adjustment V61 negative polarity */ /* Basical clock for 1 line (BASECOUNT[7:0]) number specified */
@@ -64,7 +63,7 @@ static int init_display(struct fbtft_par *par)/* Power supply setting */ write_reg (par,0x0019 ,0x0000 );/* DC/DC output setting */ -udelay (200 ); +usleep_range (200 ,201 );write_reg (par,0x001A ,0x1000 );/* DC/DC frequency setting */ write_reg (par,0x001B ,0x0023 );/* DC/DC rising setting */ write_reg (par,0x001C ,0x0C01 );/* Regulator voltage setting */
drivers/staging/fbtft/fb_watterott.c +2 -2
@@ -83,7 +83,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) par->txbuf.buf, 10 + par->info->fix.line_length);if (ret <0 )return ret; -udelay (300 ); +usleep_range (300 ,301 ); }return 0 ;
@@ -122,7 +122,7 @@ static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len) par->txbuf.buf, 10 + par->info->var.xres);if (ret <0 )return ret; -udelay (700 ); +usleep_range (700 ,701 ); }return 0 ;
Signature · 1 line
2.18.0
PATCH 2/11 staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fb_hx8347d.c | 2 +- drivers/staging/fbtft/fb_ili9163.c | 2 +- drivers/staging/fbtft/fb_ili9320.c | 2 +- drivers/staging/fbtft/fb_ili9325.c | 2 +- drivers/staging/fbtft/fb_ili9341.c | 2 +- drivers/staging/fbtft/fb_s6d1121.c | 2 +- drivers/staging/fbtft/fb_ssd1289.c | 2 +- drivers/staging/fbtft/fb_st7735r.c | 2 +- drivers/staging/fbtft/fb_watterott.c | 12 +++++++++--- drivers/staging/fbtft/fbtft.h | 9 +++++---- 10 files changed, 22 insertions(+), 15 deletions(-)
drivers/staging/fbtft/fb_hx8347d.c +1 -1
@@ -92,7 +92,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,u32 *curves) {unsigned long mask[] = {
drivers/staging/fbtft/fb_ili9163.c +1 -1
@@ -192,7 +192,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, u32 *curves) { unsigned long mask[] = {
drivers/staging/fbtft/fb_ili9320.c +1 -1
@@ -211,7 +211,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,u32 *curves) {unsigned long mask[] = {
drivers/staging/fbtft/fb_ili9325.c +1 -1
@@ -205,7 +205,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,u32 *curves) {unsigned long mask[] = {
drivers/staging/fbtft/fb_ili9341.c +1 -1
@@ -111,7 +111,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,u32 *curves) {int i;
drivers/staging/fbtft/fb_s6d1121.c +1 -1
@@ -120,7 +120,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,u32 *curves) {unsigned long mask[] = {
drivers/staging/fbtft/fb_ssd1289.c +1 -1
@@ -126,7 +126,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,u32 *curves) {unsigned long mask[] = {
drivers/staging/fbtft/fb_st7735r.c +1 -1
@@ -133,7 +133,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,u32 *curves) {int i, j;
drivers/staging/fbtft/fb_watterott.c +9 -3
@@ -89,9 +89,15 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)return 0 ; } -#define RGB565toRGB323 (c) (((c&0xE000)>>8) | ((c&0600)>>6) | ((c&0x001C)>>2)) -#define RGB565toRGB332 (c) (((c&0xE000)>>8) | ((c&0700)>>6) | ((c&0x0018)>>3)) -#define RGB565toRGB233 (c) (((c&0xC000)>>8) | ((c&0700)>>5) | ((c&0x001C)>>2)) +#define RGB565toRGB323 (c) ((((c) & 0xE000) >> 8) |\ + (((c) & 000600) >> 6) |\ + (((c) & 0x001C) >> 2)) +#define RGB565toRGB332 (c) ((((c) & 0xE000) >> 8) |\ + (((c) & 000700) >> 6) |\ + (((c) & 0x0018) >> 3)) +#define RGB565toRGB233 (c) ((((c) & 0xC000) >> 8) |\ + (((c) & 000700) >> 5) |\ + (((c) & 0x001C) >> 2))static int write_vmem_8bit (struct fbtft_par *par,size_t offset,size_t len) {
drivers/staging/fbtft/fbtft.h +5 -4
@@ -234,8 +234,8 @@ struct fbtft_par {#define NUMARGS (...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) -#define write_reg (par, ...) \ - par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__) +#define write_reg (par, ...) \ + ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))/* fbtft-core.c */ int fbtft_write_buf_dc (struct fbtft_par *par,void *buf,size_t len,int dc);
@@ -404,8 +404,9 @@ do { \ #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \ do { \ - if (unlikely(par->debug & level)) \ - fbtft_dbg_hex(dev, sizeof(type), buf, num * sizeof(type), format, ##arg); \ + if (unlikely((par)->debug & (level))) \ + fbtft_dbg_hex(dev, sizeof(type), buf,\ + (num) * sizeof(type), format, ##arg); \ } while (0)#endif /* __LINUX_FBTFT_H */
Signature · 1 line
2.18.0
PATCH 3/11 staging: fbtft: Fixes some alignment and line > 80 char issues - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fb_ssd1289.c | 6 +-- drivers/staging/fbtft/fb_ssd1306.c | 3 +- drivers/staging/fbtft/fb_ssd1331.c | 9 ++++- drivers/staging/fbtft/fb_ssd1351.c | 43 +++++++++++++-------- drivers/staging/fbtft/fb_st7735r.c | 19 +++++++--- drivers/staging/fbtft/fb_st7789v.c | 13 +++---- drivers/staging/fbtft/fb_watterott.c | 17 +++++---- drivers/staging/fbtft/fbtft-bus.c | 21 ++++++---- drivers/staging/fbtft/fbtft-core.c | 57 ++++++++++++++++++---------- drivers/staging/fbtft/fbtft-io.c | 17 +++++---- drivers/staging/fbtft/fbtft-sysfs.c | 4 +- drivers/staging/fbtft/fbtft.h | 38 +++++++++++++++---- drivers/staging/fbtft/fbtft_device.c | 44 +++++++++++---------- drivers/staging/fbtft/flexfb.c | 46 +++++++++++++--------- 14 files changed, 214 insertions(+), 123 deletions(-)
drivers/staging/fbtft/fb_ssd1289.c +3 -3
@@ -38,7 +38,7 @@ static int init_display(struct fbtft_par *par)write_reg (par,0x0E ,0x2B00 );write_reg (par,0x1E ,0x00B7 );write_reg (par,0x01 , -BIT (13 ) | (par->bgr <<11 ) |BIT (9 ) | (HEIGHT -1 )); +BIT (13 ) | (par->bgr <<11 ) |BIT (9 ) | (HEIGHT -1 ));write_reg (par,0x02 ,0x0600 );write_reg (par,0x10 ,0x0000 );write_reg (par,0x05 ,0x0000 );
@@ -98,8 +98,8 @@ static int set_var(struct fbtft_par *par)if (par->fbtftops.init_display != init_display) {/* don't risk messing up register 11h */ fbtft_par_dbg (DEBUG_INIT_DISPLAY , par, -"%s: skipping since custom init_display() is used\n" , - __func__); +"%s: skipping since custom init_display() is used\n" , + __func__);return 0 ; }
drivers/staging/fbtft/fb_ssd1306.c +2 -1
@@ -184,7 +184,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)for (y =0 ; y < yres /8 ; y++) { *buf =0x00 ;for (i =0 ; i <8 ; i++) - *buf |= (vmem16[(y *8 + i) * xres + x] ?1 :0 ) << i; + *buf |= (vmem16[(y *8 + i) * xres + x] ? +1 :0 ) << i; buf++; } }
drivers/staging/fbtft/fb_ssd1331.c +8 -1
@@ -74,7 +74,14 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)for (i =0 ; i < len; i++) buf[i] = (u8)va_arg(args, unsigned int);va_end (args); -fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, par->info->device, u8, buf, len,"%s: " , __func__); +fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , + par, + par->info->device, + u8, + buf, + len, +"%s: " , + __func__); }va_start (args, len);
drivers/staging/fbtft/fb_ssd1351.c +28 -15
78 lines not on this page · raw message
drivers/staging/fbtft/fb_st7735r.c +13 -6
@@ -130,8 +130,10 @@ static int set_var(struct fbtft_par *par)/* * Gamma string format: -* 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 +* 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)]static int set_gamma (struct fbtft_par *par,u32 *curves)
@@ -145,13 +147,18 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)for (i =0 ; i < par->gamma.num_curves; i++)write_reg (par,0xE0 + i, -CURVE (i,0 ),CURVE (i,1 ),CURVE (i,2 ),CURVE (i,3 ), -CURVE (i,4 ),CURVE (i,5 ),CURVE (i,6 ),CURVE (i,7 ), -CURVE (i,8 ),CURVE (i,9 ),CURVE (i,10 ),CURVE (i,11 ), -CURVE (i,12 ),CURVE (i,13 ),CURVE (i,14 ),CURVE (i,15 )); +CURVE (i,0 ),CURVE (i,1 ), +CURVE (i,2 ),CURVE (i,3 ), +CURVE (i,4 ),CURVE (i,5 ), +CURVE (i,6 ),CURVE (i,7 ), +CURVE (i,8 ),CURVE (i,9 ), +CURVE (i,10 ),CURVE (i,11 ), +CURVE (i,12 ),CURVE (i,13 ), +CURVE (i,14 ),CURVE (i,15 ));return 0 ; } +#undef CURVEstatic struct fbtft_display display = {
drivers/staging/fbtft/fb_st7789v.c +6 -7
@@ -201,13 +201,12 @@ static int set_gamma(struct fbtft_par *par, u32 *curves) c = i * par->gamma.num_values;for (j =0 ; j < par->gamma.num_values; j++) curves[c + j] &= gamma_par_mask[j]; -write_reg ( - par,PVGAMCTRL + i, - curves[c +0 ], curves[c +1 ], curves[c +2 ], - curves[c +3 ], curves[c +4 ], curves[c +5 ], - curves[c +6 ], curves[c +7 ], curves[c +8 ], - curves[c +9 ], curves[c +10 ], curves[c +11 ], - curves[c +12 ], curves[c +13 ]); +write_reg (par,PVGAMCTRL + i, + curves[c +0 ], curves[c +1 ], curves[c +2 ], + curves[c +3 ], curves[c +4 ], curves[c +5 ], + curves[c +6 ], curves[c +7 ], curves[c +8 ], + curves[c +9 ], curves[c +10 ], curves[c +11 ], + curves[c +12 ], curves[c +13 ]); }return 0 ; }
drivers/staging/fbtft/fb_watterott.c +10 -7
@@ -46,7 +46,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)va_end (args);fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, - par->info->device, u8, par->buf, len,"%s: " , __func__); + par->info->device, u8, par->buf, + len,"%s: " , __func__); ret = par->fbtftops.write (par, par->buf, len);if (ret <0 ) {
@@ -174,8 +175,9 @@ static int init_display(struct fbtft_par *par)write_reg (par,0x00 ); version =firmware_version (par); -fbtft_par_dbg (DEBUG_INIT_DISPLAY , par,"Firmware version: %x.%02x\n" , - version >>8 , version &0xFF ); +fbtft_par_dbg (DEBUG_INIT_DISPLAY , par, +"Firmware version: %x.%02x\n" , + version >>8 , version &0xFF );if (mode ==332 ) par->fbtftops.write_vmem = write_vmem_8bit;
@@ -226,9 +228,9 @@ static int backlight_chip_update_status(struct backlight_device *bd)int brightness = bd->props.brightness;fbtft_par_dbg (DEBUG_BACKLIGHT , par, -"%s: brightness=%d, power=%d, fb_blank=%d\n" , - __func__, bd->props.brightness, bd->props.power, - bd->props.fb_blank); +"%s: brightness=%d, power=%d, fb_blank=%d\n" , + __func__, bd->props.brightness, bd->props.power, + bd->props.fb_blank);if (bd->props.power !=FB_BLANK_UNBLANK ) brightness =0 ;
@@ -256,7 +258,8 @@ static void register_chip_backlight(struct fbtft_par *par) bl_props.brightness =DEFAULT_BRIGHTNESS ; bd =backlight_device_register (dev_driver_string (par->info->device), - par->info->device, par, &bl_ops, &bl_props); + par->info->device, par, + &bl_ops, &bl_props);if (IS_ERR (bd)) { dev_err(par->info->device, "cannot register backlight device (%ld)\n",
drivers/staging/fbtft/fbtft-bus.c +13 -8
@@ -79,7 +79,8 @@ void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int);va_end (args);fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, - par->info->device, u8, buf, len,"%s: " , __func__); + par->info->device, u8, buf, len,"%s: " , + __func__); }if (len <=0 )return ;
@@ -129,7 +130,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)size_t startbyte_size =0 ;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len); remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset);
@@ -153,8 +154,10 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)while (remain) { to_copy =min (tx_array_size, remain); -dev_dbg (par->info->device," to_copy=%zu, remain=%zu\n" , - to_copy, remain - to_copy); +dev_dbg (par->info->device, +"to_copy=%zu, remain=%zu\n" , + to_copy, + remain - to_copy);for (i =0 ; i < to_copy; i++) txbuf16[i] =cpu_to_be16 (vmem16[i]);
@@ -183,7 +186,7 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)int ret =0 ;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len);if (!par->txbuf.buf) {dev_err (par->info->device,"%s: txbuf.buf is NULL\n" , __func__);
@@ -197,8 +200,10 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)while (remain) { to_copy =min (tx_array_size, remain); -dev_dbg (par->info->device," to_copy=%zu, remain=%zu\n" , - to_copy, remain - to_copy); +dev_dbg (par->info->device, +"to_copy=%zu, remain=%zu\n" , + to_copy, + remain - to_copy);#ifdef __LITTLE_ENDIANfor (i =0 ; i < to_copy; i +=2 ) {
@@ -233,7 +238,7 @@ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len)u16 *vmem16;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len); vmem16 = (u16 *)(par->info->screen_buffer + offset);
drivers/staging/fbtft/fbtft-core.c +36 -21
135 lines not on this page · raw message
drivers/staging/fbtft/fbtft-io.c +9 -8
@@ -14,7 +14,7 @@ int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len)struct spi_message m;fbtft_par_dbg_hex (DEBUG_WRITE , par, par->info->device, u8, buf, len, -"%s(len=%d): " , __func__, len); +"%s(len=%d): " , __func__, len);if (!par->spi) { dev_err(par->info->device,
@@ -47,7 +47,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len)u64 val, dc, tmp;fbtft_par_dbg_hex (DEBUG_WRITE , par, par->info->device, u8, buf, len, -"%s(len=%d): " , __func__, len); +"%s(len=%d): " , __func__, len);if (!par->extra) { dev_err(par->info->device, "%s: error: par->extra is NULL\n",
@@ -109,14 +109,15 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len) txbuf[0 ] = par->startbyte |0x3 ; t.tx_buf = txbuf;fbtft_par_dbg_hex (DEBUG_READ , par, par->info->device, u8, - txbuf, len,"%s(len=%d) txbuf => " , __func__, len); + txbuf, len,"%s(len=%d) txbuf => " , + __func__, len); }spi_message_init (&m);spi_message_add_tail (&t, &m); ret =spi_sync (par->spi, &m);fbtft_par_dbg_hex (DEBUG_READ , par, par->info->device, u8, buf, len, -"%s(len=%d) buf <= " , __func__, len); +"%s(len=%d) buf <= " , __func__, len);return ret; }
@@ -135,7 +136,7 @@ int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len)#endif fbtft_par_dbg_hex (DEBUG_WRITE , par, par->info->device, u8, buf, len, -"%s(len=%d): " , __func__, len); +"%s(len=%d): " , __func__, len);while (len--) { data = *(u8 *)buf;
@@ -151,7 +152,7 @@ int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len)for (i =0 ; i <8 ; i++) {if ((data &1 ) != (prev_data &1 ))gpio_set_value (par->gpio.db[i], - data &1 ); + data &1 ); data >>=1 ; prev_data >>=1 ; }
@@ -185,7 +186,7 @@ int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len)#endif fbtft_par_dbg_hex (DEBUG_WRITE , par, par->info->device, u8, buf, len, -"%s(len=%d): " , __func__, len); +"%s(len=%d): " , __func__, len);while (len) { data = *(u16 *)buf;
@@ -201,7 +202,7 @@ int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len)for (i =0 ; i <16 ; i++) {if ((data &1 ) != (prev_data &1 ))gpio_set_value (par->gpio.db[i], - data &1 ); + data &1 ); data >>=1 ; prev_data >>=1 ; }
drivers/staging/fbtft/fbtft-sysfs.c +3 -1
@@ -126,7 +126,9 @@ static ssize_t store_gamma_curve(struct device *device,mutex_lock (&par->gamma.lock);memcpy (par->gamma.curves, tmp_curves, - par->gamma.num_curves * par->gamma.num_values *sizeof (tmp_curves[0 ])); + par->gamma.num_curves + * par->gamma.num_values + *sizeof (tmp_curves[0 ]));mutex_unlock (&par->gamma.lock);return count;
drivers/staging/fbtft/fbtft.h +30 -8
@@ -64,16 +64,20 @@ struct fbtft_ops {void (*write_register)(struct fbtft_par *par,int len, ...);void (*set_addr_win)(struct fbtft_par *par, -int xs,int ys,int xe,int ye); +int xs, +int ys, +int xe, +int ye);void (*reset)(struct fbtft_par *par);void (*mkdirty)(struct fb_info *info,int from,int to);void (*update_display)(struct fbtft_par *par, -unsigned int start_line,unsigned int end_line); +unsigned int start_line, +unsigned int end_line);int (*init_display)(struct fbtft_par *par);int (*blank)(struct fbtft_par *par,bool on);unsigned long (*request_gpios_match)(struct fbtft_par *par, -const struct fbtft_gpio *gpio); +const struct fbtft_gpio *gpio);int (*request_gpios)(struct fbtft_par *par);int (*verify_gpios)(struct fbtft_par *par);
@@ -348,11 +352,29 @@ module_exit(fbtft_driver_module_exit);/* shorthand debug levels */ #define DEBUG_LEVEL_1 DEBUG_REQUEST_GPIOS -#define DEBUG_LEVEL_2 (DEBUG_LEVEL_1 | DEBUG_DRIVER_INIT_FUNCTIONS | DEBUG_TIME_FIRST_UPDATE) -#define DEBUG_LEVEL_3 (DEBUG_LEVEL_2 | DEBUG_RESET | DEBUG_INIT_DISPLAY | DEBUG_BLANK | DEBUG_REQUEST_GPIOS | DEBUG_FREE_GPIOS | DEBUG_VERIFY_GPIOS | DEBUG_BACKLIGHT | DEBUG_SYSFS) -#define DEBUG_LEVEL_4 (DEBUG_LEVEL_2 | DEBUG_FB_READ | DEBUG_FB_WRITE | DEBUG_FB_FILLRECT | DEBUG_FB_COPYAREA | DEBUG_FB_IMAGEBLIT | DEBUG_FB_BLANK) -#define DEBUG_LEVEL_5 (DEBUG_LEVEL_3 | DEBUG_UPDATE_DISPLAY) -#define DEBUG_LEVEL_6 (DEBUG_LEVEL_4 | DEBUG_LEVEL_5) +#define DEBUG_LEVEL_2 (DEBUG_LEVEL_1 |\ + DEBUG_DRIVER_INIT_FUNCTIONS |\ + DEBUG_TIME_FIRST_UPDATE) +#define DEBUG_LEVEL_3 (DEBUG_LEVEL_2 |\ + DEBUG_RESET |\ + DEBUG_INIT_DISPLAY |\ + DEBUG_BLANK |\ + DEBUG_REQUEST_GPIOS |\ + DEBUG_FREE_GPIOS |\ + DEBUG_VERIFY_GPIOS |\ + DEBUG_BACKLIGHT |\ + DEBUG_SYSFS) +#define DEBUG_LEVEL_4 (DEBUG_LEVEL_2 |\ + DEBUG_FB_READ |\ + DEBUG_FB_WRITE |\ + DEBUG_FB_FILLRECT |\ + DEBUG_FB_COPYAREA |\ + DEBUG_FB_IMAGEBLIT |\ + DEBUG_FB_BLANK) +#define DEBUG_LEVEL_5 (DEBUG_LEVEL_3 |\ + DEBUG_UPDATE_DISPLAY) +#define DEBUG_LEVEL_6 (DEBUG_LEVEL_4 |\ + DEBUG_LEVEL_5)#define DEBUG_LEVEL_7 0xFFFFFFFF#define DEBUG_DRIVER_INIT_FUNCTIONS (1<<3)
drivers/staging/fbtft/fbtft_device.c +24 -20
124 lines not on this page · raw message
drivers/staging/fbtft/flexfb.c +29 -17
75 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 4/11 staging: fbtft: Adjust some empty-line problems - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fb_s6d02a1.c | 1 - drivers/staging/fbtft/fb_s6d1121.c | 1 + drivers/staging/fbtft/fb_ssd1289.c | 1 + drivers/staging/fbtft/fbtft_device.c | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_s6d02a1.c +0 -1
@@ -16,7 +16,6 @@#define DRVNAME "fb_s6d02a1"static const s16 default_init_sequence[] = { --1 ,0xf0 ,0x5a ,0x5a ,-1 ,0xfc ,0x5a ,0x5a ,
drivers/staging/fbtft/fb_s6d1121.c +1 -0
@@ -154,6 +154,7 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)return 0 ; } +#undef CURVEstatic struct fbtft_display display = {
drivers/staging/fbtft/fb_ssd1289.c +1 -0
@@ -153,6 +153,7 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)return 0 ; } +#undef CURVEstatic struct fbtft_display display = {
drivers/staging/fbtft/fbtft_device.c +0 -2
@@ -840,7 +840,6 @@ static struct fbtft_device_display displays[] = { } } }, { - .name = "piscreen", .spi = &(struct spi_board_info ) { .modalias = "fb_ili9486",
@@ -1586,7 +1585,6 @@ static void __exit fbtft_device_exit(void)if (p_device)platform_device_unregister (p_device); - }arch_initcall (fbtft_device_init);
Signature · 1 line
2.18.0
PATCH 6/11 staging: fbtft: Fixes some defines styles - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft-bus.c | 10 ++++++---- drivers/staging/fbtft/fbtft-core.c | 6 ++++-- drivers/staging/fbtft/fbtft.h | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/staging/fbtft/fbtft-bus.c +6 -4
@@ -60,11 +60,13 @@ void func(struct fbtft_par *par, int len, ...) \ out: \va_end (args); \ } \ -EXPORT_SYMBOL (func); +EXPORT_SYMBOL(func) -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) -define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, ) +#define no_modf/*No modifier*/ + +define_fbtft_write_reg (fbtft_write_reg8_bus8, u8, u8, no_modf); +define_fbtft_write_reg (fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16); +define_fbtft_write_reg (fbtft_write_reg16_bus16, u16, u16, no_modf);void fbtft_write_reg8_bus9 (struct fbtft_par *par,int len, ...) {
drivers/staging/fbtft/fbtft-core.c +4 -2
@@ -278,6 +278,7 @@ void fbtft_unregister_backlight(struct fbtft_par *par) par->info->bl_dev =NULL ; } } +EXPORT_SYMBOL (fbtft_unregister_backlight);static const struct backlight_ops fbtft_bl_ops = { .get_brightness = fbtft_backlight_get_brightness,
@@ -315,12 +316,13 @@ void fbtft_register_backlight(struct fbtft_par *par)if (!par->fbtftops.unregister_backlight) par->fbtftops.unregister_backlight = fbtft_unregister_backlight; } +EXPORT_SYMBOL (fbtft_register_backlight);#else void fbtft_register_backlight (struct fbtft_par *par) { }; -void fbtft_unregister_backlight (struct fbtft_par *par) { }; -#endif EXPORT_SYMBOL (fbtft_register_backlight); +void fbtft_unregister_backlight (struct fbtft_par *par) { };EXPORT_SYMBOL (fbtft_unregister_backlight); +#endif static void fbtft_set_addr_win (struct fbtft_par *par,int xs,int ys,int xe,int ye)
drivers/staging/fbtft/fbtft.h +2 -2
@@ -236,7 +236,7 @@ struct fbtft_par {bool polarity; }; -#define NUMARGS (...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) +#define NUMARGS (...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int))#define write_reg (par, ...) \ ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
@@ -346,7 +346,7 @@ static void __exit fbtft_driver_module_exit(void) \ } \ \module_init (fbtft_driver_module_init); \ -module_exit (fbtft_driver_module_exit); +module_exit (fbtft_driver_module_exit)/* Debug macros */
Signature · 1 line
2.18.0
PATCH 7/11 staging: fbtft: Includes description to mutex and spinlock - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft.h +2 -2
@@ -207,7 +207,7 @@ struct fbtft_par {u8 *buf;u8 startbyte;struct fbtft_ops fbtftops; -spinlock_t dirty_lock; +spinlock_t dirty_lock;/*Protects dirty_lines_{start,end}*/ unsigned int dirty_lines_start;unsigned int dirty_lines_end;struct {
@@ -223,7 +223,7 @@ struct fbtft_par { } gpio;const s16 *init_sequence;struct { -struct mutex lock; +struct mutex lock;/*Mutex for Gamma curve locking*/ u32 *curves;int num_values;int num_curves;
Signature · 1 line
2.18.0
PATCH 8/11 staging: fbtft: Add spaces around / - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fbtft-core.c +1 -1
@@ -775,7 +775,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, fbops->fb_setcolreg = fbtft_fb_setcolreg; fbops->fb_blank = fbtft_fb_blank; - fbdefio->delay =HZ /fps; + fbdefio->delay =HZ / fps; fbdefio->deferred_io = fbtft_deferred_io;fb_deferred_io_init (info);
Signature · 1 line
2.18.0
PATCH 9/11 staging: fbtft: Corrects long index line - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft-sysfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/staging/fbtft/fbtft-sysfs.c +5 -1
@@ -25,6 +25,7 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves,unsigned long val =0 ;int ret =0 ;int curve_counter, value_counter; +unsigned long idx;fbtft_par_dbg (DEBUG_SYSFS , par,"%s() str=\n" , __func__);
@@ -68,7 +69,10 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves, ret =get_next_ulong (&curve_p, &val," " ,16 );if (ret) goto out; - curves[curve_counter * par->gamma.num_values + value_counter] = val; + idx = curve_counter + * par->gamma.num_values + + value_counter; + curves[idx] = val; value_counter++; }if (value_counter != par->gamma.num_values) {
Signature · 1 line
2.18.0
PATCH 10/11 staging: fbtft: Replaces (1 << n) for macro BIT(n) - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft.h | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-)
drivers/staging/fbtft/fbtft.h +28 -28
@@ -377,39 +377,39 @@ module_exit(fbtft_driver_module_exit) DEBUG_LEVEL_5)#define DEBUG_LEVEL_7 0xFFFFFFFF -#define DEBUG_DRIVER_INIT_FUNCTIONS (1<<3) -#define DEBUG_TIME_FIRST_UPDATE (1<<4) -#define DEBUG_TIME_EACH_UPDATE (1<<5) -#define DEBUG_DEFERRED_IO (1<<6) -#define DEBUG_FBTFT_INIT_FUNCTIONS (1<<7) +#define DEBUG_DRIVER_INIT_FUNCTIONS BIT(3) +#define DEBUG_TIME_FIRST_UPDATE BIT(4) +#define DEBUG_TIME_EACH_UPDATE BIT(5) +#define DEBUG_DEFERRED_IO BIT(6) +#define DEBUG_FBTFT_INIT_FUNCTIONS BIT(7)/* fbops */ -#define DEBUG_FB_READ (1<<8) -#define DEBUG_FB_WRITE (1<<9) -#define DEBUG_FB_FILLRECT (1<<10) -#define DEBUG_FB_COPYAREA (1<<11) -#define DEBUG_FB_IMAGEBLIT (1<<12) -#define DEBUG_FB_SETCOLREG (1<<13) -#define DEBUG_FB_BLANK (1<<14) +#define DEBUG_FB_READ BIT(8) +#define DEBUG_FB_WRITE BIT(9) +#define DEBUG_FB_FILLRECT BIT(10) +#define DEBUG_FB_COPYAREA BIT(11) +#define DEBUG_FB_IMAGEBLIT BIT(12) +#define DEBUG_FB_SETCOLREG BIT(13) +#define DEBUG_FB_BLANK BIT(14) -#define DEBUG_SYSFS (1<<16) +#define DEBUG_SYSFS BIT(16)/* fbtftops */ -#define DEBUG_BACKLIGHT (1<<17) -#define DEBUG_READ (1<<18) -#define DEBUG_WRITE (1<<19) -#define DEBUG_WRITE_VMEM (1<<20) -#define DEBUG_WRITE_REGISTER (1<<21) -#define DEBUG_SET_ADDR_WIN (1<<22) -#define DEBUG_RESET (1<<23) -#define DEBUG_MKDIRTY (1<<24) -#define DEBUG_UPDATE_DISPLAY (1<<25) -#define DEBUG_INIT_DISPLAY (1<<26) -#define DEBUG_BLANK (1<<27) -#define DEBUG_REQUEST_GPIOS (1<<28) -#define DEBUG_FREE_GPIOS (1<<29) -#define DEBUG_REQUEST_GPIOS_MATCH (1<<30) -#define DEBUG_VERIFY_GPIOS (1<<31) +#define DEBUG_BACKLIGHT BIT(17) +#define DEBUG_READ BIT(18) +#define DEBUG_WRITE BIT(19) +#define DEBUG_WRITE_VMEM BIT(20) +#define DEBUG_WRITE_REGISTER BIT(21) +#define DEBUG_SET_ADDR_WIN BIT(22) +#define DEBUG_RESET BIT(23) +#define DEBUG_MKDIRTY BIT(24) +#define DEBUG_UPDATE_DISPLAY BIT(25) +#define DEBUG_INIT_DISPLAY BIT(26) +#define DEBUG_BLANK BIT(27) +#define DEBUG_REQUEST_GPIOS BIT(28) +#define DEBUG_FREE_GPIOS BIT(29) +#define DEBUG_REQUEST_GPIOS_MATCH BIT(30) +#define DEBUG_VERIFY_GPIOS BIT(31) #define fbtft_init_dbg(dev, format, arg...) \ do { \
Signature · 1 line
2.18.0
PATCH 11/11 staging: fbtft: Includes parenthesis around macro parameters and avoids multiple usage of macro parameter - Style
In reply to Leonardo Brás--- drivers/staging/fbtft/fbtft.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/staging/fbtft/fbtft.h +11 -7
@@ -411,17 +411,21 @@ module_exit(fbtft_driver_module_exit)#define DEBUG_REQUEST_GPIOS_MATCH BIT(30)#define DEBUG_VERIFY_GPIOS BIT(31) -#define fbtft_init_dbg(dev, format, arg...) \ -do { \ - if (unlikely((dev)->platform_data && \ - (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \ - dev_info(dev, format, ##arg); \ +#define fbtft_init_dbg(dev, format, arg...) \ +do { \ + typeof(dev) _dev = (dev); \ + struct fbtft_platform_data *pddev = (void *)_dev->platform_data;\ + if (unlikely(pddev && \ + (pddev->display.debug & \ + DEBUG_DRIVER_INIT_FUNCTIONS))) \ + dev_info(_dev, (format), ##arg); \ } while (0) #define fbtft_par_dbg(level, par, format, arg...) \ do { \ - if (unlikely(par->debug & level)) \ - dev_info(par->info->device, format, ##arg); \ + typeof(par) _par = (par); \ + if (unlikely(_par->debug & (level))) \ + dev_info(_par->info->device, format, ##arg); \ } while (0) #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \
Signature · 1 line
2.18.0
Re: [PATCH 01/11] staging: fbtft: Changes udelay(n) to usleep_range(n, n + 1). - Style
In reply to Leonardo BrásWe need a commit message here.
Quoted 14 lines · Leonardo Brás
Signed-off-by Leonardo Brás <[email protected]>--- drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- drivers/staging/fbtft/fb_ra8875.c | 4 ++-- drivers/staging/fbtft/fb_tinylcd.c | 2 +- drivers/staging/fbtft/fb_upd161704.c | 19 +++++++++---------- drivers/staging/fbtft/fb_watterott.c | 4 ++-- 5 files changed, 15 insertions(+), 16 deletions(-)drivers/staging/fbtft/fb_agm1264k-fl.c +0
-0
drivers/staging/fbtft/fb_agm1264k-fl.c static void reset(struct fbtft_par *par) · line 88
Quoted 5 lines
drivers/staging/fbtft/fb_agm1264k-fl.c +1
-1@@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)dev_dbg (par->info->device,"%s()\n" , __func__);gpio_set_value (par->gpio.reset,0 ); -udelay (20 ); +usleep_range (20 ,21 );
Is this really the right range? It feels tight.
drivers/staging/fbtft/fb_agm1264k-fl.c static void reset(struct fbtft_par *par) · line 90
Quoted 2 lines
drivers/staging/fbtft/fb_agm1264k-fl.c +0
-0gpio_set_value (par->gpio.reset,1 );mdelay (120 );
regards,
dan carpenter
Re: [PATCH 11/11] staging: fbtft: Includes parenthesis around macro parameters and avoids multiple usage of macro parameter - Style
In reply to Leonardo BrásQuoted 17 lines · Leonardo Brás
Signed-off-by Leonardo Brás <[email protected]>--- drivers/staging/fbtft/fbtft.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)drivers/staging/fbtft/fbtft.h +0
-4@@ -411,17 +411,21 @@ module_exit(fbtft_driver_module_exit)#define DEBUG_REQUEST_GPIOS_MATCH BIT(30)#define DEBUG_VERIFY_GPIOS BIT(31) -#define fbtft_init_dbg(dev, format, arg...) \ -do { \ - if (unlikely((dev)->platform_data && \ - (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \
drivers/staging/fbtft/fbtft.h module_exit(fbtft_driver_module_exit) · line 422
Quoted 10 lines
drivers/staging/fbtft/fbtft.h +8
-1- dev_info(dev, format, ##arg); \ +#define fbtft_init_dbg(dev, format, arg...) \ +do { \ + typeof(dev) _dev = (dev); \ + struct fbtft_platform_data *pddev = (void *)_dev->platform_data;\ + if (unlikely(pddev && \ + (pddev->display.debug & \ + DEBUG_DRIVER_INIT_FUNCTIONS))) \ + dev_info(_dev, (format), ##arg); \ } while (0)
We're never going to hit this bug ever... Let's not over engineer things just for pretend reasons.
Also let's just delete this and replace it with dev_dbg(). You can turn dev_dbg on for just one function so it already provides everything we need.
regards,
dan carpenter
Re: [PATCH 03/11] staging: fbtft: Fixes some alignment and line > 80 char issues - Style
In reply to Leonardo BrásSplit this up into two patches. One which changes alignment and one which does the 80 character limit...
Quoted 63 lines · Leonardo Brás
Signed-off-by Leonardo Brás <[email protected]>--- drivers/staging/fbtft/fb_ssd1289.c | 6 +-- drivers/staging/fbtft/fb_ssd1306.c | 3 +- drivers/staging/fbtft/fb_ssd1331.c | 9 ++++- drivers/staging/fbtft/fb_ssd1351.c | 43 +++++++++++++-------- drivers/staging/fbtft/fb_st7735r.c | 19 +++++++--- drivers/staging/fbtft/fb_st7789v.c | 13 +++---- drivers/staging/fbtft/fb_watterott.c | 17 +++++---- drivers/staging/fbtft/fbtft-bus.c | 21 ++++++---- drivers/staging/fbtft/fbtft-core.c | 57 ++++++++++++++++++---------- drivers/staging/fbtft/fbtft-io.c | 17 +++++---- drivers/staging/fbtft/fbtft-sysfs.c | 4 +- drivers/staging/fbtft/fbtft.h | 38 +++++++++++++++---- drivers/staging/fbtft/fbtft_device.c | 44 +++++++++++---------- drivers/staging/fbtft/flexfb.c | 46 +++++++++++++--------- 14 files changed, 214 insertions(+), 123 deletions(-)drivers/staging/fbtft/fb_ssd1289.c +3
-3@@ -38,7 +38,7 @@ static int init_display(struct fbtft_par *par)write_reg (par,0x0E ,0x2B00 );write_reg (par,0x1E ,0x00B7 );write_reg (par,0x01 , -BIT (13 ) | (par->bgr <<11 ) |BIT (9 ) | (HEIGHT -1 )); +BIT (13 ) | (par->bgr <<11 ) |BIT (9 ) | (HEIGHT -1 ));write_reg (par,0x02 ,0x0600 );write_reg (par,0x10 ,0x0000 );write_reg (par,0x05 ,0x0000 );@@ -98,8 +98,8 @@ static int set_var(struct fbtft_par *par)if (par->fbtftops.init_display != init_display) {/* don't risk messing up register 11h */ fbtft_par_dbg (DEBUG_INIT_DISPLAY , par, -"%s: skipping since custom init_display() is used\n" , - __func__); +"%s: skipping since custom init_display() is used\n" , + __func__);return 0 ; }drivers/staging/fbtft/fb_ssd1306.c +2
-1@@ -184,7 +184,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)for (y =0 ; y < yres /8 ; y++) { *buf =0x00 ;for (i =0 ; i <8 ; i++) - *buf |= (vmem16[(y *8 + i) * xres + x] ?1 :0 ) << i; + *buf |= (vmem16[(y *8 + i) * xres + x] ? +1 :0 ) << i; buf++; } }drivers/staging/fbtft/fb_ssd1331.c +0
-0@@ -74,7 +74,14 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)for (i =0 ; i < len; i++) buf[i] = (u8)va_arg(args, unsigned int);
drivers/staging/fbtft/fb_ssd1331.c static void write_reg8_bus8(struct fbtft_par *par, int len, ...) · line 84
Quoted 10 lines
drivers/staging/fbtft/fb_ssd1331.c +8
-1va_end (args); -fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, par->info->device, u8, buf, len,"%s: " , __func__); +fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , + par, + par->info->device, + u8, + buf, + len, +"%s: " , + __func__);
Do it like this:
fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, u8, buf, len, "%s: ", __func__);
Quoted 8 lines
drivers/staging/fbtft/fb_ssd1331.c +0
-0}va_start (args, len);drivers/staging/fbtft/fb_ssd1351.c +0
-0
drivers/staging/fbtft/fb_ssd1351.c static int set_gamma(struct fbtft_par *par, u32 *curves) · line 130
Quoted 6 lines
drivers/staging/fbtft/fb_ssd1351.c +2
-1@@ -126,35 +126,45 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)for (i =0 ; i <63 ; i++) {if (i >0 && curves[i] <2 ) {dev_err (par->info->device, -"Illegal value in Grayscale Lookup Table at index %d. Must be greater than 1\n" , i); +"Illegal value in Grayscale Lookup Table at index %d. Must be greater than 1\n" , + i);
You would think this warning should print what's stored in curves[i].
Quoted 38 lines
drivers/staging/fbtft/fb_ssd1351.c +18
-9return -EINVAL ; } acc += curves[i]; tmp[i] = acc;if (acc >180 ) {dev_err (par->info->device, -"Illegal value(s) in Grayscale Lookup Table. At index=%d, the accumulated value has exceeded 180\n" , i); +"Illegal value(s) in Grayscale Lookup Table. At index=%d, the accumulated value has exceeded 180\n" , + i);return -EINVAL ; } }write_reg (par,0xB8 , - tmp[0 ], tmp[1 ], tmp[2 ], tmp[3 ], tmp[4 ], tmp[5 ], tmp[6 ], tmp[7 ], - tmp[8 ], tmp[9 ], tmp[10 ], tmp[11 ], tmp[12 ], tmp[13 ], tmp[14 ], tmp[15 ], - tmp[16 ], tmp[17 ], tmp[18 ], tmp[19 ], tmp[20 ], tmp[21 ], tmp[22 ], tmp[23 ], - tmp[24 ], tmp[25 ], tmp[26 ], tmp[27 ], tmp[28 ], tmp[29 ], tmp[30 ], tmp[31 ], - tmp[32 ], tmp[33 ], tmp[34 ], tmp[35 ], tmp[36 ], tmp[37 ], tmp[38 ], tmp[39 ], - tmp[40 ], tmp[41 ], tmp[42 ], tmp[43 ], tmp[44 ], tmp[45 ], tmp[46 ], tmp[47 ], - tmp[48 ], tmp[49 ], tmp[50 ], tmp[51 ], tmp[52 ], tmp[53 ], tmp[54 ], tmp[55 ], - tmp[56 ], tmp[57 ], tmp[58 ], tmp[59 ], tmp[60 ], tmp[61 ], tmp[62 ]); + tmp[0 ], tmp[1 ], tmp[2 ], tmp[3 ], + tmp[4 ], tmp[5 ], tmp[6 ], tmp[7 ], + tmp[8 ], tmp[9 ], tmp[10 ], tmp[11 ], + tmp[12 ], tmp[13 ], tmp[14 ], tmp[15 ], + tmp[16 ], tmp[17 ], tmp[18 ], tmp[19 ], + tmp[20 ], tmp[21 ], tmp[22 ], tmp[23 ], + tmp[24 ], tmp[25 ], tmp[26 ], tmp[27 ], + tmp[28 ], tmp[29 ], tmp[30 ], tmp[31 ], + tmp[32 ], tmp[33 ], tmp[34 ], tmp[35 ], + tmp[36 ], tmp[37 ], tmp[38 ], tmp[39 ], + tmp[40 ], tmp[41 ], tmp[42 ], tmp[43 ], + tmp[44 ], tmp[45 ], tmp[46 ], tmp[47 ], + tmp[48 ], tmp[49 ], tmp[50 ], tmp[51 ], + tmp[52 ], tmp[53 ], tmp[54 ], tmp[55 ], + tmp[56 ], tmp[57 ], tmp[58 ], tmp[59 ], + tmp[60 ], tmp[61 ], tmp[62 ]);
drivers/staging/fbtft/fb_ssd1351.c static int set_gamma(struct fbtft_par *par, u32 *curves) · line 167
Quoted 10 lines
drivers/staging/fbtft/fb_ssd1351.c +2
-2return 0 ; }static int blank (struct fbtft_par *par,bool on) { -fbtft_par_dbg (DEBUG_BLANK , par,"%s(blank=%s)\n" , - __func__, on ?"true" :"false" ); +fbtft_par_dbg (DEBUG_BLANK , par,"(%s=%s)\n" , + __func__, on ?"true" :"false" );
The message change is unrelated.
Quoted 163 lines
drivers/staging/fbtft/fb_ssd1351.c +6
-3if (on)write_reg (par,0xAE );else @@ -185,8 +195,8 @@ static int update_onboard_backlight(struct backlight_device *bd)bool on;fbtft_par_dbg (DEBUG_BACKLIGHT , par, -"%s: power=%d, fb_blank=%d\n" , - __func__, bd->props.power, bd->props.fb_blank); +"%s: power=%d, fb_blank=%d\n" , + __func__, bd->props.power, bd->props.fb_blank); on = (bd->props.power ==FB_BLANK_UNBLANK ) && (bd->props.fb_blank ==FB_BLANK_UNBLANK );@@ -209,7 +219,10 @@ static void register_onboard_backlight(struct fbtft_par *par) bl_props.power =FB_BLANK_POWERDOWN ; bd =backlight_device_register (dev_driver_string (par->info->device), - par->info->device, par, &bl_ops, &bl_props); + par->info->device, + par, + &bl_ops, + &bl_props);if (IS_ERR (bd)) { dev_err(par->info->device, "cannot register backlight device (%ld)\n",drivers/staging/fbtft/fb_st7735r.c +13
-6@@ -130,8 +130,10 @@ static int set_var(struct fbtft_par *par)/* * Gamma string format: -* 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 +* 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)]static int set_gamma (struct fbtft_par *par,u32 *curves)@@ -145,13 +147,18 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)for (i =0 ; i < par->gamma.num_curves; i++)write_reg (par,0xE0 + i, -CURVE (i,0 ),CURVE (i,1 ),CURVE (i,2 ),CURVE (i,3 ), -CURVE (i,4 ),CURVE (i,5 ),CURVE (i,6 ),CURVE (i,7 ), -CURVE (i,8 ),CURVE (i,9 ),CURVE (i,10 ),CURVE (i,11 ), -CURVE (i,12 ),CURVE (i,13 ),CURVE (i,14 ),CURVE (i,15 )); +CURVE (i,0 ),CURVE (i,1 ), +CURVE (i,2 ),CURVE (i,3 ), +CURVE (i,4 ),CURVE (i,5 ), +CURVE (i,6 ),CURVE (i,7 ), +CURVE (i,8 ),CURVE (i,9 ), +CURVE (i,10 ),CURVE (i,11 ), +CURVE (i,12 ),CURVE (i,13 ), +CURVE (i,14 ),CURVE (i,15 ));return 0 ; } +#undef CURVEstatic struct fbtft_display display = {drivers/staging/fbtft/fb_st7789v.c +6
-7@@ -201,13 +201,12 @@ static int set_gamma(struct fbtft_par *par, u32 *curves) c = i * par->gamma.num_values;for (j =0 ; j < par->gamma.num_values; j++) curves[c + j] &= gamma_par_mask[j]; -write_reg ( - par,PVGAMCTRL + i, - curves[c +0 ], curves[c +1 ], curves[c +2 ], - curves[c +3 ], curves[c +4 ], curves[c +5 ], - curves[c +6 ], curves[c +7 ], curves[c +8 ], - curves[c +9 ], curves[c +10 ], curves[c +11 ], - curves[c +12 ], curves[c +13 ]); +write_reg (par,PVGAMCTRL + i, + curves[c +0 ], curves[c +1 ], curves[c +2 ], + curves[c +3 ], curves[c +4 ], curves[c +5 ], + curves[c +6 ], curves[c +7 ], curves[c +8 ], + curves[c +9 ], curves[c +10 ], curves[c +11 ], + curves[c +12 ], curves[c +13 ]); }return 0 ; }drivers/staging/fbtft/fb_watterott.c +10
-7@@ -46,7 +46,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)va_end (args);fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, - par->info->device, u8, par->buf, len,"%s: " , __func__); + par->info->device, u8, par->buf, + len,"%s: " , __func__); ret = par->fbtftops.write (par, par->buf, len);if (ret <0 ) {@@ -174,8 +175,9 @@ static int init_display(struct fbtft_par *par)write_reg (par,0x00 ); version =firmware_version (par); -fbtft_par_dbg (DEBUG_INIT_DISPLAY , par,"Firmware version: %x.%02x\n" , - version >>8 , version &0xFF ); +fbtft_par_dbg (DEBUG_INIT_DISPLAY , par, +"Firmware version: %x.%02x\n" , + version >>8 , version &0xFF );if (mode ==332 ) par->fbtftops.write_vmem = write_vmem_8bit;@@ -226,9 +228,9 @@ static int backlight_chip_update_status(struct backlight_device *bd)int brightness = bd->props.brightness;fbtft_par_dbg (DEBUG_BACKLIGHT , par, -"%s: brightness=%d, power=%d, fb_blank=%d\n" , - __func__, bd->props.brightness, bd->props.power, - bd->props.fb_blank); +"%s: brightness=%d, power=%d, fb_blank=%d\n" , + __func__, bd->props.brightness, bd->props.power, + bd->props.fb_blank);if (bd->props.power !=FB_BLANK_UNBLANK ) brightness =0 ;@@ -256,7 +258,8 @@ static void register_chip_backlight(struct fbtft_par *par) bl_props.brightness =DEFAULT_BRIGHTNESS ; bd =backlight_device_register (dev_driver_string (par->info->device), - par->info->device, par, &bl_ops, &bl_props); + par->info->device, par, + &bl_ops, &bl_props);if (IS_ERR (bd)) { dev_err(par->info->device, "cannot register backlight device (%ld)\n",drivers/staging/fbtft/fbtft-bus.c +3
-2@@ -79,7 +79,8 @@ void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int);va_end (args);fbtft_par_dbg_hex (DEBUG_WRITE_REGISTER , par, - par->info->device, u8, buf, len,"%s: " , __func__); + par->info->device, u8, buf, len,"%s: " , + __func__); }if (len <=0 )return ;@@ -129,7 +130,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)size_t startbyte_size =0 ;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len); remain = len /2 ; vmem16 = (u16 *)(par->info->screen_buffer + offset);
drivers/staging/fbtft/fbtft-bus.c int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) · line 160
Quoted 9 lines
drivers/staging/fbtft/fbtft-bus.c +4
-2@@ -153,8 +154,10 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)while (remain) { to_copy =min (tx_array_size, remain); -dev_dbg (par->info->device," to_copy=%zu, remain=%zu\n" , - to_copy, remain - to_copy); +dev_dbg (par->info->device, +"to_copy=%zu, remain=%zu\n" , + to_copy, + remain - to_copy);
I haven't commented on all these, but I'm hoping that you will redo them all, yeah?
dev_dbg(par->info->device, "to_copy=%zu, remain=%zu\n", to_copy, remain - to_copy);
Quoted 171 lines
drivers/staging/fbtft/fbtft-bus.c +6
-4for (i =0 ; i < to_copy; i++) txbuf16[i] =cpu_to_be16 (vmem16[i]);@@ -183,7 +186,7 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)int ret =0 ;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len);if (!par->txbuf.buf) {dev_err (par->info->device,"%s: txbuf.buf is NULL\n" , __func__);@@ -197,8 +200,10 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)while (remain) { to_copy =min (tx_array_size, remain); -dev_dbg (par->info->device," to_copy=%zu, remain=%zu\n" , - to_copy, remain - to_copy); +dev_dbg (par->info->device, +"to_copy=%zu, remain=%zu\n" , + to_copy, + remain - to_copy);#ifdef __LITTLE_ENDIANfor (i =0 ; i < to_copy; i +=2 ) {@@ -233,7 +238,7 @@ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len)u16 *vmem16;fbtft_par_dbg (DEBUG_WRITE_VMEM , par,"%s(offset=%zu, len=%zu)\n" , - __func__, offset, len); + __func__, offset, len); vmem16 = (u16 *)(par->info->screen_buffer + offset);drivers/staging/fbtft/fbtft-core.c +31
-18@@ -137,8 +137,8 @@ static int fbtft_request_gpios(struct fbtft_par *par) flags =fbtft_request_gpios_match (par, gpio);if (flags !=FBTFT_GPIO_NO_MATCH ) { ret =devm_gpio_request_one (par->info->device, - gpio->gpio, flags, - par->info->device->driver->name); + gpio->gpio, flags, + par->info->device->driver->name);if (ret <0 ) { dev_err(par->info->device, "%s: gpio_request_one('%s'=%d) failed with %d\n",@@ -249,8 +249,11 @@ static int fbtft_backlight_update_status(struct backlight_device *bd)bool polarity = par->polarity;fbtft_par_dbg (DEBUG_BACKLIGHT , par, -"%s: polarity=%d, power=%d, fb_blank=%d\n" , - __func__, polarity, bd->props.power, bd->props.fb_blank); +"%s: polarity=%d, power=%d, fb_blank=%d\n" , + __func__, + polarity, + bd->props.power, + bd->props.fb_blank);if ((bd->props.power ==FB_BLANK_UNBLANK ) && (bd->props.fb_blank ==FB_BLANK_UNBLANK ))@@ -372,7 +375,7 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line,if (start_line > par->info->var.yres -1 || end_line > par->info->var.yres -1 ) {dev_warn (par->info->device, -"%s: start_line=%u or end_line=%u is larger than max=%d. Shouldn't happen, will do full display update\n" , +"%s: start_line=%u or end_line=%u is larger than max=%d. Shouldn't happen, will do full display update\n" , __func__, start_line, end_line, par->info->var.yres -1 ); start_line =0 ;@@ -538,8 +541,11 @@ static unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf)return chan << bf->offset; } -static int fbtft_fb_setcolreg (unsigned int regno,unsigned int red,unsigned int green, -unsigned int blue,unsigned int transp, +static int fbtft_fb_setcolreg (unsigned int regno, +unsigned int red, +unsigned int green, +unsigned int blue, +unsigned int transp,struct fb_info *info) {unsigned int val;@@ -818,7 +824,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,if (par->gamma.curves && gamma) {if (fbtft_gamma_parse_str (par, - par->gamma.curves, gamma,strlen (gamma))) + par->gamma.curves, + gamma, +strlen (gamma))) goto alloc_fail; }@@ -1045,8 +1053,8 @@ static int fbtft_init_display_dt(struct fbtft_par *par)while (p && !(val &0xFFFF0000 )) {if (i >63 ) {dev_err (par->info->device, -"%s: Maximum register values exceeded\n" , - __func__); +"%s: Maximum register values exceeded\n" , + __func__);return -EINVAL ; } buf[i++] = val;@@ -1166,8 +1174,8 @@ int fbtft_init_display(struct fbtft_par *par)while (par->init_sequence[i] >=0 ) {if (j >63 ) {dev_err (par->info->device, -"%s: Maximum register values exceeded\n" , - __func__); +"%s: Maximum register values exceeded\n" , + __func__);return -EINVAL ; } buf[j++] = par->init_sequence[i++];@@ -1193,19 +1201,22 @@ int fbtft_init_display(struct fbtft_par *par)case -2 : i++;fbtft_par_dbg (DEBUG_INIT_DISPLAY , par, -"init: mdelay(%d)\n" , par->init_sequence[i]); +"init: mdelay(%d)\n" , + par->init_sequence[i]);mdelay (par->init_sequence[i++]);break ;default :dev_err (par->info->device,"unknown delimiter %d at position %d\n" , - par->init_sequence[i], i); + par->init_sequence[i], + i);return -EINVAL ; } }dev_err (par->info->device, -"%s: something is wrong. Shouldn't get here.\n" , __func__); +"%s: something is wrong. Shouldn't get here.\n" , + __func__);return -EINVAL ; }EXPORT_SYMBOL (fbtft_init_display);@@ -1225,8 +1236,9 @@ static int fbtft_verify_gpios(struct fbtft_par *par)fbtft_par_dbg (DEBUG_VERIFY_GPIOS , par,"%s()\n" , __func__); -if (pdata->display.buswidth !=9 && par->startbyte ==0 && - par->gpio.dc <0 ) { +if (pdata->display.buswidth !=9 && + par->startbyte ==0 && + par->gpio.dc <0 ) {dev_err (par->info->device,"Missing info about 'dc' gpio. Aborting.\n" );return -EINVAL ;@@ -1321,7 +1333,8 @@ static struct fbtft_platform_data *fbtft_probe_dt(struct device *dev)* Return: 0 if successful, negative if error */ int fbtft_probe_common (struct fbtft_display *display, -struct spi_device *sdev,struct platform_device *pdev) +struct spi_device *sdev, +struct platform_device *pdev) {struct device *dev;struct fb_info *info;@@ -1393,11 +1406,13 @@ int fbtft_probe_common(struct fbtft_display *display, par->spi->bits_per_word =9 ; }else { dev_warn(&par->spi->dev,
drivers/staging/fbtft/fbtft-core.c int fbtft_probe_common(struct fbtft_display *display, · line 1415
Quoted 10 lines
drivers/staging/fbtft/fbtft-core.c +5
-3- "9-bit SPI not available, emulating using 8-bit.\n"); + "9-bit SPI not available, emulating using 8-bit.\n");/* allocate buffer with room for dc bits */ par->extra =devm_kzalloc (par->info->device, - par->txbuf.len + (par->txbuf.len /8 ) +8 , -GFP_KERNEL ); + par->txbuf.len + + (par->txbuf.len /8 ) + +8 , +GFP_KERNEL );
I feel like this is not a readability improvement.
Quoted 8 lines
drivers/staging/fbtft/fbtft-core.c +0
-0if (!par->extra) { ret = -ENOMEM ; goto out_release;drivers/staging/fbtft/fbtft-sysfs.c +0
-0
drivers/staging/fbtft/fbtft-sysfs.c static ssize_t store_gamma_curve(struct device *device, · line 131
Quoted 7 lines
drivers/staging/fbtft/fbtft-sysfs.c +3
-1@@ -126,7 +126,9 @@ static ssize_t store_gamma_curve(struct device *device,mutex_lock (&par->gamma.lock);memcpy (par->gamma.curves, tmp_curves, - par->gamma.num_curves * par->gamma.num_values *sizeof (tmp_curves[0 ])); + par->gamma.num_curves + * par->gamma.num_values + *sizeof (tmp_curves[0 ]));
The operator goes on the first line:
memcpy(par->gamma.curves, tmp_curves,
par->gamma.num_curves * par->gamma.num_values * sizeof(tmp_curves[0]));
But really, the original is probably best. Just go over the 80 character limit if it improve readability.
regards,
dan carpenter