Merge branch 'master' of /home/trondmy/repositories/git/linux-2.6/

+1657 -412
+15
arch/avr32/boards/atstk1000/atstk1000.h
··· 1 + /* 2 + * ATSTK1000 setup code: Daughterboard interface 3 + * 4 + * Copyright (C) 2007 Atmel Corporation 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H 11 + #define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H 12 + 13 + extern struct atmel_lcdfb_info atstk1000_lcdc_data; 14 + 15 + #endif /* __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H */
+5 -5
arch/avr32/boards/atstk1000/atstk1002.c
··· 16 16 #include <linux/types.h> 17 17 #include <linux/spi/spi.h> 18 18 19 + #include <video/atmel_lcdc.h> 20 + 19 21 #include <asm/io.h> 20 22 #include <asm/setup.h> 21 23 #include <asm/arch/at32ap7000.h> ··· 25 23 #include <asm/arch/init.h> 26 24 #include <asm/arch/portmux.h> 27 25 26 + #include "atstk1000.h" 28 27 29 28 #define SW2_DEFAULT /* MMCI and UART_A available */ 30 29 ··· 34 31 }; 35 32 36 33 static struct eth_addr __initdata hw_addr[2]; 37 - 38 34 static struct eth_platform_data __initdata eth_data[2]; 39 - static struct lcdc_platform_data atstk1000_fb0_data; 40 35 41 36 static struct spi_board_info spi0_board_info[] __initdata = { 42 37 { ··· 149 148 set_hw_addr(at32_add_device_eth(0, &eth_data[0])); 150 149 151 150 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); 152 - atstk1000_fb0_data.fbmem_start = fbmem_start; 153 - atstk1000_fb0_data.fbmem_size = fbmem_size; 154 - at32_add_device_lcdc(0, &atstk1000_fb0_data); 151 + at32_add_device_lcdc(0, &atstk1000_lcdc_data, 152 + fbmem_start, fbmem_size); 155 153 156 154 return 0; 157 155 }
+44 -1
arch/avr32/boards/atstk1000/setup.c
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 #include <linux/bootmem.h> 11 + #include <linux/fb.h> 11 12 #include <linux/init.h> 12 13 #include <linux/types.h> 13 14 #include <linux/linkage.h> 14 15 15 - #include <asm/setup.h> 16 + #include <video/atmel_lcdc.h> 16 17 18 + #include <asm/setup.h> 17 19 #include <asm/arch/board.h> 20 + 21 + #include "atstk1000.h" 18 22 19 23 /* Initialized by bootloader-specific startup code. */ 20 24 struct tag *bootloader_tags __initdata; 25 + 26 + static struct fb_videomode __initdata ltv350qv_modes[] = { 27 + { 28 + .name = "320x240 @ 75", 29 + .refresh = 75, 30 + .xres = 320, .yres = 240, 31 + .pixclock = KHZ2PICOS(6891), 32 + 33 + .left_margin = 17, .right_margin = 33, 34 + .upper_margin = 10, .lower_margin = 10, 35 + .hsync_len = 16, .vsync_len = 1, 36 + 37 + .sync = 0, 38 + .vmode = FB_VMODE_NONINTERLACED, 39 + }, 40 + }; 41 + 42 + static struct fb_monspecs __initdata atstk1000_default_monspecs = { 43 + .manufacturer = "SNG", 44 + .monitor = "LTV350QV", 45 + .modedb = ltv350qv_modes, 46 + .modedb_len = ARRAY_SIZE(ltv350qv_modes), 47 + .hfmin = 14820, 48 + .hfmax = 22230, 49 + .vfmin = 60, 50 + .vfmax = 90, 51 + .dclkmax = 30000000, 52 + }; 53 + 54 + struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = { 55 + .default_bpp = 24, 56 + .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, 57 + .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT 58 + | ATMEL_LCDC_INVCLK 59 + | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE 60 + | ATMEL_LCDC_MEMOR_BIG), 61 + .default_monspecs = &atstk1000_default_monspecs, 62 + .guard_time = 2, 63 + };
-9
arch/avr32/kernel/irq.c
··· 7 7 * This program is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License version 2 as 9 9 * published by the Free Software Foundation. 10 - * 11 - * This file contains the code used by various IRQ handling routines: 12 - * asking for different IRQ's should be done through these routines 13 - * instead of just grabbing them. Thus setups with different IRQ numbers 14 - * shouldn't result in any weird surprises, and installing new handlers 15 - * should be easier. 16 - * 17 - * IRQ's are in fact implemented a bit like signal handlers for the kernel. 18 - * Naturally it's not a 1:1 relation, but there are similarities. 19 10 */ 20 11 21 12 #include <linux/interrupt.h>
+1 -6
arch/avr32/kernel/kprobes.c
··· 179 179 return 1; 180 180 } 181 181 182 - static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) 182 + int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) 183 183 { 184 184 struct kprobe *cur = kprobe_running(); 185 185 ··· 214 214 break; 215 215 case DIE_SSTEP: 216 216 if (post_kprobe_handler(args->regs)) 217 - ret = NOTIFY_STOP; 218 - break; 219 - case DIE_FAULT: 220 - if (kprobe_running() 221 - && kprobe_fault_handler(args->regs, args->trapnr)) 222 217 ret = NOTIFY_STOP; 223 218 break; 224 219 default:
+3
arch/avr32/kernel/syscall_table.S
··· 292 292 .long sys_shmdt 293 293 .long sys_shmctl 294 294 .long sys_utimensat 295 + .long sys_signalfd 296 + .long sys_timerfd /* 280 */ 297 + .long sys_eventfd 295 298 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */
+60 -17
arch/avr32/mach-at32ap/at32ap7000.c
··· 6 6 * published by the Free Software Foundation. 7 7 */ 8 8 #include <linux/clk.h> 9 + #include <linux/fb.h> 9 10 #include <linux/init.h> 10 11 #include <linux/platform_device.h> 11 12 #include <linux/spi/spi.h> ··· 17 16 #include <asm/arch/board.h> 18 17 #include <asm/arch/portmux.h> 19 18 #include <asm/arch/sm.h> 19 + 20 + #include <video/atmel_lcdc.h> 20 21 21 22 #include "clock.h" 22 23 #include "hmatrix.h" ··· 884 881 /* -------------------------------------------------------------------- 885 882 * LCDC 886 883 * -------------------------------------------------------------------- */ 887 - static struct lcdc_platform_data lcdc0_data; 888 - static struct resource lcdc0_resource[] = { 884 + static struct atmel_lcdfb_info atmel_lcdfb0_data; 885 + static struct resource atmel_lcdfb0_resource[] = { 889 886 { 890 887 .start = 0xff000000, 891 888 .end = 0xff000fff, 892 889 .flags = IORESOURCE_MEM, 893 890 }, 894 891 IRQ(1), 892 + { 893 + /* Placeholder for pre-allocated fb memory */ 894 + .start = 0x00000000, 895 + .end = 0x00000000, 896 + .flags = 0, 897 + }, 895 898 }; 896 - DEFINE_DEV_DATA(lcdc, 0); 897 - DEV_CLK(hclk, lcdc0, hsb, 7); 898 - static struct clk lcdc0_pixclk = { 899 - .name = "pixclk", 900 - .dev = &lcdc0_device.dev, 899 + DEFINE_DEV_DATA(atmel_lcdfb, 0); 900 + DEV_CLK(hck1, atmel_lcdfb0, hsb, 7); 901 + static struct clk atmel_lcdfb0_pixclk = { 902 + .name = "lcdc_clk", 903 + .dev = &atmel_lcdfb0_device.dev, 901 904 .mode = genclk_mode, 902 905 .get_rate = genclk_get_rate, 903 906 .set_rate = genclk_set_rate, ··· 912 903 }; 913 904 914 905 struct platform_device *__init 915 - at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data) 906 + at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 907 + unsigned long fbmem_start, unsigned long fbmem_len) 916 908 { 917 909 struct platform_device *pdev; 910 + struct atmel_lcdfb_info *info; 911 + struct fb_monspecs *monspecs; 912 + struct fb_videomode *modedb; 913 + unsigned int modedb_size; 914 + 915 + /* 916 + * Do a deep copy of the fb data, monspecs and modedb. Make 917 + * sure all allocations are done before setting up the 918 + * portmux. 919 + */ 920 + monspecs = kmemdup(data->default_monspecs, 921 + sizeof(struct fb_monspecs), GFP_KERNEL); 922 + if (!monspecs) 923 + return NULL; 924 + 925 + modedb_size = sizeof(struct fb_videomode) * monspecs->modedb_len; 926 + modedb = kmemdup(monspecs->modedb, modedb_size, GFP_KERNEL); 927 + if (!modedb) 928 + goto err_dup_modedb; 929 + monspecs->modedb = modedb; 918 930 919 931 switch (id) { 920 932 case 0: 921 - pdev = &lcdc0_device; 933 + pdev = &atmel_lcdfb0_device; 922 934 select_peripheral(PC(19), PERIPH_A, 0); /* CC */ 923 935 select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ 924 936 select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ ··· 972 942 select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ 973 943 select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ 974 944 975 - clk_set_parent(&lcdc0_pixclk, &pll0); 976 - clk_set_rate(&lcdc0_pixclk, clk_get_rate(&pll0)); 945 + clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); 946 + clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); 977 947 break; 978 948 979 949 default: 980 - return NULL; 950 + goto err_invalid_id; 981 951 } 982 952 983 - memcpy(pdev->dev.platform_data, data, 984 - sizeof(struct lcdc_platform_data)); 953 + if (fbmem_len) { 954 + pdev->resource[2].start = fbmem_start; 955 + pdev->resource[2].end = fbmem_start + fbmem_len - 1; 956 + pdev->resource[2].flags = IORESOURCE_MEM; 957 + } 958 + 959 + info = pdev->dev.platform_data; 960 + memcpy(info, data, sizeof(struct atmel_lcdfb_info)); 961 + info->default_monspecs = monspecs; 985 962 986 963 platform_device_register(pdev); 987 964 return pdev; 965 + 966 + err_invalid_id: 967 + kfree(modedb); 968 + err_dup_modedb: 969 + kfree(monspecs); 970 + return NULL; 988 971 } 989 972 990 973 /* -------------------------------------------------------------------- ··· 1080 1037 &macb1_pclk, 1081 1038 &atmel_spi0_spi_clk, 1082 1039 &atmel_spi1_spi_clk, 1083 - &lcdc0_hclk, 1084 - &lcdc0_pixclk, 1040 + &atmel_lcdfb0_hck1, 1041 + &atmel_lcdfb0_pixclk, 1085 1042 &gclk0, 1086 1043 &gclk1, 1087 1044 &gclk2, ··· 1120 1077 genclk_init_parent(&gclk2); 1121 1078 genclk_init_parent(&gclk3); 1122 1079 genclk_init_parent(&gclk4); 1123 - genclk_init_parent(&lcdc0_pixclk); 1080 + genclk_init_parent(&atmel_lcdfb0_pixclk); 1124 1081 1125 1082 /* 1126 1083 * Turn on all clocks that have at least one user already, and
+12 -24
arch/avr32/mm/fault.c
··· 12 12 #include <linux/mm.h> 13 13 #include <linux/module.h> 14 14 #include <linux/pagemap.h> 15 - 16 15 #include <linux/kdebug.h> 16 + #include <linux/kprobes.h> 17 + 17 18 #include <asm/mmu_context.h> 18 19 #include <asm/sysreg.h> 19 20 #include <asm/tlb.h> 20 21 #include <asm/uaccess.h> 21 22 22 23 #ifdef CONFIG_KPROBES 23 - ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 24 - 25 - /* Hook to register for page fault notifications */ 26 - int register_page_fault_notifier(struct notifier_block *nb) 24 + static inline int notify_page_fault(struct pt_regs *regs, int trap) 27 25 { 28 - return atomic_notifier_chain_register(&notify_page_fault_chain, nb); 29 - } 26 + int ret = 0; 30 27 31 - int unregister_page_fault_notifier(struct notifier_block *nb) 32 - { 33 - return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 34 - } 28 + if (!user_mode(regs)) { 29 + if (kprobe_running() && kprobe_fault_handler(regs, trap)) 30 + ret = 1; 31 + } 35 32 36 - static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, 37 - int trap, int sig) 38 - { 39 - struct die_args args = { 40 - .regs = regs, 41 - .trapnr = trap, 42 - }; 43 - return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); 33 + return ret; 44 34 } 45 35 #else 46 - static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, 47 - int trap, int sig) 36 + static inline int notify_page_fault(struct pt_regs *regs, int trap) 48 37 { 49 - return NOTIFY_DONE; 38 + return 0; 50 39 } 51 40 #endif 52 41 ··· 65 76 long signr; 66 77 int code; 67 78 68 - if (notify_page_fault(DIE_PAGE_FAULT, regs, 69 - ecr, SIGSEGV) == NOTIFY_STOP) 79 + if (notify_page_fault(regs, ecr)) 70 80 return; 71 81 72 82 address = sysreg_read(TLBEAR);
+1 -1
arch/ia64/kernel/acpi.c
··· 791 791 early_param("additional_cpus", setup_additional_cpus); 792 792 793 793 /* 794 - * cpu_possible_map should be static, it cannot change as cpu's 794 + * cpu_possible_map should be static, it cannot change as CPUs 795 795 * are onlined, or offlined. The reason is per-cpu data-structures 796 796 * are allocated by some modules at init time, and dont expect to 797 797 * do this dynamically on cpu arrival/departure.
+16 -8
arch/ia64/kernel/crash.c
··· 156 156 if (!kdump_on_init) 157 157 return NOTIFY_DONE; 158 158 159 - if (val != DIE_INIT_MONARCH_ENTER && 160 - val != DIE_INIT_SLAVE_ENTER && 159 + if (val != DIE_INIT_MONARCH_LEAVE && 160 + val != DIE_INIT_SLAVE_LEAVE && 161 + val != DIE_INIT_MONARCH_PROCESS && 161 162 val != DIE_MCA_RENDZVOUS_LEAVE && 162 163 val != DIE_MCA_MONARCH_LEAVE) 163 164 return NOTIFY_DONE; 164 165 165 166 nd = (struct ia64_mca_notify_die *)args->err; 166 - /* Reason code 1 means machine check rendezous*/ 167 - if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) && 168 - nd->sos->rv_rc == 1) 167 + /* Reason code 1 means machine check rendezvous*/ 168 + if ((val == DIE_INIT_MONARCH_LEAVE || val == DIE_INIT_SLAVE_LEAVE 169 + || val == DIE_INIT_MONARCH_PROCESS) && nd->sos->rv_rc == 1) 169 170 return NOTIFY_DONE; 170 171 171 172 switch (val) { 172 - case DIE_INIT_MONARCH_ENTER: 173 + case DIE_INIT_MONARCH_PROCESS: 174 + atomic_set(&kdump_in_progress, 1); 175 + *(nd->monarch_cpu) = -1; 176 + break; 177 + case DIE_INIT_MONARCH_LEAVE: 173 178 machine_kdump_on_init(); 174 179 break; 175 - case DIE_INIT_SLAVE_ENTER: 176 - unw_init_running(kdump_cpu_freeze, NULL); 180 + case DIE_INIT_SLAVE_LEAVE: 181 + if (atomic_read(&kdump_in_progress)) 182 + unw_init_running(kdump_cpu_freeze, NULL); 177 183 break; 178 184 case DIE_MCA_RENDZVOUS_LEAVE: 179 185 if (atomic_read(&kdump_in_progress)) ··· 221 215 static int 222 216 machine_crash_setup(void) 223 217 { 218 + /* be notified before default_monarch_init_process */ 224 219 static struct notifier_block kdump_init_notifier_nb = { 225 220 .notifier_call = kdump_init_notifier, 221 + .priority = 1, 226 222 }; 227 223 int ret; 228 224 if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
+3
arch/ia64/kernel/entry.S
··· 1585 1585 data8 sys_getcpu 1586 1586 data8 sys_epoll_pwait // 1305 1587 1587 data8 sys_utimensat 1588 + data8 sys_signalfd 1589 + data8 sys_timerfd 1590 + data8 sys_eventfd 1588 1591 1589 1592 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
+3 -3
arch/ia64/kernel/irq.c
··· 4 4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar 5 5 * 6 6 * This file contains the code used by various IRQ handling routines: 7 - * asking for different IRQ's should be done through these routines 7 + * asking for different IRQs should be done through these routines 8 8 * instead of just grabbing them. Thus setups with different IRQ numbers 9 9 * shouldn't result in any weird surprises, and installing new handlers 10 10 * should be easier. ··· 12 12 * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004 13 13 * 14 14 * 4/14/2004: Added code to handle cpu migration and do safe irq 15 - * migration without lossing interrupts for iosapic 15 + * migration without losing interrupts for iosapic 16 16 * architecture. 17 17 */ 18 18 ··· 190 190 } 191 191 192 192 /* 193 - * Phase 1: Locate irq's bound to this cpu and 193 + * Phase 1: Locate IRQs bound to this cpu and 194 194 * relocate them for cpu removal. 195 195 */ 196 196 migrate_irqs();
+1 -1
arch/ia64/kernel/irq_lsapic.c
··· 23 23 static void 24 24 lsapic_noop (unsigned int irq) 25 25 { 26 - /* nuthing to do... */ 26 + /* nothing to do... */ 27 27 } 28 28 29 29 static int lsapic_retrigger(unsigned int irq)
+4 -11
arch/ia64/kernel/kprobes.c
··· 151 151 152 152 cmp_inst.l = kprobe_inst; 153 153 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) { 154 - /* Integere compare - Register Register (A6 type)*/ 154 + /* Integer compare - Register Register (A6 type)*/ 155 155 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0) 156 156 &&(cmp_inst.f.c == 1)) 157 157 ctype_unc = 1; 158 158 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) { 159 - /* Integere compare - Immediate Register (A8 type)*/ 159 + /* Integer compare - Immediate Register (A8 type)*/ 160 160 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1)) 161 161 ctype_unc = 1; 162 162 } ··· 820 820 return 1; 821 821 } 822 822 823 - static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) 823 + int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) 824 824 { 825 825 struct kprobe *cur = kprobe_running(); 826 826 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); ··· 904 904 if (post_kprobes_handler(args->regs)) 905 905 ret = NOTIFY_STOP; 906 906 break; 907 - case DIE_PAGE_FAULT: 908 - /* kprobe_running() needs smp_processor_id() */ 909 - preempt_disable(); 910 - if (kprobe_running() && 911 - kprobes_fault_handler(args->regs, args->trapnr)) 912 - ret = NOTIFY_STOP; 913 - preempt_enable(); 914 907 default: 915 908 break; 916 909 } ··· 947 954 /* 948 955 * Callee owns the argument space and could overwrite it, eg 949 956 * tail call optimization. So to be absolutely safe 950 - * we save the argument space before transfering the control 957 + * we save the argument space before transferring the control 951 958 * to instrumented jprobe function which runs in 952 959 * the process context 953 960 */
+4 -1
arch/ia64/kernel/mca.c
··· 273 273 274 274 mlogbuf_finished = 1; 275 275 } 276 - EXPORT_SYMBOL(ia64_mlogbuf_finish); 277 276 278 277 /* 279 278 * Print buffered messages from INIT context. ··· 1476 1477 struct task_struct *g, *t; 1477 1478 if (val != DIE_INIT_MONARCH_PROCESS) 1478 1479 return NOTIFY_DONE; 1480 + #ifdef CONFIG_KEXEC 1481 + if (atomic_read(&kdump_in_progress)) 1482 + return NOTIFY_DONE; 1483 + #endif 1479 1484 1480 1485 /* 1481 1486 * FIXME: mlogbuf will brim over with INIT stack dumps.
+2 -2
arch/ia64/kernel/mca_drv.c
··· 438 438 * @peidx: pointer of index of processor error section 439 439 * 440 440 * Return value: 441 - * target address on Success / 0 on Failue 441 + * target address on Success / 0 on Failure 442 442 */ 443 443 static u64 444 444 get_target_identifier(peidx_table_t *peidx) ··· 701 701 return fatal_mca("External bus check fatal status"); 702 702 703 703 /* 704 - * This is a local MCA and estimated as a recoverble error. 704 + * This is a local MCA and estimated as a recoverable error. 705 705 */ 706 706 if (platform) 707 707 return recover_from_platform_error(slidx, peidx, pbci, sos);
+1 -1
arch/ia64/kernel/module.c
··· 861 861 /* 862 862 * Modules contain a single unwind table which covers both the core and the init text 863 863 * sections but since the two are not contiguous, we need to split this table up such that 864 - * we can register (and unregister) each "segment" seperately. Fortunately, this sounds 864 + * we can register (and unregister) each "segment" separately. Fortunately, this sounds 865 865 * more complicated than it really is. 866 866 */ 867 867 static void
+9 -9
arch/ia64/kernel/perfmon.c
··· 1318 1318 { 1319 1319 unsigned long flags; 1320 1320 /* 1321 - * validy checks on cpu_mask have been done upstream 1321 + * validity checks on cpu_mask have been done upstream 1322 1322 */ 1323 1323 LOCK_PFS(flags); 1324 1324 ··· 1384 1384 { 1385 1385 unsigned long flags; 1386 1386 /* 1387 - * validy checks on cpu_mask have been done upstream 1387 + * validity checks on cpu_mask have been done upstream 1388 1388 */ 1389 1389 LOCK_PFS(flags); 1390 1390 ··· 1835 1835 /* 1836 1836 * remove our file from the async queue, if we use this mode. 1837 1837 * This can be done without the context being protected. We come 1838 - * here when the context has become unreacheable by other tasks. 1838 + * here when the context has become unreachable by other tasks. 1839 1839 * 1840 1840 * We may still have active monitoring at this point and we may 1841 1841 * end up in pfm_overflow_handler(). However, fasync_helper() ··· 2132 2132 filp->private_data = NULL; 2133 2133 2134 2134 /* 2135 - * if we free on the spot, the context is now completely unreacheable 2135 + * if we free on the spot, the context is now completely unreachable 2136 2136 * from the callers side. The monitored task side is also cut, so we 2137 2137 * can freely cut. 2138 2138 * ··· 2562 2562 ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1; 2563 2563 2564 2564 /* 2565 - * bitmask of all PMDs that are accesible to this context 2565 + * bitmask of all PMDs that are accessible to this context 2566 2566 */ 2567 2567 ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0]; 2568 2568 ··· 3395 3395 if (unlikely(!PMD_IS_IMPL(cnum))) goto error; 3396 3396 /* 3397 3397 * we can only read the register that we use. That includes 3398 - * the one we explicitely initialize AND the one we want included 3398 + * the one we explicitly initialize AND the one we want included 3399 3399 * in the sampling buffer (smpl_regs). 3400 3400 * 3401 3401 * Having this restriction allows optimization in the ctxsw routine ··· 3715 3715 * if non-blocking, then we ensure that the task will go into 3716 3716 * pfm_handle_work() before returning to user mode. 3717 3717 * 3718 - * We cannot explicitely reset another task, it MUST always 3718 + * We cannot explicitly reset another task, it MUST always 3719 3719 * be done by the task itself. This works for system wide because 3720 3720 * the tool that is controlling the session is logically doing 3721 3721 * "self-monitoring". ··· 4644 4644 switch(state) { 4645 4645 case PFM_CTX_UNLOADED: 4646 4646 /* 4647 - * only comes to thios function if pfm_context is not NULL, i.e., cannot 4647 + * only comes to this function if pfm_context is not NULL, i.e., cannot 4648 4648 * be in unloaded state 4649 4649 */ 4650 4650 printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid); ··· 5247 5247 5248 5248 /* 5249 5249 * main overflow processing routine. 5250 - * it can be called from the interrupt path or explicitely during the context switch code 5250 + * it can be called from the interrupt path or explicitly during the context switch code 5251 5251 */ 5252 5252 static void 5253 5253 pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs)
+1 -1
arch/ia64/kernel/perfmon_mckinley.h
··· 181 181 .pmc_desc = pfm_mck_pmc_desc, 182 182 .num_ibrs = 8, 183 183 .num_dbrs = 8, 184 - .use_rr_dbregs = 1 /* debug register are use for range retrictions */ 184 + .use_rr_dbregs = 1 /* debug register are use for range restrictions */ 185 185 }; 186 186 187 187
+1 -1
arch/ia64/kernel/sal.c
··· 134 134 * interrupt redirection. The reason is this would require that 135 135 * All interrupts be stopped and hard bind the irq to a cpu. 136 136 * Later when the interrupt is fired we need to set the redir hint 137 - * on again in the vector. This is combersome for something that the 137 + * on again in the vector. This is cumbersome for something that the 138 138 * user mode irq balancer will solve anyways. 139 139 */ 140 140 no_int_routing=1;
+1 -1
arch/ia64/kernel/salinfo.c
··· 162 162 /** salinfo_platform_oemdata - optional callback to decode oemdata from an error 163 163 * record. 164 164 * @sect_header: pointer to the start of the section to decode. 165 - * @oemdata: returns vmalloc area containing the decded output. 165 + * @oemdata: returns vmalloc area containing the decoded output. 166 166 * @oemdata_size: returns length of decoded output (strlen). 167 167 * 168 168 * Description: If user space asks for oem data to be decoded by the kernel
+3 -3
arch/ia64/kernel/setup.c
··· 576 576 } 577 577 578 578 /* 579 - * Display cpu info for all cpu's. 579 + * Display cpu info for all CPUs. 580 580 */ 581 581 static int 582 582 show_cpuinfo (struct seq_file *m, void *v) ··· 761 761 c->cpu = smp_processor_id(); 762 762 763 763 /* below default values will be overwritten by identify_siblings() 764 - * for Multi-Threading/Multi-Core capable cpu's 764 + * for Multi-Threading/Multi-Core capable CPUs 765 765 */ 766 766 c->threads_per_core = c->cores_per_socket = c->num_log = 1; 767 767 c->socket_id = -1; ··· 947 947 ia32_cpu_init(); 948 948 #endif 949 949 950 - /* Clear ITC to eliminiate sched_clock() overflows in human time. */ 950 + /* Clear ITC to eliminate sched_clock() overflows in human time. */ 951 951 ia64_set_itc(0); 952 952 953 953 /* disable all local interrupt sources: */
+6 -6
arch/ia64/kernel/smp.c
··· 186 186 } 187 187 188 188 /* 189 - * Called with preeemption disabled. 189 + * Called with preemption disabled. 190 190 */ 191 191 static inline void 192 192 send_IPI_single (int dest_cpu, int op) ··· 196 196 } 197 197 198 198 /* 199 - * Called with preeemption disabled. 199 + * Called with preemption disabled. 200 200 */ 201 201 static inline void 202 202 send_IPI_allbutself (int op) ··· 210 210 } 211 211 212 212 /* 213 - * Called with preeemption disabled. 213 + * Called with preemption disabled. 214 214 */ 215 215 static inline void 216 216 send_IPI_all (int op) ··· 223 223 } 224 224 225 225 /* 226 - * Called with preeemption disabled. 226 + * Called with preemption disabled. 227 227 */ 228 228 static inline void 229 229 send_IPI_self (int op) ··· 252 252 } 253 253 #endif 254 254 /* 255 - * Called with preeemption disabled. 255 + * Called with preemption disabled. 256 256 */ 257 257 void 258 258 smp_send_reschedule (int cpu) ··· 261 261 } 262 262 263 263 /* 264 - * Called with preeemption disabled. 264 + * Called with preemption disabled. 265 265 */ 266 266 static void 267 267 smp_send_local_flush_tlb (int cpu)
+3 -3
arch/ia64/kernel/smpboot.c
··· 694 694 set_cpei_target_cpu(new_cpei_cpu); 695 695 desc = irq_desc + ia64_cpe_irq; 696 696 /* 697 - * Switch for now, immediatly, we need to do fake intr 697 + * Switch for now, immediately, we need to do fake intr 698 698 * as other interrupts, but need to study CPEI behaviour with 699 699 * polling before making changes. 700 700 */ ··· 840 840 } 841 841 842 842 /* 843 - * Assume that CPU's have been discovered by some platform-dependent interface. For 843 + * Assume that CPUs have been discovered by some platform-dependent interface. For 844 844 * SoftSDV/Lion, that would be ACPI. 845 845 * 846 846 * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP(). ··· 854 854 } *ap_startup; 855 855 long sal_ret; 856 856 857 - /* Tell SAL where to drop the AP's. */ 857 + /* Tell SAL where to drop the APs. */ 858 858 ap_startup = (struct fptr *) start_ap; 859 859 sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, 860 860 ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0);
+1 -1
arch/ia64/kernel/traps.c
··· 304 304 * Lower 4 bits are used as a count. Upper bits are a sequence 305 305 * number that is updated when count is reset. The cmpxchg will 306 306 * fail is seqno has changed. This minimizes mutiple cpus 307 - * reseting the count. 307 + * resetting the count. 308 308 */ 309 309 if (current_jiffies > last.time) 310 310 (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15));
+1 -1
arch/ia64/kernel/unwind.c
··· 2 2 * Copyright (C) 1999-2004 Hewlett-Packard Co 3 3 * David Mosberger-Tang <davidm@hpl.hp.com> 4 4 * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com> 5 - * - Change pt_regs_off() to make it less dependant on pt_regs structure. 5 + * - Change pt_regs_off() to make it less dependent on pt_regs structure. 6 6 */ 7 7 /* 8 8 * This file implements call frame unwind support for the Linux
+1 -1
arch/ia64/mm/discontig.c
··· 317 317 * node_online_map is not set for hot-added nodes at this time, 318 318 * because we are halfway through initialization of the new node's 319 319 * structures. If for_each_online_node() is used, a new node's 320 - * pg_data_ptrs will be not initialized. Insted of using it, 320 + * pg_data_ptrs will be not initialized. Instead of using it, 321 321 * pgdat_list[] is checked. 322 322 */ 323 323 for_each_node(node) {
+13 -26
arch/ia64/mm/fault.c
··· 19 19 extern void die (char *, struct pt_regs *, long); 20 20 21 21 #ifdef CONFIG_KPROBES 22 - ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 23 - 24 - /* Hook to register for page fault notifications */ 25 - int register_page_fault_notifier(struct notifier_block *nb) 22 + static inline int notify_page_fault(struct pt_regs *regs, int trap) 26 23 { 27 - return atomic_notifier_chain_register(&notify_page_fault_chain, nb); 28 - } 24 + int ret = 0; 29 25 30 - int unregister_page_fault_notifier(struct notifier_block *nb) 31 - { 32 - return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 33 - } 26 + if (!user_mode(regs)) { 27 + /* kprobe_running() needs smp_processor_id() */ 28 + preempt_disable(); 29 + if (kprobe_running() && kprobes_fault_handler(regs, trap)) 30 + ret = 1; 31 + preempt_enable(); 32 + } 34 33 35 - static inline int notify_page_fault(enum die_val val, const char *str, 36 - struct pt_regs *regs, long err, int trap, int sig) 37 - { 38 - struct die_args args = { 39 - .regs = regs, 40 - .str = str, 41 - .err = err, 42 - .trapnr = trap, 43 - .signr = sig 44 - }; 45 - return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); 34 + return ret; 46 35 } 47 36 #else 48 - static inline int notify_page_fault(enum die_val val, const char *str, 49 - struct pt_regs *regs, long err, int trap, int sig) 37 + static inline int notify_page_fault(struct pt_regs *regs, int trap) 50 38 { 51 - return NOTIFY_DONE; 39 + return 0; 52 40 } 53 41 #endif 54 42 ··· 105 117 /* 106 118 * This is to handle the kprobes on user space access instructions 107 119 */ 108 - if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, 109 - SIGSEGV) == NOTIFY_STOP) 120 + if (notify_page_fault(regs, TRAP_BRKPT)) 110 121 return; 111 122 112 123 down_read(&mm->mmap_sem);
+6 -6
arch/ia64/sn/kernel/bte.c
··· 63 63 * Use the block transfer engine to move kernel memory from src to dest 64 64 * using the assigned mode. 65 65 * 66 - * Paramaters: 66 + * Parameters: 67 67 * src - physical address of the transfer source. 68 68 * dest - physical address of the transfer destination. 69 69 * len - number of bytes to transfer from source to dest. ··· 247 247 * use the block transfer engine to move kernel 248 248 * memory from src to dest using the assigned mode. 249 249 * 250 - * Paramaters: 250 + * Parameters: 251 251 * src - physical address of the transfer source. 252 252 * dest - physical address of the transfer destination. 253 253 * len - number of bytes to transfer from source to dest. ··· 255 255 * for IBCT0/1 in the SGI documentation. 256 256 * 257 257 * NOTE: If the source, dest, and len are all cache line aligned, 258 - * then it would be _FAR_ preferrable to use bte_copy instead. 258 + * then it would be _FAR_ preferable to use bte_copy instead. 259 259 */ 260 260 bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) 261 261 { ··· 300 300 * a standard bte copy. 301 301 * 302 302 * One nasty exception to the above rule is when the 303 - * source and destination are not symetrically 303 + * source and destination are not symmetrically 304 304 * mis-aligned. If the source offset from the first 305 305 * cache line is different from the destination offset, 306 306 * we make the first section be the entire transfer ··· 337 337 338 338 if (footBcopyDest == (headBcopyDest + headBcopyLen)) { 339 339 /* 340 - * We have two contigous bcopy 340 + * We have two contiguous bcopy 341 341 * blocks. Merge them. 342 342 */ 343 343 headBcopyLen += footBcopyLen; ··· 375 375 } else { 376 376 377 377 /* 378 - * The transfer is not symetric, we will 378 + * The transfer is not symmetric, we will 379 379 * allocate a buffer large enough for all the 380 380 * data, bte_copy into that buffer and then 381 381 * bcopy to the destination.
+2 -2
arch/ia64/sn/kernel/bte_error.c
··· 105 105 } 106 106 107 107 BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id())); 108 - /* Reenable both bte interfaces */ 108 + /* Re-enable both bte interfaces */ 109 109 imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM); 110 110 imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1; 111 111 REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval); ··· 243 243 244 244 /* 245 245 * The caller has already figured out the error type, we save that 246 - * in the bte handle structure for the thread excercising the 246 + * in the bte handle structure for the thread exercising the 247 247 * interface to consume. 248 248 */ 249 249 bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
+1 -1
arch/ia64/sn/kernel/io_common.c
··· 479 479 } 480 480 481 481 /* 482 - * prime sn_pci_provider[]. Individial provider init routines will 482 + * prime sn_pci_provider[]. Individual provider init routines will 483 483 * override their respective default entries. 484 484 */ 485 485
+1 -1
arch/ia64/sn/kernel/setup.c
··· 167 167 * IO on SN2 is done via SAL calls, early_printk won't work without this. 168 168 * 169 169 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. 170 - * Any changes to those file may have to be made hereas well. 170 + * Any changes to those file may have to be made here as well. 171 171 */ 172 172 efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); 173 173 config_tables = __va(efi_systab->tables);
+1 -1
arch/ia64/sn/kernel/sn2/sn2_smp.c
··· 104 104 * 105 105 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. 106 106 * Context switching user threads which have memory-mapped MMIO may cause 107 - * PIOs to issue from seperate CPUs, thus the PIO writes must be drained 107 + * PIOs to issue from separate CPUs, thus the PIO writes must be drained 108 108 * from the previous CPU's Shub before execution resumes on the new CPU. 109 109 */ 110 110 void sn_migrate(struct task_struct *task)
+4 -4
arch/ia64/sn/kernel/xpc_channel.c
··· 293 293 294 294 295 295 /* 296 - * Pull the remote per partititon specific variables from the specified 296 + * Pull the remote per partition specific variables from the specified 297 297 * partition. 298 298 */ 299 299 enum xpc_retval ··· 461 461 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between 462 462 // >>> iterations of the for-loop, bail if set? 463 463 464 - // >>> should we impose a minumum #of entries? like 4 or 8? 464 + // >>> should we impose a minimum #of entries? like 4 or 8? 465 465 for (nentries = ch->local_nentries; nentries > 0; nentries--) { 466 466 467 467 nbytes = nentries * ch->msg_size; ··· 514 514 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between 515 515 // >>> iterations of the for-loop, bail if set? 516 516 517 - // >>> should we impose a minumum #of entries? like 4 or 8? 517 + // >>> should we impose a minimum #of entries? like 4 or 8? 518 518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) { 519 519 520 520 nbytes = nentries * ch->msg_size; ··· 1478 1478 1479 1479 1480 1480 /* 1481 - * Before proceding with the teardown we have to wait until all 1481 + * Before proceeding with the teardown we have to wait until all 1482 1482 * existing references cease. 1483 1483 */ 1484 1484 wait_event(part->teardown_wq, (atomic_read(&part->references) == 0));
+1 -1
arch/ia64/sn/kernel/xpnet.c
··· 531 531 dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp); 532 532 533 533 /* 534 - * If we wanted to allow promiscous mode to work like an 534 + * If we wanted to allow promiscuous mode to work like an 535 535 * unswitched network, this would be a good point to OR in a 536 536 * mask of partitions which should be receiving all packets. 537 537 */
+4 -4
arch/ia64/sn/pci/pci_dma.c
··· 333 333 /* 334 334 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work 335 335 * around hw issues at the pci bus level. SGI proms older than 336 - * 4.10 don't implment this. 336 + * 4.10 don't implement this. 337 337 */ 338 338 339 339 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, ··· 348 348 /* 349 349 * If the above failed, retry using the SAL_PROBE call which should 350 350 * be present in all proms (but which cannot work round PCI chipset 351 - * bugs). This code is retained for compatability with old 351 + * bugs). This code is retained for compatibility with old 352 352 * pre-4.10 proms, and should be removed at some point in the future. 353 353 */ 354 354 ··· 379 379 /* 380 380 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work 381 381 * around hw issues at the pci bus level. SGI proms older than 382 - * 4.10 don't implment this. 382 + * 4.10 don't implement this. 383 383 */ 384 384 385 385 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, ··· 394 394 /* 395 395 * If the above failed, retry using the SAL_PROBE call which should 396 396 * be present in all proms (but which cannot work round PCI chipset 397 - * bugs). This code is retained for compatability with old 397 + * bugs). This code is retained for compatibility with old 398 398 * pre-4.10 proms, and should be removed at some point in the future. 399 399 */ 400 400
+3 -3
arch/ia64/sn/pci/pcibr/pcibr_ate.c
··· 30 30 31 31 /* 32 32 * find_free_ate: Find the first free ate index starting from the given 33 - * index for the desired consequtive count. 33 + * index for the desired consecutive count. 34 34 */ 35 35 static int find_free_ate(struct ate_resource *ate_resource, int start, 36 36 int count) ··· 88 88 return -1; 89 89 90 90 /* 91 - * Find the required number of free consequtive ates. 91 + * Find the required number of free consecutive ates. 92 92 */ 93 93 start_index = 94 94 find_free_ate(ate_resource, ate_resource->lowest_free_index, ··· 105 105 /* 106 106 * Allocate "count" contiguous Bridge Address Translation Entries 107 107 * on the specified bridge to be used for PCI to XTALK mappings. 108 - * Indices in rm map range from 1..num_entries. Indicies returned 108 + * Indices in rm map range from 1..num_entries. Indices returned 109 109 * to caller range from 0..num_entries-1. 110 110 * 111 111 * Return the start index on success, -1 on failure.
+1 -1
arch/ia64/sn/pci/pcibr/pcibr_dma.c
··· 201 201 } 202 202 203 203 /* 204 - * Wrapper routine for free'ing DMA maps 204 + * Wrapper routine for freeing DMA maps 205 205 * DMA mappings for Direct 64 and 32 do not have any DMA maps. 206 206 */ 207 207 void
+3 -3
arch/ia64/sn/pci/tioca_provider.c
··· 223 223 224 224 /* 225 225 * Scan all vga controllers on this bus making sure they all 226 - * suport FW. If not, return. 226 + * support FW. If not, return. 227 227 */ 228 228 229 229 list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) { ··· 364 364 * @req_size: len (bytes) to map 365 365 * 366 366 * Map @paddr into CA address space using the GART mechanism. The mapped 367 - * dma_addr_t is guarenteed to be contiguous in CA bus space. 367 + * dma_addr_t is guaranteed to be contiguous in CA bus space. 368 368 */ 369 369 static dma_addr_t 370 370 tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size) ··· 526 526 return 0; 527 527 528 528 /* 529 - * If card is 64 or 48 bit addresable, use a direct mapping. 32 529 + * If card is 64 or 48 bit addressable, use a direct mapping. 32 530 530 * bit direct is so restrictive w.r.t. where the memory resides that 531 531 * we don't use it even though CA has some support. 532 532 */
+8 -8
arch/ia64/sn/pci/tioce_provider.c
··· 256 256 * @ct_addr: the coretalk address to map 257 257 * @len: number of bytes to map 258 258 * 259 - * Given the addressing type, set up various paramaters that define the 259 + * Given the addressing type, set up various parameters that define the 260 260 * ATE pool to use. Search for a contiguous block of entries to cover the 261 - * length, and if enough resources exist, fill in the ATE's and construct a 261 + * length, and if enough resources exist, fill in the ATEs and construct a 262 262 * tioce_dmamap struct to track the mapping. 263 263 */ 264 264 static u64 ··· 581 581 */ 582 582 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) { 583 583 /* 584 - * We have two options for 40-bit mappings: 16GB "super" ATE's 585 - * and 64MB "regular" ATE's. We'll try both if needed for a 584 + * We have two options for 40-bit mappings: 16GB "super" ATEs 585 + * and 64MB "regular" ATEs. We'll try both if needed for a 586 586 * given mapping but which one we try first depends on the 587 587 * size. For requests >64MB, prefer to use a super page with 588 588 * regular as the fallback. Otherwise, try in the reverse order. ··· 687 687 } 688 688 689 689 /** 690 - * tioce_reserve_m32 - reserve M32 ate's for the indicated address range 691 - * @tioce_kernel: TIOCE context to reserve ate's for 690 + * tioce_reserve_m32 - reserve M32 ATEs for the indicated address range 691 + * @tioce_kernel: TIOCE context to reserve ATEs for 692 692 * @base: starting bus address to reserve 693 693 * @limit: last bus address to reserve 694 694 * ··· 763 763 764 764 /* 765 765 * Set PMU pagesize to the largest size available, and zero out 766 - * the ate's. 766 + * the ATEs. 767 767 */ 768 768 769 769 tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; ··· 784 784 } 785 785 786 786 /* 787 - * Reserve ATE's corresponding to reserved address ranges. These 787 + * Reserve ATEs corresponding to reserved address ranges. These 788 788 * include: 789 789 * 790 790 * Memory space covered by each PPB mem base/limit register
+1 -1
arch/sparc64/kernel/Makefile
··· 12 12 irq.o ptrace.o time.o sys_sparc.o signal.o \ 13 13 unaligned.o central.o pci.o starfire.o semaphore.o \ 14 14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ 15 - visemul.o prom.o of_device.o 15 + visemul.o prom.o of_device.o hvapi.o 16 16 17 17 obj-$(CONFIG_STACKTRACE) += stacktrace.o 18 18 obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
+94
arch/sparc64/kernel/entry.S
··· 1843 1843 mov %o1, %o0 1844 1844 1: retl 1845 1845 nop 1846 + 1847 + /* %o0: API group number 1848 + * %o1: pointer to unsigned long major number storage 1849 + * %o2: pointer to unsigned long minor number storage 1850 + * 1851 + * returns %o0: status 1852 + */ 1853 + .globl sun4v_get_version 1854 + sun4v_get_version: 1855 + mov HV_CORE_GET_VER, %o5 1856 + mov %o1, %o3 1857 + mov %o2, %o4 1858 + ta HV_CORE_TRAP 1859 + stx %o1, [%o3] 1860 + retl 1861 + stx %o2, [%o4] 1862 + 1863 + /* %o0: API group number 1864 + * %o1: desired major number 1865 + * %o2: desired minor number 1866 + * %o3: pointer to unsigned long actual minor number storage 1867 + * 1868 + * returns %o0: status 1869 + */ 1870 + .globl sun4v_set_version 1871 + sun4v_set_version: 1872 + mov HV_CORE_SET_VER, %o5 1873 + mov %o3, %o4 1874 + ta HV_CORE_TRAP 1875 + retl 1876 + stx %o1, [%o4] 1877 + 1878 + /* %o0: pointer to unsigned long status 1879 + * 1880 + * returns %o0: signed character 1881 + */ 1882 + .globl sun4v_con_getchar 1883 + sun4v_con_getchar: 1884 + mov %o0, %o4 1885 + mov HV_FAST_CONS_GETCHAR, %o5 1886 + clr %o0 1887 + clr %o1 1888 + ta HV_FAST_TRAP 1889 + stx %o0, [%o4] 1890 + retl 1891 + sra %o1, 0, %o0 1892 + 1893 + /* %o0: signed long character 1894 + * 1895 + * returns %o0: status 1896 + */ 1897 + .globl sun4v_con_putchar 1898 + sun4v_con_putchar: 1899 + mov HV_FAST_CONS_PUTCHAR, %o5 1900 + ta HV_FAST_TRAP 1901 + retl 1902 + sra %o0, 0, %o0 1903 + 1904 + /* %o0: buffer real address 1905 + * %o1: buffer size 1906 + * %o2: pointer to unsigned long bytes_read 1907 + * 1908 + * returns %o0: status 1909 + */ 1910 + .globl sun4v_con_read 1911 + sun4v_con_read: 1912 + mov %o2, %o4 1913 + mov HV_FAST_CONS_READ, %o5 1914 + ta HV_FAST_TRAP 1915 + brnz %o0, 1f 1916 + cmp %o1, -1 /* break */ 1917 + be,a,pn %icc, 1f 1918 + mov %o1, %o0 1919 + cmp %o1, -2 /* hup */ 1920 + be,a,pn %icc, 1f 1921 + mov %o1, %o0 1922 + stx %o1, [%o4] 1923 + 1: retl 1924 + nop 1925 + 1926 + /* %o0: buffer real address 1927 + * %o1: buffer size 1928 + * %o2: pointer to unsigned long bytes_written 1929 + * 1930 + * returns %o0: status 1931 + */ 1932 + .globl sun4v_con_write 1933 + sun4v_con_write: 1934 + mov %o2, %o4 1935 + mov HV_FAST_CONS_WRITE, %o5 1936 + ta HV_FAST_TRAP 1937 + stx %o1, [%o4] 1938 + retl 1939 + nop
+189
arch/sparc64/kernel/hvapi.c
··· 1 + /* hvapi.c: Hypervisor API management. 2 + * 3 + * Copyright (C) 2007 David S. Miller <davem@davemloft.net> 4 + */ 5 + #include <linux/kernel.h> 6 + #include <linux/module.h> 7 + #include <linux/init.h> 8 + #include <linux/slab.h> 9 + 10 + #include <asm/hypervisor.h> 11 + #include <asm/oplib.h> 12 + 13 + /* If the hypervisor indicates that the API setting 14 + * calls are unsupported, by returning HV_EBADTRAP or 15 + * HV_ENOTSUPPORTED, we assume that API groups with the 16 + * PRE_API flag set are major 1 minor 0. 17 + */ 18 + struct api_info { 19 + unsigned long group; 20 + unsigned long major; 21 + unsigned long minor; 22 + unsigned int refcnt; 23 + unsigned int flags; 24 + #define FLAG_PRE_API 0x00000001 25 + }; 26 + 27 + static struct api_info api_table[] = { 28 + { .group = HV_GRP_SUN4V, .flags = FLAG_PRE_API }, 29 + { .group = HV_GRP_CORE, .flags = FLAG_PRE_API }, 30 + { .group = HV_GRP_INTR, }, 31 + { .group = HV_GRP_SOFT_STATE, }, 32 + { .group = HV_GRP_PCI, .flags = FLAG_PRE_API }, 33 + { .group = HV_GRP_LDOM, }, 34 + { .group = HV_GRP_SVC_CHAN, .flags = FLAG_PRE_API }, 35 + { .group = HV_GRP_NCS, .flags = FLAG_PRE_API }, 36 + { .group = HV_GRP_NIAG_PERF, .flags = FLAG_PRE_API }, 37 + { .group = HV_GRP_FIRE_PERF, }, 38 + { .group = HV_GRP_DIAG, .flags = FLAG_PRE_API }, 39 + }; 40 + 41 + static DEFINE_SPINLOCK(hvapi_lock); 42 + 43 + static struct api_info *__get_info(unsigned long group) 44 + { 45 + int i; 46 + 47 + for (i = 0; i < ARRAY_SIZE(api_table); i++) { 48 + if (api_table[i].group == group) 49 + return &api_table[i]; 50 + } 51 + return NULL; 52 + } 53 + 54 + static void __get_ref(struct api_info *p) 55 + { 56 + p->refcnt++; 57 + } 58 + 59 + static void __put_ref(struct api_info *p) 60 + { 61 + if (--p->refcnt == 0) { 62 + unsigned long ignore; 63 + 64 + sun4v_set_version(p->group, 0, 0, &ignore); 65 + p->major = p->minor = 0; 66 + } 67 + } 68 + 69 + /* Register a hypervisor API specification. It indicates the 70 + * API group and desired major+minor. 71 + * 72 + * If an existing API registration exists '0' (success) will 73 + * be returned if it is compatible with the one being registered. 74 + * Otherwise a negative error code will be returned. 75 + * 76 + * Otherwise an attempt will be made to negotiate the requested 77 + * API group/major/minor with the hypervisor, and errors returned 78 + * if that does not succeed. 79 + */ 80 + int sun4v_hvapi_register(unsigned long group, unsigned long major, 81 + unsigned long *minor) 82 + { 83 + struct api_info *p; 84 + unsigned long flags; 85 + int ret; 86 + 87 + spin_lock_irqsave(&hvapi_lock, flags); 88 + p = __get_info(group); 89 + ret = -EINVAL; 90 + if (p) { 91 + if (p->refcnt) { 92 + ret = -EINVAL; 93 + if (p->major == major) { 94 + *minor = p->minor; 95 + ret = 0; 96 + } 97 + } else { 98 + unsigned long actual_minor; 99 + unsigned long hv_ret; 100 + 101 + hv_ret = sun4v_set_version(group, major, *minor, 102 + &actual_minor); 103 + ret = -EINVAL; 104 + if (hv_ret == HV_EOK) { 105 + *minor = actual_minor; 106 + p->major = major; 107 + p->minor = actual_minor; 108 + ret = 0; 109 + } else if (hv_ret == HV_EBADTRAP || 110 + HV_ENOTSUPPORTED) { 111 + if (p->flags & FLAG_PRE_API) { 112 + if (major == 1) { 113 + p->major = 1; 114 + p->minor = 0; 115 + *minor = 0; 116 + ret = 0; 117 + } 118 + } 119 + } 120 + } 121 + 122 + if (ret == 0) 123 + __get_ref(p); 124 + } 125 + spin_unlock_irqrestore(&hvapi_lock, flags); 126 + 127 + return ret; 128 + } 129 + EXPORT_SYMBOL(sun4v_hvapi_register); 130 + 131 + void sun4v_hvapi_unregister(unsigned long group) 132 + { 133 + struct api_info *p; 134 + unsigned long flags; 135 + 136 + spin_lock_irqsave(&hvapi_lock, flags); 137 + p = __get_info(group); 138 + if (p) 139 + __put_ref(p); 140 + spin_unlock_irqrestore(&hvapi_lock, flags); 141 + } 142 + EXPORT_SYMBOL(sun4v_hvapi_unregister); 143 + 144 + int sun4v_hvapi_get(unsigned long group, 145 + unsigned long *major, 146 + unsigned long *minor) 147 + { 148 + struct api_info *p; 149 + unsigned long flags; 150 + int ret; 151 + 152 + spin_lock_irqsave(&hvapi_lock, flags); 153 + ret = -EINVAL; 154 + p = __get_info(group); 155 + if (p && p->refcnt) { 156 + *major = p->major; 157 + *minor = p->minor; 158 + ret = 0; 159 + } 160 + spin_unlock_irqrestore(&hvapi_lock, flags); 161 + 162 + return ret; 163 + } 164 + EXPORT_SYMBOL(sun4v_hvapi_get); 165 + 166 + void __init sun4v_hvapi_init(void) 167 + { 168 + unsigned long group, major, minor; 169 + 170 + group = HV_GRP_SUN4V; 171 + major = 1; 172 + minor = 0; 173 + if (sun4v_hvapi_register(group, major, &minor)) 174 + goto bad; 175 + 176 + group = HV_GRP_CORE; 177 + major = 1; 178 + minor = 1; 179 + if (sun4v_hvapi_register(group, major, &minor)) 180 + goto bad; 181 + 182 + return; 183 + 184 + bad: 185 + prom_printf("HVAPI: Cannot register API group " 186 + "%lx with major(%u) minor(%u)\n", 187 + group, major, minor); 188 + prom_halt(); 189 + }
+3
arch/sparc64/kernel/setup.c
··· 269 269 270 270 void __init sun4v_patch(void) 271 271 { 272 + extern void sun4v_hvapi_init(void); 272 273 struct sun4v_1insn_patch_entry *p1; 273 274 struct sun4v_2insn_patch_entry *p2; 274 275 ··· 301 300 302 301 p2++; 303 302 } 303 + 304 + sun4v_hvapi_init(); 304 305 } 305 306 306 307 #ifdef CONFIG_SMP
+2 -1
drivers/ata/ahci.c
··· 173 173 174 174 AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 175 175 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 176 - ATA_FLAG_SKIP_D2H_BSY, 176 + ATA_FLAG_SKIP_D2H_BSY | 177 + ATA_FLAG_ACPI_SATA, 177 178 }; 178 179 179 180 struct ahci_cmd_hdr {
+5 -5
drivers/ata/libata-acpi.c
··· 321 321 322 322 /* Don't continue if device has no _ADR method. 323 323 * _GTF is intended for known motherboard devices. */ 324 - if (!(ap->cbl == ATA_CBL_SATA)) { 324 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 325 325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); 326 326 if (err < 0) { 327 327 if (ata_msg_probe(ap)) ··· 343 343 344 344 /* Get this drive's _ADR info. if not already known. */ 345 345 if (!dev->obj_handle) { 346 - if (!(ap->cbl == ATA_CBL_SATA)) { 346 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 347 347 /* get child objects of dev_handle == channel objects, 348 348 * + _their_ children == drive objects */ 349 349 /* channel is ap->port_no */ ··· 528 528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", 529 529 __FUNCTION__, ap->port_no); 530 530 531 - if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) 531 + if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA)) 532 532 return 0; 533 533 534 534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) ··· 578 578 * we should not run GTF on PATA devices since some 579 579 * PATA require execution of GTM/STM before GTF. 580 580 */ 581 - if (!(ap->cbl == ATA_CBL_SATA)) 581 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) 582 582 return 0; 583 583 584 584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { ··· 641 641 __FUNCTION__, dev->devno, ap->port_no); 642 642 643 643 /* Don't continue if not a SATA device. */ 644 - if (!(ap->cbl == ATA_CBL_SATA)) { 644 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 645 645 if (ata_msg_probe(ap)) 646 646 ata_dev_printk(dev, KERN_DEBUG, 647 647 "%s: Not a SATA device\n", __FUNCTION__);
+50 -32
drivers/ata/libata-core.c
··· 1919 1919 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); 1920 1920 1921 1921 dev->n_sectors = ata_id_n_sectors(id); 1922 - dev->n_sectors_boot = dev->n_sectors; 1923 1922 1924 1923 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ 1925 1924 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, ··· 3631 3632 const u16 *old_id = dev->id; 3632 3633 unsigned char model[2][ATA_ID_PROD_LEN + 1]; 3633 3634 unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; 3634 - u64 new_n_sectors; 3635 3635 3636 3636 if (dev->class != new_class) { 3637 3637 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", ··· 3642 3644 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); 3643 3645 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); 3644 3646 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); 3645 - new_n_sectors = ata_id_n_sectors(new_id); 3646 3647 3647 3648 if (strcmp(model[0], model[1])) { 3648 3649 ata_dev_printk(dev, KERN_INFO, "model number mismatch " ··· 3655 3658 return 0; 3656 3659 } 3657 3660 3658 - if (dev->class == ATA_DEV_ATA && dev->n_sectors != new_n_sectors) { 3659 - ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " 3660 - "%llu != %llu\n", 3661 - (unsigned long long)dev->n_sectors, 3662 - (unsigned long long)new_n_sectors); 3663 - /* Are we the boot time size - if so we appear to be the 3664 - same disk at this point and our HPA got reapplied */ 3665 - if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors 3666 - && ata_id_hpa_enabled(new_id)) 3667 - return 1; 3668 - return 0; 3669 - } 3670 - 3671 3661 return 1; 3672 3662 } 3673 3663 3674 3664 /** 3675 - * ata_dev_revalidate - Revalidate ATA device 3676 - * @dev: device to revalidate 3665 + * ata_dev_reread_id - Re-read IDENTIFY data 3666 + * @adev: target ATA device 3677 3667 * @readid_flags: read ID flags 3678 3668 * 3679 3669 * Re-read IDENTIFY page and make sure @dev is still attached to ··· 3672 3688 * RETURNS: 3673 3689 * 0 on success, negative errno otherwise 3674 3690 */ 3675 - int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) 3691 + int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags) 3676 3692 { 3677 3693 unsigned int class = dev->class; 3678 3694 u16 *id = (void *)dev->ap->sector_buf; 3679 3695 int rc; 3680 3696 3681 - if (!ata_dev_enabled(dev)) { 3682 - rc = -ENODEV; 3683 - goto fail; 3684 - } 3685 - 3686 3697 /* read ID data */ 3687 3698 rc = ata_dev_read_id(dev, &class, readid_flags, id); 3688 3699 if (rc) 3689 - goto fail; 3700 + return rc; 3690 3701 3691 3702 /* is the device still there? */ 3692 - if (!ata_dev_same_device(dev, class, id)) { 3703 + if (!ata_dev_same_device(dev, class, id)) 3704 + return -ENODEV; 3705 + 3706 + memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); 3707 + return 0; 3708 + } 3709 + 3710 + /** 3711 + * ata_dev_revalidate - Revalidate ATA device 3712 + * @dev: device to revalidate 3713 + * @readid_flags: read ID flags 3714 + * 3715 + * Re-read IDENTIFY page, make sure @dev is still attached to the 3716 + * port and reconfigure it according to the new IDENTIFY page. 3717 + * 3718 + * LOCKING: 3719 + * Kernel thread context (may sleep) 3720 + * 3721 + * RETURNS: 3722 + * 0 on success, negative errno otherwise 3723 + */ 3724 + int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) 3725 + { 3726 + u64 n_sectors = dev->n_sectors; 3727 + int rc; 3728 + 3729 + if (!ata_dev_enabled(dev)) 3730 + return -ENODEV; 3731 + 3732 + /* re-read ID */ 3733 + rc = ata_dev_reread_id(dev, readid_flags); 3734 + if (rc) 3735 + goto fail; 3736 + 3737 + /* configure device according to the new ID */ 3738 + rc = ata_dev_configure(dev); 3739 + if (rc) 3740 + goto fail; 3741 + 3742 + /* verify n_sectors hasn't changed */ 3743 + if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) { 3744 + ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " 3745 + "%llu != %llu\n", 3746 + (unsigned long long)n_sectors, 3747 + (unsigned long long)dev->n_sectors); 3693 3748 rc = -ENODEV; 3694 3749 goto fail; 3695 3750 } 3696 3751 3697 - memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); 3698 - 3699 - /* configure device according to the new ID */ 3700 - rc = ata_dev_configure(dev); 3701 - if (rc == 0) 3702 - return 0; 3752 + return 0; 3703 3753 3704 3754 fail: 3705 3755 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc);
+36 -8
drivers/ata/libata-scsi.c
··· 893 893 return queue_depth; 894 894 } 895 895 896 + /* XXX: for ata_spindown_compat */ 897 + static void ata_delayed_done_timerfn(unsigned long arg) 898 + { 899 + struct scsi_cmnd *scmd = (void *)arg; 900 + 901 + scmd->scsi_done(scmd); 902 + } 903 + 904 + /* XXX: for ata_spindown_compat */ 905 + static void ata_delayed_done(struct scsi_cmnd *scmd) 906 + { 907 + static struct timer_list timer; 908 + 909 + setup_timer(&timer, ata_delayed_done_timerfn, (unsigned long)scmd); 910 + mod_timer(&timer, jiffies + 5 * HZ); 911 + } 912 + 896 913 /** 897 914 * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command 898 915 * @qc: Storage for translated ATA taskfile ··· 967 950 * for more info. 968 951 */ 969 952 if (ata_spindown_compat && 953 + (qc->dev->flags & ATA_DFLAG_SPUNDOWN) && 970 954 (system_state == SYSTEM_HALT || 971 955 system_state == SYSTEM_POWER_OFF)) { 972 - static int warned = 0; 956 + static unsigned long warned = 0; 973 957 974 - if (!warned) { 975 - spin_unlock_irq(qc->ap->lock); 958 + if (!test_and_set_bit(0, &warned)) { 976 959 ata_dev_printk(qc->dev, KERN_WARNING, 977 960 "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " 978 961 "UPDATE SHUTDOWN UTILITY\n"); 979 962 ata_dev_printk(qc->dev, KERN_WARNING, 980 963 "For more info, visit " 981 964 "http://linux-ata.org/shutdown.html\n"); 982 - warned = 1; 983 - ssleep(5); 984 - spin_lock_irq(qc->ap->lock); 965 + 966 + /* ->scsi_done is not used, use it for 967 + * delayed completion. 968 + */ 969 + scmd->scsi_done = qc->scsidone; 970 + qc->scsidone = ata_delayed_done; 985 971 } 986 972 scmd->result = SAM_STAT_GOOD; 987 973 return 1; ··· 1395 1375 } 1396 1376 } 1397 1377 1378 + /* XXX: track spindown state for spindown_compat */ 1379 + if (unlikely(qc->tf.command == ATA_CMD_STANDBY || 1380 + qc->tf.command == ATA_CMD_STANDBYNOW1)) 1381 + qc->dev->flags |= ATA_DFLAG_SPUNDOWN; 1382 + else if (likely(system_state != SYSTEM_HALT && 1383 + system_state != SYSTEM_POWER_OFF)) 1384 + qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN; 1385 + 1398 1386 if (need_sense && !ap->ops->error_handler) 1399 1387 ata_dump_status(ap->print_id, &qc->result_tf); 1400 1388 ··· 1516 1488 1517 1489 early_finish: 1518 1490 ata_qc_free(qc); 1519 - done(cmd); 1491 + qc->scsidone(cmd); 1520 1492 DPRINTK("EXIT - early finish (good or error)\n"); 1521 1493 return 0; 1522 1494 1523 1495 err_did: 1524 1496 ata_qc_free(qc); 1525 1497 cmd->result = (DID_ERROR << 16); 1526 - done(cmd); 1498 + qc->scsidone(cmd); 1527 1499 err_mem: 1528 1500 DPRINTK("EXIT - internal\n"); 1529 1501 return 0;
+2 -1
drivers/ata/libata.h
··· 76 76 extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); 77 77 extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, 78 78 unsigned int flags, u16 *id); 79 - extern int ata_dev_revalidate(struct ata_device *dev, unsigned int flags); 79 + extern int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags); 80 + extern int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags); 80 81 extern int ata_dev_configure(struct ata_device *dev); 81 82 extern int sata_down_spd_limit(struct ata_port *ap); 82 83 extern int sata_set_spd_needed(struct ata_port *ap);
+2 -2
drivers/ata/pata_scc.c
··· 864 864 * @ap: ATA port to be reset 865 865 */ 866 866 867 - static int scc_pata_prereset (struct ata_port *ap) 867 + static int scc_pata_prereset (struct ata_port *ap, unsigned long deadline) 868 868 { 869 869 ap->cbl = ATA_CBL_PATA80; 870 - return ata_std_prereset(ap); 870 + return ata_std_prereset(ap, deadline); 871 871 } 872 872 873 873 /**
+2 -1
drivers/ata/sata_sil24.c
··· 237 237 /* host flags */ 238 238 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 239 239 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 240 - ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY, 240 + ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY | 241 + ATA_FLAG_ACPI_SATA, 241 242 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 242 243 243 244 IRQ_STAT_4PORTS = 0xf,
+1
drivers/parport/parport_pc.c
··· 51 51 #include <linux/ioport.h> 52 52 #include <linux/kernel.h> 53 53 #include <linux/slab.h> 54 + #include <linux/dma-mapping.h> 54 55 #include <linux/pci.h> 55 56 #include <linux/pnp.h> 56 57 #include <linux/platform_device.h>
+214 -80
drivers/serial/sunhv.c
··· 1 1 /* sunhv.c: Serial driver for SUN4V hypervisor console. 2 2 * 3 - * Copyright (C) 2006 David S. Miller (davem@davemloft.net) 3 + * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) 4 4 */ 5 5 6 6 #include <linux/module.h> ··· 35 35 #define CON_BREAK ((long)-1) 36 36 #define CON_HUP ((long)-2) 37 37 38 - static inline long hypervisor_con_getchar(long *status) 39 - { 40 - register unsigned long func asm("%o5"); 41 - register unsigned long arg0 asm("%o0"); 42 - register unsigned long arg1 asm("%o1"); 43 - 44 - func = HV_FAST_CONS_GETCHAR; 45 - arg0 = 0; 46 - arg1 = 0; 47 - __asm__ __volatile__("ta %6" 48 - : "=&r" (func), "=&r" (arg0), "=&r" (arg1) 49 - : "0" (func), "1" (arg0), "2" (arg1), 50 - "i" (HV_FAST_TRAP)); 51 - 52 - *status = arg0; 53 - 54 - return (long) arg1; 55 - } 56 - 57 - static inline long hypervisor_con_putchar(long ch) 58 - { 59 - register unsigned long func asm("%o5"); 60 - register unsigned long arg0 asm("%o0"); 61 - 62 - func = HV_FAST_CONS_PUTCHAR; 63 - arg0 = ch; 64 - __asm__ __volatile__("ta %4" 65 - : "=&r" (func), "=&r" (arg0) 66 - : "0" (func), "1" (arg0), "i" (HV_FAST_TRAP)); 67 - 68 - return (long) arg0; 69 - } 70 - 71 38 #define IGNORE_BREAK 0x1 72 39 #define IGNORE_ALL 0x2 73 40 41 + static char *con_write_page; 42 + static char *con_read_page; 43 + 74 44 static int hung_up = 0; 75 45 76 - static struct tty_struct *receive_chars(struct uart_port *port) 46 + static void transmit_chars_putchar(struct uart_port *port, struct circ_buf *xmit) 77 47 { 78 - struct tty_struct *tty = NULL; 48 + while (!uart_circ_empty(xmit)) { 49 + long status = sun4v_con_putchar(xmit->buf[xmit->tail]); 50 + 51 + if (status != HV_EOK) 52 + break; 53 + 54 + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 55 + port->icount.tx++; 56 + } 57 + } 58 + 59 + static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit) 60 + { 61 + while (!uart_circ_empty(xmit)) { 62 + unsigned long ra = __pa(xmit->buf + xmit->tail); 63 + unsigned long len, status, sent; 64 + 65 + len = CIRC_CNT_TO_END(xmit->head, xmit->tail, 66 + UART_XMIT_SIZE); 67 + status = sun4v_con_write(ra, len, &sent); 68 + if (status != HV_EOK) 69 + break; 70 + xmit->tail = (xmit->tail + sent) & (UART_XMIT_SIZE - 1); 71 + port->icount.tx += sent; 72 + } 73 + } 74 + 75 + static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty) 76 + { 79 77 int saw_console_brk = 0; 80 78 int limit = 10000; 81 79 82 - if (port->info != NULL) /* Unopened serial console */ 83 - tty = port->info->tty; 84 - 85 80 while (limit-- > 0) { 86 81 long status; 87 - long c = hypervisor_con_getchar(&status); 88 - unsigned char flag; 82 + long c = sun4v_con_getchar(&status); 89 83 90 84 if (status == HV_EWOULDBLOCK) 91 85 break; ··· 104 110 continue; 105 111 } 106 112 107 - flag = TTY_NORMAL; 108 113 port->icount.rx++; 109 - if (c == CON_BREAK) { 110 - port->icount.brk++; 111 - if (uart_handle_break(port)) 112 - continue; 113 - flag = TTY_BREAK; 114 - } 115 114 116 115 if (uart_handle_sysrq_char(port, c)) 117 116 continue; 118 117 119 - if ((port->ignore_status_mask & IGNORE_ALL) || 120 - ((port->ignore_status_mask & IGNORE_BREAK) && 121 - (c == CON_BREAK))) 122 - continue; 123 - 124 - tty_insert_flip_char(tty, c, flag); 118 + tty_insert_flip_char(tty, c, TTY_NORMAL); 125 119 } 126 120 127 - if (saw_console_brk) 121 + return saw_console_brk; 122 + } 123 + 124 + static int receive_chars_read(struct uart_port *port, struct tty_struct *tty) 125 + { 126 + int saw_console_brk = 0; 127 + int limit = 10000; 128 + 129 + while (limit-- > 0) { 130 + unsigned long ra = __pa(con_read_page); 131 + unsigned long bytes_read, i; 132 + long stat = sun4v_con_read(ra, PAGE_SIZE, &bytes_read); 133 + 134 + if (stat != HV_EOK) { 135 + bytes_read = 0; 136 + 137 + if (stat == CON_BREAK) { 138 + if (uart_handle_break(port)) 139 + continue; 140 + saw_console_brk = 1; 141 + *con_read_page = 0; 142 + bytes_read = 1; 143 + } else if (stat == CON_HUP) { 144 + hung_up = 1; 145 + uart_handle_dcd_change(port, 0); 146 + continue; 147 + } else { 148 + /* HV_EWOULDBLOCK, etc. */ 149 + break; 150 + } 151 + } 152 + 153 + if (hung_up) { 154 + hung_up = 0; 155 + uart_handle_dcd_change(port, 1); 156 + } 157 + 158 + for (i = 0; i < bytes_read; i++) 159 + uart_handle_sysrq_char(port, con_read_page[i]); 160 + 161 + if (tty == NULL) 162 + continue; 163 + 164 + port->icount.rx += bytes_read; 165 + 166 + tty_insert_flip_string(tty, con_read_page, bytes_read); 167 + } 168 + 169 + return saw_console_brk; 170 + } 171 + 172 + struct sunhv_ops { 173 + void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit); 174 + int (*receive_chars)(struct uart_port *port, struct tty_struct *tty); 175 + }; 176 + 177 + static struct sunhv_ops bychar_ops = { 178 + .transmit_chars = transmit_chars_putchar, 179 + .receive_chars = receive_chars_getchar, 180 + }; 181 + 182 + static struct sunhv_ops bywrite_ops = { 183 + .transmit_chars = transmit_chars_write, 184 + .receive_chars = receive_chars_read, 185 + }; 186 + 187 + static struct sunhv_ops *sunhv_ops = &bychar_ops; 188 + 189 + static struct tty_struct *receive_chars(struct uart_port *port) 190 + { 191 + struct tty_struct *tty = NULL; 192 + 193 + if (port->info != NULL) /* Unopened serial console */ 194 + tty = port->info->tty; 195 + 196 + if (sunhv_ops->receive_chars(port, tty)) 128 197 sun_do_break(); 129 198 130 199 return tty; ··· 204 147 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) 205 148 return; 206 149 207 - while (!uart_circ_empty(xmit)) { 208 - long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); 209 - 210 - if (status != HV_EOK) 211 - break; 212 - 213 - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 214 - port->icount.tx++; 215 - } 150 + sunhv_ops->transmit_chars(port, xmit); 216 151 217 152 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 218 153 uart_write_wakeup(port); ··· 261 212 struct circ_buf *xmit = &port->info->xmit; 262 213 263 214 while (!uart_circ_empty(xmit)) { 264 - long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); 215 + long status = sun4v_con_putchar(xmit->buf[xmit->tail]); 265 216 266 217 if (status != HV_EOK) 267 218 break; ··· 280 231 spin_lock_irqsave(&port->lock, flags); 281 232 282 233 while (limit-- > 0) { 283 - long status = hypervisor_con_putchar(ch); 234 + long status = sun4v_con_putchar(ch); 284 235 if (status == HV_EOK) 285 236 break; 237 + udelay(1); 286 238 } 287 239 288 240 spin_unlock_irqrestore(&port->lock, flags); ··· 304 254 { 305 255 if (break_state) { 306 256 unsigned long flags; 307 - int limit = 1000000; 257 + int limit = 10000; 308 258 309 259 spin_lock_irqsave(&port->lock, flags); 310 260 311 261 while (limit-- > 0) { 312 - long status = hypervisor_con_putchar(CON_BREAK); 262 + long status = sun4v_con_putchar(CON_BREAK); 313 263 if (status == HV_EOK) 314 264 break; 315 - udelay(2); 265 + udelay(1); 316 266 } 317 267 318 268 spin_unlock_irqrestore(&port->lock, flags); ··· 409 359 410 360 static struct uart_port *sunhv_port; 411 361 412 - static inline void sunhv_console_putchar(struct uart_port *port, char c) 362 + /* Copy 's' into the con_write_page, decoding "\n" into 363 + * "\r\n" along the way. We have to return two lengths 364 + * because the caller needs to know how much to advance 365 + * 's' and also how many bytes to output via con_write_page. 366 + */ 367 + static int fill_con_write_page(const char *s, unsigned int n, 368 + unsigned long *page_bytes) 413 369 { 370 + const char *orig_s = s; 371 + char *p = con_write_page; 372 + int left = PAGE_SIZE; 373 + 374 + while (n--) { 375 + if (*s == '\n') { 376 + if (left < 2) 377 + break; 378 + *p++ = '\r'; 379 + left--; 380 + } else if (left < 1) 381 + break; 382 + *p++ = *s++; 383 + left--; 384 + } 385 + *page_bytes = p - con_write_page; 386 + return s - orig_s; 387 + } 388 + 389 + static void sunhv_console_write_paged(struct console *con, const char *s, unsigned n) 390 + { 391 + struct uart_port *port = sunhv_port; 414 392 unsigned long flags; 415 - int limit = 1000000; 416 393 417 394 spin_lock_irqsave(&port->lock, flags); 395 + while (n > 0) { 396 + unsigned long ra = __pa(con_write_page); 397 + unsigned long page_bytes; 398 + unsigned int cpy = fill_con_write_page(s, n, 399 + &page_bytes); 418 400 419 - while (limit-- > 0) { 420 - long status = hypervisor_con_putchar(c); 421 - if (status == HV_EOK) 422 - break; 423 - udelay(2); 401 + n -= cpy; 402 + s += cpy; 403 + while (page_bytes > 0) { 404 + unsigned long written; 405 + int limit = 1000000; 406 + 407 + while (limit--) { 408 + unsigned long stat; 409 + 410 + stat = sun4v_con_write(ra, page_bytes, 411 + &written); 412 + if (stat == HV_EOK) 413 + break; 414 + udelay(1); 415 + } 416 + if (limit <= 0) 417 + break; 418 + page_bytes -= written; 419 + ra += written; 420 + } 424 421 } 425 - 426 422 spin_unlock_irqrestore(&port->lock, flags); 427 423 } 428 424 429 - static void sunhv_console_write(struct console *con, const char *s, unsigned n) 425 + static inline void sunhv_console_putchar(struct uart_port *port, char c) 426 + { 427 + int limit = 1000000; 428 + 429 + while (limit-- > 0) { 430 + long status = sun4v_con_putchar(c); 431 + if (status == HV_EOK) 432 + break; 433 + udelay(1); 434 + } 435 + } 436 + 437 + static void sunhv_console_write_bychar(struct console *con, const char *s, unsigned n) 430 438 { 431 439 struct uart_port *port = sunhv_port; 440 + unsigned long flags; 432 441 int i; 433 442 443 + spin_lock_irqsave(&port->lock, flags); 434 444 for (i = 0; i < n; i++) { 435 445 if (*s == '\n') 436 446 sunhv_console_putchar(port, '\r'); 437 447 sunhv_console_putchar(port, *s++); 438 448 } 449 + spin_unlock_irqrestore(&port->lock, flags); 439 450 } 440 451 441 452 static struct console sunhv_console = { 442 453 .name = "ttyHV", 443 - .write = sunhv_console_write, 454 + .write = sunhv_console_write_bychar, 444 455 .device = uart_console_device, 445 456 .flags = CON_PRINTBUFFER, 446 457 .index = -1, ··· 521 410 static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) 522 411 { 523 412 struct uart_port *port; 413 + unsigned long minor; 524 414 int err; 525 415 526 416 if (op->irqs[0] == 0xffffffff) ··· 530 418 port = kzalloc(sizeof(struct uart_port), GFP_KERNEL); 531 419 if (unlikely(!port)) 532 420 return -ENOMEM; 421 + 422 + minor = 1; 423 + if (sun4v_hvapi_register(HV_GRP_CORE, 1, &minor) == 0 && 424 + minor >= 1) { 425 + err = -ENOMEM; 426 + con_write_page = kzalloc(PAGE_SIZE, GFP_KERNEL); 427 + if (!con_write_page) 428 + goto out_free_port; 429 + 430 + con_read_page = kzalloc(PAGE_SIZE, GFP_KERNEL); 431 + if (!con_read_page) 432 + goto out_free_con_write_page; 433 + 434 + sunhv_console.write = sunhv_console_write_paged; 435 + sunhv_ops = &bywrite_ops; 436 + } 533 437 534 438 sunhv_port = port; 535 439 ··· 565 437 566 438 err = uart_register_driver(&sunhv_reg); 567 439 if (err) 568 - goto out_free_port; 440 + goto out_free_con_read_page; 569 441 570 442 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; 571 443 sunserial_current_minor += 1; ··· 590 462 out_unregister_driver: 591 463 sunserial_current_minor -= 1; 592 464 uart_unregister_driver(&sunhv_reg); 465 + 466 + out_free_con_read_page: 467 + kfree(con_read_page); 468 + 469 + out_free_con_write_page: 470 + kfree(con_write_page); 593 471 594 472 out_free_port: 595 473 kfree(port);
+1 -1
drivers/spi/spidev.c
··· 484 484 * Reusing minors is fine so long as udev or mdev is working. 485 485 */ 486 486 mutex_lock(&device_list_lock); 487 - minor = find_first_zero_bit(minors, ARRAY_SIZE(minors)); 487 + minor = find_first_zero_bit(minors, N_SPI_MINORS); 488 488 if (minor < N_SPI_MINORS) { 489 489 spidev->dev.parent = &spi->dev; 490 490 spidev->dev.class = &spidev_class;
-1
fs/afs/super.c
··· 47 47 static const struct super_operations afs_super_ops = { 48 48 .statfs = afs_statfs, 49 49 .alloc_inode = afs_alloc_inode, 50 - .drop_inode = generic_delete_inode, 51 50 .write_inode = afs_write_inode, 52 51 .destroy_inode = afs_destroy_inode, 53 52 .clear_inode = afs_clear_inode,
+1 -2
fs/afs/write.c
··· 206 206 _leave(" = %d [prep]", ret); 207 207 return ret; 208 208 } 209 - SetPageUptodate(page); 210 209 } 211 210 212 211 try_again: ··· 310 311 spin_unlock(&vnode->writeback_lock); 311 312 } 312 313 314 + SetPageUptodate(page); 313 315 set_page_dirty(page); 314 - 315 316 if (PageDirty(page)) 316 317 _debug("dirtied"); 317 318
+3 -5
include/asm-avr32/arch-at32ap/board.h
··· 30 30 struct platform_device * 31 31 at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); 32 32 33 - struct lcdc_platform_data { 34 - unsigned long fbmem_start; 35 - unsigned long fbmem_size; 36 - }; 33 + struct atmel_lcdfb_info; 37 34 struct platform_device * 38 - at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data); 35 + at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 36 + unsigned long fbmem_start, unsigned long fbmem_len); 39 37 40 38 #endif /* __ASM_ARCH_BOARD_H */
+13 -4
include/asm-avr32/kdebug.h
··· 5 5 6 6 /* Grossly misnamed. */ 7 7 enum die_val { 8 - DIE_FAULT, 9 8 DIE_BREAKPOINT, 10 9 DIE_SSTEP, 11 - DIE_PAGE_FAULT, 12 10 }; 13 11 14 - int register_page_fault_notifier(struct notifier_block *nb); 15 - int unregister_page_fault_notifier(struct notifier_block *nb); 12 + /* 13 + * These are only here because kprobes.c wants them to implement a 14 + * blatant layering violation. Will hopefully go away soon once all 15 + * architectures are updated. 16 + */ 17 + static inline int register_page_fault_notifier(struct notifier_block *nb) 18 + { 19 + return 0; 20 + } 21 + static inline int unregister_page_fault_notifier(struct notifier_block *nb) 22 + { 23 + return 0; 24 + } 16 25 17 26 #endif /* __ASM_AVR32_KDEBUG_H */
+1
include/asm-avr32/kprobes.h
··· 26 26 kprobe_opcode_t insn[MAX_INSN_SIZE]; 27 27 }; 28 28 29 + extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 29 30 extern int kprobe_exceptions_notify(struct notifier_block *self, 30 31 unsigned long val, void *data); 31 32
+4 -1
include/asm-avr32/unistd.h
··· 296 296 #define __NR_shmctl 277 297 297 298 298 #define __NR_utimensat 278 299 + #define __NR_signalfd 279 300 + #define __NR_timerfd 280 301 + #define __NR_eventfd 281 299 302 300 303 #ifdef __KERNEL__ 301 - #define NR_syscalls 279 304 + #define NR_syscalls 282 302 305 303 306 304 307 #define __ARCH_WANT_IPC_PARSE_VERSION
+13 -3
include/asm-ia64/kdebug.h
··· 28 28 */ 29 29 #include <linux/notifier.h> 30 30 31 - extern int register_page_fault_notifier(struct notifier_block *); 32 - extern int unregister_page_fault_notifier(struct notifier_block *); 31 + /* 32 + * These are only here because kprobes.c wants them to implement a 33 + * blatant layering violation. Will hopefully go away soon once all 34 + * architectures are updated. 35 + */ 36 + static inline int register_page_fault_notifier(struct notifier_block *nb) 37 + { 38 + return 0; 39 + } 40 + static inline int unregister_page_fault_notifier(struct notifier_block *nb) 41 + { 42 + return 0; 43 + } 33 44 34 45 enum die_val { 35 46 DIE_BREAK = 1, 36 47 DIE_FAULT, 37 48 DIE_OOPS, 38 - DIE_PAGE_FAULT, 39 49 DIE_MACHINE_HALT, 40 50 DIE_MACHINE_RESTART, 41 51 DIE_MCA_MONARCH_ENTER,
+1
include/asm-ia64/kprobes.h
··· 120 120 unsigned short slot; 121 121 }; 122 122 123 + extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr); 123 124 extern int kprobe_exceptions_notify(struct notifier_block *self, 124 125 unsigned long val, void *data); 125 126
+4 -1
include/asm-ia64/unistd.h
··· 296 296 #define __NR_getcpu 1304 297 297 #define __NR_epoll_pwait 1305 298 298 #define __NR_utimensat 1306 299 + #define __NR_signalfd 1307 300 + #define __NR_timerfd 1308 301 + #define __NR_eventfd 1309 299 302 300 303 #ifdef __KERNEL__ 301 304 302 305 303 - #define NR_syscalls 283 /* length of syscall table */ 306 + #define NR_syscalls 286 /* length of syscall table */ 304 307 305 308 #define __ARCH_WANT_SYS_RT_SIGACTION 306 309 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+82 -1
include/asm-sparc64/hypervisor.h
··· 940 940 */ 941 941 #define HV_FAST_CONS_PUTCHAR 0x61 942 942 943 + /* con_read() 944 + * TRAP: HV_FAST_TRAP 945 + * FUNCTION: HV_FAST_CONS_READ 946 + * ARG0: buffer real address 947 + * ARG1: buffer size in bytes 948 + * RET0: status 949 + * RET1: bytes read or BREAK or HUP 950 + * ERRORS: EWOULDBLOCK No character available. 951 + * 952 + * Reads characters into a buffer from the console device. If no 953 + * character is available then an EWOULDBLOCK error is returned. 954 + * If a character is available, then the returned status is EOK 955 + * and the number of bytes read into the given buffer is provided 956 + * in RET1. 957 + * 958 + * A virtual BREAK is represented by the 64-bit RET1 value -1. 959 + * 960 + * A virtual HUP signal is represented by the 64-bit RET1 value -2. 961 + * 962 + * If BREAK or HUP are indicated, no bytes were read into buffer. 963 + */ 964 + #define HV_FAST_CONS_READ 0x62 965 + 966 + /* con_write() 967 + * TRAP: HV_FAST_TRAP 968 + * FUNCTION: HV_FAST_CONS_WRITE 969 + * ARG0: buffer real address 970 + * ARG1: buffer size in bytes 971 + * RET0: status 972 + * RET1: bytes written 973 + * ERRORS: EWOULDBLOCK Output buffer currently full, would block 974 + * 975 + * Send a characters in buffer to the console device. Breaks must be 976 + * sent using con_putchar(). 977 + */ 978 + #define HV_FAST_CONS_WRITE 0x63 979 + 980 + #ifndef __ASSEMBLY__ 981 + extern long sun4v_con_getchar(long *status); 982 + extern long sun4v_con_putchar(long c); 983 + extern long sun4v_con_read(unsigned long buffer, 984 + unsigned long size, 985 + unsigned long *bytes_read); 986 + extern unsigned long sun4v_con_write(unsigned long buffer, 987 + unsigned long size, 988 + unsigned long *bytes_written); 989 + #endif 990 + 943 991 /* Trap trace services. 944 992 * 945 993 * The hypervisor provides a trap tracing capability for privileged ··· 2169 2121 #define HV_FAST_MMUSTAT_INFO 0x103 2170 2122 2171 2123 /* Function numbers for HV_CORE_TRAP. */ 2172 - #define HV_CORE_VER 0x00 2124 + #define HV_CORE_SET_VER 0x00 2173 2125 #define HV_CORE_PUTCHAR 0x01 2174 2126 #define HV_CORE_EXIT 0x02 2127 + #define HV_CORE_GET_VER 0x03 2128 + 2129 + /* Hypervisor API groups for use with HV_CORE_SET_VER and 2130 + * HV_CORE_GET_VER. 2131 + */ 2132 + #define HV_GRP_SUN4V 0x0000 2133 + #define HV_GRP_CORE 0x0001 2134 + #define HV_GRP_INTR 0x0002 2135 + #define HV_GRP_SOFT_STATE 0x0003 2136 + #define HV_GRP_PCI 0x0100 2137 + #define HV_GRP_LDOM 0x0101 2138 + #define HV_GRP_SVC_CHAN 0x0102 2139 + #define HV_GRP_NCS 0x0103 2140 + #define HV_GRP_NIAG_PERF 0x0200 2141 + #define HV_GRP_FIRE_PERF 0x0201 2142 + #define HV_GRP_DIAG 0x0300 2143 + 2144 + #ifndef __ASSEMBLY__ 2145 + extern unsigned long sun4v_get_version(unsigned long group, 2146 + unsigned long *major, 2147 + unsigned long *minor); 2148 + extern unsigned long sun4v_set_version(unsigned long group, 2149 + unsigned long major, 2150 + unsigned long minor, 2151 + unsigned long *actual_minor); 2152 + 2153 + extern int sun4v_hvapi_register(unsigned long group, unsigned long major, 2154 + unsigned long *minor); 2155 + extern void sun4v_hvapi_unregister(unsigned long group); 2156 + extern int sun4v_hvapi_get(unsigned long group, 2157 + unsigned long *major, 2158 + unsigned long *minor); 2159 + #endif 2175 2160 2176 2161 #endif /* !(_SPARC64_HYPERVISOR_H) */
+2 -1
include/linux/libata.h
··· 140 140 141 141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 142 142 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ 143 + ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */ 143 144 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 144 145 145 146 ATA_DFLAG_DETACH = (1 << 16), ··· 174 173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ 175 174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 176 175 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 176 + ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 177 177 178 178 /* The following flag belongs to ap->pflags but is kept in 179 179 * ap->flags because it's referenced in many LLDs and will be ··· 433 431 struct scsi_device *sdev; /* attached SCSI device */ 434 432 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 435 433 u64 n_sectors; /* size of device, if ATA */ 436 - u64 n_sectors_boot; /* size of ATA device at startup */ 437 434 unsigned int class; /* ATA_DEV_xxx */ 438 435 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ 439 436 u8 pio_mode;
+1 -1
include/linux/slub_def.h
··· 88 88 */ 89 89 WARN_ON_ONCE(size == 0); 90 90 91 - if (size >= (1 << KMALLOC_SHIFT_HIGH)) 91 + if (size > (1 << KMALLOC_SHIFT_HIGH)) 92 92 return -1; 93 93 94 94 if (size > 64 && size <= 96)
+3 -1
include/sound/soc.h
··· 22 22 #include <sound/control.h> 23 23 #include <sound/ac97_codec.h> 24 24 25 - #define SND_SOC_VERSION "0.13.0" 25 + #define SND_SOC_VERSION "0.13.1" 26 26 27 27 /* 28 28 * Convenience kcontrol builders ··· 83 83 #define SND_SOC_DAI_AC97 0x1 84 84 #define SND_SOC_DAI_I2S 0x2 85 85 #define SND_SOC_DAI_PCM 0x4 86 + #define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */ 86 87 87 88 /* 88 89 * DAI hardware audio formats ··· 279 278 struct snd_soc_codec_dai { 280 279 char *name; 281 280 int id; 281 + unsigned char type; 282 282 283 283 /* DAI capabilities */ 284 284 struct snd_soc_pcm_stream playback;
+1 -1
include/sound/version.h
··· 1 1 /* include/version.h. Generated by alsa/ksync script. */ 2 2 #define CONFIG_SND_VERSION "1.0.14rc4" 3 - #define CONFIG_SND_DATE " (Wed May 09 09:51:39 2007 UTC)" 3 + #define CONFIG_SND_DATE " (Wed May 16 09:45:46 2007 UTC)"
+8 -7
kernel/power/main.c
··· 97 97 } 98 98 } 99 99 100 - if (pm_ops->prepare) { 101 - if ((error = pm_ops->prepare(state))) 102 - goto Thaw; 103 - } 104 - 105 100 suspend_console(); 106 101 error = device_suspend(PMSG_SUSPEND); 107 102 if (error) { 108 103 printk(KERN_ERR "Some devices failed to suspend\n"); 109 - goto Resume_devices; 104 + goto Resume_console; 110 105 } 106 + if (pm_ops->prepare) { 107 + if ((error = pm_ops->prepare(state))) 108 + goto Resume_devices; 109 + } 110 + 111 111 error = disable_nonboot_cpus(); 112 112 if (!error) 113 113 return 0; 114 114 115 115 enable_nonboot_cpus(); 116 - Resume_devices: 117 116 pm_finish(state); 117 + Resume_devices: 118 118 device_resume(); 119 + Resume_console: 119 120 resume_console(); 120 121 Thaw: 121 122 thaw_processes();
+2 -1
mm/filemap.c
··· 670 670 page = find_lock_page(mapping, index); 671 671 if (!page) { 672 672 if (!cached_page) { 673 - cached_page = alloc_page(gfp_mask); 673 + cached_page = 674 + __page_cache_alloc(gfp_mask); 674 675 if (!cached_page) 675 676 return NULL; 676 677 }
+1 -1
mm/slub.c
··· 2522 2522 struct kmem_cache *s; 2523 2523 2524 2524 down_write(&slub_lock); 2525 - s = find_mergeable(size, align, flags, dtor, ctor); 2525 + s = find_mergeable(size, align, flags, ctor, dtor); 2526 2526 if (s) { 2527 2527 s->refcount++; 2528 2528 /*
+11 -4
sound/isa/cmi8330.c
··· 109 109 MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); 110 110 111 111 #ifdef CONFIG_PNP 112 + static int isa_registered; 112 113 static int pnp_registered; 113 114 #endif 114 115 ··· 687 686 int err; 688 687 689 688 err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); 690 - if (err < 0) 691 - return err; 692 689 #ifdef CONFIG_PNP 690 + if (!err) 691 + isa_registered = 1; 692 + 693 693 err = pnp_register_card_driver(&cmi8330_pnpc_driver); 694 694 if (!err) 695 695 pnp_registered = 1; 696 + 697 + if (isa_registered) 698 + err = 0; 696 699 #endif 697 - return 0; 700 + return err; 698 701 } 699 702 700 703 static void __exit alsa_card_cmi8330_exit(void) ··· 706 701 #ifdef CONFIG_PNP 707 702 if (pnp_registered) 708 703 pnp_unregister_card_driver(&cmi8330_pnpc_driver); 704 + 705 + if (isa_registered) 709 706 #endif 710 - isa_unregister_driver(&snd_cmi8330_driver); 707 + isa_unregister_driver(&snd_cmi8330_driver); 711 708 } 712 709 713 710 module_init(alsa_card_cmi8330_init)
+14 -6
sound/isa/cs423x/cs4236.c
··· 127 127 MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); 128 128 129 129 #ifdef CONFIG_PNP 130 + static int isa_registered; 130 131 static int pnpc_registered; 131 132 #ifdef CS4232 132 133 static int pnp_registered; ··· 771 770 int err; 772 771 773 772 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); 774 - if (err < 0) 775 - return err; 776 773 #ifdef CONFIG_PNP 774 + if (!err) 775 + isa_registered = 1; 777 776 #ifdef CS4232 778 777 err = pnp_register_driver(&cs4232_pnp_driver); 779 778 if (!err) ··· 782 781 err = pnp_register_card_driver(&cs423x_pnpc_driver); 783 782 if (!err) 784 783 pnpc_registered = 1; 785 - #endif /* CONFIG_PNP */ 786 - return 0; 784 + #ifdef CS4232 785 + if (pnp_registered) 786 + err = 0; 787 + #endif 788 + if (isa_registered) 789 + err = 0; 790 + #endif 791 + return err; 787 792 } 788 793 789 794 static void __exit alsa_card_cs423x_exit(void) ··· 801 794 if (pnp_registered) 802 795 pnp_unregister_driver(&cs4232_pnp_driver); 803 796 #endif 804 - #endif /* CONFIG_PNP */ 805 - isa_unregister_driver(&cs423x_isa_driver); 797 + if (isa_registered) 798 + #endif 799 + isa_unregister_driver(&cs423x_isa_driver); 806 800 } 807 801 808 802 module_init(alsa_card_cs423x_init)
+13 -6
sound/isa/es18xx.c
··· 2036 2036 MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); 2037 2037 2038 2038 #ifdef CONFIG_PNP 2039 - static int pnp_registered, pnpc_registered; 2039 + static int isa_registered; 2040 + static int pnp_registered; 2041 + static int pnpc_registered; 2040 2042 2041 2043 static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { 2042 2044 { .id = "ESS1869" }, ··· 2468 2466 int err; 2469 2467 2470 2468 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); 2471 - if (err < 0) 2472 - return err; 2473 - 2474 2469 #ifdef CONFIG_PNP 2470 + if (!err) 2471 + isa_registered = 1; 2472 + 2475 2473 err = pnp_register_driver(&es18xx_pnp_driver); 2476 2474 if (!err) 2477 2475 pnp_registered = 1; 2476 + 2478 2477 err = pnp_register_card_driver(&es18xx_pnpc_driver); 2479 2478 if (!err) 2480 2479 pnpc_registered = 1; 2480 + 2481 + if (isa_registered || pnp_registered) 2482 + err = 0; 2481 2483 #endif 2482 - return 0; 2484 + return err; 2483 2485 } 2484 2486 2485 2487 static void __exit alsa_card_es18xx_exit(void) ··· 2493 2487 pnp_unregister_card_driver(&es18xx_pnpc_driver); 2494 2488 if (pnp_registered) 2495 2489 pnp_unregister_driver(&es18xx_pnp_driver); 2490 + if (isa_registered) 2496 2491 #endif 2497 - isa_unregister_driver(&snd_es18xx_isa_driver); 2492 + isa_unregister_driver(&snd_es18xx_isa_driver); 2498 2493 } 2499 2494 2500 2495 module_init(alsa_card_es18xx_init)
+10 -5
sound/isa/gus/interwave.c
··· 135 135 136 136 137 137 #ifdef CONFIG_PNP 138 + static int isa_registered; 138 139 static int pnp_registered; 139 140 140 141 static struct pnp_card_device_id snd_interwave_pnpids[] = { ··· 935 934 int err; 936 935 937 936 err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); 938 - if (err < 0) 939 - return err; 940 937 #ifdef CONFIG_PNP 941 - /* ISA PnP cards */ 938 + if (!err) 939 + isa_registered = 1; 940 + 942 941 err = pnp_register_card_driver(&interwave_pnpc_driver); 943 942 if (!err) 944 943 pnp_registered = 1; 944 + 945 + if (isa_registered) 946 + err = 0; 945 947 #endif 946 - return 0; 948 + return err; 947 949 } 948 950 949 951 static void __exit alsa_card_interwave_exit(void) ··· 954 950 #ifdef CONFIG_PNP 955 951 if (pnp_registered) 956 952 pnp_unregister_card_driver(&interwave_pnpc_driver); 953 + if (isa_registered) 957 954 #endif 958 - isa_unregister_driver(&snd_interwave_driver); 955 + isa_unregister_driver(&snd_interwave_driver); 959 956 } 960 957 961 958 module_init(alsa_card_interwave_init)
+11 -4
sound/isa/opl3sa2.c
··· 92 92 MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); 93 93 94 94 #ifdef CONFIG_PNP 95 + static int isa_registered; 95 96 static int pnp_registered; 96 97 static int pnpc_registered; 97 98 #endif ··· 968 967 int err; 969 968 970 969 err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); 971 - if (err < 0) 972 - return err; 973 970 #ifdef CONFIG_PNP 971 + if (!err) 972 + isa_registered = 1; 973 + 974 974 err = pnp_register_driver(&opl3sa2_pnp_driver); 975 975 if (!err) 976 976 pnp_registered = 1; 977 + 977 978 err = pnp_register_card_driver(&opl3sa2_pnpc_driver); 978 979 if (!err) 979 980 pnpc_registered = 1; 981 + 982 + if (isa_registered || pnp_registered) 983 + err = 0; 980 984 #endif 981 - return 0; 985 + return err; 982 986 } 983 987 984 988 static void __exit alsa_card_opl3sa2_exit(void) ··· 993 987 pnp_unregister_card_driver(&opl3sa2_pnpc_driver); 994 988 if (pnp_registered) 995 989 pnp_unregister_driver(&opl3sa2_pnp_driver); 990 + if (isa_registered) 996 991 #endif 997 - isa_unregister_driver(&snd_opl3sa2_isa_driver); 992 + isa_unregister_driver(&snd_opl3sa2_isa_driver); 998 993 } 999 994 1000 995 module_init(alsa_card_opl3sa2_init)
+10 -5
sound/isa/sb/sb16.c
··· 129 129 #endif 130 130 131 131 #ifdef CONFIG_PNP 132 + static int isa_registered; 132 133 static int pnp_registered; 133 134 #endif 134 135 ··· 703 702 int err; 704 703 705 704 err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); 706 - if (err < 0) 707 - return err; 708 705 #ifdef CONFIG_PNP 709 - /* PnP cards at last */ 706 + if (!err) 707 + isa_registered = 1; 708 + 710 709 err = pnp_register_card_driver(&sb16_pnpc_driver); 711 710 if (!err) 712 711 pnp_registered = 1; 712 + 713 + if (isa_registered) 714 + err = 0; 713 715 #endif 714 - return 0; 716 + return err; 715 717 } 716 718 717 719 static void __exit alsa_card_sb16_exit(void) ··· 722 718 #ifdef CONFIG_PNP 723 719 if (pnp_registered) 724 720 pnp_unregister_card_driver(&sb16_pnpc_driver); 721 + if (isa_registered) 725 722 #endif 726 - isa_unregister_driver(&snd_sb16_isa_driver); 723 + isa_unregister_driver(&snd_sb16_isa_driver); 727 724 } 728 725 729 726 module_init(alsa_card_sb16_init)
+15 -13
sound/isa/sscape.c
··· 69 69 MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); 70 70 71 71 #ifdef CONFIG_PNP 72 + static int isa_registered; 72 73 static int pnp_registered; 74 + 73 75 static struct pnp_card_device_id sscape_pnpids[] = { 74 76 { .id = "ENS3081", .devs = { { "ENS0000" } } }, 75 77 { .id = "" } /* end */ ··· 1407 1405 1408 1406 static int __init sscape_init(void) 1409 1407 { 1410 - int ret; 1408 + int err; 1411 1409 1412 - /* 1413 - * First check whether we were passed any parameters. 1414 - * These MUST take precedence over ANY automatic way 1415 - * of allocating cards, because the operator is 1416 - * S-P-E-L-L-I-N-G it out for us... 1417 - */ 1418 - ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); 1419 - if (ret < 0) 1420 - return ret; 1410 + err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); 1421 1411 #ifdef CONFIG_PNP 1422 - if (pnp_register_card_driver(&sscape_pnpc_driver) == 0) 1412 + if (!err) 1413 + isa_registered = 1; 1414 + 1415 + err = pnp_register_card_driver(&sscape_pnpc_driver); 1416 + if (!err) 1423 1417 pnp_registered = 1; 1418 + 1419 + if (isa_registered) 1420 + err = 0; 1424 1421 #endif 1425 - return 0; 1422 + return err; 1426 1423 } 1427 1424 1428 1425 static void __exit sscape_exit(void) ··· 1429 1428 #ifdef CONFIG_PNP 1430 1429 if (pnp_registered) 1431 1430 pnp_unregister_card_driver(&sscape_pnpc_driver); 1431 + if (isa_registered) 1432 1432 #endif 1433 - isa_unregister_driver(&snd_sscape_driver); 1433 + isa_unregister_driver(&snd_sscape_driver); 1434 1434 } 1435 1435 1436 1436 module_init(sscape_init);
+10 -4
sound/isa/wavefront/wavefront.c
··· 86 86 MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); 87 87 88 88 #ifdef CONFIG_PNP 89 + static int isa_registered; 89 90 static int pnp_registered; 90 91 91 92 static struct pnp_card_device_id snd_wavefront_pnpids[] = { ··· 707 706 int err; 708 707 709 708 err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); 710 - if (err < 0) 711 - return err; 712 709 #ifdef CONFIG_PNP 710 + if (!err) 711 + isa_registered = 1; 712 + 713 713 err = pnp_register_card_driver(&wavefront_pnpc_driver); 714 714 if (!err) 715 715 pnp_registered = 1; 716 + 717 + if (isa_registered) 718 + err = 0; 716 719 #endif 717 - return 0; 720 + return err; 718 721 } 719 722 720 723 static void __exit alsa_card_wavefront_exit(void) ··· 726 721 #ifdef CONFIG_PNP 727 722 if (pnp_registered) 728 723 pnp_unregister_card_driver(&wavefront_pnpc_driver); 724 + if (isa_registered) 729 725 #endif 730 - isa_unregister_driver(&snd_wavefront_driver); 726 + isa_unregister_driver(&snd_wavefront_driver); 731 727 } 732 728 733 729 module_init(alsa_card_wavefront_init)
+5
sound/pci/ac97/ac97_patch.c
··· 1782 1782 0x10140534, /* Thinkpad X31 */ 1783 1783 0x10140537, /* Thinkpad T41p */ 1784 1784 0x10140554, /* Thinkpad T42p/R50p */ 1785 + 0x10140567, /* Thinkpad T43p 2668-G7U */ 1786 + 0x10140581, /* Thinkpad X41-2527 */ 1787 + 0x104380b0, /* Asus A7V8X-MX */ 1788 + 0x11790241, /* Toshiba Satellite A-15 S127 */ 1789 + 0x144dc01a, /* Samsung NP-X20C004/SEG */ 1785 1790 0 /* end */ 1786 1791 }; 1787 1792
+2 -1
sound/pci/hda/hda_codec.c
··· 707 707 direction == HDA_OUTPUT ? 708 708 AC_PAR_AMP_OUT_CAP : 709 709 AC_PAR_AMP_IN_CAP); 710 - info->status |= INFO_AMP_CAPS; 710 + if (info->amp_caps) 711 + info->status |= INFO_AMP_CAPS; 711 712 } 712 713 return info->amp_caps; 713 714 }
+515 -17
sound/pci/hda/patch_realtek.c
··· 93 93 ALC262_HP_BPC_D7000_WL, 94 94 ALC262_HP_BPC_D7000_WF, 95 95 ALC262_BENQ_ED8, 96 + ALC262_SONY_ASSAMD, 96 97 ALC262_AUTO, 97 98 ALC262_MODEL_LAST /* last tag */ 98 99 }; ··· 119 118 ALC861VD_3ST_DIG, 120 119 ALC861VD_6ST_DIG, 121 120 ALC861VD_LENOVO, 121 + ALC861VD_DALLAS, 122 122 ALC861VD_AUTO, 123 123 ALC861VD_MODEL_LAST, 124 124 }; ··· 141 139 ALC882_6ST_DIG, 142 140 ALC882_ARIMA, 143 141 ALC882_W2JC, 144 - ALC882_AUTO, 142 + ALC882_TARGA, 143 + ALC882_ASUS_A7J, 145 144 ALC885_MACPRO, 145 + ALC882_AUTO, 146 146 ALC882_MODEL_LAST, 147 147 }; 148 148 ··· 156 152 ALC883_6ST_DIG, 157 153 ALC883_TARGA_DIG, 158 154 ALC883_TARGA_2ch_DIG, 159 - ALC888_DEMO_BOARD, 160 155 ALC883_ACER, 161 156 ALC883_MEDION, 157 + ALC883_MEDION_MD2, 162 158 ALC883_LAPTOP_EAPD, 163 159 ALC883_LENOVO_101E_2ch, 160 + ALC883_LENOVO_NB0763, 161 + ALC888_LENOVO_MS7195_DIG, 164 162 ALC883_AUTO, 165 163 ALC883_MODEL_LAST, 166 164 }; ··· 4759 4753 } 4760 4754 4761 4755 /* 4756 + * 2ch mode 4757 + */ 4758 + static struct hda_verb alc882_3ST_ch2_init[] = { 4759 + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, 4760 + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 4761 + { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 4762 + { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, 4763 + { } /* end */ 4764 + }; 4765 + 4766 + /* 4767 + * 6ch mode 4768 + */ 4769 + static struct hda_verb alc882_3ST_ch6_init[] = { 4770 + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 4771 + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 4772 + { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 }, 4773 + { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 4774 + { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, 4775 + { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 }, 4776 + { } /* end */ 4777 + }; 4778 + 4779 + static struct hda_channel_mode alc882_3ST_6ch_modes[2] = { 4780 + { 2, alc882_3ST_ch2_init }, 4781 + { 6, alc882_3ST_ch6_init }, 4782 + }; 4783 + 4784 + /* 4762 4785 * 6ch mode 4763 4786 */ 4764 4787 static struct hda_verb alc882_sixstack_ch6_init[] = { ··· 4856 4821 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4857 4822 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 4858 4823 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 4824 + { } /* end */ 4825 + }; 4826 + 4827 + static struct snd_kcontrol_new alc882_targa_mixer[] = { 4828 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 4829 + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 4830 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), 4831 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 4832 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 4833 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 4834 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 4835 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 4836 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4837 + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 4838 + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 4839 + { } /* end */ 4840 + }; 4841 + 4842 + /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ??? 4843 + * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c 4844 + */ 4845 + static struct snd_kcontrol_new alc882_asus_a7j_mixer[] = { 4846 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 4847 + HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), 4848 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), 4849 + HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT), 4850 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 4851 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 4852 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 4853 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 4854 + HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT), 4855 + HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT), 4856 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 4857 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 4859 4858 { } /* end */ 4860 4859 }; 4861 4860 ··· 5052 4983 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 5053 4984 5054 4985 { } 4986 + }; 4987 + 4988 + static struct hda_verb alc882_targa_verbs[] = { 4989 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4990 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4991 + 4992 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 4993 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 4994 + 4995 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ 4996 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ 4997 + {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 4998 + 4999 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5000 + {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, 5001 + {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, 5002 + {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, 5003 + { } /* end */ 5004 + }; 5005 + 5006 + /* toggle speaker-output according to the hp-jack state */ 5007 + static void alc882_targa_automute(struct hda_codec *codec) 5008 + { 5009 + unsigned int present; 5010 + 5011 + present = snd_hda_codec_read(codec, 0x14, 0, 5012 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5013 + snd_hda_codec_amp_update(codec, 0x1b, 0, HDA_OUTPUT, 0, 5014 + 0x80, present ? 0x80 : 0); 5015 + snd_hda_codec_amp_update(codec, 0x1b, 1, HDA_OUTPUT, 0, 5016 + 0x80, present ? 0x80 : 0); 5017 + snd_hda_codec_write(codec, 1, 0, AC_VERB_SET_GPIO_DATA, present ? 1 : 3); 5018 + } 5019 + 5020 + static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res) 5021 + { 5022 + /* Looks like the unsol event is incompatible with the standard 5023 + * definition. 4bit tag is placed at 26 bit! 5024 + */ 5025 + if (((res >> 26) == ALC880_HP_EVENT)) { 5026 + alc882_targa_automute(codec); 5027 + } 5028 + } 5029 + 5030 + static struct hda_verb alc882_asus_a7j_verbs[] = { 5031 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5032 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5033 + 5034 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5035 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 5036 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 5037 + 5038 + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ 5039 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 5040 + {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ 5041 + 5042 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ 5043 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ 5044 + {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 5045 + { } /* end */ 5055 5046 }; 5056 5047 5057 5048 static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) ··· 5281 5152 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), 5282 5153 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), 5283 5154 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), 5155 + SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ 5284 5156 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), 5157 + SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J), 5285 5158 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), 5286 5159 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), 5287 5160 {} ··· 5345 5214 .channel_mode = alc882_ch_modes, 5346 5215 .input_mux = &alc882_capture_source, 5347 5216 }, 5217 + [ALC882_TARGA] = { 5218 + .mixers = { alc882_targa_mixer, alc882_chmode_mixer, 5219 + alc882_capture_mixer }, 5220 + .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, 5221 + .num_dacs = ARRAY_SIZE(alc882_dac_nids), 5222 + .dac_nids = alc882_dac_nids, 5223 + .dig_out_nid = ALC882_DIGOUT_NID, 5224 + .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), 5225 + .adc_nids = alc882_adc_nids, 5226 + .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), 5227 + .channel_mode = alc882_3ST_6ch_modes, 5228 + .need_dac_fix = 1, 5229 + .input_mux = &alc882_capture_source, 5230 + .unsol_event = alc882_targa_unsol_event, 5231 + .init_hook = alc882_targa_automute, 5232 + }, 5233 + [ALC882_ASUS_A7J] = { 5234 + .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer, 5235 + alc882_capture_mixer }, 5236 + .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs}, 5237 + .num_dacs = ARRAY_SIZE(alc882_dac_nids), 5238 + .dac_nids = alc882_dac_nids, 5239 + .dig_out_nid = ALC882_DIGOUT_NID, 5240 + .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), 5241 + .adc_nids = alc882_adc_nids, 5242 + .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), 5243 + .channel_mode = alc882_3ST_6ch_modes, 5244 + .need_dac_fix = 1, 5245 + .input_mux = &alc882_capture_source, 5246 + }, 5348 5247 }; 5349 5248 5350 5249 ··· 5599 5438 .items = { 5600 5439 { "Mic", 0x1 }, 5601 5440 { "Line", 0x2 }, 5441 + }, 5442 + }; 5443 + 5444 + static struct hda_input_mux alc883_lenovo_nb0763_capture_source = { 5445 + .num_items = 4, 5446 + .items = { 5447 + { "Mic", 0x0 }, 5448 + { "iMic", 0x1 }, 5449 + { "Line", 0x2 }, 5450 + { "CD", 0x4 }, 5602 5451 }, 5603 5452 }; 5604 5453 ··· 5943 5772 { } /* end */ 5944 5773 }; 5945 5774 5775 + static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = { 5776 + HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 5777 + HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT), 5778 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), 5779 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5780 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 5781 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5782 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5783 + HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT), 5784 + HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT), 5785 + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 5786 + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 5787 + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 5788 + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 5789 + { 5790 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 5791 + /* .name = "Capture Source", */ 5792 + .name = "Input Source", 5793 + .count = 2, 5794 + .info = alc883_mux_enum_info, 5795 + .get = alc883_mux_enum_get, 5796 + .put = alc883_mux_enum_put, 5797 + }, 5798 + { } /* end */ 5799 + }; 5800 + 5801 + static struct snd_kcontrol_new alc883_medion_md2_mixer[] = { 5802 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 5803 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), 5804 + HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), 5805 + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 5806 + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 5807 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 5808 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 5809 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 5810 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 5811 + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 5812 + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 5813 + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 5814 + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), 5815 + { 5816 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 5817 + /* .name = "Capture Source", */ 5818 + .name = "Input Source", 5819 + .count = 2, 5820 + .info = alc883_mux_enum_info, 5821 + .get = alc883_mux_enum_get, 5822 + .put = alc883_mux_enum_put, 5823 + }, 5824 + { } /* end */ 5825 + }; 5826 + 5946 5827 static struct snd_kcontrol_new alc883_chmode_mixer[] = { 5947 5828 { 5948 5829 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 6108 5885 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT|AC_USRSP_EN}, 6109 5886 { } /* end */ 6110 5887 }; 5888 + 5889 + static struct hda_verb alc883_lenovo_nb0763_verbs[] = { 5890 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 5891 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5892 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5893 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5894 + { } /* end */ 5895 + }; 5896 + 5897 + static struct hda_verb alc888_lenovo_ms7195_verbs[] = { 5898 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5899 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5900 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 5901 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT | AC_USRSP_EN}, 5902 + {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5903 + { } /* end */ 5904 + }; 5905 + 5906 + /* toggle front-jack and RCA according to the hp-jack state */ 5907 + static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec) 5908 + { 5909 + unsigned int present; 5910 + 5911 + present = snd_hda_codec_read(codec, 0x1b, 0, 5912 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5913 + snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 5914 + 0x80, present ? 0x80 : 0); 5915 + snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, 5916 + 0x80, present ? 0x80 : 0); 5917 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5918 + 0x80, present ? 0x80 : 0); 5919 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5920 + 0x80, present ? 0x80 : 0); 5921 + 5922 + } 5923 + 5924 + /* toggle RCA according to the front-jack state */ 5925 + static void alc888_lenovo_ms7195_rca_automute(struct hda_codec *codec) 5926 + { 5927 + unsigned int present; 5928 + 5929 + present = snd_hda_codec_read(codec, 0x14, 0, 5930 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5931 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5932 + 0x80, present ? 0x80 : 0); 5933 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5934 + 0x80, present ? 0x80 : 0); 5935 + 5936 + } 5937 + static void alc883_lenovo_ms7195_unsol_event(struct hda_codec *codec, 5938 + unsigned int res) 5939 + { 5940 + if ((res >> 26) == ALC880_HP_EVENT) 5941 + alc888_lenovo_ms7195_front_automute(codec); 5942 + if ((res >> 26) == ALC880_FRONT_EVENT) 5943 + alc888_lenovo_ms7195_rca_automute(codec); 5944 + } 5945 + 5946 + static struct hda_verb alc883_medion_md2_verbs[] = { 5947 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 5948 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 5949 + 5950 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 5951 + 5952 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 5953 + { } /* end */ 5954 + }; 5955 + 5956 + /* toggle speaker-output according to the hp-jack state */ 5957 + static void alc883_medion_md2_automute(struct hda_codec *codec) 5958 + { 5959 + unsigned int present; 5960 + 5961 + present = snd_hda_codec_read(codec, 0x14, 0, 5962 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 5963 + snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, 5964 + 0x80, present ? 0x80 : 0); 5965 + snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, 5966 + 0x80, present ? 0x80 : 0); 5967 + } 5968 + 5969 + static void alc883_medion_md2_unsol_event(struct hda_codec *codec, 5970 + unsigned int res) 5971 + { 5972 + if ((res >> 26) == ALC880_HP_EVENT) 5973 + alc883_medion_md2_automute(codec); 5974 + } 6111 5975 6112 5976 /* toggle speaker-output according to the hp-jack state */ 6113 5977 static void alc883_tagra_automute(struct hda_codec *codec) ··· 6361 6051 [ALC883_6ST_DIG] = "6stack-dig", 6362 6052 [ALC883_TARGA_DIG] = "targa-dig", 6363 6053 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", 6364 - [ALC888_DEMO_BOARD] = "6stack-dig-demo", 6365 6054 [ALC883_ACER] = "acer", 6366 6055 [ALC883_MEDION] = "medion", 6056 + [ALC883_MEDION_MD2] = "medion-md2", 6367 6057 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 6368 6058 [ALC883_LENOVO_101E_2ch] = "lenovo-101e", 6059 + [ALC883_LENOVO_NB0763] = "lenovo-nb0763", 6060 + [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig", 6369 6061 [ALC883_AUTO] = "auto", 6370 6062 }; 6371 6063 ··· 6394 6082 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 6395 6083 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 6396 6084 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 6397 - SND_PCI_QUIRK(0x17aa, 0x101e, "lenovo 101e", ALC883_LENOVO_101E_2ch), 6085 + SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), 6086 + SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6087 + SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6088 + SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), 6398 6089 {} 6399 6090 }; 6400 6091 ··· 6483 6168 .unsol_event = alc883_tagra_unsol_event, 6484 6169 .init_hook = alc883_tagra_automute, 6485 6170 }, 6486 - [ALC888_DEMO_BOARD] = { 6487 - .mixers = { alc883_base_mixer, alc883_chmode_mixer }, 6488 - .init_verbs = { alc883_init_verbs }, 6489 - .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6490 - .dac_nids = alc883_dac_nids, 6491 - .dig_out_nid = ALC883_DIGOUT_NID, 6492 - .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6493 - .adc_nids = alc883_adc_nids, 6494 - .dig_in_nid = ALC883_DIGIN_NID, 6495 - .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 6496 - .channel_mode = alc883_sixstack_modes, 6497 - .input_mux = &alc883_capture_source, 6498 - }, 6499 6171 [ALC883_ACER] = { 6500 6172 .mixers = { alc883_base_mixer, 6501 6173 alc883_chmode_mixer }, ··· 6513 6211 .channel_mode = alc883_sixstack_modes, 6514 6212 .input_mux = &alc883_capture_source, 6515 6213 }, 6214 + [ALC883_MEDION_MD2] = { 6215 + .mixers = { alc883_medion_md2_mixer}, 6216 + .init_verbs = { alc883_init_verbs, alc883_medion_md2_verbs}, 6217 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6218 + .dac_nids = alc883_dac_nids, 6219 + .dig_out_nid = ALC883_DIGOUT_NID, 6220 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6221 + .adc_nids = alc883_adc_nids, 6222 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 6223 + .channel_mode = alc883_3ST_2ch_modes, 6224 + .input_mux = &alc883_capture_source, 6225 + .unsol_event = alc883_medion_md2_unsol_event, 6226 + .init_hook = alc883_medion_md2_automute, 6227 + }, 6516 6228 [ALC883_LAPTOP_EAPD] = { 6517 6229 .mixers = { alc883_base_mixer, 6518 6230 alc883_chmode_mixer }, ··· 6552 6236 .unsol_event = alc883_lenovo_101e_unsol_event, 6553 6237 .init_hook = alc883_lenovo_101e_all_automute, 6554 6238 }, 6239 + [ALC883_LENOVO_NB0763] = { 6240 + .mixers = { alc883_lenovo_nb0763_mixer }, 6241 + .init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs}, 6242 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6243 + .dac_nids = alc883_dac_nids, 6244 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6245 + .adc_nids = alc883_adc_nids, 6246 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 6247 + .channel_mode = alc883_3ST_2ch_modes, 6248 + .need_dac_fix = 1, 6249 + .input_mux = &alc883_lenovo_nb0763_capture_source, 6250 + .unsol_event = alc883_medion_md2_unsol_event, 6251 + .init_hook = alc883_medion_md2_automute, 6252 + }, 6253 + [ALC888_LENOVO_MS7195_DIG] = { 6254 + .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer }, 6255 + .init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs}, 6256 + .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6257 + .dac_nids = alc883_dac_nids, 6258 + .dig_out_nid = ALC883_DIGOUT_NID, 6259 + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 6260 + .adc_nids = alc883_adc_nids, 6261 + .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), 6262 + .channel_mode = alc883_3ST_6ch_modes, 6263 + .need_dac_fix = 1, 6264 + .input_mux = &alc883_capture_source, 6265 + .unsol_event = alc883_lenovo_ms7195_unsol_event, 6266 + .init_hook = alc888_lenovo_ms7195_front_automute, 6267 + }, 6555 6268 }; 6556 6269 6557 6270 ··· 6844 6499 { } /* end */ 6845 6500 }; 6846 6501 6502 + static struct snd_kcontrol_new alc262_sony_mixer[] = { 6503 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 6504 + HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), 6505 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 6506 + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 6507 + HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), 6508 + HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 6509 + { } /* end */ 6510 + }; 6511 + 6512 + 6513 + 6847 6514 #define alc262_capture_mixer alc882_capture_mixer 6848 6515 #define alc262_capture_alt_mixer alc882_capture_alt_mixer 6849 6516 ··· 6952 6595 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 6953 6596 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 6954 6597 {} 6598 + }; 6599 + 6600 + static struct hda_verb alc262_sony_unsol_verbs[] = { 6601 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, 6602 + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 6603 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic 6604 + 6605 + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 6606 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 6955 6607 }; 6956 6608 6957 6609 /* mute/unmute internal speaker according to the hp jack and mute state */ ··· 7581 7215 [ALC262_HP_BPC] = "hp-bpc", 7582 7216 [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", 7583 7217 [ALC262_BENQ_ED8] = "benq", 7218 + [ALC262_BENQ_ED8] = "sony-assamd", 7584 7219 [ALC262_AUTO] = "auto", 7585 7220 }; 7586 7221 ··· 7603 7236 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 7604 7237 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), 7605 7238 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 7239 + SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), 7240 + SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), 7241 + SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), 7606 7242 {} 7607 7243 }; 7608 7244 ··· 7697 7327 .channel_mode = alc262_modes, 7698 7328 .input_mux = &alc262_capture_source, 7699 7329 }, 7330 + [ALC262_SONY_ASSAMD] = { 7331 + .mixers = { alc262_sony_mixer }, 7332 + .init_verbs = { alc262_init_verbs, alc262_sony_unsol_verbs}, 7333 + .num_dacs = ARRAY_SIZE(alc262_dac_nids), 7334 + .dac_nids = alc262_dac_nids, 7335 + .hp_nid = 0x02, 7336 + .num_channel_mode = ARRAY_SIZE(alc262_modes), 7337 + .channel_mode = alc262_modes, 7338 + .input_mux = &alc262_capture_source, 7339 + .unsol_event = alc262_hippo_unsol_event, 7340 + }, 7700 7341 }; 7701 7342 7702 7343 static int patch_alc262(struct hda_codec *codec) ··· 8980 8599 }, 8981 8600 }; 8982 8601 8602 + static struct hda_input_mux alc861vd_dallas_capture_source = { 8603 + .num_items = 3, 8604 + .items = { 8605 + { "Front Mic", 0x0 }, 8606 + { "ATAPI Mic", 0x1 }, 8607 + { "Line In", 0x5 }, 8608 + }, 8609 + }; 8610 + 8983 8611 #define alc861vd_mux_enum_info alc_mux_enum_info 8984 8612 #define alc861vd_mux_enum_get alc_mux_enum_get 8985 8613 ··· 9169 8779 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 9170 8780 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 9171 8781 8782 + { } /* end */ 8783 + }; 8784 + 8785 + /* Pin assignment: Front=0x14, HP = 0x15, 8786 + * Front Mic=0x18, ATAPI Mic = 0x19, Line In = 0x1d 8787 + */ 8788 + static struct snd_kcontrol_new alc861vd_dallas_mixer[] = { 8789 + HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT), 8790 + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 8791 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), 8792 + HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT), 8793 + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 8794 + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), 8795 + HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), 8796 + HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 8797 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x05, HDA_INPUT), 8798 + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x05, HDA_INPUT), 8799 + HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 8800 + HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 8801 + { 8802 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 8803 + /* .name = "Capture Source", */ 8804 + .name = "Input Source", 8805 + .count = 1, 8806 + .info = alc882_mux_enum_info, 8807 + .get = alc882_mux_enum_get, 8808 + .put = alc882_mux_enum_put, 8809 + }, 9172 8810 { } /* end */ 9173 8811 }; 9174 8812 ··· 9387 8969 } 9388 8970 } 9389 8971 8972 + static struct hda_verb alc861vd_dallas_verbs[] = { 8973 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8974 + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8975 + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8976 + {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 8977 + 8978 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8979 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 8980 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8981 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8982 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8983 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8984 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8985 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8986 + 8987 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8988 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8989 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8990 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8991 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8992 + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8993 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 8994 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 8995 + 8996 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, 8997 + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 8998 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, 8999 + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 9000 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9001 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9002 + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9003 + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 9004 + 9005 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 9006 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 9007 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 9008 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 9009 + 9010 + {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 9011 + {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 9012 + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 9013 + 9014 + { } /* end */ 9015 + }; 9016 + 9017 + /* toggle speaker-output according to the hp-jack state */ 9018 + static void alc861vd_dallas_automute(struct hda_codec *codec) 9019 + { 9020 + unsigned int present; 9021 + 9022 + present = snd_hda_codec_read(codec, 0x15, 0, 9023 + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 9024 + snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 9025 + 0x80, present ? 0x80 : 0); 9026 + snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, 9027 + 0x80, present ? 0x80 : 0); 9028 + } 9029 + 9030 + static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int res) 9031 + { 9032 + if ((res >> 26) == ALC880_HP_EVENT) 9033 + alc861vd_dallas_automute(codec); 9034 + } 9035 + 9390 9036 /* pcm configuration: identiacal with ALC880 */ 9391 9037 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback 9392 9038 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture ··· 9466 8984 [ALC861VD_3ST_DIG] = "3stack-digout", 9467 8985 [ALC861VD_6ST_DIG] = "6stack-digout", 9468 8986 [ALC861VD_LENOVO] = "lenovo", 8987 + [ALC861VD_DALLAS] = "dallas", 9469 8988 [ALC861VD_AUTO] = "auto", 9470 8989 }; 9471 8990 ··· 9476 8993 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 9477 8994 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 9478 8995 8996 + SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS), 8997 + SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), 9479 8998 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), 9480 8999 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), 9481 9000 {} ··· 9544 9059 .unsol_event = alc861vd_lenovo_unsol_event, 9545 9060 .init_hook = alc861vd_lenovo_automute, 9546 9061 }, 9062 + [ALC861VD_DALLAS] = { 9063 + .mixers = { alc861vd_dallas_mixer }, 9064 + .init_verbs = { alc861vd_dallas_verbs }, 9065 + .num_dacs = ARRAY_SIZE(alc861vd_dac_nids), 9066 + .dac_nids = alc861vd_dac_nids, 9067 + .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids), 9068 + .adc_nids = alc861vd_adc_nids, 9069 + .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes), 9070 + .channel_mode = alc861vd_3stack_2ch_modes, 9071 + .input_mux = &alc861vd_dallas_capture_source, 9072 + .unsol_event = alc861vd_dallas_unsol_event, 9073 + .init_hook = alc861vd_dallas_automute, 9074 + }, 9547 9075 }; 9548 9076 9549 9077 /*
+2
sound/pci/hda/patch_sigmatel.c
··· 467 467 "Dell XPS M1710", STAC_REF), 468 468 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf, 469 469 "Dell Precision M90", STAC_REF), 470 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6, 471 + "unknown Dell", STAC_REF), 470 472 {} /* terminator */ 471 473 }; 472 474
+19 -1
sound/pci/intel8x0.c
··· 1799 1799 }, 1800 1800 { 1801 1801 .subvendor = 0x1028, 1802 + .subdevice = 0x0186, 1803 + .name = "Dell Latitude D810", /* cf. Malone #41015 */ 1804 + .type = AC97_TUNE_HP_MUTE_LED 1805 + }, 1806 + { 1807 + .subvendor = 0x1028, 1808 + .subdevice = 0x0188, 1809 + .name = "Dell Inspiron 6000", 1810 + .type = AC97_TUNE_HP_MUTE_LED /* cf. Malone #41015 */ 1811 + }, 1812 + { 1813 + .subvendor = 0x1028, 1802 1814 .subdevice = 0x0191, 1803 1815 .name = "Dell Inspiron 8600", 1804 1816 .type = AC97_TUNE_HP_ONLY ··· 1831 1819 .subvendor = 0x103c, 1832 1820 .subdevice = 0x088c, 1833 1821 .name = "HP nc8000", 1834 - .type = AC97_TUNE_MUTE_LED 1822 + .type = AC97_TUNE_HP_MUTE_LED 1835 1823 }, 1836 1824 { 1837 1825 .subvendor = 0x103c, ··· 1921 1909 .subvendor = 0x10cf, 1922 1910 .subdevice = 0x1253, 1923 1911 .name = "Fujitsu S6210", /* STAC9750/51 */ 1912 + .type = AC97_TUNE_HP_ONLY 1913 + }, 1914 + { 1915 + .subvendor = 0x10cf, 1916 + .subdevice = 0x127e, 1917 + .name = "Fujitsu Lifebook C1211D", 1924 1918 .type = AC97_TUNE_HP_ONLY 1925 1919 }, 1926 1920 {
+2 -1
sound/soc/codecs/ac97.c
··· 43 43 #define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 44 44 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 45 45 46 - static struct snd_soc_codec_dai ac97_dai = { 46 + struct snd_soc_codec_dai ac97_dai = { 47 47 .name = "AC97 HiFi", 48 + .type = SND_SOC_DAI_AC97, 48 49 .playback = { 49 50 .stream_name = "AC97 Playback", 50 51 .channels_min = 1,
+1
sound/soc/codecs/wm9712.c
··· 544 544 struct snd_soc_codec_dai wm9712_dai[] = { 545 545 { 546 546 .name = "AC97 HiFi", 547 + .type = SND_SOC_DAI_AC97_BUS, 547 548 .playback = { 548 549 .stream_name = "HiFi Playback", 549 550 .channels_min = 1,
+15 -3
sound/soc/soc-core.c
··· 116 116 static inline const char* get_dai_name(int type) 117 117 { 118 118 switch(type) { 119 + case SND_SOC_DAI_AC97_BUS: 119 120 case SND_SOC_DAI_AC97: 120 121 return "AC97"; 121 122 case SND_SOC_DAI_I2S: ··· 1100 1099 continue; 1101 1100 } 1102 1101 } 1103 - if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) 1102 + if (socdev->machine->dai_link[i].codec_dai->type == 1103 + SND_SOC_DAI_AC97_BUS) 1104 1104 ac97 = 1; 1105 1105 } 1106 1106 snprintf(codec->card->shortname, sizeof(codec->card->shortname), ··· 1150 1148 void snd_soc_free_pcms(struct snd_soc_device *socdev) 1151 1149 { 1152 1150 struct snd_soc_codec *codec = socdev->codec; 1151 + #ifdef CONFIG_SND_SOC_AC97_BUS 1152 + struct snd_soc_codec_dai *codec_dai; 1153 + int i; 1154 + #endif 1153 1155 1154 1156 mutex_lock(&codec->mutex); 1155 1157 #ifdef CONFIG_SND_SOC_AC97_BUS 1156 - if (codec->ac97) 1157 - soc_ac97_dev_unregister(codec); 1158 + for(i = 0; i < codec->num_dai; i++) { 1159 + codec_dai = &codec->dai[i]; 1160 + if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) { 1161 + soc_ac97_dev_unregister(codec); 1162 + goto free_card; 1163 + } 1164 + } 1165 + free_card: 1158 1166 #endif 1159 1167 1160 1168 if (codec->card)
+1 -1
sound/usb/usbmixer.c
··· 360 360 request, 361 361 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 362 362 validx, cval->mixer->ctrlif | (cval->id << 8), 363 - buf, val_len, 100) >= 0) { 363 + buf, val_len, 100) >= val_len) { 364 364 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); 365 365 return 0; 366 366 }
+9
sound/usb/usbquirks.h
··· 48 48 USB_DEVICE_ID_MATCH_INT_CLASS | 49 49 USB_DEVICE_ID_MATCH_INT_SUBCLASS, 50 50 .idVendor = 0x046d, 51 + .idProduct = 0x0850, 52 + .bInterfaceClass = USB_CLASS_AUDIO, 53 + .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL 54 + }, 55 + { 56 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 57 + USB_DEVICE_ID_MATCH_INT_CLASS | 58 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 59 + .idVendor = 0x046d, 51 60 .idProduct = 0x08f0, 52 61 .bInterfaceClass = USB_CLASS_AUDIO, 53 62 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL