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

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

authored by

Russell King and committed by
Russell King
64bd43a0 4a014a24

+95 -37
+10
arch/arm/mach-pxa/include/mach/audio.h
··· 4 4 #include <sound/core.h> 5 5 #include <sound/pcm.h> 6 6 7 + /* 8 + * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95) 9 + * a -1 value means no gpio will be used for reset 10 + 11 + * reset_gpio should only be specified for pxa27x CPUs where a silicon 12 + * bug prevents correct operation of the reset line. If not specified, 13 + * the default behaviour on these CPUs is to consider gpio 113 as the 14 + * AC97 reset line, which is the default on most boards. 15 + */ 7 16 typedef struct { 8 17 int (*startup)(struct snd_pcm_substream *, void *); 9 18 void (*shutdown)(struct snd_pcm_substream *, void *); 10 19 void (*suspend)(void *); 11 20 void (*resume)(void *); 12 21 void *priv; 22 + int reset_gpio; 13 23 } pxa2xx_audio_ops_t; 14 24 15 25 extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops);
+1 -6
arch/arm/mach-pxa/include/mach/palmasoc.h
··· 1 1 #ifndef _INCLUDE_PALMASOC_H_ 2 2 #define _INCLUDE_PALMASOC_H_ 3 + 3 4 struct palm27x_asoc_info { 4 5 int jack_gpio; 5 6 }; 6 - 7 - #ifdef CONFIG_SND_PXA2XX_SOC_PALM27X 8 - void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data); 9 - #else 10 - static inline void palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) {} 11 - #endif 12 7 13 8 #endif
+5 -1
arch/arm/mach-pxa/mioa701.c
··· 742 742 .fast_mode = 1, 743 743 }; 744 744 745 + static pxa2xx_audio_ops_t mioa701_ac97_info = { 746 + .reset_gpio = 95, 747 + }; 748 + 745 749 /* 746 750 * Mio global 747 751 */ ··· 819 815 pxa_set_keypad_info(&mioa701_keypad_info); 820 816 wm97xx_bat_set_pdata(&mioa701_battery_data); 821 817 pxa_set_udc_info(&mioa701_udc_info); 822 - pxa_set_ac97_info(NULL); 818 + pxa_set_ac97_info(&mioa701_ac97_info); 823 819 pm_power_off = mioa701_poweroff; 824 820 arm_pm_restart = mioa701_restart; 825 821 platform_add_devices(devices, ARRAY_SIZE(devices));
+15 -3
arch/arm/mach-pxa/palmld.c
··· 477 477 /****************************************************************************** 478 478 * aSoC audio 479 479 ******************************************************************************/ 480 - static struct palm27x_asoc_info palm27x_asoc_pdata = { 480 + static struct palm27x_asoc_info palmld_asoc_pdata = { 481 481 .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT, 482 + }; 483 + 484 + static pxa2xx_audio_ops_t palmld_ac97_pdata = { 485 + .reset_gpio = 95, 486 + }; 487 + 488 + static struct platform_device palmld_asoc = { 489 + .name = "palm27x-asoc", 490 + .id = -1, 491 + .dev = { 492 + .platform_data = &palmld_asoc_pdata, 493 + }, 482 494 }; 483 495 484 496 /****************************************************************************** ··· 556 544 &palmld_backlight, 557 545 &palmld_leds, 558 546 &power_supply, 547 + &palmld_asoc, 559 548 }; 560 549 561 550 static struct map_desc palmld_io_desc[] __initdata = { ··· 586 573 587 574 set_pxa_fb_info(&palmld_lcd_screen); 588 575 pxa_set_mci_info(&palmld_mci_platform_data); 589 - pxa_set_ac97_info(NULL); 576 + pxa_set_ac97_info(&palmld_ac97_pdata); 590 577 pxa_set_ficp_info(&palmld_ficp_platform_data); 591 578 pxa_set_keypad_info(&palmld_keypad_platform_data); 592 579 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 593 - palm27x_asoc_set_pdata(&palm27x_asoc_pdata); 594 580 595 581 platform_add_devices(devices, ARRAY_SIZE(devices)); 596 582 }
+15 -3
arch/arm/mach-pxa/palmt5.c
··· 420 420 /****************************************************************************** 421 421 * aSoC audio 422 422 ******************************************************************************/ 423 - static struct palm27x_asoc_info palm27x_asoc_pdata = { 423 + static struct palm27x_asoc_info palmt5_asoc_pdata = { 424 424 .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT, 425 + }; 426 + 427 + static pxa2xx_audio_ops_t palmt5_ac97_pdata = { 428 + .reset_gpio = 95, 429 + }; 430 + 431 + static struct platform_device palmt5_asoc = { 432 + .name = "palm27x-asoc", 433 + .id = -1, 434 + .dev = { 435 + .platform_data = &palmt5_asoc_pdata, 436 + }, 425 437 }; 426 438 427 439 /****************************************************************************** ··· 498 486 #endif 499 487 &palmt5_backlight, 500 488 &power_supply, 489 + &palmt5_asoc, 501 490 }; 502 491 503 492 /* setup udc GPIOs initial state */ ··· 517 504 set_pxa_fb_info(&palmt5_lcd_screen); 518 505 pxa_set_mci_info(&palmt5_mci_platform_data); 519 506 palmt5_udc_init(); 507 + pxa_set_ac97_info(&palmt5_ac97_pdata); 520 508 pxa_set_udc_info(&palmt5_udc_info); 521 - pxa_set_ac97_info(NULL); 522 509 pxa_set_ficp_info(&palmt5_ficp_platform_data); 523 510 pxa_set_keypad_info(&palmt5_keypad_platform_data); 524 511 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 525 - palm27x_asoc_set_pdata(&palm27x_asoc_pdata); 526 512 platform_add_devices(devices, ARRAY_SIZE(devices)); 527 513 } 528 514
+22 -1
arch/arm/mach-pxa/palmtx.c
··· 40 40 #include <mach/irda.h> 41 41 #include <mach/pxa27x_keypad.h> 42 42 #include <mach/udc.h> 43 + #include <mach/palmasoc.h> 43 44 44 45 #include "generic.h" 45 46 #include "devices.h" ··· 435 434 }; 436 435 437 436 /****************************************************************************** 437 + * aSoC audio 438 + ******************************************************************************/ 439 + static struct palm27x_asoc_info palmtx_asoc_pdata = { 440 + .jack_gpio = GPIO_NR_PALMTX_EARPHONE_DETECT, 441 + }; 442 + 443 + static pxa2xx_audio_ops_t palmtx_ac97_pdata = { 444 + .reset_gpio = 95, 445 + }; 446 + 447 + static struct platform_device palmtx_asoc = { 448 + .name = "palm27x-asoc", 449 + .id = -1, 450 + .dev = { 451 + .platform_data = &palmtx_asoc_pdata, 452 + }, 453 + }; 454 + 455 + /****************************************************************************** 438 456 * Framebuffer 439 457 ******************************************************************************/ 440 458 static struct pxafb_mode_info palmtx_lcd_modes[] = { ··· 515 495 #endif 516 496 &palmtx_backlight, 517 497 &power_supply, 498 + &palmtx_asoc, 518 499 }; 519 500 520 501 static struct map_desc palmtx_io_desc[] __initdata = { ··· 550 529 set_pxa_fb_info(&palmtx_lcd_screen); 551 530 pxa_set_mci_info(&palmtx_mci_platform_data); 552 531 palmtx_udc_init(); 532 + pxa_set_ac97_info(&palmtx_ac97_pdata); 553 533 pxa_set_udc_info(&palmtx_udc_info); 554 - pxa_set_ac97_info(NULL); 555 534 pxa_set_ficp_info(&palmtx_ficp_platform_data); 556 535 pxa_set_keypad_info(&palmtx_keypad_platform_data); 557 536 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
+3 -3
arch/arm/mach-pxa/pcm990-baseboard.c
··· 377 377 #include <linux/i2c/pca953x.h> 378 378 379 379 static struct pca953x_platform_data pca9536_data = { 380 - .gpio_base = NR_BUILTIN_GPIO + 1, 380 + .gpio_base = NR_BUILTIN_GPIO, 381 381 }; 382 382 383 383 static int gpio_bus_switch; ··· 405 405 int ret; 406 406 407 407 if (!gpio_bus_switch) { 408 - ret = gpio_request(NR_BUILTIN_GPIO + 1, "camera"); 408 + ret = gpio_request(NR_BUILTIN_GPIO, "camera"); 409 409 if (!ret) { 410 - gpio_bus_switch = NR_BUILTIN_GPIO + 1; 410 + gpio_bus_switch = NR_BUILTIN_GPIO; 411 411 gpio_direction_output(gpio_bus_switch, 0); 412 412 } else 413 413 gpio_bus_switch = -EINVAL;
-15
include/sound/pxa2xx-lib.h
··· 42 42 extern int pxa2xx_ac97_hw_probe(struct platform_device *dev); 43 43 extern void pxa2xx_ac97_hw_remove(struct platform_device *dev); 44 44 45 - /* AC97 platform_data */ 46 - /** 47 - * struct pxa2xx_ac97_platform_data - pxa ac97 platform data 48 - * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95) 49 - * a -1 value means no gpio will be used for reset 50 - * 51 - * Platform data should only be specified for pxa27x CPUs where a silicon bug 52 - * prevents correct operation of the reset line. If not specified, the default 53 - * behaviour is to consider gpio 113 as the AC97 reset line, which is the 54 - * default on most boards. 55 - */ 56 - struct pxa2xx_ac97_platform_data { 57 - int reset_gpio; 58 - }; 59 - 60 45 #endif
+1 -1
sound/arm/pxa2xx-ac97-lib.c
··· 364 364 int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev) 365 365 { 366 366 int ret; 367 - struct pxa2xx_ac97_platform_data *pdata = dev->dev.platform_data; 367 + pxa2xx_audio_ops_t *pdata = dev->dev.platform_data; 368 368 369 369 if (pdata) { 370 370 switch (pdata->reset_gpio) {
+23 -4
sound/soc/pxa/palm27x.c
··· 200 200 201 201 static struct platform_device *palm27x_snd_device; 202 202 203 - static int __init palm27x_asoc_init(void) 203 + static int palm27x_asoc_probe(struct platform_device *pdev) 204 204 { 205 205 int ret; 206 206 207 207 if (!(machine_is_palmtx() || machine_is_palmt5() || 208 208 machine_is_palmld())) 209 209 return -ENODEV; 210 + 211 + if (pdev->dev.platform_data) 212 + palm27x_ep_gpio = ((struct palm27x_asoc_info *) 213 + (pdev->dev.platform_data))->jack_gpio; 210 214 211 215 ret = gpio_request(palm27x_ep_gpio, "Headphone Jack"); 212 216 if (ret) ··· 249 245 return ret; 250 246 } 251 247 252 - static void __exit palm27x_asoc_exit(void) 248 + static int __devexit palm27x_asoc_remove(struct platform_device *pdev) 253 249 { 254 250 free_irq(gpio_to_irq(palm27x_ep_gpio), NULL); 255 251 gpio_free(palm27x_ep_gpio); 256 252 platform_device_unregister(palm27x_snd_device); 253 + return 0; 257 254 } 258 255 259 - void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) 256 + static struct platform_driver palm27x_wm9712_driver = { 257 + .probe = palm27x_asoc_probe, 258 + .remove = __devexit_p(palm27x_asoc_remove), 259 + .driver = { 260 + .name = "palm27x-asoc", 261 + .owner = THIS_MODULE, 262 + }, 263 + }; 264 + 265 + static int __init palm27x_asoc_init(void) 260 266 { 261 - palm27x_ep_gpio = data->jack_gpio; 267 + return platform_driver_register(&palm27x_wm9712_driver); 268 + } 269 + 270 + static void __exit palm27x_asoc_exit(void) 271 + { 272 + platform_driver_unregister(&palm27x_wm9712_driver); 262 273 } 263 274 264 275 module_init(palm27x_asoc_init);