Updated from Linux LTS 3.10.21 to 3.10.22
This commit is contained in:
parent
8de512f759
commit
fb417c8ab5
@ -291,13 +291,24 @@ Default value is "/sbin/hotplug".
|
|||||||
kptr_restrict:
|
kptr_restrict:
|
||||||
|
|
||||||
This toggle indicates whether restrictions are placed on
|
This toggle indicates whether restrictions are placed on
|
||||||
exposing kernel addresses via /proc and other interfaces. When
|
exposing kernel addresses via /proc and other interfaces.
|
||||||
kptr_restrict is set to (0), there are no restrictions. When
|
|
||||||
kptr_restrict is set to (1), the default, kernel pointers
|
When kptr_restrict is set to (0), the default, there are no restrictions.
|
||||||
printed using the %pK format specifier will be replaced with 0's
|
|
||||||
unless the user has CAP_SYSLOG. When kptr_restrict is set to
|
When kptr_restrict is set to (1), kernel pointers printed using the %pK
|
||||||
(2), kernel pointers printed using %pK will be replaced with 0's
|
format specifier will be replaced with 0's unless the user has CAP_SYSLOG
|
||||||
regardless of privileges.
|
and effective user and group ids are equal to the real ids. This is
|
||||||
|
because %pK checks are done at read() time rather than open() time, so
|
||||||
|
if permissions are elevated between the open() and the read() (e.g via
|
||||||
|
a setuid binary) then %pK will not leak kernel pointers to unprivileged
|
||||||
|
users. Note, this is a temporary solution only. The correct long-term
|
||||||
|
solution is to do the permission checks at open() time. Consider removing
|
||||||
|
world read permissions from files that use %pK, and using dmesg_restrict
|
||||||
|
to protect against uses of %pK in dmesg(8) if leaking kernel pointer
|
||||||
|
values to unprivileged users is a concern.
|
||||||
|
|
||||||
|
When kptr_restrict is set to (2), kernel pointers printed using
|
||||||
|
%pK will be replaced with 0's regardless of privileges.
|
||||||
|
|
||||||
==============================================================
|
==============================================================
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
|||||||
VERSION = 3
|
VERSION = 3
|
||||||
PATCHLEVEL = 10
|
PATCHLEVEL = 10
|
||||||
SUBLEVEL = 21
|
SUBLEVEL = 22
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = TOSSUG Baby Fish
|
NAME = TOSSUG Baby Fish
|
||||||
|
|
||||||
|
@ -85,6 +85,8 @@
|
|||||||
reg = <0x7e205000 0x1000>;
|
reg = <0x7e205000 0x1000>;
|
||||||
interrupts = <2 21>;
|
interrupts = <2 21>;
|
||||||
clocks = <&clk_i2c>;
|
clocks = <&clk_i2c>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -93,6 +95,8 @@
|
|||||||
reg = <0x7e804000 0x1000>;
|
reg = <0x7e804000 0x1000>;
|
||||||
interrupts = <2 21>;
|
interrupts = <2 21>;
|
||||||
clocks = <&clk_i2c>;
|
clocks = <&clk_i2c>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,6 +27,13 @@
|
|||||||
i2c2_bus: i2c2-bus {
|
i2c2_bus: i2c2-bus {
|
||||||
samsung,pin-pud = <0>;
|
samsung,pin-pud = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
max77686_irq: max77686-irq {
|
||||||
|
samsung,pins = "gpx3-2";
|
||||||
|
samsung,pin-function = <0>;
|
||||||
|
samsung,pin-pud = <0>;
|
||||||
|
samsung,pin-drv = <0>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
i2c@12C60000 {
|
i2c@12C60000 {
|
||||||
@ -35,6 +42,11 @@
|
|||||||
|
|
||||||
max77686@09 {
|
max77686@09 {
|
||||||
compatible = "maxim,max77686";
|
compatible = "maxim,max77686";
|
||||||
|
interrupt-parent = <&gpx3>;
|
||||||
|
interrupts = <2 0>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&max77686_irq>;
|
||||||
|
wakeup-source;
|
||||||
reg = <0x09>;
|
reg = <0x09>;
|
||||||
|
|
||||||
voltage-regulators {
|
voltage-regulators {
|
||||||
|
@ -192,6 +192,7 @@ __dabt_svc:
|
|||||||
svc_entry
|
svc_entry
|
||||||
mov r2, sp
|
mov r2, sp
|
||||||
dabt_helper
|
dabt_helper
|
||||||
|
THUMB( ldr r5, [sp, #S_PSR] ) @ potentially updated CPSR
|
||||||
svc_exit r5 @ return from exception
|
svc_exit r5 @ return from exception
|
||||||
UNWIND(.fnend )
|
UNWIND(.fnend )
|
||||||
ENDPROC(__dabt_svc)
|
ENDPROC(__dabt_svc)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Makefile for the linux kernel.
|
# Makefile for the linux kernel.
|
||||||
#
|
#
|
||||||
|
|
||||||
obj-y := irq.o gpio.o setup.o
|
obj-y := irq.o gpio.o setup.o sysirq_mask.o
|
||||||
obj-m :=
|
obj-m :=
|
||||||
obj-n :=
|
obj-n :=
|
||||||
obj- :=
|
obj- :=
|
||||||
|
@ -351,6 +351,8 @@ static void __init at91sam9260_initialize(void)
|
|||||||
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
|
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
|
||||||
| (1 << AT91SAM9260_ID_IRQ2);
|
| (1 << AT91SAM9260_ID_IRQ2);
|
||||||
|
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9260_BASE_RTT);
|
||||||
|
|
||||||
/* Register GPIO subsystem */
|
/* Register GPIO subsystem */
|
||||||
at91_gpio_init(at91sam9260_gpio, 3);
|
at91_gpio_init(at91sam9260_gpio, 3);
|
||||||
}
|
}
|
||||||
|
@ -293,6 +293,8 @@ static void __init at91sam9261_initialize(void)
|
|||||||
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
|
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
|
||||||
| (1 << AT91SAM9261_ID_IRQ2);
|
| (1 << AT91SAM9261_ID_IRQ2);
|
||||||
|
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9261_BASE_RTT);
|
||||||
|
|
||||||
/* Register GPIO subsystem */
|
/* Register GPIO subsystem */
|
||||||
at91_gpio_init(at91sam9261_gpio, 3);
|
at91_gpio_init(at91sam9261_gpio, 3);
|
||||||
}
|
}
|
||||||
|
@ -329,6 +329,9 @@ static void __init at91sam9263_initialize(void)
|
|||||||
arm_pm_restart = at91sam9_alt_restart;
|
arm_pm_restart = at91sam9_alt_restart;
|
||||||
at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
|
at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
|
||||||
|
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT0);
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9263_BASE_RTT1);
|
||||||
|
|
||||||
/* Register GPIO subsystem */
|
/* Register GPIO subsystem */
|
||||||
at91_gpio_init(at91sam9263_gpio, 5);
|
at91_gpio_init(at91sam9263_gpio, 5);
|
||||||
}
|
}
|
||||||
|
@ -376,6 +376,9 @@ static void __init at91sam9g45_initialize(void)
|
|||||||
arm_pm_restart = at91sam9g45_restart;
|
arm_pm_restart = at91sam9g45_restart;
|
||||||
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
|
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
|
||||||
|
|
||||||
|
at91_sysirq_mask_rtc(AT91SAM9G45_BASE_RTC);
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9G45_BASE_RTT);
|
||||||
|
|
||||||
/* Register GPIO subsystem */
|
/* Register GPIO subsystem */
|
||||||
at91_gpio_init(at91sam9g45_gpio, 5);
|
at91_gpio_init(at91sam9g45_gpio, 5);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,13 @@ static void __init at91sam9n12_map_io(void)
|
|||||||
at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
|
at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __init at91sam9n12_initialize(void)
|
||||||
|
{
|
||||||
|
at91_sysirq_mask_rtc(AT91SAM9N12_BASE_RTC);
|
||||||
|
}
|
||||||
|
|
||||||
AT91_SOC_START(at91sam9n12)
|
AT91_SOC_START(at91sam9n12)
|
||||||
.map_io = at91sam9n12_map_io,
|
.map_io = at91sam9n12_map_io,
|
||||||
.register_clocks = at91sam9n12_register_clocks,
|
.register_clocks = at91sam9n12_register_clocks,
|
||||||
|
.init = at91sam9n12_initialize,
|
||||||
AT91_SOC_END
|
AT91_SOC_END
|
||||||
|
@ -295,6 +295,9 @@ static void __init at91sam9rl_initialize(void)
|
|||||||
arm_pm_restart = at91sam9_alt_restart;
|
arm_pm_restart = at91sam9_alt_restart;
|
||||||
at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
|
at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
|
||||||
|
|
||||||
|
at91_sysirq_mask_rtc(AT91SAM9RL_BASE_RTC);
|
||||||
|
at91_sysirq_mask_rtt(AT91SAM9RL_BASE_RTT);
|
||||||
|
|
||||||
/* Register GPIO subsystem */
|
/* Register GPIO subsystem */
|
||||||
at91_gpio_init(at91sam9rl_gpio, 4);
|
at91_gpio_init(at91sam9rl_gpio, 4);
|
||||||
}
|
}
|
||||||
|
@ -318,6 +318,11 @@ static void __init at91sam9x5_map_io(void)
|
|||||||
at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
|
at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __init at91sam9x5_initialize(void)
|
||||||
|
{
|
||||||
|
at91_sysirq_mask_rtc(AT91SAM9X5_BASE_RTC);
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------
|
/* --------------------------------------------------------------------
|
||||||
* Interrupt initialization
|
* Interrupt initialization
|
||||||
* -------------------------------------------------------------------- */
|
* -------------------------------------------------------------------- */
|
||||||
@ -325,4 +330,5 @@ static void __init at91sam9x5_map_io(void)
|
|||||||
AT91_SOC_START(at91sam9x5)
|
AT91_SOC_START(at91sam9x5)
|
||||||
.map_io = at91sam9x5_map_io,
|
.map_io = at91sam9x5_map_io,
|
||||||
.register_clocks = at91sam9x5_register_clocks,
|
.register_clocks = at91sam9x5_register_clocks,
|
||||||
|
.init = at91sam9x5_initialize,
|
||||||
AT91_SOC_END
|
AT91_SOC_END
|
||||||
|
@ -33,6 +33,8 @@ extern int __init at91_aic_of_init(struct device_node *node,
|
|||||||
struct device_node *parent);
|
struct device_node *parent);
|
||||||
extern int __init at91_aic5_of_init(struct device_node *node,
|
extern int __init at91_aic5_of_init(struct device_node *node,
|
||||||
struct device_node *parent);
|
struct device_node *parent);
|
||||||
|
extern void __init at91_sysirq_mask_rtc(u32 rtc_base);
|
||||||
|
extern void __init at91_sysirq_mask_rtt(u32 rtt_base);
|
||||||
|
|
||||||
|
|
||||||
/* Timer */
|
/* Timer */
|
||||||
|
@ -48,6 +48,11 @@
|
|||||||
#define AT91SAM9N12_BASE_USART2 0xf8024000
|
#define AT91SAM9N12_BASE_USART2 0xf8024000
|
||||||
#define AT91SAM9N12_BASE_USART3 0xf8028000
|
#define AT91SAM9N12_BASE_USART3 0xf8028000
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System Peripherals
|
||||||
|
*/
|
||||||
|
#define AT91SAM9N12_BASE_RTC 0xfffffeb0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal Memory.
|
* Internal Memory.
|
||||||
*/
|
*/
|
||||||
|
@ -54,6 +54,11 @@
|
|||||||
#define AT91SAM9X5_BASE_USART1 0xf8020000
|
#define AT91SAM9X5_BASE_USART1 0xf8020000
|
||||||
#define AT91SAM9X5_BASE_USART2 0xf8024000
|
#define AT91SAM9X5_BASE_USART2 0xf8024000
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System Peripherals
|
||||||
|
*/
|
||||||
|
#define AT91SAM9X5_BASE_RTC 0xfffffeb0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal Memory.
|
* Internal Memory.
|
||||||
*/
|
*/
|
||||||
|
@ -64,6 +64,11 @@
|
|||||||
#define SAMA5D3_ID_TRNG 45 /* True Random Generator Number */
|
#define SAMA5D3_ID_TRNG 45 /* True Random Generator Number */
|
||||||
#define SAMA5D3_ID_IRQ0 47 /* Advanced Interrupt Controller (IRQ0) */
|
#define SAMA5D3_ID_IRQ0 47 /* Advanced Interrupt Controller (IRQ0) */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System Peripherals
|
||||||
|
*/
|
||||||
|
#define SAMA5D3_BASE_RTC 0xfffffeb0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal Memory
|
* Internal Memory
|
||||||
*/
|
*/
|
||||||
|
@ -371,7 +371,13 @@ static void __init sama5d3_map_io(void)
|
|||||||
at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
|
at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __init sama5d3_initialize(void)
|
||||||
|
{
|
||||||
|
at91_sysirq_mask_rtc(SAMA5D3_BASE_RTC);
|
||||||
|
}
|
||||||
|
|
||||||
AT91_SOC_START(sama5d3)
|
AT91_SOC_START(sama5d3)
|
||||||
.map_io = sama5d3_map_io,
|
.map_io = sama5d3_map_io,
|
||||||
.register_clocks = sama5d3_register_clocks,
|
.register_clocks = sama5d3_register_clocks,
|
||||||
|
.init = sama5d3_initialize,
|
||||||
AT91_SOC_END
|
AT91_SOC_END
|
||||||
|
71
arch/arm/mach-at91/sysirq_mask.c
Normal file
71
arch/arm/mach-at91/sysirq_mask.c
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* sysirq_mask.c - System-interrupt masking
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Johan Hovold <jhovold@gmail.com>
|
||||||
|
*
|
||||||
|
* Functions to disable system interrupts from backup-powered peripherals.
|
||||||
|
*
|
||||||
|
* The RTC and RTT-peripherals are generally powered by backup power (VDDBU)
|
||||||
|
* and are not reset on wake-up, user, watchdog or software reset. This means
|
||||||
|
* that their interrupts may be enabled during early boot (e.g. after a user
|
||||||
|
* reset).
|
||||||
|
*
|
||||||
|
* As the RTC and RTT share the system-interrupt line with the PIT, an
|
||||||
|
* interrupt occurring before a handler has been installed would lead to the
|
||||||
|
* system interrupt being disabled and prevent the system from booting.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <mach/at91_rtt.h>
|
||||||
|
|
||||||
|
#include "generic.h"
|
||||||
|
|
||||||
|
#define AT91_RTC_IDR 0x24 /* Interrupt Disable Register */
|
||||||
|
#define AT91_RTC_IMR 0x28 /* Interrupt Mask Register */
|
||||||
|
|
||||||
|
void __init at91_sysirq_mask_rtc(u32 rtc_base)
|
||||||
|
{
|
||||||
|
void __iomem *base;
|
||||||
|
u32 mask;
|
||||||
|
|
||||||
|
base = ioremap(rtc_base, 64);
|
||||||
|
if (!base)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mask = readl_relaxed(base + AT91_RTC_IMR);
|
||||||
|
if (mask) {
|
||||||
|
pr_info("AT91: Disabling rtc irq\n");
|
||||||
|
writel_relaxed(mask, base + AT91_RTC_IDR);
|
||||||
|
(void)readl_relaxed(base + AT91_RTC_IMR); /* flush */
|
||||||
|
}
|
||||||
|
|
||||||
|
iounmap(base);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __init at91_sysirq_mask_rtt(u32 rtt_base)
|
||||||
|
{
|
||||||
|
void __iomem *base;
|
||||||
|
void __iomem *reg;
|
||||||
|
u32 mode;
|
||||||
|
|
||||||
|
base = ioremap(rtt_base, 16);
|
||||||
|
if (!base)
|
||||||
|
return;
|
||||||
|
|
||||||
|
reg = base + AT91_RTT_MR;
|
||||||
|
|
||||||
|
mode = readl_relaxed(reg);
|
||||||
|
if (mode & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)) {
|
||||||
|
pr_info("AT91: Disabling rtt irq\n");
|
||||||
|
mode &= ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
|
||||||
|
writel_relaxed(mode, reg);
|
||||||
|
(void)readl_relaxed(reg); /* flush */
|
||||||
|
}
|
||||||
|
|
||||||
|
iounmap(base);
|
||||||
|
}
|
@ -424,7 +424,7 @@ int __init mx6q_clocks_init(void)
|
|||||||
clk[asrc_podf] = imx_clk_divider("asrc_podf", "asrc_pred", base + 0x30, 9, 3);
|
clk[asrc_podf] = imx_clk_divider("asrc_podf", "asrc_pred", base + 0x30, 9, 3);
|
||||||
clk[spdif_pred] = imx_clk_divider("spdif_pred", "spdif_sel", base + 0x30, 25, 3);
|
clk[spdif_pred] = imx_clk_divider("spdif_pred", "spdif_sel", base + 0x30, 25, 3);
|
||||||
clk[spdif_podf] = imx_clk_divider("spdif_podf", "spdif_pred", base + 0x30, 22, 3);
|
clk[spdif_podf] = imx_clk_divider("spdif_podf", "spdif_pred", base + 0x30, 22, 3);
|
||||||
clk[can_root] = imx_clk_divider("can_root", "pll3_usb_otg", base + 0x20, 2, 6);
|
clk[can_root] = imx_clk_divider("can_root", "pll3_60m", base + 0x20, 2, 6);
|
||||||
clk[ecspi_root] = imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6);
|
clk[ecspi_root] = imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6);
|
||||||
clk[gpu2d_core_podf] = imx_clk_divider("gpu2d_core_podf", "gpu2d_core_sel", base + 0x18, 23, 3);
|
clk[gpu2d_core_podf] = imx_clk_divider("gpu2d_core_podf", "gpu2d_core_sel", base + 0x18, 23, 3);
|
||||||
clk[gpu3d_core_podf] = imx_clk_divider("gpu3d_core_podf", "gpu3d_core_sel", base + 0x18, 26, 3);
|
clk[gpu3d_core_podf] = imx_clk_divider("gpu3d_core_podf", "gpu3d_core_sel", base + 0x18, 26, 3);
|
||||||
|
@ -199,7 +199,8 @@ static struct mmci_platform_data mmc_data = {
|
|||||||
static void cp_clcd_enable(struct clcd_fb *fb)
|
static void cp_clcd_enable(struct clcd_fb *fb)
|
||||||
{
|
{
|
||||||
struct fb_var_screeninfo *var = &fb->fb.var;
|
struct fb_var_screeninfo *var = &fb->fb.var;
|
||||||
u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
|
u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2
|
||||||
|
| CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1;
|
||||||
|
|
||||||
if (var->bits_per_pixel <= 8 ||
|
if (var->bits_per_pixel <= 8 ||
|
||||||
(var->bits_per_pixel == 16 && var->green.length == 5))
|
(var->bits_per_pixel == 16 && var->green.length == 5))
|
||||||
|
@ -233,7 +233,7 @@ static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
irqnr = readl_relaxed(base_addr + 0xd8);
|
irqnr = readl_relaxed(base_addr + 0xd8);
|
||||||
#ifdef CONFIG_SOC_TI81XX
|
#if IS_ENABLED(CONFIG_SOC_TI81XX) || IS_ENABLED(CONFIG_SOC_AM33XX)
|
||||||
if (irqnr)
|
if (irqnr)
|
||||||
goto out;
|
goto out;
|
||||||
irqnr = readl_relaxed(base_addr + 0xf8);
|
irqnr = readl_relaxed(base_addr + 0xf8);
|
||||||
|
@ -512,6 +512,9 @@ static void __init assabet_map_io(void)
|
|||||||
* Its called GPCLKR0 in my SA1110 manual.
|
* Its called GPCLKR0 in my SA1110 manual.
|
||||||
*/
|
*/
|
||||||
Ser1SDCR0 |= SDCR0_SUS;
|
Ser1SDCR0 |= SDCR0_SUS;
|
||||||
|
MSC1 = (MSC1 & ~0xffff) |
|
||||||
|
MSC_NonBrst | MSC_32BitStMem |
|
||||||
|
MSC_RdAcc(2) | MSC_WrAcc(2) | MSC_Rec(0);
|
||||||
|
|
||||||
if (!machine_has_neponset())
|
if (!machine_has_neponset())
|
||||||
sa1100_register_uart_fns(&assabet_port_fns);
|
sa1100_register_uart_fns(&assabet_port_fns);
|
||||||
|
@ -9,8 +9,13 @@ int fixup_exception(struct pt_regs *regs)
|
|||||||
const struct exception_table_entry *fixup;
|
const struct exception_table_entry *fixup;
|
||||||
|
|
||||||
fixup = search_exception_tables(instruction_pointer(regs));
|
fixup = search_exception_tables(instruction_pointer(regs));
|
||||||
if (fixup)
|
if (fixup) {
|
||||||
regs->ARM_pc = fixup->fixup;
|
regs->ARM_pc = fixup->fixup;
|
||||||
|
#ifdef CONFIG_THUMB2_KERNEL
|
||||||
|
/* Clear the IT state to avoid nasty surprises in the fixup */
|
||||||
|
regs->ARM_cpsr &= ~PSR_IT_MASK;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return fixup != NULL;
|
return fixup != NULL;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*/
|
*/
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
|
#include <asm/thread_info.h>
|
||||||
|
#include <asm/sysreg.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The kernel is loaded where we want it to be and all caches
|
* The kernel is loaded where we want it to be and all caches
|
||||||
@ -20,11 +22,6 @@
|
|||||||
.section .init.text,"ax"
|
.section .init.text,"ax"
|
||||||
.global _start
|
.global _start
|
||||||
_start:
|
_start:
|
||||||
/* Check if the boot loader actually provided a tag table */
|
|
||||||
lddpc r0, magic_number
|
|
||||||
cp.w r12, r0
|
|
||||||
brne no_tag_table
|
|
||||||
|
|
||||||
/* Initialize .bss */
|
/* Initialize .bss */
|
||||||
lddpc r2, bss_start_addr
|
lddpc r2, bss_start_addr
|
||||||
lddpc r3, end_addr
|
lddpc r3, end_addr
|
||||||
@ -34,6 +31,25 @@ _start:
|
|||||||
cp r2, r3
|
cp r2, r3
|
||||||
brlo 1b
|
brlo 1b
|
||||||
|
|
||||||
|
/* Initialize status register */
|
||||||
|
lddpc r0, init_sr
|
||||||
|
mtsr SYSREG_SR, r0
|
||||||
|
|
||||||
|
/* Set initial stack pointer */
|
||||||
|
lddpc sp, stack_addr
|
||||||
|
sub sp, -THREAD_SIZE
|
||||||
|
|
||||||
|
#ifdef CONFIG_FRAME_POINTER
|
||||||
|
/* Mark last stack frame */
|
||||||
|
mov lr, 0
|
||||||
|
mov r7, 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Check if the boot loader actually provided a tag table */
|
||||||
|
lddpc r0, magic_number
|
||||||
|
cp.w r12, r0
|
||||||
|
brne no_tag_table
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the tag table address for later use. This must be done
|
* Save the tag table address for later use. This must be done
|
||||||
* _after_ .bss has been initialized...
|
* _after_ .bss has been initialized...
|
||||||
@ -53,8 +69,15 @@ bss_start_addr:
|
|||||||
.long __bss_start
|
.long __bss_start
|
||||||
end_addr:
|
end_addr:
|
||||||
.long _end
|
.long _end
|
||||||
|
init_sr:
|
||||||
|
.long 0x007f0000 /* Supervisor mode, everything masked */
|
||||||
|
stack_addr:
|
||||||
|
.long init_thread_union
|
||||||
|
panic_addr:
|
||||||
|
.long panic
|
||||||
|
|
||||||
no_tag_table:
|
no_tag_table:
|
||||||
sub r12, pc, (. - 2f)
|
sub r12, pc, (. - 2f)
|
||||||
bral panic
|
/* branch to panic() which can be far away with that construct */
|
||||||
|
lddpc pc, panic_addr
|
||||||
2: .asciz "Boot loader didn't provide correct magic number\n"
|
2: .asciz "Boot loader didn't provide correct magic number\n"
|
||||||
|
@ -401,9 +401,10 @@ handle_critical:
|
|||||||
/* We should never get here... */
|
/* We should never get here... */
|
||||||
bad_return:
|
bad_return:
|
||||||
sub r12, pc, (. - 1f)
|
sub r12, pc, (. - 1f)
|
||||||
bral panic
|
lddpc pc, 2f
|
||||||
.align 2
|
.align 2
|
||||||
1: .asciz "Return from critical exception!"
|
1: .asciz "Return from critical exception!"
|
||||||
|
2: .long panic
|
||||||
|
|
||||||
.align 1
|
.align 1
|
||||||
do_bus_error_write:
|
do_bus_error_write:
|
||||||
|
@ -10,33 +10,13 @@
|
|||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/thread_info.h>
|
|
||||||
#include <asm/sysreg.h>
|
|
||||||
|
|
||||||
.section .init.text,"ax"
|
.section .init.text,"ax"
|
||||||
.global kernel_entry
|
.global kernel_entry
|
||||||
kernel_entry:
|
kernel_entry:
|
||||||
/* Initialize status register */
|
|
||||||
lddpc r0, init_sr
|
|
||||||
mtsr SYSREG_SR, r0
|
|
||||||
|
|
||||||
/* Set initial stack pointer */
|
|
||||||
lddpc sp, stack_addr
|
|
||||||
sub sp, -THREAD_SIZE
|
|
||||||
|
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
|
||||||
/* Mark last stack frame */
|
|
||||||
mov lr, 0
|
|
||||||
mov r7, 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Start the show */
|
/* Start the show */
|
||||||
lddpc pc, kernel_start_addr
|
lddpc pc, kernel_start_addr
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
init_sr:
|
|
||||||
.long 0x007f0000 /* Supervisor mode, everything masked */
|
|
||||||
stack_addr:
|
|
||||||
.long init_thread_union
|
|
||||||
kernel_start_addr:
|
kernel_start_addr:
|
||||||
.long start_kernel
|
.long start_kernel
|
||||||
|
11
arch/parisc/include/asm/socket.h
Normal file
11
arch/parisc/include/asm/socket.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef _ASM_SOCKET_H
|
||||||
|
#define _ASM_SOCKET_H
|
||||||
|
|
||||||
|
#include <uapi/asm/socket.h>
|
||||||
|
|
||||||
|
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
|
||||||
|
* have to define SOCK_NONBLOCK to a different value here.
|
||||||
|
*/
|
||||||
|
#define SOCK_NONBLOCK 0x40000000
|
||||||
|
|
||||||
|
#endif /* _ASM_SOCKET_H */
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef _ASM_SOCKET_H
|
#ifndef _UAPI_ASM_SOCKET_H
|
||||||
#define _ASM_SOCKET_H
|
#define _UAPI_ASM_SOCKET_H
|
||||||
|
|
||||||
#include <asm/sockios.h>
|
#include <asm/sockios.h>
|
||||||
|
|
||||||
@ -73,9 +73,4 @@
|
|||||||
|
|
||||||
#define SO_SELECT_ERR_QUEUE 0x4026
|
#define SO_SELECT_ERR_QUEUE 0x4026
|
||||||
|
|
||||||
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
|
#endif /* _UAPI_ASM_SOCKET_H */
|
||||||
* have to define SOCK_NONBLOCK to a different value here.
|
|
||||||
*/
|
|
||||||
#define SOCK_NONBLOCK 0x40000000
|
|
||||||
|
|
||||||
#endif /* _ASM_SOCKET_H */
|
|
||||||
|
@ -442,6 +442,12 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
|
|||||||
#endif /* CONFIG_ALTIVEC */
|
#endif /* CONFIG_ALTIVEC */
|
||||||
if (copy_fpr_to_user(&frame->mc_fregs, current))
|
if (copy_fpr_to_user(&frame->mc_fregs, current))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear the MSR VSX bit to indicate there is no valid state attached
|
||||||
|
* to this context, except in the specific case below where we set it.
|
||||||
|
*/
|
||||||
|
msr &= ~MSR_VSX;
|
||||||
#ifdef CONFIG_VSX
|
#ifdef CONFIG_VSX
|
||||||
/*
|
/*
|
||||||
* Copy VSR 0-31 upper half from thread_struct to local
|
* Copy VSR 0-31 upper half from thread_struct to local
|
||||||
@ -454,15 +460,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
|
|||||||
if (copy_vsx_to_user(&frame->mc_vsregs, current))
|
if (copy_vsx_to_user(&frame->mc_vsregs, current))
|
||||||
return 1;
|
return 1;
|
||||||
msr |= MSR_VSX;
|
msr |= MSR_VSX;
|
||||||
} else if (!ctx_has_vsx_region)
|
}
|
||||||
/*
|
|
||||||
* With a small context structure we can't hold the VSX
|
|
||||||
* registers, hence clear the MSR value to indicate the state
|
|
||||||
* was not saved.
|
|
||||||
*/
|
|
||||||
msr &= ~MSR_VSX;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_VSX */
|
#endif /* CONFIG_VSX */
|
||||||
#ifdef CONFIG_SPE
|
#ifdef CONFIG_SPE
|
||||||
/* save spe registers */
|
/* save spe registers */
|
||||||
|
@ -121,6 +121,12 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
|
|||||||
flush_fp_to_thread(current);
|
flush_fp_to_thread(current);
|
||||||
/* copy fpr regs and fpscr */
|
/* copy fpr regs and fpscr */
|
||||||
err |= copy_fpr_to_user(&sc->fp_regs, current);
|
err |= copy_fpr_to_user(&sc->fp_regs, current);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear the MSR VSX bit to indicate there is no valid state attached
|
||||||
|
* to this context, except in the specific case below where we set it.
|
||||||
|
*/
|
||||||
|
msr &= ~MSR_VSX;
|
||||||
#ifdef CONFIG_VSX
|
#ifdef CONFIG_VSX
|
||||||
/*
|
/*
|
||||||
* Copy VSX low doubleword to local buffer for formatting,
|
* Copy VSX low doubleword to local buffer for formatting,
|
||||||
|
@ -78,11 +78,14 @@ static size_t copy_in_kernel(size_t count, void __user *to,
|
|||||||
* contains the (negative) exception code.
|
* contains the (negative) exception code.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
|
|
||||||
static unsigned long follow_table(struct mm_struct *mm,
|
static unsigned long follow_table(struct mm_struct *mm,
|
||||||
unsigned long address, int write)
|
unsigned long address, int write)
|
||||||
{
|
{
|
||||||
unsigned long *table = (unsigned long *)__pa(mm->pgd);
|
unsigned long *table = (unsigned long *)__pa(mm->pgd);
|
||||||
|
|
||||||
|
if (unlikely(address > mm->context.asce_limit - 1))
|
||||||
|
return -0x38UL;
|
||||||
switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
|
switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
|
||||||
case _ASCE_TYPE_REGION1:
|
case _ASCE_TYPE_REGION1:
|
||||||
table = table + ((address >> 53) & 0x7ff);
|
table = table + ((address >> 53) & 0x7ff);
|
||||||
|
@ -645,10 +645,12 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
|
|||||||
__set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
|
__set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
|
||||||
|
|
||||||
if (blkcg_init_queue(q))
|
if (blkcg_init_queue(q))
|
||||||
goto fail_id;
|
goto fail_bdi;
|
||||||
|
|
||||||
return q;
|
return q;
|
||||||
|
|
||||||
|
fail_bdi:
|
||||||
|
bdi_destroy(&q->backing_dev_info);
|
||||||
fail_id:
|
fail_id:
|
||||||
ida_simple_remove(&blk_queue_ida, q->id);
|
ida_simple_remove(&blk_queue_ida, q->id);
|
||||||
fail_q:
|
fail_q:
|
||||||
|
@ -106,7 +106,6 @@ error_no_sig:
|
|||||||
static int x509_key_preparse(struct key_preparsed_payload *prep)
|
static int x509_key_preparse(struct key_preparsed_payload *prep)
|
||||||
{
|
{
|
||||||
struct x509_certificate *cert;
|
struct x509_certificate *cert;
|
||||||
struct tm now;
|
|
||||||
size_t srlen, sulen;
|
size_t srlen, sulen;
|
||||||
char *desc = NULL;
|
char *desc = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
@ -137,43 +136,6 @@ static int x509_key_preparse(struct key_preparsed_payload *prep)
|
|||||||
goto error_free_cert;
|
goto error_free_cert;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_to_tm(CURRENT_TIME.tv_sec, 0, &now);
|
|
||||||
pr_devel("Now: %04ld-%02d-%02d %02d:%02d:%02d\n",
|
|
||||||
now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
|
|
||||||
now.tm_hour, now.tm_min, now.tm_sec);
|
|
||||||
if (now.tm_year < cert->valid_from.tm_year ||
|
|
||||||
(now.tm_year == cert->valid_from.tm_year &&
|
|
||||||
(now.tm_mon < cert->valid_from.tm_mon ||
|
|
||||||
(now.tm_mon == cert->valid_from.tm_mon &&
|
|
||||||
(now.tm_mday < cert->valid_from.tm_mday ||
|
|
||||||
(now.tm_mday == cert->valid_from.tm_mday &&
|
|
||||||
(now.tm_hour < cert->valid_from.tm_hour ||
|
|
||||||
(now.tm_hour == cert->valid_from.tm_hour &&
|
|
||||||
(now.tm_min < cert->valid_from.tm_min ||
|
|
||||||
(now.tm_min == cert->valid_from.tm_min &&
|
|
||||||
(now.tm_sec < cert->valid_from.tm_sec
|
|
||||||
))))))))))) {
|
|
||||||
pr_warn("Cert %s is not yet valid\n", cert->fingerprint);
|
|
||||||
ret = -EKEYREJECTED;
|
|
||||||
goto error_free_cert;
|
|
||||||
}
|
|
||||||
if (now.tm_year > cert->valid_to.tm_year ||
|
|
||||||
(now.tm_year == cert->valid_to.tm_year &&
|
|
||||||
(now.tm_mon > cert->valid_to.tm_mon ||
|
|
||||||
(now.tm_mon == cert->valid_to.tm_mon &&
|
|
||||||
(now.tm_mday > cert->valid_to.tm_mday ||
|
|
||||||
(now.tm_mday == cert->valid_to.tm_mday &&
|
|
||||||
(now.tm_hour > cert->valid_to.tm_hour ||
|
|
||||||
(now.tm_hour == cert->valid_to.tm_hour &&
|
|
||||||
(now.tm_min > cert->valid_to.tm_min ||
|
|
||||||
(now.tm_min == cert->valid_to.tm_min &&
|
|
||||||
(now.tm_sec > cert->valid_to.tm_sec
|
|
||||||
))))))))))) {
|
|
||||||
pr_warn("Cert %s has expired\n", cert->fingerprint);
|
|
||||||
ret = -EKEYEXPIRED;
|
|
||||||
goto error_free_cert;
|
|
||||||
}
|
|
||||||
|
|
||||||
cert->pub->algo = x509_public_key_algorithms[cert->pkey_algo];
|
cert->pub->algo = x509_public_key_algorithms[cert->pkey_algo];
|
||||||
cert->pub->id_type = PKEY_ID_X509;
|
cert->pub->id_type = PKEY_ID_X509;
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ static struct acpi_scan_handler pci_root_handler = {
|
|||||||
.ids = root_device_ids,
|
.ids = root_device_ids,
|
||||||
.attach = acpi_pci_root_add,
|
.attach = acpi_pci_root_add,
|
||||||
.detach = acpi_pci_root_remove,
|
.detach = acpi_pci_root_remove,
|
||||||
|
.hotplug = {
|
||||||
|
.ignore = true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Lock to protect both acpi_pci_roots lists */
|
/* Lock to protect both acpi_pci_roots lists */
|
||||||
|
@ -1790,7 +1790,7 @@ static void acpi_scan_init_hotplug(acpi_handle handle, int type)
|
|||||||
*/
|
*/
|
||||||
list_for_each_entry(hwid, &pnp.ids, list) {
|
list_for_each_entry(hwid, &pnp.ids, list) {
|
||||||
handler = acpi_scan_match_handler(hwid->id, NULL);
|
handler = acpi_scan_match_handler(hwid->id, NULL);
|
||||||
if (handler) {
|
if (handler && !handler->hotplug.ignore) {
|
||||||
acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
|
acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
|
||||||
acpi_hotplug_notify_cb, handler);
|
acpi_hotplug_notify_cb, handler);
|
||||||
break;
|
break;
|
||||||
|
@ -292,6 +292,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {
|
|||||||
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
|
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
|
||||||
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
|
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
|
||||||
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
|
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
|
||||||
|
{ PCI_VDEVICE(INTEL, 0x9c83), board_ahci }, /* Wildcat Point-LP AHCI */
|
||||||
|
{ PCI_VDEVICE(INTEL, 0x9c85), board_ahci }, /* Wildcat Point-LP RAID */
|
||||||
|
{ PCI_VDEVICE(INTEL, 0x9c87), board_ahci }, /* Wildcat Point-LP RAID */
|
||||||
|
{ PCI_VDEVICE(INTEL, 0x9c8f), board_ahci }, /* Wildcat Point-LP RAID */
|
||||||
|
|
||||||
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
|
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
|
||||||
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||||
@ -431,6 +435,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
|
|||||||
.driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */
|
.driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3),
|
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3),
|
||||||
.driver_data = board_ahci_yes_fbs },
|
.driver_data = board_ahci_yes_fbs },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9230),
|
||||||
|
.driver_data = board_ahci_yes_fbs },
|
||||||
|
|
||||||
/* Promise */
|
/* Promise */
|
||||||
{ PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
|
{ PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
|
||||||
|
@ -1266,9 +1266,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
|
|||||||
{
|
{
|
||||||
struct ata_port *ap = link->ap;
|
struct ata_port *ap = link->ap;
|
||||||
struct ahci_host_priv *hpriv = ap->host->private_data;
|
struct ahci_host_priv *hpriv = ap->host->private_data;
|
||||||
|
struct ahci_port_priv *pp = ap->private_data;
|
||||||
const char *reason = NULL;
|
const char *reason = NULL;
|
||||||
unsigned long now, msecs;
|
unsigned long now, msecs;
|
||||||
struct ata_taskfile tf;
|
struct ata_taskfile tf;
|
||||||
|
bool fbs_disabled = false;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DPRINTK("ENTER\n");
|
DPRINTK("ENTER\n");
|
||||||
@ -1278,6 +1280,16 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
|
|||||||
if (rc && rc != -EOPNOTSUPP)
|
if (rc && rc != -EOPNOTSUPP)
|
||||||
ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
|
ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* According to AHCI-1.2 9.3.9: if FBS is enable, software shall
|
||||||
|
* clear PxFBS.EN to '0' prior to issuing software reset to devices
|
||||||
|
* that is attached to port multiplier.
|
||||||
|
*/
|
||||||
|
if (!ata_is_host_link(link) && pp->fbs_enabled) {
|
||||||
|
ahci_disable_fbs(ap);
|
||||||
|
fbs_disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
ata_tf_init(link->device, &tf);
|
ata_tf_init(link->device, &tf);
|
||||||
|
|
||||||
/* issue the first D2H Register FIS */
|
/* issue the first D2H Register FIS */
|
||||||
@ -1318,6 +1330,10 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
|
|||||||
} else
|
} else
|
||||||
*class = ahci_dev_classify(ap);
|
*class = ahci_dev_classify(ap);
|
||||||
|
|
||||||
|
/* re-enable FBS if disabled before */
|
||||||
|
if (fbs_disabled)
|
||||||
|
ahci_enable_fbs(ap);
|
||||||
|
|
||||||
DPRINTK("EXIT, class=%u\n", *class);
|
DPRINTK("EXIT, class=%u\n", *class);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -4105,6 +4105,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
|
|||||||
{ "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
|
{ "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
|
||||||
{ "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
|
{ "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
|
||||||
{ "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
|
{ "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
|
||||||
|
{ "Slimtype DVD A DS8A9SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
|
||||||
|
|
||||||
/* Devices we expect to fail diagnostics */
|
/* Devices we expect to fail diagnostics */
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ static void __device_release_driver(struct device *dev)
|
|||||||
BUS_NOTIFY_UNBIND_DRIVER,
|
BUS_NOTIFY_UNBIND_DRIVER,
|
||||||
dev);
|
dev);
|
||||||
|
|
||||||
pm_runtime_put(dev);
|
pm_runtime_put_sync(dev);
|
||||||
|
|
||||||
if (dev->bus && dev->bus->remove)
|
if (dev->bus && dev->bus->remove)
|
||||||
dev->bus->remove(dev);
|
dev->bus->remove(dev);
|
||||||
|
@ -894,13 +894,6 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
|
|||||||
|
|
||||||
bio_list_init(&lo->lo_bio_list);
|
bio_list_init(&lo->lo_bio_list);
|
||||||
|
|
||||||
/*
|
|
||||||
* set queue make_request_fn, and add limits based on lower level
|
|
||||||
* device
|
|
||||||
*/
|
|
||||||
blk_queue_make_request(lo->lo_queue, loop_make_request);
|
|
||||||
lo->lo_queue->queuedata = lo;
|
|
||||||
|
|
||||||
if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
|
if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
|
||||||
blk_queue_flush(lo->lo_queue, REQ_FLUSH);
|
blk_queue_flush(lo->lo_queue, REQ_FLUSH);
|
||||||
|
|
||||||
@ -1624,6 +1617,8 @@ static int loop_add(struct loop_device **l, int i)
|
|||||||
if (!lo)
|
if (!lo)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
lo->lo_state = Lo_unbound;
|
||||||
|
|
||||||
/* allocate id, if @id >= 0, we're requesting that specific id */
|
/* allocate id, if @id >= 0, we're requesting that specific id */
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
err = idr_alloc(&loop_index_idr, lo, i, i + 1, GFP_KERNEL);
|
err = idr_alloc(&loop_index_idr, lo, i, i + 1, GFP_KERNEL);
|
||||||
@ -1639,7 +1634,13 @@ static int loop_add(struct loop_device **l, int i)
|
|||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
lo->lo_queue = blk_alloc_queue(GFP_KERNEL);
|
lo->lo_queue = blk_alloc_queue(GFP_KERNEL);
|
||||||
if (!lo->lo_queue)
|
if (!lo->lo_queue)
|
||||||
goto out_free_dev;
|
goto out_free_idr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set queue make_request_fn
|
||||||
|
*/
|
||||||
|
blk_queue_make_request(lo->lo_queue, loop_make_request);
|
||||||
|
lo->lo_queue->queuedata = lo;
|
||||||
|
|
||||||
disk = lo->lo_disk = alloc_disk(1 << part_shift);
|
disk = lo->lo_disk = alloc_disk(1 << part_shift);
|
||||||
if (!disk)
|
if (!disk)
|
||||||
@ -1684,6 +1685,8 @@ static int loop_add(struct loop_device **l, int i)
|
|||||||
|
|
||||||
out_free_queue:
|
out_free_queue:
|
||||||
blk_cleanup_queue(lo->lo_queue);
|
blk_cleanup_queue(lo->lo_queue);
|
||||||
|
out_free_idr:
|
||||||
|
idr_remove(&loop_index_idr, i);
|
||||||
out_free_dev:
|
out_free_dev:
|
||||||
kfree(lo);
|
kfree(lo);
|
||||||
out:
|
out:
|
||||||
|
@ -649,6 +649,8 @@ static int dispatch_discard_io(struct xen_blkif *blkif,
|
|||||||
unsigned long secure;
|
unsigned long secure;
|
||||||
struct phys_req preq;
|
struct phys_req preq;
|
||||||
|
|
||||||
|
xen_blkif_get(blkif);
|
||||||
|
|
||||||
preq.sector_number = req->u.discard.sector_number;
|
preq.sector_number = req->u.discard.sector_number;
|
||||||
preq.nr_sects = req->u.discard.nr_sectors;
|
preq.nr_sects = req->u.discard.nr_sectors;
|
||||||
|
|
||||||
@ -661,7 +663,6 @@ static int dispatch_discard_io(struct xen_blkif *blkif,
|
|||||||
}
|
}
|
||||||
blkif->st_ds_req++;
|
blkif->st_ds_req++;
|
||||||
|
|
||||||
xen_blkif_get(blkif);
|
|
||||||
secure = (blkif->vbd.discard_secure &&
|
secure = (blkif->vbd.discard_secure &&
|
||||||
(req->u.discard.flag & BLKIF_DISCARD_SECURE)) ?
|
(req->u.discard.flag & BLKIF_DISCARD_SECURE)) ?
|
||||||
BLKDEV_DISCARD_SECURE : 0;
|
BLKDEV_DISCARD_SECURE : 0;
|
||||||
|
@ -126,8 +126,8 @@ static void __init mvebu_clk_core_setup(struct device_node *np,
|
|||||||
#define SARH_AXP_FAB_FREQ_OPT_SHIFT 4
|
#define SARH_AXP_FAB_FREQ_OPT_SHIFT 4
|
||||||
|
|
||||||
static const u32 __initconst armada_370_tclk_frequencies[] = {
|
static const u32 __initconst armada_370_tclk_frequencies[] = {
|
||||||
16600000,
|
166000000,
|
||||||
20000000,
|
200000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 __init armada_370_get_tclk_freq(void __iomem *sar)
|
static u32 __init armada_370_get_tclk_freq(void __iomem *sar)
|
||||||
|
@ -66,7 +66,8 @@ static int hb_cpufreq_driver_init(void)
|
|||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!of_machine_is_compatible("calxeda,highbank"))
|
if ((!of_machine_is_compatible("calxeda,highbank")) &&
|
||||||
|
(!of_machine_is_compatible("calxeda,ecx-2000")))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
for_each_child_of_node(of_find_node_by_path("/cpus"), np)
|
for_each_child_of_node(of_find_node_by_path("/cpus"), np)
|
||||||
|
@ -87,13 +87,6 @@ static const u8 pq_idx_to_field[] = { 1, 4, 5, 0, 1, 2, 4, 5 };
|
|||||||
static const u8 pq16_idx_to_field[] = { 1, 4, 1, 2, 3, 4, 5, 6, 7,
|
static const u8 pq16_idx_to_field[] = { 1, 4, 1, 2, 3, 4, 5, 6, 7,
|
||||||
0, 1, 2, 3, 4, 5, 6 };
|
0, 1, 2, 3, 4, 5, 6 };
|
||||||
|
|
||||||
/*
|
|
||||||
* technically sources 1 and 2 do not require SED, but the op will have
|
|
||||||
* at least 9 descriptors so that's irrelevant.
|
|
||||||
*/
|
|
||||||
static const u8 pq16_idx_to_sed[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1, 1, 1 };
|
|
||||||
|
|
||||||
static void ioat3_eh(struct ioat2_dma_chan *ioat);
|
static void ioat3_eh(struct ioat2_dma_chan *ioat);
|
||||||
|
|
||||||
static dma_addr_t xor_get_src(struct ioat_raw_descriptor *descs[2], int idx)
|
static dma_addr_t xor_get_src(struct ioat_raw_descriptor *descs[2], int idx)
|
||||||
@ -135,12 +128,6 @@ static void pq_set_src(struct ioat_raw_descriptor *descs[2],
|
|||||||
pq->coef[idx] = coef;
|
pq->coef[idx] = coef;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sed_get_pq16_pool_idx(int src_cnt)
|
|
||||||
{
|
|
||||||
|
|
||||||
return pq16_idx_to_sed[src_cnt];
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool is_jf_ioat(struct pci_dev *pdev)
|
static bool is_jf_ioat(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
switch (pdev->device) {
|
switch (pdev->device) {
|
||||||
@ -1182,9 +1169,6 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
|||||||
u8 op;
|
u8 op;
|
||||||
int i, s, idx, num_descs;
|
int i, s, idx, num_descs;
|
||||||
|
|
||||||
/* this function only handles src_cnt 9 - 16 */
|
|
||||||
BUG_ON(src_cnt < 9);
|
|
||||||
|
|
||||||
/* this function is only called with 9-16 sources */
|
/* this function is only called with 9-16 sources */
|
||||||
op = result ? IOAT_OP_PQ_VAL_16S : IOAT_OP_PQ_16S;
|
op = result ? IOAT_OP_PQ_VAL_16S : IOAT_OP_PQ_16S;
|
||||||
|
|
||||||
@ -1212,8 +1196,7 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
|||||||
|
|
||||||
descs[0] = (struct ioat_raw_descriptor *) pq;
|
descs[0] = (struct ioat_raw_descriptor *) pq;
|
||||||
|
|
||||||
desc->sed = ioat3_alloc_sed(device,
|
desc->sed = ioat3_alloc_sed(device, (src_cnt-2) >> 3);
|
||||||
sed_get_pq16_pool_idx(src_cnt));
|
|
||||||
if (!desc->sed) {
|
if (!desc->sed) {
|
||||||
dev_err(to_dev(chan),
|
dev_err(to_dev(chan),
|
||||||
"%s: no free sed entries\n", __func__);
|
"%s: no free sed entries\n", __func__);
|
||||||
@ -1271,13 +1254,21 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
|||||||
return &desc->txd;
|
return &desc->txd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int src_cnt_flags(unsigned int src_cnt, unsigned long flags)
|
||||||
|
{
|
||||||
|
if (dmaf_p_disabled_continue(flags))
|
||||||
|
return src_cnt + 1;
|
||||||
|
else if (dmaf_continue(flags))
|
||||||
|
return src_cnt + 3;
|
||||||
|
else
|
||||||
|
return src_cnt;
|
||||||
|
}
|
||||||
|
|
||||||
static struct dma_async_tx_descriptor *
|
static struct dma_async_tx_descriptor *
|
||||||
ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||||
unsigned long flags)
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
struct dma_device *dma = chan->device;
|
|
||||||
|
|
||||||
/* specify valid address for disabled result */
|
/* specify valid address for disabled result */
|
||||||
if (flags & DMA_PREP_PQ_DISABLE_P)
|
if (flags & DMA_PREP_PQ_DISABLE_P)
|
||||||
dst[0] = dst[1];
|
dst[0] = dst[1];
|
||||||
@ -1297,7 +1288,7 @@ ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
|||||||
single_source_coef[0] = scf[0];
|
single_source_coef[0] = scf[0];
|
||||||
single_source_coef[1] = 0;
|
single_source_coef[1] = 0;
|
||||||
|
|
||||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||||
__ioat3_prep_pq16_lock(chan, NULL, dst, single_source,
|
__ioat3_prep_pq16_lock(chan, NULL, dst, single_source,
|
||||||
2, single_source_coef, len,
|
2, single_source_coef, len,
|
||||||
flags) :
|
flags) :
|
||||||
@ -1305,7 +1296,7 @@ ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
|||||||
single_source_coef, len, flags);
|
single_source_coef, len, flags);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||||
__ioat3_prep_pq16_lock(chan, NULL, dst, src, src_cnt,
|
__ioat3_prep_pq16_lock(chan, NULL, dst, src, src_cnt,
|
||||||
scf, len, flags) :
|
scf, len, flags) :
|
||||||
__ioat3_prep_pq_lock(chan, NULL, dst, src, src_cnt,
|
__ioat3_prep_pq_lock(chan, NULL, dst, src, src_cnt,
|
||||||
@ -1318,8 +1309,6 @@ ioat3_prep_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
|||||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||||
enum sum_check_flags *pqres, unsigned long flags)
|
enum sum_check_flags *pqres, unsigned long flags)
|
||||||
{
|
{
|
||||||
struct dma_device *dma = chan->device;
|
|
||||||
|
|
||||||
/* specify valid address for disabled result */
|
/* specify valid address for disabled result */
|
||||||
if (flags & DMA_PREP_PQ_DISABLE_P)
|
if (flags & DMA_PREP_PQ_DISABLE_P)
|
||||||
pq[0] = pq[1];
|
pq[0] = pq[1];
|
||||||
@ -1331,7 +1320,7 @@ ioat3_prep_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
|||||||
*/
|
*/
|
||||||
*pqres = 0;
|
*pqres = 0;
|
||||||
|
|
||||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||||
__ioat3_prep_pq16_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
__ioat3_prep_pq16_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
||||||
flags) :
|
flags) :
|
||||||
__ioat3_prep_pq_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
__ioat3_prep_pq_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
||||||
@ -1342,7 +1331,6 @@ static struct dma_async_tx_descriptor *
|
|||||||
ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
||||||
unsigned int src_cnt, size_t len, unsigned long flags)
|
unsigned int src_cnt, size_t len, unsigned long flags)
|
||||||
{
|
{
|
||||||
struct dma_device *dma = chan->device;
|
|
||||||
unsigned char scf[src_cnt];
|
unsigned char scf[src_cnt];
|
||||||
dma_addr_t pq[2];
|
dma_addr_t pq[2];
|
||||||
|
|
||||||
@ -1351,7 +1339,7 @@ ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
|||||||
flags |= DMA_PREP_PQ_DISABLE_Q;
|
flags |= DMA_PREP_PQ_DISABLE_Q;
|
||||||
pq[1] = dst; /* specify valid address for disabled result */
|
pq[1] = dst; /* specify valid address for disabled result */
|
||||||
|
|
||||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||||
__ioat3_prep_pq16_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
__ioat3_prep_pq16_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
||||||
flags) :
|
flags) :
|
||||||
__ioat3_prep_pq_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
__ioat3_prep_pq_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
||||||
@ -1363,7 +1351,6 @@ ioat3_prep_pqxor_val(struct dma_chan *chan, dma_addr_t *src,
|
|||||||
unsigned int src_cnt, size_t len,
|
unsigned int src_cnt, size_t len,
|
||||||
enum sum_check_flags *result, unsigned long flags)
|
enum sum_check_flags *result, unsigned long flags)
|
||||||
{
|
{
|
||||||
struct dma_device *dma = chan->device;
|
|
||||||
unsigned char scf[src_cnt];
|
unsigned char scf[src_cnt];
|
||||||
dma_addr_t pq[2];
|
dma_addr_t pq[2];
|
||||||
|
|
||||||
@ -1377,8 +1364,7 @@ ioat3_prep_pqxor_val(struct dma_chan *chan, dma_addr_t *src,
|
|||||||
flags |= DMA_PREP_PQ_DISABLE_Q;
|
flags |= DMA_PREP_PQ_DISABLE_Q;
|
||||||
pq[1] = pq[0]; /* specify valid address for disabled result */
|
pq[1] = pq[0]; /* specify valid address for disabled result */
|
||||||
|
|
||||||
|
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
|
||||||
__ioat3_prep_pq16_lock(chan, result, pq, &src[1], src_cnt - 1,
|
__ioat3_prep_pq16_lock(chan, result, pq, &src[1], src_cnt - 1,
|
||||||
scf, len, flags) :
|
scf, len, flags) :
|
||||||
__ioat3_prep_pq_lock(chan, result, pq, &src[1], src_cnt - 1,
|
__ioat3_prep_pq_lock(chan, result, pq, &src[1], src_cnt - 1,
|
||||||
|
@ -90,28 +90,30 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
drvdata->db_irq = platform_get_irq(pdev, 0);
|
|
||||||
res = devm_request_irq(&pdev->dev, drvdata->db_irq,
|
|
||||||
highbank_l2_err_handler,
|
|
||||||
0, dev_name(&pdev->dev), dci);
|
|
||||||
if (res < 0)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
drvdata->sb_irq = platform_get_irq(pdev, 1);
|
|
||||||
res = devm_request_irq(&pdev->dev, drvdata->sb_irq,
|
|
||||||
highbank_l2_err_handler,
|
|
||||||
0, dev_name(&pdev->dev), dci);
|
|
||||||
if (res < 0)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
dci->mod_name = dev_name(&pdev->dev);
|
dci->mod_name = dev_name(&pdev->dev);
|
||||||
dci->dev_name = dev_name(&pdev->dev);
|
dci->dev_name = dev_name(&pdev->dev);
|
||||||
|
|
||||||
if (edac_device_add_device(dci))
|
if (edac_device_add_device(dci))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
drvdata->db_irq = platform_get_irq(pdev, 0);
|
||||||
|
res = devm_request_irq(&pdev->dev, drvdata->db_irq,
|
||||||
|
highbank_l2_err_handler,
|
||||||
|
0, dev_name(&pdev->dev), dci);
|
||||||
|
if (res < 0)
|
||||||
|
goto err2;
|
||||||
|
|
||||||
|
drvdata->sb_irq = platform_get_irq(pdev, 1);
|
||||||
|
res = devm_request_irq(&pdev->dev, drvdata->sb_irq,
|
||||||
|
highbank_l2_err_handler,
|
||||||
|
0, dev_name(&pdev->dev), dci);
|
||||||
|
if (res < 0)
|
||||||
|
goto err2;
|
||||||
|
|
||||||
devres_close_group(&pdev->dev, NULL);
|
devres_close_group(&pdev->dev, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
|
err2:
|
||||||
|
edac_device_del_device(&pdev->dev);
|
||||||
err:
|
err:
|
||||||
devres_release_group(&pdev->dev, NULL);
|
devres_release_group(&pdev->dev, NULL);
|
||||||
edac_device_free_ctl_info(dci);
|
edac_device_free_ctl_info(dci);
|
||||||
|
@ -189,14 +189,6 @@ static int highbank_mc_probe(struct platform_device *pdev)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
irq = platform_get_irq(pdev, 0);
|
|
||||||
res = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler,
|
|
||||||
0, dev_name(&pdev->dev), mci);
|
|
||||||
if (res < 0) {
|
|
||||||
dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
mci->mtype_cap = MEM_FLAG_DDR3;
|
mci->mtype_cap = MEM_FLAG_DDR3;
|
||||||
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
|
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
|
||||||
mci->edac_cap = EDAC_FLAG_SECDED;
|
mci->edac_cap = EDAC_FLAG_SECDED;
|
||||||
@ -217,10 +209,20 @@ static int highbank_mc_probe(struct platform_device *pdev)
|
|||||||
if (res < 0)
|
if (res < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
irq = platform_get_irq(pdev, 0);
|
||||||
|
res = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler,
|
||||||
|
0, dev_name(&pdev->dev), mci);
|
||||||
|
if (res < 0) {
|
||||||
|
dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
|
||||||
|
goto err2;
|
||||||
|
}
|
||||||
|
|
||||||
highbank_mc_create_debugfs_nodes(mci);
|
highbank_mc_create_debugfs_nodes(mci);
|
||||||
|
|
||||||
devres_close_group(&pdev->dev, NULL);
|
devres_close_group(&pdev->dev, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
|
err2:
|
||||||
|
edac_mc_del_mc(&pdev->dev);
|
||||||
err:
|
err:
|
||||||
devres_release_group(&pdev->dev, NULL);
|
devres_release_group(&pdev->dev, NULL);
|
||||||
edac_mc_free(mci);
|
edac_mc_free(mci);
|
||||||
|
@ -79,7 +79,7 @@ struct mvebu_gpio_chip {
|
|||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
void __iomem *membase;
|
void __iomem *membase;
|
||||||
void __iomem *percpu_membase;
|
void __iomem *percpu_membase;
|
||||||
unsigned int irqbase;
|
int irqbase;
|
||||||
struct irq_domain *domain;
|
struct irq_domain *domain;
|
||||||
int soc_variant;
|
int soc_variant;
|
||||||
};
|
};
|
||||||
|
@ -286,11 +286,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
|
|||||||
if (!chip->base)
|
if (!chip->base)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR,
|
|
||||||
irq_base, &pl061_domain_ops, chip);
|
|
||||||
if (!chip->domain)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
spin_lock_init(&chip->lock);
|
spin_lock_init(&chip->lock);
|
||||||
|
|
||||||
chip->gc.request = pl061_gpio_request;
|
chip->gc.request = pl061_gpio_request;
|
||||||
@ -320,6 +315,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
|
|||||||
irq_set_chained_handler(irq, pl061_irq_handler);
|
irq_set_chained_handler(irq, pl061_irq_handler);
|
||||||
irq_set_handler_data(irq, chip);
|
irq_set_handler_data(irq, chip);
|
||||||
|
|
||||||
|
chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR,
|
||||||
|
irq_base, &pl061_domain_ops, chip);
|
||||||
|
if (!chip->domain)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
for (i = 0; i < PL061_GPIO_NR; i++) {
|
for (i = 0; i < PL061_GPIO_NR; i++) {
|
||||||
if (pdata) {
|
if (pdata) {
|
||||||
if (pdata->directions & (1 << i))
|
if (pdata->directions & (1 << i))
|
||||||
|
@ -329,7 +329,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
|||||||
if (!p->irq_domain) {
|
if (!p->irq_domain) {
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
dev_err(&pdev->dev, "cannot initialize irq domain\n");
|
dev_err(&pdev->dev, "cannot initialize irq domain\n");
|
||||||
goto err1;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devm_request_irq(&pdev->dev, irq->start,
|
if (devm_request_irq(&pdev->dev, irq->start,
|
||||||
|
@ -354,17 +354,18 @@ static void twl_set(struct gpio_chip *chip, unsigned offset, int value)
|
|||||||
static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value)
|
static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value)
|
||||||
{
|
{
|
||||||
struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip);
|
struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip);
|
||||||
|
int ret = -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&priv->mutex);
|
mutex_lock(&priv->mutex);
|
||||||
if (offset < TWL4030_GPIO_MAX)
|
if (offset < TWL4030_GPIO_MAX)
|
||||||
twl4030_set_gpio_dataout(offset, value);
|
ret = twl4030_set_gpio_direction(offset, 0);
|
||||||
|
|
||||||
priv->direction |= BIT(offset);
|
priv->direction |= BIT(offset);
|
||||||
mutex_unlock(&priv->mutex);
|
mutex_unlock(&priv->mutex);
|
||||||
|
|
||||||
twl_set(chip, offset, value);
|
twl_set(chip, offset, value);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int twl_to_irq(struct gpio_chip *chip, unsigned offset)
|
static int twl_to_irq(struct gpio_chip *chip, unsigned offset)
|
||||||
|
@ -7163,7 +7163,9 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
|
|||||||
intel_crtc->cursor_visible = visible;
|
intel_crtc->cursor_visible = visible;
|
||||||
}
|
}
|
||||||
/* and commit changes on next vblank */
|
/* and commit changes on next vblank */
|
||||||
|
POSTING_READ(CURCNTR(pipe));
|
||||||
I915_WRITE(CURBASE(pipe), base);
|
I915_WRITE(CURBASE(pipe), base);
|
||||||
|
POSTING_READ(CURBASE(pipe));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
|
static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
|
||||||
@ -7192,7 +7194,9 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
|
|||||||
intel_crtc->cursor_visible = visible;
|
intel_crtc->cursor_visible = visible;
|
||||||
}
|
}
|
||||||
/* and commit changes on next vblank */
|
/* and commit changes on next vblank */
|
||||||
|
POSTING_READ(CURCNTR_IVB(pipe));
|
||||||
I915_WRITE(CURBASE_IVB(pipe), base);
|
I915_WRITE(CURBASE_IVB(pipe), base);
|
||||||
|
POSTING_READ(CURBASE_IVB(pipe));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
|
/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
|
||||||
|
@ -91,7 +91,7 @@ static void qxl_fb_dirty_flush(struct fb_info *info)
|
|||||||
u32 x1, x2, y1, y2;
|
u32 x1, x2, y1, y2;
|
||||||
|
|
||||||
/* TODO: hard coding 32 bpp */
|
/* TODO: hard coding 32 bpp */
|
||||||
int stride = qfbdev->qfb.base.pitches[0] * 4;
|
int stride = qfbdev->qfb.base.pitches[0];
|
||||||
|
|
||||||
x1 = qfbdev->dirty.x1;
|
x1 = qfbdev->dirty.x1;
|
||||||
x2 = qfbdev->dirty.x2;
|
x2 = qfbdev->dirty.x2;
|
||||||
|
@ -1683,7 +1683,7 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
|
|||||||
if (pll != ATOM_PPLL_INVALID)
|
if (pll != ATOM_PPLL_INVALID)
|
||||||
return pll;
|
return pll;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!ASIC_IS_DCE41(rdev)) { /* Don't share PLLs on DCE4.1 chips */
|
||||||
/* use the same PPLL for all monitors with the same clock */
|
/* use the same PPLL for all monitors with the same clock */
|
||||||
pll = radeon_get_shared_nondp_ppll(crtc);
|
pll = radeon_get_shared_nondp_ppll(crtc);
|
||||||
if (pll != ATOM_PPLL_INVALID)
|
if (pll != ATOM_PPLL_INVALID)
|
||||||
|
@ -219,8 +219,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
|
|||||||
/* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
|
/* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
|
||||||
|
|
||||||
WREG32(HDMI_ACR_PACKET_CONTROL + offset,
|
WREG32(HDMI_ACR_PACKET_CONTROL + offset,
|
||||||
HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
|
HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
|
||||||
HDMI_ACR_SOURCE); /* select SW CTS value */
|
|
||||||
|
|
||||||
evergreen_hdmi_update_ACR(encoder, mode->clock);
|
evergreen_hdmi_update_ACR(encoder, mode->clock);
|
||||||
|
|
||||||
|
@ -57,15 +57,15 @@ enum r600_hdmi_iec_status_bits {
|
|||||||
static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
|
static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
|
||||||
/* 32kHz 44.1kHz 48kHz */
|
/* 32kHz 44.1kHz 48kHz */
|
||||||
/* Clock N CTS N CTS N CTS */
|
/* Clock N CTS N CTS N CTS */
|
||||||
{ 25174, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
|
{ 25175, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
|
||||||
{ 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */
|
{ 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */
|
||||||
{ 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */
|
{ 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */
|
||||||
{ 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */
|
{ 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */
|
||||||
{ 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */
|
{ 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */
|
||||||
{ 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */
|
{ 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */
|
||||||
{ 74175, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
|
{ 74176, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
|
||||||
{ 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */
|
{ 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */
|
||||||
{ 148351, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
|
{ 148352, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
|
||||||
{ 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */
|
{ 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */
|
||||||
{ 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */
|
{ 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */
|
||||||
};
|
};
|
||||||
@ -75,8 +75,15 @@ static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
|
|||||||
*/
|
*/
|
||||||
static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq)
|
static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq)
|
||||||
{
|
{
|
||||||
if (*CTS == 0)
|
u64 n;
|
||||||
*CTS = clock * N / (128 * freq) * 1000;
|
u32 d;
|
||||||
|
|
||||||
|
if (*CTS == 0) {
|
||||||
|
n = (u64)clock * (u64)N * 1000ULL;
|
||||||
|
d = 128 * freq;
|
||||||
|
do_div(n, d);
|
||||||
|
*CTS = n;
|
||||||
|
}
|
||||||
DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n",
|
DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n",
|
||||||
N, *CTS, freq);
|
N, *CTS, freq);
|
||||||
}
|
}
|
||||||
@ -313,8 +320,8 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
|
WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
|
||||||
HDMI0_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
|
HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */
|
||||||
HDMI0_ACR_SOURCE); /* select SW CTS value */
|
HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
|
||||||
|
|
||||||
WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
|
WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
|
||||||
HDMI0_NULL_SEND | /* send null packets when required */
|
HDMI0_NULL_SEND | /* send null packets when required */
|
||||||
|
@ -1157,6 +1157,8 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
r = radeon_ib_get(rdev, ridx, &ib, NULL, ndw * 4);
|
r = radeon_ib_get(rdev, ridx, &ib, NULL, ndw * 4);
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
ib.length_dw = 0;
|
ib.length_dw = 0;
|
||||||
|
|
||||||
r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset);
|
r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset);
|
||||||
|
@ -422,6 +422,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
|
|||||||
/* Pin framebuffer & get tilling informations */
|
/* Pin framebuffer & get tilling informations */
|
||||||
obj = radeon_fb->obj;
|
obj = radeon_fb->obj;
|
||||||
rbo = gem_to_radeon_bo(obj);
|
rbo = gem_to_radeon_bo(obj);
|
||||||
|
retry:
|
||||||
r = radeon_bo_reserve(rbo, false);
|
r = radeon_bo_reserve(rbo, false);
|
||||||
if (unlikely(r != 0))
|
if (unlikely(r != 0))
|
||||||
return r;
|
return r;
|
||||||
@ -430,6 +431,33 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
|
|||||||
&base);
|
&base);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
radeon_bo_unreserve(rbo);
|
radeon_bo_unreserve(rbo);
|
||||||
|
|
||||||
|
/* On old GPU like RN50 with little vram pining can fails because
|
||||||
|
* current fb is taking all space needed. So instead of unpining
|
||||||
|
* the old buffer after pining the new one, first unpin old one
|
||||||
|
* and then retry pining new one.
|
||||||
|
*
|
||||||
|
* As only master can set mode only master can pin and it is
|
||||||
|
* unlikely the master client will race with itself especialy
|
||||||
|
* on those old gpu with single crtc.
|
||||||
|
*
|
||||||
|
* We don't shutdown the display controller because new buffer
|
||||||
|
* will end up in same spot.
|
||||||
|
*/
|
||||||
|
if (!atomic && fb && fb != crtc->fb) {
|
||||||
|
struct radeon_bo *old_rbo;
|
||||||
|
unsigned long nsize, osize;
|
||||||
|
|
||||||
|
old_rbo = gem_to_radeon_bo(to_radeon_framebuffer(fb)->obj);
|
||||||
|
osize = radeon_bo_size(old_rbo);
|
||||||
|
nsize = radeon_bo_size(rbo);
|
||||||
|
if (nsize <= osize && !radeon_bo_reserve(old_rbo, false)) {
|
||||||
|
radeon_bo_unpin(old_rbo);
|
||||||
|
radeon_bo_unreserve(old_rbo);
|
||||||
|
fb = NULL;
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
|
}
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
|
radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
|
||||||
|
@ -242,6 +242,8 @@ void radeon_uvd_free_handles(struct radeon_device *rdev, struct drm_file *filp)
|
|||||||
if (handle != 0 && rdev->uvd.filp[i] == filp) {
|
if (handle != 0 && rdev->uvd.filp[i] == filp) {
|
||||||
struct radeon_fence *fence;
|
struct radeon_fence *fence;
|
||||||
|
|
||||||
|
radeon_uvd_note_usage(rdev);
|
||||||
|
|
||||||
r = radeon_uvd_get_destroy_msg(rdev,
|
r = radeon_uvd_get_destroy_msg(rdev,
|
||||||
R600_RING_TYPE_UVD_INDEX, handle, &fence);
|
R600_RING_TYPE_UVD_INDEX, handle, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
@ -247,7 +247,7 @@
|
|||||||
#define NOOFGROUPS_SHIFT 12
|
#define NOOFGROUPS_SHIFT 12
|
||||||
#define NOOFGROUPS_MASK 0x00001000
|
#define NOOFGROUPS_MASK 0x00001000
|
||||||
|
|
||||||
#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x2808
|
#define MC_SEQ_TRAIN_WAKEUP_CNTL 0x28e8
|
||||||
#define TRAIN_DONE_D0 (1 << 30)
|
#define TRAIN_DONE_D0 (1 << 30)
|
||||||
#define TRAIN_DONE_D1 (1 << 31)
|
#define TRAIN_DONE_D1 (1 << 31)
|
||||||
|
|
||||||
|
@ -1076,24 +1076,32 @@ out_unlock:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ttm_bo_mem_compat(struct ttm_placement *placement,
|
static bool ttm_bo_mem_compat(struct ttm_placement *placement,
|
||||||
struct ttm_mem_reg *mem)
|
struct ttm_mem_reg *mem,
|
||||||
|
uint32_t *new_flags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (mem->mm_node && placement->lpfn != 0 &&
|
if (mem->mm_node && placement->lpfn != 0 &&
|
||||||
(mem->start < placement->fpfn ||
|
(mem->start < placement->fpfn ||
|
||||||
mem->start + mem->num_pages > placement->lpfn))
|
mem->start + mem->num_pages > placement->lpfn))
|
||||||
return -1;
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < placement->num_placement; i++) {
|
for (i = 0; i < placement->num_placement; i++) {
|
||||||
if ((placement->placement[i] & mem->placement &
|
*new_flags = placement->placement[i];
|
||||||
TTM_PL_MASK_CACHING) &&
|
if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
|
||||||
(placement->placement[i] & mem->placement &
|
(*new_flags & mem->placement & TTM_PL_MASK_MEM))
|
||||||
TTM_PL_MASK_MEM))
|
return true;
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
return -1;
|
|
||||||
|
for (i = 0; i < placement->num_busy_placement; i++) {
|
||||||
|
*new_flags = placement->busy_placement[i];
|
||||||
|
if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
|
||||||
|
(*new_flags & mem->placement & TTM_PL_MASK_MEM))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ttm_bo_validate(struct ttm_buffer_object *bo,
|
int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||||
@ -1102,6 +1110,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
|||||||
bool no_wait_gpu)
|
bool no_wait_gpu)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
uint32_t new_flags;
|
||||||
|
|
||||||
BUG_ON(!ttm_bo_is_reserved(bo));
|
BUG_ON(!ttm_bo_is_reserved(bo));
|
||||||
/* Check that range is valid */
|
/* Check that range is valid */
|
||||||
@ -1112,8 +1121,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
|||||||
/*
|
/*
|
||||||
* Check whether we need to move buffer.
|
* Check whether we need to move buffer.
|
||||||
*/
|
*/
|
||||||
ret = ttm_bo_mem_compat(placement, &bo->mem);
|
if (!ttm_bo_mem_compat(placement, &bo->mem, &new_flags)) {
|
||||||
if (ret < 0) {
|
|
||||||
ret = ttm_bo_move_buffer(bo, placement, interruptible,
|
ret = ttm_bo_move_buffer(bo, placement, interruptible,
|
||||||
no_wait_gpu);
|
no_wait_gpu);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -1123,7 +1131,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
|
|||||||
* Use the access and other non-mapping-related flag bits from
|
* Use the access and other non-mapping-related flag bits from
|
||||||
* the compatible memory placement flags to the active flags
|
* the compatible memory placement flags to the active flags
|
||||||
*/
|
*/
|
||||||
ttm_flag_masked(&bo->mem.placement, placement->placement[ret],
|
ttm_flag_masked(&bo->mem.placement, new_flags,
|
||||||
~TTM_PL_MASK_MEMTYPE);
|
~TTM_PL_MASK_MEMTYPE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -343,19 +343,25 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Single TTM move. NOP.
|
||||||
|
*/
|
||||||
if (old_iomap == NULL && new_iomap == NULL)
|
if (old_iomap == NULL && new_iomap == NULL)
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Move nonexistent data. NOP.
|
||||||
|
*/
|
||||||
if (old_iomap == NULL && ttm == NULL)
|
if (old_iomap == NULL && ttm == NULL)
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
if (ttm->state == tt_unpopulated) {
|
/*
|
||||||
|
* TTM might be null for moves within the same region.
|
||||||
|
*/
|
||||||
|
if (ttm && ttm->state == tt_unpopulated) {
|
||||||
ret = ttm->bdev->driver->ttm_tt_populate(ttm);
|
ret = ttm->bdev->driver->ttm_tt_populate(ttm);
|
||||||
if (ret) {
|
if (ret)
|
||||||
/* if we fail here don't nuke the mm node
|
|
||||||
* as the bo still owns it */
|
|
||||||
old_copy.mm_node = NULL;
|
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add = 0;
|
add = 0;
|
||||||
@ -381,11 +387,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
|||||||
prot);
|
prot);
|
||||||
} else
|
} else
|
||||||
ret = ttm_copy_io_page(new_iomap, old_iomap, page);
|
ret = ttm_copy_io_page(new_iomap, old_iomap, page);
|
||||||
if (ret) {
|
if (ret)
|
||||||
/* failing here, means keep old copy as-is */
|
|
||||||
old_copy.mm_node = NULL;
|
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mb();
|
mb();
|
||||||
out2:
|
out2:
|
||||||
@ -403,7 +406,12 @@ out1:
|
|||||||
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
|
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
|
||||||
out:
|
out:
|
||||||
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
|
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
|
||||||
ttm_bo_mem_put(bo, &old_copy);
|
|
||||||
|
/*
|
||||||
|
* On error, keep the mm node!
|
||||||
|
*/
|
||||||
|
if (!ret)
|
||||||
|
ttm_bo_mem_put(bo, &old_copy);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ttm_bo_move_memcpy);
|
EXPORT_SYMBOL(ttm_bo_move_memcpy);
|
||||||
|
@ -369,12 +369,14 @@ config LOGITECH_FF
|
|||||||
force feedback.
|
force feedback.
|
||||||
|
|
||||||
config LOGIRUMBLEPAD2_FF
|
config LOGIRUMBLEPAD2_FF
|
||||||
bool "Logitech RumblePad/Rumblepad 2 force feedback support"
|
bool "Logitech force feedback support (variant 2)"
|
||||||
depends on HID_LOGITECH
|
depends on HID_LOGITECH
|
||||||
select INPUT_FF_MEMLESS
|
select INPUT_FF_MEMLESS
|
||||||
help
|
help
|
||||||
Say Y here if you want to enable force feedback support for Logitech
|
Say Y here if you want to enable force feedback support for:
|
||||||
RumblePad and Rumblepad 2 devices.
|
- Logitech RumblePad
|
||||||
|
- Logitech Rumblepad 2
|
||||||
|
- Logitech Formula Vibration Feedback Wheel
|
||||||
|
|
||||||
config LOGIG940_FF
|
config LOGIG940_FF
|
||||||
bool "Logitech Flight System G940 force feedback support"
|
bool "Logitech Flight System G940 force feedback support"
|
||||||
@ -453,9 +455,11 @@ config HID_MULTITOUCH
|
|||||||
- Pixcir dual touch panels
|
- Pixcir dual touch panels
|
||||||
- Quanta panels
|
- Quanta panels
|
||||||
- eGalax dual-touch panels, including the Joojoo and Wetab tablets
|
- eGalax dual-touch panels, including the Joojoo and Wetab tablets
|
||||||
|
- SiS multitouch panels
|
||||||
- Stantum multitouch panels
|
- Stantum multitouch panels
|
||||||
- Touch International Panels
|
- Touch International Panels
|
||||||
- Unitec Panels
|
- Unitec Panels
|
||||||
|
- Wistron optical touch panels
|
||||||
- XAT optical touch panels
|
- XAT optical touch panels
|
||||||
- Xiroku optical touch panels
|
- Xiroku optical touch panels
|
||||||
- Zytronic touch panels
|
- Zytronic touch panels
|
||||||
|
@ -46,6 +46,12 @@ module_param(iso_layout, uint, 0644);
|
|||||||
MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. "
|
MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. "
|
||||||
"(0 = disabled, [1] = enabled)");
|
"(0 = disabled, [1] = enabled)");
|
||||||
|
|
||||||
|
static unsigned int swap_opt_cmd = 0;
|
||||||
|
module_param(swap_opt_cmd, uint, 0644);
|
||||||
|
MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\") keys. "
|
||||||
|
"(For people who want to keep Windows PC keyboard muscle memory. "
|
||||||
|
"[0] = as-is, Mac layout. 1 = swapped, Windows layout.)");
|
||||||
|
|
||||||
struct apple_sc {
|
struct apple_sc {
|
||||||
unsigned long quirks;
|
unsigned long quirks;
|
||||||
unsigned int fn_on;
|
unsigned int fn_on;
|
||||||
@ -150,6 +156,14 @@ static const struct apple_key_translation apple_iso_keyboard[] = {
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct apple_key_translation swapped_option_cmd_keys[] = {
|
||||||
|
{ KEY_LEFTALT, KEY_LEFTMETA },
|
||||||
|
{ KEY_LEFTMETA, KEY_LEFTALT },
|
||||||
|
{ KEY_RIGHTALT, KEY_RIGHTMETA },
|
||||||
|
{ KEY_RIGHTMETA,KEY_RIGHTALT },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
static const struct apple_key_translation *apple_find_translation(
|
static const struct apple_key_translation *apple_find_translation(
|
||||||
const struct apple_key_translation *table, u16 from)
|
const struct apple_key_translation *table, u16 from)
|
||||||
{
|
{
|
||||||
@ -242,6 +256,14 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (swap_opt_cmd) {
|
||||||
|
trans = apple_find_translation(swapped_option_cmd_keys, usage->code);
|
||||||
|
if (trans) {
|
||||||
|
input_event(input, usage->type, trans->to, value);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ static int axff_init(struct hid_device *hid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field_count < 4) {
|
if (field_count < 4 && hid->product != 0xf705) {
|
||||||
hid_err(hid, "not enough fields in the report: %d\n",
|
hid_err(hid, "not enough fields in the report: %d\n",
|
||||||
field_count);
|
field_count);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -180,6 +180,7 @@ static void ax_remove(struct hid_device *hdev)
|
|||||||
|
|
||||||
static const struct hid_device_id ax_devices[] = {
|
static const struct hid_device_id ax_devices[] = {
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0xf705), },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(hid, ax_devices);
|
MODULE_DEVICE_TABLE(hid, ax_devices);
|
||||||
|
@ -1657,6 +1657,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0xf705) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
|
||||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
|
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
|
||||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICTRACKPAD) },
|
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICTRACKPAD) },
|
||||||
@ -1799,6 +1800,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFP_WHEEL) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFP_WHEEL) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
|
||||||
@ -1854,12 +1856,14 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
|
||||||
#if IS_ENABLED(CONFIG_HID_ROCCAT)
|
#if IS_ENABLED(CONFIG_HID_ROCCAT)
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
|
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKUFX) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEXTD) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
|
||||||
@ -1869,6 +1873,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SIS2_TOUCH, USB_DEVICE_ID_SIS9200_TOUCH) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SIS2_TOUCH, USB_DEVICE_ID_SIS817_TOUCH) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
|
||||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
|
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
|
||||||
@ -2423,15 +2429,6 @@ bool hid_ignore(struct hid_device *hdev)
|
|||||||
hdev->type == HID_TYPE_USBNONE)
|
hdev->type == HID_TYPE_USBNONE)
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case USB_VENDOR_ID_DWAV:
|
|
||||||
/* These are handled by usbtouchscreen. hdev->type is probably
|
|
||||||
* HID_TYPE_USBNONE, but we say !HID_TYPE_USBMOUSE to match
|
|
||||||
* usbtouchscreen. */
|
|
||||||
if ((hdev->product == USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER ||
|
|
||||||
hdev->product == USB_DEVICE_ID_DWAV_TOUCHCONTROLLER) &&
|
|
||||||
hdev->type != HID_TYPE_USBMOUSE)
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
case USB_VENDOR_ID_VELLEMAN:
|
case USB_VENDOR_ID_VELLEMAN:
|
||||||
/* These are not HID devices. They are handled by comedi. */
|
/* These are not HID devices. They are handled by comedi. */
|
||||||
if ((hdev->product >= USB_DEVICE_ID_VELLEMAN_K8055_FIRST &&
|
if ((hdev->product >= USB_DEVICE_ID_VELLEMAN_K8055_FIRST &&
|
||||||
|
@ -330,6 +330,11 @@
|
|||||||
#define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc
|
#define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc
|
||||||
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003
|
||||||
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS 0x0100
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS 0x0100
|
||||||
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0101 0x0101
|
||||||
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0102 0x0102
|
||||||
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0106 0x0106
|
||||||
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_010A 0x010a
|
||||||
|
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100
|
||||||
|
|
||||||
#define USB_VENDOR_ID_GLAB 0x06c2
|
#define USB_VENDOR_ID_GLAB 0x06c2
|
||||||
#define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038
|
#define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038
|
||||||
@ -569,6 +574,7 @@
|
|||||||
#define USB_DEVICE_ID_DINOVO_EDGE 0xc714
|
#define USB_DEVICE_ID_DINOVO_EDGE 0xc714
|
||||||
#define USB_DEVICE_ID_DINOVO_MINI 0xc71f
|
#define USB_DEVICE_ID_DINOVO_MINI 0xc71f
|
||||||
#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 0xca03
|
#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 0xca03
|
||||||
|
#define USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL 0xca04
|
||||||
#define USB_DEVICE_ID_WIRELESS_TOUCHPAD_T651 0xb00c
|
#define USB_DEVICE_ID_WIRELESS_TOUCHPAD_T651 0xb00c
|
||||||
#define USB_DEVICE_ID_BLUETOOTH_TOUCHMOUSE 0xb00d
|
#define USB_DEVICE_ID_BLUETOOTH_TOUCHMOUSE 0xb00d
|
||||||
|
|
||||||
@ -747,6 +753,10 @@
|
|||||||
#define USB_VENDOR_ID_SIGMATEL 0x066F
|
#define USB_VENDOR_ID_SIGMATEL 0x066F
|
||||||
#define USB_DEVICE_ID_SIGMATEL_STMP3780 0x3780
|
#define USB_DEVICE_ID_SIGMATEL_STMP3780 0x3780
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_SIS2_TOUCH 0x0457
|
||||||
|
#define USB_DEVICE_ID_SIS9200_TOUCH 0x9200
|
||||||
|
#define USB_DEVICE_ID_SIS817_TOUCH 0x0817
|
||||||
|
|
||||||
#define USB_VENDOR_ID_SKYCABLE 0x1223
|
#define USB_VENDOR_ID_SKYCABLE 0x1223
|
||||||
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07
|
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07
|
||||||
|
|
||||||
@ -886,6 +896,9 @@
|
|||||||
#define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802
|
#define USB_DEVICE_ID_SUPER_DUAL_BOX_PRO 0x8802
|
||||||
#define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804
|
#define USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO 0x8804
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_WISTRON 0x0fb8
|
||||||
|
#define USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH 0x1109
|
||||||
|
|
||||||
#define USB_VENDOR_ID_X_TENSIONS 0x1ae7
|
#define USB_VENDOR_ID_X_TENSIONS 0x1ae7
|
||||||
#define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001
|
#define USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE 0x9001
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
/* Size of the original descriptors of the Driving Force (and Pro) wheels */
|
/* Size of the original descriptors of the Driving Force (and Pro) wheels */
|
||||||
#define DF_RDESC_ORIG_SIZE 130
|
#define DF_RDESC_ORIG_SIZE 130
|
||||||
#define DFP_RDESC_ORIG_SIZE 97
|
#define DFP_RDESC_ORIG_SIZE 97
|
||||||
|
#define FV_RDESC_ORIG_SIZE 130
|
||||||
#define MOMO_RDESC_ORIG_SIZE 87
|
#define MOMO_RDESC_ORIG_SIZE 87
|
||||||
|
|
||||||
/* Fixed report descriptors for Logitech Driving Force (and Pro)
|
/* Fixed report descriptors for Logitech Driving Force (and Pro)
|
||||||
@ -170,6 +171,73 @@ static __u8 dfp_rdesc_fixed[] = {
|
|||||||
0xC0 /* End Collection */
|
0xC0 /* End Collection */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static __u8 fv_rdesc_fixed[] = {
|
||||||
|
0x05, 0x01, /* Usage Page (Desktop), */
|
||||||
|
0x09, 0x04, /* Usage (Joystik), */
|
||||||
|
0xA1, 0x01, /* Collection (Application), */
|
||||||
|
0xA1, 0x02, /* Collection (Logical), */
|
||||||
|
0x95, 0x01, /* Report Count (1), */
|
||||||
|
0x75, 0x0A, /* Report Size (10), */
|
||||||
|
0x15, 0x00, /* Logical Minimum (0), */
|
||||||
|
0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
|
||||||
|
0x35, 0x00, /* Physical Minimum (0), */
|
||||||
|
0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
|
||||||
|
0x09, 0x30, /* Usage (X), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x95, 0x0C, /* Report Count (12), */
|
||||||
|
0x75, 0x01, /* Report Size (1), */
|
||||||
|
0x25, 0x01, /* Logical Maximum (1), */
|
||||||
|
0x45, 0x01, /* Physical Maximum (1), */
|
||||||
|
0x05, 0x09, /* Usage Page (Button), */
|
||||||
|
0x19, 0x01, /* Usage Minimum (01h), */
|
||||||
|
0x29, 0x0C, /* Usage Maximum (0Ch), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x95, 0x02, /* Report Count (2), */
|
||||||
|
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||||
|
0x09, 0x01, /* Usage (01h), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x09, 0x02, /* Usage (02h), */
|
||||||
|
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||||
|
0x46, 0xFF, 0x00, /* Physical Maximum (255), */
|
||||||
|
0x95, 0x01, /* Report Count (1), */
|
||||||
|
0x75, 0x08, /* Report Size (8), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x05, 0x01, /* Usage Page (Desktop), */
|
||||||
|
0x25, 0x07, /* Logical Maximum (7), */
|
||||||
|
0x46, 0x3B, 0x01, /* Physical Maximum (315), */
|
||||||
|
0x75, 0x04, /* Report Size (4), */
|
||||||
|
0x65, 0x14, /* Unit (Degrees), */
|
||||||
|
0x09, 0x39, /* Usage (Hat Switch), */
|
||||||
|
0x81, 0x42, /* Input (Variable, Null State), */
|
||||||
|
0x75, 0x01, /* Report Size (1), */
|
||||||
|
0x95, 0x04, /* Report Count (4), */
|
||||||
|
0x65, 0x00, /* Unit, */
|
||||||
|
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||||
|
0x09, 0x01, /* Usage (01h), */
|
||||||
|
0x25, 0x01, /* Logical Maximum (1), */
|
||||||
|
0x45, 0x01, /* Physical Maximum (1), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x05, 0x01, /* Usage Page (Desktop), */
|
||||||
|
0x95, 0x01, /* Report Count (1), */
|
||||||
|
0x75, 0x08, /* Report Size (8), */
|
||||||
|
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||||
|
0x46, 0xFF, 0x00, /* Physical Maximum (255), */
|
||||||
|
0x09, 0x31, /* Usage (Y), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0x09, 0x32, /* Usage (Z), */
|
||||||
|
0x81, 0x02, /* Input (Variable), */
|
||||||
|
0xC0, /* End Collection, */
|
||||||
|
0xA1, 0x02, /* Collection (Logical), */
|
||||||
|
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||||
|
0x46, 0xFF, 0x00, /* Physical Maximum (255), */
|
||||||
|
0x95, 0x07, /* Report Count (7), */
|
||||||
|
0x75, 0x08, /* Report Size (8), */
|
||||||
|
0x09, 0x03, /* Usage (03h), */
|
||||||
|
0x91, 0x02, /* Output (Variable), */
|
||||||
|
0xC0, /* End Collection, */
|
||||||
|
0xC0 /* End Collection */
|
||||||
|
};
|
||||||
|
|
||||||
static __u8 momo_rdesc_fixed[] = {
|
static __u8 momo_rdesc_fixed[] = {
|
||||||
0x05, 0x01, /* Usage Page (Desktop), */
|
0x05, 0x01, /* Usage Page (Desktop), */
|
||||||
0x09, 0x04, /* Usage (Joystik), */
|
0x09, 0x04, /* Usage (Joystik), */
|
||||||
@ -275,6 +343,15 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL:
|
||||||
|
if (*rsize == FV_RDESC_ORIG_SIZE) {
|
||||||
|
hid_info(hdev,
|
||||||
|
"fixing up Logitech Formula Vibration report descriptor\n");
|
||||||
|
rdesc = fv_rdesc_fixed;
|
||||||
|
*rsize = sizeof(fv_rdesc_fixed);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case USB_DEVICE_ID_LOGITECH_DFP_WHEEL:
|
case USB_DEVICE_ID_LOGITECH_DFP_WHEEL:
|
||||||
if (*rsize == DFP_RDESC_ORIG_SIZE) {
|
if (*rsize == DFP_RDESC_ORIG_SIZE) {
|
||||||
hid_info(hdev,
|
hid_info(hdev,
|
||||||
@ -492,6 +569,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi,
|
|||||||
case USB_DEVICE_ID_LOGITECH_G27_WHEEL:
|
case USB_DEVICE_ID_LOGITECH_G27_WHEEL:
|
||||||
case USB_DEVICE_ID_LOGITECH_WII_WHEEL:
|
case USB_DEVICE_ID_LOGITECH_WII_WHEEL:
|
||||||
case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2:
|
case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2:
|
||||||
|
case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL:
|
||||||
field->application = HID_GD_MULTIAXIS;
|
field->application = HID_GD_MULTIAXIS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -639,6 +717,8 @@ static const struct hid_device_id lg_devices[] = {
|
|||||||
.driver_data = LG_NOGET | LG_FF4 },
|
.driver_data = LG_NOGET | LG_FF4 },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
|
||||||
.driver_data = LG_FF4 },
|
.driver_data = LG_FF4 },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL),
|
||||||
|
.driver_data = LG_FF2 },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
|
||||||
.driver_data = LG_FF4 },
|
.driver_data = LG_FF4 },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL),
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL),
|
||||||
|
@ -95,7 +95,7 @@ int lg2ff_init(struct hid_device *hid)
|
|||||||
|
|
||||||
hid_hw_request(hid, report, HID_REQ_SET_REPORT);
|
hid_hw_request(hid, report, HID_REQ_SET_REPORT);
|
||||||
|
|
||||||
hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <anssi.hannula@gmail.com>\n");
|
hid_info(hid, "Force feedback for Logitech variant 2 rumble devices by Anssi Hannula <anssi.hannula@gmail.com>\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -218,12 +218,46 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud
|
|||||||
struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
|
struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
|
||||||
struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
|
struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
|
||||||
__s32 *value = report->field[0]->value;
|
__s32 *value = report->field[0]->value;
|
||||||
|
__u32 expand_a, expand_b;
|
||||||
|
|
||||||
|
/* De-activate Auto-Center */
|
||||||
|
if (magnitude == 0) {
|
||||||
|
value[0] = 0xf5;
|
||||||
|
value[1] = 0x00;
|
||||||
|
value[2] = 0x00;
|
||||||
|
value[3] = 0x00;
|
||||||
|
value[4] = 0x00;
|
||||||
|
value[5] = 0x00;
|
||||||
|
value[6] = 0x00;
|
||||||
|
|
||||||
|
hid_hw_request(hid, report, HID_REQ_SET_REPORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (magnitude <= 0xaaaa) {
|
||||||
|
expand_a = 0x0c * magnitude;
|
||||||
|
expand_b = 0x80 * magnitude;
|
||||||
|
} else {
|
||||||
|
expand_a = (0x0c * 0xaaaa) + 0x06 * (magnitude - 0xaaaa);
|
||||||
|
expand_b = (0x80 * 0xaaaa) + 0xff * (magnitude - 0xaaaa);
|
||||||
|
}
|
||||||
|
|
||||||
value[0] = 0xfe;
|
value[0] = 0xfe;
|
||||||
value[1] = 0x0d;
|
value[1] = 0x0d;
|
||||||
value[2] = magnitude >> 13;
|
value[2] = expand_a / 0xaaaa;
|
||||||
value[3] = magnitude >> 13;
|
value[3] = expand_a / 0xaaaa;
|
||||||
value[4] = magnitude >> 8;
|
value[4] = expand_b / 0xaaaa;
|
||||||
|
value[5] = 0x00;
|
||||||
|
value[6] = 0x00;
|
||||||
|
|
||||||
|
hid_hw_request(hid, report, HID_REQ_SET_REPORT);
|
||||||
|
|
||||||
|
/* Activate Auto-Center */
|
||||||
|
value[0] = 0x14;
|
||||||
|
value[1] = 0x00;
|
||||||
|
value[2] = 0x00;
|
||||||
|
value[3] = 0x00;
|
||||||
|
value[4] = 0x00;
|
||||||
value[5] = 0x00;
|
value[5] = 0x00;
|
||||||
value[6] = 0x00;
|
value[6] = 0x00;
|
||||||
|
|
||||||
@ -540,17 +574,6 @@ int lg4ff_init(struct hid_device *hid)
|
|||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
/* Check if autocentering is available and
|
|
||||||
* set the centering force to zero by default */
|
|
||||||
if (test_bit(FF_AUTOCENTER, dev->ffbit)) {
|
|
||||||
if (rev_maj == FFEX_REV_MAJ && rev_min == FFEX_REV_MIN) /* Formula Force EX expects different autocentering command */
|
|
||||||
dev->ff->set_autocenter = hid_lg4ff_set_autocenter_ffex;
|
|
||||||
else
|
|
||||||
dev->ff->set_autocenter = hid_lg4ff_set_autocenter_default;
|
|
||||||
|
|
||||||
dev->ff->set_autocenter(dev, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get private driver data */
|
/* Get private driver data */
|
||||||
drv_data = hid_get_drvdata(hid);
|
drv_data = hid_get_drvdata(hid);
|
||||||
if (!drv_data) {
|
if (!drv_data) {
|
||||||
@ -571,6 +594,17 @@ int lg4ff_init(struct hid_device *hid)
|
|||||||
entry->max_range = lg4ff_devices[i].max_range;
|
entry->max_range = lg4ff_devices[i].max_range;
|
||||||
entry->set_range = lg4ff_devices[i].set_range;
|
entry->set_range = lg4ff_devices[i].set_range;
|
||||||
|
|
||||||
|
/* Check if autocentering is available and
|
||||||
|
* set the centering force to zero by default */
|
||||||
|
if (test_bit(FF_AUTOCENTER, dev->ffbit)) {
|
||||||
|
if (rev_maj == FFEX_REV_MAJ && rev_min == FFEX_REV_MIN) /* Formula Force EX expects different autocentering command */
|
||||||
|
dev->ff->set_autocenter = hid_lg4ff_set_autocenter_ffex;
|
||||||
|
else
|
||||||
|
dev->ff->set_autocenter = hid_lg4ff_set_autocenter_default;
|
||||||
|
|
||||||
|
dev->ff->set_autocenter(dev, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Create sysfs interface */
|
/* Create sysfs interface */
|
||||||
error = device_create_file(&hid->dev, &dev_attr_range);
|
error = device_create_file(&hid->dev, &dev_attr_range);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -250,12 +250,12 @@ static struct mt_class mt_classes[] = {
|
|||||||
{ .name = MT_CLS_GENERALTOUCH_TWOFINGERS,
|
{ .name = MT_CLS_GENERALTOUCH_TWOFINGERS,
|
||||||
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
|
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
|
||||||
MT_QUIRK_VALID_IS_INRANGE |
|
MT_QUIRK_VALID_IS_INRANGE |
|
||||||
MT_QUIRK_SLOT_IS_CONTACTNUMBER,
|
MT_QUIRK_SLOT_IS_CONTACTID,
|
||||||
.maxcontacts = 2
|
.maxcontacts = 2
|
||||||
},
|
},
|
||||||
{ .name = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
{ .name = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
|
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
|
||||||
MT_QUIRK_SLOT_IS_CONTACTNUMBER
|
MT_QUIRK_SLOT_IS_CONTACTID
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = MT_CLS_FLATFROG,
|
{ .name = MT_CLS_FLATFROG,
|
||||||
@ -1200,6 +1200,21 @@ static const struct hid_device_id mt_devices[] = {
|
|||||||
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
|
||||||
|
{ .driver_data = MT_CLS_GENERALTOUCH_TWOFINGERS,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0101) },
|
||||||
|
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0102) },
|
||||||
|
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_0106) },
|
||||||
|
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_010A) },
|
||||||
|
{ .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
|
||||||
|
USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100) },
|
||||||
|
|
||||||
/* Gametel game controller */
|
/* Gametel game controller */
|
||||||
{ .driver_data = MT_CLS_NSMU,
|
{ .driver_data = MT_CLS_NSMU,
|
||||||
@ -1314,6 +1329,14 @@ static const struct hid_device_id mt_devices[] = {
|
|||||||
MT_USB_DEVICE(USB_VENDOR_ID_QUANTA,
|
MT_USB_DEVICE(USB_VENDOR_ID_QUANTA,
|
||||||
USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
|
USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008) },
|
||||||
|
|
||||||
|
/* SiS panels */
|
||||||
|
{ .driver_data = MT_CLS_DEFAULT,
|
||||||
|
HID_USB_DEVICE(USB_VENDOR_ID_SIS2_TOUCH,
|
||||||
|
USB_DEVICE_ID_SIS9200_TOUCH) },
|
||||||
|
{ .driver_data = MT_CLS_DEFAULT,
|
||||||
|
HID_USB_DEVICE(USB_VENDOR_ID_SIS2_TOUCH,
|
||||||
|
USB_DEVICE_ID_SIS817_TOUCH) },
|
||||||
|
|
||||||
/* Stantum panels */
|
/* Stantum panels */
|
||||||
{ .driver_data = MT_CLS_CONFIDENCE,
|
{ .driver_data = MT_CLS_CONFIDENCE,
|
||||||
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
|
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM,
|
||||||
@ -1342,6 +1365,12 @@ static const struct hid_device_id mt_devices[] = {
|
|||||||
{ .driver_data = MT_CLS_NSMU,
|
{ .driver_data = MT_CLS_NSMU,
|
||||||
MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
|
MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
|
||||||
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
|
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
|
||||||
|
|
||||||
|
/* Wistron panels */
|
||||||
|
{ .driver_data = MT_CLS_NSMU,
|
||||||
|
MT_USB_DEVICE(USB_VENDOR_ID_WISTRON,
|
||||||
|
USB_DEVICE_ID_WISTRON_OPTICAL_TOUCH) },
|
||||||
|
|
||||||
/* XAT */
|
/* XAT */
|
||||||
{ .driver_data = MT_CLS_NSMU,
|
{ .driver_data = MT_CLS_NSMU,
|
||||||
MT_USB_DEVICE(USB_VENDOR_ID_XAT,
|
MT_USB_DEVICE(USB_VENDOR_ID_XAT,
|
||||||
|
@ -65,10 +65,11 @@ int roccat_common2_send(struct usb_device *usb_dev, uint report_id,
|
|||||||
EXPORT_SYMBOL_GPL(roccat_common2_send);
|
EXPORT_SYMBOL_GPL(roccat_common2_send);
|
||||||
|
|
||||||
enum roccat_common2_control_states {
|
enum roccat_common2_control_states {
|
||||||
ROCCAT_COMMON_CONTROL_STATUS_OVERLOAD = 0,
|
ROCCAT_COMMON_CONTROL_STATUS_CRITICAL = 0,
|
||||||
ROCCAT_COMMON_CONTROL_STATUS_OK = 1,
|
ROCCAT_COMMON_CONTROL_STATUS_OK = 1,
|
||||||
ROCCAT_COMMON_CONTROL_STATUS_INVALID = 2,
|
ROCCAT_COMMON_CONTROL_STATUS_INVALID = 2,
|
||||||
ROCCAT_COMMON_CONTROL_STATUS_WAIT = 3,
|
ROCCAT_COMMON_CONTROL_STATUS_BUSY = 3,
|
||||||
|
ROCCAT_COMMON_CONTROL_STATUS_CRITICAL_NEW = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int roccat_common2_receive_control_status(struct usb_device *usb_dev)
|
static int roccat_common2_receive_control_status(struct usb_device *usb_dev)
|
||||||
@ -88,13 +89,12 @@ static int roccat_common2_receive_control_status(struct usb_device *usb_dev)
|
|||||||
switch (control.value) {
|
switch (control.value) {
|
||||||
case ROCCAT_COMMON_CONTROL_STATUS_OK:
|
case ROCCAT_COMMON_CONTROL_STATUS_OK:
|
||||||
return 0;
|
return 0;
|
||||||
case ROCCAT_COMMON_CONTROL_STATUS_WAIT:
|
case ROCCAT_COMMON_CONTROL_STATUS_BUSY:
|
||||||
msleep(500);
|
msleep(500);
|
||||||
continue;
|
continue;
|
||||||
case ROCCAT_COMMON_CONTROL_STATUS_INVALID:
|
case ROCCAT_COMMON_CONTROL_STATUS_INVALID:
|
||||||
|
case ROCCAT_COMMON_CONTROL_STATUS_CRITICAL:
|
||||||
case ROCCAT_COMMON_CONTROL_STATUS_OVERLOAD:
|
case ROCCAT_COMMON_CONTROL_STATUS_CRITICAL_NEW:
|
||||||
/* seems to be critical - replug necessary */
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
default:
|
default:
|
||||||
dev_err(&usb_dev->dev,
|
dev_err(&usb_dev->dev,
|
||||||
|
@ -577,9 +577,13 @@ static void kovaplus_keep_values_up_to_date(struct kovaplus_device *kovaplus,
|
|||||||
break;
|
break;
|
||||||
case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI:
|
case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI:
|
||||||
kovaplus->actual_cpi = kovaplus_convert_event_cpi(button_report->data1);
|
kovaplus->actual_cpi = kovaplus_convert_event_cpi(button_report->data1);
|
||||||
|
break;
|
||||||
case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY:
|
case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY:
|
||||||
kovaplus->actual_x_sensitivity = button_report->data1;
|
kovaplus->actual_x_sensitivity = button_report->data1;
|
||||||
kovaplus->actual_y_sensitivity = button_report->data2;
|
kovaplus->actual_y_sensitivity = button_report->data2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,8 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
|
|||||||
field->logical == attr_usage_id) {
|
field->logical == attr_usage_id) {
|
||||||
sensor_hub_fill_attr_info(info, i, report->id,
|
sensor_hub_fill_attr_info(info, i, report->id,
|
||||||
field->unit, field->unit_exponent,
|
field->unit, field->unit_exponent,
|
||||||
field->report_size);
|
field->report_size *
|
||||||
|
field->report_count);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
for (j = 0; j < field->maxusage; ++j) {
|
for (j = 0; j < field->maxusage; ++j) {
|
||||||
@ -339,7 +340,8 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
|
|||||||
i, report->id,
|
i, report->id,
|
||||||
field->unit,
|
field->unit,
|
||||||
field->unit_exponent,
|
field->unit_exponent,
|
||||||
field->report_size);
|
field->report_size *
|
||||||
|
field->report_count);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -426,9 +428,10 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
|
|||||||
hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n",
|
hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n",
|
||||||
i, report->field[i]->usage->collection_index,
|
i, report->field[i]->usage->collection_index,
|
||||||
report->field[i]->usage->hid,
|
report->field[i]->usage->hid,
|
||||||
report->field[i]->report_size/8);
|
(report->field[i]->report_size *
|
||||||
|
report->field[i]->report_count)/8);
|
||||||
sz = report->field[i]->report_size/8;
|
sz = (report->field[i]->report_size *
|
||||||
|
report->field[i]->report_count)/8;
|
||||||
if (pdata->pending.status && pdata->pending.attr_usage_id ==
|
if (pdata->pending.status && pdata->pending.attr_usage_id ==
|
||||||
report->field[i]->usage->hid) {
|
report->field[i]->usage->hid) {
|
||||||
hid_dbg(hdev, "data was pending ...\n");
|
hid_dbg(hdev, "data was pending ...\n");
|
||||||
|
@ -88,6 +88,8 @@ static const struct hid_blacklist {
|
|||||||
{ USB_VENDOR_ID_REALTEK, USB_DEVICE_ID_REALTEK_READER, HID_QUIRK_NO_INIT_REPORTS },
|
{ USB_VENDOR_ID_REALTEK, USB_DEVICE_ID_REALTEK_READER, HID_QUIRK_NO_INIT_REPORTS },
|
||||||
{ USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
|
{ USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
|
||||||
{ USB_VENDOR_ID_SIGMATEL, USB_DEVICE_ID_SIGMATEL_STMP3780, HID_QUIRK_NOGET },
|
{ USB_VENDOR_ID_SIGMATEL, USB_DEVICE_ID_SIGMATEL_STMP3780, HID_QUIRK_NOGET },
|
||||||
|
{ USB_VENDOR_ID_SIS2_TOUCH, USB_DEVICE_ID_SIS9200_TOUCH, HID_QUIRK_NOGET },
|
||||||
|
{ USB_VENDOR_ID_SIS2_TOUCH, USB_DEVICE_ID_SIS817_TOUCH, HID_QUIRK_NOGET },
|
||||||
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
|
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
|
||||||
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
|
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
|
||||||
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
|
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
|
||||||
|
@ -31,15 +31,15 @@ static void i2c_mux_gpio_set(const struct gpiomux *mux, unsigned val)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < mux->data.n_gpios; i++)
|
for (i = 0; i < mux->data.n_gpios; i++)
|
||||||
gpio_set_value(mux->gpio_base + mux->data.gpios[i],
|
gpio_set_value_cansleep(mux->gpio_base + mux->data.gpios[i],
|
||||||
val & (1 << i));
|
val & (1 << i));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int i2c_mux_gpio_select(struct i2c_adapter *adap, void *data, u32 chan)
|
static int i2c_mux_gpio_select(struct i2c_adapter *adap, void *data, u32 chan)
|
||||||
{
|
{
|
||||||
struct gpiomux *mux = data;
|
struct gpiomux *mux = data;
|
||||||
|
|
||||||
i2c_mux_gpio_set(mux, mux->data.values[chan]);
|
i2c_mux_gpio_set(mux, chan);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
|
|||||||
unsigned int class = mux->data.classes ? mux->data.classes[i] : 0;
|
unsigned int class = mux->data.classes ? mux->data.classes[i] : 0;
|
||||||
|
|
||||||
mux->adap[i] = i2c_add_mux_adapter(parent, &pdev->dev, mux, nr,
|
mux->adap[i] = i2c_add_mux_adapter(parent, &pdev->dev, mux, nr,
|
||||||
i, class,
|
mux->data.values[i], class,
|
||||||
i2c_mux_gpio_select, deselect);
|
i2c_mux_gpio_select, deselect);
|
||||||
if (!mux->adap[i]) {
|
if (!mux->adap[i]) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
|
@ -112,9 +112,10 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address)
|
|||||||
mutex_lock(&st->buf_lock);
|
mutex_lock(&st->buf_lock);
|
||||||
st->tx[0] = KXSD9_READ(address);
|
st->tx[0] = KXSD9_READ(address);
|
||||||
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
|
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
|
||||||
if (ret)
|
if (!ret)
|
||||||
return ret;
|
ret = (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
|
||||||
return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
|
mutex_unlock(&st->buf_lock);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IIO_CONST_ATTR(accel_scale_available,
|
static IIO_CONST_ATTR(accel_scale_available,
|
||||||
|
@ -280,9 +280,7 @@ static int ipath_user_sdma_pin_pages(const struct ipath_devdata *dd,
|
|||||||
int j;
|
int j;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = get_user_pages(current, current->mm, addr,
|
ret = get_user_pages_fast(addr, npages, 0, pages);
|
||||||
npages, 0, 1, pages, NULL);
|
|
||||||
|
|
||||||
if (ret != npages) {
|
if (ret != npages) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -811,10 +809,7 @@ int ipath_user_sdma_writev(struct ipath_devdata *dd,
|
|||||||
while (dim) {
|
while (dim) {
|
||||||
const int mxp = 8;
|
const int mxp = 8;
|
||||||
|
|
||||||
down_write(¤t->mm->mmap_sem);
|
|
||||||
ret = ipath_user_sdma_queue_pkts(dd, pq, &list, iov, dim, mxp);
|
ret = ipath_user_sdma_queue_pkts(dd, pq, &list, iov, dim, mxp);
|
||||||
up_write(¤t->mm->mmap_sem);
|
|
||||||
|
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
goto done_unlock;
|
goto done_unlock;
|
||||||
else {
|
else {
|
||||||
|
@ -5853,21 +5853,20 @@ static int setup_txselect(const char *str, struct kernel_param *kp)
|
|||||||
{
|
{
|
||||||
struct qib_devdata *dd;
|
struct qib_devdata *dd;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int ret;
|
char *n;
|
||||||
|
|
||||||
if (strlen(str) >= MAX_ATTEN_LEN) {
|
if (strlen(str) >= MAX_ATTEN_LEN) {
|
||||||
pr_info("txselect_values string too long\n");
|
pr_info("txselect_values string too long\n");
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
ret = kstrtoul(str, 0, &val);
|
val = simple_strtoul(str, &n, 0);
|
||||||
if (ret || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
|
if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
|
||||||
TXDDS_MFG_SZ)) {
|
TXDDS_MFG_SZ)) {
|
||||||
pr_info("txselect_values must start with a number < %d\n",
|
pr_info("txselect_values must start with a number < %d\n",
|
||||||
TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
|
TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
|
||||||
return ret ? ret : -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(txselect_list, str);
|
strcpy(txselect_list, str);
|
||||||
|
|
||||||
list_for_each_entry(dd, &qib_dev_list, list)
|
list_for_each_entry(dd, &qib_dev_list, list)
|
||||||
if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
|
if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
|
||||||
set_no_qsfp_atten(dd, 1);
|
set_no_qsfp_atten(dd, 1);
|
||||||
|
@ -1300,14 +1300,13 @@ static void srp_handle_recv(struct srp_target_port *target, struct ib_wc *wc)
|
|||||||
PFX "Recv failed with error code %d\n", res);
|
PFX "Recv failed with error code %d\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void srp_handle_qp_err(enum ib_wc_status wc_status,
|
static void srp_handle_qp_err(enum ib_wc_status wc_status, bool send_err,
|
||||||
enum ib_wc_opcode wc_opcode,
|
|
||||||
struct srp_target_port *target)
|
struct srp_target_port *target)
|
||||||
{
|
{
|
||||||
if (target->connected && !target->qp_in_error) {
|
if (target->connected && !target->qp_in_error) {
|
||||||
shost_printk(KERN_ERR, target->scsi_host,
|
shost_printk(KERN_ERR, target->scsi_host,
|
||||||
PFX "failed %s status %d\n",
|
PFX "failed %s status %d\n",
|
||||||
wc_opcode & IB_WC_RECV ? "receive" : "send",
|
send_err ? "send" : "receive",
|
||||||
wc_status);
|
wc_status);
|
||||||
}
|
}
|
||||||
target->qp_in_error = true;
|
target->qp_in_error = true;
|
||||||
@ -1323,7 +1322,7 @@ static void srp_recv_completion(struct ib_cq *cq, void *target_ptr)
|
|||||||
if (likely(wc.status == IB_WC_SUCCESS)) {
|
if (likely(wc.status == IB_WC_SUCCESS)) {
|
||||||
srp_handle_recv(target, &wc);
|
srp_handle_recv(target, &wc);
|
||||||
} else {
|
} else {
|
||||||
srp_handle_qp_err(wc.status, wc.opcode, target);
|
srp_handle_qp_err(wc.status, false, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1339,7 +1338,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr)
|
|||||||
iu = (struct srp_iu *) (uintptr_t) wc.wr_id;
|
iu = (struct srp_iu *) (uintptr_t) wc.wr_id;
|
||||||
list_add(&iu->list, &target->free_tx);
|
list_add(&iu->list, &target->free_tx);
|
||||||
} else {
|
} else {
|
||||||
srp_handle_qp_err(wc.status, wc.opcode, target);
|
srp_handle_qp_err(wc.status, true, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/vmalloc.h>
|
||||||
|
#include <linux/mm.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/input/mt.h>
|
#include <linux/input/mt.h>
|
||||||
@ -289,7 +291,11 @@ static int evdev_release(struct inode *inode, struct file *file)
|
|||||||
mutex_unlock(&evdev->mutex);
|
mutex_unlock(&evdev->mutex);
|
||||||
|
|
||||||
evdev_detach_client(evdev, client);
|
evdev_detach_client(evdev, client);
|
||||||
kfree(client);
|
|
||||||
|
if (is_vmalloc_addr(client))
|
||||||
|
vfree(client);
|
||||||
|
else
|
||||||
|
kfree(client);
|
||||||
|
|
||||||
evdev_close_device(evdev);
|
evdev_close_device(evdev);
|
||||||
|
|
||||||
@ -309,12 +315,14 @@ static int evdev_open(struct inode *inode, struct file *file)
|
|||||||
{
|
{
|
||||||
struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev);
|
struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev);
|
||||||
unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev);
|
unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev);
|
||||||
|
unsigned int size = sizeof(struct evdev_client) +
|
||||||
|
bufsize * sizeof(struct input_event);
|
||||||
struct evdev_client *client;
|
struct evdev_client *client;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
client = kzalloc(sizeof(struct evdev_client) +
|
client = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
|
||||||
bufsize * sizeof(struct input_event),
|
if (!client)
|
||||||
GFP_KERNEL);
|
client = vzalloc(size);
|
||||||
if (!client)
|
if (!client)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ static int cypress_get_finger_count(unsigned char header_byte)
|
|||||||
case 2: return 5;
|
case 2: return 5;
|
||||||
default:
|
default:
|
||||||
/* Invalid contact (e.g. palm). Ignore it. */
|
/* Invalid contact (e.g. palm). Ignore it. */
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,17 +452,10 @@ static int cypress_parse_packet(struct psmouse *psmouse,
|
|||||||
{
|
{
|
||||||
unsigned char *packet = psmouse->packet;
|
unsigned char *packet = psmouse->packet;
|
||||||
unsigned char header_byte = packet[0];
|
unsigned char header_byte = packet[0];
|
||||||
int contact_cnt;
|
|
||||||
|
|
||||||
memset(report_data, 0, sizeof(struct cytp_report_data));
|
memset(report_data, 0, sizeof(struct cytp_report_data));
|
||||||
|
|
||||||
contact_cnt = cypress_get_finger_count(header_byte);
|
report_data->contact_cnt = cypress_get_finger_count(header_byte);
|
||||||
|
|
||||||
if (contact_cnt < 0) /* e.g. palm detect */
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
report_data->contact_cnt = contact_cnt;
|
|
||||||
|
|
||||||
report_data->tap = (header_byte & ABS_MULTIFINGER_TAP) ? 1 : 0;
|
report_data->tap = (header_byte & ABS_MULTIFINGER_TAP) ? 1 : 0;
|
||||||
|
|
||||||
if (report_data->contact_cnt == 1) {
|
if (report_data->contact_cnt == 1) {
|
||||||
@ -535,11 +528,9 @@ static void cypress_process_packet(struct psmouse *psmouse, bool zero_pkt)
|
|||||||
int slots[CYTP_MAX_MT_SLOTS];
|
int slots[CYTP_MAX_MT_SLOTS];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (cypress_parse_packet(psmouse, cytp, &report_data))
|
cypress_parse_packet(psmouse, cytp, &report_data);
|
||||||
return;
|
|
||||||
|
|
||||||
n = report_data.contact_cnt;
|
n = report_data.contact_cnt;
|
||||||
|
|
||||||
if (n > CYTP_MAX_MT_SLOTS)
|
if (n > CYTP_MAX_MT_SLOTS)
|
||||||
n = CYTP_MAX_MT_SLOTS;
|
n = CYTP_MAX_MT_SLOTS;
|
||||||
|
|
||||||
@ -605,10 +596,6 @@ static psmouse_ret_t cypress_validate_byte(struct psmouse *psmouse)
|
|||||||
return PSMOUSE_BAD_DATA;
|
return PSMOUSE_BAD_DATA;
|
||||||
|
|
||||||
contact_cnt = cypress_get_finger_count(packet[0]);
|
contact_cnt = cypress_get_finger_count(packet[0]);
|
||||||
|
|
||||||
if (contact_cnt < 0)
|
|
||||||
return PSMOUSE_BAD_DATA;
|
|
||||||
|
|
||||||
if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE)
|
if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE)
|
||||||
cypress_set_packet_size(psmouse, contact_cnt == 2 ? 7 : 4);
|
cypress_set_packet_size(psmouse, contact_cnt == 2 ? 7 : 4);
|
||||||
else
|
else
|
||||||
|
@ -765,6 +765,7 @@ static struct pnp_device_id pnp_kbd_devids[] = {
|
|||||||
{ .id = "CPQA0D7", .driver_data = 0 },
|
{ .id = "CPQA0D7", .driver_data = 0 },
|
||||||
{ .id = "", },
|
{ .id = "", },
|
||||||
};
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
|
||||||
|
|
||||||
static struct pnp_driver i8042_pnp_kbd_driver = {
|
static struct pnp_driver i8042_pnp_kbd_driver = {
|
||||||
.name = "i8042 kbd",
|
.name = "i8042 kbd",
|
||||||
@ -786,6 +787,7 @@ static struct pnp_device_id pnp_aux_devids[] = {
|
|||||||
{ .id = "SYN0801", .driver_data = 0 },
|
{ .id = "SYN0801", .driver_data = 0 },
|
||||||
{ .id = "", },
|
{ .id = "", },
|
||||||
};
|
};
|
||||||
|
MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
|
||||||
|
|
||||||
static struct pnp_driver i8042_pnp_aux_driver = {
|
static struct pnp_driver i8042_pnp_aux_driver = {
|
||||||
.name = "i8042 aux",
|
.name = "i8042 aux",
|
||||||
|
@ -146,12 +146,10 @@ enum {
|
|||||||
|
|
||||||
#define USB_DEVICE_HID_CLASS(vend, prod) \
|
#define USB_DEVICE_HID_CLASS(vend, prod) \
|
||||||
.match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \
|
.match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \
|
||||||
| USB_DEVICE_ID_MATCH_INT_PROTOCOL \
|
|
||||||
| USB_DEVICE_ID_MATCH_DEVICE, \
|
| USB_DEVICE_ID_MATCH_DEVICE, \
|
||||||
.idVendor = (vend), \
|
.idVendor = (vend), \
|
||||||
.idProduct = (prod), \
|
.idProduct = (prod), \
|
||||||
.bInterfaceClass = USB_INTERFACE_CLASS_HID, \
|
.bInterfaceClass = USB_INTERFACE_CLASS_HID
|
||||||
.bInterfaceProtocol = USB_INTERFACE_PROTOCOL_MOUSE
|
|
||||||
|
|
||||||
static const struct usb_device_id usbtouch_devices[] = {
|
static const struct usb_device_id usbtouch_devices[] = {
|
||||||
#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
|
#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
|
||||||
|
@ -151,6 +151,9 @@ struct cache {
|
|||||||
atomic_t nr_migrations;
|
atomic_t nr_migrations;
|
||||||
wait_queue_head_t migration_wait;
|
wait_queue_head_t migration_wait;
|
||||||
|
|
||||||
|
wait_queue_head_t quiescing_wait;
|
||||||
|
atomic_t quiescing_ack;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cache_size entries, dirty if set
|
* cache_size entries, dirty if set
|
||||||
*/
|
*/
|
||||||
@ -742,8 +745,9 @@ static void cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell,
|
|||||||
|
|
||||||
static void cleanup_migration(struct dm_cache_migration *mg)
|
static void cleanup_migration(struct dm_cache_migration *mg)
|
||||||
{
|
{
|
||||||
dec_nr_migrations(mg->cache);
|
struct cache *cache = mg->cache;
|
||||||
free_migration(mg);
|
free_migration(mg);
|
||||||
|
dec_nr_migrations(cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void migration_failure(struct dm_cache_migration *mg)
|
static void migration_failure(struct dm_cache_migration *mg)
|
||||||
@ -1340,24 +1344,6 @@ static void writeback_some_dirty_blocks(struct cache *cache)
|
|||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
* Main worker loop
|
* Main worker loop
|
||||||
*--------------------------------------------------------------*/
|
*--------------------------------------------------------------*/
|
||||||
static void start_quiescing(struct cache *cache)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&cache->lock, flags);
|
|
||||||
cache->quiescing = 1;
|
|
||||||
spin_unlock_irqrestore(&cache->lock, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void stop_quiescing(struct cache *cache)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&cache->lock, flags);
|
|
||||||
cache->quiescing = 0;
|
|
||||||
spin_unlock_irqrestore(&cache->lock, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool is_quiescing(struct cache *cache)
|
static bool is_quiescing(struct cache *cache)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@ -1370,6 +1356,41 @@ static bool is_quiescing(struct cache *cache)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ack_quiescing(struct cache *cache)
|
||||||
|
{
|
||||||
|
if (is_quiescing(cache)) {
|
||||||
|
atomic_inc(&cache->quiescing_ack);
|
||||||
|
wake_up(&cache->quiescing_wait);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void wait_for_quiescing_ack(struct cache *cache)
|
||||||
|
{
|
||||||
|
wait_event(cache->quiescing_wait, atomic_read(&cache->quiescing_ack));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void start_quiescing(struct cache *cache)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&cache->lock, flags);
|
||||||
|
cache->quiescing = true;
|
||||||
|
spin_unlock_irqrestore(&cache->lock, flags);
|
||||||
|
|
||||||
|
wait_for_quiescing_ack(cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void stop_quiescing(struct cache *cache)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&cache->lock, flags);
|
||||||
|
cache->quiescing = false;
|
||||||
|
spin_unlock_irqrestore(&cache->lock, flags);
|
||||||
|
|
||||||
|
atomic_set(&cache->quiescing_ack, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void wait_for_migrations(struct cache *cache)
|
static void wait_for_migrations(struct cache *cache)
|
||||||
{
|
{
|
||||||
wait_event(cache->migration_wait, !atomic_read(&cache->nr_migrations));
|
wait_event(cache->migration_wait, !atomic_read(&cache->nr_migrations));
|
||||||
@ -1414,16 +1435,15 @@ static void do_worker(struct work_struct *ws)
|
|||||||
struct cache *cache = container_of(ws, struct cache, worker);
|
struct cache *cache = container_of(ws, struct cache, worker);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!is_quiescing(cache))
|
if (!is_quiescing(cache)) {
|
||||||
|
writeback_some_dirty_blocks(cache);
|
||||||
|
process_deferred_writethrough_bios(cache);
|
||||||
process_deferred_bios(cache);
|
process_deferred_bios(cache);
|
||||||
|
}
|
||||||
|
|
||||||
process_migrations(cache, &cache->quiesced_migrations, issue_copy);
|
process_migrations(cache, &cache->quiesced_migrations, issue_copy);
|
||||||
process_migrations(cache, &cache->completed_migrations, complete_migration);
|
process_migrations(cache, &cache->completed_migrations, complete_migration);
|
||||||
|
|
||||||
writeback_some_dirty_blocks(cache);
|
|
||||||
|
|
||||||
process_deferred_writethrough_bios(cache);
|
|
||||||
|
|
||||||
if (commit_if_needed(cache)) {
|
if (commit_if_needed(cache)) {
|
||||||
process_deferred_flush_bios(cache, false);
|
process_deferred_flush_bios(cache, false);
|
||||||
|
|
||||||
@ -1436,6 +1456,9 @@ static void do_worker(struct work_struct *ws)
|
|||||||
process_migrations(cache, &cache->need_commit_migrations,
|
process_migrations(cache, &cache->need_commit_migrations,
|
||||||
migration_success_post_commit);
|
migration_success_post_commit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ack_quiescing(cache);
|
||||||
|
|
||||||
} while (more_work(cache));
|
} while (more_work(cache));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1998,6 +2021,9 @@ static int cache_create(struct cache_args *ca, struct cache **result)
|
|||||||
atomic_set(&cache->nr_migrations, 0);
|
atomic_set(&cache->nr_migrations, 0);
|
||||||
init_waitqueue_head(&cache->migration_wait);
|
init_waitqueue_head(&cache->migration_wait);
|
||||||
|
|
||||||
|
init_waitqueue_head(&cache->quiescing_wait);
|
||||||
|
atomic_set(&cache->quiescing_ack, 0);
|
||||||
|
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
cache->nr_dirty = 0;
|
cache->nr_dirty = 0;
|
||||||
cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size));
|
cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size));
|
||||||
|
@ -86,6 +86,7 @@ struct multipath {
|
|||||||
unsigned queue_if_no_path:1; /* Queue I/O if last path fails? */
|
unsigned queue_if_no_path:1; /* Queue I/O if last path fails? */
|
||||||
unsigned saved_queue_if_no_path:1; /* Saved state during suspension */
|
unsigned saved_queue_if_no_path:1; /* Saved state during suspension */
|
||||||
unsigned retain_attached_hw_handler:1; /* If there's already a hw_handler present, don't change it. */
|
unsigned retain_attached_hw_handler:1; /* If there's already a hw_handler present, don't change it. */
|
||||||
|
unsigned pg_init_disabled:1; /* pg_init is not currently allowed */
|
||||||
|
|
||||||
unsigned pg_init_retries; /* Number of times to retry pg_init */
|
unsigned pg_init_retries; /* Number of times to retry pg_init */
|
||||||
unsigned pg_init_count; /* Number of times pg_init called */
|
unsigned pg_init_count; /* Number of times pg_init called */
|
||||||
@ -497,7 +498,8 @@ static void process_queued_ios(struct work_struct *work)
|
|||||||
(!pgpath && !m->queue_if_no_path))
|
(!pgpath && !m->queue_if_no_path))
|
||||||
must_queue = 0;
|
must_queue = 0;
|
||||||
|
|
||||||
if (m->pg_init_required && !m->pg_init_in_progress && pgpath)
|
if (m->pg_init_required && !m->pg_init_in_progress && pgpath &&
|
||||||
|
!m->pg_init_disabled)
|
||||||
__pg_init_all_paths(m);
|
__pg_init_all_paths(m);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&m->lock, flags);
|
spin_unlock_irqrestore(&m->lock, flags);
|
||||||
@ -942,10 +944,20 @@ static void multipath_wait_for_pg_init_completion(struct multipath *m)
|
|||||||
|
|
||||||
static void flush_multipath_work(struct multipath *m)
|
static void flush_multipath_work(struct multipath *m)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&m->lock, flags);
|
||||||
|
m->pg_init_disabled = 1;
|
||||||
|
spin_unlock_irqrestore(&m->lock, flags);
|
||||||
|
|
||||||
flush_workqueue(kmpath_handlerd);
|
flush_workqueue(kmpath_handlerd);
|
||||||
multipath_wait_for_pg_init_completion(m);
|
multipath_wait_for_pg_init_completion(m);
|
||||||
flush_workqueue(kmultipathd);
|
flush_workqueue(kmultipathd);
|
||||||
flush_work(&m->trigger_event);
|
flush_work(&m->trigger_event);
|
||||||
|
|
||||||
|
spin_lock_irqsave(&m->lock, flags);
|
||||||
|
m->pg_init_disabled = 0;
|
||||||
|
spin_unlock_irqrestore(&m->lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void multipath_dtr(struct dm_target *ti)
|
static void multipath_dtr(struct dm_target *ti)
|
||||||
@ -1164,7 +1176,7 @@ static int pg_init_limit_reached(struct multipath *m, struct pgpath *pgpath)
|
|||||||
|
|
||||||
spin_lock_irqsave(&m->lock, flags);
|
spin_lock_irqsave(&m->lock, flags);
|
||||||
|
|
||||||
if (m->pg_init_count <= m->pg_init_retries)
|
if (m->pg_init_count <= m->pg_init_retries && !m->pg_init_disabled)
|
||||||
m->pg_init_required = 1;
|
m->pg_init_required = 1;
|
||||||
else
|
else
|
||||||
limit_reached = 1;
|
limit_reached = 1;
|
||||||
@ -1699,7 +1711,7 @@ out:
|
|||||||
*---------------------------------------------------------------*/
|
*---------------------------------------------------------------*/
|
||||||
static struct target_type multipath_target = {
|
static struct target_type multipath_target = {
|
||||||
.name = "multipath",
|
.name = "multipath",
|
||||||
.version = {1, 5, 1},
|
.version = {1, 6, 0},
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.ctr = multipath_ctr,
|
.ctr = multipath_ctr,
|
||||||
.dtr = multipath_dtr,
|
.dtr = multipath_dtr,
|
||||||
|
@ -583,14 +583,28 @@ static int adjoin(struct dm_table *table, struct dm_target *ti)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Used to dynamically allocate the arg array.
|
* Used to dynamically allocate the arg array.
|
||||||
|
*
|
||||||
|
* We do first allocation with GFP_NOIO because dm-mpath and dm-thin must
|
||||||
|
* process messages even if some device is suspended. These messages have a
|
||||||
|
* small fixed number of arguments.
|
||||||
|
*
|
||||||
|
* On the other hand, dm-switch needs to process bulk data using messages and
|
||||||
|
* excessive use of GFP_NOIO could cause trouble.
|
||||||
*/
|
*/
|
||||||
static char **realloc_argv(unsigned *array_size, char **old_argv)
|
static char **realloc_argv(unsigned *array_size, char **old_argv)
|
||||||
{
|
{
|
||||||
char **argv;
|
char **argv;
|
||||||
unsigned new_size;
|
unsigned new_size;
|
||||||
|
gfp_t gfp;
|
||||||
|
|
||||||
new_size = *array_size ? *array_size * 2 : 64;
|
if (*array_size) {
|
||||||
argv = kmalloc(new_size * sizeof(*argv), GFP_KERNEL);
|
new_size = *array_size * 2;
|
||||||
|
gfp = GFP_KERNEL;
|
||||||
|
} else {
|
||||||
|
new_size = 8;
|
||||||
|
gfp = GFP_NOIO;
|
||||||
|
}
|
||||||
|
argv = kmalloc(new_size * sizeof(*argv), gfp);
|
||||||
if (argv) {
|
if (argv) {
|
||||||
memcpy(argv, old_argv, *array_size * sizeof(*argv));
|
memcpy(argv, old_argv, *array_size * sizeof(*argv));
|
||||||
*array_size = new_size;
|
*array_size = new_size;
|
||||||
|
@ -3619,6 +3619,7 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
|
|||||||
mddev->in_sync = 1;
|
mddev->in_sync = 1;
|
||||||
del_timer_sync(&mddev->safemode_timer);
|
del_timer_sync(&mddev->safemode_timer);
|
||||||
}
|
}
|
||||||
|
blk_set_stacking_limits(&mddev->queue->limits);
|
||||||
pers->run(mddev);
|
pers->run(mddev);
|
||||||
set_bit(MD_CHANGE_DEVS, &mddev->flags);
|
set_bit(MD_CHANGE_DEVS, &mddev->flags);
|
||||||
mddev_resume(mddev);
|
mddev_resume(mddev);
|
||||||
|
@ -509,15 +509,18 @@ static int grow_add_tail_block(struct resize *resize)
|
|||||||
static int grow_needs_more_blocks(struct resize *resize)
|
static int grow_needs_more_blocks(struct resize *resize)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
unsigned old_nr_blocks = resize->old_nr_full_blocks;
|
||||||
|
|
||||||
if (resize->old_nr_entries_in_last_block > 0) {
|
if (resize->old_nr_entries_in_last_block > 0) {
|
||||||
|
old_nr_blocks++;
|
||||||
|
|
||||||
r = grow_extend_tail_block(resize, resize->max_entries);
|
r = grow_extend_tail_block(resize, resize->max_entries);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = insert_full_ablocks(resize->info, resize->size_of_block,
|
r = insert_full_ablocks(resize->info, resize->size_of_block,
|
||||||
resize->old_nr_full_blocks,
|
old_nr_blocks,
|
||||||
resize->new_nr_full_blocks,
|
resize->new_nr_full_blocks,
|
||||||
resize->max_entries, resize->value,
|
resize->max_entries, resize->value,
|
||||||
&resize->root);
|
&resize->root);
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
#include "af9013_priv.h"
|
#include "af9013_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
struct af9013_state {
|
struct af9013_state {
|
||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
struct dvb_frontend fe;
|
struct dvb_frontend fe;
|
||||||
@ -50,16 +53,23 @@ static int af9013_wr_regs_i2c(struct af9013_state *priv, u8 mbox, u16 reg,
|
|||||||
const u8 *val, int len)
|
const u8 *val, int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[3+len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[1] = {
|
struct i2c_msg msg[1] = {
|
||||||
{
|
{
|
||||||
.addr = priv->config.i2c_addr,
|
.addr = priv->config.i2c_addr,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.len = sizeof(buf),
|
.len = 3 + len,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (3 + len > sizeof(buf)) {
|
||||||
|
dev_warn(&priv->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = (reg >> 8) & 0xff;
|
buf[0] = (reg >> 8) & 0xff;
|
||||||
buf[1] = (reg >> 0) & 0xff;
|
buf[1] = (reg >> 0) & 0xff;
|
||||||
buf[2] = mbox;
|
buf[2] = mbox;
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
#include "af9033_priv.h"
|
#include "af9033_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
struct af9033_state {
|
struct af9033_state {
|
||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
struct dvb_frontend fe;
|
struct dvb_frontend fe;
|
||||||
@ -40,16 +43,23 @@ static int af9033_wr_regs(struct af9033_state *state, u32 reg, const u8 *val,
|
|||||||
int len)
|
int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[3 + len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[1] = {
|
struct i2c_msg msg[1] = {
|
||||||
{
|
{
|
||||||
.addr = state->cfg.i2c_addr,
|
.addr = state->cfg.i2c_addr,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.len = sizeof(buf),
|
.len = 3 + len,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (3 + len > sizeof(buf)) {
|
||||||
|
dev_warn(&state->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = (reg >> 16) & 0xff;
|
buf[0] = (reg >> 16) & 0xff;
|
||||||
buf[1] = (reg >> 8) & 0xff;
|
buf[1] = (reg >> 8) & 0xff;
|
||||||
buf[2] = (reg >> 0) & 0xff;
|
buf[2] = (reg >> 0) & 0xff;
|
||||||
@ -161,7 +171,14 @@ static int af9033_wr_reg_val_tab(struct af9033_state *state,
|
|||||||
const struct reg_val *tab, int tab_len)
|
const struct reg_val *tab, int tab_len)
|
||||||
{
|
{
|
||||||
int ret, i, j;
|
int ret, i, j;
|
||||||
u8 buf[tab_len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
|
|
||||||
|
if (tab_len > sizeof(buf)) {
|
||||||
|
dev_warn(&state->i2c->dev,
|
||||||
|
"%s: i2c wr len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, tab_len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);
|
dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);
|
||||||
|
|
||||||
|
@ -44,6 +44,9 @@
|
|||||||
#include "bcm3510.h"
|
#include "bcm3510.h"
|
||||||
#include "bcm3510_priv.h"
|
#include "bcm3510_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by bcm3510_do_hab_cmd() function */
|
||||||
|
#define MAX_XFER_SIZE 128
|
||||||
|
|
||||||
struct bcm3510_state {
|
struct bcm3510_state {
|
||||||
|
|
||||||
struct i2c_adapter* i2c;
|
struct i2c_adapter* i2c;
|
||||||
@ -201,9 +204,19 @@ static int bcm3510_hab_send_request(struct bcm3510_state *st, u8 *buf, int len)
|
|||||||
|
|
||||||
static int bcm3510_do_hab_cmd(struct bcm3510_state *st, u8 cmd, u8 msgid, u8 *obuf, u8 olen, u8 *ibuf, u8 ilen)
|
static int bcm3510_do_hab_cmd(struct bcm3510_state *st, u8 cmd, u8 msgid, u8 *obuf, u8 olen, u8 *ibuf, u8 ilen)
|
||||||
{
|
{
|
||||||
u8 ob[olen+2],ib[ilen+2];
|
u8 ob[MAX_XFER_SIZE], ib[MAX_XFER_SIZE];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (ilen + 2 > sizeof(ib)) {
|
||||||
|
deb_hab("do_hab_cmd: ilen=%d is too big!\n", ilen);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (olen + 2 > sizeof(ob)) {
|
||||||
|
deb_hab("do_hab_cmd: olen=%d is too big!\n", olen);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ob[0] = cmd;
|
ob[0] = cmd;
|
||||||
ob[1] = msgid;
|
ob[1] = msgid;
|
||||||
memcpy(&ob[2],obuf,olen);
|
memcpy(&ob[2],obuf,olen);
|
||||||
|
@ -21,12 +21,15 @@
|
|||||||
|
|
||||||
#include "cxd2820r_priv.h"
|
#include "cxd2820r_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
/* write multiple registers */
|
/* write multiple registers */
|
||||||
static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
|
static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
|
||||||
u8 *val, int len)
|
u8 *val, int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[len+1];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[1] = {
|
struct i2c_msg msg[1] = {
|
||||||
{
|
{
|
||||||
.addr = i2c,
|
.addr = i2c,
|
||||||
@ -36,6 +39,13 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (1 + len > sizeof(buf)) {
|
||||||
|
dev_warn(&priv->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
memcpy(&buf[1], val, len);
|
memcpy(&buf[1], val, len);
|
||||||
|
|
||||||
@ -55,7 +65,7 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
|
|||||||
u8 *val, int len)
|
u8 *val, int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[2] = {
|
struct i2c_msg msg[2] = {
|
||||||
{
|
{
|
||||||
.addr = i2c,
|
.addr = i2c,
|
||||||
@ -70,6 +80,13 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (len > sizeof(buf)) {
|
||||||
|
dev_warn(&priv->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = i2c_transfer(priv->i2c, msg, 2);
|
ret = i2c_transfer(priv->i2c, msg, 2);
|
||||||
if (ret == 2) {
|
if (ret == 2) {
|
||||||
memcpy(val, buf, len);
|
memcpy(val, buf, len);
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
#include "itd1000.h"
|
#include "itd1000.h"
|
||||||
#include "itd1000_priv.h"
|
#include "itd1000_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
static int debug;
|
static int debug;
|
||||||
module_param(debug, int, 0644);
|
module_param(debug, int, 0644);
|
||||||
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
|
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
|
||||||
@ -52,10 +55,18 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
|
|||||||
/* don't write more than one byte with flexcop behind */
|
/* don't write more than one byte with flexcop behind */
|
||||||
static int itd1000_write_regs(struct itd1000_state *state, u8 reg, u8 v[], u8 len)
|
static int itd1000_write_regs(struct itd1000_state *state, u8 reg, u8 v[], u8 len)
|
||||||
{
|
{
|
||||||
u8 buf[1+len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg = {
|
struct i2c_msg msg = {
|
||||||
.addr = state->cfg->i2c_address, .flags = 0, .buf = buf, .len = len+1
|
.addr = state->cfg->i2c_address, .flags = 0, .buf = buf, .len = len+1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (1 + len > sizeof(buf)) {
|
||||||
|
printk(KERN_WARNING
|
||||||
|
"itd1000: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
memcpy(&buf[1], v, len);
|
memcpy(&buf[1], v, len);
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
#include "mt312_priv.h"
|
#include "mt312_priv.h"
|
||||||
#include "mt312.h"
|
#include "mt312.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
struct mt312_state {
|
struct mt312_state {
|
||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
@ -96,9 +98,15 @@ static int mt312_write(struct mt312_state *state, const enum mt312_reg_addr reg,
|
|||||||
const u8 *src, const size_t count)
|
const u8 *src, const size_t count)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[count + 1];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg;
|
struct i2c_msg msg;
|
||||||
|
|
||||||
|
if (1 + count > sizeof(buf)) {
|
||||||
|
printk(KERN_WARNING
|
||||||
|
"mt312: write: len=%zd is too big!\n", count);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
int i;
|
int i;
|
||||||
dprintk("W(%d):", reg & 0x7f);
|
dprintk("W(%d):", reg & 0x7f);
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
*/
|
*/
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"
|
#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"
|
||||||
#define NXT2004_DEFAULT_FIRMWARE "dvb-fe-nxt2004.fw"
|
#define NXT2004_DEFAULT_FIRMWARE "dvb-fe-nxt2004.fw"
|
||||||
#define CRC_CCIT_MASK 0x1021
|
#define CRC_CCIT_MASK 0x1021
|
||||||
@ -95,10 +98,16 @@ static int i2c_readbytes(struct nxt200x_state *state, u8 addr, u8 *buf, u8 len)
|
|||||||
static int nxt200x_writebytes (struct nxt200x_state* state, u8 reg,
|
static int nxt200x_writebytes (struct nxt200x_state* state, u8 reg,
|
||||||
const u8 *buf, u8 len)
|
const u8 *buf, u8 len)
|
||||||
{
|
{
|
||||||
u8 buf2 [len+1];
|
u8 buf2[MAX_XFER_SIZE];
|
||||||
int err;
|
int err;
|
||||||
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 };
|
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 };
|
||||||
|
|
||||||
|
if (1 + len > sizeof(buf2)) {
|
||||||
|
pr_warn("%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
__func__, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf2[0] = reg;
|
buf2[0] = reg;
|
||||||
memcpy(&buf2[1], buf, len);
|
memcpy(&buf2[1], buf, len);
|
||||||
|
|
||||||
|
@ -27,20 +27,30 @@
|
|||||||
|
|
||||||
#include "rtl2830_priv.h"
|
#include "rtl2830_priv.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
/* write multiple hardware registers */
|
/* write multiple hardware registers */
|
||||||
static int rtl2830_wr(struct rtl2830_priv *priv, u8 reg, const u8 *val, int len)
|
static int rtl2830_wr(struct rtl2830_priv *priv, u8 reg, const u8 *val, int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[1+len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[1] = {
|
struct i2c_msg msg[1] = {
|
||||||
{
|
{
|
||||||
.addr = priv->cfg.i2c_addr,
|
.addr = priv->cfg.i2c_addr,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.len = 1+len,
|
.len = 1 + len,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (1 + len > sizeof(buf)) {
|
||||||
|
dev_warn(&priv->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
memcpy(&buf[1], val, len);
|
memcpy(&buf[1], val, len);
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#include "dvb_math.h"
|
#include "dvb_math.h"
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
int rtl2832_debug;
|
int rtl2832_debug;
|
||||||
module_param_named(debug, rtl2832_debug, int, 0644);
|
module_param_named(debug, rtl2832_debug, int, 0644);
|
||||||
MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
|
MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
|
||||||
@ -162,16 +165,23 @@ static const struct rtl2832_reg_entry registers[] = {
|
|||||||
static int rtl2832_wr(struct rtl2832_priv *priv, u8 reg, u8 *val, int len)
|
static int rtl2832_wr(struct rtl2832_priv *priv, u8 reg, u8 *val, int len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[1+len];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg msg[1] = {
|
struct i2c_msg msg[1] = {
|
||||||
{
|
{
|
||||||
.addr = priv->cfg.i2c_addr,
|
.addr = priv->cfg.i2c_addr,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.len = 1+len,
|
.len = 1 + len,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (1 + len > sizeof(buf)) {
|
||||||
|
dev_warn(&priv->i2c->dev,
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
memcpy(&buf[1], val, len);
|
memcpy(&buf[1], val, len);
|
||||||
|
|
||||||
|
@ -836,9 +836,16 @@ static u32 s5h1420_tuner_i2c_func(struct i2c_adapter *adapter)
|
|||||||
static int s5h1420_tuner_i2c_tuner_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num)
|
static int s5h1420_tuner_i2c_tuner_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num)
|
||||||
{
|
{
|
||||||
struct s5h1420_state *state = i2c_get_adapdata(i2c_adap);
|
struct s5h1420_state *state = i2c_get_adapdata(i2c_adap);
|
||||||
struct i2c_msg m[1 + num];
|
struct i2c_msg m[3];
|
||||||
u8 tx_open[2] = { CON_1, state->CON_1_val | 1 }; /* repeater stops once there was a stop condition */
|
u8 tx_open[2] = { CON_1, state->CON_1_val | 1 }; /* repeater stops once there was a stop condition */
|
||||||
|
|
||||||
|
if (1 + num > ARRAY_SIZE(m)) {
|
||||||
|
printk(KERN_WARNING
|
||||||
|
"%s: i2c xfer: num=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, num);
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
memset(m, 0, sizeof(struct i2c_msg) * (1 + num));
|
memset(m, 0, sizeof(struct i2c_msg) * (1 + num));
|
||||||
|
|
||||||
m[0].addr = state->config->demod_address;
|
m[0].addr = state->config->demod_address;
|
||||||
@ -847,7 +854,7 @@ static int s5h1420_tuner_i2c_tuner_xfer(struct i2c_adapter *i2c_adap, struct i2c
|
|||||||
|
|
||||||
memcpy(&m[1], msg, sizeof(struct i2c_msg) * num);
|
memcpy(&m[1], msg, sizeof(struct i2c_msg) * num);
|
||||||
|
|
||||||
return i2c_transfer(state->i2c, m, 1+num) == 1 + num ? num : -EIO;
|
return i2c_transfer(state->i2c, m, 1 + num) == 1 + num ? num : -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct i2c_algorithm s5h1420_tuner_i2c_algo = {
|
static struct i2c_algorithm s5h1420_tuner_i2c_algo = {
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
#include "stb0899_priv.h"
|
#include "stb0899_priv.h"
|
||||||
#include "stb0899_reg.h"
|
#include "stb0899_reg.h"
|
||||||
|
|
||||||
|
/* Max transfer size done by I2C transfer functions */
|
||||||
|
#define MAX_XFER_SIZE 64
|
||||||
|
|
||||||
static unsigned int verbose = 0;//1;
|
static unsigned int verbose = 0;//1;
|
||||||
module_param(verbose, int, 0644);
|
module_param(verbose, int, 0644);
|
||||||
|
|
||||||
@ -499,7 +502,7 @@ err:
|
|||||||
int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data, u32 count)
|
int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data, u32 count)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 buf[2 + count];
|
u8 buf[MAX_XFER_SIZE];
|
||||||
struct i2c_msg i2c_msg = {
|
struct i2c_msg i2c_msg = {
|
||||||
.addr = state->config->demod_address,
|
.addr = state->config->demod_address,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
@ -507,6 +510,13 @@ int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data,
|
|||||||
.len = 2 + count
|
.len = 2 + count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (2 + count > sizeof(buf)) {
|
||||||
|
printk(KERN_WARNING
|
||||||
|
"%s: i2c wr reg=%04x: len=%d is too big!\n",
|
||||||
|
KBUILD_MODNAME, reg, count);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = reg >> 8;
|
buf[0] = reg >> 8;
|
||||||
buf[1] = reg & 0xff;
|
buf[1] = reg & 0xff;
|
||||||
memcpy(&buf[2], data, count);
|
memcpy(&buf[2], data, count);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user