aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Roux <sed@free.fr>2018-09-07 17:54:45 -0400
committerKrzysztof Kozlowski <krzk@kernel.org>2018-09-10 13:00:57 -0400
commite728e4f2010063ac0f3a4f220cca14b3a334469d (patch)
tree633d31ed706ad7214930f309c6cb3896b6a43663
parentb2a13da505e8614f55dc4abb6e2067261be35a55 (diff)
ARM: s3c24xx: formatting cleanup in mach-mini2440.c
Running: scripts/checkpatch.pl -f arch/arm/mach-s3c24xx/mach-mini2440.c revealed several errors and warnings. They were all removed, except one which is an #if 0 around the declaration of a gpio pin. This needs some more investigation and I prefer to let it here. This is not some dead code. 'printk' was replaced by 'pr_info'. Signed-off-by: Cedric Roux <sed@free.fr> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c80
1 files changed, 43 insertions, 37 deletions
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index f9fc1f8d2b28..4a0bf6abba8c 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -64,8 +64,8 @@ static struct map_desc mini2440_iodesc[] __initdata = {
64}; 64};
65 65
66#define UCON S3C2410_UCON_DEFAULT 66#define UCON S3C2410_UCON_DEFAULT
67#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 67#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
68#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 68#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
69 69
70 70
71static struct s3c2410_uartcfg mini2440_uartcfgs[] __initdata = { 71static struct s3c2410_uartcfg mini2440_uartcfgs[] __initdata = {
@@ -104,8 +104,8 @@ static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = {
104/* 104/*
105 * This macro simplifies the table bellow 105 * This macro simplifies the table bellow
106 */ 106 */
107#define _LCD_DECLARE(_clock,_xres,margin_left,margin_right,hsync, \ 107#define _LCD_DECLARE(_clock, _xres, margin_left, margin_right, hsync, \
108 _yres,margin_top,margin_bottom,vsync, refresh) \ 108 _yres, margin_top, margin_bottom, vsync, refresh) \
109 .width = _xres, \ 109 .width = _xres, \
110 .xres = _xres, \ 110 .xres = _xres, \
111 .height = _yres, \ 111 .height = _yres, \
@@ -128,7 +128,7 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
128 [0] = { /* mini2440 + 3.5" TFT + touchscreen */ 128 [0] = { /* mini2440 + 3.5" TFT + touchscreen */
129 _LCD_DECLARE( 129 _LCD_DECLARE(
130 7, /* The 3.5 is quite fast */ 130 7, /* The 3.5 is quite fast */
131 240, 21, 38, 6, /* x timing */ 131 240, 21, 38, 6, /* x timing */
132 320, 4, 4, 2, /* y timing */ 132 320, 4, 4, 2, /* y timing */
133 60), /* refresh rate */ 133 60), /* refresh rate */
134 .lcdcon5 = (S3C2410_LCDCON5_FRM565 | 134 .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
@@ -140,7 +140,7 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
140 [1] = { /* mini2440 + 7" TFT + touchscreen */ 140 [1] = { /* mini2440 + 7" TFT + touchscreen */
141 _LCD_DECLARE( 141 _LCD_DECLARE(
142 10, /* the 7" runs slower */ 142 10, /* the 7" runs slower */
143 800, 40, 40, 48, /* x timing */ 143 800, 40, 40, 48, /* x timing */
144 480, 29, 3, 3, /* y timing */ 144 480, 29, 3, 3, /* y timing */
145 50), /* refresh rate */ 145 50), /* refresh rate */
146 .lcdcon5 = (S3C2410_LCDCON5_FRM565 | 146 .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
@@ -148,7 +148,7 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
148 S3C2410_LCDCON5_INVVFRAME | 148 S3C2410_LCDCON5_INVVFRAME |
149 S3C2410_LCDCON5_PWREN), 149 S3C2410_LCDCON5_PWREN),
150 }, 150 },
151 /* The VGA shield can outout at several resolutions. All share 151 /* The VGA shield can outout at several resolutions. All share
152 * the same timings, however, anything smaller than 1024x768 152 * the same timings, however, anything smaller than 1024x768
153 * will only be displayed in the top left corner of a 1024x768 153 * will only be displayed in the top left corner of a 1024x768
154 * XGA output unless you add optional dip switches to the shield. 154 * XGA output unless you add optional dip switches to the shield.
@@ -158,9 +158,10 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
158 _LCD_DECLARE( 158 _LCD_DECLARE(
159 10, 159 10,
160 1024, 1, 2, 2, /* y timing */ 160 1024, 1, 2, 2, /* y timing */
161 768, 200, 16, 16, /* x timing */ 161 768, 200, 16, 16, /* x timing */
162 24), /* refresh rate, maximum stable, 162 24), /* refresh rate, maximum stable,
163 tested with the FPGA shield */ 163 * tested with the FPGA shield
164 */
164 .lcdcon5 = (S3C2410_LCDCON5_FRM565 | 165 .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
165 S3C2410_LCDCON5_HWSWP), 166 S3C2410_LCDCON5_HWSWP),
166 }, 167 },
@@ -196,7 +197,8 @@ static struct s3c2410fb_mach_info mini2440_fb_info __initdata = {
196 197
197 /* Enable VD[2..7], VD[10..15], VD[18..23] and VCLK, syncs, VDEN 198 /* Enable VD[2..7], VD[10..15], VD[18..23] and VCLK, syncs, VDEN
198 * and disable the pull down resistors on pins we are using for LCD 199 * and disable the pull down resistors on pins we are using for LCD
199 * data. */ 200 * data.
201 */
200 202
201 .gpcup = (0xf << 1) | (0x3f << 10), 203 .gpcup = (0xf << 1) | (0x3f << 10),
202 204
@@ -232,10 +234,10 @@ static struct s3c2410fb_mach_info mini2440_fb_info __initdata = {
232/* MMC/SD */ 234/* MMC/SD */
233 235
234static struct s3c24xx_mci_pdata mini2440_mmc_cfg __initdata = { 236static struct s3c24xx_mci_pdata mini2440_mmc_cfg __initdata = {
235 .gpio_detect = S3C2410_GPG(8), 237 .gpio_detect = S3C2410_GPG(8),
236 .gpio_wprotect = S3C2410_GPH(8), 238 .gpio_wprotect = S3C2410_GPH(8),
237 .set_power = NULL, 239 .set_power = NULL,
238 .ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34, 240 .ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34,
239}; 241};
240 242
241/* NAND Flash on MINI2440 board */ 243/* NAND Flash on MINI2440 board */
@@ -254,7 +256,8 @@ static struct mtd_partition mini2440_default_nand_part[] __initdata = {
254 [2] = { 256 [2] = {
255 .name = "kernel", 257 .name = "kernel",
256 /* 5 megabytes, for a kernel with no modules 258 /* 5 megabytes, for a kernel with no modules
257 * or a uImage with a ramdisk attached */ 259 * or a uImage with a ramdisk attached
260 */
258 .size = 0x00500000, 261 .size = 0x00500000,
259 .offset = SZ_256K + SZ_128K, 262 .offset = SZ_256K + SZ_128K,
260 }, 263 },
@@ -271,7 +274,7 @@ static struct s3c2410_nand_set mini2440_nand_sets[] __initdata = {
271 .nr_chips = 1, 274 .nr_chips = 1,
272 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part), 275 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
273 .partitions = mini2440_default_nand_part, 276 .partitions = mini2440_default_nand_part,
274 .flash_bbt = 1, /* we use u-boot to create a BBT */ 277 .flash_bbt = 1, /* we use u-boot to create a BBT */
275 }, 278 },
276}; 279};
277 280
@@ -290,7 +293,7 @@ static struct s3c2410_platform_nand mini2440_nand_info __initdata = {
290static struct resource mini2440_dm9k_resource[] = { 293static struct resource mini2440_dm9k_resource[] = {
291 [0] = DEFINE_RES_MEM(MACH_MINI2440_DM9K_BASE, 4), 294 [0] = DEFINE_RES_MEM(MACH_MINI2440_DM9K_BASE, 4),
292 [1] = DEFINE_RES_MEM(MACH_MINI2440_DM9K_BASE + 4, 4), 295 [1] = DEFINE_RES_MEM(MACH_MINI2440_DM9K_BASE + 4, 4),
293 [2] = DEFINE_RES_NAMED(IRQ_EINT7, 1, NULL, IORESOURCE_IRQ \ 296 [2] = DEFINE_RES_NAMED(IRQ_EINT7, 1, NULL, IORESOURCE_IRQ
294 | IORESOURCE_IRQ_HIGHEDGE), 297 | IORESOURCE_IRQ_HIGHEDGE),
295}; 298};
296 299
@@ -362,7 +365,8 @@ static struct gpio_keys_button mini2440_buttons[] = {
362 }, 365 },
363#if 0 366#if 0
364 /* this pin is also known as TCLK1 and seems to already 367 /* this pin is also known as TCLK1 and seems to already
365 * marked as "in use" somehow in the kernel -- possibly wrongly */ 368 * marked as "in use" somehow in the kernel -- possibly wrongly
369 */
366 { 370 {
367 .gpio = S3C2410_GPG(11), /* K6 */ 371 .gpio = S3C2410_GPG(11), /* K6 */
368 .code = KEY_F6, 372 .code = KEY_F6,
@@ -564,7 +568,8 @@ static char mini2440_features_str[12] __initdata = "0tb";
564static int __init mini2440_features_setup(char *str) 568static int __init mini2440_features_setup(char *str)
565{ 569{
566 if (str) 570 if (str)
567 strlcpy(mini2440_features_str, str, sizeof(mini2440_features_str)); 571 strlcpy(mini2440_features_str, str,
572 sizeof(mini2440_features_str));
568 return 1; 573 return 1;
569} 574}
570 575
@@ -583,10 +588,10 @@ struct mini2440_features_t {
583}; 588};
584 589
585static void __init mini2440_parse_features( 590static void __init mini2440_parse_features(
586 struct mini2440_features_t * features, 591 struct mini2440_features_t *features,
587 const char * features_str ) 592 const char *features_str)
588{ 593{
589 const char * fp = features_str; 594 const char *fp = features_str;
590 595
591 features->count = 0; 596 features->count = 0;
592 features->done = 0; 597 features->done = 0;
@@ -598,13 +603,14 @@ static void __init mini2440_parse_features(
598 switch (f) { 603 switch (f) {
599 case '0'...'9': /* tft screen */ 604 case '0'...'9': /* tft screen */
600 if (features->done & FEATURE_SCREEN) { 605 if (features->done & FEATURE_SCREEN) {
601 printk(KERN_INFO "MINI2440: '%c' ignored, " 606 pr_info("MINI2440: '%c' ignored, screen type already set\n",
602 "screen type already set\n", f); 607 f);
603 } else { 608 } else {
604 int li = f - '0'; 609 int li = f - '0';
610
605 if (li >= ARRAY_SIZE(mini2440_lcd_cfg)) 611 if (li >= ARRAY_SIZE(mini2440_lcd_cfg))
606 printk(KERN_INFO "MINI2440: " 612 pr_info("MINI2440: '%c' out of range LCD mode\n",
607 "'%c' out of range LCD mode\n", f); 613 f);
608 else { 614 else {
609 features->optional[features->count++] = 615 features->optional[features->count++] =
610 &s3c_device_lcd; 616 &s3c_device_lcd;
@@ -615,8 +621,8 @@ static void __init mini2440_parse_features(
615 break; 621 break;
616 case 'b': 622 case 'b':
617 if (features->done & FEATURE_BACKLIGHT) 623 if (features->done & FEATURE_BACKLIGHT)
618 printk(KERN_INFO "MINI2440: '%c' ignored, " 624 pr_info("MINI2440: '%c' ignored, backlight already set\n",
619 "backlight already set\n", f); 625 f);
620 else { 626 else {
621 features->optional[features->count++] = 627 features->optional[features->count++] =
622 &mini2440_led_backlight; 628 &mini2440_led_backlight;
@@ -624,13 +630,13 @@ static void __init mini2440_parse_features(
624 features->done |= FEATURE_BACKLIGHT; 630 features->done |= FEATURE_BACKLIGHT;
625 break; 631 break;
626 case 't': 632 case 't':
627 printk(KERN_INFO "MINI2440: '%c' ignored, " 633 pr_info("MINI2440: '%c' ignored, touchscreen not compiled in\n",
628 "touchscreen not compiled in\n", f); 634 f);
629 break; 635 break;
630 case 'c': 636 case 'c':
631 if (features->done & FEATURE_CAMERA) 637 if (features->done & FEATURE_CAMERA)
632 printk(KERN_INFO "MINI2440: '%c' ignored, " 638 pr_info("MINI2440: '%c' ignored, camera already registered\n",
633 "camera already registered\n", f); 639 f);
634 else 640 else
635 features->optional[features->count++] = 641 features->optional[features->count++] =
636 &s3c_device_camif; 642 &s3c_device_camif;
@@ -645,7 +651,7 @@ static void __init mini2440_init(void)
645 struct mini2440_features_t features = { 0 }; 651 struct mini2440_features_t features = { 0 };
646 int i; 652 int i;
647 653
648 printk(KERN_INFO "MINI2440: Option string mini2440=%s\n", 654 pr_info("MINI2440: Option string mini2440=%s\n",
649 mini2440_features_str); 655 mini2440_features_str);
650 656
651 /* Parse the feature string */ 657 /* Parse the feature string */
@@ -674,17 +680,17 @@ static void __init mini2440_init(void)
674 mini2440_fb_info.displays = 680 mini2440_fb_info.displays =
675 &mini2440_lcd_cfg[features.lcd_index]; 681 &mini2440_lcd_cfg[features.lcd_index];
676 682
677 printk(KERN_INFO "MINI2440: LCD"); 683 pr_info("MINI2440: LCD");
678 for (li = 0; li < ARRAY_SIZE(mini2440_lcd_cfg); li++) 684 for (li = 0; li < ARRAY_SIZE(mini2440_lcd_cfg); li++)
679 if (li == features.lcd_index) 685 if (li == features.lcd_index)
680 printk(" [%d:%dx%d]", li, 686 pr_info(" [%d:%dx%d]", li,
681 mini2440_lcd_cfg[li].width, 687 mini2440_lcd_cfg[li].width,
682 mini2440_lcd_cfg[li].height); 688 mini2440_lcd_cfg[li].height);
683 else 689 else
684 printk(" %d:%dx%d", li, 690 pr_info(" %d:%dx%d", li,
685 mini2440_lcd_cfg[li].width, 691 mini2440_lcd_cfg[li].width,
686 mini2440_lcd_cfg[li].height); 692 mini2440_lcd_cfg[li].height);
687 printk("\n"); 693 pr_info("\n");
688 s3c24xx_fb_set_platdata(&mini2440_fb_info); 694 s3c24xx_fb_set_platdata(&mini2440_fb_info);
689 } 695 }
690 696