Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel-stable

Conflicts:
arch/arm/mach-pxa/tosa.c

+515 -583
-2
arch/arm/include/asm/mach/udc_pxa2xx.h
··· 20 20 * VBUS IRQ and omit the methods above. Store the GPIO number 21 21 * here. Note that sometimes the signals go through inverters... 22 22 */ 23 - bool gpio_vbus_inverted; 24 - int gpio_vbus; /* high == vbus present */ 25 23 bool gpio_pullup_inverted; 26 24 int gpio_pullup; /* high == pullup activated */ 27 25 };
+4 -4
arch/arm/mach-pxa/am200epd.c
··· 128 128 return 0; 129 129 130 130 err_req_gpio: 131 - while (i > 0) 132 - gpio_free(gpios[i--]); 131 + while (--i >= 0) 132 + gpio_free(gpios[i]); 133 133 134 134 return err; 135 135 } ··· 194 194 }; 195 195 196 196 /* this gets called as part of our init. these steps must be done now so 197 - * that we can use set_pxa_fb_info */ 197 + * that we can use pxa_set_fb_info */ 198 198 static void __init am200_presetup_fb(void) 199 199 { 200 200 int fw; ··· 249 249 /* we divide since we told the LCD controller we're 16bpp */ 250 250 am200_fb_info.modes->xres /= 2; 251 251 252 - set_pxa_fb_info(&am200_fb_info); 252 + pxa_set_fb_info(NULL, &am200_fb_info); 253 253 254 254 } 255 255
+7 -6
arch/arm/mach-pxa/am300epd.c
··· 125 125 if (err) { 126 126 dev_err(&am300_device->dev, "failed requesting " 127 127 "gpio %d, err=%d\n", i, err); 128 - while (i >= DB0_GPIO_PIN) 129 - gpio_free(i--); 130 - i = ARRAY_SIZE(gpios) - 1; 131 - goto err_req_gpio; 128 + goto err_req_gpio2; 132 129 } 133 130 } 134 131 ··· 156 159 157 160 return 0; 158 161 162 + err_req_gpio2: 163 + while (--i >= DB0_GPIO_PIN) 164 + gpio_free(i); 165 + i = ARRAY_SIZE(gpios); 159 166 err_req_gpio: 160 - while (i > 0) 161 - gpio_free(gpios[i--]); 167 + while (--i >= 0) 168 + gpio_free(gpios[i]); 162 169 163 170 return err; 164 171 }
+1 -1
arch/arm/mach-pxa/balloon3.c
··· 263 263 } 264 264 265 265 balloon3_lcd_screen.pxafb_backlight_power = balloon3_backlight_power; 266 - set_pxa_fb_info(&balloon3_lcd_screen); 266 + pxa_set_fb_info(NULL, &balloon3_lcd_screen); 267 267 return; 268 268 269 269 err2:
+1 -1
arch/arm/mach-pxa/cm-x2xx.c
··· 379 379 380 380 static void __init cmx2xx_init_display(void) 381 381 { 382 - set_pxa_fb_info(cmx2xx_display); 382 + pxa_set_fb_info(NULL, cmx2xx_display); 383 383 } 384 384 #else 385 385 static inline void cmx2xx_init_display(void) {}
+1 -1
arch/arm/mach-pxa/cm-x300.c
··· 296 296 297 297 static void __init cm_x300_init_lcd(void) 298 298 { 299 - set_pxa_fb_info(&cm_x300_lcd); 299 + pxa_set_fb_info(NULL, &cm_x300_lcd); 300 300 } 301 301 #else 302 302 static inline void cm_x300_init_lcd(void) {}
+1 -1
arch/arm/mach-pxa/colibri-pxa270-income.c
··· 175 175 176 176 static void __init income_lcd_init(void) 177 177 { 178 - set_pxa_fb_info(&income_lcd_screen); 178 + pxa_set_fb_info(NULL, &income_lcd_screen); 179 179 } 180 180 #else 181 181 static inline void income_lcd_init(void) {}
+1 -1
arch/arm/mach-pxa/colibri-pxa3xx.c
··· 105 105 lcd_bl_pin = bl_pin; 106 106 gpio_request(bl_pin, "lcd backlight"); 107 107 gpio_direction_output(bl_pin, 0); 108 - set_pxa_fb_info(&sharp_lq43_info); 108 + pxa_set_fb_info(NULL, &sharp_lq43_info); 109 109 } 110 110 #endif 111 111
-1
arch/arm/mach-pxa/corgi.c
··· 462 462 * USB Device Controller 463 463 */ 464 464 static struct pxa2xx_udc_mach_info udc_info __initdata = { 465 - .gpio_vbus = -1, 466 465 /* no connect GPIO; corgi can't tell connection status */ 467 466 .gpio_pullup = CORGI_GPIO_USB_PULLUP, 468 467 };
+2 -7
arch/arm/mach-pxa/devices.c
··· 90 90 91 91 static struct pxa2xx_udc_mach_info pxa_udc_info = { 92 92 .gpio_pullup = -1, 93 - .gpio_vbus = -1, 94 93 }; 95 94 96 95 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info) ··· 187 188 .resource = pxafb_resources, 188 189 }; 189 190 190 - void __init set_pxa_fb_info(struct pxafb_mach_info *info) 191 + void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info) 191 192 { 193 + pxa_device_fb.dev.parent = parent; 192 194 pxa_register_device(&pxa_device_fb, info); 193 - } 194 - 195 - void __init set_pxa_fb_parent(struct device *parent_dev) 196 - { 197 - pxa_device_fb.dev.parent = parent_dev; 198 195 } 199 196 200 197 static struct resource pxa_resource_ffuart[] = {
+1 -1
arch/arm/mach-pxa/em-x270.c
··· 689 689 690 690 static void __init em_x270_init_lcd(void) 691 691 { 692 - set_pxa_fb_info(&em_x270_lcd); 692 + pxa_set_fb_info(NULL, &em_x270_lcd); 693 693 } 694 694 #else 695 695 static inline void em_x270_init_lcd(void) {}
+27 -9
arch/arm/mach-pxa/eseries.c
··· 20 20 #include <linux/mfd/t7l66xb.h> 21 21 #include <linux/mtd/nand.h> 22 22 #include <linux/mtd/partitions.h> 23 + #include <linux/usb/gpio_vbus.h> 23 24 24 25 #include <video/w100fb.h> 25 26 ··· 52 51 mi->bank[0].size = (64*1024*1024); 53 52 } 54 53 55 - struct pxa2xx_udc_mach_info e7xx_udc_mach_info = { 54 + struct gpio_vbus_mach_info e7xx_udc_info = { 56 55 .gpio_vbus = GPIO_E7XX_USB_DISC, 57 56 .gpio_pullup = GPIO_E7XX_USB_PULLUP, 58 57 .gpio_pullup_inverted = 1 58 + }; 59 + 60 + static struct platform_device e7xx_gpio_vbus = { 61 + .name = "gpio-vbus", 62 + .id = -1, 63 + .dev = { 64 + .platform_data = &e7xx_udc_info, 65 + }, 59 66 }; 60 67 61 68 struct pxaficp_platform_data e7xx_ficp_platform_data = { ··· 174 165 175 166 static struct platform_device *e330_devices[] __initdata = { 176 167 &e330_tc6387xb_device, 168 + &e7xx_gpio_vbus, 177 169 }; 178 170 179 171 static void __init e330_init(void) ··· 185 175 eseries_register_clks(); 186 176 eseries_get_tmio_gpios(); 187 177 platform_add_devices(ARRAY_AND_SIZE(e330_devices)); 188 - pxa_set_udc_info(&e7xx_udc_mach_info); 189 178 } 190 179 191 180 MACHINE_START(E330, "Toshiba e330") ··· 223 214 224 215 static struct platform_device *e350_devices[] __initdata = { 225 216 &e350_t7l66xb_device, 217 + &e7xx_gpio_vbus, 226 218 }; 227 219 228 220 static void __init e350_init(void) ··· 234 224 eseries_register_clks(); 235 225 eseries_get_tmio_gpios(); 236 226 platform_add_devices(ARRAY_AND_SIZE(e350_devices)); 237 - pxa_set_udc_info(&e7xx_udc_mach_info); 238 227 } 239 228 240 229 MACHINE_START(E350, "Toshiba e350") ··· 342 333 343 334 static struct platform_device *e400_devices[] __initdata = { 344 335 &e400_t7l66xb_device, 336 + &e7xx_gpio_vbus, 345 337 }; 346 338 347 339 static void __init e400_init(void) ··· 354 344 /* Fixme - e400 may have a switched clock */ 355 345 eseries_register_clks(); 356 346 eseries_get_tmio_gpios(); 357 - set_pxa_fb_info(&e400_pxafb_mach_info); 347 + pxa_set_fb_info(NULL, &e400_pxafb_mach_info); 358 348 platform_add_devices(ARRAY_AND_SIZE(e400_devices)); 359 - pxa_set_udc_info(&e7xx_udc_mach_info); 360 349 } 361 350 362 351 MACHINE_START(E400, "Toshiba e400") ··· 528 519 static struct platform_device *e740_devices[] __initdata = { 529 520 &e740_fb_device, 530 521 &e740_t7l66xb_device, 522 + &e7xx_gpio_vbus, 531 523 }; 532 524 533 525 static void __init e740_init(void) ··· 542 532 "UDCCLK", &pxa25x_device_udc.dev), 543 533 eseries_get_tmio_gpios(); 544 534 platform_add_devices(ARRAY_AND_SIZE(e740_devices)); 545 - pxa_set_udc_info(&e7xx_udc_mach_info); 546 535 pxa_set_ac97_info(NULL); 547 536 pxa_set_ficp_info(&e7xx_ficp_platform_data); 548 537 } ··· 720 711 static struct platform_device *e750_devices[] __initdata = { 721 712 &e750_fb_device, 722 713 &e750_tc6393xb_device, 714 + &e7xx_gpio_vbus, 723 715 }; 724 716 725 717 static void __init e750_init(void) ··· 733 723 "GPIO11_CLK", NULL), 734 724 eseries_get_tmio_gpios(); 735 725 platform_add_devices(ARRAY_AND_SIZE(e750_devices)); 736 - pxa_set_udc_info(&e7xx_udc_mach_info); 737 726 pxa_set_ac97_info(NULL); 738 727 pxa_set_ficp_info(&e7xx_ficp_platform_data); 739 728 } ··· 882 873 883 874 /* --------------------------- UDC definitions --------------------------- */ 884 875 885 - static struct pxa2xx_udc_mach_info e800_udc_mach_info = { 876 + static struct gpio_vbus_mach_info e800_udc_info = { 886 877 .gpio_vbus = GPIO_E800_USB_DISC, 887 878 .gpio_pullup = GPIO_E800_USB_PULLUP, 888 879 .gpio_pullup_inverted = 1 889 880 }; 881 + 882 + static struct platform_device e800_gpio_vbus = { 883 + .name = "gpio-vbus", 884 + .id = -1, 885 + .dev = { 886 + .platform_data = &e800_udc_info, 887 + }, 888 + }; 889 + 890 890 891 891 /* ----------------- e800 tc6393xb parameters ------------------ */ 892 892 ··· 925 907 static struct platform_device *e800_devices[] __initdata = { 926 908 &e800_fb_device, 927 909 &e800_tc6393xb_device, 910 + &e800_gpio_vbus, 928 911 }; 929 912 930 913 static void __init e800_init(void) ··· 938 919 "GPIO11_CLK", NULL), 939 920 eseries_get_tmio_gpios(); 940 921 platform_add_devices(ARRAY_AND_SIZE(e800_devices)); 941 - pxa_set_udc_info(&e800_udc_mach_info); 942 922 pxa_set_ac97_info(NULL); 943 923 } 944 924
+6 -6
arch/arm/mach-pxa/ezx.c
··· 783 783 784 784 pxa_set_i2c_info(NULL); 785 785 786 - set_pxa_fb_info(&ezx_fb_info_1); 786 + pxa_set_fb_info(NULL, &ezx_fb_info_1); 787 787 788 788 pxa_set_keypad_info(&a780_keypad_platform_data); 789 789 ··· 853 853 pxa_set_i2c_info(NULL); 854 854 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info)); 855 855 856 - set_pxa_fb_info(&ezx_fb_info_1); 856 + pxa_set_fb_info(NULL, &ezx_fb_info_1); 857 857 858 858 pxa_set_keypad_info(&e680_keypad_platform_data); 859 859 ··· 918 918 pxa_set_i2c_info(NULL); 919 919 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info)); 920 920 921 - set_pxa_fb_info(&ezx_fb_info_2); 921 + pxa_set_fb_info(NULL, &ezx_fb_info_2); 922 922 923 923 pxa_set_keypad_info(&a1200_keypad_platform_data); 924 924 ··· 1103 1103 pxa_set_i2c_info(NULL); 1104 1104 i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info)); 1105 1105 1106 - set_pxa_fb_info(&ezx_fb_info_2); 1106 + pxa_set_fb_info(NULL, &ezx_fb_info_2); 1107 1107 1108 1108 pxa_set_keypad_info(&a910_keypad_platform_data); 1109 1109 ··· 1173 1173 pxa_set_i2c_info(NULL); 1174 1174 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info)); 1175 1175 1176 - set_pxa_fb_info(&ezx_fb_info_2); 1176 + pxa_set_fb_info(NULL, &ezx_fb_info_2); 1177 1177 1178 1178 pxa_set_keypad_info(&e6_keypad_platform_data); 1179 1179 ··· 1212 1212 pxa_set_i2c_info(NULL); 1213 1213 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info)); 1214 1214 1215 - set_pxa_fb_info(&ezx_fb_info_2); 1215 + pxa_set_fb_info(NULL, &ezx_fb_info_2); 1216 1216 1217 1217 pxa_set_keypad_info(&e2_keypad_platform_data); 1218 1218
+11 -2
arch/arm/mach-pxa/gumstix.c
··· 26 26 #include <linux/gpio.h> 27 27 #include <linux/err.h> 28 28 #include <linux/clk.h> 29 + #include <linux/usb/gpio_vbus.h> 29 30 30 31 #include <asm/setup.h> 31 32 #include <asm/memory.h> ··· 107 106 #endif 108 107 109 108 #ifdef CONFIG_USB_GADGET_PXA25X 110 - static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = { 109 + static struct gpio_vbus_mach_info gumstix_udc_info = { 111 110 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn, 112 111 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx, 113 112 }; 114 113 114 + static struct platform_device gumstix_gpio_vbus = { 115 + .name = "gpio-vbus", 116 + .id = -1, 117 + .dev = { 118 + .platform_data = &gumstix_udc_info, 119 + }, 120 + }; 121 + 115 122 static void __init gumstix_udc_init(void) 116 123 { 117 - pxa_set_udc_info(&gumstix_udc_info); 124 + platform_device_register(&gumstix_gpio_vbus); 118 125 } 119 126 #else 120 127 static void gumstix_udc_init(void)
+1 -1
arch/arm/mach-pxa/idp.c
··· 167 167 168 168 platform_device_register(&smc91x_device); 169 169 //platform_device_register(&mst_audio_device); 170 - set_pxa_fb_info(&sharp_lm8v31); 170 + pxa_set_fb_info(NULL, &sharp_lm8v31); 171 171 pxa_set_mci_info(&idp_mci_platform_data); 172 172 } 173 173
+5
arch/arm/mach-pxa/include/mach/palmz72.h
··· 44 44 #define GPIO_NR_PALMZ72_BT_POWER 17 45 45 #define GPIO_NR_PALMZ72_BT_RESET 83 46 46 47 + /* Camera */ 48 + #define GPIO_NR_PALMZ72_CAM_PWDN 56 49 + #define GPIO_NR_PALMZ72_CAM_RESET 57 50 + #define GPIO_NR_PALMZ72_CAM_POWER 91 51 + 47 52 /** Initial values **/ 48 53 49 54 /* Battery */
+2 -2
arch/arm/mach-pxa/include/mach/pxafb.h
··· 154 154 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); 155 155 void (*smart_update)(struct fb_info *); 156 156 }; 157 - void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); 158 - void set_pxa_fb_parent(struct device *parent_dev); 157 + 158 + void pxa_set_fb_info(struct device *, struct pxafb_mach_info *); 159 159 unsigned long pxafb_get_hsync_time(struct device *dev); 160 160 161 161 extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int);
+1 -2
arch/arm/mach-pxa/include/mach/z2.h
··· 25 25 #define GPIO98_ZIPITZ2_LID_BUTTON 98 26 26 27 27 /* Libertas GSPI8686 WiFi */ 28 - #define GPIO14_ZIPITZ2_WIFI_RESET 14 29 - #define GPIO15_ZIPITZ2_WIFI_POWER 15 28 + #define GPIO14_ZIPITZ2_WIFI_POWER 14 30 29 #define GPIO24_ZIPITZ2_WIFI_CS 24 31 30 #define GPIO36_ZIPITZ2_WIFI_IRQ 36 32 31
+1 -1
arch/arm/mach-pxa/littleton.c
··· 185 185 186 186 static void littleton_init_lcd(void) 187 187 { 188 - set_pxa_fb_info(&littleton_lcd_info); 188 + pxa_set_fb_info(NULL, &littleton_lcd_info); 189 189 } 190 190 #else 191 191 static inline void littleton_init_lcd(void) {};
+1 -1
arch/arm/mach-pxa/lpd270.c
··· 480 480 pxa_set_ac97_info(NULL); 481 481 482 482 if (lpd270_lcd_to_use != NULL) 483 - set_pxa_fb_info(lpd270_lcd_to_use); 483 + pxa_set_fb_info(NULL, lpd270_lcd_to_use); 484 484 485 485 pxa_set_ohci_info(&lpd270_ohci_platform_data); 486 486 }
+1 -1
arch/arm/mach-pxa/lubbock.c
··· 521 521 522 522 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); 523 523 pxa_set_udc_info(&udc_info); 524 - set_pxa_fb_info(&sharp_lm8v31); 524 + pxa_set_fb_info(NULL, &sharp_lm8v31); 525 525 pxa_set_mci_info(&lubbock_mci_platform_data); 526 526 pxa_set_ficp_info(&lubbock_ficp_platform_data); 527 527 pxa_set_ac97_info(NULL);
+1 -1
arch/arm/mach-pxa/magician.c
··· 757 757 gpio_direction_output(GPIO104_MAGICIAN_LCD_POWER_1, 0); 758 758 gpio_direction_output(GPIO105_MAGICIAN_LCD_POWER_2, 0); 759 759 gpio_direction_output(GPIO106_MAGICIAN_LCD_POWER_3, 0); 760 - set_pxa_fb_info(lcd_select ? &samsung_info : &toppoly_info); 760 + pxa_set_fb_info(NULL, lcd_select ? &samsung_info : &toppoly_info); 761 761 } else 762 762 pr_err("LCD detection: CPLD mapping failed\n"); 763 763 }
+1 -1
arch/arm/mach-pxa/mainstone.c
··· 592 592 else 593 593 mainstone_pxafb_info.modes = &toshiba_ltm035a776c_mode; 594 594 595 - set_pxa_fb_info(&mainstone_pxafb_info); 595 + pxa_set_fb_info(NULL, &mainstone_pxafb_info); 596 596 mainstone_backlight_register(); 597 597 598 598 pxa_set_mci_info(&mainstone_mci_platform_data);
+1 -1
arch/arm/mach-pxa/mioa701.c
··· 795 795 pxa_set_stuart_info(NULL); 796 796 mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); 797 797 bootstrap_init(); 798 - set_pxa_fb_info(&mioa701_pxafb_info); 798 + pxa_set_fb_info(NULL, &mioa701_pxafb_info); 799 799 pxa_set_mci_info(&mioa701_mci_info); 800 800 pxa_set_keypad_info(&mioa701_keypad_info); 801 801 pxa_set_udc_info(&mioa701_udc_info);
+2 -3
arch/arm/mach-pxa/palm27x.c
··· 1 1 /* 2 2 * Common code for Palm LD, T5, TX, Z72 3 3 * 4 - * Copyright (C) 2010 5 - * Marek Vasut <marek.vasut@gmail.com> 4 + * Copyright (C) 2010-2011 Marek Vasut <marek.vasut@gmail.com> 6 5 * 7 6 * This program is free software; you can redistribute it and/or modify 8 7 * it under the terms of the GNU General Public License version 2 as ··· 157 158 palm27x_lcd_screen.pxafb_lcd_power = palm27x_lcd_ctl; 158 159 } 159 160 160 - set_pxa_fb_info(&palm27x_lcd_screen); 161 + pxa_set_fb_info(NULL, &palm27x_lcd_screen); 161 162 } 162 163 #endif 163 164
+1 -1
arch/arm/mach-pxa/palmtc.c
··· 507 507 508 508 static void __init palmtc_lcd_init(void) 509 509 { 510 - set_pxa_fb_info(&palmtc_lcd_screen); 510 + pxa_set_fb_info(NULL, &palmtc_lcd_screen); 511 511 } 512 512 #else 513 513 static inline void palmtc_lcd_init(void) {}
+8 -25
arch/arm/mach-pxa/palmte2.c
··· 136 136 /****************************************************************************** 137 137 * Backlight 138 138 ******************************************************************************/ 139 + static struct gpio palmte_bl_gpios[] = { 140 + { GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" }, 141 + { GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" }, 142 + }; 143 + 139 144 static int palmte2_backlight_init(struct device *dev) 140 145 { 141 - int ret; 142 - 143 - ret = gpio_request(GPIO_NR_PALMTE2_BL_POWER, "BL POWER"); 144 - if (ret) 145 - goto err; 146 - ret = gpio_direction_output(GPIO_NR_PALMTE2_BL_POWER, 0); 147 - if (ret) 148 - goto err2; 149 - ret = gpio_request(GPIO_NR_PALMTE2_LCD_POWER, "LCD POWER"); 150 - if (ret) 151 - goto err2; 152 - ret = gpio_direction_output(GPIO_NR_PALMTE2_LCD_POWER, 0); 153 - if (ret) 154 - goto err3; 155 - 156 - return 0; 157 - err3: 158 - gpio_free(GPIO_NR_PALMTE2_LCD_POWER); 159 - err2: 160 - gpio_free(GPIO_NR_PALMTE2_BL_POWER); 161 - err: 162 - return ret; 146 + return gpio_request_array(ARRAY_AND_SIZE(palmte_bl_gpios)); 163 147 } 164 148 165 149 static int palmte2_backlight_notify(struct device *dev, int brightness) ··· 155 171 156 172 static void palmte2_backlight_exit(struct device *dev) 157 173 { 158 - gpio_free(GPIO_NR_PALMTE2_BL_POWER); 159 - gpio_free(GPIO_NR_PALMTE2_LCD_POWER); 174 + gpio_free_array(ARRAY_AND_SIZE(palmte_bl_gpios)); 160 175 } 161 176 162 177 static struct platform_pwm_backlight_data palmte2_backlight_data = { ··· 346 363 pxa_set_btuart_info(NULL); 347 364 pxa_set_stuart_info(NULL); 348 365 349 - set_pxa_fb_info(&palmte2_lcd_screen); 366 + pxa_set_fb_info(NULL, &palmte2_lcd_screen); 350 367 pxa_set_mci_info(&palmte2_mci_platform_data); 351 368 palmte2_udc_init(); 352 369 pxa_set_ac97_info(&palmte2_ac97_pdata);
+127
arch/arm/mach-pxa/palmz72.c
··· 30 30 #include <linux/wm97xx.h> 31 31 #include <linux/power_supply.h> 32 32 #include <linux/usb/gpio_vbus.h> 33 + #include <linux/i2c-gpio.h> 33 34 34 35 #include <asm/mach-types.h> 35 36 #include <asm/mach/arch.h> ··· 48 47 #include <mach/palm27x.h> 49 48 50 49 #include <mach/pm.h> 50 + #include <mach/camera.h> 51 + 52 + #include <media/soc_camera.h> 51 53 52 54 #include "generic.h" 53 55 #include "devices.h" ··· 106 102 GPIO21_GPIO, /* LCD border switch */ 107 103 GPIO22_GPIO, /* LCD border color */ 108 104 GPIO96_GPIO, /* lcd power */ 105 + 106 + /* PXA Camera */ 107 + GPIO81_CIF_DD_0, 108 + GPIO48_CIF_DD_5, 109 + GPIO50_CIF_DD_3, 110 + GPIO51_CIF_DD_2, 111 + GPIO52_CIF_DD_4, 112 + GPIO53_CIF_MCLK, 113 + GPIO54_CIF_PCLK, 114 + GPIO55_CIF_DD_1, 115 + GPIO84_CIF_FV, 116 + GPIO85_CIF_LV, 117 + GPIO93_CIF_DD_6, 118 + GPIO108_CIF_DD_7, 119 + 120 + GPIO56_GPIO, /* OV9640 Powerdown */ 121 + GPIO57_GPIO, /* OV9640 Reset */ 122 + GPIO91_GPIO, /* OV9640 Power */ 123 + 124 + /* I2C */ 125 + GPIO117_GPIO, /* I2C_SCL */ 126 + GPIO118_GPIO, /* I2C_SDA */ 109 127 110 128 /* Misc. */ 111 129 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* power detect */ ··· 280 254 #endif 281 255 282 256 /****************************************************************************** 257 + * SoC Camera 258 + ******************************************************************************/ 259 + #if defined(CONFIG_SOC_CAMERA_OV9640) || \ 260 + defined(CONFIG_SOC_CAMERA_OV9640_MODULE) 261 + static struct pxacamera_platform_data palmz72_pxacamera_platform_data = { 262 + .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | 263 + PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, 264 + .mclk_10khz = 2600, 265 + }; 266 + 267 + /* Board I2C devices. */ 268 + static struct i2c_board_info palmz72_i2c_device[] = { 269 + { 270 + I2C_BOARD_INFO("ov9640", 0x30), 271 + } 272 + }; 273 + 274 + static int palmz72_camera_power(struct device *dev, int power) 275 + { 276 + gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); 277 + mdelay(50); 278 + return 0; 279 + } 280 + 281 + static int palmz72_camera_reset(struct device *dev) 282 + { 283 + gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 1); 284 + mdelay(50); 285 + gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 0); 286 + mdelay(50); 287 + return 0; 288 + } 289 + 290 + static struct soc_camera_link palmz72_iclink = { 291 + .bus_id = 0, /* Match id in pxa27x_device_camera in device.c */ 292 + .board_info = &palmz72_i2c_device[0], 293 + .i2c_adapter_id = 0, 294 + .module_name = "ov96xx", 295 + .power = &palmz72_camera_power, 296 + .reset = &palmz72_camera_reset, 297 + .flags = SOCAM_DATAWIDTH_8, 298 + }; 299 + 300 + static struct i2c_gpio_platform_data palmz72_i2c_bus_data = { 301 + .sda_pin = 118, 302 + .scl_pin = 117, 303 + .udelay = 10, 304 + .timeout = 100, 305 + }; 306 + 307 + static struct platform_device palmz72_i2c_bus_device = { 308 + .name = "i2c-gpio", 309 + .id = 0, /* we use this as a replacement for i2c-pxa */ 310 + .dev = { 311 + .platform_data = &palmz72_i2c_bus_data, 312 + } 313 + }; 314 + 315 + static struct platform_device palmz72_camera = { 316 + .name = "soc-camera-pdrv", 317 + .id = -1, 318 + .dev = { 319 + .platform_data = &palmz72_iclink, 320 + }, 321 + }; 322 + 323 + /* Here we request the camera GPIOs and configure them. We power up the camera 324 + * module, deassert the reset pin, but put it into powerdown (low to no power 325 + * consumption) mode. This allows us to later bring the module up fast. */ 326 + static struct gpio palmz72_camera_gpios[] = { 327 + { GPIO_NR_PALMZ72_CAM_POWER, GPIOF_INIT_HIGH,"Camera DVDD" }, 328 + { GPIO_NR_PALMZ72_CAM_RESET, GPIOF_INIT_LOW, "Camera RESET" }, 329 + { GPIO_NR_PALMZ72_CAM_PWDN, GPIOF_INIT_LOW, "Camera PWDN" }, 330 + }; 331 + 332 + static inline void __init palmz72_cam_gpio_init(void) 333 + { 334 + int ret; 335 + 336 + ret = gpio_request_array(ARRAY_AND_SIZE(palmz72_camera_gpios)); 337 + if (!ret) 338 + gpio_free_array(ARRAY_AND_SIZE(palmz72_camera_gpios)); 339 + else 340 + printk(KERN_ERR "Camera GPIO init failed!\n"); 341 + 342 + return; 343 + } 344 + 345 + static void __init palmz72_camera_init(void) 346 + { 347 + palmz72_cam_gpio_init(); 348 + pxa_set_camera_info(&palmz72_pxacamera_platform_data); 349 + platform_device_register(&palmz72_i2c_bus_device); 350 + platform_device_register(&palmz72_camera); 351 + } 352 + #else 353 + static inline void palmz72_camera_init(void) {} 354 + #endif 355 + 356 + /****************************************************************************** 283 357 * Machine init 284 358 ******************************************************************************/ 285 359 static void __init palmz72_init(void) ··· 402 276 palm27x_pmic_init(); 403 277 palmz72_kpc_init(); 404 278 palmz72_leds_init(); 279 + palmz72_camera_init(); 405 280 } 406 281 407 282 MACHINE_START(PALMZ72, "Palm Zire72")
+1 -1
arch/arm/mach-pxa/pcm990-baseboard.c
··· 515 515 pcm990_init_irq(); 516 516 517 517 #ifndef CONFIG_PCM990_DISPLAY_NONE 518 - set_pxa_fb_info(&pcm990_fbinfo); 518 + pxa_set_fb_info(NULL, &pcm990_fbinfo); 519 519 #endif 520 520 platform_device_register(&pcm990_backlight_device); 521 521
+1 -2
arch/arm/mach-pxa/poodle.c
··· 445 445 if (ret) 446 446 pr_warning("poodle: Unable to register LoCoMo device\n"); 447 447 448 - set_pxa_fb_parent(&poodle_locomo_device.dev); 449 - set_pxa_fb_info(&poodle_fb_info); 448 + pxa_set_fb_info(&poodle_locomo_device.dev, &poodle_fb_info); 450 449 pxa_set_udc_info(&udc_info); 451 450 pxa_set_mci_info(&poodle_mci_platform_data); 452 451 pxa_set_ficp_info(&poodle_ficp_platform_data);
+1 -1
arch/arm/mach-pxa/raumfeld.c
··· 597 597 { 598 598 int ret; 599 599 600 - set_pxa_fb_info(&raumfeld_sharp_lcd_info); 600 + pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info); 601 601 602 602 /* Earlier devices had the backlight regulator controlled 603 603 * via PWM, later versions use another controller for that */
+1 -1
arch/arm/mach-pxa/saar.c
··· 473 473 474 474 static void __init saar_init_lcd(void) 475 475 { 476 - set_pxa_fb_info(&saar_lcd_info); 476 + pxa_set_fb_info(NULL, &saar_lcd_info); 477 477 } 478 478 #else 479 479 static inline void saar_init_lcd(void) {}
+1 -1
arch/arm/mach-pxa/spitz.c
··· 724 724 725 725 static void __init spitz_lcd_init(void) 726 726 { 727 - set_pxa_fb_info(&spitz_pxafb_info); 727 + pxa_set_fb_info(NULL, &spitz_pxafb_info); 728 728 } 729 729 #else 730 730 static inline void spitz_lcd_init(void) {}
+1 -1
arch/arm/mach-pxa/tavorevb.c
··· 466 466 { 467 467 platform_device_register(&tavorevb_backlight_devices[0]); 468 468 platform_device_register(&tavorevb_backlight_devices[1]); 469 - set_pxa_fb_info(&tavorevb_lcd_info); 469 + pxa_set_fb_info(NULL, &tavorevb_lcd_info); 470 470 } 471 471 #else 472 472 static inline void tavorevb_init_lcd(void) {}
+2 -3
arch/arm/mach-pxa/time.c
··· 100 100 static struct clock_event_device ckevt_pxa_osmr0 = { 101 101 .name = "osmr0", 102 102 .features = CLOCK_EVT_FEAT_ONESHOT, 103 - .shift = 32, 104 103 .rating = 200, 105 104 .set_next_event = pxa_osmr0_set_next_event, 106 105 .set_mode = pxa_osmr0_set_mode, ··· 134 135 135 136 init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate); 136 137 137 - ckevt_pxa_osmr0.mult = 138 - div_sc(clock_tick_rate, NSEC_PER_SEC, ckevt_pxa_osmr0.shift); 138 + clocksource_calc_mult_shift(&cksrc_pxa_oscr0, clock_tick_rate, 4); 139 + clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4); 139 140 ckevt_pxa_osmr0.max_delta_ns = 140 141 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0); 141 142 ckevt_pxa_osmr0.min_delta_ns =
+11 -2
arch/arm/mach-pxa/tosa.c
··· 35 35 #include <linux/spi/pxa2xx_spi.h> 36 36 #include <linux/input/matrix_keypad.h> 37 37 #include <linux/i2c/pxa-i2c.h> 38 + #include <linux/usb/gpio_vbus.h> 38 39 39 40 #include <asm/setup.h> 40 41 #include <asm/mach-types.h> ··· 241 240 /* 242 241 * USB Device Controller 243 242 */ 244 - static struct pxa2xx_udc_mach_info udc_info __initdata = { 243 + static struct gpio_vbus_mach_info tosa_udc_info = { 245 244 .gpio_pullup = TOSA_GPIO_USB_PULLUP, 246 245 .gpio_vbus = TOSA_GPIO_USB_IN, 247 246 .gpio_vbus_inverted = 1, 247 + }; 248 + 249 + static struct platform_device tosa_gpio_vbus = { 250 + .name = "gpio-vbus", 251 + .id = -1, 252 + .dev = { 253 + .platform_data = &tosa_udc_info, 254 + }, 248 255 }; 249 256 250 257 /* ··· 900 891 &tosa_bt_device, 901 892 &sharpsl_rom_device, 902 893 &wm9712_device, 894 + &tosa_gpio_vbus, 903 895 }; 904 896 905 897 static void tosa_poweroff(void) ··· 947 937 dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16); 948 938 949 939 pxa_set_mci_info(&tosa_mci_platform_data); 950 - pxa_set_udc_info(&udc_info); 951 940 pxa_set_ficp_info(&tosa_ficp_platform_data); 952 941 pxa_set_i2c_info(NULL); 953 942 pxa_set_ac97_info(NULL);
+2 -2
arch/arm/mach-pxa/trizeps4.c
··· 516 516 pxa_set_stuart_info(NULL); 517 517 518 518 if (0) /* dont know how to determine LCD */ 519 - set_pxa_fb_info(&sharp_lcd); 519 + pxa_set_fb_info(NULL, &sharp_lcd); 520 520 else 521 - set_pxa_fb_info(&toshiba_lcd); 521 + pxa_set_fb_info(NULL, &toshiba_lcd); 522 522 523 523 pxa_set_mci_info(&trizeps4_mci_platform_data); 524 524 #ifndef STATUS_LEDS_ON_STUART_PINS
+1 -1
arch/arm/mach-pxa/viper.c
··· 932 932 /* Wake-up serial console */ 933 933 viper_init_serial_gpio(); 934 934 935 - set_pxa_fb_info(&fb_info); 935 + pxa_set_fb_info(NULL, &fb_info); 936 936 937 937 /* v1 hardware cannot use the datacs line */ 938 938 version = viper_hw_version();
+1 -1
arch/arm/mach-pxa/vpac270.c
··· 572 572 } 573 573 574 574 vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power; 575 - set_pxa_fb_info(&vpac270_lcd_screen); 575 + pxa_set_fb_info(NULL, &vpac270_lcd_screen); 576 576 return; 577 577 578 578 err2:
+38 -39
arch/arm/mach-pxa/z2.c
··· 91 91 GPIO47_STUART_TXD, 92 92 93 93 /* Keypad */ 94 - GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, 95 - GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, 96 - GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, 97 - GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, 98 - GPIO38_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, 99 - GPIO16_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, 100 - GPIO17_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH, 94 + GPIO100_KP_MKIN_0, 95 + GPIO101_KP_MKIN_1, 96 + GPIO102_KP_MKIN_2, 97 + GPIO34_KP_MKIN_3, 98 + GPIO38_KP_MKIN_4, 99 + GPIO16_KP_MKIN_5, 100 + GPIO17_KP_MKIN_6, 101 101 GPIO103_KP_MKOUT_0, 102 102 GPIO104_KP_MKOUT_1, 103 103 GPIO105_KP_MKOUT_2, ··· 138 138 GPIO1_GPIO, /* Power button */ 139 139 GPIO37_GPIO, /* Headphone detect */ 140 140 GPIO98_GPIO, /* Lid switch */ 141 - GPIO14_GPIO, /* WiFi Reset */ 142 - GPIO15_GPIO, /* WiFi Power */ 141 + GPIO14_GPIO, /* WiFi Power */ 143 142 GPIO24_GPIO, /* WiFi CS */ 144 143 GPIO36_GPIO, /* WiFi IRQ */ 145 144 GPIO88_GPIO, /* LCD CS */ ··· 203 204 /* Keypad Backlight */ 204 205 .pwm_id = 1, 205 206 .max_brightness = 1023, 206 - .dft_brightness = 512, 207 + .dft_brightness = 0, 207 208 .pwm_period_ns = 1260320, 208 209 }, 209 210 [1] = { ··· 270 271 271 272 static void __init z2_lcd_init(void) 272 273 { 273 - set_pxa_fb_info(&z2_lcd_screen); 274 + pxa_set_fb_info(NULL, &z2_lcd_screen); 274 275 } 275 276 #else 276 277 static inline void z2_lcd_init(void) {} ··· 308 309 .active_low = 1, 309 310 }, { 310 311 .name = "z2:green:charged", 311 - .default_trigger = "none", 312 + .default_trigger = "mmc0", 312 313 .gpio = GPIO85_ZIPITZ2_LED_CHARGED, 313 314 .active_low = 1, 314 315 }, { 315 316 .name = "z2:amber:charging", 316 - .default_trigger = "none", 317 + .default_trigger = "Z2-charging-or-full", 317 318 .gpio = GPIO83_ZIPITZ2_LED_CHARGING, 318 319 .active_low = 1, 319 320 }, ··· 426 427 ******************************************************************************/ 427 428 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 428 429 static struct gpio_keys_button z2_pxa_buttons[] = { 429 - {KEY_POWER, GPIO1_ZIPITZ2_POWER_BUTTON, 0, "Power Button" }, 430 - {KEY_CLOSE, GPIO98_ZIPITZ2_LID_BUTTON, 0, "Lid Button" }, 430 + { 431 + .code = KEY_POWER, 432 + .gpio = GPIO1_ZIPITZ2_POWER_BUTTON, 433 + .active_low = 0, 434 + .desc = "Power Button", 435 + .wakeup = 1, 436 + .type = EV_KEY, 437 + }, 438 + { 439 + .code = SW_LID, 440 + .gpio = GPIO98_ZIPITZ2_LID_BUTTON, 441 + .active_low = 1, 442 + .desc = "Lid Switch", 443 + .wakeup = 0, 444 + .type = EV_SW, 445 + }, 431 446 }; 432 447 433 448 static struct gpio_keys_platform_data z2_pxa_keys_data = { ··· 474 461 .batt_I2C_addr = 0x55, 475 462 .batt_I2C_reg = 2, 476 463 .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT, 477 - .min_voltage = 2400000, 478 - .max_voltage = 3700000, 479 - .batt_div = 69, 464 + .min_voltage = 3475000, 465 + .max_voltage = 4190000, 466 + .batt_div = 59, 480 467 .batt_mult = 1000000, 481 468 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION, 482 469 .batt_name = "Z2", ··· 510 497 { 511 498 int ret = 0; 512 499 513 - ret = gpio_request(GPIO15_ZIPITZ2_WIFI_POWER, "WiFi Power"); 500 + ret = gpio_request(GPIO14_ZIPITZ2_WIFI_POWER, "WiFi Power"); 514 501 if (ret) 515 502 goto err; 516 503 517 - ret = gpio_direction_output(GPIO15_ZIPITZ2_WIFI_POWER, 1); 504 + ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_POWER, 1); 518 505 if (ret) 519 506 goto err2; 520 507 521 - ret = gpio_request(GPIO14_ZIPITZ2_WIFI_RESET, "WiFi Reset"); 522 - if (ret) 523 - goto err2; 524 - 525 - ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_RESET, 0); 526 - if (ret) 527 - goto err3; 528 - 529 - /* Reset the card */ 508 + /* Wait until card is powered on */ 530 509 mdelay(180); 531 - gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 1); 532 - mdelay(20); 533 510 534 511 spi->bits_per_word = 16; 535 512 spi->mode = SPI_MODE_2, ··· 528 525 529 526 return 0; 530 527 531 - err3: 532 - gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); 533 528 err2: 534 - gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); 529 + gpio_free(GPIO14_ZIPITZ2_WIFI_POWER); 535 530 err: 536 531 return ret; 537 532 }; 538 533 539 534 static int z2_lbs_spi_teardown(struct spi_device *spi) 540 535 { 541 - gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 0); 542 - gpio_set_value(GPIO15_ZIPITZ2_WIFI_POWER, 0); 543 - gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); 544 - gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); 545 - return 0; 536 + gpio_set_value(GPIO14_ZIPITZ2_WIFI_POWER, 0); 537 + gpio_free(GPIO14_ZIPITZ2_WIFI_POWER); 546 538 539 + return 0; 547 540 }; 548 541 549 542 static struct pxa2xx_spi_chip z2_lbs_chip_info = {
+1 -1
arch/arm/mach-pxa/zeus.c
··· 846 846 if (zeus_setup_fb_gpios()) 847 847 pr_err("Failed to setup fb gpios\n"); 848 848 else 849 - set_pxa_fb_info(&zeus_fb_info); 849 + pxa_set_fb_info(NULL, &zeus_fb_info); 850 850 851 851 pxa_set_mci_info(&zeus_mci_platform_data); 852 852 pxa_set_udc_info(&zeus_udc_info);
+2 -2
arch/arm/mach-pxa/zylonite.c
··· 208 208 platform_device_register(&zylonite_backlight_device); 209 209 210 210 if (lcd_id & 0x20) { 211 - set_pxa_fb_info(&zylonite_sharp_lcd_info); 211 + pxa_set_fb_info(NULL, &zylonite_sharp_lcd_info); 212 212 return; 213 213 } 214 214 ··· 220 220 else 221 221 zylonite_toshiba_lcd_info.modes = &toshiba_ltm04c380k_mode; 222 222 223 - set_pxa_fb_info(&zylonite_toshiba_lcd_info); 223 + pxa_set_fb_info(NULL, &zylonite_toshiba_lcd_info); 224 224 } 225 225 #else 226 226 static inline void zylonite_init_lcd(void) {}
+22 -21
drivers/ata/pata_palmld.c
··· 33 33 34 34 #define DRV_NAME "pata_palmld" 35 35 36 + static struct gpio palmld_hdd_gpios[] = { 37 + { GPIO_NR_PALMLD_IDE_PWEN, GPIOF_INIT_HIGH, "HDD Power" }, 38 + { GPIO_NR_PALMLD_IDE_RESET, GPIOF_INIT_LOW, "HDD Reset" }, 39 + }; 40 + 36 41 static struct scsi_host_template palmld_sht = { 37 42 ATA_PIO_SHT(DRV_NAME), 38 43 }; ··· 57 52 58 53 /* allocate host */ 59 54 host = ata_host_alloc(&pdev->dev, 1); 60 - if (!host) 61 - return -ENOMEM; 55 + if (!host) { 56 + ret = -ENOMEM; 57 + goto err1; 58 + } 62 59 63 60 /* remap drive's physical memory address */ 64 61 mem = devm_ioremap(&pdev->dev, PALMLD_IDE_PHYS, 0x1000); 65 - if (!mem) 66 - return -ENOMEM; 62 + if (!mem) { 63 + ret = -ENOMEM; 64 + goto err1; 65 + } 67 66 68 67 /* request and activate power GPIO, IRQ GPIO */ 69 - ret = gpio_request(GPIO_NR_PALMLD_IDE_PWEN, "HDD PWR"); 68 + ret = gpio_request_array(palmld_hdd_gpios, 69 + ARRAY_SIZE(palmld_hdd_gpios)); 70 70 if (ret) 71 71 goto err1; 72 - ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_PWEN, 1); 73 - if (ret) 74 - goto err2; 75 - 76 - ret = gpio_request(GPIO_NR_PALMLD_IDE_RESET, "HDD RST"); 77 - if (ret) 78 - goto err2; 79 - ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_RESET, 0); 80 - if (ret) 81 - goto err3; 82 72 83 73 /* reset the drive */ 84 74 gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 0); ··· 96 96 ata_sff_std_ports(&ap->ioaddr); 97 97 98 98 /* activate host */ 99 - return ata_host_activate(host, 0, NULL, IRQF_TRIGGER_RISING, 99 + ret = ata_host_activate(host, 0, NULL, IRQF_TRIGGER_RISING, 100 100 &palmld_sht); 101 + if (ret) 102 + goto err2; 101 103 102 - err3: 103 - gpio_free(GPIO_NR_PALMLD_IDE_RESET); 104 + return ret; 105 + 104 106 err2: 105 - gpio_free(GPIO_NR_PALMLD_IDE_PWEN); 107 + gpio_free_array(palmld_hdd_gpios, ARRAY_SIZE(palmld_hdd_gpios)); 106 108 err1: 107 109 return ret; 108 110 } ··· 118 116 /* power down the HDD */ 119 117 gpio_set_value(GPIO_NR_PALMLD_IDE_PWEN, 0); 120 118 121 - gpio_free(GPIO_NR_PALMLD_IDE_RESET); 122 - gpio_free(GPIO_NR_PALMLD_IDE_PWEN); 119 + gpio_free_array(palmld_hdd_gpios, ARRAY_SIZE(palmld_hdd_gpios)); 123 120 124 121 return 0; 125 122 }
+50 -85
drivers/pcmcia/pxa2xx_colibri.c
··· 34 34 #define COLIBRI320_DETECT_GPIO 81 35 35 #define COLIBRI320_READY_GPIO 29 36 36 37 - static struct { 38 - int reset_gpio; 39 - int ppen_gpio; 40 - int bvd1_gpio; 41 - int bvd2_gpio; 42 - int detect_gpio; 43 - int ready_gpio; 44 - } colibri_pcmcia_gpio; 37 + enum { 38 + DETECT = 0, 39 + READY = 1, 40 + BVD1 = 2, 41 + BVD2 = 3, 42 + PPEN = 4, 43 + RESET = 5, 44 + }; 45 + 46 + /* Contents of this array are configured on-the-fly in init function */ 47 + static struct gpio colibri_pcmcia_gpios[] = { 48 + { 0, GPIOF_IN, "PCMCIA Detect" }, 49 + { 0, GPIOF_IN, "PCMCIA Ready" }, 50 + { 0, GPIOF_IN, "PCMCIA BVD1" }, 51 + { 0, GPIOF_IN, "PCMCIA BVD2" }, 52 + { 0, GPIOF_INIT_LOW, "PCMCIA PPEN" }, 53 + { 0, GPIOF_INIT_HIGH,"PCMCIA Reset" }, 54 + }; 45 55 46 56 static struct pcmcia_irqs colibri_irqs[] = { 47 57 { ··· 64 54 { 65 55 int ret; 66 56 67 - ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT"); 57 + ret = gpio_request_array(colibri_pcmcia_gpios, 58 + ARRAY_SIZE(colibri_pcmcia_gpios)); 68 59 if (ret) 69 60 goto err1; 70 - ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio); 71 - if (ret) 72 - goto err2; 73 61 74 - ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY"); 75 - if (ret) 76 - goto err2; 77 - ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio); 78 - if (ret) 79 - goto err3; 62 + colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpios[DETECT].gpio); 63 + skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpios[READY].gpio); 80 64 81 - ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1"); 82 - if (ret) 83 - goto err3; 84 - ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio); 85 - if (ret) 86 - goto err4; 87 - 88 - ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2"); 89 - if (ret) 90 - goto err4; 91 - ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio); 92 - if (ret) 93 - goto err5; 94 - 95 - ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN"); 96 - if (ret) 97 - goto err5; 98 - ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0); 99 - if (ret) 100 - goto err6; 101 - 102 - ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET"); 103 - if (ret) 104 - goto err6; 105 - ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1); 106 - if (ret) 107 - goto err7; 108 - 109 - colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio); 110 - skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio); 111 - 112 - return soc_pcmcia_request_irqs(skt, colibri_irqs, 65 + ret = soc_pcmcia_request_irqs(skt, colibri_irqs, 113 66 ARRAY_SIZE(colibri_irqs)); 67 + if (ret) 68 + goto err2; 114 69 115 - err7: 116 - gpio_free(colibri_pcmcia_gpio.detect_gpio); 117 - err6: 118 - gpio_free(colibri_pcmcia_gpio.ready_gpio); 119 - err5: 120 - gpio_free(colibri_pcmcia_gpio.bvd1_gpio); 121 - err4: 122 - gpio_free(colibri_pcmcia_gpio.bvd2_gpio); 123 - err3: 124 - gpio_free(colibri_pcmcia_gpio.reset_gpio); 70 + return ret; 71 + 125 72 err2: 126 - gpio_free(colibri_pcmcia_gpio.ppen_gpio); 73 + gpio_free_array(colibri_pcmcia_gpios, 74 + ARRAY_SIZE(colibri_pcmcia_gpios)); 127 75 err1: 128 76 return ret; 129 77 } 130 78 131 79 static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 132 80 { 133 - gpio_free(colibri_pcmcia_gpio.detect_gpio); 134 - gpio_free(colibri_pcmcia_gpio.ready_gpio); 135 - gpio_free(colibri_pcmcia_gpio.bvd1_gpio); 136 - gpio_free(colibri_pcmcia_gpio.bvd2_gpio); 137 - gpio_free(colibri_pcmcia_gpio.reset_gpio); 138 - gpio_free(colibri_pcmcia_gpio.ppen_gpio); 81 + gpio_free_array(colibri_pcmcia_gpios, 82 + ARRAY_SIZE(colibri_pcmcia_gpios)); 139 83 } 140 84 141 85 static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 142 86 struct pcmcia_state *state) 143 87 { 144 88 145 - state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio); 146 - state->ready = !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio); 147 - state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio); 148 - state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio); 89 + state->detect = !!gpio_get_value(colibri_pcmcia_gpios[DETECT].gpio); 90 + state->ready = !!gpio_get_value(colibri_pcmcia_gpios[READY].gpio); 91 + state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpios[BVD1].gpio); 92 + state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpios[BVD2].gpio); 149 93 state->wrprot = 0; 150 94 state->vs_3v = 1; 151 95 state->vs_Xv = 0; ··· 109 145 colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 110 146 const socket_state_t *state) 111 147 { 112 - gpio_set_value(colibri_pcmcia_gpio.ppen_gpio, 148 + gpio_set_value(colibri_pcmcia_gpios[PPEN].gpio, 113 149 !(state->Vcc == 33 && state->Vpp < 50)); 114 - gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET); 150 + gpio_set_value(colibri_pcmcia_gpios[RESET].gpio, 151 + state->flags & SS_RESET); 115 152 return 0; 116 153 } 117 154 ··· 155 190 156 191 /* Colibri PXA270 */ 157 192 if (machine_is_colibri()) { 158 - colibri_pcmcia_gpio.reset_gpio = COLIBRI270_RESET_GPIO; 159 - colibri_pcmcia_gpio.ppen_gpio = COLIBRI270_PPEN_GPIO; 160 - colibri_pcmcia_gpio.bvd1_gpio = COLIBRI270_BVD1_GPIO; 161 - colibri_pcmcia_gpio.bvd2_gpio = COLIBRI270_BVD2_GPIO; 162 - colibri_pcmcia_gpio.detect_gpio = COLIBRI270_DETECT_GPIO; 163 - colibri_pcmcia_gpio.ready_gpio = COLIBRI270_READY_GPIO; 193 + colibri_pcmcia_gpios[RESET].gpio = COLIBRI270_RESET_GPIO; 194 + colibri_pcmcia_gpios[PPEN].gpio = COLIBRI270_PPEN_GPIO; 195 + colibri_pcmcia_gpios[BVD1].gpio = COLIBRI270_BVD1_GPIO; 196 + colibri_pcmcia_gpios[BVD2].gpio = COLIBRI270_BVD2_GPIO; 197 + colibri_pcmcia_gpios[DETECT].gpio = COLIBRI270_DETECT_GPIO; 198 + colibri_pcmcia_gpios[READY].gpio = COLIBRI270_READY_GPIO; 164 199 /* Colibri PXA320 */ 165 200 } else if (machine_is_colibri320()) { 166 - colibri_pcmcia_gpio.reset_gpio = COLIBRI320_RESET_GPIO; 167 - colibri_pcmcia_gpio.ppen_gpio = COLIBRI320_PPEN_GPIO; 168 - colibri_pcmcia_gpio.bvd1_gpio = COLIBRI320_BVD1_GPIO; 169 - colibri_pcmcia_gpio.bvd2_gpio = COLIBRI320_BVD2_GPIO; 170 - colibri_pcmcia_gpio.detect_gpio = COLIBRI320_DETECT_GPIO; 171 - colibri_pcmcia_gpio.ready_gpio = COLIBRI320_READY_GPIO; 201 + colibri_pcmcia_gpios[RESET].gpio = COLIBRI320_RESET_GPIO; 202 + colibri_pcmcia_gpios[PPEN].gpio = COLIBRI320_PPEN_GPIO; 203 + colibri_pcmcia_gpios[BVD1].gpio = COLIBRI320_BVD1_GPIO; 204 + colibri_pcmcia_gpios[BVD2].gpio = COLIBRI320_BVD2_GPIO; 205 + colibri_pcmcia_gpios[DETECT].gpio = COLIBRI320_DETECT_GPIO; 206 + colibri_pcmcia_gpios[READY].gpio = COLIBRI320_READY_GPIO; 172 207 } 173 208 174 209 ret = platform_device_add_data(colibri_pcmcia_device,
+10 -32
drivers/pcmcia/pxa2xx_palmld.c
··· 4 4 * Driver for Palm LifeDrive PCMCIA 5 5 * 6 6 * Copyright (C) 2006 Alex Osborne <ato@meshy.org> 7 - * Copyright (C) 2007-2008 Marek Vasut <marek.vasut@gmail.com> 7 + * Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.com> 8 8 * 9 9 * This program is free software; you can redistribute it and/or modify 10 10 * it under the terms of the GNU General Public License version 2 as ··· 20 20 #include <mach/palmld.h> 21 21 #include "soc_common.h" 22 22 23 + static struct gpio palmld_pcmcia_gpios[] = { 24 + { GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" }, 25 + { GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, 26 + { GPIO_NR_PALMLD_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, 27 + }; 28 + 23 29 static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 24 30 { 25 31 int ret; 26 32 27 - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_POWER, "PCMCIA PWR"); 28 - if (ret) 29 - goto err1; 30 - ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_POWER, 0); 31 - if (ret) 32 - goto err2; 33 - 34 - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_RESET, "PCMCIA RST"); 35 - if (ret) 36 - goto err2; 37 - ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_RESET, 1); 38 - if (ret) 39 - goto err3; 40 - 41 - ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_READY, "PCMCIA RDY"); 42 - if (ret) 43 - goto err3; 44 - ret = gpio_direction_input(GPIO_NR_PALMLD_PCMCIA_READY); 45 - if (ret) 46 - goto err4; 33 + ret = gpio_request_array(palmld_pcmcia_gpios, 34 + ARRAY_SIZE(palmld_pcmcia_gpios)); 47 35 48 36 skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY); 49 - return 0; 50 37 51 - err4: 52 - gpio_free(GPIO_NR_PALMLD_PCMCIA_READY); 53 - err3: 54 - gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET); 55 - err2: 56 - gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER); 57 - err1: 58 38 return ret; 59 39 } 60 40 61 41 static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 62 42 { 63 - gpio_free(GPIO_NR_PALMLD_PCMCIA_READY); 64 - gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET); 65 - gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER); 43 + gpio_free_array(palmld_pcmcia_gpios, ARRAY_SIZE(palmld_pcmcia_gpios)); 66 44 } 67 45 68 46 static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+13 -62
drivers/pcmcia/pxa2xx_palmtc.c
··· 4 4 * Driver for Palm Tungsten|C PCMCIA 5 5 * 6 6 * Copyright (C) 2008 Alex Osborne <ato@meshy.org> 7 - * Copyright (C) 2009 Marek Vasut <marek.vasut@gmail.com> 7 + * Copyright (C) 2009-2011 Marek Vasut <marek.vasut@gmail.com> 8 8 * 9 9 * This program is free software; you can redistribute it and/or modify 10 10 * it under the terms of the GNU General Public License version 2 as ··· 21 21 #include <mach/palmtc.h> 22 22 #include "soc_common.h" 23 23 24 + static struct gpio palmtc_pcmcia_gpios[] = { 25 + { GPIO_NR_PALMTC_PCMCIA_POWER1, GPIOF_INIT_LOW, "PCMCIA Power 1" }, 26 + { GPIO_NR_PALMTC_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" }, 27 + { GPIO_NR_PALMTC_PCMCIA_POWER3, GPIOF_INIT_LOW, "PCMCIA Power 3" }, 28 + { GPIO_NR_PALMTC_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, 29 + { GPIO_NR_PALMTC_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, 30 + { GPIO_NR_PALMTC_PCMCIA_PWRREADY, GPIOF_IN, "PCMCIA Power Ready" }, 31 + }; 32 + 24 33 static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 25 34 { 26 35 int ret; 27 36 28 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER1, "PCMCIA PWR1"); 29 - if (ret) 30 - goto err1; 31 - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER1, 0); 32 - if (ret) 33 - goto err2; 34 - 35 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER2, "PCMCIA PWR2"); 36 - if (ret) 37 - goto err2; 38 - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER2, 0); 39 - if (ret) 40 - goto err3; 41 - 42 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER3, "PCMCIA PWR3"); 43 - if (ret) 44 - goto err3; 45 - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER3, 0); 46 - if (ret) 47 - goto err4; 48 - 49 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_RESET, "PCMCIA RST"); 50 - if (ret) 51 - goto err4; 52 - ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_RESET, 1); 53 - if (ret) 54 - goto err5; 55 - 56 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_READY, "PCMCIA RDY"); 57 - if (ret) 58 - goto err5; 59 - ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_READY); 60 - if (ret) 61 - goto err6; 62 - 63 - ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_PWRREADY, "PCMCIA PWRRDY"); 64 - if (ret) 65 - goto err6; 66 - ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_PWRREADY); 67 - if (ret) 68 - goto err7; 37 + ret = gpio_request_array(palmtc_pcmcia_gpios, 38 + ARRAY_SIZE(palmtc_pcmcia_gpios)); 69 39 70 40 skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMTC_PCMCIA_READY); 71 - return 0; 72 41 73 - err7: 74 - gpio_free(GPIO_NR_PALMTC_PCMCIA_PWRREADY); 75 - err6: 76 - gpio_free(GPIO_NR_PALMTC_PCMCIA_READY); 77 - err5: 78 - gpio_free(GPIO_NR_PALMTC_PCMCIA_RESET); 79 - err4: 80 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER3); 81 - err3: 82 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER2); 83 - err2: 84 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER1); 85 - err1: 86 42 return ret; 87 43 } 88 44 89 45 static void palmtc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 90 46 { 91 - gpio_free(GPIO_NR_PALMTC_PCMCIA_PWRREADY); 92 - gpio_free(GPIO_NR_PALMTC_PCMCIA_READY); 93 - gpio_free(GPIO_NR_PALMTC_PCMCIA_RESET); 94 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER3); 95 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER2); 96 - gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER1); 47 + gpio_free_array(palmtc_pcmcia_gpios, ARRAY_SIZE(palmtc_pcmcia_gpios)); 97 48 } 98 49 99 50 static void palmtc_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+12 -45
drivers/pcmcia/pxa2xx_palmtx.c
··· 3 3 * 4 4 * Driver for Palm T|X PCMCIA 5 5 * 6 - * Copyright (C) 2007-2008 Marek Vasut <marek.vasut@gmail.com> 6 + * Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.com> 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify 9 9 * it under the terms of the GNU General Public License version 2 as ··· 13 13 14 14 #include <linux/module.h> 15 15 #include <linux/platform_device.h> 16 + #include <linux/gpio.h> 16 17 17 18 #include <asm/mach-types.h> 18 - 19 - #include <mach/gpio.h> 20 19 #include <mach/palmtx.h> 21 - 22 20 #include "soc_common.h" 21 + 22 + static struct gpio palmtx_pcmcia_gpios[] = { 23 + { GPIO_NR_PALMTX_PCMCIA_POWER1, GPIOF_INIT_LOW, "PCMCIA Power 1" }, 24 + { GPIO_NR_PALMTX_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" }, 25 + { GPIO_NR_PALMTX_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, 26 + { GPIO_NR_PALMTX_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, 27 + }; 23 28 24 29 static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 25 30 { 26 31 int ret; 27 32 28 - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1"); 29 - if (ret) 30 - goto err1; 31 - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0); 32 - if (ret) 33 - goto err2; 34 - 35 - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2"); 36 - if (ret) 37 - goto err2; 38 - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0); 39 - if (ret) 40 - goto err3; 41 - 42 - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST"); 43 - if (ret) 44 - goto err3; 45 - ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1); 46 - if (ret) 47 - goto err4; 48 - 49 - ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY"); 50 - if (ret) 51 - goto err4; 52 - ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY); 53 - if (ret) 54 - goto err5; 33 + ret = gpio_request_array(palmtx_pcmcia_gpios, 34 + ARRAY_SIZE(palmtx_pcmcia_gpios)); 55 35 56 36 skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY); 57 - return 0; 58 37 59 - err5: 60 - gpio_free(GPIO_NR_PALMTX_PCMCIA_READY); 61 - err4: 62 - gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET); 63 - err3: 64 - gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2); 65 - err2: 66 - gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1); 67 - err1: 68 38 return ret; 69 39 } 70 40 71 41 static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 72 42 { 73 - gpio_free(GPIO_NR_PALMTX_PCMCIA_READY); 74 - gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET); 75 - gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2); 76 - gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1); 43 + gpio_free_array(palmtx_pcmcia_gpios, ARRAY_SIZE(palmtx_pcmcia_gpios)); 77 44 } 78 45 79 46 static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+30 -80
drivers/pcmcia/pxa2xx_vpac270.c
··· 3 3 * 4 4 * Driver for Voipac PXA270 PCMCIA and CF sockets 5 5 * 6 - * Copyright (C) 2010 7 - * Marek Vasut <marek.vasut@gmail.com> 6 + * Copyright (C) 2010-2011 Marek Vasut <marek.vasut@gmail.com> 8 7 * 9 8 * This program is free software; you can redistribute it and/or modify 10 9 * it under the terms of the GNU General Public License version 2 as ··· 20 21 #include <mach/vpac270.h> 21 22 22 23 #include "soc_common.h" 24 + 25 + static struct gpio vpac270_pcmcia_gpios[] = { 26 + { GPIO84_VPAC270_PCMCIA_CD, GPIOF_IN, "PCMCIA Card Detect" }, 27 + { GPIO35_VPAC270_PCMCIA_RDY, GPIOF_IN, "PCMCIA Ready" }, 28 + { GPIO107_VPAC270_PCMCIA_PPEN, GPIOF_INIT_LOW, "PCMCIA PPEN" }, 29 + { GPIO11_VPAC270_PCMCIA_RESET, GPIOF_INIT_LOW, "PCMCIA Reset" }, 30 + }; 31 + 32 + static struct gpio vpac270_cf_gpios[] = { 33 + { GPIO17_VPAC270_CF_CD, GPIOF_IN, "CF Card Detect" }, 34 + { GPIO12_VPAC270_CF_RDY, GPIOF_IN, "CF Ready" }, 35 + { GPIO16_VPAC270_CF_RESET, GPIOF_INIT_LOW, "CF Reset" }, 36 + }; 23 37 24 38 static struct pcmcia_irqs cd_irqs[] = { 25 39 { ··· 52 40 int ret; 53 41 54 42 if (skt->nr == 0) { 55 - ret = gpio_request(GPIO84_VPAC270_PCMCIA_CD, "PCMCIA CD"); 56 - if (ret) 57 - goto err1; 58 - ret = gpio_direction_input(GPIO84_VPAC270_PCMCIA_CD); 59 - if (ret) 60 - goto err2; 61 - 62 - ret = gpio_request(GPIO35_VPAC270_PCMCIA_RDY, "PCMCIA RDY"); 63 - if (ret) 64 - goto err2; 65 - ret = gpio_direction_input(GPIO35_VPAC270_PCMCIA_RDY); 66 - if (ret) 67 - goto err3; 68 - 69 - ret = gpio_request(GPIO107_VPAC270_PCMCIA_PPEN, "PCMCIA PPEN"); 70 - if (ret) 71 - goto err3; 72 - ret = gpio_direction_output(GPIO107_VPAC270_PCMCIA_PPEN, 0); 73 - if (ret) 74 - goto err4; 75 - 76 - ret = gpio_request(GPIO11_VPAC270_PCMCIA_RESET, "PCMCIA RESET"); 77 - if (ret) 78 - goto err4; 79 - ret = gpio_direction_output(GPIO11_VPAC270_PCMCIA_RESET, 0); 80 - if (ret) 81 - goto err5; 43 + ret = gpio_request_array(vpac270_pcmcia_gpios, 44 + ARRAY_SIZE(vpac270_pcmcia_gpios)); 82 45 83 46 skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY); 84 47 85 - return soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1); 86 - 87 - err5: 88 - gpio_free(GPIO11_VPAC270_PCMCIA_RESET); 89 - err4: 90 - gpio_free(GPIO107_VPAC270_PCMCIA_PPEN); 91 - err3: 92 - gpio_free(GPIO35_VPAC270_PCMCIA_RDY); 93 - err2: 94 - gpio_free(GPIO84_VPAC270_PCMCIA_CD); 95 - err1: 96 - return ret; 97 - 48 + if (!ret) 49 + ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1); 98 50 } else { 99 - ret = gpio_request(GPIO17_VPAC270_CF_CD, "CF CD"); 100 - if (ret) 101 - goto err6; 102 - ret = gpio_direction_input(GPIO17_VPAC270_CF_CD); 103 - if (ret) 104 - goto err7; 105 - 106 - ret = gpio_request(GPIO12_VPAC270_CF_RDY, "CF RDY"); 107 - if (ret) 108 - goto err7; 109 - ret = gpio_direction_input(GPIO12_VPAC270_CF_RDY); 110 - if (ret) 111 - goto err8; 112 - 113 - ret = gpio_request(GPIO16_VPAC270_CF_RESET, "CF RESET"); 114 - if (ret) 115 - goto err8; 116 - ret = gpio_direction_output(GPIO16_VPAC270_CF_RESET, 0); 117 - if (ret) 118 - goto err9; 51 + ret = gpio_request_array(vpac270_cf_gpios, 52 + ARRAY_SIZE(vpac270_cf_gpios)); 119 53 120 54 skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY); 121 55 122 - return soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1); 123 - 124 - err9: 125 - gpio_free(GPIO16_VPAC270_CF_RESET); 126 - err8: 127 - gpio_free(GPIO12_VPAC270_CF_RDY); 128 - err7: 129 - gpio_free(GPIO17_VPAC270_CF_CD); 130 - err6: 131 - return ret; 132 - 56 + if (!ret) 57 + ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1); 133 58 } 59 + 60 + return ret; 134 61 } 135 62 136 63 static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 137 64 { 138 - gpio_free(GPIO11_VPAC270_PCMCIA_RESET); 139 - gpio_free(GPIO107_VPAC270_PCMCIA_PPEN); 140 - gpio_free(GPIO35_VPAC270_PCMCIA_RDY); 141 - gpio_free(GPIO84_VPAC270_PCMCIA_CD); 142 - gpio_free(GPIO16_VPAC270_CF_RESET); 143 - gpio_free(GPIO12_VPAC270_CF_RDY); 144 - gpio_free(GPIO17_VPAC270_CF_CD); 65 + if (skt->nr == 0) 66 + gpio_request_array(vpac270_pcmcia_gpios, 67 + ARRAY_SIZE(vpac270_pcmcia_gpios)); 68 + else 69 + gpio_request_array(vpac270_cf_gpios, 70 + ARRAY_SIZE(vpac270_cf_gpios)); 145 71 } 146 72 147 73 static void vpac270_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+7 -69
drivers/usb/gadget/pxa25x_udc.c
··· 139 139 static void pxa25x_ep_fifo_flush (struct usb_ep *ep); 140 140 static void nuke (struct pxa25x_ep *, int status); 141 141 142 - /* one GPIO should be used to detect VBUS from the host */ 143 - static int is_vbus_present(void) 144 - { 145 - struct pxa2xx_udc_mach_info *mach = the_controller->mach; 146 - 147 - if (gpio_is_valid(mach->gpio_vbus)) { 148 - int value = gpio_get_value(mach->gpio_vbus); 149 - 150 - if (mach->gpio_vbus_inverted) 151 - return !value; 152 - else 153 - return !!value; 154 - } 155 - if (mach->udc_is_connected) 156 - return mach->udc_is_connected(); 157 - return 1; 158 - } 159 - 160 142 /* one GPIO should control a D+ pullup, so host sees this device (or not) */ 161 143 static void pullup_off(void) 162 144 { ··· 1037 1055 "%s version: %s\nGadget driver: %s\nHost %s\n\n", 1038 1056 driver_name, DRIVER_VERSION SIZE_STR "(pio)", 1039 1057 dev->driver ? dev->driver->driver.name : "(none)", 1040 - is_vbus_present() ? "full speed" : "disconnected"); 1058 + dev->gadget.speed == USB_SPEED_FULL ? "full speed" : "disconnected"); 1041 1059 1042 1060 /* registers for device and ep0 */ 1043 1061 seq_printf(m, ··· 1076 1094 (tmp & UDCCFR_ACM) ? " acm" : ""); 1077 1095 } 1078 1096 1079 - if (!is_vbus_present() || !dev->driver) 1097 + if (dev->gadget.speed != USB_SPEED_FULL || !dev->driver) 1080 1098 goto done; 1081 1099 1082 1100 seq_printf(m, "ep0 IN %lu/%lu, OUT %lu/%lu\nirqs %lu\n\n", ··· 1417 1435 1418 1436 #endif 1419 1437 1420 - static irqreturn_t udc_vbus_irq(int irq, void *_dev) 1421 - { 1422 - struct pxa25x_udc *dev = _dev; 1423 - 1424 - pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present()); 1425 - return IRQ_HANDLED; 1426 - } 1427 - 1428 1438 1429 1439 /*-------------------------------------------------------------------------*/ 1430 1440 ··· 1740 1766 if (unlikely(udccr & UDCCR_SUSIR)) { 1741 1767 udc_ack_int_UDCCR(UDCCR_SUSIR); 1742 1768 handled = 1; 1743 - DBG(DBG_VERBOSE, "USB suspend%s\n", is_vbus_present() 1744 - ? "" : "+disconnect"); 1769 + DBG(DBG_VERBOSE, "USB suspend\n"); 1745 1770 1746 - if (!is_vbus_present()) 1747 - stop_activity(dev, dev->driver); 1748 - else if (dev->gadget.speed != USB_SPEED_UNKNOWN 1771 + if (dev->gadget.speed != USB_SPEED_UNKNOWN 1749 1772 && dev->driver 1750 1773 && dev->driver->suspend) 1751 1774 dev->driver->suspend(&dev->gadget); ··· 1757 1786 1758 1787 if (dev->gadget.speed != USB_SPEED_UNKNOWN 1759 1788 && dev->driver 1760 - && dev->driver->resume 1761 - && is_vbus_present()) 1789 + && dev->driver->resume) 1762 1790 dev->driver->resume(&dev->gadget); 1763 1791 } 1764 1792 ··· 2107 2137 static int __init pxa25x_udc_probe(struct platform_device *pdev) 2108 2138 { 2109 2139 struct pxa25x_udc *dev = &memory; 2110 - int retval, vbus_irq, irq; 2140 + int retval, irq; 2111 2141 u32 chiprev; 2112 2142 2113 2143 /* insist on Intel/ARM/XScale */ ··· 2169 2199 2170 2200 dev->transceiver = otg_get_transceiver(); 2171 2201 2172 - if (gpio_is_valid(dev->mach->gpio_vbus)) { 2173 - if ((retval = gpio_request(dev->mach->gpio_vbus, 2174 - "pxa25x_udc GPIO VBUS"))) { 2175 - dev_dbg(&pdev->dev, 2176 - "can't get vbus gpio %d, err: %d\n", 2177 - dev->mach->gpio_vbus, retval); 2178 - goto err_gpio_vbus; 2179 - } 2180 - gpio_direction_input(dev->mach->gpio_vbus); 2181 - vbus_irq = gpio_to_irq(dev->mach->gpio_vbus); 2182 - } else 2183 - vbus_irq = 0; 2184 - 2185 2202 if (gpio_is_valid(dev->mach->gpio_pullup)) { 2186 2203 if ((retval = gpio_request(dev->mach->gpio_pullup, 2187 2204 "pca25x_udc GPIO PULLUP"))) { ··· 2194 2237 udc_disable(dev); 2195 2238 udc_reinit(dev); 2196 2239 2197 - dev->vbus = !!is_vbus_present(); 2240 + dev->vbus = 0; 2198 2241 2199 2242 /* irq setup after old hardware state is cleaned up */ 2200 2243 retval = request_irq(irq, pxa25x_udc_irq, ··· 2230 2273 } 2231 2274 } else 2232 2275 #endif 2233 - if (vbus_irq) { 2234 - retval = request_irq(vbus_irq, udc_vbus_irq, 2235 - IRQF_DISABLED | IRQF_SAMPLE_RANDOM | 2236 - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 2237 - driver_name, dev); 2238 - if (retval != 0) { 2239 - pr_err("%s: can't get irq %i, err %d\n", 2240 - driver_name, vbus_irq, retval); 2241 - goto err_vbus_irq; 2242 - } 2243 - } 2244 2276 create_debug_files(dev); 2245 2277 2246 2278 return 0; 2247 2279 2248 - err_vbus_irq: 2249 2280 #ifdef CONFIG_ARCH_LUBBOCK 2250 2281 free_irq(LUBBOCK_USB_DISC_IRQ, dev); 2251 2282 err_irq_lub: ··· 2243 2298 if (gpio_is_valid(dev->mach->gpio_pullup)) 2244 2299 gpio_free(dev->mach->gpio_pullup); 2245 2300 err_gpio_pullup: 2246 - if (gpio_is_valid(dev->mach->gpio_vbus)) 2247 - gpio_free(dev->mach->gpio_vbus); 2248 - err_gpio_vbus: 2249 2301 if (dev->transceiver) { 2250 2302 otg_put_transceiver(dev->transceiver); 2251 2303 dev->transceiver = NULL; ··· 2279 2337 free_irq(LUBBOCK_USB_IRQ, dev); 2280 2338 } 2281 2339 #endif 2282 - if (gpio_is_valid(dev->mach->gpio_vbus)) { 2283 - free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev); 2284 - gpio_free(dev->mach->gpio_vbus); 2285 - } 2286 2340 if (gpio_is_valid(dev->mach->gpio_pullup)) 2287 2341 gpio_free(dev->mach->gpio_pullup); 2288 2342
+89 -47
drivers/video/pxafb.c
··· 627 627 628 628 static void overlay1fb_disable(struct pxafb_layer *ofb) 629 629 { 630 - uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5); 630 + uint32_t lccr5; 631 + 632 + if (!(lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN)) 633 + return; 634 + 635 + lccr5 = lcd_readl(ofb->fbi, LCCR5); 631 636 632 637 lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] & ~OVLxC1_OEN); 633 638 ··· 690 685 691 686 static void overlay2fb_disable(struct pxafb_layer *ofb) 692 687 { 693 - uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5); 688 + uint32_t lccr5; 689 + 690 + if (!(lcd_readl(ofb->fbi, OVL2C1) & OVLxC1_OEN)) 691 + return; 692 + 693 + lccr5 = lcd_readl(ofb->fbi, LCCR5); 694 694 695 695 lcd_writel(ofb->fbi, OVL2C1, ofb->control[0] & ~OVLxC1_OEN); 696 696 ··· 730 720 if (user == 0) 731 721 return -ENODEV; 732 722 733 - /* allow only one user at a time */ 734 - if (atomic_inc_and_test(&ofb->usage)) 735 - return -EBUSY; 723 + if (ofb->usage++ == 0) 724 + /* unblank the base framebuffer */ 725 + fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK); 736 726 737 - /* unblank the base framebuffer */ 738 - fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK); 739 727 return 0; 740 728 } 741 729 ··· 741 733 { 742 734 struct pxafb_layer *ofb = (struct pxafb_layer*) info; 743 735 744 - atomic_dec(&ofb->usage); 745 - ofb->ops->disable(ofb); 736 + if (ofb->usage == 1) { 737 + ofb->ops->disable(ofb); 738 + ofb->fb.var.height = -1; 739 + ofb->fb.var.width = -1; 740 + ofb->fb.var.xres = ofb->fb.var.xres_virtual = 0; 741 + ofb->fb.var.yres = ofb->fb.var.yres_virtual = 0; 746 742 747 - free_pages_exact(ofb->video_mem, ofb->video_mem_size); 748 - ofb->video_mem = NULL; 749 - ofb->video_mem_size = 0; 743 + ofb->usage--; 744 + } 750 745 return 0; 751 746 } 752 747 ··· 761 750 int xpos, ypos, pfor, bpp; 762 751 763 752 xpos = NONSTD_TO_XPOS(var->nonstd); 764 - ypos = NONSTD_TO_XPOS(var->nonstd); 753 + ypos = NONSTD_TO_YPOS(var->nonstd); 765 754 pfor = NONSTD_TO_PFOR(var->nonstd); 766 755 767 756 bpp = pxafb_var_to_bpp(var); ··· 805 794 return 0; 806 795 } 807 796 808 - static int overlayfb_map_video_memory(struct pxafb_layer *ofb) 797 + static int overlayfb_check_video_memory(struct pxafb_layer *ofb) 809 798 { 810 799 struct fb_var_screeninfo *var = &ofb->fb.var; 811 800 int pfor = NONSTD_TO_PFOR(var->nonstd); ··· 823 812 824 813 size = PAGE_ALIGN(ofb->fb.fix.line_length * var->yres_virtual); 825 814 826 - /* don't re-allocate if the original video memory is enough */ 827 815 if (ofb->video_mem) { 828 816 if (ofb->video_mem_size >= size) 829 817 return 0; 830 - 831 - free_pages_exact(ofb->video_mem, ofb->video_mem_size); 832 818 } 833 - 834 - ofb->video_mem = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO); 835 - if (ofb->video_mem == NULL) 836 - return -ENOMEM; 837 - 838 - ofb->video_mem_phys = virt_to_phys(ofb->video_mem); 839 - ofb->video_mem_size = size; 840 - 841 - mutex_lock(&ofb->fb.mm_lock); 842 - ofb->fb.fix.smem_start = ofb->video_mem_phys; 843 - ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual; 844 - mutex_unlock(&ofb->fb.mm_lock); 845 - ofb->fb.screen_base = ofb->video_mem; 846 - return 0; 819 + return -EINVAL; 847 820 } 848 821 849 822 static int overlayfb_set_par(struct fb_info *info) ··· 836 841 struct fb_var_screeninfo *var = &info->var; 837 842 int xpos, ypos, pfor, bpp, ret; 838 843 839 - ret = overlayfb_map_video_memory(ofb); 844 + ret = overlayfb_check_video_memory(ofb); 840 845 if (ret) 841 846 return ret; 842 847 843 848 bpp = pxafb_var_to_bpp(var); 844 849 xpos = NONSTD_TO_XPOS(var->nonstd); 845 - ypos = NONSTD_TO_XPOS(var->nonstd); 850 + ypos = NONSTD_TO_YPOS(var->nonstd); 846 851 pfor = NONSTD_TO_PFOR(var->nonstd); 847 852 848 853 ofb->control[0] = OVLxC1_PPL(var->xres) | OVLxC1_LPO(var->yres) | ··· 886 891 887 892 ofb->id = id; 888 893 ofb->ops = &ofb_ops[id]; 889 - atomic_set(&ofb->usage, 0); 894 + ofb->usage = 0; 890 895 ofb->fbi = fbi; 891 896 init_completion(&ofb->branch_done); 892 897 } ··· 899 904 return 0; 900 905 } 901 906 902 - static int __devinit pxafb_overlay_init(struct pxafb_info *fbi) 907 + static int __devinit pxafb_overlay_map_video_memory(struct pxafb_info *pxafb, 908 + struct pxafb_layer *ofb) 909 + { 910 + /* We assume that user will use at most video_mem_size for overlay fb, 911 + * anyway, it's useless to use 16bpp main plane and 24bpp overlay 912 + */ 913 + ofb->video_mem = alloc_pages_exact(PAGE_ALIGN(pxafb->video_mem_size), 914 + GFP_KERNEL | __GFP_ZERO); 915 + if (ofb->video_mem == NULL) 916 + return -ENOMEM; 917 + 918 + ofb->video_mem_phys = virt_to_phys(ofb->video_mem); 919 + ofb->video_mem_size = PAGE_ALIGN(pxafb->video_mem_size); 920 + 921 + mutex_lock(&ofb->fb.mm_lock); 922 + ofb->fb.fix.smem_start = ofb->video_mem_phys; 923 + ofb->fb.fix.smem_len = pxafb->video_mem_size; 924 + mutex_unlock(&ofb->fb.mm_lock); 925 + 926 + ofb->fb.screen_base = ofb->video_mem; 927 + 928 + return 0; 929 + } 930 + 931 + static void __devinit pxafb_overlay_init(struct pxafb_info *fbi) 903 932 { 904 933 int i, ret; 905 934 906 935 if (!pxafb_overlay_supported()) 907 - return 0; 936 + return; 908 937 909 938 for (i = 0; i < 2; i++) { 910 - init_pxafb_overlay(fbi, &fbi->overlay[i], i); 911 - ret = register_framebuffer(&fbi->overlay[i].fb); 939 + struct pxafb_layer *ofb = &fbi->overlay[i]; 940 + init_pxafb_overlay(fbi, ofb, i); 941 + ret = register_framebuffer(&ofb->fb); 912 942 if (ret) { 913 943 dev_err(fbi->dev, "failed to register overlay %d\n", i); 914 - return ret; 944 + continue; 915 945 } 946 + ret = pxafb_overlay_map_video_memory(fbi, ofb); 947 + if (ret) { 948 + dev_err(fbi->dev, 949 + "failed to map video memory for overlay %d\n", 950 + i); 951 + unregister_framebuffer(&ofb->fb); 952 + continue; 953 + } 954 + ofb->registered = 1; 916 955 } 917 956 918 957 /* mask all IU/BS/EOF/SOF interrupts */ 919 958 lcd_writel(fbi, LCCR5, ~0); 920 959 921 - /* place overlay(s) on top of base */ 922 - fbi->lccr0 |= LCCR0_OUC; 923 960 pr_info("PXA Overlay driver loaded successfully!\n"); 924 - return 0; 925 961 } 926 962 927 963 static void __devexit pxafb_overlay_exit(struct pxafb_info *fbi) ··· 962 936 if (!pxafb_overlay_supported()) 963 937 return; 964 938 965 - for (i = 0; i < 2; i++) 966 - unregister_framebuffer(&fbi->overlay[i].fb); 939 + for (i = 0; i < 2; i++) { 940 + struct pxafb_layer *ofb = &fbi->overlay[i]; 941 + if (ofb->registered) { 942 + if (ofb->video_mem) 943 + free_pages_exact(ofb->video_mem, 944 + ofb->video_mem_size); 945 + unregister_framebuffer(&ofb->fb); 946 + } 947 + } 967 948 } 968 949 #else 969 950 static inline void pxafb_overlay_init(struct pxafb_info *fbi) {} ··· 1401 1368 (lcd_readl(fbi, LCCR3) != fbi->reg_lccr3) || 1402 1369 (lcd_readl(fbi, LCCR4) != fbi->reg_lccr4) || 1403 1370 (lcd_readl(fbi, FDADR0) != fbi->fdadr[0]) || 1404 - (lcd_readl(fbi, FDADR1) != fbi->fdadr[1])) 1371 + ((fbi->lccr0 & LCCR0_SDS) && 1372 + (lcd_readl(fbi, FDADR1) != fbi->fdadr[1]))) 1405 1373 pxafb_schedule_work(fbi, C_REENABLE); 1406 1374 1407 1375 return 0; ··· 1454 1420 lcd_writel(fbi, LCCR0, fbi->reg_lccr0 & ~LCCR0_ENB); 1455 1421 1456 1422 lcd_writel(fbi, FDADR0, fbi->fdadr[0]); 1457 - lcd_writel(fbi, FDADR1, fbi->fdadr[1]); 1423 + if (fbi->lccr0 & LCCR0_SDS) 1424 + lcd_writel(fbi, FDADR1, fbi->fdadr[1]); 1458 1425 lcd_writel(fbi, LCCR0, fbi->reg_lccr0 | LCCR0_ENB); 1459 1426 } 1460 1427 ··· 1648 1613 1649 1614 switch (val) { 1650 1615 case CPUFREQ_PRECHANGE: 1651 - set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE); 1616 + if (!fbi->overlay[0].usage && !fbi->overlay[1].usage) 1617 + set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE); 1652 1618 break; 1653 1619 1654 1620 case CPUFREQ_POSTCHANGE: ··· 1841 1805 fbi->task_state = (u_char)-1; 1842 1806 1843 1807 pxafb_decode_mach_info(fbi, inf); 1808 + 1809 + #ifdef CONFIG_FB_PXA_OVERLAY 1810 + /* place overlay(s) on top of base */ 1811 + if (pxafb_overlay_supported()) 1812 + fbi->lccr0 |= LCCR0_OUC; 1813 + #endif 1844 1814 1845 1815 init_waitqueue_head(&fbi->ctrlr_wait); 1846 1816 INIT_WORK(&fbi->task, pxafb_task);
+2 -1
drivers/video/pxafb.h
··· 92 92 struct pxafb_layer { 93 93 struct fb_info fb; 94 94 int id; 95 - atomic_t usage; 95 + int registered; 96 + uint32_t usage; 96 97 uint32_t control[2]; 97 98 98 99 struct pxafb_layer_ops *ops;