diff options
89 files changed, 1648 insertions, 403 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1000.h b/arch/avr32/boards/atstk1000/atstk1000.h new file mode 100644 index 000000000000..9a49ed036b72 --- /dev/null +++ b/arch/avr32/boards/atstk1000/atstk1000.h | |||
| @@ -0,0 +1,15 @@ | |||
| 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 */ | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index abe6ca203fa7..fe1dbe2e28f4 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
| 18 | 18 | ||
| 19 | #include <video/atmel_lcdc.h> | ||
| 20 | |||
| 19 | #include <asm/io.h> | 21 | #include <asm/io.h> |
| 20 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
| 21 | #include <asm/arch/at32ap7000.h> | 23 | #include <asm/arch/at32ap7000.h> |
| @@ -23,6 +25,7 @@ | |||
| 23 | #include <asm/arch/init.h> | 25 | #include <asm/arch/init.h> |
| 24 | #include <asm/arch/portmux.h> | 26 | #include <asm/arch/portmux.h> |
| 25 | 27 | ||
| 28 | #include "atstk1000.h" | ||
| 26 | 29 | ||
| 27 | #define SW2_DEFAULT /* MMCI and UART_A available */ | 30 | #define SW2_DEFAULT /* MMCI and UART_A available */ |
| 28 | 31 | ||
| @@ -31,9 +34,7 @@ struct eth_addr { | |||
| 31 | }; | 34 | }; |
| 32 | 35 | ||
| 33 | static struct eth_addr __initdata hw_addr[2]; | 36 | static struct eth_addr __initdata hw_addr[2]; |
| 34 | |||
| 35 | static struct eth_platform_data __initdata eth_data[2]; | 37 | static struct eth_platform_data __initdata eth_data[2]; |
| 36 | static struct lcdc_platform_data atstk1000_fb0_data; | ||
| 37 | 38 | ||
| 38 | static struct spi_board_info spi0_board_info[] __initdata = { | 39 | static struct spi_board_info spi0_board_info[] __initdata = { |
| 39 | { | 40 | { |
| @@ -148,9 +149,8 @@ static int __init atstk1002_init(void) | |||
| 148 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); | 149 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); |
| 149 | 150 | ||
| 150 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | 151 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
| 151 | atstk1000_fb0_data.fbmem_start = fbmem_start; | 152 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
| 152 | atstk1000_fb0_data.fbmem_size = fbmem_size; | 153 | fbmem_start, fbmem_size); |
| 153 | at32_add_device_lcdc(0, &atstk1000_fb0_data); | ||
| 154 | 154 | ||
| 155 | return 0; | 155 | return 0; |
| 156 | } | 156 | } |
diff --git a/arch/avr32/boards/atstk1000/setup.c b/arch/avr32/boards/atstk1000/setup.c index 2bc4b88d7edb..c9af409ada9a 100644 --- a/arch/avr32/boards/atstk1000/setup.c +++ b/arch/avr32/boards/atstk1000/setup.c | |||
| @@ -8,13 +8,56 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #include <linux/bootmem.h> | 10 | #include <linux/bootmem.h> |
| 11 | #include <linux/fb.h> | ||
| 11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 13 | #include <linux/linkage.h> | 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 | #include <asm/arch/board.h> | 19 | #include <asm/arch/board.h> |
| 18 | 20 | ||
| 21 | #include "atstk1000.h" | ||
| 22 | |||
| 19 | /* Initialized by bootloader-specific startup code. */ | 23 | /* Initialized by bootloader-specific startup code. */ |
| 20 | struct tag *bootloader_tags __initdata; | 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 | }; | ||
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c index fd311248c143..61f2de266f62 100644 --- a/arch/avr32/kernel/irq.c +++ b/arch/avr32/kernel/irq.c | |||
| @@ -7,15 +7,6 @@ | |||
| 7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. | 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 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
diff --git a/arch/avr32/kernel/kprobes.c b/arch/avr32/kernel/kprobes.c index 004c94b6fc1d..4942ee662e0b 100644 --- a/arch/avr32/kernel/kprobes.c +++ b/arch/avr32/kernel/kprobes.c | |||
| @@ -179,7 +179,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) | |||
| 179 | return 1; | 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 | struct kprobe *cur = kprobe_running(); | 184 | struct kprobe *cur = kprobe_running(); |
| 185 | 185 | ||
| @@ -216,11 +216,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 216 | if (post_kprobe_handler(args->regs)) | 216 | if (post_kprobe_handler(args->regs)) |
| 217 | ret = NOTIFY_STOP; | 217 | ret = NOTIFY_STOP; |
| 218 | break; | 218 | break; |
| 219 | case DIE_FAULT: | ||
| 220 | if (kprobe_running() | ||
| 221 | && kprobe_fault_handler(args->regs, args->trapnr)) | ||
| 222 | ret = NOTIFY_STOP; | ||
| 223 | break; | ||
| 224 | default: | 219 | default: |
| 225 | break; | 220 | break; |
| 226 | } | 221 | } |
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index 07f6a6fa340d..75c81f2dd0b3 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S | |||
| @@ -292,4 +292,7 @@ sys_call_table: | |||
| 292 | .long sys_shmdt | 292 | .long sys_shmdt |
| 293 | .long sys_shmctl | 293 | .long sys_shmctl |
| 294 | .long sys_utimensat | 294 | .long sys_utimensat |
| 295 | .long sys_signalfd | ||
| 296 | .long sys_timerfd /* 280 */ | ||
| 297 | .long sys_eventfd | ||
| 295 | .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ | 298 | .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ |
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c index 56db45b99a0f..1d2bf347a1d6 100644 --- a/arch/avr32/mach-at32ap/at32ap7000.c +++ b/arch/avr32/mach-at32ap/at32ap7000.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
| 7 | */ | 7 | */ |
| 8 | #include <linux/clk.h> | 8 | #include <linux/clk.h> |
| 9 | #include <linux/fb.h> | ||
| 9 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 10 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 11 | #include <linux/spi/spi.h> | 12 | #include <linux/spi/spi.h> |
| @@ -17,6 +18,8 @@ | |||
| 17 | #include <asm/arch/portmux.h> | 18 | #include <asm/arch/portmux.h> |
| 18 | #include <asm/arch/sm.h> | 19 | #include <asm/arch/sm.h> |
| 19 | 20 | ||
| 21 | #include <video/atmel_lcdc.h> | ||
| 22 | |||
| 20 | #include "clock.h" | 23 | #include "clock.h" |
| 21 | #include "hmatrix.h" | 24 | #include "hmatrix.h" |
| 22 | #include "pio.h" | 25 | #include "pio.h" |
| @@ -881,20 +884,26 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n) | |||
| 881 | /* -------------------------------------------------------------------- | 884 | /* -------------------------------------------------------------------- |
| 882 | * LCDC | 885 | * LCDC |
| 883 | * -------------------------------------------------------------------- */ | 886 | * -------------------------------------------------------------------- */ |
| 884 | static struct lcdc_platform_data lcdc0_data; | 887 | static struct atmel_lcdfb_info atmel_lcdfb0_data; |
| 885 | static struct resource lcdc0_resource[] = { | 888 | static struct resource atmel_lcdfb0_resource[] = { |
| 886 | { | 889 | { |
| 887 | .start = 0xff000000, | 890 | .start = 0xff000000, |
| 888 | .end = 0xff000fff, | 891 | .end = 0xff000fff, |
| 889 | .flags = IORESOURCE_MEM, | 892 | .flags = IORESOURCE_MEM, |
| 890 | }, | 893 | }, |
| 891 | IRQ(1), | 894 | IRQ(1), |
| 895 | { | ||
| 896 | /* Placeholder for pre-allocated fb memory */ | ||
| 897 | .start = 0x00000000, | ||
| 898 | .end = 0x00000000, | ||
| 899 | .flags = 0, | ||
| 900 | }, | ||
| 892 | }; | 901 | }; |
| 893 | DEFINE_DEV_DATA(lcdc, 0); | 902 | DEFINE_DEV_DATA(atmel_lcdfb, 0); |
| 894 | DEV_CLK(hclk, lcdc0, hsb, 7); | 903 | DEV_CLK(hck1, atmel_lcdfb0, hsb, 7); |
| 895 | static struct clk lcdc0_pixclk = { | 904 | static struct clk atmel_lcdfb0_pixclk = { |
| 896 | .name = "pixclk", | 905 | .name = "lcdc_clk", |
| 897 | .dev = &lcdc0_device.dev, | 906 | .dev = &atmel_lcdfb0_device.dev, |
| 898 | .mode = genclk_mode, | 907 | .mode = genclk_mode, |
| 899 | .get_rate = genclk_get_rate, | 908 | .get_rate = genclk_get_rate, |
| 900 | .set_rate = genclk_set_rate, | 909 | .set_rate = genclk_set_rate, |
| @@ -903,13 +912,34 @@ static struct clk lcdc0_pixclk = { | |||
| 903 | }; | 912 | }; |
| 904 | 913 | ||
| 905 | struct platform_device *__init | 914 | struct platform_device *__init |
| 906 | at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data) | 915 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, |
| 916 | unsigned long fbmem_start, unsigned long fbmem_len) | ||
| 907 | { | 917 | { |
| 908 | struct platform_device *pdev; | 918 | struct platform_device *pdev; |
| 919 | struct atmel_lcdfb_info *info; | ||
| 920 | struct fb_monspecs *monspecs; | ||
| 921 | struct fb_videomode *modedb; | ||
| 922 | unsigned int modedb_size; | ||
| 923 | |||
| 924 | /* | ||
| 925 | * Do a deep copy of the fb data, monspecs and modedb. Make | ||
| 926 | * sure all allocations are done before setting up the | ||
| 927 | * portmux. | ||
| 928 | */ | ||
| 929 | monspecs = kmemdup(data->default_monspecs, | ||
| 930 | sizeof(struct fb_monspecs), GFP_KERNEL); | ||
| 931 | if (!monspecs) | ||
| 932 | return NULL; | ||
| 933 | |||
| 934 | modedb_size = sizeof(struct fb_videomode) * monspecs->modedb_len; | ||
| 935 | modedb = kmemdup(monspecs->modedb, modedb_size, GFP_KERNEL); | ||
| 936 | if (!modedb) | ||
| 937 | goto err_dup_modedb; | ||
| 938 | monspecs->modedb = modedb; | ||
| 909 | 939 | ||
| 910 | switch (id) { | 940 | switch (id) { |
| 911 | case 0: | 941 | case 0: |
| 912 | pdev = &lcdc0_device; | 942 | pdev = &atmel_lcdfb0_device; |
| 913 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ | 943 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ |
| 914 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ | 944 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ |
| 915 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ | 945 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ |
| @@ -942,19 +972,32 @@ at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data) | |||
| 942 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | 972 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ |
| 943 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | 973 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ |
| 944 | 974 | ||
| 945 | clk_set_parent(&lcdc0_pixclk, &pll0); | 975 | clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); |
| 946 | clk_set_rate(&lcdc0_pixclk, clk_get_rate(&pll0)); | 976 | clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); |
| 947 | break; | 977 | break; |
| 948 | 978 | ||
| 949 | default: | 979 | default: |
| 950 | return NULL; | 980 | goto err_invalid_id; |
| 951 | } | 981 | } |
| 952 | 982 | ||
| 953 | memcpy(pdev->dev.platform_data, data, | 983 | if (fbmem_len) { |
| 954 | sizeof(struct lcdc_platform_data)); | 984 | pdev->resource[2].start = fbmem_start; |
| 985 | pdev->resource[2].end = fbmem_start + fbmem_len - 1; | ||
| 986 | pdev->resource[2].flags = IORESOURCE_MEM; | ||
| 987 | } | ||
| 988 | |||
| 989 | info = pdev->dev.platform_data; | ||
| 990 | memcpy(info, data, sizeof(struct atmel_lcdfb_info)); | ||
| 991 | info->default_monspecs = monspecs; | ||
| 955 | 992 | ||
| 956 | platform_device_register(pdev); | 993 | platform_device_register(pdev); |
| 957 | return pdev; | 994 | return pdev; |
| 995 | |||
| 996 | err_invalid_id: | ||
| 997 | kfree(modedb); | ||
| 998 | err_dup_modedb: | ||
| 999 | kfree(monspecs); | ||
| 1000 | return NULL; | ||
| 958 | } | 1001 | } |
| 959 | 1002 | ||
| 960 | /* -------------------------------------------------------------------- | 1003 | /* -------------------------------------------------------------------- |
| @@ -1037,8 +1080,8 @@ struct clk *at32_clock_list[] = { | |||
| 1037 | &macb1_pclk, | 1080 | &macb1_pclk, |
| 1038 | &atmel_spi0_spi_clk, | 1081 | &atmel_spi0_spi_clk, |
| 1039 | &atmel_spi1_spi_clk, | 1082 | &atmel_spi1_spi_clk, |
| 1040 | &lcdc0_hclk, | 1083 | &atmel_lcdfb0_hck1, |
| 1041 | &lcdc0_pixclk, | 1084 | &atmel_lcdfb0_pixclk, |
| 1042 | &gclk0, | 1085 | &gclk0, |
| 1043 | &gclk1, | 1086 | &gclk1, |
| 1044 | &gclk2, | 1087 | &gclk2, |
| @@ -1077,7 +1120,7 @@ void __init at32_clock_init(void) | |||
| 1077 | genclk_init_parent(&gclk2); | 1120 | genclk_init_parent(&gclk2); |
| 1078 | genclk_init_parent(&gclk3); | 1121 | genclk_init_parent(&gclk3); |
| 1079 | genclk_init_parent(&gclk4); | 1122 | genclk_init_parent(&gclk4); |
| 1080 | genclk_init_parent(&lcdc0_pixclk); | 1123 | genclk_init_parent(&atmel_lcdfb0_pixclk); |
| 1081 | 1124 | ||
| 1082 | /* | 1125 | /* |
| 1083 | * Turn on all clocks that have at least one user already, and | 1126 | * Turn on all clocks that have at least one user already, and |
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c index 88b00b15970f..e011f1ce1875 100644 --- a/arch/avr32/mm/fault.c +++ b/arch/avr32/mm/fault.c | |||
| @@ -12,41 +12,30 @@ | |||
| 12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
| 15 | |||
| 16 | #include <linux/kdebug.h> | 15 | #include <linux/kdebug.h> |
| 16 | #include <linux/kprobes.h> | ||
| 17 | |||
| 17 | #include <asm/mmu_context.h> | 18 | #include <asm/mmu_context.h> |
| 18 | #include <asm/sysreg.h> | 19 | #include <asm/sysreg.h> |
| 19 | #include <asm/tlb.h> | 20 | #include <asm/tlb.h> |
| 20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
| 21 | 22 | ||
| 22 | #ifdef CONFIG_KPROBES | 23 | #ifdef CONFIG_KPROBES |
| 23 | ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); | 24 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
| 24 | |||
| 25 | /* Hook to register for page fault notifications */ | ||
| 26 | int register_page_fault_notifier(struct notifier_block *nb) | ||
| 27 | { | 25 | { |
| 28 | return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); | 26 | int ret = 0; |
| 29 | } | ||
| 30 | 27 | ||
| 31 | int unregister_page_fault_notifier(struct notifier_block *nb) | 28 | if (!user_mode(regs)) { |
| 32 | { | 29 | if (kprobe_running() && kprobe_fault_handler(regs, trap)) |
| 33 | return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); | 30 | ret = 1; |
| 34 | } | 31 | } |
| 35 | 32 | ||
| 36 | static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, | 33 | return ret; |
| 37 | int trap, int sig) | ||
| 38 | { | ||
| 39 | struct die_args args = { | ||
| 40 | .regs = regs, | ||
| 41 | .trapnr = trap, | ||
| 42 | }; | ||
| 43 | return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args); | ||
| 44 | } | 34 | } |
| 45 | #else | 35 | #else |
| 46 | static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, | 36 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
| 47 | int trap, int sig) | ||
| 48 | { | 37 | { |
| 49 | return NOTIFY_DONE; | 38 | return 0; |
| 50 | } | 39 | } |
| 51 | #endif | 40 | #endif |
| 52 | 41 | ||
| @@ -76,8 +65,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs) | |||
| 76 | long signr; | 65 | long signr; |
| 77 | int code; | 66 | int code; |
| 78 | 67 | ||
| 79 | if (notify_page_fault(DIE_PAGE_FAULT, regs, | 68 | if (notify_page_fault(regs, ecr)) |
| 80 | ecr, SIGSEGV) == NOTIFY_STOP) | ||
| 81 | return; | 69 | return; |
| 82 | 70 | ||
| 83 | address = sysreg_read(TLBEAR); | 71 | address = sysreg_read(TLBEAR); |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 3549c94467b8..c4784494970e 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -791,7 +791,7 @@ static __init int setup_additional_cpus(char *s) | |||
| 791 | early_param("additional_cpus", setup_additional_cpus); | 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 | * are onlined, or offlined. The reason is per-cpu data-structures | 795 | * are onlined, or offlined. The reason is per-cpu data-structures |
| 796 | * are allocated by some modules at init time, and dont expect to | 796 | * are allocated by some modules at init time, and dont expect to |
| 797 | * do this dynamically on cpu arrival/departure. | 797 | * do this dynamically on cpu arrival/departure. |
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index aeb79fb28f0b..1d64ef478dde 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c | |||
| @@ -156,24 +156,30 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
| 156 | if (!kdump_on_init) | 156 | if (!kdump_on_init) |
| 157 | return NOTIFY_DONE; | 157 | return NOTIFY_DONE; |
| 158 | 158 | ||
| 159 | if (val != DIE_INIT_MONARCH_ENTER && | 159 | if (val != DIE_INIT_MONARCH_LEAVE && |
| 160 | val != DIE_INIT_SLAVE_ENTER && | 160 | val != DIE_INIT_SLAVE_LEAVE && |
| 161 | val != DIE_INIT_MONARCH_PROCESS && | ||
| 161 | val != DIE_MCA_RENDZVOUS_LEAVE && | 162 | val != DIE_MCA_RENDZVOUS_LEAVE && |
| 162 | val != DIE_MCA_MONARCH_LEAVE) | 163 | val != DIE_MCA_MONARCH_LEAVE) |
| 163 | return NOTIFY_DONE; | 164 | return NOTIFY_DONE; |
| 164 | 165 | ||
| 165 | nd = (struct ia64_mca_notify_die *)args->err; | 166 | nd = (struct ia64_mca_notify_die *)args->err; |
| 166 | /* Reason code 1 means machine check rendezous*/ | 167 | /* Reason code 1 means machine check rendezvous*/ |
| 167 | if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) && | 168 | if ((val == DIE_INIT_MONARCH_LEAVE || val == DIE_INIT_SLAVE_LEAVE |
| 168 | nd->sos->rv_rc == 1) | 169 | || val == DIE_INIT_MONARCH_PROCESS) && nd->sos->rv_rc == 1) |
| 169 | return NOTIFY_DONE; | 170 | return NOTIFY_DONE; |
| 170 | 171 | ||
| 171 | switch (val) { | 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 | machine_kdump_on_init(); | 178 | machine_kdump_on_init(); |
| 174 | break; | 179 | break; |
| 175 | case DIE_INIT_SLAVE_ENTER: | 180 | case DIE_INIT_SLAVE_LEAVE: |
| 176 | unw_init_running(kdump_cpu_freeze, NULL); | 181 | if (atomic_read(&kdump_in_progress)) |
| 182 | unw_init_running(kdump_cpu_freeze, NULL); | ||
| 177 | break; | 183 | break; |
| 178 | case DIE_MCA_RENDZVOUS_LEAVE: | 184 | case DIE_MCA_RENDZVOUS_LEAVE: |
| 179 | if (atomic_read(&kdump_in_progress)) | 185 | if (atomic_read(&kdump_in_progress)) |
| @@ -215,8 +221,10 @@ static ctl_table sys_table[] = { | |||
| 215 | static int | 221 | static int |
| 216 | machine_crash_setup(void) | 222 | machine_crash_setup(void) |
| 217 | { | 223 | { |
| 224 | /* be notified before default_monarch_init_process */ | ||
| 218 | static struct notifier_block kdump_init_notifier_nb = { | 225 | static struct notifier_block kdump_init_notifier_nb = { |
| 219 | .notifier_call = kdump_init_notifier, | 226 | .notifier_call = kdump_init_notifier, |
| 227 | .priority = 1, | ||
| 220 | }; | 228 | }; |
| 221 | int ret; | 229 | int ret; |
| 222 | if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0) | 230 | if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0) |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 144b056282af..95f517515235 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
| @@ -1585,5 +1585,8 @@ sys_call_table: | |||
| 1585 | data8 sys_getcpu | 1585 | data8 sys_getcpu |
| 1586 | data8 sys_epoll_pwait // 1305 | 1586 | data8 sys_epoll_pwait // 1305 |
| 1587 | data8 sys_utimensat | 1587 | data8 sys_utimensat |
| 1588 | data8 sys_signalfd | ||
| 1589 | data8 sys_timerfd | ||
| 1590 | data8 sys_eventfd | ||
| 1588 | 1591 | ||
| 1589 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1592 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index b4c239685d2e..407b45870489 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar | 4 | * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar |
| 5 | * | 5 | * |
| 6 | * This file contains the code used by various IRQ handling routines: | 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 | * instead of just grabbing them. Thus setups with different IRQ numbers | 8 | * instead of just grabbing them. Thus setups with different IRQ numbers |
| 9 | * shouldn't result in any weird surprises, and installing new handlers | 9 | * shouldn't result in any weird surprises, and installing new handlers |
| 10 | * should be easier. | 10 | * should be easier. |
| @@ -12,7 +12,7 @@ | |||
| 12 | * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004 | 12 | * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004 |
| 13 | * | 13 | * |
| 14 | * 4/14/2004: Added code to handle cpu migration and do safe irq | 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 | * architecture. | 16 | * architecture. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| @@ -190,7 +190,7 @@ void fixup_irqs(void) | |||
| 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 | * relocate them for cpu removal. | 194 | * relocate them for cpu removal. |
| 195 | */ | 195 | */ |
| 196 | migrate_irqs(); | 196 | migrate_irqs(); |
diff --git a/arch/ia64/kernel/irq_lsapic.c b/arch/ia64/kernel/irq_lsapic.c index c2f07beb1759..e56a7a36aca3 100644 --- a/arch/ia64/kernel/irq_lsapic.c +++ b/arch/ia64/kernel/irq_lsapic.c | |||
| @@ -23,7 +23,7 @@ lsapic_noop_startup (unsigned int irq) | |||
| 23 | static void | 23 | static void |
| 24 | lsapic_noop (unsigned int irq) | 24 | lsapic_noop (unsigned int irq) |
| 25 | { | 25 | { |
| 26 | /* nuthing to do... */ | 26 | /* nothing to do... */ |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | static int lsapic_retrigger(unsigned int irq) | 29 | static int lsapic_retrigger(unsigned int irq) |
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 72e593e94053..5bc46f151344 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c | |||
| @@ -151,12 +151,12 @@ static uint __kprobes is_cmp_ctype_unc_inst(uint template, uint slot, | |||
| 151 | 151 | ||
| 152 | cmp_inst.l = kprobe_inst; | 152 | cmp_inst.l = kprobe_inst; |
| 153 | if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) { | 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 | if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0) | 155 | if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0) |
| 156 | &&(cmp_inst.f.c == 1)) | 156 | &&(cmp_inst.f.c == 1)) |
| 157 | ctype_unc = 1; | 157 | ctype_unc = 1; |
| 158 | } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) { | 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 | if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1)) | 160 | if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1)) |
| 161 | ctype_unc = 1; | 161 | ctype_unc = 1; |
| 162 | } | 162 | } |
| @@ -820,7 +820,7 @@ out: | |||
| 820 | return 1; | 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 | struct kprobe *cur = kprobe_running(); | 825 | struct kprobe *cur = kprobe_running(); |
| 826 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 826 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
| @@ -904,13 +904,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 904 | if (post_kprobes_handler(args->regs)) | 904 | if (post_kprobes_handler(args->regs)) |
| 905 | ret = NOTIFY_STOP; | 905 | ret = NOTIFY_STOP; |
| 906 | break; | 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 | default: | 907 | default: |
| 915 | break; | 908 | break; |
| 916 | } | 909 | } |
| @@ -954,7 +947,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 954 | /* | 947 | /* |
| 955 | * Callee owns the argument space and could overwrite it, eg | 948 | * Callee owns the argument space and could overwrite it, eg |
| 956 | * tail call optimization. So to be absolutely safe | 949 | * tail call optimization. So to be absolutely safe |
| 957 | * we save the argument space before transfering the control | 950 | * we save the argument space before transferring the control |
| 958 | * to instrumented jprobe function which runs in | 951 | * to instrumented jprobe function which runs in |
| 959 | * the process context | 952 | * the process context |
| 960 | */ | 953 | */ |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 26814de6c29a..1ead5ea6c5ce 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
| @@ -273,7 +273,6 @@ static void ia64_mlogbuf_finish(int wait) | |||
| 273 | 273 | ||
| 274 | mlogbuf_finished = 1; | 274 | mlogbuf_finished = 1; |
| 275 | } | 275 | } |
| 276 | EXPORT_SYMBOL(ia64_mlogbuf_finish); | ||
| 277 | 276 | ||
| 278 | /* | 277 | /* |
| 279 | * Print buffered messages from INIT context. | 278 | * Print buffered messages from INIT context. |
| @@ -1477,6 +1476,10 @@ default_monarch_init_process(struct notifier_block *self, unsigned long val, voi | |||
| 1477 | struct task_struct *g, *t; | 1476 | struct task_struct *g, *t; |
| 1478 | if (val != DIE_INIT_MONARCH_PROCESS) | 1477 | if (val != DIE_INIT_MONARCH_PROCESS) |
| 1479 | return NOTIFY_DONE; | 1478 | return NOTIFY_DONE; |
| 1479 | #ifdef CONFIG_KEXEC | ||
| 1480 | if (atomic_read(&kdump_in_progress)) | ||
| 1481 | return NOTIFY_DONE; | ||
| 1482 | #endif | ||
| 1480 | 1483 | ||
| 1481 | /* | 1484 | /* |
| 1482 | * FIXME: mlogbuf will brim over with INIT stack dumps. | 1485 | * FIXME: mlogbuf will brim over with INIT stack dumps. |
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 70b8bdbb7e6f..aba813c2c150 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c | |||
| @@ -438,7 +438,7 @@ is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci, | |||
| 438 | * @peidx: pointer of index of processor error section | 438 | * @peidx: pointer of index of processor error section |
| 439 | * | 439 | * |
| 440 | * Return value: | 440 | * Return value: |
| 441 | * target address on Success / 0 on Failue | 441 | * target address on Success / 0 on Failure |
| 442 | */ | 442 | */ |
| 443 | static u64 | 443 | static u64 |
| 444 | get_target_identifier(peidx_table_t *peidx) | 444 | get_target_identifier(peidx_table_t *peidx) |
| @@ -701,7 +701,7 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, | |||
| 701 | return fatal_mca("External bus check fatal status"); | 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 | if (platform) | 706 | if (platform) |
| 707 | return recover_from_platform_error(slidx, peidx, pbci, sos); | 707 | return recover_from_platform_error(slidx, peidx, pbci, sos); |
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 158e3c51bb77..196287928bae 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
| @@ -861,7 +861,7 @@ apply_relocate (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
| 861 | /* | 861 | /* |
| 862 | * Modules contain a single unwind table which covers both the core and the init text | 862 | * Modules contain a single unwind table which covers both the core and the init text |
| 863 | * sections but since the two are not contiguous, we need to split this table up such that | 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 | * more complicated than it really is. | 865 | * more complicated than it really is. |
| 866 | */ | 866 | */ |
| 867 | static void | 867 | static void |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index e7191ca30b16..b7133cabdbea 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
| @@ -1318,7 +1318,7 @@ pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu) | |||
| 1318 | { | 1318 | { |
| 1319 | unsigned long flags; | 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 | LOCK_PFS(flags); | 1323 | LOCK_PFS(flags); |
| 1324 | 1324 | ||
| @@ -1384,7 +1384,7 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu) | |||
| 1384 | { | 1384 | { |
| 1385 | unsigned long flags; | 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 | LOCK_PFS(flags); | 1389 | LOCK_PFS(flags); |
| 1390 | 1390 | ||
| @@ -1835,7 +1835,7 @@ pfm_flush(struct file *filp, fl_owner_t id) | |||
| 1835 | /* | 1835 | /* |
| 1836 | * remove our file from the async queue, if we use this mode. | 1836 | * remove our file from the async queue, if we use this mode. |
| 1837 | * This can be done without the context being protected. We come | 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 | * We may still have active monitoring at this point and we may | 1840 | * We may still have active monitoring at this point and we may |
| 1841 | * end up in pfm_overflow_handler(). However, fasync_helper() | 1841 | * end up in pfm_overflow_handler(). However, fasync_helper() |
| @@ -2132,7 +2132,7 @@ doit: | |||
| 2132 | filp->private_data = NULL; | 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 | * from the callers side. The monitored task side is also cut, so we | 2136 | * from the callers side. The monitored task side is also cut, so we |
| 2137 | * can freely cut. | 2137 | * can freely cut. |
| 2138 | * | 2138 | * |
| @@ -2562,7 +2562,7 @@ pfm_reset_pmu_state(pfm_context_t *ctx) | |||
| 2562 | ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1; | 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 | ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0]; | 2567 | ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0]; |
| 2568 | 2568 | ||
| @@ -3395,7 +3395,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
| 3395 | if (unlikely(!PMD_IS_IMPL(cnum))) goto error; | 3395 | if (unlikely(!PMD_IS_IMPL(cnum))) goto error; |
| 3396 | /* | 3396 | /* |
| 3397 | * we can only read the register that we use. That includes | 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 | * in the sampling buffer (smpl_regs). | 3399 | * in the sampling buffer (smpl_regs). |
| 3400 | * | 3400 | * |
| 3401 | * Having this restriction allows optimization in the ctxsw routine | 3401 | * Having this restriction allows optimization in the ctxsw routine |
| @@ -3715,7 +3715,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
| 3715 | * if non-blocking, then we ensure that the task will go into | 3715 | * if non-blocking, then we ensure that the task will go into |
| 3716 | * pfm_handle_work() before returning to user mode. | 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 | * be done by the task itself. This works for system wide because | 3719 | * be done by the task itself. This works for system wide because |
| 3720 | * the tool that is controlling the session is logically doing | 3720 | * the tool that is controlling the session is logically doing |
| 3721 | * "self-monitoring". | 3721 | * "self-monitoring". |
| @@ -4644,7 +4644,7 @@ pfm_exit_thread(struct task_struct *task) | |||
| 4644 | switch(state) { | 4644 | switch(state) { |
| 4645 | case PFM_CTX_UNLOADED: | 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 | * be in unloaded state | 4648 | * be in unloaded state |
| 4649 | */ | 4649 | */ |
| 4650 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid); | 4650 | printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid); |
| @@ -5247,7 +5247,7 @@ pfm_end_notify_user(pfm_context_t *ctx) | |||
| 5247 | 5247 | ||
| 5248 | /* | 5248 | /* |
| 5249 | * main overflow processing routine. | 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 | static void | 5252 | static void |
| 5253 | pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs) | 5253 | pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs) |
diff --git a/arch/ia64/kernel/perfmon_mckinley.h b/arch/ia64/kernel/perfmon_mckinley.h index 9becccda2897..c4bec7a9d18f 100644 --- a/arch/ia64/kernel/perfmon_mckinley.h +++ b/arch/ia64/kernel/perfmon_mckinley.h | |||
| @@ -181,7 +181,7 @@ static pmu_config_t pmu_conf_mck={ | |||
| 181 | .pmc_desc = pfm_mck_pmc_desc, | 181 | .pmc_desc = pfm_mck_pmc_desc, |
| 182 | .num_ibrs = 8, | 182 | .num_ibrs = 8, |
| 183 | .num_dbrs = 8, | 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 | ||
diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c index 37c876f95dba..27c2ef445a56 100644 --- a/arch/ia64/kernel/sal.c +++ b/arch/ia64/kernel/sal.c | |||
| @@ -134,7 +134,7 @@ set_smp_redirect (int flag) | |||
| 134 | * interrupt redirection. The reason is this would require that | 134 | * interrupt redirection. The reason is this would require that |
| 135 | * All interrupts be stopped and hard bind the irq to a cpu. | 135 | * All interrupts be stopped and hard bind the irq to a cpu. |
| 136 | * Later when the interrupt is fired we need to set the redir hint | 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 | * user mode irq balancer will solve anyways. | 138 | * user mode irq balancer will solve anyways. |
| 139 | */ | 139 | */ |
| 140 | no_int_routing=1; | 140 | no_int_routing=1; |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 89f6b138a62c..25cd75f50ab1 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
| @@ -162,7 +162,7 @@ static DEFINE_SPINLOCK(data_saved_lock); | |||
| 162 | /** salinfo_platform_oemdata - optional callback to decode oemdata from an error | 162 | /** salinfo_platform_oemdata - optional callback to decode oemdata from an error |
| 163 | * record. | 163 | * record. |
| 164 | * @sect_header: pointer to the start of the section to decode. | 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 | * @oemdata_size: returns length of decoded output (strlen). | 166 | * @oemdata_size: returns length of decoded output (strlen). |
| 167 | * | 167 | * |
| 168 | * Description: If user space asks for oem data to be decoded by the kernel | 168 | * Description: If user space asks for oem data to be decoded by the kernel |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 9df1efe7487d..eaa6a24bc0b6 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
| @@ -576,7 +576,7 @@ setup_arch (char **cmdline_p) | |||
| 576 | } | 576 | } |
| 577 | 577 | ||
| 578 | /* | 578 | /* |
| 579 | * Display cpu info for all cpu's. | 579 | * Display cpu info for all CPUs. |
| 580 | */ | 580 | */ |
| 581 | static int | 581 | static int |
| 582 | show_cpuinfo (struct seq_file *m, void *v) | 582 | show_cpuinfo (struct seq_file *m, void *v) |
| @@ -761,7 +761,7 @@ identify_cpu (struct cpuinfo_ia64 *c) | |||
| 761 | c->cpu = smp_processor_id(); | 761 | c->cpu = smp_processor_id(); |
| 762 | 762 | ||
| 763 | /* below default values will be overwritten by identify_siblings() | 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 | c->threads_per_core = c->cores_per_socket = c->num_log = 1; | 766 | c->threads_per_core = c->cores_per_socket = c->num_log = 1; |
| 767 | c->socket_id = -1; | 767 | c->socket_id = -1; |
| @@ -947,7 +947,7 @@ cpu_init (void) | |||
| 947 | ia32_cpu_init(); | 947 | ia32_cpu_init(); |
| 948 | #endif | 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 | ia64_set_itc(0); | 951 | ia64_set_itc(0); |
| 952 | 952 | ||
| 953 | /* disable all local interrupt sources: */ | 953 | /* disable all local interrupt sources: */ |
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c index 221de3804560..b3a47f986e1e 100644 --- a/arch/ia64/kernel/smp.c +++ b/arch/ia64/kernel/smp.c | |||
| @@ -186,7 +186,7 @@ handle_IPI (int irq, void *dev_id) | |||
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | /* | 188 | /* |
| 189 | * Called with preeemption disabled. | 189 | * Called with preemption disabled. |
| 190 | */ | 190 | */ |
| 191 | static inline void | 191 | static inline void |
| 192 | send_IPI_single (int dest_cpu, int op) | 192 | send_IPI_single (int dest_cpu, int op) |
| @@ -196,7 +196,7 @@ 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 | static inline void | 201 | static inline void |
| 202 | send_IPI_allbutself (int op) | 202 | send_IPI_allbutself (int op) |
| @@ -210,7 +210,7 @@ send_IPI_allbutself (int op) | |||
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | /* | 212 | /* |
| 213 | * Called with preeemption disabled. | 213 | * Called with preemption disabled. |
| 214 | */ | 214 | */ |
| 215 | static inline void | 215 | static inline void |
| 216 | send_IPI_all (int op) | 216 | send_IPI_all (int op) |
| @@ -223,7 +223,7 @@ send_IPI_all (int op) | |||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | /* | 225 | /* |
| 226 | * Called with preeemption disabled. | 226 | * Called with preemption disabled. |
| 227 | */ | 227 | */ |
| 228 | static inline void | 228 | static inline void |
| 229 | send_IPI_self (int op) | 229 | send_IPI_self (int op) |
| @@ -252,7 +252,7 @@ kdump_smp_send_init(void) | |||
| 252 | } | 252 | } |
| 253 | #endif | 253 | #endif |
| 254 | /* | 254 | /* |
| 255 | * Called with preeemption disabled. | 255 | * Called with preemption disabled. |
| 256 | */ | 256 | */ |
| 257 | void | 257 | void |
| 258 | smp_send_reschedule (int cpu) | 258 | smp_send_reschedule (int cpu) |
| @@ -261,7 +261,7 @@ smp_send_reschedule (int cpu) | |||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | /* | 263 | /* |
| 264 | * Called with preeemption disabled. | 264 | * Called with preemption disabled. |
| 265 | */ | 265 | */ |
| 266 | static void | 266 | static void |
| 267 | smp_send_local_flush_tlb (int cpu) | 267 | smp_send_local_flush_tlb (int cpu) |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index a44792d0f3a9..542958079f1b 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
| @@ -694,7 +694,7 @@ int migrate_platform_irqs(unsigned int cpu) | |||
| 694 | set_cpei_target_cpu(new_cpei_cpu); | 694 | set_cpei_target_cpu(new_cpei_cpu); |
| 695 | desc = irq_desc + ia64_cpe_irq; | 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 | * as other interrupts, but need to study CPEI behaviour with | 698 | * as other interrupts, but need to study CPEI behaviour with |
| 699 | * polling before making changes. | 699 | * polling before making changes. |
| 700 | */ | 700 | */ |
| @@ -840,7 +840,7 @@ __cpu_up (unsigned int cpu) | |||
| 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 | * SoftSDV/Lion, that would be ACPI. | 844 | * SoftSDV/Lion, that would be ACPI. |
| 845 | * | 845 | * |
| 846 | * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP(). | 846 | * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP(). |
| @@ -854,7 +854,7 @@ init_smp_config(void) | |||
| 854 | } *ap_startup; | 854 | } *ap_startup; |
| 855 | long sal_ret; | 855 | long sal_ret; |
| 856 | 856 | ||
| 857 | /* Tell SAL where to drop the AP's. */ | 857 | /* Tell SAL where to drop the APs. */ |
| 858 | ap_startup = (struct fptr *) start_ap; | 858 | ap_startup = (struct fptr *) start_ap; |
| 859 | sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, | 859 | sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, |
| 860 | ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0); | 860 | ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0); |
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index b8e0d70bf989..15ad85da15a9 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c | |||
| @@ -304,7 +304,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr) | |||
| 304 | * Lower 4 bits are used as a count. Upper bits are a sequence | 304 | * Lower 4 bits are used as a count. Upper bits are a sequence |
| 305 | * number that is updated when count is reset. The cmpxchg will | 305 | * number that is updated when count is reset. The cmpxchg will |
| 306 | * fail is seqno has changed. This minimizes mutiple cpus | 306 | * fail is seqno has changed. This minimizes mutiple cpus |
| 307 | * reseting the count. | 307 | * resetting the count. |
| 308 | */ | 308 | */ |
| 309 | if (current_jiffies > last.time) | 309 | if (current_jiffies > last.time) |
| 310 | (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15)); | 310 | (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15)); |
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index fe1426266b9b..7d3dd6cdafa4 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * Copyright (C) 1999-2004 Hewlett-Packard Co | 2 | * Copyright (C) 1999-2004 Hewlett-Packard Co |
| 3 | * David Mosberger-Tang <davidm@hpl.hp.com> | 3 | * David Mosberger-Tang <davidm@hpl.hp.com> |
| 4 | * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com> | 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 | * This file implements call frame unwind support for the Linux | 8 | * This file implements call frame unwind support for the Linux |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 38085ac18338..0dbf0e81f8c0 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
| @@ -317,7 +317,7 @@ static void __meminit scatter_node_data(void) | |||
| 317 | * node_online_map is not set for hot-added nodes at this time, | 317 | * node_online_map is not set for hot-added nodes at this time, |
| 318 | * because we are halfway through initialization of the new node's | 318 | * because we are halfway through initialization of the new node's |
| 319 | * structures. If for_each_online_node() is used, a new node's | 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 | * pgdat_list[] is checked. | 321 | * pgdat_list[] is checked. |
| 322 | */ | 322 | */ |
| 323 | for_each_node(node) { | 323 | for_each_node(node) { |
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 21658e02116c..b87f785c2416 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c | |||
| @@ -19,36 +19,24 @@ | |||
| 19 | extern void die (char *, struct pt_regs *, long); | 19 | extern void die (char *, struct pt_regs *, long); |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_KPROBES | 21 | #ifdef CONFIG_KPROBES |
| 22 | ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); | 22 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
| 23 | |||
| 24 | /* Hook to register for page fault notifications */ | ||
| 25 | int register_page_fault_notifier(struct notifier_block *nb) | ||
| 26 | { | ||
| 27 | return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); | ||
| 28 | } | ||
| 29 | |||
| 30 | int unregister_page_fault_notifier(struct notifier_block *nb) | ||
| 31 | { | 23 | { |
| 32 | return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); | 24 | int ret = 0; |
| 33 | } | 25 | |
| 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, | 34 | return ret; |
| 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(¬ify_page_fault_chain, val, &args); | ||
| 46 | } | 35 | } |
| 47 | #else | 36 | #else |
| 48 | static inline int notify_page_fault(enum die_val val, const char *str, | 37 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
| 49 | struct pt_regs *regs, long err, int trap, int sig) | ||
| 50 | { | 38 | { |
| 51 | return NOTIFY_DONE; | 39 | return 0; |
| 52 | } | 40 | } |
| 53 | #endif | 41 | #endif |
| 54 | 42 | ||
| @@ -117,8 +105,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re | |||
| 117 | /* | 105 | /* |
| 118 | * This is to handle the kprobes on user space access instructions | 106 | * This is to handle the kprobes on user space access instructions |
| 119 | */ | 107 | */ |
| 120 | if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, | 108 | if (notify_page_fault(regs, TRAP_BRKPT)) |
| 121 | SIGSEGV) == NOTIFY_STOP) | ||
| 122 | return; | 109 | return; |
| 123 | 110 | ||
| 124 | down_read(&mm->mmap_sem); | 111 | down_read(&mm->mmap_sem); |
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c index ff1c55601178..b362d6d6a8c8 100644 --- a/arch/ia64/sn/kernel/bte.c +++ b/arch/ia64/sn/kernel/bte.c | |||
| @@ -63,7 +63,7 @@ static inline void bte_start_transfer(struct bteinfo_s *bte, u64 len, u64 mode) | |||
| 63 | * Use the block transfer engine to move kernel memory from src to dest | 63 | * Use the block transfer engine to move kernel memory from src to dest |
| 64 | * using the assigned mode. | 64 | * using the assigned mode. |
| 65 | * | 65 | * |
| 66 | * Paramaters: | 66 | * Parameters: |
| 67 | * src - physical address of the transfer source. | 67 | * src - physical address of the transfer source. |
| 68 | * dest - physical address of the transfer destination. | 68 | * dest - physical address of the transfer destination. |
| 69 | * len - number of bytes to transfer from source to dest. | 69 | * len - number of bytes to transfer from source to dest. |
| @@ -247,7 +247,7 @@ EXPORT_SYMBOL(bte_copy); | |||
| 247 | * use the block transfer engine to move kernel | 247 | * use the block transfer engine to move kernel |
| 248 | * memory from src to dest using the assigned mode. | 248 | * memory from src to dest using the assigned mode. |
| 249 | * | 249 | * |
| 250 | * Paramaters: | 250 | * Parameters: |
| 251 | * src - physical address of the transfer source. | 251 | * src - physical address of the transfer source. |
| 252 | * dest - physical address of the transfer destination. | 252 | * dest - physical address of the transfer destination. |
| 253 | * len - number of bytes to transfer from source to dest. | 253 | * len - number of bytes to transfer from source to dest. |
| @@ -255,7 +255,7 @@ EXPORT_SYMBOL(bte_copy); | |||
| 255 | * for IBCT0/1 in the SGI documentation. | 255 | * for IBCT0/1 in the SGI documentation. |
| 256 | * | 256 | * |
| 257 | * NOTE: If the source, dest, and len are all cache line aligned, | 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 | bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) | 260 | bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) |
| 261 | { | 261 | { |
| @@ -300,7 +300,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) | |||
| 300 | * a standard bte copy. | 300 | * a standard bte copy. |
| 301 | * | 301 | * |
| 302 | * One nasty exception to the above rule is when the | 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 | * mis-aligned. If the source offset from the first | 304 | * mis-aligned. If the source offset from the first |
| 305 | * cache line is different from the destination offset, | 305 | * cache line is different from the destination offset, |
| 306 | * we make the first section be the entire transfer | 306 | * we make the first section be the entire transfer |
| @@ -337,7 +337,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) | |||
| 337 | 337 | ||
| 338 | if (footBcopyDest == (headBcopyDest + headBcopyLen)) { | 338 | if (footBcopyDest == (headBcopyDest + headBcopyLen)) { |
| 339 | /* | 339 | /* |
| 340 | * We have two contigous bcopy | 340 | * We have two contiguous bcopy |
| 341 | * blocks. Merge them. | 341 | * blocks. Merge them. |
| 342 | */ | 342 | */ |
| 343 | headBcopyLen += footBcopyLen; | 343 | headBcopyLen += footBcopyLen; |
| @@ -375,7 +375,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) | |||
| 375 | } else { | 375 | } else { |
| 376 | 376 | ||
| 377 | /* | 377 | /* |
| 378 | * The transfer is not symetric, we will | 378 | * The transfer is not symmetric, we will |
| 379 | * allocate a buffer large enough for all the | 379 | * allocate a buffer large enough for all the |
| 380 | * data, bte_copy into that buffer and then | 380 | * data, bte_copy into that buffer and then |
| 381 | * bcopy to the destination. | 381 | * bcopy to the destination. |
diff --git a/arch/ia64/sn/kernel/bte_error.c b/arch/ia64/sn/kernel/bte_error.c index b6fcf8164f2b..27c5936ccfe9 100644 --- a/arch/ia64/sn/kernel/bte_error.c +++ b/arch/ia64/sn/kernel/bte_error.c | |||
| @@ -105,7 +105,7 @@ int shub1_bte_error_handler(unsigned long _nodepda) | |||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id())); | 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 | imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM); | 109 | imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM); |
| 110 | imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1; | 110 | imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1; |
| 111 | REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval); | 111 | REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval); |
| @@ -243,7 +243,7 @@ bte_crb_error_handler(cnodeid_t cnode, int btenum, | |||
| 243 | 243 | ||
| 244 | /* | 244 | /* |
| 245 | * The caller has already figured out the error type, we save that | 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 | * interface to consume. | 247 | * interface to consume. |
| 248 | */ | 248 | */ |
| 249 | bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET; | 249 | bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET; |
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 7ed72d3faf73..787ed642dd49 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c | |||
| @@ -479,7 +479,7 @@ sn_io_early_init(void) | |||
| 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 | * override their respective default entries. | 483 | * override their respective default entries. |
| 484 | */ | 484 | */ |
| 485 | 485 | ||
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index a9bed5ca2ed8..a574fcd163dd 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
| @@ -167,7 +167,7 @@ void __init early_sn_setup(void) | |||
| 167 | * IO on SN2 is done via SAL calls, early_printk won't work without this. | 167 | * IO on SN2 is done via SAL calls, early_printk won't work without this. |
| 168 | * | 168 | * |
| 169 | * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. | 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 | efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); | 172 | efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); |
| 173 | config_tables = __va(efi_systab->tables); | 173 | config_tables = __va(efi_systab->tables); |
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index 5d318b579fb1..033c8a9f000e 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c | |||
| @@ -104,7 +104,7 @@ static inline unsigned long wait_piowc(void) | |||
| 104 | * | 104 | * |
| 105 | * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. | 105 | * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. |
| 106 | * Context switching user threads which have memory-mapped MMIO may cause | 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 | * from the previous CPU's Shub before execution resumes on the new CPU. | 108 | * from the previous CPU's Shub before execution resumes on the new CPU. |
| 109 | */ | 109 | */ |
| 110 | void sn_migrate(struct task_struct *task) | 110 | void sn_migrate(struct task_struct *task) |
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c index c08db9c2375d..44ccc0d789c9 100644 --- a/arch/ia64/sn/kernel/xpc_channel.c +++ b/arch/ia64/sn/kernel/xpc_channel.c | |||
| @@ -293,7 +293,7 @@ xpc_pull_remote_cachelines(struct xpc_partition *part, void *dst, | |||
| 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 | * partition. | 297 | * partition. |
| 298 | */ | 298 | */ |
| 299 | enum xpc_retval | 299 | enum xpc_retval |
| @@ -461,7 +461,7 @@ xpc_allocate_local_msgqueue(struct xpc_channel *ch) | |||
| 461 | // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between | 461 | // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between |
| 462 | // >>> iterations of the for-loop, bail if set? | 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 | for (nentries = ch->local_nentries; nentries > 0; nentries--) { | 465 | for (nentries = ch->local_nentries; nentries > 0; nentries--) { |
| 466 | 466 | ||
| 467 | nbytes = nentries * ch->msg_size; | 467 | nbytes = nentries * ch->msg_size; |
| @@ -514,7 +514,7 @@ xpc_allocate_remote_msgqueue(struct xpc_channel *ch) | |||
| 514 | // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between | 514 | // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between |
| 515 | // >>> iterations of the for-loop, bail if set? | 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 | for (nentries = ch->remote_nentries; nentries > 0; nentries--) { | 518 | for (nentries = ch->remote_nentries; nentries > 0; nentries--) { |
| 519 | 519 | ||
| 520 | nbytes = nentries * ch->msg_size; | 520 | nbytes = nentries * ch->msg_size; |
| @@ -1478,7 +1478,7 @@ xpc_teardown_infrastructure(struct xpc_partition *part) | |||
| 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 | * existing references cease. | 1482 | * existing references cease. |
| 1483 | */ | 1483 | */ |
| 1484 | wait_event(part->teardown_wq, (atomic_read(&part->references) == 0)); | 1484 | wait_event(part->teardown_wq, (atomic_read(&part->references) == 0)); |
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c index da7213530972..e58fcadff2e9 100644 --- a/arch/ia64/sn/kernel/xpnet.c +++ b/arch/ia64/sn/kernel/xpnet.c | |||
| @@ -531,7 +531,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 531 | dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp); | 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 | * unswitched network, this would be a good point to OR in a | 535 | * unswitched network, this would be a good point to OR in a |
| 536 | * mask of partitions which should be receiving all packets. | 536 | * mask of partitions which should be receiving all packets. |
| 537 | */ | 537 | */ |
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 7a291a271511..d79ddacfba2d 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c | |||
| @@ -333,7 +333,7 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size) | |||
| 333 | /* | 333 | /* |
| 334 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work | 334 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work |
| 335 | * around hw issues at the pci bus level. SGI proms older than | 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 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, | 339 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, |
| @@ -348,7 +348,7 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size) | |||
| 348 | /* | 348 | /* |
| 349 | * If the above failed, retry using the SAL_PROBE call which should | 349 | * If the above failed, retry using the SAL_PROBE call which should |
| 350 | * be present in all proms (but which cannot work round PCI chipset | 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 | * pre-4.10 proms, and should be removed at some point in the future. | 352 | * pre-4.10 proms, and should be removed at some point in the future. |
| 353 | */ | 353 | */ |
| 354 | 354 | ||
| @@ -379,7 +379,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) | |||
| 379 | /* | 379 | /* |
| 380 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work | 380 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work |
| 381 | * around hw issues at the pci bus level. SGI proms older than | 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 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, | 385 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, |
| @@ -394,7 +394,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) | |||
| 394 | /* | 394 | /* |
| 395 | * If the above failed, retry using the SAL_PROBE call which should | 395 | * If the above failed, retry using the SAL_PROBE call which should |
| 396 | * be present in all proms (but which cannot work round PCI chipset | 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 | * pre-4.10 proms, and should be removed at some point in the future. | 398 | * pre-4.10 proms, and should be removed at some point in the future. |
| 399 | */ | 399 | */ |
| 400 | 400 | ||
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c index 935029fc400d..239b3cedcf2b 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c | |||
| @@ -30,7 +30,7 @@ static void mark_ate(struct ate_resource *ate_resource, int start, int number, | |||
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | * find_free_ate: Find the first free ate index starting from the given | 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 | static int find_free_ate(struct ate_resource *ate_resource, int start, | 35 | static int find_free_ate(struct ate_resource *ate_resource, int start, |
| 36 | int count) | 36 | int count) |
| @@ -88,7 +88,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource, | |||
| 88 | return -1; | 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 | start_index = | 93 | start_index = |
| 94 | find_free_ate(ate_resource, ate_resource->lowest_free_index, | 94 | find_free_ate(ate_resource, ate_resource->lowest_free_index, |
| @@ -105,7 +105,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource, | |||
| 105 | /* | 105 | /* |
| 106 | * Allocate "count" contiguous Bridge Address Translation Entries | 106 | * Allocate "count" contiguous Bridge Address Translation Entries |
| 107 | * on the specified bridge to be used for PCI to XTALK mappings. | 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 | * to caller range from 0..num_entries-1. | 109 | * to caller range from 0..num_entries-1. |
| 110 | * | 110 | * |
| 111 | * Return the start index on success, -1 on failure. | 111 | * Return the start index on success, -1 on failure. |
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c index 95af40cb22f2..e626e50a938a 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c | |||
| @@ -201,7 +201,7 @@ pcibr_dmatrans_direct32(struct pcidev_info * info, | |||
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | /* | 203 | /* |
| 204 | * Wrapper routine for free'ing DMA maps | 204 | * Wrapper routine for freeing DMA maps |
| 205 | * DMA mappings for Direct 64 and 32 do not have any DMA maps. | 205 | * DMA mappings for Direct 64 and 32 do not have any DMA maps. |
| 206 | */ | 206 | */ |
| 207 | void | 207 | void |
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c index 8a2cb4e691fd..b9bedbd6e1d6 100644 --- a/arch/ia64/sn/pci/tioca_provider.c +++ b/arch/ia64/sn/pci/tioca_provider.c | |||
| @@ -223,7 +223,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern) | |||
| 223 | 223 | ||
| 224 | /* | 224 | /* |
| 225 | * Scan all vga controllers on this bus making sure they all | 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 | list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) { | 229 | list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) { |
| @@ -364,7 +364,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr) | |||
| 364 | * @req_size: len (bytes) to map | 364 | * @req_size: len (bytes) to map |
| 365 | * | 365 | * |
| 366 | * Map @paddr into CA address space using the GART mechanism. The mapped | 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 | static dma_addr_t | 369 | static dma_addr_t |
| 370 | tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size) | 370 | tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size) |
| @@ -526,7 +526,7 @@ tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) | |||
| 526 | return 0; | 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 | * bit direct is so restrictive w.r.t. where the memory resides that | 530 | * bit direct is so restrictive w.r.t. where the memory resides that |
| 531 | * we don't use it even though CA has some support. | 531 | * we don't use it even though CA has some support. |
| 532 | */ | 532 | */ |
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index 35f854fb6120..f4c0b961a939 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c | |||
| @@ -256,9 +256,9 @@ pcidev_to_tioce(struct pci_dev *pdev, struct tioce __iomem **base, | |||
| 256 | * @ct_addr: the coretalk address to map | 256 | * @ct_addr: the coretalk address to map |
| 257 | * @len: number of bytes to map | 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 | * ATE pool to use. Search for a contiguous block of entries to cover the | 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 | * tioce_dmamap struct to track the mapping. | 262 | * tioce_dmamap struct to track the mapping. |
| 263 | */ | 263 | */ |
| 264 | static u64 | 264 | static u64 |
| @@ -581,8 +581,8 @@ tioce_do_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, | |||
| 581 | */ | 581 | */ |
| 582 | if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) { | 582 | if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) { |
| 583 | /* | 583 | /* |
| 584 | * We have two options for 40-bit mappings: 16GB "super" ATE's | 584 | * We have two options for 40-bit mappings: 16GB "super" ATEs |
| 585 | * and 64MB "regular" ATE's. We'll try both if needed for a | 585 | * and 64MB "regular" ATEs. We'll try both if needed for a |
| 586 | * given mapping but which one we try first depends on the | 586 | * given mapping but which one we try first depends on the |
| 587 | * size. For requests >64MB, prefer to use a super page with | 587 | * size. For requests >64MB, prefer to use a super page with |
| 588 | * regular as the fallback. Otherwise, try in the reverse order. | 588 | * regular as the fallback. Otherwise, try in the reverse order. |
| @@ -687,8 +687,8 @@ tioce_error_intr_handler(int irq, void *arg) | |||
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | /** | 689 | /** |
| 690 | * tioce_reserve_m32 - reserve M32 ate's for the indicated address range | 690 | * tioce_reserve_m32 - reserve M32 ATEs for the indicated address range |
| 691 | * @tioce_kernel: TIOCE context to reserve ate's for | 691 | * @tioce_kernel: TIOCE context to reserve ATEs for |
| 692 | * @base: starting bus address to reserve | 692 | * @base: starting bus address to reserve |
| 693 | * @limit: last bus address to reserve | 693 | * @limit: last bus address to reserve |
| 694 | * | 694 | * |
| @@ -763,7 +763,7 @@ tioce_kern_init(struct tioce_common *tioce_common) | |||
| 763 | 763 | ||
| 764 | /* | 764 | /* |
| 765 | * Set PMU pagesize to the largest size available, and zero out | 765 | * Set PMU pagesize to the largest size available, and zero out |
| 766 | * the ate's. | 766 | * the ATEs. |
| 767 | */ | 767 | */ |
| 768 | 768 | ||
| 769 | tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; | 769 | tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; |
| @@ -784,7 +784,7 @@ tioce_kern_init(struct tioce_common *tioce_common) | |||
| 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 | * include: | 788 | * include: |
| 789 | * | 789 | * |
| 790 | * Memory space covered by each PPB mem base/limit register | 790 | * Memory space covered by each PPB mem base/limit register |
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 6bf6fb65bc20..c749dccacc32 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile | |||
| @@ -12,7 +12,7 @@ obj-y := process.o setup.o cpu.o idprom.o \ | |||
| 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ | 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ |
| 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ | 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ |
| 14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ | 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 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 17 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| 18 | obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ | 18 | obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ |
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index c15a3edcb826..732b77cb71f8 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
| @@ -1843,3 +1843,97 @@ sun4v_cpu_state: | |||
| 1843 | mov %o1, %o0 | 1843 | mov %o1, %o0 |
| 1844 | 1: retl | 1844 | 1: retl |
| 1845 | nop | 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 | ||
diff --git a/arch/sparc64/kernel/hvapi.c b/arch/sparc64/kernel/hvapi.c new file mode 100644 index 000000000000..f03ffc829c7a --- /dev/null +++ b/arch/sparc64/kernel/hvapi.c | |||
| @@ -0,0 +1,189 @@ | |||
| 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 | } | ||
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 451028341c75..dea9c3c9ec5f 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c | |||
| @@ -269,6 +269,7 @@ void __init per_cpu_patch(void) | |||
| 269 | 269 | ||
| 270 | void __init sun4v_patch(void) | 270 | void __init sun4v_patch(void) |
| 271 | { | 271 | { |
| 272 | extern void sun4v_hvapi_init(void); | ||
| 272 | struct sun4v_1insn_patch_entry *p1; | 273 | struct sun4v_1insn_patch_entry *p1; |
| 273 | struct sun4v_2insn_patch_entry *p2; | 274 | struct sun4v_2insn_patch_entry *p2; |
| 274 | 275 | ||
| @@ -300,6 +301,8 @@ void __init sun4v_patch(void) | |||
| 300 | 301 | ||
| 301 | p2++; | 302 | p2++; |
| 302 | } | 303 | } |
| 304 | |||
| 305 | sun4v_hvapi_init(); | ||
| 303 | } | 306 | } |
| 304 | 307 | ||
| 305 | #ifdef CONFIG_SMP | 308 | #ifdef CONFIG_SMP |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 1ae443d7ab92..e00e1b913d28 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -173,7 +173,8 @@ enum { | |||
| 173 | 173 | ||
| 174 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 174 | AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
| 175 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 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 | struct ahci_cmd_hdr { | 180 | struct ahci_cmd_hdr { |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index ed4138e24b0c..02236739b40f 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
| @@ -321,7 +321,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length, | |||
| 321 | 321 | ||
| 322 | /* Don't continue if device has no _ADR method. | 322 | /* Don't continue if device has no _ADR method. |
| 323 | * _GTF is intended for known motherboard devices. */ | 323 | * _GTF is intended for known motherboard devices. */ |
| 324 | if (!(ap->cbl == ATA_CBL_SATA)) { | 324 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { |
| 325 | err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); | 325 | err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); |
| 326 | if (err < 0) { | 326 | if (err < 0) { |
| 327 | if (ata_msg_probe(ap)) | 327 | if (ata_msg_probe(ap)) |
| @@ -343,7 +343,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length, | |||
| 343 | 343 | ||
| 344 | /* Get this drive's _ADR info. if not already known. */ | 344 | /* Get this drive's _ADR info. if not already known. */ |
| 345 | if (!dev->obj_handle) { | 345 | if (!dev->obj_handle) { |
| 346 | if (!(ap->cbl == ATA_CBL_SATA)) { | 346 | if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { |
| 347 | /* get child objects of dev_handle == channel objects, | 347 | /* get child objects of dev_handle == channel objects, |
| 348 | * + _their_ children == drive objects */ | 348 | * + _their_ children == drive objects */ |
| 349 | /* channel is ap->port_no */ | 349 | /* channel is ap->port_no */ |
| @@ -528,7 +528,7 @@ static int do_drive_set_taskfiles(struct ata_device *dev, | |||
| 528 | ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", | 528 | ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
| 529 | __FUNCTION__, ap->port_no); | 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 | return 0; | 532 | return 0; |
| 533 | 533 | ||
| 534 | if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) | 534 | if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) |
| @@ -578,7 +578,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
| 578 | * we should not run GTF on PATA devices since some | 578 | * we should not run GTF on PATA devices since some |
| 579 | * PATA require execution of GTM/STM before GTF. | 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 | return 0; | 582 | return 0; |
| 583 | 583 | ||
| 584 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { | 584 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { |
| @@ -641,7 +641,7 @@ int ata_acpi_push_id(struct ata_device *dev) | |||
| 641 | __FUNCTION__, dev->devno, ap->port_no); | 641 | __FUNCTION__, dev->devno, ap->port_no); |
| 642 | 642 | ||
| 643 | /* Don't continue if not a SATA device. */ | 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 | if (ata_msg_probe(ap)) | 645 | if (ata_msg_probe(ap)) |
| 646 | ata_dev_printk(dev, KERN_DEBUG, | 646 | ata_dev_printk(dev, KERN_DEBUG, |
| 647 | "%s: Not a SATA device\n", __FUNCTION__); | 647 | "%s: Not a SATA device\n", __FUNCTION__); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4166407eb47c..d5939e659cbb 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -1919,7 +1919,6 @@ int ata_dev_configure(struct ata_device *dev) | |||
| 1919 | snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); | 1919 | snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); |
| 1920 | 1920 | ||
| 1921 | dev->n_sectors = ata_id_n_sectors(id); | 1921 | dev->n_sectors = ata_id_n_sectors(id); |
| 1922 | dev->n_sectors_boot = dev->n_sectors; | ||
| 1923 | 1922 | ||
| 1924 | /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ | 1923 | /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ |
| 1925 | ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, | 1924 | ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, |
| @@ -3632,7 +3631,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
| 3632 | const u16 *old_id = dev->id; | 3631 | const u16 *old_id = dev->id; |
| 3633 | unsigned char model[2][ATA_ID_PROD_LEN + 1]; | 3632 | unsigned char model[2][ATA_ID_PROD_LEN + 1]; |
| 3634 | unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; | 3633 | unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; |
| 3635 | u64 new_n_sectors; | ||
| 3636 | 3634 | ||
| 3637 | if (dev->class != new_class) { | 3635 | if (dev->class != new_class) { |
| 3638 | ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", | 3636 | ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", |
| @@ -3644,7 +3642,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
| 3644 | ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); | 3642 | ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); |
| 3645 | ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); | 3643 | ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); |
| 3646 | ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); | 3644 | ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); |
| 3647 | new_n_sectors = ata_id_n_sectors(new_id); | ||
| 3648 | 3645 | ||
| 3649 | if (strcmp(model[0], model[1])) { | 3646 | if (strcmp(model[0], model[1])) { |
| 3650 | ata_dev_printk(dev, KERN_INFO, "model number mismatch " | 3647 | ata_dev_printk(dev, KERN_INFO, "model number mismatch " |
| @@ -3658,25 +3655,12 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
| 3658 | return 0; | 3655 | return 0; |
| 3659 | } | 3656 | } |
| 3660 | 3657 | ||
| 3661 | if (dev->class == ATA_DEV_ATA && dev->n_sectors != new_n_sectors) { | ||
| 3662 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " | ||
| 3663 | "%llu != %llu\n", | ||
| 3664 | (unsigned long long)dev->n_sectors, | ||
| 3665 | (unsigned long long)new_n_sectors); | ||
| 3666 | /* Are we the boot time size - if so we appear to be the | ||
| 3667 | same disk at this point and our HPA got reapplied */ | ||
| 3668 | if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors | ||
| 3669 | && ata_id_hpa_enabled(new_id)) | ||
| 3670 | return 1; | ||
| 3671 | return 0; | ||
| 3672 | } | ||
| 3673 | |||
| 3674 | return 1; | 3658 | return 1; |
| 3675 | } | 3659 | } |
| 3676 | 3660 | ||
| 3677 | /** | 3661 | /** |
| 3678 | * ata_dev_revalidate - Revalidate ATA device | 3662 | * ata_dev_reread_id - Re-read IDENTIFY data |
| 3679 | * @dev: device to revalidate | 3663 | * @adev: target ATA device |
| 3680 | * @readid_flags: read ID flags | 3664 | * @readid_flags: read ID flags |
| 3681 | * | 3665 | * |
| 3682 | * Re-read IDENTIFY page and make sure @dev is still attached to | 3666 | * Re-read IDENTIFY page and make sure @dev is still attached to |
| @@ -3688,34 +3672,68 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class, | |||
| 3688 | * RETURNS: | 3672 | * RETURNS: |
| 3689 | * 0 on success, negative errno otherwise | 3673 | * 0 on success, negative errno otherwise |
| 3690 | */ | 3674 | */ |
| 3691 | int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) | 3675 | int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags) |
| 3692 | { | 3676 | { |
| 3693 | unsigned int class = dev->class; | 3677 | unsigned int class = dev->class; |
| 3694 | u16 *id = (void *)dev->ap->sector_buf; | 3678 | u16 *id = (void *)dev->ap->sector_buf; |
| 3695 | int rc; | 3679 | int rc; |
| 3696 | 3680 | ||
| 3697 | if (!ata_dev_enabled(dev)) { | ||
| 3698 | rc = -ENODEV; | ||
| 3699 | goto fail; | ||
| 3700 | } | ||
| 3701 | |||
| 3702 | /* read ID data */ | 3681 | /* read ID data */ |
| 3703 | rc = ata_dev_read_id(dev, &class, readid_flags, id); | 3682 | rc = ata_dev_read_id(dev, &class, readid_flags, id); |
| 3704 | if (rc) | 3683 | if (rc) |
| 3705 | goto fail; | 3684 | return rc; |
| 3706 | 3685 | ||
| 3707 | /* is the device still there? */ | 3686 | /* is the device still there? */ |
| 3708 | if (!ata_dev_same_device(dev, class, id)) { | 3687 | if (!ata_dev_same_device(dev, class, id)) |
| 3709 | rc = -ENODEV; | 3688 | return -ENODEV; |
| 3710 | goto fail; | ||
| 3711 | } | ||
| 3712 | 3689 | ||
| 3713 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); | 3690 | memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); |
| 3691 | return 0; | ||
| 3692 | } | ||
| 3693 | |||
| 3694 | /** | ||
| 3695 | * ata_dev_revalidate - Revalidate ATA device | ||
| 3696 | * @dev: device to revalidate | ||
| 3697 | * @readid_flags: read ID flags | ||
| 3698 | * | ||
| 3699 | * Re-read IDENTIFY page, make sure @dev is still attached to the | ||
| 3700 | * port and reconfigure it according to the new IDENTIFY page. | ||
| 3701 | * | ||
| 3702 | * LOCKING: | ||
| 3703 | * Kernel thread context (may sleep) | ||
| 3704 | * | ||
| 3705 | * RETURNS: | ||
| 3706 | * 0 on success, negative errno otherwise | ||
| 3707 | */ | ||
| 3708 | int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) | ||
| 3709 | { | ||
| 3710 | u64 n_sectors = dev->n_sectors; | ||
| 3711 | int rc; | ||
| 3712 | |||
| 3713 | if (!ata_dev_enabled(dev)) | ||
| 3714 | return -ENODEV; | ||
| 3715 | |||
| 3716 | /* re-read ID */ | ||
| 3717 | rc = ata_dev_reread_id(dev, readid_flags); | ||
| 3718 | if (rc) | ||
| 3719 | goto fail; | ||
| 3714 | 3720 | ||
| 3715 | /* configure device according to the new ID */ | 3721 | /* configure device according to the new ID */ |
| 3716 | rc = ata_dev_configure(dev); | 3722 | rc = ata_dev_configure(dev); |
| 3717 | if (rc == 0) | 3723 | if (rc) |
| 3718 | return 0; | 3724 | goto fail; |
| 3725 | |||
| 3726 | /* verify n_sectors hasn't changed */ | ||
| 3727 | if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) { | ||
| 3728 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " | ||
| 3729 | "%llu != %llu\n", | ||
| 3730 | (unsigned long long)n_sectors, | ||
| 3731 | (unsigned long long)dev->n_sectors); | ||
| 3732 | rc = -ENODEV; | ||
| 3733 | goto fail; | ||
| 3734 | } | ||
| 3735 | |||
| 3736 | return 0; | ||
| 3719 | 3737 | ||
| 3720 | fail: | 3738 | fail: |
| 3721 | ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); | 3739 | ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index dd81fa78cdcf..b6a1de8fad5b 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -893,6 +893,23 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) | |||
| 893 | return queue_depth; | 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 | * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command | 914 | * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command |
| 898 | * @qc: Storage for translated ATA taskfile | 915 | * @qc: Storage for translated ATA taskfile |
| @@ -950,21 +967,24 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) | |||
| 950 | * for more info. | 967 | * for more info. |
| 951 | */ | 968 | */ |
| 952 | if (ata_spindown_compat && | 969 | if (ata_spindown_compat && |
| 970 | (qc->dev->flags & ATA_DFLAG_SPUNDOWN) && | ||
| 953 | (system_state == SYSTEM_HALT || | 971 | (system_state == SYSTEM_HALT || |
| 954 | system_state == SYSTEM_POWER_OFF)) { | 972 | system_state == SYSTEM_POWER_OFF)) { |
| 955 | static int warned = 0; | 973 | static unsigned long warned = 0; |
| 956 | 974 | ||
| 957 | if (!warned) { | 975 | if (!test_and_set_bit(0, &warned)) { |
| 958 | spin_unlock_irq(qc->ap->lock); | ||
| 959 | ata_dev_printk(qc->dev, KERN_WARNING, | 976 | ata_dev_printk(qc->dev, KERN_WARNING, |
| 960 | "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " | 977 | "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " |
| 961 | "UPDATE SHUTDOWN UTILITY\n"); | 978 | "UPDATE SHUTDOWN UTILITY\n"); |
| 962 | ata_dev_printk(qc->dev, KERN_WARNING, | 979 | ata_dev_printk(qc->dev, KERN_WARNING, |
| 963 | "For more info, visit " | 980 | "For more info, visit " |
| 964 | "http://linux-ata.org/shutdown.html\n"); | 981 | "http://linux-ata.org/shutdown.html\n"); |
| 965 | warned = 1; | 982 | |
| 966 | ssleep(5); | 983 | /* ->scsi_done is not used, use it for |
| 967 | spin_lock_irq(qc->ap->lock); | 984 | * delayed completion. |
| 985 | */ | ||
| 986 | scmd->scsi_done = qc->scsidone; | ||
| 987 | qc->scsidone = ata_delayed_done; | ||
| 968 | } | 988 | } |
| 969 | scmd->result = SAM_STAT_GOOD; | 989 | scmd->result = SAM_STAT_GOOD; |
| 970 | return 1; | 990 | return 1; |
| @@ -1375,6 +1395,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
| 1375 | } | 1395 | } |
| 1376 | } | 1396 | } |
| 1377 | 1397 | ||
| 1398 | /* XXX: track spindown state for spindown_compat */ | ||
| 1399 | if (unlikely(qc->tf.command == ATA_CMD_STANDBY || | ||
| 1400 | qc->tf.command == ATA_CMD_STANDBYNOW1)) | ||
| 1401 | qc->dev->flags |= ATA_DFLAG_SPUNDOWN; | ||
| 1402 | else if (likely(system_state != SYSTEM_HALT && | ||
| 1403 | system_state != SYSTEM_POWER_OFF)) | ||
| 1404 | qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN; | ||
| 1405 | |||
| 1378 | if (need_sense && !ap->ops->error_handler) | 1406 | if (need_sense && !ap->ops->error_handler) |
| 1379 | ata_dump_status(ap->print_id, &qc->result_tf); | 1407 | ata_dump_status(ap->print_id, &qc->result_tf); |
| 1380 | 1408 | ||
| @@ -1488,14 +1516,14 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, | |||
| 1488 | 1516 | ||
| 1489 | early_finish: | 1517 | early_finish: |
| 1490 | ata_qc_free(qc); | 1518 | ata_qc_free(qc); |
| 1491 | done(cmd); | 1519 | qc->scsidone(cmd); |
| 1492 | DPRINTK("EXIT - early finish (good or error)\n"); | 1520 | DPRINTK("EXIT - early finish (good or error)\n"); |
| 1493 | return 0; | 1521 | return 0; |
| 1494 | 1522 | ||
| 1495 | err_did: | 1523 | err_did: |
| 1496 | ata_qc_free(qc); | 1524 | ata_qc_free(qc); |
| 1497 | cmd->result = (DID_ERROR << 16); | 1525 | cmd->result = (DID_ERROR << 16); |
| 1498 | done(cmd); | 1526 | qc->scsidone(cmd); |
| 1499 | err_mem: | 1527 | err_mem: |
| 1500 | DPRINTK("EXIT - internal\n"); | 1528 | DPRINTK("EXIT - internal\n"); |
| 1501 | return 0; | 1529 | return 0; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 8b71b73a199c..13cb0c9af68d 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
| @@ -76,7 +76,8 @@ extern unsigned ata_exec_internal_sg(struct ata_device *dev, | |||
| 76 | extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); | 76 | extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); |
| 77 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | 77 | extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, |
| 78 | unsigned int flags, u16 *id); | 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 | extern int ata_dev_configure(struct ata_device *dev); | 81 | extern int ata_dev_configure(struct ata_device *dev); |
| 81 | extern int sata_down_spd_limit(struct ata_port *ap); | 82 | extern int sata_down_spd_limit(struct ata_port *ap); |
| 82 | extern int sata_set_spd_needed(struct ata_port *ap); | 83 | extern int sata_set_spd_needed(struct ata_port *ap); |
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c index cca3aa225efe..844e53b280c7 100644 --- a/drivers/ata/pata_scc.c +++ b/drivers/ata/pata_scc.c | |||
| @@ -864,10 +864,10 @@ static void scc_bmdma_freeze (struct ata_port *ap) | |||
| 864 | * @ap: ATA port to be reset | 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 | ap->cbl = ATA_CBL_PATA80; | 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 | /** |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index a69d78cd8e9b..0cb6618935b1 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
| @@ -237,7 +237,8 @@ enum { | |||
| 237 | /* host flags */ | 237 | /* host flags */ |
| 238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 238 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
| 239 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 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 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ | 242 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ |
| 242 | 243 | ||
| 243 | IRQ_STAT_4PORTS = 0xf, | 244 | IRQ_STAT_4PORTS = 0xf, |
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 02c0d52c9f76..7bfbad57879d 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/ioport.h> | 51 | #include <linux/ioport.h> |
| 52 | #include <linux/kernel.h> | 52 | #include <linux/kernel.h> |
| 53 | #include <linux/slab.h> | 53 | #include <linux/slab.h> |
| 54 | #include <linux/dma-mapping.h> | ||
| 54 | #include <linux/pci.h> | 55 | #include <linux/pci.h> |
| 55 | #include <linux/pnp.h> | 56 | #include <linux/pnp.h> |
| 56 | #include <linux/platform_device.h> | 57 | #include <linux/platform_device.h> |
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index c3a6bd2e7950..96557e6dba60 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* sunhv.c: Serial driver for SUN4V hypervisor console. | 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 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| @@ -35,57 +35,51 @@ | |||
| 35 | #define CON_BREAK ((long)-1) | 35 | #define CON_BREAK ((long)-1) |
| 36 | #define CON_HUP ((long)-2) | 36 | #define CON_HUP ((long)-2) |
| 37 | 37 | ||
| 38 | static inline long hypervisor_con_getchar(long *status) | 38 | #define IGNORE_BREAK 0x1 |
| 39 | { | 39 | #define IGNORE_ALL 0x2 |
| 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 | 40 | ||
| 52 | *status = arg0; | 41 | static char *con_write_page; |
| 42 | static char *con_read_page; | ||
| 53 | 43 | ||
| 54 | return (long) arg1; | 44 | static int hung_up = 0; |
| 55 | } | ||
| 56 | 45 | ||
| 57 | static inline long hypervisor_con_putchar(long ch) | 46 | static void transmit_chars_putchar(struct uart_port *port, struct circ_buf *xmit) |
| 58 | { | 47 | { |
| 59 | register unsigned long func asm("%o5"); | 48 | while (!uart_circ_empty(xmit)) { |
| 60 | register unsigned long arg0 asm("%o0"); | 49 | long status = sun4v_con_putchar(xmit->buf[xmit->tail]); |
| 61 | 50 | ||
| 62 | func = HV_FAST_CONS_PUTCHAR; | 51 | if (status != HV_EOK) |
| 63 | arg0 = ch; | 52 | break; |
| 64 | __asm__ __volatile__("ta %4" | ||
| 65 | : "=&r" (func), "=&r" (arg0) | ||
| 66 | : "0" (func), "1" (arg0), "i" (HV_FAST_TRAP)); | ||
| 67 | 53 | ||
| 68 | return (long) arg0; | 54 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
| 55 | port->icount.tx++; | ||
| 56 | } | ||
| 69 | } | 57 | } |
| 70 | 58 | ||
| 71 | #define IGNORE_BREAK 0x1 | 59 | static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit) |
| 72 | #define IGNORE_ALL 0x2 | 60 | { |
| 61 | while (!uart_circ_empty(xmit)) { | ||
| 62 | unsigned long ra = __pa(xmit->buf + xmit->tail); | ||
| 63 | unsigned long len, status, sent; | ||
| 73 | 64 | ||
| 74 | static int hung_up = 0; | 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 | } | ||
| 75 | 74 | ||
| 76 | static struct tty_struct *receive_chars(struct uart_port *port) | 75 | static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty) |
| 77 | { | 76 | { |
| 78 | struct tty_struct *tty = NULL; | ||
| 79 | int saw_console_brk = 0; | 77 | int saw_console_brk = 0; |
| 80 | int limit = 10000; | 78 | int limit = 10000; |
| 81 | 79 | ||
| 82 | if (port->info != NULL) /* Unopened serial console */ | ||
| 83 | tty = port->info->tty; | ||
| 84 | |||
| 85 | while (limit-- > 0) { | 80 | while (limit-- > 0) { |
| 86 | long status; | 81 | long status; |
| 87 | long c = hypervisor_con_getchar(&status); | 82 | long c = sun4v_con_getchar(&status); |
| 88 | unsigned char flag; | ||
| 89 | 83 | ||
| 90 | if (status == HV_EWOULDBLOCK) | 84 | if (status == HV_EWOULDBLOCK) |
| 91 | break; | 85 | break; |
| @@ -110,27 +104,90 @@ static struct tty_struct *receive_chars(struct uart_port *port) | |||
| 110 | continue; | 104 | continue; |
| 111 | } | 105 | } |
| 112 | 106 | ||
| 113 | flag = TTY_NORMAL; | ||
| 114 | port->icount.rx++; | 107 | port->icount.rx++; |
| 115 | if (c == CON_BREAK) { | ||
| 116 | port->icount.brk++; | ||
| 117 | if (uart_handle_break(port)) | ||
| 118 | continue; | ||
| 119 | flag = TTY_BREAK; | ||
| 120 | } | ||
| 121 | 108 | ||
| 122 | if (uart_handle_sysrq_char(port, c)) | 109 | if (uart_handle_sysrq_char(port, c)) |
| 123 | continue; | 110 | continue; |
| 124 | 111 | ||
| 125 | if ((port->ignore_status_mask & IGNORE_ALL) || | 112 | tty_insert_flip_char(tty, c, TTY_NORMAL); |
| 126 | ((port->ignore_status_mask & IGNORE_BREAK) && | 113 | } |
| 127 | (c == CON_BREAK))) | 114 | |
| 115 | return saw_console_brk; | ||
| 116 | } | ||
| 117 | |||
| 118 | static int receive_chars_read(struct uart_port *port, struct tty_struct *tty) | ||
| 119 | { | ||
| 120 | int saw_console_brk = 0; | ||
| 121 | int limit = 10000; | ||
| 122 | |||
| 123 | while (limit-- > 0) { | ||
| 124 | unsigned long ra = __pa(con_read_page); | ||
| 125 | unsigned long bytes_read, i; | ||
| 126 | long stat = sun4v_con_read(ra, PAGE_SIZE, &bytes_read); | ||
| 127 | |||
| 128 | if (stat != HV_EOK) { | ||
| 129 | bytes_read = 0; | ||
| 130 | |||
| 131 | if (stat == CON_BREAK) { | ||
| 132 | if (uart_handle_break(port)) | ||
| 133 | continue; | ||
| 134 | saw_console_brk = 1; | ||
| 135 | *con_read_page = 0; | ||
| 136 | bytes_read = 1; | ||
| 137 | } else if (stat == CON_HUP) { | ||
| 138 | hung_up = 1; | ||
| 139 | uart_handle_dcd_change(port, 0); | ||
| 140 | continue; | ||
| 141 | } else { | ||
| 142 | /* HV_EWOULDBLOCK, etc. */ | ||
| 143 | break; | ||
| 144 | } | ||
| 145 | } | ||
| 146 | |||
| 147 | if (hung_up) { | ||
| 148 | hung_up = 0; | ||
| 149 | uart_handle_dcd_change(port, 1); | ||
| 150 | } | ||
| 151 | |||
| 152 | for (i = 0; i < bytes_read; i++) | ||
| 153 | uart_handle_sysrq_char(port, con_read_page[i]); | ||
| 154 | |||
| 155 | if (tty == NULL) | ||
| 128 | continue; | 156 | continue; |
| 129 | 157 | ||
| 130 | tty_insert_flip_char(tty, c, flag); | 158 | port->icount.rx += bytes_read; |
| 159 | |||
| 160 | tty_insert_flip_string(tty, con_read_page, bytes_read); | ||
| 131 | } | 161 | } |
| 132 | 162 | ||
| 133 | if (saw_console_brk) | 163 | return saw_console_brk; |
| 164 | } | ||
| 165 | |||
| 166 | struct sunhv_ops { | ||
| 167 | void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit); | ||
| 168 | int (*receive_chars)(struct uart_port *port, struct tty_struct *tty); | ||
| 169 | }; | ||
| 170 | |||
| 171 | static struct sunhv_ops bychar_ops = { | ||
| 172 | .transmit_chars = transmit_chars_putchar, | ||
| 173 | .receive_chars = receive_chars_getchar, | ||
| 174 | }; | ||
| 175 | |||
| 176 | static struct sunhv_ops bywrite_ops = { | ||
| 177 | .transmit_chars = transmit_chars_write, | ||
| 178 | .receive_chars = receive_chars_read, | ||
| 179 | }; | ||
| 180 | |||
| 181 | static struct sunhv_ops *sunhv_ops = &bychar_ops; | ||
| 182 | |||
| 183 | static struct tty_struct *receive_chars(struct uart_port *port) | ||
| 184 | { | ||
| 185 | struct tty_struct *tty = NULL; | ||
| 186 | |||
| 187 | if (port->info != NULL) /* Unopened serial console */ | ||
| 188 | tty = port->info->tty; | ||
| 189 | |||
| 190 | if (sunhv_ops->receive_chars(port, tty)) | ||
| 134 | sun_do_break(); | 191 | sun_do_break(); |
| 135 | 192 | ||
| 136 | return tty; | 193 | return tty; |
| @@ -147,15 +204,7 @@ static void transmit_chars(struct uart_port *port) | |||
| 147 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) | 204 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) |
| 148 | return; | 205 | return; |
| 149 | 206 | ||
| 150 | while (!uart_circ_empty(xmit)) { | 207 | sunhv_ops->transmit_chars(port, xmit); |
| 151 | long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); | ||
| 152 | |||
| 153 | if (status != HV_EOK) | ||
| 154 | break; | ||
| 155 | |||
| 156 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | ||
| 157 | port->icount.tx++; | ||
| 158 | } | ||
| 159 | 208 | ||
| 160 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 209 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
| 161 | uart_write_wakeup(port); | 210 | uart_write_wakeup(port); |
| @@ -212,7 +261,7 @@ static void sunhv_start_tx(struct uart_port *port) | |||
| 212 | struct circ_buf *xmit = &port->info->xmit; | 261 | struct circ_buf *xmit = &port->info->xmit; |
| 213 | 262 | ||
| 214 | while (!uart_circ_empty(xmit)) { | 263 | while (!uart_circ_empty(xmit)) { |
| 215 | long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); | 264 | long status = sun4v_con_putchar(xmit->buf[xmit->tail]); |
| 216 | 265 | ||
| 217 | if (status != HV_EOK) | 266 | if (status != HV_EOK) |
| 218 | break; | 267 | break; |
| @@ -231,9 +280,10 @@ static void sunhv_send_xchar(struct uart_port *port, char ch) | |||
| 231 | spin_lock_irqsave(&port->lock, flags); | 280 | spin_lock_irqsave(&port->lock, flags); |
| 232 | 281 | ||
| 233 | while (limit-- > 0) { | 282 | while (limit-- > 0) { |
| 234 | long status = hypervisor_con_putchar(ch); | 283 | long status = sun4v_con_putchar(ch); |
| 235 | if (status == HV_EOK) | 284 | if (status == HV_EOK) |
| 236 | break; | 285 | break; |
| 286 | udelay(1); | ||
| 237 | } | 287 | } |
| 238 | 288 | ||
| 239 | spin_unlock_irqrestore(&port->lock, flags); | 289 | spin_unlock_irqrestore(&port->lock, flags); |
| @@ -254,15 +304,15 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state) | |||
| 254 | { | 304 | { |
| 255 | if (break_state) { | 305 | if (break_state) { |
| 256 | unsigned long flags; | 306 | unsigned long flags; |
| 257 | int limit = 1000000; | 307 | int limit = 10000; |
| 258 | 308 | ||
| 259 | spin_lock_irqsave(&port->lock, flags); | 309 | spin_lock_irqsave(&port->lock, flags); |
| 260 | 310 | ||
| 261 | while (limit-- > 0) { | 311 | while (limit-- > 0) { |
| 262 | long status = hypervisor_con_putchar(CON_BREAK); | 312 | long status = sun4v_con_putchar(CON_BREAK); |
| 263 | if (status == HV_EOK) | 313 | if (status == HV_EOK) |
| 264 | break; | 314 | break; |
| 265 | udelay(2); | 315 | udelay(1); |
| 266 | } | 316 | } |
| 267 | 317 | ||
| 268 | spin_unlock_irqrestore(&port->lock, flags); | 318 | spin_unlock_irqrestore(&port->lock, flags); |
| @@ -359,38 +409,99 @@ static struct uart_driver sunhv_reg = { | |||
| 359 | 409 | ||
| 360 | static struct uart_port *sunhv_port; | 410 | static struct uart_port *sunhv_port; |
| 361 | 411 | ||
| 362 | static inline void sunhv_console_putchar(struct uart_port *port, char c) | 412 | /* Copy 's' into the con_write_page, decoding "\n" into |
| 413 | * "\r\n" along the way. We have to return two lengths | ||
| 414 | * because the caller needs to know how much to advance | ||
| 415 | * 's' and also how many bytes to output via con_write_page. | ||
| 416 | */ | ||
| 417 | static int fill_con_write_page(const char *s, unsigned int n, | ||
| 418 | unsigned long *page_bytes) | ||
| 419 | { | ||
| 420 | const char *orig_s = s; | ||
| 421 | char *p = con_write_page; | ||
| 422 | int left = PAGE_SIZE; | ||
| 423 | |||
| 424 | while (n--) { | ||
| 425 | if (*s == '\n') { | ||
| 426 | if (left < 2) | ||
| 427 | break; | ||
| 428 | *p++ = '\r'; | ||
| 429 | left--; | ||
| 430 | } else if (left < 1) | ||
| 431 | break; | ||
| 432 | *p++ = *s++; | ||
| 433 | left--; | ||
| 434 | } | ||
| 435 | *page_bytes = p - con_write_page; | ||
| 436 | return s - orig_s; | ||
| 437 | } | ||
| 438 | |||
| 439 | static void sunhv_console_write_paged(struct console *con, const char *s, unsigned n) | ||
| 363 | { | 440 | { |
| 441 | struct uart_port *port = sunhv_port; | ||
| 364 | unsigned long flags; | 442 | unsigned long flags; |
| 365 | int limit = 1000000; | ||
| 366 | 443 | ||
| 367 | spin_lock_irqsave(&port->lock, flags); | 444 | spin_lock_irqsave(&port->lock, flags); |
| 445 | while (n > 0) { | ||
| 446 | unsigned long ra = __pa(con_write_page); | ||
| 447 | unsigned long page_bytes; | ||
| 448 | unsigned int cpy = fill_con_write_page(s, n, | ||
| 449 | &page_bytes); | ||
| 450 | |||
| 451 | n -= cpy; | ||
| 452 | s += cpy; | ||
| 453 | while (page_bytes > 0) { | ||
| 454 | unsigned long written; | ||
| 455 | int limit = 1000000; | ||
| 456 | |||
| 457 | while (limit--) { | ||
| 458 | unsigned long stat; | ||
| 459 | |||
| 460 | stat = sun4v_con_write(ra, page_bytes, | ||
| 461 | &written); | ||
| 462 | if (stat == HV_EOK) | ||
| 463 | break; | ||
| 464 | udelay(1); | ||
| 465 | } | ||
| 466 | if (limit <= 0) | ||
| 467 | break; | ||
| 468 | page_bytes -= written; | ||
| 469 | ra += written; | ||
| 470 | } | ||
| 471 | } | ||
| 472 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 473 | } | ||
| 474 | |||
| 475 | static inline void sunhv_console_putchar(struct uart_port *port, char c) | ||
| 476 | { | ||
| 477 | int limit = 1000000; | ||
| 368 | 478 | ||
| 369 | while (limit-- > 0) { | 479 | while (limit-- > 0) { |
| 370 | long status = hypervisor_con_putchar(c); | 480 | long status = sun4v_con_putchar(c); |
| 371 | if (status == HV_EOK) | 481 | if (status == HV_EOK) |
| 372 | break; | 482 | break; |
| 373 | udelay(2); | 483 | udelay(1); |
| 374 | } | 484 | } |
| 375 | |||
| 376 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 377 | } | 485 | } |
| 378 | 486 | ||
| 379 | static void sunhv_console_write(struct console *con, const char *s, unsigned n) | 487 | static void sunhv_console_write_bychar(struct console *con, const char *s, unsigned n) |
| 380 | { | 488 | { |
| 381 | struct uart_port *port = sunhv_port; | 489 | struct uart_port *port = sunhv_port; |
| 490 | unsigned long flags; | ||
| 382 | int i; | 491 | int i; |
| 383 | 492 | ||
| 493 | spin_lock_irqsave(&port->lock, flags); | ||
| 384 | for (i = 0; i < n; i++) { | 494 | for (i = 0; i < n; i++) { |
| 385 | if (*s == '\n') | 495 | if (*s == '\n') |
| 386 | sunhv_console_putchar(port, '\r'); | 496 | sunhv_console_putchar(port, '\r'); |
| 387 | sunhv_console_putchar(port, *s++); | 497 | sunhv_console_putchar(port, *s++); |
| 388 | } | 498 | } |
| 499 | spin_unlock_irqrestore(&port->lock, flags); | ||
| 389 | } | 500 | } |
| 390 | 501 | ||
| 391 | static struct console sunhv_console = { | 502 | static struct console sunhv_console = { |
| 392 | .name = "ttyHV", | 503 | .name = "ttyHV", |
| 393 | .write = sunhv_console_write, | 504 | .write = sunhv_console_write_bychar, |
| 394 | .device = uart_console_device, | 505 | .device = uart_console_device, |
| 395 | .flags = CON_PRINTBUFFER, | 506 | .flags = CON_PRINTBUFFER, |
| 396 | .index = -1, | 507 | .index = -1, |
| @@ -410,6 +521,7 @@ static inline struct console *SUNHV_CONSOLE(void) | |||
| 410 | static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) | 521 | static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) |
| 411 | { | 522 | { |
| 412 | struct uart_port *port; | 523 | struct uart_port *port; |
| 524 | unsigned long minor; | ||
| 413 | int err; | 525 | int err; |
| 414 | 526 | ||
| 415 | if (op->irqs[0] == 0xffffffff) | 527 | if (op->irqs[0] == 0xffffffff) |
| @@ -419,6 +531,22 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m | |||
| 419 | if (unlikely(!port)) | 531 | if (unlikely(!port)) |
| 420 | return -ENOMEM; | 532 | return -ENOMEM; |
| 421 | 533 | ||
| 534 | minor = 1; | ||
| 535 | if (sun4v_hvapi_register(HV_GRP_CORE, 1, &minor) == 0 && | ||
| 536 | minor >= 1) { | ||
| 537 | err = -ENOMEM; | ||
| 538 | con_write_page = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
| 539 | if (!con_write_page) | ||
| 540 | goto out_free_port; | ||
| 541 | |||
| 542 | con_read_page = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
| 543 | if (!con_read_page) | ||
| 544 | goto out_free_con_write_page; | ||
| 545 | |||
| 546 | sunhv_console.write = sunhv_console_write_paged; | ||
| 547 | sunhv_ops = &bywrite_ops; | ||
| 548 | } | ||
| 549 | |||
| 422 | sunhv_port = port; | 550 | sunhv_port = port; |
| 423 | 551 | ||
| 424 | port->line = 0; | 552 | port->line = 0; |
| @@ -437,7 +565,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m | |||
| 437 | 565 | ||
| 438 | err = uart_register_driver(&sunhv_reg); | 566 | err = uart_register_driver(&sunhv_reg); |
| 439 | if (err) | 567 | if (err) |
| 440 | goto out_free_port; | 568 | goto out_free_con_read_page; |
| 441 | 569 | ||
| 442 | sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; | 570 | sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; |
| 443 | sunserial_current_minor += 1; | 571 | sunserial_current_minor += 1; |
| @@ -463,6 +591,12 @@ out_unregister_driver: | |||
| 463 | sunserial_current_minor -= 1; | 591 | sunserial_current_minor -= 1; |
| 464 | uart_unregister_driver(&sunhv_reg); | 592 | uart_unregister_driver(&sunhv_reg); |
| 465 | 593 | ||
| 594 | out_free_con_read_page: | ||
| 595 | kfree(con_read_page); | ||
| 596 | |||
| 597 | out_free_con_write_page: | ||
| 598 | kfree(con_write_page); | ||
| 599 | |||
| 466 | out_free_port: | 600 | out_free_port: |
| 467 | kfree(port); | 601 | kfree(port); |
| 468 | sunhv_port = NULL; | 602 | sunhv_port = NULL; |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index c0a6dce800a3..225d6b2f82dd 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
| @@ -484,7 +484,7 @@ static int spidev_probe(struct spi_device *spi) | |||
| 484 | * Reusing minors is fine so long as udev or mdev is working. | 484 | * Reusing minors is fine so long as udev or mdev is working. |
| 485 | */ | 485 | */ |
| 486 | mutex_lock(&device_list_lock); | 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 | if (minor < N_SPI_MINORS) { | 488 | if (minor < N_SPI_MINORS) { |
| 489 | spidev->dev.parent = &spi->dev; | 489 | spidev->dev.parent = &spi->dev; |
| 490 | spidev->dev.class = &spidev_class; | 490 | spidev->dev.class = &spidev_class; |
diff --git a/fs/afs/super.c b/fs/afs/super.c index 579af632c8e8..370cecc910db 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c | |||
| @@ -47,7 +47,6 @@ struct file_system_type afs_fs_type = { | |||
| 47 | static const struct super_operations afs_super_ops = { | 47 | static const struct super_operations afs_super_ops = { |
| 48 | .statfs = afs_statfs, | 48 | .statfs = afs_statfs, |
| 49 | .alloc_inode = afs_alloc_inode, | 49 | .alloc_inode = afs_alloc_inode, |
| 50 | .drop_inode = generic_delete_inode, | ||
| 51 | .write_inode = afs_write_inode, | 50 | .write_inode = afs_write_inode, |
| 52 | .destroy_inode = afs_destroy_inode, | 51 | .destroy_inode = afs_destroy_inode, |
| 53 | .clear_inode = afs_clear_inode, | 52 | .clear_inode = afs_clear_inode, |
diff --git a/fs/afs/write.c b/fs/afs/write.c index 28f37516c126..a03b92a0fe1d 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c | |||
| @@ -206,7 +206,6 @@ int afs_prepare_write(struct file *file, struct page *page, | |||
| 206 | _leave(" = %d [prep]", ret); | 206 | _leave(" = %d [prep]", ret); |
| 207 | return ret; | 207 | return ret; |
| 208 | } | 208 | } |
| 209 | SetPageUptodate(page); | ||
| 210 | } | 209 | } |
| 211 | 210 | ||
| 212 | try_again: | 211 | try_again: |
| @@ -311,8 +310,8 @@ int afs_commit_write(struct file *file, struct page *page, | |||
| 311 | spin_unlock(&vnode->writeback_lock); | 310 | spin_unlock(&vnode->writeback_lock); |
| 312 | } | 311 | } |
| 313 | 312 | ||
| 313 | SetPageUptodate(page); | ||
| 314 | set_page_dirty(page); | 314 | set_page_dirty(page); |
| 315 | |||
| 316 | if (PageDirty(page)) | 315 | if (PageDirty(page)) |
| 317 | _debug("dirtied"); | 316 | _debug("dirtied"); |
| 318 | 317 | ||
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index 1a7b07d436ff..9fd2e32f84b8 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
| @@ -30,11 +30,9 @@ struct spi_board_info; | |||
| 30 | struct platform_device * | 30 | struct platform_device * |
| 31 | at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); | 31 | at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); |
| 32 | 32 | ||
| 33 | struct lcdc_platform_data { | 33 | struct atmel_lcdfb_info; |
| 34 | unsigned long fbmem_start; | ||
| 35 | unsigned long fbmem_size; | ||
| 36 | }; | ||
| 37 | struct platform_device * | 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 | #endif /* __ASM_ARCH_BOARD_H */ | 38 | #endif /* __ASM_ARCH_BOARD_H */ |
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h index de419278fc39..7f54e2b15d13 100644 --- a/include/asm-avr32/kdebug.h +++ b/include/asm-avr32/kdebug.h | |||
| @@ -5,13 +5,22 @@ | |||
| 5 | 5 | ||
| 6 | /* Grossly misnamed. */ | 6 | /* Grossly misnamed. */ |
| 7 | enum die_val { | 7 | enum die_val { |
| 8 | DIE_FAULT, | ||
| 9 | DIE_BREAKPOINT, | 8 | DIE_BREAKPOINT, |
| 10 | DIE_SSTEP, | 9 | DIE_SSTEP, |
| 11 | DIE_PAGE_FAULT, | ||
| 12 | }; | 10 | }; |
| 13 | 11 | ||
| 14 | int register_page_fault_notifier(struct notifier_block *nb); | 12 | /* |
| 15 | int unregister_page_fault_notifier(struct notifier_block *nb); | 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 | #endif /* __ASM_AVR32_KDEBUG_H */ | 26 | #endif /* __ASM_AVR32_KDEBUG_H */ |
diff --git a/include/asm-avr32/kprobes.h b/include/asm-avr32/kprobes.h index 09a5cbe2f896..190a6377c809 100644 --- a/include/asm-avr32/kprobes.h +++ b/include/asm-avr32/kprobes.h | |||
| @@ -26,6 +26,7 @@ struct arch_specific_insn { | |||
| 26 | kprobe_opcode_t insn[MAX_INSN_SIZE]; | 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 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 30 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
| 30 | unsigned long val, void *data); | 31 | unsigned long val, void *data); |
| 31 | 32 | ||
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index 2418cce624cc..3b4e35b55c82 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h | |||
| @@ -296,9 +296,12 @@ | |||
| 296 | #define __NR_shmctl 277 | 296 | #define __NR_shmctl 277 |
| 297 | 297 | ||
| 298 | #define __NR_utimensat 278 | 298 | #define __NR_utimensat 278 |
| 299 | #define __NR_signalfd 279 | ||
| 300 | #define __NR_timerfd 280 | ||
| 301 | #define __NR_eventfd 281 | ||
| 299 | 302 | ||
| 300 | #ifdef __KERNEL__ | 303 | #ifdef __KERNEL__ |
| 301 | #define NR_syscalls 279 | 304 | #define NR_syscalls 282 |
| 302 | 305 | ||
| 303 | 306 | ||
| 304 | #define __ARCH_WANT_IPC_PARSE_VERSION | 307 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index ba211e011a1d..320cd8e754ea 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h | |||
| @@ -28,14 +28,24 @@ | |||
| 28 | */ | 28 | */ |
| 29 | #include <linux/notifier.h> | 29 | #include <linux/notifier.h> |
| 30 | 30 | ||
| 31 | extern int register_page_fault_notifier(struct notifier_block *); | 31 | /* |
| 32 | extern int unregister_page_fault_notifier(struct notifier_block *); | 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 | enum die_val { | 45 | enum die_val { |
| 35 | DIE_BREAK = 1, | 46 | DIE_BREAK = 1, |
| 36 | DIE_FAULT, | 47 | DIE_FAULT, |
| 37 | DIE_OOPS, | 48 | DIE_OOPS, |
| 38 | DIE_PAGE_FAULT, | ||
| 39 | DIE_MACHINE_HALT, | 49 | DIE_MACHINE_HALT, |
| 40 | DIE_MACHINE_RESTART, | 50 | DIE_MACHINE_RESTART, |
| 41 | DIE_MCA_MONARCH_ENTER, | 51 | DIE_MCA_MONARCH_ENTER, |
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 2abc98b336f3..6382e52ec227 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
| @@ -120,6 +120,7 @@ struct arch_specific_insn { | |||
| 120 | unsigned short slot; | 120 | unsigned short slot; |
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr); | ||
| 123 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 124 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
| 124 | unsigned long val, void *data); | 125 | unsigned long val, void *data); |
| 125 | 126 | ||
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index f049bc40ca7d..d7781a2ddefe 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
| @@ -296,11 +296,14 @@ | |||
| 296 | #define __NR_getcpu 1304 | 296 | #define __NR_getcpu 1304 |
| 297 | #define __NR_epoll_pwait 1305 | 297 | #define __NR_epoll_pwait 1305 |
| 298 | #define __NR_utimensat 1306 | 298 | #define __NR_utimensat 1306 |
| 299 | #define __NR_signalfd 1307 | ||
| 300 | #define __NR_timerfd 1308 | ||
| 301 | #define __NR_eventfd 1309 | ||
| 299 | 302 | ||
| 300 | #ifdef __KERNEL__ | 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 | #define __ARCH_WANT_SYS_RT_SIGACTION | 308 | #define __ARCH_WANT_SYS_RT_SIGACTION |
| 306 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 309 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h index 612bf319753f..a5558c87556d 100644 --- a/include/asm-sparc64/hypervisor.h +++ b/include/asm-sparc64/hypervisor.h | |||
| @@ -940,6 +940,54 @@ struct hv_fault_status { | |||
| 940 | */ | 940 | */ |
| 941 | #define HV_FAST_CONS_PUTCHAR 0x61 | 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 | /* Trap trace services. | 991 | /* Trap trace services. |
| 944 | * | 992 | * |
| 945 | * The hypervisor provides a trap tracing capability for privileged | 993 | * The hypervisor provides a trap tracing capability for privileged |
| @@ -2121,8 +2169,41 @@ struct hv_mmu_statistics { | |||
| 2121 | #define HV_FAST_MMUSTAT_INFO 0x103 | 2169 | #define HV_FAST_MMUSTAT_INFO 0x103 |
| 2122 | 2170 | ||
| 2123 | /* Function numbers for HV_CORE_TRAP. */ | 2171 | /* Function numbers for HV_CORE_TRAP. */ |
| 2124 | #define HV_CORE_VER 0x00 | 2172 | #define HV_CORE_SET_VER 0x00 |
| 2125 | #define HV_CORE_PUTCHAR 0x01 | 2173 | #define HV_CORE_PUTCHAR 0x01 |
| 2126 | #define HV_CORE_EXIT 0x02 | 2174 | #define HV_CORE_EXIT 0x02 |
| 2175 | #define HV_CORE_GET_VER 0x03 | ||
| 2176 | |||
| 2177 | /* Hypervisor API groups for use with HV_CORE_SET_VER and | ||
| 2178 | * HV_CORE_GET_VER. | ||
| 2179 | */ | ||
| 2180 | #define HV_GRP_SUN4V 0x0000 | ||
| 2181 | #define HV_GRP_CORE 0x0001 | ||
| 2182 | #define HV_GRP_INTR 0x0002 | ||
| 2183 | #define HV_GRP_SOFT_STATE 0x0003 | ||
| 2184 | #define HV_GRP_PCI 0x0100 | ||
| 2185 | #define HV_GRP_LDOM 0x0101 | ||
| 2186 | #define HV_GRP_SVC_CHAN 0x0102 | ||
| 2187 | #define HV_GRP_NCS 0x0103 | ||
| 2188 | #define HV_GRP_NIAG_PERF 0x0200 | ||
| 2189 | #define HV_GRP_FIRE_PERF 0x0201 | ||
| 2190 | #define HV_GRP_DIAG 0x0300 | ||
| 2191 | |||
| 2192 | #ifndef __ASSEMBLY__ | ||
| 2193 | extern unsigned long sun4v_get_version(unsigned long group, | ||
| 2194 | unsigned long *major, | ||
| 2195 | unsigned long *minor); | ||
| 2196 | extern unsigned long sun4v_set_version(unsigned long group, | ||
| 2197 | unsigned long major, | ||
| 2198 | unsigned long minor, | ||
| 2199 | unsigned long *actual_minor); | ||
| 2200 | |||
| 2201 | extern int sun4v_hvapi_register(unsigned long group, unsigned long major, | ||
| 2202 | unsigned long *minor); | ||
| 2203 | extern void sun4v_hvapi_unregister(unsigned long group); | ||
| 2204 | extern int sun4v_hvapi_get(unsigned long group, | ||
| 2205 | unsigned long *major, | ||
| 2206 | unsigned long *minor); | ||
| 2207 | #endif | ||
| 2127 | 2208 | ||
| 2128 | #endif /* !(_SPARC64_HYPERVISOR_H) */ | 2209 | #endif /* !(_SPARC64_HYPERVISOR_H) */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 27d936279574..666592ef0b25 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -140,6 +140,7 @@ enum { | |||
| 140 | 140 | ||
| 141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
| 142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ | 142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ |
| 143 | ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */ | ||
| 143 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 144 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
| 144 | 145 | ||
| 145 | ATA_DFLAG_DETACH = (1 << 16), | 146 | ATA_DFLAG_DETACH = (1 << 16), |
| @@ -173,6 +174,7 @@ enum { | |||
| 173 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ | 174 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ |
| 174 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ | 175 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ |
| 175 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ | 176 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ |
| 177 | ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ | ||
| 176 | 178 | ||
| 177 | /* The following flag belongs to ap->pflags but is kept in | 179 | /* The following flag belongs to ap->pflags but is kept in |
| 178 | * ap->flags because it's referenced in many LLDs and will be | 180 | * ap->flags because it's referenced in many LLDs and will be |
| @@ -431,7 +433,6 @@ struct ata_device { | |||
| 431 | struct scsi_device *sdev; /* attached SCSI device */ | 433 | struct scsi_device *sdev; /* attached SCSI device */ |
| 432 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 434 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
| 433 | u64 n_sectors; /* size of device, if ATA */ | 435 | u64 n_sectors; /* size of device, if ATA */ |
| 434 | u64 n_sectors_boot; /* size of ATA device at startup */ | ||
| 435 | unsigned int class; /* ATA_DEV_xxx */ | 436 | unsigned int class; /* ATA_DEV_xxx */ |
| 436 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 437 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ |
| 437 | u8 pio_mode; | 438 | u8 pio_mode; |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index fd6627e2d115..c6c1f4a120e3 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -88,7 +88,7 @@ static inline int kmalloc_index(int size) | |||
| 88 | */ | 88 | */ |
| 89 | WARN_ON_ONCE(size == 0); | 89 | WARN_ON_ONCE(size == 0); |
| 90 | 90 | ||
| 91 | if (size >= (1 << KMALLOC_SHIFT_HIGH)) | 91 | if (size > (1 << KMALLOC_SHIFT_HIGH)) |
| 92 | return -1; | 92 | return -1; |
| 93 | 93 | ||
| 94 | if (size > 64 && size <= 96) | 94 | if (size > 64 && size <= 96) |
diff --git a/include/sound/soc.h b/include/sound/soc.h index b1dc364b8f74..db6edba8ef08 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <sound/control.h> | 22 | #include <sound/control.h> |
| 23 | #include <sound/ac97_codec.h> | 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 | * Convenience kcontrol builders | 28 | * Convenience kcontrol builders |
| @@ -83,6 +83,7 @@ | |||
| 83 | #define SND_SOC_DAI_AC97 0x1 | 83 | #define SND_SOC_DAI_AC97 0x1 |
| 84 | #define SND_SOC_DAI_I2S 0x2 | 84 | #define SND_SOC_DAI_I2S 0x2 |
| 85 | #define SND_SOC_DAI_PCM 0x4 | 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 | * DAI hardware audio formats | 89 | * DAI hardware audio formats |
| @@ -278,6 +279,7 @@ struct snd_soc_cpu_ops { | |||
| 278 | struct snd_soc_codec_dai { | 279 | struct snd_soc_codec_dai { |
| 279 | char *name; | 280 | char *name; |
| 280 | int id; | 281 | int id; |
| 282 | unsigned char type; | ||
| 281 | 283 | ||
| 282 | /* DAI capabilities */ | 284 | /* DAI capabilities */ |
| 283 | struct snd_soc_pcm_stream playback; | 285 | struct snd_soc_pcm_stream playback; |
diff --git a/include/sound/version.h b/include/sound/version.h index e820f0e7bdd3..50ee4fd420fa 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h. Generated by alsa/ksync script. */ | 1 | /* include/version.h. Generated by alsa/ksync script. */ |
| 2 | #define CONFIG_SND_VERSION "1.0.14rc4" | 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)" |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 40d56a31245e..b98b80ccf437 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -97,25 +97,26 @@ static int suspend_prepare(suspend_state_t state) | |||
| 97 | } | 97 | } |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | if (pm_ops->prepare) { | ||
| 101 | if ((error = pm_ops->prepare(state))) | ||
| 102 | goto Thaw; | ||
| 103 | } | ||
| 104 | |||
| 105 | suspend_console(); | 100 | suspend_console(); |
| 106 | error = device_suspend(PMSG_SUSPEND); | 101 | error = device_suspend(PMSG_SUSPEND); |
| 107 | if (error) { | 102 | if (error) { |
| 108 | printk(KERN_ERR "Some devices failed to suspend\n"); | 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 | error = disable_nonboot_cpus(); | 111 | error = disable_nonboot_cpus(); |
| 112 | if (!error) | 112 | if (!error) |
| 113 | return 0; | 113 | return 0; |
| 114 | 114 | ||
| 115 | enable_nonboot_cpus(); | 115 | enable_nonboot_cpus(); |
| 116 | Resume_devices: | ||
| 117 | pm_finish(state); | 116 | pm_finish(state); |
| 117 | Resume_devices: | ||
| 118 | device_resume(); | 118 | device_resume(); |
| 119 | Resume_console: | ||
| 119 | resume_console(); | 120 | resume_console(); |
| 120 | Thaw: | 121 | Thaw: |
| 121 | thaw_processes(); | 122 | thaw_processes(); |
diff --git a/mm/filemap.c b/mm/filemap.c index 7b48b2ad00e7..edb1b0b5cc8d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
| @@ -670,7 +670,8 @@ repeat: | |||
| 670 | page = find_lock_page(mapping, index); | 670 | page = find_lock_page(mapping, index); |
| 671 | if (!page) { | 671 | if (!page) { |
| 672 | if (!cached_page) { | 672 | if (!cached_page) { |
| 673 | cached_page = alloc_page(gfp_mask); | 673 | cached_page = |
| 674 | __page_cache_alloc(gfp_mask); | ||
| 674 | if (!cached_page) | 675 | if (!cached_page) |
| 675 | return NULL; | 676 | return NULL; |
| 676 | } | 677 | } |
| @@ -2522,7 +2522,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, | |||
| 2522 | struct kmem_cache *s; | 2522 | struct kmem_cache *s; |
| 2523 | 2523 | ||
| 2524 | down_write(&slub_lock); | 2524 | down_write(&slub_lock); |
| 2525 | s = find_mergeable(size, align, flags, dtor, ctor); | 2525 | s = find_mergeable(size, align, flags, ctor, dtor); |
| 2526 | if (s) { | 2526 | if (s) { |
| 2527 | s->refcount++; | 2527 | s->refcount++; |
| 2528 | /* | 2528 | /* |
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 214d65d94c45..f471f8ad6885 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
| @@ -109,6 +109,7 @@ module_param_array(wssdma, int, NULL, 0444); | |||
| 109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); | 109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); |
| 110 | 110 | ||
| 111 | #ifdef CONFIG_PNP | 111 | #ifdef CONFIG_PNP |
| 112 | static int isa_registered; | ||
| 112 | static int pnp_registered; | 113 | static int pnp_registered; |
| 113 | #endif | 114 | #endif |
| 114 | 115 | ||
| @@ -686,14 +687,18 @@ static int __init alsa_card_cmi8330_init(void) | |||
| 686 | int err; | 687 | int err; |
| 687 | 688 | ||
| 688 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); | 689 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); |
| 689 | if (err < 0) | ||
| 690 | return err; | ||
| 691 | #ifdef CONFIG_PNP | 690 | #ifdef CONFIG_PNP |
| 691 | if (!err) | ||
| 692 | isa_registered = 1; | ||
| 693 | |||
| 692 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); | 694 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); |
| 693 | if (!err) | 695 | if (!err) |
| 694 | pnp_registered = 1; | 696 | pnp_registered = 1; |
| 697 | |||
| 698 | if (isa_registered) | ||
| 699 | err = 0; | ||
| 695 | #endif | 700 | #endif |
| 696 | return 0; | 701 | return err; |
| 697 | } | 702 | } |
| 698 | 703 | ||
| 699 | static void __exit alsa_card_cmi8330_exit(void) | 704 | static void __exit alsa_card_cmi8330_exit(void) |
| @@ -701,8 +706,10 @@ static void __exit alsa_card_cmi8330_exit(void) | |||
| 701 | #ifdef CONFIG_PNP | 706 | #ifdef CONFIG_PNP |
| 702 | if (pnp_registered) | 707 | if (pnp_registered) |
| 703 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); | 708 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); |
| 709 | |||
| 710 | if (isa_registered) | ||
| 704 | #endif | 711 | #endif |
| 705 | isa_unregister_driver(&snd_cmi8330_driver); | 712 | isa_unregister_driver(&snd_cmi8330_driver); |
| 706 | } | 713 | } |
| 707 | 714 | ||
| 708 | module_init(alsa_card_cmi8330_init) | 715 | module_init(alsa_card_cmi8330_init) |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 87f1392a2fa7..1a14f33b6ab0 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
| @@ -127,6 +127,7 @@ module_param_array(dma2, int, NULL, 0444); | |||
| 127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); | 127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); |
| 128 | 128 | ||
| 129 | #ifdef CONFIG_PNP | 129 | #ifdef CONFIG_PNP |
| 130 | static int isa_registered; | ||
| 130 | static int pnpc_registered; | 131 | static int pnpc_registered; |
| 131 | #ifdef CS4232 | 132 | #ifdef CS4232 |
| 132 | static int pnp_registered; | 133 | static int pnp_registered; |
| @@ -770,9 +771,9 @@ static int __init alsa_card_cs423x_init(void) | |||
| 770 | int err; | 771 | int err; |
| 771 | 772 | ||
| 772 | err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); | 773 | err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); |
| 773 | if (err < 0) | ||
| 774 | return err; | ||
| 775 | #ifdef CONFIG_PNP | 774 | #ifdef CONFIG_PNP |
| 775 | if (!err) | ||
| 776 | isa_registered = 1; | ||
| 776 | #ifdef CS4232 | 777 | #ifdef CS4232 |
| 777 | err = pnp_register_driver(&cs4232_pnp_driver); | 778 | err = pnp_register_driver(&cs4232_pnp_driver); |
| 778 | if (!err) | 779 | if (!err) |
| @@ -781,8 +782,14 @@ static int __init alsa_card_cs423x_init(void) | |||
| 781 | err = pnp_register_card_driver(&cs423x_pnpc_driver); | 782 | err = pnp_register_card_driver(&cs423x_pnpc_driver); |
| 782 | if (!err) | 783 | if (!err) |
| 783 | pnpc_registered = 1; | 784 | pnpc_registered = 1; |
| 784 | #endif /* CONFIG_PNP */ | 785 | #ifdef CS4232 |
| 785 | return 0; | 786 | if (pnp_registered) |
| 787 | err = 0; | ||
| 788 | #endif | ||
| 789 | if (isa_registered) | ||
| 790 | err = 0; | ||
| 791 | #endif | ||
| 792 | return err; | ||
| 786 | } | 793 | } |
| 787 | 794 | ||
| 788 | static void __exit alsa_card_cs423x_exit(void) | 795 | static void __exit alsa_card_cs423x_exit(void) |
| @@ -794,8 +801,9 @@ static void __exit alsa_card_cs423x_exit(void) | |||
| 794 | if (pnp_registered) | 801 | if (pnp_registered) |
| 795 | pnp_unregister_driver(&cs4232_pnp_driver); | 802 | pnp_unregister_driver(&cs4232_pnp_driver); |
| 796 | #endif | 803 | #endif |
| 797 | #endif /* CONFIG_PNP */ | 804 | if (isa_registered) |
| 798 | isa_unregister_driver(&cs423x_isa_driver); | 805 | #endif |
| 806 | isa_unregister_driver(&cs423x_isa_driver); | ||
| 799 | } | 807 | } |
| 800 | 808 | ||
| 801 | module_init(alsa_card_cs423x_init) | 809 | module_init(alsa_card_cs423x_init) |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index d2a9c7df0ce5..f7732bf90be3 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
| @@ -2036,7 +2036,9 @@ module_param_array(dma2, int, NULL, 0444); | |||
| 2036 | MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); | 2036 | MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); |
| 2037 | 2037 | ||
| 2038 | #ifdef CONFIG_PNP | 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 | static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { | 2043 | static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { |
| 2042 | { .id = "ESS1869" }, | 2044 | { .id = "ESS1869" }, |
| @@ -2466,18 +2468,22 @@ static int __init alsa_card_es18xx_init(void) | |||
| 2466 | int err; | 2468 | int err; |
| 2467 | 2469 | ||
| 2468 | err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); | 2470 | err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); |
| 2469 | if (err < 0) | ||
| 2470 | return err; | ||
| 2471 | |||
| 2472 | #ifdef CONFIG_PNP | 2471 | #ifdef CONFIG_PNP |
| 2472 | if (!err) | ||
| 2473 | isa_registered = 1; | ||
| 2474 | |||
| 2473 | err = pnp_register_driver(&es18xx_pnp_driver); | 2475 | err = pnp_register_driver(&es18xx_pnp_driver); |
| 2474 | if (!err) | 2476 | if (!err) |
| 2475 | pnp_registered = 1; | 2477 | pnp_registered = 1; |
| 2478 | |||
| 2476 | err = pnp_register_card_driver(&es18xx_pnpc_driver); | 2479 | err = pnp_register_card_driver(&es18xx_pnpc_driver); |
| 2477 | if (!err) | 2480 | if (!err) |
| 2478 | pnpc_registered = 1; | 2481 | pnpc_registered = 1; |
| 2482 | |||
| 2483 | if (isa_registered || pnp_registered) | ||
| 2484 | err = 0; | ||
| 2479 | #endif | 2485 | #endif |
| 2480 | return 0; | 2486 | return err; |
| 2481 | } | 2487 | } |
| 2482 | 2488 | ||
| 2483 | static void __exit alsa_card_es18xx_exit(void) | 2489 | static void __exit alsa_card_es18xx_exit(void) |
| @@ -2487,8 +2493,9 @@ static void __exit alsa_card_es18xx_exit(void) | |||
| 2487 | pnp_unregister_card_driver(&es18xx_pnpc_driver); | 2493 | pnp_unregister_card_driver(&es18xx_pnpc_driver); |
| 2488 | if (pnp_registered) | 2494 | if (pnp_registered) |
| 2489 | pnp_unregister_driver(&es18xx_pnp_driver); | 2495 | pnp_unregister_driver(&es18xx_pnp_driver); |
| 2496 | if (isa_registered) | ||
| 2490 | #endif | 2497 | #endif |
| 2491 | isa_unregister_driver(&snd_es18xx_isa_driver); | 2498 | isa_unregister_driver(&snd_es18xx_isa_driver); |
| 2492 | } | 2499 | } |
| 2493 | 2500 | ||
| 2494 | module_init(alsa_card_es18xx_init) | 2501 | module_init(alsa_card_es18xx_init) |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 3e4657255536..0220cdbe1a2a 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
| @@ -135,6 +135,7 @@ struct snd_interwave { | |||
| 135 | 135 | ||
| 136 | 136 | ||
| 137 | #ifdef CONFIG_PNP | 137 | #ifdef CONFIG_PNP |
| 138 | static int isa_registered; | ||
| 138 | static int pnp_registered; | 139 | static int pnp_registered; |
| 139 | 140 | ||
| 140 | static struct pnp_card_device_id snd_interwave_pnpids[] = { | 141 | static struct pnp_card_device_id snd_interwave_pnpids[] = { |
| @@ -934,15 +935,18 @@ static int __init alsa_card_interwave_init(void) | |||
| 934 | int err; | 935 | int err; |
| 935 | 936 | ||
| 936 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); | 937 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); |
| 937 | if (err < 0) | ||
| 938 | return err; | ||
| 939 | #ifdef CONFIG_PNP | 938 | #ifdef CONFIG_PNP |
| 940 | /* ISA PnP cards */ | 939 | if (!err) |
| 940 | isa_registered = 1; | ||
| 941 | |||
| 941 | err = pnp_register_card_driver(&interwave_pnpc_driver); | 942 | err = pnp_register_card_driver(&interwave_pnpc_driver); |
| 942 | if (!err) | 943 | if (!err) |
| 943 | pnp_registered = 1; | 944 | pnp_registered = 1; |
| 945 | |||
| 946 | if (isa_registered) | ||
| 947 | err = 0; | ||
| 944 | #endif | 948 | #endif |
| 945 | return 0; | 949 | return err; |
| 946 | } | 950 | } |
| 947 | 951 | ||
| 948 | static void __exit alsa_card_interwave_exit(void) | 952 | static void __exit alsa_card_interwave_exit(void) |
| @@ -950,8 +954,9 @@ static void __exit alsa_card_interwave_exit(void) | |||
| 950 | #ifdef CONFIG_PNP | 954 | #ifdef CONFIG_PNP |
| 951 | if (pnp_registered) | 955 | if (pnp_registered) |
| 952 | pnp_unregister_card_driver(&interwave_pnpc_driver); | 956 | pnp_unregister_card_driver(&interwave_pnpc_driver); |
| 957 | if (isa_registered) | ||
| 953 | #endif | 958 | #endif |
| 954 | isa_unregister_driver(&snd_interwave_driver); | 959 | isa_unregister_driver(&snd_interwave_driver); |
| 955 | } | 960 | } |
| 956 | 961 | ||
| 957 | module_init(alsa_card_interwave_init) | 962 | module_init(alsa_card_interwave_init) |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 48743eb85fb6..61a323cc0e49 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
| @@ -92,6 +92,7 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444); | |||
| 92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); | 92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); |
| 93 | 93 | ||
| 94 | #ifdef CONFIG_PNP | 94 | #ifdef CONFIG_PNP |
| 95 | static int isa_registered; | ||
| 95 | static int pnp_registered; | 96 | static int pnp_registered; |
| 96 | static int pnpc_registered; | 97 | static int pnpc_registered; |
| 97 | #endif | 98 | #endif |
| @@ -967,17 +968,22 @@ static int __init alsa_card_opl3sa2_init(void) | |||
| 967 | int err; | 968 | int err; |
| 968 | 969 | ||
| 969 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); | 970 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); |
| 970 | if (err < 0) | ||
| 971 | return err; | ||
| 972 | #ifdef CONFIG_PNP | 971 | #ifdef CONFIG_PNP |
| 972 | if (!err) | ||
| 973 | isa_registered = 1; | ||
| 974 | |||
| 973 | err = pnp_register_driver(&opl3sa2_pnp_driver); | 975 | err = pnp_register_driver(&opl3sa2_pnp_driver); |
| 974 | if (!err) | 976 | if (!err) |
| 975 | pnp_registered = 1; | 977 | pnp_registered = 1; |
| 978 | |||
| 976 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); | 979 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); |
| 977 | if (!err) | 980 | if (!err) |
| 978 | pnpc_registered = 1; | 981 | pnpc_registered = 1; |
| 982 | |||
| 983 | if (isa_registered || pnp_registered) | ||
| 984 | err = 0; | ||
| 979 | #endif | 985 | #endif |
| 980 | return 0; | 986 | return err; |
| 981 | } | 987 | } |
| 982 | 988 | ||
| 983 | static void __exit alsa_card_opl3sa2_exit(void) | 989 | static void __exit alsa_card_opl3sa2_exit(void) |
| @@ -987,8 +993,9 @@ static void __exit alsa_card_opl3sa2_exit(void) | |||
| 987 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); | 993 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); |
| 988 | if (pnp_registered) | 994 | if (pnp_registered) |
| 989 | pnp_unregister_driver(&opl3sa2_pnp_driver); | 995 | pnp_unregister_driver(&opl3sa2_pnp_driver); |
| 996 | if (isa_registered) | ||
| 990 | #endif | 997 | #endif |
| 991 | isa_unregister_driver(&snd_opl3sa2_isa_driver); | 998 | isa_unregister_driver(&snd_opl3sa2_isa_driver); |
| 992 | } | 999 | } |
| 993 | 1000 | ||
| 994 | module_init(alsa_card_opl3sa2_init) | 1001 | module_init(alsa_card_opl3sa2_init) |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 2a19b0a39eda..c4ba24bfd27c 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
| @@ -129,6 +129,7 @@ MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth."); | |||
| 129 | #endif | 129 | #endif |
| 130 | 130 | ||
| 131 | #ifdef CONFIG_PNP | 131 | #ifdef CONFIG_PNP |
| 132 | static int isa_registered; | ||
| 132 | static int pnp_registered; | 133 | static int pnp_registered; |
| 133 | #endif | 134 | #endif |
| 134 | 135 | ||
| @@ -702,15 +703,18 @@ static int __init alsa_card_sb16_init(void) | |||
| 702 | int err; | 703 | int err; |
| 703 | 704 | ||
| 704 | err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); | 705 | err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); |
| 705 | if (err < 0) | ||
| 706 | return err; | ||
| 707 | #ifdef CONFIG_PNP | 706 | #ifdef CONFIG_PNP |
| 708 | /* PnP cards at last */ | 707 | if (!err) |
| 708 | isa_registered = 1; | ||
| 709 | |||
| 709 | err = pnp_register_card_driver(&sb16_pnpc_driver); | 710 | err = pnp_register_card_driver(&sb16_pnpc_driver); |
| 710 | if (!err) | 711 | if (!err) |
| 711 | pnp_registered = 1; | 712 | pnp_registered = 1; |
| 713 | |||
| 714 | if (isa_registered) | ||
| 715 | err = 0; | ||
| 712 | #endif | 716 | #endif |
| 713 | return 0; | 717 | return err; |
| 714 | } | 718 | } |
| 715 | 719 | ||
| 716 | static void __exit alsa_card_sb16_exit(void) | 720 | static void __exit alsa_card_sb16_exit(void) |
| @@ -718,8 +722,9 @@ static void __exit alsa_card_sb16_exit(void) | |||
| 718 | #ifdef CONFIG_PNP | 722 | #ifdef CONFIG_PNP |
| 719 | if (pnp_registered) | 723 | if (pnp_registered) |
| 720 | pnp_unregister_card_driver(&sb16_pnpc_driver); | 724 | pnp_unregister_card_driver(&sb16_pnpc_driver); |
| 725 | if (isa_registered) | ||
| 721 | #endif | 726 | #endif |
| 722 | isa_unregister_driver(&snd_sb16_isa_driver); | 727 | isa_unregister_driver(&snd_sb16_isa_driver); |
| 723 | } | 728 | } |
| 724 | 729 | ||
| 725 | module_init(alsa_card_sb16_init) | 730 | module_init(alsa_card_sb16_init) |
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 08c14978558c..9ea417bcf3e5 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c | |||
| @@ -69,7 +69,9 @@ module_param_array(dma, int, NULL, 0444); | |||
| 69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); | 69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); |
| 70 | 70 | ||
| 71 | #ifdef CONFIG_PNP | 71 | #ifdef CONFIG_PNP |
| 72 | static int isa_registered; | ||
| 72 | static int pnp_registered; | 73 | static int pnp_registered; |
| 74 | |||
| 73 | static struct pnp_card_device_id sscape_pnpids[] = { | 75 | static struct pnp_card_device_id sscape_pnpids[] = { |
| 74 | { .id = "ENS3081", .devs = { { "ENS0000" } } }, | 76 | { .id = "ENS3081", .devs = { { "ENS0000" } } }, |
| 75 | { .id = "" } /* end */ | 77 | { .id = "" } /* end */ |
| @@ -1405,22 +1407,21 @@ static struct pnp_card_driver sscape_pnpc_driver = { | |||
| 1405 | 1407 | ||
| 1406 | static int __init sscape_init(void) | 1408 | static int __init sscape_init(void) |
| 1407 | { | 1409 | { |
| 1408 | int ret; | 1410 | int err; |
| 1409 | 1411 | ||
| 1410 | /* | 1412 | err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); |
| 1411 | * First check whether we were passed any parameters. | ||
| 1412 | * These MUST take precedence over ANY automatic way | ||
| 1413 | * of allocating cards, because the operator is | ||
| 1414 | * S-P-E-L-L-I-N-G it out for us... | ||
| 1415 | */ | ||
| 1416 | ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); | ||
| 1417 | if (ret < 0) | ||
| 1418 | return ret; | ||
| 1419 | #ifdef CONFIG_PNP | 1413 | #ifdef CONFIG_PNP |
| 1420 | if (pnp_register_card_driver(&sscape_pnpc_driver) == 0) | 1414 | if (!err) |
| 1415 | isa_registered = 1; | ||
| 1416 | |||
| 1417 | err = pnp_register_card_driver(&sscape_pnpc_driver); | ||
| 1418 | if (!err) | ||
| 1421 | pnp_registered = 1; | 1419 | pnp_registered = 1; |
| 1420 | |||
| 1421 | if (isa_registered) | ||
| 1422 | err = 0; | ||
| 1422 | #endif | 1423 | #endif |
| 1423 | return 0; | 1424 | return err; |
| 1424 | } | 1425 | } |
| 1425 | 1426 | ||
| 1426 | static void __exit sscape_exit(void) | 1427 | static void __exit sscape_exit(void) |
| @@ -1428,8 +1429,9 @@ static void __exit sscape_exit(void) | |||
| 1428 | #ifdef CONFIG_PNP | 1429 | #ifdef CONFIG_PNP |
| 1429 | if (pnp_registered) | 1430 | if (pnp_registered) |
| 1430 | pnp_unregister_card_driver(&sscape_pnpc_driver); | 1431 | pnp_unregister_card_driver(&sscape_pnpc_driver); |
| 1432 | if (isa_registered) | ||
| 1431 | #endif | 1433 | #endif |
| 1432 | isa_unregister_driver(&snd_sscape_driver); | 1434 | isa_unregister_driver(&snd_sscape_driver); |
| 1433 | } | 1435 | } |
| 1434 | 1436 | ||
| 1435 | module_init(sscape_init); | 1437 | module_init(sscape_init); |
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 75673f723857..83c2fc4cfc64 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
| @@ -86,6 +86,7 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444); | |||
| 86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); | 86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); |
| 87 | 87 | ||
| 88 | #ifdef CONFIG_PNP | 88 | #ifdef CONFIG_PNP |
| 89 | static int isa_registered; | ||
| 89 | static int pnp_registered; | 90 | static int pnp_registered; |
| 90 | 91 | ||
| 91 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { | 92 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { |
| @@ -706,14 +707,18 @@ static int __init alsa_card_wavefront_init(void) | |||
| 706 | int err; | 707 | int err; |
| 707 | 708 | ||
| 708 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); | 709 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); |
| 709 | if (err < 0) | ||
| 710 | return err; | ||
| 711 | #ifdef CONFIG_PNP | 710 | #ifdef CONFIG_PNP |
| 711 | if (!err) | ||
| 712 | isa_registered = 1; | ||
| 713 | |||
| 712 | err = pnp_register_card_driver(&wavefront_pnpc_driver); | 714 | err = pnp_register_card_driver(&wavefront_pnpc_driver); |
| 713 | if (!err) | 715 | if (!err) |
| 714 | pnp_registered = 1; | 716 | pnp_registered = 1; |
| 717 | |||
| 718 | if (isa_registered) | ||
| 719 | err = 0; | ||
| 715 | #endif | 720 | #endif |
| 716 | return 0; | 721 | return err; |
| 717 | } | 722 | } |
| 718 | 723 | ||
| 719 | static void __exit alsa_card_wavefront_exit(void) | 724 | static void __exit alsa_card_wavefront_exit(void) |
| @@ -721,8 +726,9 @@ static void __exit alsa_card_wavefront_exit(void) | |||
| 721 | #ifdef CONFIG_PNP | 726 | #ifdef CONFIG_PNP |
| 722 | if (pnp_registered) | 727 | if (pnp_registered) |
| 723 | pnp_unregister_card_driver(&wavefront_pnpc_driver); | 728 | pnp_unregister_card_driver(&wavefront_pnpc_driver); |
| 729 | if (isa_registered) | ||
| 724 | #endif | 730 | #endif |
| 725 | isa_unregister_driver(&snd_wavefront_driver); | 731 | isa_unregister_driver(&snd_wavefront_driver); |
| 726 | } | 732 | } |
| 727 | 733 | ||
| 728 | module_init(alsa_card_wavefront_init) | 734 | module_init(alsa_card_wavefront_init) |
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 3eac0f86266c..581ebba4d1a7 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
| @@ -1782,6 +1782,11 @@ static unsigned int ad1981_jacks_blacklist[] = { | |||
| 1782 | 0x10140534, /* Thinkpad X31 */ | 1782 | 0x10140534, /* Thinkpad X31 */ |
| 1783 | 0x10140537, /* Thinkpad T41p */ | 1783 | 0x10140537, /* Thinkpad T41p */ |
| 1784 | 0x10140554, /* Thinkpad T42p/R50p */ | 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 | 0 /* end */ | 1790 | 0 /* end */ |
| 1786 | }; | 1791 | }; |
| 1787 | 1792 | ||
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 14649d54b493..8e89d56b6400 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
| @@ -707,7 +707,8 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) | |||
| 707 | direction == HDA_OUTPUT ? | 707 | direction == HDA_OUTPUT ? |
| 708 | AC_PAR_AMP_OUT_CAP : | 708 | AC_PAR_AMP_OUT_CAP : |
| 709 | AC_PAR_AMP_IN_CAP); | 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 | return info->amp_caps; | 713 | return info->amp_caps; |
| 713 | } | 714 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a4ede27af021..34ac63469532 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -93,6 +93,7 @@ enum { | |||
| 93 | ALC262_HP_BPC_D7000_WL, | 93 | ALC262_HP_BPC_D7000_WL, |
| 94 | ALC262_HP_BPC_D7000_WF, | 94 | ALC262_HP_BPC_D7000_WF, |
| 95 | ALC262_BENQ_ED8, | 95 | ALC262_BENQ_ED8, |
| 96 | ALC262_SONY_ASSAMD, | ||
| 96 | ALC262_AUTO, | 97 | ALC262_AUTO, |
| 97 | ALC262_MODEL_LAST /* last tag */ | 98 | ALC262_MODEL_LAST /* last tag */ |
| 98 | }; | 99 | }; |
| @@ -118,6 +119,7 @@ enum { | |||
| 118 | ALC861VD_3ST_DIG, | 119 | ALC861VD_3ST_DIG, |
| 119 | ALC861VD_6ST_DIG, | 120 | ALC861VD_6ST_DIG, |
| 120 | ALC861VD_LENOVO, | 121 | ALC861VD_LENOVO, |
| 122 | ALC861VD_DALLAS, | ||
| 121 | ALC861VD_AUTO, | 123 | ALC861VD_AUTO, |
| 122 | ALC861VD_MODEL_LAST, | 124 | ALC861VD_MODEL_LAST, |
| 123 | }; | 125 | }; |
| @@ -139,8 +141,10 @@ enum { | |||
| 139 | ALC882_6ST_DIG, | 141 | ALC882_6ST_DIG, |
| 140 | ALC882_ARIMA, | 142 | ALC882_ARIMA, |
| 141 | ALC882_W2JC, | 143 | ALC882_W2JC, |
| 142 | ALC882_AUTO, | 144 | ALC882_TARGA, |
| 145 | ALC882_ASUS_A7J, | ||
| 143 | ALC885_MACPRO, | 146 | ALC885_MACPRO, |
| 147 | ALC882_AUTO, | ||
| 144 | ALC882_MODEL_LAST, | 148 | ALC882_MODEL_LAST, |
| 145 | }; | 149 | }; |
| 146 | 150 | ||
| @@ -152,11 +156,13 @@ enum { | |||
| 152 | ALC883_6ST_DIG, | 156 | ALC883_6ST_DIG, |
| 153 | ALC883_TARGA_DIG, | 157 | ALC883_TARGA_DIG, |
| 154 | ALC883_TARGA_2ch_DIG, | 158 | ALC883_TARGA_2ch_DIG, |
| 155 | ALC888_DEMO_BOARD, | ||
| 156 | ALC883_ACER, | 159 | ALC883_ACER, |
| 157 | ALC883_MEDION, | 160 | ALC883_MEDION, |
| 161 | ALC883_MEDION_MD2, | ||
| 158 | ALC883_LAPTOP_EAPD, | 162 | ALC883_LAPTOP_EAPD, |
| 159 | ALC883_LENOVO_101E_2ch, | 163 | ALC883_LENOVO_101E_2ch, |
| 164 | ALC883_LENOVO_NB0763, | ||
| 165 | ALC888_LENOVO_MS7195_DIG, | ||
| 160 | ALC883_AUTO, | 166 | ALC883_AUTO, |
| 161 | ALC883_MODEL_LAST, | 167 | ALC883_MODEL_LAST, |
| 162 | }; | 168 | }; |
| @@ -4753,6 +4759,35 @@ static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
| 4753 | } | 4759 | } |
| 4754 | 4760 | ||
| 4755 | /* | 4761 | /* |
| 4762 | * 2ch mode | ||
| 4763 | */ | ||
| 4764 | static struct hda_verb alc882_3ST_ch2_init[] = { | ||
| 4765 | { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, | ||
| 4766 | { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, | ||
| 4767 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, | ||
| 4768 | { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, | ||
| 4769 | { } /* end */ | ||
| 4770 | }; | ||
| 4771 | |||
| 4772 | /* | ||
| 4773 | * 6ch mode | ||
| 4774 | */ | ||
| 4775 | static struct hda_verb alc882_3ST_ch6_init[] = { | ||
| 4776 | { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, | ||
| 4777 | { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, | ||
| 4778 | { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 }, | ||
| 4779 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, | ||
| 4780 | { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, | ||
| 4781 | { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 }, | ||
| 4782 | { } /* end */ | ||
| 4783 | }; | ||
| 4784 | |||
| 4785 | static struct hda_channel_mode alc882_3ST_6ch_modes[2] = { | ||
| 4786 | { 2, alc882_3ST_ch2_init }, | ||
| 4787 | { 6, alc882_3ST_ch6_init }, | ||
| 4788 | }; | ||
| 4789 | |||
| 4790 | /* | ||
| 4756 | * 6ch mode | 4791 | * 6ch mode |
| 4757 | */ | 4792 | */ |
| 4758 | static struct hda_verb alc882_sixstack_ch6_init[] = { | 4793 | static struct hda_verb alc882_sixstack_ch6_init[] = { |
| @@ -4824,6 +4859,40 @@ static struct snd_kcontrol_new alc882_w2jc_mixer[] = { | |||
| 4824 | { } /* end */ | 4859 | { } /* end */ |
| 4825 | }; | 4860 | }; |
| 4826 | 4861 | ||
| 4862 | static struct snd_kcontrol_new alc882_targa_mixer[] = { | ||
| 4863 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
| 4864 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | ||
| 4865 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), | ||
| 4866 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | ||
| 4867 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | ||
| 4868 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
| 4869 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
| 4870 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 4871 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 4872 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), | ||
| 4873 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), | ||
| 4874 | { } /* end */ | ||
| 4875 | }; | ||
| 4876 | |||
| 4877 | /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ??? | ||
| 4878 | * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c | ||
| 4879 | */ | ||
| 4880 | static struct snd_kcontrol_new alc882_asus_a7j_mixer[] = { | ||
| 4881 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
| 4882 | HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
| 4883 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
| 4884 | HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT), | ||
| 4885 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | ||
| 4886 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | ||
| 4887 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
| 4888 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
| 4889 | HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT), | ||
| 4890 | HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT), | ||
| 4891 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 4892 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 4893 | { } /* end */ | ||
| 4894 | }; | ||
| 4895 | |||
| 4827 | static struct snd_kcontrol_new alc882_chmode_mixer[] = { | 4896 | static struct snd_kcontrol_new alc882_chmode_mixer[] = { |
| 4828 | { | 4897 | { |
| 4829 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 4898 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| @@ -4985,6 +5054,66 @@ static struct hda_verb alc882_macpro_init_verbs[] = { | |||
| 4985 | { } | 5054 | { } |
| 4986 | }; | 5055 | }; |
| 4987 | 5056 | ||
| 5057 | static struct hda_verb alc882_targa_verbs[] = { | ||
| 5058 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 5059 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
| 5060 | |||
| 5061 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 5062 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 5063 | |||
| 5064 | {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ | ||
| 5065 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ | ||
| 5066 | {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ | ||
| 5067 | |||
| 5068 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
| 5069 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, | ||
| 5070 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, | ||
| 5071 | {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, | ||
| 5072 | { } /* end */ | ||
| 5073 | }; | ||
| 5074 | |||
| 5075 | /* toggle speaker-output according to the hp-jack state */ | ||
| 5076 | static void alc882_targa_automute(struct hda_codec *codec) | ||
| 5077 | { | ||
| 5078 | unsigned int present; | ||
| 5079 | |||
| 5080 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
| 5081 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 5082 | snd_hda_codec_amp_update(codec, 0x1b, 0, HDA_OUTPUT, 0, | ||
| 5083 | 0x80, present ? 0x80 : 0); | ||
| 5084 | snd_hda_codec_amp_update(codec, 0x1b, 1, HDA_OUTPUT, 0, | ||
| 5085 | 0x80, present ? 0x80 : 0); | ||
| 5086 | snd_hda_codec_write(codec, 1, 0, AC_VERB_SET_GPIO_DATA, present ? 1 : 3); | ||
| 5087 | } | ||
| 5088 | |||
| 5089 | static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res) | ||
| 5090 | { | ||
| 5091 | /* Looks like the unsol event is incompatible with the standard | ||
| 5092 | * definition. 4bit tag is placed at 26 bit! | ||
| 5093 | */ | ||
| 5094 | if (((res >> 26) == ALC880_HP_EVENT)) { | ||
| 5095 | alc882_targa_automute(codec); | ||
| 5096 | } | ||
| 5097 | } | ||
| 5098 | |||
| 5099 | static struct hda_verb alc882_asus_a7j_verbs[] = { | ||
| 5100 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 5101 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
| 5102 | |||
| 5103 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 5104 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 5105 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 5106 | |||
| 5107 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ | ||
| 5108 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ | ||
| 5109 | {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */ | ||
| 5110 | |||
| 5111 | {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ | ||
| 5112 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */ | ||
| 5113 | {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ | ||
| 5114 | { } /* end */ | ||
| 5115 | }; | ||
| 5116 | |||
| 4988 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) | 5117 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) |
| 4989 | { | 5118 | { |
| 4990 | unsigned int gpiostate, gpiomask, gpiodir; | 5119 | unsigned int gpiostate, gpiomask, gpiodir; |
| @@ -5152,7 +5281,9 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { | |||
| 5152 | SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), | 5281 | SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), |
| 5153 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), | 5282 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), |
| 5154 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), | 5283 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), |
| 5284 | SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ | ||
| 5155 | SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), | 5285 | SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), |
| 5286 | SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J), | ||
| 5156 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), | 5287 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), |
| 5157 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), | 5288 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), |
| 5158 | {} | 5289 | {} |
| @@ -5214,6 +5345,36 @@ static struct alc_config_preset alc882_presets[] = { | |||
| 5214 | .channel_mode = alc882_ch_modes, | 5345 | .channel_mode = alc882_ch_modes, |
| 5215 | .input_mux = &alc882_capture_source, | 5346 | .input_mux = &alc882_capture_source, |
| 5216 | }, | 5347 | }, |
| 5348 | [ALC882_TARGA] = { | ||
| 5349 | .mixers = { alc882_targa_mixer, alc882_chmode_mixer, | ||
| 5350 | alc882_capture_mixer }, | ||
| 5351 | .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, | ||
| 5352 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), | ||
| 5353 | .dac_nids = alc882_dac_nids, | ||
| 5354 | .dig_out_nid = ALC882_DIGOUT_NID, | ||
| 5355 | .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), | ||
| 5356 | .adc_nids = alc882_adc_nids, | ||
| 5357 | .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), | ||
| 5358 | .channel_mode = alc882_3ST_6ch_modes, | ||
| 5359 | .need_dac_fix = 1, | ||
| 5360 | .input_mux = &alc882_capture_source, | ||
| 5361 | .unsol_event = alc882_targa_unsol_event, | ||
| 5362 | .init_hook = alc882_targa_automute, | ||
| 5363 | }, | ||
| 5364 | [ALC882_ASUS_A7J] = { | ||
| 5365 | .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer, | ||
| 5366 | alc882_capture_mixer }, | ||
| 5367 | .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs}, | ||
| 5368 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), | ||
| 5369 | .dac_nids = alc882_dac_nids, | ||
| 5370 | .dig_out_nid = ALC882_DIGOUT_NID, | ||
| 5371 | .num_adc_nids = ARRAY_SIZE(alc882_adc_nids), | ||
| 5372 | .adc_nids = alc882_adc_nids, | ||
| 5373 | .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes), | ||
| 5374 | .channel_mode = alc882_3ST_6ch_modes, | ||
| 5375 | .need_dac_fix = 1, | ||
| 5376 | .input_mux = &alc882_capture_source, | ||
| 5377 | }, | ||
| 5217 | }; | 5378 | }; |
| 5218 | 5379 | ||
| 5219 | 5380 | ||
| @@ -5441,6 +5602,16 @@ static struct hda_input_mux alc883_lenovo_101e_capture_source = { | |||
| 5441 | }, | 5602 | }, |
| 5442 | }; | 5603 | }; |
| 5443 | 5604 | ||
| 5605 | static struct hda_input_mux alc883_lenovo_nb0763_capture_source = { | ||
| 5606 | .num_items = 4, | ||
| 5607 | .items = { | ||
| 5608 | { "Mic", 0x0 }, | ||
| 5609 | { "iMic", 0x1 }, | ||
| 5610 | { "Line", 0x2 }, | ||
| 5611 | { "CD", 0x4 }, | ||
| 5612 | }, | ||
| 5613 | }; | ||
| 5614 | |||
| 5444 | #define alc883_mux_enum_info alc_mux_enum_info | 5615 | #define alc883_mux_enum_info alc_mux_enum_info |
| 5445 | #define alc883_mux_enum_get alc_mux_enum_get | 5616 | #define alc883_mux_enum_get alc_mux_enum_get |
| 5446 | 5617 | ||
| @@ -5772,6 +5943,58 @@ static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer[] = { | |||
| 5772 | { } /* end */ | 5943 | { } /* end */ |
| 5773 | }; | 5944 | }; |
| 5774 | 5945 | ||
| 5946 | static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = { | ||
| 5947 | HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
| 5948 | HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT), | ||
| 5949 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
| 5950 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | ||
| 5951 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | ||
| 5952 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 5953 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 5954 | HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT), | ||
| 5955 | HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT), | ||
| 5956 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
| 5957 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
| 5958 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), | ||
| 5959 | HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), | ||
| 5960 | { | ||
| 5961 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
| 5962 | /* .name = "Capture Source", */ | ||
| 5963 | .name = "Input Source", | ||
| 5964 | .count = 2, | ||
| 5965 | .info = alc883_mux_enum_info, | ||
| 5966 | .get = alc883_mux_enum_get, | ||
| 5967 | .put = alc883_mux_enum_put, | ||
| 5968 | }, | ||
| 5969 | { } /* end */ | ||
| 5970 | }; | ||
| 5971 | |||
| 5972 | static struct snd_kcontrol_new alc883_medion_md2_mixer[] = { | ||
| 5973 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
| 5974 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
| 5975 | HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
| 5976 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | ||
| 5977 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | ||
| 5978 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 5979 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 5980 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
| 5981 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
| 5982 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
| 5983 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
| 5984 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), | ||
| 5985 | HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), | ||
| 5986 | { | ||
| 5987 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
| 5988 | /* .name = "Capture Source", */ | ||
| 5989 | .name = "Input Source", | ||
| 5990 | .count = 2, | ||
| 5991 | .info = alc883_mux_enum_info, | ||
| 5992 | .get = alc883_mux_enum_get, | ||
| 5993 | .put = alc883_mux_enum_put, | ||
| 5994 | }, | ||
| 5995 | { } /* end */ | ||
| 5996 | }; | ||
| 5997 | |||
| 5775 | static struct snd_kcontrol_new alc883_chmode_mixer[] = { | 5998 | static struct snd_kcontrol_new alc883_chmode_mixer[] = { |
| 5776 | { | 5999 | { |
| 5777 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 6000 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| @@ -5886,6 +6109,93 @@ static struct hda_verb alc883_lenovo_101e_verbs[] = { | |||
| 5886 | { } /* end */ | 6109 | { } /* end */ |
| 5887 | }; | 6110 | }; |
| 5888 | 6111 | ||
| 6112 | static struct hda_verb alc883_lenovo_nb0763_verbs[] = { | ||
| 6113 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
| 6114 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 6115 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
| 6116 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 6117 | { } /* end */ | ||
| 6118 | }; | ||
| 6119 | |||
| 6120 | static struct hda_verb alc888_lenovo_ms7195_verbs[] = { | ||
| 6121 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 6122 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
| 6123 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
| 6124 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT | AC_USRSP_EN}, | ||
| 6125 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
| 6126 | { } /* end */ | ||
| 6127 | }; | ||
| 6128 | |||
| 6129 | /* toggle front-jack and RCA according to the hp-jack state */ | ||
| 6130 | static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec) | ||
| 6131 | { | ||
| 6132 | unsigned int present; | ||
| 6133 | |||
| 6134 | present = snd_hda_codec_read(codec, 0x1b, 0, | ||
| 6135 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 6136 | snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | ||
| 6137 | 0x80, present ? 0x80 : 0); | ||
| 6138 | snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | ||
| 6139 | 0x80, present ? 0x80 : 0); | ||
| 6140 | snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, | ||
| 6141 | 0x80, present ? 0x80 : 0); | ||
| 6142 | snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, | ||
| 6143 | 0x80, present ? 0x80 : 0); | ||
| 6144 | |||
| 6145 | } | ||
| 6146 | |||
| 6147 | /* toggle RCA according to the front-jack state */ | ||
| 6148 | static void alc888_lenovo_ms7195_rca_automute(struct hda_codec *codec) | ||
| 6149 | { | ||
| 6150 | unsigned int present; | ||
| 6151 | |||
| 6152 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
| 6153 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 6154 | snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, | ||
| 6155 | 0x80, present ? 0x80 : 0); | ||
| 6156 | snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, | ||
| 6157 | 0x80, present ? 0x80 : 0); | ||
| 6158 | |||
| 6159 | } | ||
| 6160 | static void alc883_lenovo_ms7195_unsol_event(struct hda_codec *codec, | ||
| 6161 | unsigned int res) | ||
| 6162 | { | ||
| 6163 | if ((res >> 26) == ALC880_HP_EVENT) | ||
| 6164 | alc888_lenovo_ms7195_front_automute(codec); | ||
| 6165 | if ((res >> 26) == ALC880_FRONT_EVENT) | ||
| 6166 | alc888_lenovo_ms7195_rca_automute(codec); | ||
| 6167 | } | ||
| 6168 | |||
| 6169 | static struct hda_verb alc883_medion_md2_verbs[] = { | ||
| 6170 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 6171 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
| 6172 | |||
| 6173 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 6174 | |||
| 6175 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
| 6176 | { } /* end */ | ||
| 6177 | }; | ||
| 6178 | |||
| 6179 | /* toggle speaker-output according to the hp-jack state */ | ||
| 6180 | static void alc883_medion_md2_automute(struct hda_codec *codec) | ||
| 6181 | { | ||
| 6182 | unsigned int present; | ||
| 6183 | |||
| 6184 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
| 6185 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 6186 | snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0, | ||
| 6187 | 0x80, present ? 0x80 : 0); | ||
| 6188 | snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0, | ||
| 6189 | 0x80, present ? 0x80 : 0); | ||
| 6190 | } | ||
| 6191 | |||
| 6192 | static void alc883_medion_md2_unsol_event(struct hda_codec *codec, | ||
| 6193 | unsigned int res) | ||
| 6194 | { | ||
| 6195 | if ((res >> 26) == ALC880_HP_EVENT) | ||
| 6196 | alc883_medion_md2_automute(codec); | ||
| 6197 | } | ||
| 6198 | |||
| 5889 | /* toggle speaker-output according to the hp-jack state */ | 6199 | /* toggle speaker-output according to the hp-jack state */ |
| 5890 | static void alc883_tagra_automute(struct hda_codec *codec) | 6200 | static void alc883_tagra_automute(struct hda_codec *codec) |
| 5891 | { | 6201 | { |
| @@ -6051,11 +6361,13 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { | |||
| 6051 | [ALC883_6ST_DIG] = "6stack-dig", | 6361 | [ALC883_6ST_DIG] = "6stack-dig", |
| 6052 | [ALC883_TARGA_DIG] = "targa-dig", | 6362 | [ALC883_TARGA_DIG] = "targa-dig", |
| 6053 | [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", | 6363 | [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", |
| 6054 | [ALC888_DEMO_BOARD] = "6stack-dig-demo", | ||
| 6055 | [ALC883_ACER] = "acer", | 6364 | [ALC883_ACER] = "acer", |
| 6056 | [ALC883_MEDION] = "medion", | 6365 | [ALC883_MEDION] = "medion", |
| 6366 | [ALC883_MEDION_MD2] = "medion-md2", | ||
| 6057 | [ALC883_LAPTOP_EAPD] = "laptop-eapd", | 6367 | [ALC883_LAPTOP_EAPD] = "laptop-eapd", |
| 6058 | [ALC883_LENOVO_101E_2ch] = "lenovo-101e", | 6368 | [ALC883_LENOVO_101E_2ch] = "lenovo-101e", |
| 6369 | [ALC883_LENOVO_NB0763] = "lenovo-nb0763", | ||
| 6370 | [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig", | ||
| 6059 | [ALC883_AUTO] = "auto", | 6371 | [ALC883_AUTO] = "auto", |
| 6060 | }; | 6372 | }; |
| 6061 | 6373 | ||
| @@ -6082,7 +6394,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
| 6082 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), | 6394 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), |
| 6083 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), | 6395 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), |
| 6084 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), | 6396 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), |
| 6085 | SND_PCI_QUIRK(0x17aa, 0x101e, "lenovo 101e", ALC883_LENOVO_101E_2ch), | 6397 | SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), |
| 6398 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), | ||
| 6399 | SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), | ||
| 6400 | SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), | ||
| 6086 | {} | 6401 | {} |
| 6087 | }; | 6402 | }; |
| 6088 | 6403 | ||
| @@ -6168,19 +6483,6 @@ static struct alc_config_preset alc883_presets[] = { | |||
| 6168 | .unsol_event = alc883_tagra_unsol_event, | 6483 | .unsol_event = alc883_tagra_unsol_event, |
| 6169 | .init_hook = alc883_tagra_automute, | 6484 | .init_hook = alc883_tagra_automute, |
| 6170 | }, | 6485 | }, |
| 6171 | [ALC888_DEMO_BOARD] = { | ||
| 6172 | .mixers = { alc883_base_mixer, alc883_chmode_mixer }, | ||
| 6173 | .init_verbs = { alc883_init_verbs }, | ||
| 6174 | .num_dacs = ARRAY_SIZE(alc883_dac_nids), | ||
| 6175 | .dac_nids = alc883_dac_nids, | ||
| 6176 | .dig_out_nid = ALC883_DIGOUT_NID, | ||
| 6177 | .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), | ||
| 6178 | .adc_nids = alc883_adc_nids, | ||
| 6179 | .dig_in_nid = ALC883_DIGIN_NID, | ||
| 6180 | .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), | ||
| 6181 | .channel_mode = alc883_sixstack_modes, | ||
| 6182 | .input_mux = &alc883_capture_source, | ||
| 6183 | }, | ||
| 6184 | [ALC883_ACER] = { | 6486 | [ALC883_ACER] = { |
| 6185 | .mixers = { alc883_base_mixer, | 6487 | .mixers = { alc883_base_mixer, |
| 6186 | alc883_chmode_mixer }, | 6488 | alc883_chmode_mixer }, |
| @@ -6211,6 +6513,20 @@ static struct alc_config_preset alc883_presets[] = { | |||
| 6211 | .channel_mode = alc883_sixstack_modes, | 6513 | .channel_mode = alc883_sixstack_modes, |
| 6212 | .input_mux = &alc883_capture_source, | 6514 | .input_mux = &alc883_capture_source, |
| 6213 | }, | 6515 | }, |
| 6516 | [ALC883_MEDION_MD2] = { | ||
| 6517 | .mixers = { alc883_medion_md2_mixer}, | ||
| 6518 | .init_verbs = { alc883_init_verbs, alc883_medion_md2_verbs}, | ||
| 6519 | .num_dacs = ARRAY_SIZE(alc883_dac_nids), | ||
| 6520 | .dac_nids = alc883_dac_nids, | ||
| 6521 | .dig_out_nid = ALC883_DIGOUT_NID, | ||
| 6522 | .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), | ||
| 6523 | .adc_nids = alc883_adc_nids, | ||
| 6524 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), | ||
| 6525 | .channel_mode = alc883_3ST_2ch_modes, | ||
| 6526 | .input_mux = &alc883_capture_source, | ||
| 6527 | .unsol_event = alc883_medion_md2_unsol_event, | ||
| 6528 | .init_hook = alc883_medion_md2_automute, | ||
| 6529 | }, | ||
| 6214 | [ALC883_LAPTOP_EAPD] = { | 6530 | [ALC883_LAPTOP_EAPD] = { |
| 6215 | .mixers = { alc883_base_mixer, | 6531 | .mixers = { alc883_base_mixer, |
| 6216 | alc883_chmode_mixer }, | 6532 | alc883_chmode_mixer }, |
| @@ -6236,6 +6552,35 @@ static struct alc_config_preset alc883_presets[] = { | |||
| 6236 | .unsol_event = alc883_lenovo_101e_unsol_event, | 6552 | .unsol_event = alc883_lenovo_101e_unsol_event, |
| 6237 | .init_hook = alc883_lenovo_101e_all_automute, | 6553 | .init_hook = alc883_lenovo_101e_all_automute, |
| 6238 | }, | 6554 | }, |
| 6555 | [ALC883_LENOVO_NB0763] = { | ||
| 6556 | .mixers = { alc883_lenovo_nb0763_mixer }, | ||
| 6557 | .init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs}, | ||
| 6558 | .num_dacs = ARRAY_SIZE(alc883_dac_nids), | ||
| 6559 | .dac_nids = alc883_dac_nids, | ||
| 6560 | .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), | ||
| 6561 | .adc_nids = alc883_adc_nids, | ||
| 6562 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), | ||
| 6563 | .channel_mode = alc883_3ST_2ch_modes, | ||
| 6564 | .need_dac_fix = 1, | ||
| 6565 | .input_mux = &alc883_lenovo_nb0763_capture_source, | ||
| 6566 | .unsol_event = alc883_medion_md2_unsol_event, | ||
| 6567 | .init_hook = alc883_medion_md2_automute, | ||
| 6568 | }, | ||
| 6569 | [ALC888_LENOVO_MS7195_DIG] = { | ||
| 6570 | .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer }, | ||
| 6571 | .init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs}, | ||
| 6572 | .num_dacs = ARRAY_SIZE(alc883_dac_nids), | ||
| 6573 | .dac_nids = alc883_dac_nids, | ||
| 6574 | .dig_out_nid = ALC883_DIGOUT_NID, | ||
| 6575 | .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), | ||
| 6576 | .adc_nids = alc883_adc_nids, | ||
| 6577 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), | ||
| 6578 | .channel_mode = alc883_3ST_6ch_modes, | ||
| 6579 | .need_dac_fix = 1, | ||
| 6580 | .input_mux = &alc883_capture_source, | ||
| 6581 | .unsol_event = alc883_lenovo_ms7195_unsol_event, | ||
| 6582 | .init_hook = alc888_lenovo_ms7195_front_automute, | ||
| 6583 | }, | ||
| 6239 | }; | 6584 | }; |
| 6240 | 6585 | ||
| 6241 | 6586 | ||
| @@ -6499,6 +6844,18 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = { | |||
| 6499 | { } /* end */ | 6844 | { } /* end */ |
| 6500 | }; | 6845 | }; |
| 6501 | 6846 | ||
| 6847 | static struct snd_kcontrol_new alc262_sony_mixer[] = { | ||
| 6848 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
| 6849 | HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
| 6850 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 6851 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 6852 | HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | ||
| 6853 | HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), | ||
| 6854 | { } /* end */ | ||
| 6855 | }; | ||
| 6856 | |||
| 6857 | |||
| 6858 | |||
| 6502 | #define alc262_capture_mixer alc882_capture_mixer | 6859 | #define alc262_capture_mixer alc882_capture_mixer |
| 6503 | #define alc262_capture_alt_mixer alc882_capture_alt_mixer | 6860 | #define alc262_capture_alt_mixer alc882_capture_alt_mixer |
| 6504 | 6861 | ||
| @@ -6597,6 +6954,15 @@ static struct hda_verb alc262_hippo1_unsol_verbs[] = { | |||
| 6597 | {} | 6954 | {} |
| 6598 | }; | 6955 | }; |
| 6599 | 6956 | ||
| 6957 | static struct hda_verb alc262_sony_unsol_verbs[] = { | ||
| 6958 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, | ||
| 6959 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
| 6960 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic | ||
| 6961 | |||
| 6962 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
| 6963 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
| 6964 | }; | ||
| 6965 | |||
| 6600 | /* mute/unmute internal speaker according to the hp jack and mute state */ | 6966 | /* mute/unmute internal speaker according to the hp jack and mute state */ |
| 6601 | static void alc262_hippo_automute(struct hda_codec *codec, int force) | 6967 | static void alc262_hippo_automute(struct hda_codec *codec, int force) |
| 6602 | { | 6968 | { |
| @@ -7215,6 +7581,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = { | |||
| 7215 | [ALC262_HP_BPC] = "hp-bpc", | 7581 | [ALC262_HP_BPC] = "hp-bpc", |
| 7216 | [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", | 7582 | [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", |
| 7217 | [ALC262_BENQ_ED8] = "benq", | 7583 | [ALC262_BENQ_ED8] = "benq", |
| 7584 | [ALC262_BENQ_ED8] = "sony-assamd", | ||
| 7218 | [ALC262_AUTO] = "auto", | 7585 | [ALC262_AUTO] = "auto", |
| 7219 | }; | 7586 | }; |
| 7220 | 7587 | ||
| @@ -7236,6 +7603,9 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
| 7236 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), | 7603 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), |
| 7237 | SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), | 7604 | SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), |
| 7238 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), | 7605 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), |
| 7606 | SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), | ||
| 7607 | SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), | ||
| 7608 | SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), | ||
| 7239 | {} | 7609 | {} |
| 7240 | }; | 7610 | }; |
| 7241 | 7611 | ||
| @@ -7327,6 +7697,17 @@ static struct alc_config_preset alc262_presets[] = { | |||
| 7327 | .channel_mode = alc262_modes, | 7697 | .channel_mode = alc262_modes, |
| 7328 | .input_mux = &alc262_capture_source, | 7698 | .input_mux = &alc262_capture_source, |
| 7329 | }, | 7699 | }, |
| 7700 | [ALC262_SONY_ASSAMD] = { | ||
| 7701 | .mixers = { alc262_sony_mixer }, | ||
| 7702 | .init_verbs = { alc262_init_verbs, alc262_sony_unsol_verbs}, | ||
| 7703 | .num_dacs = ARRAY_SIZE(alc262_dac_nids), | ||
| 7704 | .dac_nids = alc262_dac_nids, | ||
| 7705 | .hp_nid = 0x02, | ||
| 7706 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | ||
| 7707 | .channel_mode = alc262_modes, | ||
| 7708 | .input_mux = &alc262_capture_source, | ||
| 7709 | .unsol_event = alc262_hippo_unsol_event, | ||
| 7710 | }, | ||
| 7330 | }; | 7711 | }; |
| 7331 | 7712 | ||
| 7332 | static int patch_alc262(struct hda_codec *codec) | 7713 | static int patch_alc262(struct hda_codec *codec) |
| @@ -8599,6 +8980,15 @@ static struct hda_input_mux alc861vd_capture_source = { | |||
| 8599 | }, | 8980 | }, |
| 8600 | }; | 8981 | }; |
| 8601 | 8982 | ||
| 8983 | static struct hda_input_mux alc861vd_dallas_capture_source = { | ||
| 8984 | .num_items = 3, | ||
| 8985 | .items = { | ||
| 8986 | { "Front Mic", 0x0 }, | ||
| 8987 | { "ATAPI Mic", 0x1 }, | ||
| 8988 | { "Line In", 0x5 }, | ||
| 8989 | }, | ||
| 8990 | }; | ||
| 8991 | |||
| 8602 | #define alc861vd_mux_enum_info alc_mux_enum_info | 8992 | #define alc861vd_mux_enum_info alc_mux_enum_info |
| 8603 | #define alc861vd_mux_enum_get alc_mux_enum_get | 8993 | #define alc861vd_mux_enum_get alc_mux_enum_get |
| 8604 | 8994 | ||
| @@ -8782,6 +9172,34 @@ static struct snd_kcontrol_new alc861vd_lenovo_mixer[] = { | |||
| 8782 | { } /* end */ | 9172 | { } /* end */ |
| 8783 | }; | 9173 | }; |
| 8784 | 9174 | ||
| 9175 | /* Pin assignment: Front=0x14, HP = 0x15, | ||
| 9176 | * Front Mic=0x18, ATAPI Mic = 0x19, Line In = 0x1d | ||
| 9177 | */ | ||
| 9178 | static struct snd_kcontrol_new alc861vd_dallas_mixer[] = { | ||
| 9179 | HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT), | ||
| 9180 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | ||
| 9181 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), | ||
| 9182 | HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT), | ||
| 9183 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
| 9184 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
| 9185 | HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), | ||
| 9186 | HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), | ||
| 9187 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x05, HDA_INPUT), | ||
| 9188 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x05, HDA_INPUT), | ||
| 9189 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), | ||
| 9190 | HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), | ||
| 9191 | { | ||
| 9192 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
| 9193 | /* .name = "Capture Source", */ | ||
| 9194 | .name = "Input Source", | ||
| 9195 | .count = 1, | ||
| 9196 | .info = alc882_mux_enum_info, | ||
| 9197 | .get = alc882_mux_enum_get, | ||
| 9198 | .put = alc882_mux_enum_put, | ||
| 9199 | }, | ||
| 9200 | { } /* end */ | ||
| 9201 | }; | ||
| 9202 | |||
| 8785 | /* | 9203 | /* |
| 8786 | * generic initialization of ADC, input mixers and output mixers | 9204 | * generic initialization of ADC, input mixers and output mixers |
| 8787 | */ | 9205 | */ |
| @@ -8969,6 +9387,70 @@ static void alc861vd_lenovo_unsol_event(struct hda_codec *codec, | |||
| 8969 | } | 9387 | } |
| 8970 | } | 9388 | } |
| 8971 | 9389 | ||
| 9390 | static struct hda_verb alc861vd_dallas_verbs[] = { | ||
| 9391 | {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
| 9392 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
| 9393 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
| 9394 | {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
| 9395 | |||
| 9396 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 9397 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
| 9398 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
| 9399 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
| 9400 | {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
| 9401 | {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
| 9402 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
| 9403 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
| 9404 | |||
| 9405 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 9406 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
| 9407 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 9408 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
| 9409 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 9410 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
| 9411 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
| 9412 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
| 9413 | |||
| 9414 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, | ||
| 9415 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
| 9416 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, | ||
| 9417 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
| 9418 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
| 9419 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
| 9420 | {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
| 9421 | {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
| 9422 | |||
| 9423 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
| 9424 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | ||
| 9425 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | ||
| 9426 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | ||
| 9427 | |||
| 9428 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
| 9429 | {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
| 9430 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
| 9431 | |||
| 9432 | { } /* end */ | ||
| 9433 | }; | ||
| 9434 | |||
| 9435 | /* toggle speaker-output according to the hp-jack state */ | ||
| 9436 | static void alc861vd_dallas_automute(struct hda_codec *codec) | ||
| 9437 | { | ||
| 9438 | unsigned int present; | ||
| 9439 | |||
| 9440 | present = snd_hda_codec_read(codec, 0x15, 0, | ||
| 9441 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 9442 | snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | ||
| 9443 | 0x80, present ? 0x80 : 0); | ||
| 9444 | snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | ||
| 9445 | 0x80, present ? 0x80 : 0); | ||
| 9446 | } | ||
| 9447 | |||
| 9448 | static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int res) | ||
| 9449 | { | ||
| 9450 | if ((res >> 26) == ALC880_HP_EVENT) | ||
| 9451 | alc861vd_dallas_automute(codec); | ||
| 9452 | } | ||
| 9453 | |||
| 8972 | /* pcm configuration: identiacal with ALC880 */ | 9454 | /* pcm configuration: identiacal with ALC880 */ |
| 8973 | #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback | 9455 | #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback |
| 8974 | #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture | 9456 | #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture |
| @@ -8984,6 +9466,7 @@ static const char *alc861vd_models[ALC861VD_MODEL_LAST] = { | |||
| 8984 | [ALC861VD_3ST_DIG] = "3stack-digout", | 9466 | [ALC861VD_3ST_DIG] = "3stack-digout", |
| 8985 | [ALC861VD_6ST_DIG] = "6stack-digout", | 9467 | [ALC861VD_6ST_DIG] = "6stack-digout", |
| 8986 | [ALC861VD_LENOVO] = "lenovo", | 9468 | [ALC861VD_LENOVO] = "lenovo", |
| 9469 | [ALC861VD_DALLAS] = "dallas", | ||
| 8987 | [ALC861VD_AUTO] = "auto", | 9470 | [ALC861VD_AUTO] = "auto", |
| 8988 | }; | 9471 | }; |
| 8989 | 9472 | ||
| @@ -8993,6 +9476,8 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
| 8993 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 9476 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
| 8994 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), | 9477 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), |
| 8995 | 9478 | ||
| 9479 | SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS), | ||
| 9480 | SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), | ||
| 8996 | SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), | 9481 | SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), |
| 8997 | SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), | 9482 | SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), |
| 8998 | {} | 9483 | {} |
| @@ -9059,6 +9544,19 @@ static struct alc_config_preset alc861vd_presets[] = { | |||
| 9059 | .unsol_event = alc861vd_lenovo_unsol_event, | 9544 | .unsol_event = alc861vd_lenovo_unsol_event, |
| 9060 | .init_hook = alc861vd_lenovo_automute, | 9545 | .init_hook = alc861vd_lenovo_automute, |
| 9061 | }, | 9546 | }, |
| 9547 | [ALC861VD_DALLAS] = { | ||
| 9548 | .mixers = { alc861vd_dallas_mixer }, | ||
| 9549 | .init_verbs = { alc861vd_dallas_verbs }, | ||
| 9550 | .num_dacs = ARRAY_SIZE(alc861vd_dac_nids), | ||
| 9551 | .dac_nids = alc861vd_dac_nids, | ||
| 9552 | .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids), | ||
| 9553 | .adc_nids = alc861vd_adc_nids, | ||
| 9554 | .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes), | ||
| 9555 | .channel_mode = alc861vd_3stack_2ch_modes, | ||
| 9556 | .input_mux = &alc861vd_dallas_capture_source, | ||
| 9557 | .unsol_event = alc861vd_dallas_unsol_event, | ||
| 9558 | .init_hook = alc861vd_dallas_automute, | ||
| 9559 | }, | ||
| 9062 | }; | 9560 | }; |
| 9063 | 9561 | ||
| 9064 | /* | 9562 | /* |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 93ae9c250767..a6a0a80edc3b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -467,6 +467,8 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = { | |||
| 467 | "Dell XPS M1710", STAC_REF), | 467 | "Dell XPS M1710", STAC_REF), |
| 468 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf, | 468 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf, |
| 469 | "Dell Precision M90", STAC_REF), | 469 | "Dell Precision M90", STAC_REF), |
| 470 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6, | ||
| 471 | "unknown Dell", STAC_REF), | ||
| 470 | {} /* terminator */ | 472 | {} /* terminator */ |
| 471 | }; | 473 | }; |
| 472 | 474 | ||
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 202f720b34b9..da9734073dba 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
| @@ -1799,6 +1799,18 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
| 1799 | }, | 1799 | }, |
| 1800 | { | 1800 | { |
| 1801 | .subvendor = 0x1028, | 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 | .subdevice = 0x0191, | 1814 | .subdevice = 0x0191, |
| 1803 | .name = "Dell Inspiron 8600", | 1815 | .name = "Dell Inspiron 8600", |
| 1804 | .type = AC97_TUNE_HP_ONLY | 1816 | .type = AC97_TUNE_HP_ONLY |
| @@ -1819,7 +1831,7 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
| 1819 | .subvendor = 0x103c, | 1831 | .subvendor = 0x103c, |
| 1820 | .subdevice = 0x088c, | 1832 | .subdevice = 0x088c, |
| 1821 | .name = "HP nc8000", | 1833 | .name = "HP nc8000", |
| 1822 | .type = AC97_TUNE_MUTE_LED | 1834 | .type = AC97_TUNE_HP_MUTE_LED |
| 1823 | }, | 1835 | }, |
| 1824 | { | 1836 | { |
| 1825 | .subvendor = 0x103c, | 1837 | .subvendor = 0x103c, |
| @@ -1913,6 +1925,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
| 1913 | }, | 1925 | }, |
| 1914 | { | 1926 | { |
| 1915 | .subvendor = 0x10cf, | 1927 | .subvendor = 0x10cf, |
| 1928 | .subdevice = 0x127e, | ||
| 1929 | .name = "Fujitsu Lifebook C1211D", | ||
| 1930 | .type = AC97_TUNE_HP_ONLY | ||
| 1931 | }, | ||
| 1932 | { | ||
| 1933 | .subvendor = 0x10cf, | ||
| 1916 | .subdevice = 0x12ec, | 1934 | .subdevice = 0x12ec, |
| 1917 | .name = "Fujitsu-Siemens 4010", | 1935 | .name = "Fujitsu-Siemens 4010", |
| 1918 | .type = AC97_TUNE_HP_ONLY | 1936 | .type = AC97_TUNE_HP_ONLY |
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 0cdef971cbd3..0b8a6f8b3668 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c | |||
| @@ -43,8 +43,9 @@ static int ac97_prepare(struct snd_pcm_substream *substream) | |||
| 43 | #define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ | 43 | #define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ |
| 44 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 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 | .name = "AC97 HiFi", | 47 | .name = "AC97 HiFi", |
| 48 | .type = SND_SOC_DAI_AC97, | ||
| 48 | .playback = { | 49 | .playback = { |
| 49 | .stream_name = "AC97 Playback", | 50 | .stream_name = "AC97 Playback", |
| 50 | .channels_min = 1, | 51 | .channels_min = 1, |
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 264413a00cac..986b5d59cefa 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
| @@ -544,6 +544,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream) | |||
| 544 | struct snd_soc_codec_dai wm9712_dai[] = { | 544 | struct snd_soc_codec_dai wm9712_dai[] = { |
| 545 | { | 545 | { |
| 546 | .name = "AC97 HiFi", | 546 | .name = "AC97 HiFi", |
| 547 | .type = SND_SOC_DAI_AC97_BUS, | ||
| 547 | .playback = { | 548 | .playback = { |
| 548 | .stream_name = "HiFi Playback", | 549 | .stream_name = "HiFi Playback", |
| 549 | .channels_min = 1, | 550 | .channels_min = 1, |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 36519aef55d9..92d5d917b73b 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -116,6 +116,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) | |||
| 116 | static inline const char* get_dai_name(int type) | 116 | static inline const char* get_dai_name(int type) |
| 117 | { | 117 | { |
| 118 | switch(type) { | 118 | switch(type) { |
| 119 | case SND_SOC_DAI_AC97_BUS: | ||
| 119 | case SND_SOC_DAI_AC97: | 120 | case SND_SOC_DAI_AC97: |
| 120 | return "AC97"; | 121 | return "AC97"; |
| 121 | case SND_SOC_DAI_I2S: | 122 | case SND_SOC_DAI_I2S: |
| @@ -1099,7 +1100,8 @@ int snd_soc_register_card(struct snd_soc_device *socdev) | |||
| 1099 | continue; | 1100 | continue; |
| 1100 | } | 1101 | } |
| 1101 | } | 1102 | } |
| 1102 | if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) | 1103 | if (socdev->machine->dai_link[i].codec_dai->type == |
| 1104 | SND_SOC_DAI_AC97_BUS) | ||
| 1103 | ac97 = 1; | 1105 | ac97 = 1; |
| 1104 | } | 1106 | } |
| 1105 | snprintf(codec->card->shortname, sizeof(codec->card->shortname), | 1107 | snprintf(codec->card->shortname, sizeof(codec->card->shortname), |
| @@ -1148,11 +1150,21 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card); | |||
| 1148 | void snd_soc_free_pcms(struct snd_soc_device *socdev) | 1150 | void snd_soc_free_pcms(struct snd_soc_device *socdev) |
| 1149 | { | 1151 | { |
| 1150 | struct snd_soc_codec *codec = socdev->codec; | 1152 | struct snd_soc_codec *codec = socdev->codec; |
| 1153 | #ifdef CONFIG_SND_SOC_AC97_BUS | ||
| 1154 | struct snd_soc_codec_dai *codec_dai; | ||
| 1155 | int i; | ||
| 1156 | #endif | ||
| 1151 | 1157 | ||
| 1152 | mutex_lock(&codec->mutex); | 1158 | mutex_lock(&codec->mutex); |
| 1153 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1159 | #ifdef CONFIG_SND_SOC_AC97_BUS |
| 1154 | if (codec->ac97) | 1160 | for(i = 0; i < codec->num_dai; i++) { |
| 1155 | soc_ac97_dev_unregister(codec); | 1161 | codec_dai = &codec->dai[i]; |
| 1162 | if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) { | ||
| 1163 | soc_ac97_dev_unregister(codec); | ||
| 1164 | goto free_card; | ||
| 1165 | } | ||
| 1166 | } | ||
| 1167 | free_card: | ||
| 1156 | #endif | 1168 | #endif |
| 1157 | 1169 | ||
| 1158 | if (codec->card) | 1170 | if (codec->card) |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 7b3bf3545a3b..325d4b6b54aa 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
| @@ -360,7 +360,7 @@ static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int vali | |||
| 360 | request, | 360 | request, |
| 361 | USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, | 361 | USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, |
| 362 | validx, cval->mixer->ctrlif | (cval->id << 8), | 362 | validx, cval->mixer->ctrlif | (cval->id << 8), |
| 363 | buf, val_len, 100) >= 0) { | 363 | buf, val_len, 100) >= val_len) { |
| 364 | *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); | 364 | *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); |
| 365 | return 0; | 365 | return 0; |
| 366 | } | 366 | } |
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 8fcbe93b2589..374fbf657a2d 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
| @@ -48,6 +48,15 @@ | |||
| 48 | USB_DEVICE_ID_MATCH_INT_CLASS | | 48 | USB_DEVICE_ID_MATCH_INT_CLASS | |
| 49 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 49 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
| 50 | .idVendor = 0x046d, | 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 | .idProduct = 0x08f0, | 60 | .idProduct = 0x08f0, |
| 52 | .bInterfaceClass = USB_CLASS_AUDIO, | 61 | .bInterfaceClass = USB_CLASS_AUDIO, |
| 53 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 62 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL |
