snd_ps3.c (bd7dd77c2a05c530684eea2e3af16449ae9c5d52) | snd_ps3.c (26db11af12fb58dde1d6327035a248a99f60f112) |
---|---|
1/* 2 * Audio support for PS3 3 * Copyright (C) 2007 Sony Computer Entertainment Inc. 4 * All rights reserved. 5 * Copyright 2006, 2007 Sony Corporation 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License --- 463 unchanged lines hidden (view full) --- 472 473 card->dma_last_transfer_vaddr[SND_PS3_CH_R] = 474 card->dma_next_transfer_vaddr[SND_PS3_CH_R] = 475 card->dma_start_vaddr[SND_PS3_CH_R] = 476 runtime->dma_area + (runtime->dma_bytes / 2); 477 card->dma_start_bus_addr[SND_PS3_CH_R] = 478 runtime->dma_addr + (runtime->dma_bytes / 2); 479 | 1/* 2 * Audio support for PS3 3 * Copyright (C) 2007 Sony Computer Entertainment Inc. 4 * All rights reserved. 5 * Copyright 2006, 2007 Sony Corporation 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License --- 463 unchanged lines hidden (view full) --- 472 473 card->dma_last_transfer_vaddr[SND_PS3_CH_R] = 474 card->dma_next_transfer_vaddr[SND_PS3_CH_R] = 475 card->dma_start_vaddr[SND_PS3_CH_R] = 476 runtime->dma_area + (runtime->dma_bytes / 2); 477 card->dma_start_bus_addr[SND_PS3_CH_R] = 478 runtime->dma_addr + (runtime->dma_bytes / 2); 479 |
480 pr_debug("%s: vaddr=%p bus=%#lx\n", __func__, | 480 pr_debug("%s: vaddr=%p bus=%#llx\n", __func__, |
481 card->dma_start_vaddr[SND_PS3_CH_L], 482 card->dma_start_bus_addr[SND_PS3_CH_L]); 483 484 } 485 spin_unlock_irqrestore(&card->dma_lock, irqsave); 486 487 /* ensure the hardware sees the change */ 488 mb(); --- 475 unchanged lines hidden (view full) --- 964 965 /* irq */ 966 if (snd_ps3_allocate_irq()) { 967 ret = -ENXIO; 968 goto clean_dma_region; 969 } 970 971 /* create card instance */ | 481 card->dma_start_vaddr[SND_PS3_CH_L], 482 card->dma_start_bus_addr[SND_PS3_CH_L]); 483 484 } 485 spin_unlock_irqrestore(&card->dma_lock, irqsave); 486 487 /* ensure the hardware sees the change */ 488 mb(); --- 475 unchanged lines hidden (view full) --- 964 965 /* irq */ 966 if (snd_ps3_allocate_irq()) { 967 ret = -ENXIO; 968 goto clean_dma_region; 969 } 970 971 /* create card instance */ |
972 ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card); 973 if (ret < 0) | 972 the_card.card = snd_card_new(index, id, THIS_MODULE, 0); 973 if (!the_card.card) { 974 ret = -ENXIO; |
974 goto clean_irq; | 975 goto clean_irq; |
976 } |
|
975 976 strcpy(the_card.card->driver, "PS3"); 977 strcpy(the_card.card->shortname, "PS3"); 978 strcpy(the_card.card->longname, "PS3 sound"); 979 980 /* create control elements */ 981 for (i = 0; i < ARRAY_SIZE(spdif_ctls); i++) { 982 ret = snd_ctl_add(the_card.card, --- 40 unchanged lines hidden (view full) --- 1023 if (!(the_card.null_buffer_start_vaddr = 1024 dma_alloc_coherent(&the_card.ps3_dev->core, 1025 PAGE_SIZE, 1026 &the_card.null_buffer_start_dma_addr, 1027 GFP_KERNEL))) { 1028 pr_info("%s: nullbuffer alloc failed\n", __func__); 1029 goto clean_preallocate; 1030 } | 977 978 strcpy(the_card.card->driver, "PS3"); 979 strcpy(the_card.card->shortname, "PS3"); 980 strcpy(the_card.card->longname, "PS3 sound"); 981 982 /* create control elements */ 983 for (i = 0; i < ARRAY_SIZE(spdif_ctls); i++) { 984 ret = snd_ctl_add(the_card.card, --- 40 unchanged lines hidden (view full) --- 1025 if (!(the_card.null_buffer_start_vaddr = 1026 dma_alloc_coherent(&the_card.ps3_dev->core, 1027 PAGE_SIZE, 1028 &the_card.null_buffer_start_dma_addr, 1029 GFP_KERNEL))) { 1030 pr_info("%s: nullbuffer alloc failed\n", __func__); 1031 goto clean_preallocate; 1032 } |
1031 pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__, | 1033 pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, |
1032 the_card.null_buffer_start_vaddr, 1033 the_card.null_buffer_start_dma_addr); 1034 /* set default sample rate/word width */ 1035 snd_ps3_init_avsetting(&the_card); 1036 1037 /* register the card */ 1038 snd_card_set_dev(the_card.card, &dev->core); 1039 ret = snd_card_register(the_card.card); --- 167 unchanged lines hidden --- | 1034 the_card.null_buffer_start_vaddr, 1035 the_card.null_buffer_start_dma_addr); 1036 /* set default sample rate/word width */ 1037 snd_ps3_init_avsetting(&the_card); 1038 1039 /* register the card */ 1040 snd_card_set_dev(the_card.card, &dev->core); 1041 ret = snd_card_register(the_card.card); --- 167 unchanged lines hidden --- |