mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
Linux 6.1-rc3
-----BEGIN PGP SIGNATURE----- iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmNe+HAeHHRvcnZhbGRz QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGrFwH/jYeSZl8ACW2GR7r 8zsyHK/qy7tOmwV99QZjS94b1KK1hfi2L93Ro8LXohqI3HDvk6eBXWApz3jSicFW OeTCq1vu2Bw1iimhUThVqVCWF8EaVwdYYobvNqIznA2QCkOO+oTG+3oIiWJaEOVE xKJypq95b16D0KAGXrgZznjdBi2DlOUzdsjNT3E8xSXeEjvX7y7optHhuMlCgir4 19kEgelGAOp28rd5l0qZ2pt0ltMN+COx4EF8LCNvsD2kvXPbyDN/V2Ql04mYBMde hriWyP5W0WDOCvjrcxV4CgyosZ2UgkfAdZ1JTJQi3RkfJ1B52BpyfRiBkfQeqcC+ RoHbW7w= =RWs8 -----END PGP SIGNATURE----- Merge tag 'v6.1-rc3' into android-mainline Linux 6.1-rc3 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I48ed66064fea18f95d60d16af0b553597dc9731c
This commit is contained in:
commit
68ff963c1e
23
MAINTAINERS
23
MAINTAINERS
|
|
@ -4101,6 +4101,7 @@ N: bcm7038
|
|||
N: bcm7120
|
||||
|
||||
BROADCOM BDC DRIVER
|
||||
M: Justin Chen <justinpopo6@gmail.com>
|
||||
M: Al Cooper <alcooperx@gmail.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
|
||||
|
|
@ -4207,6 +4208,7 @@ F: Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml
|
|||
F: drivers/tty/serial/8250/8250_bcm7271.c
|
||||
|
||||
BROADCOM BRCMSTB USB EHCI DRIVER
|
||||
M: Justin Chen <justinpopo6@gmail.com>
|
||||
M: Al Cooper <alcooperx@gmail.com>
|
||||
R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
|
|
@ -4223,6 +4225,7 @@ F: Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml
|
|||
F: drivers/usb/misc/brcmstb-usb-pinmap.c
|
||||
|
||||
BROADCOM BRCMSTB USB2 and USB3 PHY DRIVER
|
||||
M: Justin Chen <justinpopo6@gmail.com>
|
||||
M: Al Cooper <alcooperx@gmail.com>
|
||||
R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
|
|
@ -17819,7 +17822,7 @@ S: Odd Fixes
|
|||
F: drivers/tty/serial/rp2.*
|
||||
|
||||
ROHM BD99954 CHARGER IC
|
||||
R: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
M: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
S: Supported
|
||||
F: drivers/power/supply/bd99954-charger.c
|
||||
F: drivers/power/supply/bd99954-charger.h
|
||||
|
|
@ -17842,7 +17845,7 @@ F: drivers/regulator/bd9571mwv-regulator.c
|
|||
F: include/linux/mfd/bd9571mwv.h
|
||||
|
||||
ROHM POWER MANAGEMENT IC DEVICE DRIVERS
|
||||
R: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
M: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
S: Supported
|
||||
F: drivers/clk/clk-bd718x7.c
|
||||
F: drivers/gpio/gpio-bd71815.c
|
||||
|
|
@ -21186,15 +21189,6 @@ S: Maintained
|
|||
F: Documentation/usb/ehci.rst
|
||||
F: drivers/usb/host/ehci*
|
||||
|
||||
USB GADGET/PERIPHERAL SUBSYSTEM
|
||||
M: Felipe Balbi <balbi@kernel.org>
|
||||
L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://www.linux-usb.org/gadget
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
|
||||
F: drivers/usb/gadget/
|
||||
F: include/linux/usb/gadget*
|
||||
|
||||
USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
|
||||
M: Jiri Kosina <jikos@kernel.org>
|
||||
M: Benjamin Tissoires <benjamin.tissoires@redhat.com>
|
||||
|
|
@ -21301,13 +21295,6 @@ W: https://github.com/petkan/pegasus
|
|||
T: git https://github.com/petkan/pegasus.git
|
||||
F: drivers/net/usb/pegasus.*
|
||||
|
||||
USB PHY LAYER
|
||||
M: Felipe Balbi <balbi@kernel.org>
|
||||
L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
|
||||
F: drivers/usb/phy/
|
||||
|
||||
USB PRINTER DRIVER (usblp)
|
||||
M: Pete Zaitcev <zaitcev@redhat.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -2,7 +2,7 @@
|
|||
VERSION = 6
|
||||
PATCHLEVEL = 1
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc3
|
||||
NAME = Hurr durr I'ma ninja sloth
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ static inline void flush_thread(void)
|
|||
unsigned long __get_wchan(struct task_struct *p);
|
||||
|
||||
#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \
|
||||
THREAD_SIZE - 32 - sizeof(struct pt_regs))
|
||||
THREAD_SIZE - sizeof(struct pt_regs))
|
||||
#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk))
|
||||
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->csr_era)
|
||||
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[3])
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ struct pt_regs {
|
|||
unsigned long csr_euen;
|
||||
unsigned long csr_ecfg;
|
||||
unsigned long csr_estat;
|
||||
unsigned long __last[0];
|
||||
unsigned long __last[];
|
||||
} __aligned(8);
|
||||
|
||||
static inline int regs_irqs_disabled(struct pt_regs *regs)
|
||||
|
|
@ -133,7 +133,7 @@ static inline void die_if_kernel(const char *str, struct pt_regs *regs)
|
|||
#define current_pt_regs() \
|
||||
({ \
|
||||
unsigned long sp = (unsigned long)__builtin_frame_address(0); \
|
||||
(struct pt_regs *)((sp | (THREAD_SIZE - 1)) + 1 - 32) - 1; \
|
||||
(struct pt_regs *)((sp | (THREAD_SIZE - 1)) + 1) - 1; \
|
||||
})
|
||||
|
||||
/* Helpers for working with the user stack pointer */
|
||||
|
|
|
|||
|
|
@ -84,10 +84,9 @@ SYM_CODE_START(kernel_entry) # kernel entry point
|
|||
|
||||
la.pcrel tp, init_thread_union
|
||||
/* Set the SP after an empty pt_regs. */
|
||||
PTR_LI sp, (_THREAD_SIZE - 32 - PT_SIZE)
|
||||
PTR_LI sp, (_THREAD_SIZE - PT_SIZE)
|
||||
PTR_ADD sp, sp, tp
|
||||
set_saved_sp sp, t0, t1
|
||||
PTR_ADDI sp, sp, -4 * SZREG # init stack pointer
|
||||
|
||||
bl start_kernel
|
||||
ASM_BUG()
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
|
|||
unsigned long clone_flags = args->flags;
|
||||
struct pt_regs *childregs, *regs = current_pt_regs();
|
||||
|
||||
childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;
|
||||
childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
|
||||
|
||||
/* set up new TSS. */
|
||||
childregs = (struct pt_regs *) childksp - 1;
|
||||
|
|
@ -236,7 +236,7 @@ bool in_task_stack(unsigned long stack, struct task_struct *task,
|
|||
struct stack_info *info)
|
||||
{
|
||||
unsigned long begin = (unsigned long)task_stack_page(task);
|
||||
unsigned long end = begin + THREAD_SIZE - 32;
|
||||
unsigned long end = begin + THREAD_SIZE;
|
||||
|
||||
if (stack < begin || stack >= end)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ SYM_FUNC_START(__switch_to)
|
|||
move tp, a2
|
||||
cpu_restore_nonscratch a1
|
||||
|
||||
li.w t0, _THREAD_SIZE - 32
|
||||
li.w t0, _THREAD_SIZE
|
||||
PTR_ADD t0, t0, tp
|
||||
set_saved_sp t0, t1, t2
|
||||
|
||||
|
|
|
|||
|
|
@ -279,6 +279,7 @@ static void emit_atomic(const struct bpf_insn *insn, struct jit_ctx *ctx)
|
|||
const u8 t1 = LOONGARCH_GPR_T1;
|
||||
const u8 t2 = LOONGARCH_GPR_T2;
|
||||
const u8 t3 = LOONGARCH_GPR_T3;
|
||||
const u8 r0 = regmap[BPF_REG_0];
|
||||
const u8 src = regmap[insn->src_reg];
|
||||
const u8 dst = regmap[insn->dst_reg];
|
||||
const s16 off = insn->off;
|
||||
|
|
@ -359,8 +360,6 @@ static void emit_atomic(const struct bpf_insn *insn, struct jit_ctx *ctx)
|
|||
break;
|
||||
/* r0 = atomic_cmpxchg(dst + off, r0, src); */
|
||||
case BPF_CMPXCHG:
|
||||
u8 r0 = regmap[BPF_REG_0];
|
||||
|
||||
move_reg(ctx, t2, r0);
|
||||
if (isdw) {
|
||||
emit_insn(ctx, lld, r0, t1, 0);
|
||||
|
|
@ -390,8 +389,11 @@ static bool is_signed_bpf_cond(u8 cond)
|
|||
|
||||
static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool extra_pass)
|
||||
{
|
||||
const bool is32 = BPF_CLASS(insn->code) == BPF_ALU ||
|
||||
BPF_CLASS(insn->code) == BPF_JMP32;
|
||||
u8 tm = -1;
|
||||
u64 func_addr;
|
||||
bool func_addr_fixed;
|
||||
int i = insn - ctx->prog->insnsi;
|
||||
int ret, jmp_offset;
|
||||
const u8 code = insn->code;
|
||||
const u8 cond = BPF_OP(code);
|
||||
const u8 t1 = LOONGARCH_GPR_T1;
|
||||
|
|
@ -400,8 +402,8 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
const u8 dst = regmap[insn->dst_reg];
|
||||
const s16 off = insn->off;
|
||||
const s32 imm = insn->imm;
|
||||
int jmp_offset;
|
||||
int i = insn - ctx->prog->insnsi;
|
||||
const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;
|
||||
const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32;
|
||||
|
||||
switch (code) {
|
||||
/* dst = src */
|
||||
|
|
@ -724,24 +726,23 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
case BPF_JMP32 | BPF_JSGE | BPF_K:
|
||||
case BPF_JMP32 | BPF_JSLT | BPF_K:
|
||||
case BPF_JMP32 | BPF_JSLE | BPF_K:
|
||||
u8 t7 = -1;
|
||||
jmp_offset = bpf2la_offset(i, off, ctx);
|
||||
if (imm) {
|
||||
move_imm(ctx, t1, imm, false);
|
||||
t7 = t1;
|
||||
tm = t1;
|
||||
} else {
|
||||
/* If imm is 0, simply use zero register. */
|
||||
t7 = LOONGARCH_GPR_ZERO;
|
||||
tm = LOONGARCH_GPR_ZERO;
|
||||
}
|
||||
move_reg(ctx, t2, dst);
|
||||
if (is_signed_bpf_cond(BPF_OP(code))) {
|
||||
emit_sext_32(ctx, t7, is32);
|
||||
emit_sext_32(ctx, tm, is32);
|
||||
emit_sext_32(ctx, t2, is32);
|
||||
} else {
|
||||
emit_zext_32(ctx, t7, is32);
|
||||
emit_zext_32(ctx, tm, is32);
|
||||
emit_zext_32(ctx, t2, is32);
|
||||
}
|
||||
if (emit_cond_jmp(ctx, cond, t2, t7, jmp_offset) < 0)
|
||||
if (emit_cond_jmp(ctx, cond, t2, tm, jmp_offset) < 0)
|
||||
goto toofar;
|
||||
break;
|
||||
|
||||
|
|
@ -775,10 +776,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
|
||||
/* function call */
|
||||
case BPF_JMP | BPF_CALL:
|
||||
int ret;
|
||||
u64 func_addr;
|
||||
bool func_addr_fixed;
|
||||
|
||||
mark_call(ctx);
|
||||
ret = bpf_jit_get_func_addr(ctx->prog, insn, extra_pass,
|
||||
&func_addr, &func_addr_fixed);
|
||||
|
|
@ -811,8 +808,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
|
||||
/* dst = imm64 */
|
||||
case BPF_LD | BPF_IMM | BPF_DW:
|
||||
u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;
|
||||
|
||||
move_imm(ctx, dst, imm64, is32);
|
||||
return 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ static void perf_ibs_get_mem_lvl(union ibs_op_data2 *op_data2,
|
|||
/* Extension Memory */
|
||||
if (ibs_caps & IBS_CAPS_ZEN4 &&
|
||||
ibs_data_src == IBS_DATA_SRC_EXT_EXT_MEM) {
|
||||
data_src->mem_lvl_num = PERF_MEM_LVLNUM_EXTN_MEM;
|
||||
data_src->mem_lvl_num = PERF_MEM_LVLNUM_CXL;
|
||||
if (op_data2->rmt_node) {
|
||||
data_src->mem_remote = PERF_MEM_REMOTE_REMOTE;
|
||||
/* IBS doesn't provide Remote socket detail */
|
||||
|
|
|
|||
|
|
@ -806,7 +806,11 @@ static const struct x86_cpu_id rapl_model_match[] __initconst = {
|
|||
X86_MATCH_INTEL_FAM6_MODEL(COMETLAKE, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_N, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &model_spr),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &model_skl),
|
||||
X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &model_skl),
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(x86cpu, rapl_model_match);
|
||||
|
|
|
|||
|
|
@ -232,34 +232,45 @@ static const enum counter_function quad8_count_functions_list[] = {
|
|||
COUNTER_FUNCTION_QUADRATURE_X4,
|
||||
};
|
||||
|
||||
static int quad8_function_get(const struct quad8 *const priv, const size_t id,
|
||||
enum counter_function *const function)
|
||||
{
|
||||
if (!priv->quadrature_mode[id]) {
|
||||
*function = COUNTER_FUNCTION_PULSE_DIRECTION;
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (priv->quadrature_scale[id]) {
|
||||
case 0:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X1_A;
|
||||
return 0;
|
||||
case 1:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X2_A;
|
||||
return 0;
|
||||
case 2:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X4;
|
||||
return 0;
|
||||
default:
|
||||
/* should never reach this path */
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int quad8_function_read(struct counter_device *counter,
|
||||
struct counter_count *count,
|
||||
enum counter_function *function)
|
||||
{
|
||||
struct quad8 *const priv = counter_priv(counter);
|
||||
const int id = count->id;
|
||||
unsigned long irqflags;
|
||||
int retval;
|
||||
|
||||
spin_lock_irqsave(&priv->lock, irqflags);
|
||||
|
||||
if (priv->quadrature_mode[id])
|
||||
switch (priv->quadrature_scale[id]) {
|
||||
case 0:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X1_A;
|
||||
break;
|
||||
case 1:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X2_A;
|
||||
break;
|
||||
case 2:
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X4;
|
||||
break;
|
||||
}
|
||||
else
|
||||
*function = COUNTER_FUNCTION_PULSE_DIRECTION;
|
||||
retval = quad8_function_get(priv, count->id, function);
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, irqflags);
|
||||
|
||||
return 0;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int quad8_function_write(struct counter_device *counter,
|
||||
|
|
@ -359,6 +370,7 @@ static int quad8_action_read(struct counter_device *counter,
|
|||
enum counter_synapse_action *action)
|
||||
{
|
||||
struct quad8 *const priv = counter_priv(counter);
|
||||
unsigned long irqflags;
|
||||
int err;
|
||||
enum counter_function function;
|
||||
const size_t signal_a_id = count->synapses[0].signal->id;
|
||||
|
|
@ -374,9 +386,21 @@ static int quad8_action_read(struct counter_device *counter,
|
|||
return 0;
|
||||
}
|
||||
|
||||
err = quad8_function_read(counter, count, &function);
|
||||
if (err)
|
||||
spin_lock_irqsave(&priv->lock, irqflags);
|
||||
|
||||
/* Get Count function and direction atomically */
|
||||
err = quad8_function_get(priv, count->id, &function);
|
||||
if (err) {
|
||||
spin_unlock_irqrestore(&priv->lock, irqflags);
|
||||
return err;
|
||||
}
|
||||
err = quad8_direction_read(counter, count, &direction);
|
||||
if (err) {
|
||||
spin_unlock_irqrestore(&priv->lock, irqflags);
|
||||
return err;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, irqflags);
|
||||
|
||||
/* Default action mode */
|
||||
*action = COUNTER_SYNAPSE_ACTION_NONE;
|
||||
|
|
@ -389,10 +413,6 @@ static int quad8_action_read(struct counter_device *counter,
|
|||
return 0;
|
||||
case COUNTER_FUNCTION_QUADRATURE_X1_A:
|
||||
if (synapse->signal->id == signal_a_id) {
|
||||
err = quad8_direction_read(counter, count, &direction);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (direction == COUNTER_COUNT_DIRECTION_FORWARD)
|
||||
*action = COUNTER_SYNAPSE_ACTION_RISING_EDGE;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ struct mchp_tc_data {
|
|||
int qdec_mode;
|
||||
int num_channels;
|
||||
int channel[2];
|
||||
bool trig_inverted;
|
||||
};
|
||||
|
||||
static const enum counter_function mchp_tc_count_functions[] = {
|
||||
|
|
@ -153,7 +152,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
|
|||
|
||||
regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], SR), &sr);
|
||||
|
||||
if (priv->trig_inverted)
|
||||
if (signal->id == 1)
|
||||
sigstatus = (sr & ATMEL_TC_MTIOB);
|
||||
else
|
||||
sigstatus = (sr & ATMEL_TC_MTIOA);
|
||||
|
|
@ -171,6 +170,17 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
|
|||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 cmr;
|
||||
|
||||
if (priv->qdec_mode) {
|
||||
*action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Only TIOA signal is evaluated in non-QDEC mode */
|
||||
if (synapse->signal->id != 0) {
|
||||
*action = COUNTER_SYNAPSE_ACTION_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
|
||||
|
||||
switch (cmr & ATMEL_TC_ETRGEDG) {
|
||||
|
|
@ -199,8 +209,8 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
|
|||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 edge = ATMEL_TC_ETRGEDG_NONE;
|
||||
|
||||
/* QDEC mode is rising edge only */
|
||||
if (priv->qdec_mode)
|
||||
/* QDEC mode is rising edge only; only TIOA handled in non-QDEC mode */
|
||||
if (priv->qdec_mode || synapse->signal->id != 0)
|
||||
return -EINVAL;
|
||||
|
||||
switch (action) {
|
||||
|
|
|
|||
|
|
@ -377,7 +377,8 @@ static const enum counter_signal_polarity ecap_cnt_pol_avail[] = {
|
|||
COUNTER_SIGNAL_POLARITY_NEGATIVE,
|
||||
};
|
||||
|
||||
static DEFINE_COUNTER_ARRAY_POLARITY(ecap_cnt_pol_array, ecap_cnt_pol_avail, ECAP_NB_CEVT);
|
||||
static DEFINE_COUNTER_AVAILABLE(ecap_cnt_pol_available, ecap_cnt_pol_avail);
|
||||
static DEFINE_COUNTER_ARRAY_POLARITY(ecap_cnt_pol_array, ecap_cnt_pol_available, ECAP_NB_CEVT);
|
||||
|
||||
static struct counter_comp ecap_cnt_signal_ext[] = {
|
||||
COUNTER_COMP_ARRAY_POLARITY(ecap_cnt_pol_read, ecap_cnt_pol_write, ecap_cnt_pol_array),
|
||||
|
|
@ -479,8 +480,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
|
|||
int ret;
|
||||
|
||||
counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
|
||||
if (IS_ERR(counter_dev))
|
||||
return PTR_ERR(counter_dev);
|
||||
if (!counter_dev)
|
||||
return -ENOMEM;
|
||||
|
||||
counter_dev->name = ECAP_DRV_NAME;
|
||||
counter_dev->parent = dev;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
|
@ -94,7 +95,6 @@ struct tegra_gpio_info {
|
|||
struct tegra_gpio_bank *bank_info;
|
||||
const struct tegra_gpio_soc_config *soc;
|
||||
struct gpio_chip gc;
|
||||
struct irq_chip ic;
|
||||
u32 bank_count;
|
||||
unsigned int *irqs;
|
||||
};
|
||||
|
|
@ -288,6 +288,7 @@ static void tegra_gpio_irq_mask(struct irq_data *d)
|
|||
unsigned int gpio = d->hwirq;
|
||||
|
||||
tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 0);
|
||||
gpiochip_disable_irq(chip, gpio);
|
||||
}
|
||||
|
||||
static void tegra_gpio_irq_unmask(struct irq_data *d)
|
||||
|
|
@ -296,6 +297,7 @@ static void tegra_gpio_irq_unmask(struct irq_data *d)
|
|||
struct tegra_gpio_info *tgi = gpiochip_get_data(chip);
|
||||
unsigned int gpio = d->hwirq;
|
||||
|
||||
gpiochip_enable_irq(chip, gpio);
|
||||
tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 1);
|
||||
}
|
||||
|
||||
|
|
@ -598,10 +600,47 @@ static void tegra_gpio_irq_release_resources(struct irq_data *d)
|
|||
tegra_gpio_enable(tgi, d->hwirq);
|
||||
}
|
||||
|
||||
static void tegra_gpio_irq_print_chip(struct irq_data *d, struct seq_file *s)
|
||||
{
|
||||
struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
|
||||
|
||||
seq_printf(s, dev_name(chip->parent));
|
||||
}
|
||||
|
||||
static const struct irq_chip tegra_gpio_irq_chip = {
|
||||
.irq_shutdown = tegra_gpio_irq_shutdown,
|
||||
.irq_ack = tegra_gpio_irq_ack,
|
||||
.irq_mask = tegra_gpio_irq_mask,
|
||||
.irq_unmask = tegra_gpio_irq_unmask,
|
||||
.irq_set_type = tegra_gpio_irq_set_type,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.irq_set_wake = tegra_gpio_irq_set_wake,
|
||||
#endif
|
||||
.irq_print_chip = tegra_gpio_irq_print_chip,
|
||||
.irq_request_resources = tegra_gpio_irq_request_resources,
|
||||
.irq_release_resources = tegra_gpio_irq_release_resources,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
};
|
||||
|
||||
static const struct irq_chip tegra210_gpio_irq_chip = {
|
||||
.irq_shutdown = tegra_gpio_irq_shutdown,
|
||||
.irq_ack = tegra_gpio_irq_ack,
|
||||
.irq_mask = tegra_gpio_irq_mask,
|
||||
.irq_unmask = tegra_gpio_irq_unmask,
|
||||
.irq_set_affinity = tegra_gpio_irq_set_affinity,
|
||||
.irq_set_type = tegra_gpio_irq_set_type,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.irq_set_wake = tegra_gpio_irq_set_wake,
|
||||
#endif
|
||||
.irq_print_chip = tegra_gpio_irq_print_chip,
|
||||
.irq_request_resources = tegra_gpio_irq_request_resources,
|
||||
.irq_release_resources = tegra_gpio_irq_release_resources,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
static int tegra_dbg_gpio_show(struct seq_file *s, void *unused)
|
||||
{
|
||||
|
|
@ -689,18 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
|||
tgi->gc.ngpio = tgi->bank_count * 32;
|
||||
tgi->gc.parent = &pdev->dev;
|
||||
|
||||
tgi->ic.name = "GPIO";
|
||||
tgi->ic.irq_ack = tegra_gpio_irq_ack;
|
||||
tgi->ic.irq_mask = tegra_gpio_irq_mask;
|
||||
tgi->ic.irq_unmask = tegra_gpio_irq_unmask;
|
||||
tgi->ic.irq_set_type = tegra_gpio_irq_set_type;
|
||||
tgi->ic.irq_shutdown = tegra_gpio_irq_shutdown;
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
tgi->ic.irq_set_wake = tegra_gpio_irq_set_wake;
|
||||
#endif
|
||||
tgi->ic.irq_request_resources = tegra_gpio_irq_request_resources;
|
||||
tgi->ic.irq_release_resources = tegra_gpio_irq_release_resources;
|
||||
|
||||
platform_set_drvdata(pdev, tgi);
|
||||
|
||||
if (tgi->soc->debounce_supported)
|
||||
|
|
@ -733,7 +760,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
irq = &tgi->gc.irq;
|
||||
irq->chip = &tgi->ic;
|
||||
irq->fwnode = of_node_to_fwnode(pdev->dev.of_node);
|
||||
irq->child_to_parent_hwirq = tegra_gpio_child_to_parent_hwirq;
|
||||
irq->populate_parent_alloc_arg = tegra_gpio_populate_parent_fwspec;
|
||||
|
|
@ -752,7 +778,9 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
|||
if (!irq->parent_domain)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
tgi->ic.irq_set_affinity = tegra_gpio_irq_set_affinity;
|
||||
gpio_irq_chip_set_chip(irq, &tegra210_gpio_irq_chip);
|
||||
} else {
|
||||
gpio_irq_chip_set_chip(irq, &tegra_gpio_irq_chip);
|
||||
}
|
||||
|
||||
tgi->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
|
|
|
|||
|
|
@ -1687,14 +1687,15 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
|
|||
ret = coresight_fixup_device_conns(csdev);
|
||||
if (!ret)
|
||||
ret = coresight_fixup_orphan_conns(csdev);
|
||||
if (!ret && cti_assoc_ops && cti_assoc_ops->add)
|
||||
cti_assoc_ops->add(csdev);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&coresight_mutex);
|
||||
/* Success */
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
if (cti_assoc_ops && cti_assoc_ops->add)
|
||||
cti_assoc_ops->add(csdev);
|
||||
return csdev;
|
||||
}
|
||||
|
||||
/* Unregister the device if needed */
|
||||
if (registered) {
|
||||
|
|
|
|||
|
|
@ -90,11 +90,9 @@ void cti_write_all_hw_regs(struct cti_drvdata *drvdata)
|
|||
static int cti_enable_hw(struct cti_drvdata *drvdata)
|
||||
{
|
||||
struct cti_config *config = &drvdata->config;
|
||||
struct device *dev = &drvdata->csdev->dev;
|
||||
unsigned long flags;
|
||||
int rc = 0;
|
||||
|
||||
pm_runtime_get_sync(dev->parent);
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
/* no need to do anything if enabled or unpowered*/
|
||||
|
|
@ -119,7 +117,6 @@ static int cti_enable_hw(struct cti_drvdata *drvdata)
|
|||
/* cannot enable due to error */
|
||||
cti_err_not_enabled:
|
||||
spin_unlock_irqrestore(&drvdata->spinlock, flags);
|
||||
pm_runtime_put(dev->parent);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +150,6 @@ static void cti_cpuhp_enable_hw(struct cti_drvdata *drvdata)
|
|||
static int cti_disable_hw(struct cti_drvdata *drvdata)
|
||||
{
|
||||
struct cti_config *config = &drvdata->config;
|
||||
struct device *dev = &drvdata->csdev->dev;
|
||||
struct coresight_device *csdev = drvdata->csdev;
|
||||
|
||||
spin_lock(&drvdata->spinlock);
|
||||
|
|
@ -175,7 +171,6 @@ static int cti_disable_hw(struct cti_drvdata *drvdata)
|
|||
coresight_disclaim_device_unlocked(csdev);
|
||||
CS_LOCK(drvdata->base);
|
||||
spin_unlock(&drvdata->spinlock);
|
||||
pm_runtime_put(dev->parent);
|
||||
return 0;
|
||||
|
||||
/* not disabled this call */
|
||||
|
|
@ -541,7 +536,7 @@ cti_match_fixup_csdev(struct cti_device *ctidev, const char *node_name,
|
|||
/*
|
||||
* Search the cti list to add an associated CTI into the supplied CS device
|
||||
* This will set the association if CTI declared before the CS device.
|
||||
* (called from coresight_register() with coresight_mutex locked).
|
||||
* (called from coresight_register() without coresight_mutex locked).
|
||||
*/
|
||||
static void cti_add_assoc_to_csdev(struct coresight_device *csdev)
|
||||
{
|
||||
|
|
@ -569,7 +564,8 @@ static void cti_add_assoc_to_csdev(struct coresight_device *csdev)
|
|||
* if we found a matching csdev then update the ECT
|
||||
* association pointer for the device with this CTI.
|
||||
*/
|
||||
csdev->ect_dev = ect_item->csdev;
|
||||
coresight_set_assoc_ectdev_mutex(csdev->ect_dev,
|
||||
ect_item->csdev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1185,17 +1185,30 @@ static ssize_t adxl367_get_fifo_watermark(struct device *dev,
|
|||
return sysfs_emit(buf, "%d\n", fifo_watermark);
|
||||
}
|
||||
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_min, "1");
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_max,
|
||||
__stringify(ADXL367_FIFO_MAX_WATERMARK));
|
||||
static ssize_t hwfifo_watermark_min_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", "1");
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_max_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", __stringify(ADXL367_FIFO_MAX_WATERMARK));
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_watermark, 0444,
|
||||
adxl367_get_fifo_watermark, NULL, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
|
||||
adxl367_get_fifo_enabled, NULL, 0);
|
||||
|
||||
static const struct attribute *adxl367_fifo_attributes[] = {
|
||||
&iio_const_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_const_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_enabled.dev_attr.attr,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -998,17 +998,30 @@ static ssize_t adxl372_get_fifo_watermark(struct device *dev,
|
|||
return sprintf(buf, "%d\n", st->watermark);
|
||||
}
|
||||
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_min, "1");
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_max,
|
||||
__stringify(ADXL372_FIFO_SIZE));
|
||||
static ssize_t hwfifo_watermark_min_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", "1");
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_max_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", __stringify(ADXL372_FIFO_SIZE));
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_watermark, 0444,
|
||||
adxl372_get_fifo_watermark, NULL, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
|
||||
adxl372_get_fifo_enabled, NULL, 0);
|
||||
|
||||
static const struct attribute *adxl372_fifo_attributes[] = {
|
||||
&iio_const_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_const_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_enabled.dev_attr.attr,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -925,17 +925,30 @@ static const struct iio_chan_spec_ext_info bmc150_accel_ext_info[] = {
|
|||
{ }
|
||||
};
|
||||
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_min, "1");
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_max,
|
||||
__stringify(BMC150_ACCEL_FIFO_LENGTH));
|
||||
static ssize_t hwfifo_watermark_min_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", "1");
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_max_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", __stringify(BMC150_ACCEL_FIFO_LENGTH));
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, S_IRUGO,
|
||||
bmc150_accel_get_fifo_state, NULL, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_watermark, S_IRUGO,
|
||||
bmc150_accel_get_fifo_watermark, NULL, 0);
|
||||
|
||||
static const struct attribute *bmc150_accel_fifo_attributes[] = {
|
||||
&iio_const_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_const_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_enabled.dev_attr.attr,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -2193,17 +2193,30 @@ static ssize_t at91_adc_get_watermark(struct device *dev,
|
|||
return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark);
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_min_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", "2");
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_max_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", AT91_HWFIFO_MAX_SIZE_STR);
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
|
||||
at91_adc_get_fifo_state, NULL, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_watermark, 0444,
|
||||
at91_adc_get_watermark, NULL, 0);
|
||||
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_min, "2");
|
||||
static IIO_CONST_ATTR(hwfifo_watermark_max, AT91_HWFIFO_MAX_SIZE_STR);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0);
|
||||
|
||||
static const struct attribute *at91_adc_fifo_attributes[] = {
|
||||
&iio_const_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_const_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_min.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark_max.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_watermark.dev_attr.attr,
|
||||
&iio_dev_attr_hwfifo_enabled.dev_attr.attr,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -55,8 +55,9 @@
|
|||
/* Internal voltage reference in mV */
|
||||
#define MCP3911_INT_VREF_MV 1200
|
||||
|
||||
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 5) | (1 << 0)) & 0xff)
|
||||
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 5) | (0 << 0)) & 0xff)
|
||||
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 6) | (1 << 0)) & 0xff)
|
||||
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 6) | (0 << 0)) & 0xff)
|
||||
#define MCP3911_REG_MASK GENMASK(4, 1)
|
||||
|
||||
#define MCP3911_NUM_CHANNELS 2
|
||||
|
||||
|
|
@ -89,8 +90,8 @@ static int mcp3911_read(struct mcp3911 *adc, u8 reg, u32 *val, u8 len)
|
|||
|
||||
be32_to_cpus(val);
|
||||
*val >>= ((4 - len) * 8);
|
||||
dev_dbg(&adc->spi->dev, "reading 0x%x from register 0x%x\n", *val,
|
||||
reg >> 1);
|
||||
dev_dbg(&adc->spi->dev, "reading 0x%x from register 0x%lx\n", *val,
|
||||
FIELD_GET(MCP3911_REG_MASK, reg));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +249,7 @@ static int mcp3911_write_raw(struct iio_dev *indio_dev,
|
|||
break;
|
||||
|
||||
case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
|
||||
for (int i = 0; i < sizeof(mcp3911_osr_table); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(mcp3911_osr_table); i++) {
|
||||
if (val == mcp3911_osr_table[i]) {
|
||||
val = FIELD_PREP(MCP3911_CONFIG_OSR, i);
|
||||
ret = mcp3911_update(adc, MCP3911_REG_CONFIG, MCP3911_CONFIG_OSR,
|
||||
|
|
@ -496,7 +497,7 @@ static int mcp3911_probe(struct spi_device *spi)
|
|||
indio_dev->name,
|
||||
iio_device_id(indio_dev));
|
||||
if (!adc->trig)
|
||||
return PTR_ERR(adc->trig);
|
||||
return -ENOMEM;
|
||||
|
||||
adc->trig->ops = &mcp3911_trigger_ops;
|
||||
iio_trigger_set_drvdata(adc->trig, adc);
|
||||
|
|
|
|||
|
|
@ -2086,18 +2086,19 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev,
|
|||
stm32_adc_chan_init_one(indio_dev, &channels[scan_index], val,
|
||||
vin[1], scan_index, differential);
|
||||
|
||||
val = 0;
|
||||
ret = fwnode_property_read_u32(child, "st,min-sample-time-ns", &val);
|
||||
/* st,min-sample-time-ns is optional */
|
||||
if (!ret) {
|
||||
stm32_adc_smpr_init(adc, channels[scan_index].channel, val);
|
||||
if (differential)
|
||||
stm32_adc_smpr_init(adc, vin[1], val);
|
||||
} else if (ret != -EINVAL) {
|
||||
if (ret && ret != -EINVAL) {
|
||||
dev_err(&indio_dev->dev, "Invalid st,min-sample-time-ns property %d\n",
|
||||
ret);
|
||||
goto err;
|
||||
}
|
||||
|
||||
stm32_adc_smpr_init(adc, channels[scan_index].channel, val);
|
||||
if (differential)
|
||||
stm32_adc_smpr_init(adc, vin[1], val);
|
||||
|
||||
scan_index++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -858,7 +858,7 @@ static int tsl2583_probe(struct i2c_client *clientp,
|
|||
TSL2583_POWER_OFF_DELAY_MS);
|
||||
pm_runtime_use_autosuspend(&clientp->dev);
|
||||
|
||||
ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
|
||||
ret = iio_device_register(indio_dev);
|
||||
if (ret) {
|
||||
dev_err(&clientp->dev, "%s: iio registration failed\n",
|
||||
__func__);
|
||||
|
|
|
|||
|
|
@ -1385,13 +1385,6 @@ static int ltc2983_setup(struct ltc2983_data *st, bool assign_iio)
|
|||
return ret;
|
||||
}
|
||||
|
||||
st->iio_chan = devm_kzalloc(&st->spi->dev,
|
||||
st->iio_channels * sizeof(*st->iio_chan),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!st->iio_chan)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = regmap_update_bits(st->regmap, LTC2983_GLOBAL_CONFIG_REG,
|
||||
LTC2983_NOTCH_FREQ_MASK,
|
||||
LTC2983_NOTCH_FREQ(st->filter_notch_freq));
|
||||
|
|
@ -1514,6 +1507,12 @@ static int ltc2983_probe(struct spi_device *spi)
|
|||
gpiod_set_value_cansleep(gpio, 0);
|
||||
}
|
||||
|
||||
st->iio_chan = devm_kzalloc(&spi->dev,
|
||||
st->iio_channels * sizeof(*st->iio_chan),
|
||||
GFP_KERNEL);
|
||||
if (!st->iio_chan)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = ltc2983_setup(st, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static int gru_assign_asid(struct gru_state *gru)
|
|||
* Optionally, build an array of chars that contain the bit numbers allocated.
|
||||
*/
|
||||
static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
|
||||
char *idx)
|
||||
signed char *idx)
|
||||
{
|
||||
unsigned long bits = 0;
|
||||
int i;
|
||||
|
|
@ -170,14 +170,14 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
|
|||
}
|
||||
|
||||
unsigned long gru_reserve_cb_resources(struct gru_state *gru, int cbr_au_count,
|
||||
char *cbmap)
|
||||
signed char *cbmap)
|
||||
{
|
||||
return reserve_resources(&gru->gs_cbr_map, cbr_au_count, GRU_CBR_AU,
|
||||
cbmap);
|
||||
}
|
||||
|
||||
unsigned long gru_reserve_ds_resources(struct gru_state *gru, int dsr_au_count,
|
||||
char *dsmap)
|
||||
signed char *dsmap)
|
||||
{
|
||||
return reserve_resources(&gru->gs_dsr_map, dsr_au_count, GRU_DSR_AU,
|
||||
dsmap);
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ struct gru_thread_state {
|
|||
pid_t ts_tgid_owner; /* task that is using the
|
||||
context - for migration */
|
||||
short ts_user_blade_id;/* user selected blade */
|
||||
char ts_user_chiplet_id;/* user selected chiplet */
|
||||
signed char ts_user_chiplet_id;/* user selected chiplet */
|
||||
unsigned short ts_sizeavail; /* Pagesizes in use */
|
||||
int ts_tsid; /* thread that owns the
|
||||
structure */
|
||||
|
|
@ -364,11 +364,11 @@ struct gru_thread_state {
|
|||
required for contest */
|
||||
unsigned char ts_cbr_au_count;/* Number of CBR resources
|
||||
required for contest */
|
||||
char ts_cch_req_slice;/* CCH packet slice */
|
||||
char ts_blade; /* If >= 0, migrate context if
|
||||
signed char ts_cch_req_slice;/* CCH packet slice */
|
||||
signed char ts_blade; /* If >= 0, migrate context if
|
||||
ref from different blade */
|
||||
char ts_force_cch_reload;
|
||||
char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each
|
||||
signed char ts_force_cch_reload;
|
||||
signed char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each
|
||||
allocated CB */
|
||||
int ts_data_valid; /* Indicates if ts_gdata has
|
||||
valid data */
|
||||
|
|
@ -643,9 +643,9 @@ extern struct gru_thread_state *gru_alloc_gts(struct vm_area_struct *vma,
|
|||
int cbr_au_count, int dsr_au_count,
|
||||
unsigned char tlb_preload_count, int options, int tsid);
|
||||
extern unsigned long gru_reserve_cb_resources(struct gru_state *gru,
|
||||
int cbr_au_count, char *cbmap);
|
||||
int cbr_au_count, signed char *cbmap);
|
||||
extern unsigned long gru_reserve_ds_resources(struct gru_state *gru,
|
||||
int dsr_au_count, char *dsmap);
|
||||
int dsr_au_count, signed char *dsmap);
|
||||
extern vm_fault_t gru_fault(struct vm_fault *vmf);
|
||||
extern struct gru_mm_struct *gru_register_mmu_notifier(void);
|
||||
extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);
|
||||
|
|
|
|||
|
|
@ -199,6 +199,13 @@ static int loongson_hotkey_resume(struct device *dev)
|
|||
struct key_entry ke;
|
||||
struct backlight_device *bd;
|
||||
|
||||
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
|
||||
if (bd) {
|
||||
loongson_laptop_backlight_update(bd) ?
|
||||
pr_warn("Loongson_backlight: resume brightness failed") :
|
||||
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only if the firmware supports SW_LID event model, we can handle the
|
||||
* event. This is for the consideration of development board without EC.
|
||||
|
|
@ -228,13 +235,6 @@ static int loongson_hotkey_resume(struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
|
||||
if (bd) {
|
||||
loongson_laptop_backlight_update(bd) ?
|
||||
pr_warn("Loongson_backlight: resume brightness failed") :
|
||||
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -448,6 +448,7 @@ static int __init event_init(struct generic_sub_driver *sub_driver)
|
|||
if (ret < 0) {
|
||||
pr_err("Failed to setup input device keymap\n");
|
||||
input_free_device(generic_inputdev);
|
||||
generic_inputdev = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -502,8 +503,11 @@ static int __init generic_subdriver_init(struct generic_sub_driver *sub_driver)
|
|||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
if (sub_driver->init)
|
||||
sub_driver->init(sub_driver);
|
||||
if (sub_driver->init) {
|
||||
ret = sub_driver->init(sub_driver);
|
||||
if (ret)
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
if (sub_driver->notify) {
|
||||
ret = setup_acpi_notify(sub_driver);
|
||||
|
|
@ -519,7 +523,7 @@ static int __init generic_subdriver_init(struct generic_sub_driver *sub_driver)
|
|||
|
||||
err_out:
|
||||
generic_subdriver_exit(sub_driver);
|
||||
return (ret < 0) ? ret : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void generic_subdriver_exit(struct generic_sub_driver *sub_driver)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_graph.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/reset.h>
|
||||
|
|
@ -85,7 +86,7 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
|
|||
* mode. If the controller supports DRD but the dr_mode is not
|
||||
* specified or set to OTG, then set the mode to peripheral.
|
||||
*/
|
||||
if (mode == USB_DR_MODE_OTG &&
|
||||
if (mode == USB_DR_MODE_OTG && !dwc->edev &&
|
||||
(!IS_ENABLED(CONFIG_USB_ROLE_SWITCH) ||
|
||||
!device_property_read_bool(dwc->dev, "usb-role-switch")) &&
|
||||
!DWC3_VER_IS_PRIOR(DWC3, 330A))
|
||||
|
|
@ -1690,6 +1691,46 @@ static void dwc3_check_params(struct dwc3 *dwc)
|
|||
}
|
||||
}
|
||||
|
||||
static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
|
||||
{
|
||||
struct device *dev = dwc->dev;
|
||||
struct device_node *np_phy;
|
||||
struct extcon_dev *edev = NULL;
|
||||
const char *name;
|
||||
|
||||
if (device_property_read_bool(dev, "extcon"))
|
||||
return extcon_get_edev_by_phandle(dev, 0);
|
||||
|
||||
/*
|
||||
* Device tree platforms should get extcon via phandle.
|
||||
* On ACPI platforms, we get the name from a device property.
|
||||
* This device property is for kernel internal use only and
|
||||
* is expected to be set by the glue code.
|
||||
*/
|
||||
if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
|
||||
return extcon_get_extcon_dev(name);
|
||||
|
||||
/*
|
||||
* Try to get an extcon device from the USB PHY controller's "port"
|
||||
* node. Check if it has the "port" node first, to avoid printing the
|
||||
* error message from underlying code, as it's a valid case: extcon
|
||||
* device (and "port" node) may be missing in case of "usb-role-switch"
|
||||
* or OTG mode.
|
||||
*/
|
||||
np_phy = of_parse_phandle(dev->of_node, "phys", 0);
|
||||
if (of_graph_is_present(np_phy)) {
|
||||
struct device_node *np_conn;
|
||||
|
||||
np_conn = of_graph_get_remote_node(np_phy, -1, -1);
|
||||
if (np_conn)
|
||||
edev = extcon_find_edev_by_node(np_conn);
|
||||
of_node_put(np_conn);
|
||||
}
|
||||
of_node_put(np_phy);
|
||||
|
||||
return edev;
|
||||
}
|
||||
|
||||
static int dwc3_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
|
|
@ -1840,6 +1881,12 @@ static int dwc3_probe(struct platform_device *pdev)
|
|||
goto err2;
|
||||
}
|
||||
|
||||
dwc->edev = dwc3_get_extcon(dwc);
|
||||
if (IS_ERR(dwc->edev)) {
|
||||
ret = dev_err_probe(dwc->dev, PTR_ERR(dwc->edev), "failed to get extcon\n");
|
||||
goto err3;
|
||||
}
|
||||
|
||||
ret = dwc3_get_dr_mode(dwc);
|
||||
if (ret)
|
||||
goto err3;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/extcon.h>
|
||||
#include <linux/of_graph.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
|
|
@ -439,51 +438,6 @@ static int dwc3_drd_notifier(struct notifier_block *nb,
|
|||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
|
||||
{
|
||||
struct device *dev = dwc->dev;
|
||||
struct device_node *np_phy;
|
||||
struct extcon_dev *edev = NULL;
|
||||
const char *name;
|
||||
|
||||
if (device_property_read_bool(dev, "extcon"))
|
||||
return extcon_get_edev_by_phandle(dev, 0);
|
||||
|
||||
/*
|
||||
* Device tree platforms should get extcon via phandle.
|
||||
* On ACPI platforms, we get the name from a device property.
|
||||
* This device property is for kernel internal use only and
|
||||
* is expected to be set by the glue code.
|
||||
*/
|
||||
if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
|
||||
edev = extcon_get_extcon_dev(name);
|
||||
if (!edev)
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
|
||||
return edev;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to get an extcon device from the USB PHY controller's "port"
|
||||
* node. Check if it has the "port" node first, to avoid printing the
|
||||
* error message from underlying code, as it's a valid case: extcon
|
||||
* device (and "port" node) may be missing in case of "usb-role-switch"
|
||||
* or OTG mode.
|
||||
*/
|
||||
np_phy = of_parse_phandle(dev->of_node, "phys", 0);
|
||||
if (of_graph_is_present(np_phy)) {
|
||||
struct device_node *np_conn;
|
||||
|
||||
np_conn = of_graph_get_remote_node(np_phy, -1, -1);
|
||||
if (np_conn)
|
||||
edev = extcon_find_edev_by_node(np_conn);
|
||||
of_node_put(np_conn);
|
||||
}
|
||||
of_node_put(np_phy);
|
||||
|
||||
return edev;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
|
||||
#define ROLE_SWITCH 1
|
||||
static int dwc3_usb_role_switch_set(struct usb_role_switch *sw,
|
||||
|
|
@ -588,10 +542,6 @@ int dwc3_drd_init(struct dwc3 *dwc)
|
|||
device_property_read_bool(dwc->dev, "usb-role-switch"))
|
||||
return dwc3_setup_role_switch(dwc);
|
||||
|
||||
dwc->edev = dwc3_get_extcon(dwc);
|
||||
if (IS_ERR(dwc->edev))
|
||||
return PTR_ERR(dwc->edev);
|
||||
|
||||
if (dwc->edev) {
|
||||
dwc->edev_nb.notifier_call = dwc3_drd_notifier;
|
||||
ret = extcon_register_notifier(dwc->edev, EXTCON_USB_HOST,
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
|||
/* Manage SoftReset */
|
||||
reset_control_deassert(dwc3_data->rstc_rst);
|
||||
|
||||
child = of_get_child_by_name(node, "usb");
|
||||
child = of_get_compatible_child(node, "snps,dwc3");
|
||||
if (!child) {
|
||||
dev_err(&pdev->dev, "failed to find dwc3 core node\n");
|
||||
ret = -ENODEV;
|
||||
|
|
|
|||
|
|
@ -1292,8 +1292,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
|
|||
trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS;
|
||||
}
|
||||
|
||||
/* always enable Interrupt on Missed ISOC */
|
||||
trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
|
||||
if (!no_interrupt && !chain)
|
||||
trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
|
||||
break;
|
||||
|
||||
case USB_ENDPOINT_XFER_BULK:
|
||||
|
|
@ -1698,6 +1698,16 @@ static int __dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool int
|
|||
cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
|
||||
/*
|
||||
* If the End Transfer command was timed out while the device is
|
||||
* not in SETUP phase, it's possible that an incoming Setup packet
|
||||
* may prevent the command's completion. Let's retry when the
|
||||
* ep0state returns to EP0_SETUP_PHASE.
|
||||
*/
|
||||
if (ret == -ETIMEDOUT && dep->dwc->ep0state != EP0_SETUP_PHASE) {
|
||||
dep->flags |= DWC3_EP_DELAY_STOP;
|
||||
return 0;
|
||||
}
|
||||
WARN_ON_ONCE(ret);
|
||||
dep->resource_index = 0;
|
||||
|
||||
|
|
@ -3238,6 +3248,10 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep,
|
|||
if (event->status & DEPEVT_STATUS_SHORT && !chain)
|
||||
return 1;
|
||||
|
||||
if ((trb->ctrl & DWC3_TRB_CTRL_ISP_IMI) &&
|
||||
DWC3_TRB_SIZE_TRBSTS(trb->size) == DWC3_TRBSTS_MISSED_ISOC)
|
||||
return 1;
|
||||
|
||||
if ((trb->ctrl & DWC3_TRB_CTRL_IOC) ||
|
||||
(trb->ctrl & DWC3_TRB_CTRL_LST))
|
||||
return 1;
|
||||
|
|
@ -3719,7 +3733,7 @@ void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
|
|||
* timeout. Delay issuing the End Transfer command until the Setup TRB is
|
||||
* prepared.
|
||||
*/
|
||||
if (dwc->ep0state != EP0_SETUP_PHASE) {
|
||||
if (dwc->ep0state != EP0_SETUP_PHASE && !dwc->delayed_status) {
|
||||
dep->flags |= DWC3_EP_DELAY_STOP;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,6 +304,7 @@ int uvcg_queue_enable(struct uvc_video_queue *queue, int enable)
|
|||
|
||||
queue->sequence = 0;
|
||||
queue->buf_used = 0;
|
||||
queue->flags &= ~UVC_QUEUE_DROP_INCOMPLETE;
|
||||
} else {
|
||||
ret = vb2_streamoff(&queue->queue, queue->queue.type);
|
||||
if (ret < 0)
|
||||
|
|
@ -329,10 +330,11 @@ int uvcg_queue_enable(struct uvc_video_queue *queue, int enable)
|
|||
void uvcg_complete_buffer(struct uvc_video_queue *queue,
|
||||
struct uvc_buffer *buf)
|
||||
{
|
||||
if ((queue->flags & UVC_QUEUE_DROP_INCOMPLETE) &&
|
||||
buf->length != buf->bytesused) {
|
||||
buf->state = UVC_BUF_STATE_QUEUED;
|
||||
if (queue->flags & UVC_QUEUE_DROP_INCOMPLETE) {
|
||||
queue->flags &= ~UVC_QUEUE_DROP_INCOMPLETE;
|
||||
buf->state = UVC_BUF_STATE_ERROR;
|
||||
vb2_set_plane_payload(&buf->buf.vb2_buf, 0, 0);
|
||||
vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ uvc_video_encode_bulk(struct usb_request *req, struct uvc_video *video,
|
|||
struct uvc_buffer *buf)
|
||||
{
|
||||
void *mem = req->buf;
|
||||
struct uvc_request *ureq = req->context;
|
||||
int len = video->req_size;
|
||||
int ret;
|
||||
|
||||
|
|
@ -113,13 +114,14 @@ uvc_video_encode_bulk(struct usb_request *req, struct uvc_video *video,
|
|||
video->queue.buf_used = 0;
|
||||
buf->state = UVC_BUF_STATE_DONE;
|
||||
list_del(&buf->queue);
|
||||
uvcg_complete_buffer(&video->queue, buf);
|
||||
video->fid ^= UVC_STREAM_FID;
|
||||
ureq->last_buf = buf;
|
||||
|
||||
video->payload_size = 0;
|
||||
}
|
||||
|
||||
if (video->payload_size == video->max_payload_size ||
|
||||
video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE ||
|
||||
buf->bytesused == video->queue.buf_used)
|
||||
video->payload_size = 0;
|
||||
}
|
||||
|
|
@ -155,10 +157,10 @@ uvc_video_encode_isoc_sg(struct usb_request *req, struct uvc_video *video,
|
|||
sg = sg_next(sg);
|
||||
|
||||
for_each_sg(sg, iter, ureq->sgt.nents - 1, i) {
|
||||
if (!len || !buf->sg || !sg_dma_len(buf->sg))
|
||||
if (!len || !buf->sg || !buf->sg->length)
|
||||
break;
|
||||
|
||||
sg_left = sg_dma_len(buf->sg) - buf->offset;
|
||||
sg_left = buf->sg->length - buf->offset;
|
||||
part = min_t(unsigned int, len, sg_left);
|
||||
|
||||
sg_set_page(iter, sg_page(buf->sg), part, buf->offset);
|
||||
|
|
@ -180,7 +182,8 @@ uvc_video_encode_isoc_sg(struct usb_request *req, struct uvc_video *video,
|
|||
req->length -= len;
|
||||
video->queue.buf_used += req->length - header_len;
|
||||
|
||||
if (buf->bytesused == video->queue.buf_used || !buf->sg) {
|
||||
if (buf->bytesused == video->queue.buf_used || !buf->sg ||
|
||||
video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE) {
|
||||
video->queue.buf_used = 0;
|
||||
buf->state = UVC_BUF_STATE_DONE;
|
||||
buf->offset = 0;
|
||||
|
|
@ -195,6 +198,7 @@ uvc_video_encode_isoc(struct usb_request *req, struct uvc_video *video,
|
|||
struct uvc_buffer *buf)
|
||||
{
|
||||
void *mem = req->buf;
|
||||
struct uvc_request *ureq = req->context;
|
||||
int len = video->req_size;
|
||||
int ret;
|
||||
|
||||
|
|
@ -209,12 +213,13 @@ uvc_video_encode_isoc(struct usb_request *req, struct uvc_video *video,
|
|||
|
||||
req->length = video->req_size - len;
|
||||
|
||||
if (buf->bytesused == video->queue.buf_used) {
|
||||
if (buf->bytesused == video->queue.buf_used ||
|
||||
video->queue.flags & UVC_QUEUE_DROP_INCOMPLETE) {
|
||||
video->queue.buf_used = 0;
|
||||
buf->state = UVC_BUF_STATE_DONE;
|
||||
list_del(&buf->queue);
|
||||
uvcg_complete_buffer(&video->queue, buf);
|
||||
video->fid ^= UVC_STREAM_FID;
|
||||
ureq->last_buf = buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -255,6 +260,11 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req)
|
|||
case 0:
|
||||
break;
|
||||
|
||||
case -EXDEV:
|
||||
uvcg_dbg(&video->uvc->func, "VS request missed xfer.\n");
|
||||
queue->flags |= UVC_QUEUE_DROP_INCOMPLETE;
|
||||
break;
|
||||
|
||||
case -ESHUTDOWN: /* disconnect from host. */
|
||||
uvcg_dbg(&video->uvc->func, "VS request cancelled.\n");
|
||||
uvcg_queue_cancel(queue, 1);
|
||||
|
|
@ -431,7 +441,8 @@ static void uvcg_video_pump(struct work_struct *work)
|
|||
|
||||
/* Endpoint now owns the request */
|
||||
req = NULL;
|
||||
video->req_int_count++;
|
||||
if (buf->state != UVC_BUF_STATE_DONE)
|
||||
video->req_int_count++;
|
||||
}
|
||||
|
||||
if (!req)
|
||||
|
|
|
|||
|
|
@ -591,6 +591,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx)
|
|||
d->gadget.max_speed = USB_SPEED_HIGH;
|
||||
d->gadget.speed = USB_SPEED_UNKNOWN;
|
||||
d->gadget.dev.of_node = vhub->pdev->dev.of_node;
|
||||
d->gadget.dev.of_node_reused = true;
|
||||
|
||||
rc = usb_add_gadget_udc(d->port_dev, &d->gadget);
|
||||
if (rc != 0)
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ static void bdc_uspc_disconnected(struct bdc *bdc, bool reinit)
|
|||
bdc->delayed_status = false;
|
||||
bdc->reinit = reinit;
|
||||
bdc->test_mode = false;
|
||||
usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED);
|
||||
}
|
||||
|
||||
/* TNotify wkaeup timer */
|
||||
|
|
|
|||
|
|
@ -889,15 +889,19 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
|
|||
if (dev->eps[i].stream_info)
|
||||
xhci_free_stream_info(xhci,
|
||||
dev->eps[i].stream_info);
|
||||
/* Endpoints on the TT/root port lists should have been removed
|
||||
* when usb_disable_device() was called for the device.
|
||||
* We can't drop them anyway, because the udev might have gone
|
||||
* away by this point, and we can't tell what speed it was.
|
||||
/*
|
||||
* Endpoints are normally deleted from the bandwidth list when
|
||||
* endpoints are dropped, before device is freed.
|
||||
* If host is dying or being removed then endpoints aren't
|
||||
* dropped cleanly, so delete the endpoint from list here.
|
||||
* Only applicable for hosts with software bandwidth checking.
|
||||
*/
|
||||
if (!list_empty(&dev->eps[i].bw_endpoint_list))
|
||||
xhci_warn(xhci, "Slot %u endpoint %u "
|
||||
"not removed from BW list!\n",
|
||||
slot_id, i);
|
||||
|
||||
if (!list_empty(&dev->eps[i].bw_endpoint_list)) {
|
||||
list_del_init(&dev->eps[i].bw_endpoint_list);
|
||||
xhci_dbg(xhci, "Slot %u endpoint %u not removed from BW list!\n",
|
||||
slot_id, i);
|
||||
}
|
||||
}
|
||||
/* If this is a hub, free the TT(s) from the TT list */
|
||||
xhci_free_tt_info(xhci, dev, slot_id);
|
||||
|
|
|
|||
|
|
@ -58,25 +58,13 @@
|
|||
#define PCI_DEVICE_ID_INTEL_CML_XHCI 0xa3af
|
||||
#define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13
|
||||
#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138
|
||||
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e
|
||||
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI 0x464e
|
||||
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
|
||||
#define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI 0xa71e
|
||||
#define PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI 0x7ec0
|
||||
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
|
||||
|
||||
#define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639
|
||||
#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
|
||||
#define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba
|
||||
#define PCI_DEVICE_ID_AMD_PROMONTORYA_2 0x43bb
|
||||
#define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_1 0x161a
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_2 0x161b
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_3 0x161d
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4 0x161e
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5 0x15d6
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6 0x15d7
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7 0x161c
|
||||
#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8 0x161f
|
||||
|
||||
#define PCI_DEVICE_ID_ASMEDIA_1042_XHCI 0x1042
|
||||
#define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
|
||||
|
|
@ -257,6 +245,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||
pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI))
|
||||
xhci->quirks |= XHCI_MISSING_CAS;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI)
|
||||
xhci->quirks |= XHCI_RESET_TO_DEFAULT;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||
(pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_XHCI ||
|
||||
|
|
@ -268,12 +260,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||
pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI ||
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI))
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI))
|
||||
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
|
||||
|
|
@ -306,8 +293,14 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||
}
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||||
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
|
||||
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {
|
||||
/*
|
||||
* try to tame the ASMedia 1042 controller which reports 0.96
|
||||
* but appears to behave more like 1.0
|
||||
*/
|
||||
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
|
||||
xhci->quirks |= XHCI_BROKEN_STREAMS;
|
||||
}
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||||
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) {
|
||||
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
|
||||
|
|
@ -336,15 +329,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||
pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4))
|
||||
xhci->quirks |= XHCI_NO_SOFT_RETRY;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_AMD &&
|
||||
(pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_1 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_2 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_3 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7 ||
|
||||
pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8))
|
||||
/* xHC spec requires PCI devices to support D3hot and D3cold */
|
||||
if (xhci->hci_version >= 0x120)
|
||||
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
|
||||
|
||||
if (xhci->quirks & XHCI_RESET_ON_RESUME)
|
||||
|
|
|
|||
|
|
@ -810,9 +810,15 @@ void xhci_shutdown(struct usb_hcd *hcd)
|
|||
|
||||
spin_lock_irq(&xhci->lock);
|
||||
xhci_halt(xhci);
|
||||
/* Workaround for spurious wakeups at shutdown with HSW */
|
||||
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
|
||||
|
||||
/*
|
||||
* Workaround for spurious wakeps at shutdown with HSW, and for boot
|
||||
* firmware delay in ADL-P PCH if port are left in U3 at shutdown
|
||||
*/
|
||||
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP ||
|
||||
xhci->quirks & XHCI_RESET_TO_DEFAULT)
|
||||
xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
|
||||
|
||||
spin_unlock_irq(&xhci->lock);
|
||||
|
||||
xhci_cleanup_msix(xhci);
|
||||
|
|
|
|||
|
|
@ -1897,6 +1897,7 @@ struct xhci_hcd {
|
|||
#define XHCI_BROKEN_D3COLD BIT_ULL(41)
|
||||
#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42)
|
||||
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
|
||||
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
|
||||
|
||||
unsigned int num_active_eps;
|
||||
unsigned int limit_active_eps;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ struct SiS_Ext {
|
|||
unsigned char VB_ExtTVYFilterIndex;
|
||||
unsigned char VB_ExtTVYFilterIndexROM661;
|
||||
unsigned char REFindex;
|
||||
char ROMMODEIDX661;
|
||||
signed char ROMMODEIDX661;
|
||||
};
|
||||
|
||||
struct SiS_Ext2 {
|
||||
|
|
|
|||
|
|
@ -183,16 +183,6 @@ int ucsi_send_command(struct ucsi *ucsi, u64 command,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(ucsi_send_command);
|
||||
|
||||
int ucsi_resume(struct ucsi *ucsi)
|
||||
{
|
||||
u64 command;
|
||||
|
||||
/* Restore UCSI notification enable mask after system resume */
|
||||
command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
|
||||
|
||||
return ucsi_send_command(ucsi, command, NULL, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ucsi_resume);
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
struct ucsi_work {
|
||||
|
|
@ -744,6 +734,7 @@ static void ucsi_partner_change(struct ucsi_connector *con)
|
|||
|
||||
static int ucsi_check_connection(struct ucsi_connector *con)
|
||||
{
|
||||
u8 prev_flags = con->status.flags;
|
||||
u64 command;
|
||||
int ret;
|
||||
|
||||
|
|
@ -754,10 +745,13 @@ static int ucsi_check_connection(struct ucsi_connector *con)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (con->status.flags == prev_flags)
|
||||
return 0;
|
||||
|
||||
if (con->status.flags & UCSI_CONSTAT_CONNECTED) {
|
||||
if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) ==
|
||||
UCSI_CONSTAT_PWR_OPMODE_PD)
|
||||
ucsi_partner_task(con, ucsi_check_altmodes, 30, 0);
|
||||
ucsi_register_partner(con);
|
||||
ucsi_pwr_opmode_change(con);
|
||||
ucsi_partner_change(con);
|
||||
} else {
|
||||
ucsi_partner_change(con);
|
||||
ucsi_port_psy_changed(con);
|
||||
|
|
@ -1276,6 +1270,28 @@ static int ucsi_init(struct ucsi *ucsi)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ucsi_resume(struct ucsi *ucsi)
|
||||
{
|
||||
struct ucsi_connector *con;
|
||||
u64 command;
|
||||
int ret;
|
||||
|
||||
/* Restore UCSI notification enable mask after system resume */
|
||||
command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
|
||||
ret = ucsi_send_command(ucsi, command, NULL, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
for (con = ucsi->connector; con->port; con++) {
|
||||
mutex_lock(&con->lock);
|
||||
ucsi_check_connection(con);
|
||||
mutex_unlock(&con->lock);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ucsi_resume);
|
||||
|
||||
static void ucsi_init_work(struct work_struct *work)
|
||||
{
|
||||
struct ucsi *ucsi = container_of(work, struct ucsi, work.work);
|
||||
|
|
|
|||
|
|
@ -185,6 +185,15 @@ static int ucsi_acpi_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ucsi_acpi_resume(struct device *dev)
|
||||
{
|
||||
struct ucsi_acpi *ua = dev_get_drvdata(dev);
|
||||
|
||||
return ucsi_resume(ua->ucsi);
|
||||
}
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(ucsi_acpi_pm_ops, NULL, ucsi_acpi_resume);
|
||||
|
||||
static const struct acpi_device_id ucsi_acpi_match[] = {
|
||||
{ "PNP0CA0", 0 },
|
||||
{ },
|
||||
|
|
@ -194,6 +203,7 @@ MODULE_DEVICE_TABLE(acpi, ucsi_acpi_match);
|
|||
static struct platform_driver ucsi_acpi_platform_driver = {
|
||||
.driver = {
|
||||
.name = "ucsi_acpi",
|
||||
.pm = pm_ptr(&ucsi_acpi_pm_ops),
|
||||
.acpi_match_table = ACPI_PTR(ucsi_acpi_match),
|
||||
},
|
||||
.probe = ucsi_acpi_probe,
|
||||
|
|
|
|||
|
|
@ -1796,6 +1796,7 @@ static int cyberpro_pci_probe(struct pci_dev *dev,
|
|||
failed_regions:
|
||||
cyberpro_free_fb_info(cfb);
|
||||
failed_release:
|
||||
pci_disable_device(dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -1812,6 +1813,7 @@ static void cyberpro_pci_remove(struct pci_dev *dev)
|
|||
int_cfb_info = NULL;
|
||||
|
||||
pci_release_regions(dev);
|
||||
pci_disable_device(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,8 @@ static int fb_remove(struct platform_device *dev)
|
|||
if (par->lcd_supply) {
|
||||
ret = regulator_disable(par->lcd_supply);
|
||||
if (ret)
|
||||
return ret;
|
||||
dev_warn(&dev->dev, "Failed to disable regulator (%pe)\n",
|
||||
ERR_PTR(ret));
|
||||
}
|
||||
|
||||
lcd_disable_raster(DA8XX_FRAME_WAIT);
|
||||
|
|
|
|||
|
|
@ -1060,14 +1060,14 @@ static const struct fb_ops gbefb_ops = {
|
|||
|
||||
static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size);
|
||||
return sysfs_emit(buf, "%u\n", gbe_mem_size);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
|
||||
|
||||
static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision);
|
||||
return sysfs_emit(buf, "%d\n", gbe_revision);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL);
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ SiS310SubsequentScreenToScreenCopy(struct sis_video_info *ivideo, int src_x, int
|
|||
* and destination blitting areas overlap and
|
||||
* adapt the bitmap addresses synchronously
|
||||
* if the coordinates exceed the valid range.
|
||||
* The the areas do not overlap, we do our
|
||||
* The areas do not overlap, we do our
|
||||
* normal check.
|
||||
*/
|
||||
if((mymax - mymin) < height) {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ struct SiS_Ext {
|
|||
unsigned char VB_ExtTVYFilterIndex;
|
||||
unsigned char VB_ExtTVYFilterIndexROM661;
|
||||
unsigned char REFindex;
|
||||
char ROMMODEIDX661;
|
||||
signed char ROMMODEIDX661;
|
||||
};
|
||||
|
||||
struct SiS_Ext2 {
|
||||
|
|
|
|||
|
|
@ -1166,7 +1166,7 @@ static ssize_t sm501fb_crtsrc_show(struct device *dev,
|
|||
ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
|
||||
ctrl &= SM501_DC_CRT_CONTROL_SEL;
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
|
||||
return sysfs_emit(buf, "%s\n", ctrl ? "crt" : "panel");
|
||||
}
|
||||
|
||||
/* sm501fb_crtsrc_show
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ struct ufx_data {
|
|||
struct kref kref;
|
||||
int fb_count;
|
||||
bool virtualized; /* true when physical usb device not present */
|
||||
struct delayed_work free_framebuffer_work;
|
||||
atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */
|
||||
atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */
|
||||
u8 *edid; /* null until we read edid from hw or get from sysfs */
|
||||
|
|
@ -1117,15 +1116,24 @@ static void ufx_free(struct kref *kref)
|
|||
{
|
||||
struct ufx_data *dev = container_of(kref, struct ufx_data, kref);
|
||||
|
||||
/* this function will wait for all in-flight urbs to complete */
|
||||
if (dev->urbs.count > 0)
|
||||
ufx_free_urb_list(dev);
|
||||
|
||||
pr_debug("freeing ufx_data %p", dev);
|
||||
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static void ufx_ops_destory(struct fb_info *info)
|
||||
{
|
||||
struct ufx_data *dev = info->par;
|
||||
int node = info->node;
|
||||
|
||||
/* Assume info structure is freed after this point */
|
||||
framebuffer_release(info);
|
||||
|
||||
pr_debug("fb_info for /dev/fb%d has been freed", node);
|
||||
|
||||
/* release reference taken by kref_init in probe() */
|
||||
kref_put(&dev->kref, ufx_free);
|
||||
}
|
||||
|
||||
|
||||
static void ufx_release_urb_work(struct work_struct *work)
|
||||
{
|
||||
struct urb_node *unode = container_of(work, struct urb_node,
|
||||
|
|
@ -1134,14 +1142,9 @@ static void ufx_release_urb_work(struct work_struct *work)
|
|||
up(&unode->dev->urbs.limit_sem);
|
||||
}
|
||||
|
||||
static void ufx_free_framebuffer_work(struct work_struct *work)
|
||||
static void ufx_free_framebuffer(struct ufx_data *dev)
|
||||
{
|
||||
struct ufx_data *dev = container_of(work, struct ufx_data,
|
||||
free_framebuffer_work.work);
|
||||
struct fb_info *info = dev->info;
|
||||
int node = info->node;
|
||||
|
||||
unregister_framebuffer(info);
|
||||
|
||||
if (info->cmap.len != 0)
|
||||
fb_dealloc_cmap(&info->cmap);
|
||||
|
|
@ -1153,11 +1156,6 @@ static void ufx_free_framebuffer_work(struct work_struct *work)
|
|||
|
||||
dev->info = NULL;
|
||||
|
||||
/* Assume info structure is freed after this point */
|
||||
framebuffer_release(info);
|
||||
|
||||
pr_debug("fb_info for /dev/fb%d has been freed", node);
|
||||
|
||||
/* ref taken in probe() as part of registering framebfufer */
|
||||
kref_put(&dev->kref, ufx_free);
|
||||
}
|
||||
|
|
@ -1169,11 +1167,13 @@ static int ufx_ops_release(struct fb_info *info, int user)
|
|||
{
|
||||
struct ufx_data *dev = info->par;
|
||||
|
||||
mutex_lock(&disconnect_mutex);
|
||||
|
||||
dev->fb_count--;
|
||||
|
||||
/* We can't free fb_info here - fbmem will touch it when we return */
|
||||
if (dev->virtualized && (dev->fb_count == 0))
|
||||
schedule_delayed_work(&dev->free_framebuffer_work, HZ);
|
||||
ufx_free_framebuffer(dev);
|
||||
|
||||
if ((dev->fb_count == 0) && (info->fbdefio)) {
|
||||
fb_deferred_io_cleanup(info);
|
||||
|
|
@ -1186,6 +1186,8 @@ static int ufx_ops_release(struct fb_info *info, int user)
|
|||
|
||||
kref_put(&dev->kref, ufx_free);
|
||||
|
||||
mutex_unlock(&disconnect_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1292,6 +1294,7 @@ static const struct fb_ops ufx_ops = {
|
|||
.fb_blank = ufx_ops_blank,
|
||||
.fb_check_var = ufx_ops_check_var,
|
||||
.fb_set_par = ufx_ops_set_par,
|
||||
.fb_destroy = ufx_ops_destory,
|
||||
};
|
||||
|
||||
/* Assumes &info->lock held by caller
|
||||
|
|
@ -1673,9 +1676,6 @@ static int ufx_usb_probe(struct usb_interface *interface,
|
|||
goto destroy_modedb;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&dev->free_framebuffer_work,
|
||||
ufx_free_framebuffer_work);
|
||||
|
||||
retval = ufx_reg_read(dev, 0x3000, &id_rev);
|
||||
check_warn_goto_error(retval, "error %d reading 0x3000 register from device", retval);
|
||||
dev_dbg(dev->gdev, "ID_REV register value 0x%08x", id_rev);
|
||||
|
|
@ -1748,10 +1748,12 @@ static int ufx_usb_probe(struct usb_interface *interface,
|
|||
static void ufx_usb_disconnect(struct usb_interface *interface)
|
||||
{
|
||||
struct ufx_data *dev;
|
||||
struct fb_info *info;
|
||||
|
||||
mutex_lock(&disconnect_mutex);
|
||||
|
||||
dev = usb_get_intfdata(interface);
|
||||
info = dev->info;
|
||||
|
||||
pr_debug("USB disconnect starting\n");
|
||||
|
||||
|
|
@ -1765,12 +1767,15 @@ static void ufx_usb_disconnect(struct usb_interface *interface)
|
|||
|
||||
/* if clients still have us open, will be freed on last close */
|
||||
if (dev->fb_count == 0)
|
||||
schedule_delayed_work(&dev->free_framebuffer_work, 0);
|
||||
ufx_free_framebuffer(dev);
|
||||
|
||||
/* release reference taken by kref_init in probe() */
|
||||
kref_put(&dev->kref, ufx_free);
|
||||
/* this function will wait for all in-flight urbs to complete */
|
||||
if (dev->urbs.count > 0)
|
||||
ufx_free_urb_list(dev);
|
||||
|
||||
/* consider ufx_data freed */
|
||||
pr_debug("freeing ufx_data %p", dev);
|
||||
|
||||
unregister_framebuffer(info);
|
||||
|
||||
mutex_unlock(&disconnect_mutex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1055,7 +1055,8 @@ stifb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
|||
{
|
||||
struct stifb_info *fb = container_of(info, struct stifb_info, info);
|
||||
|
||||
if (rect->rop != ROP_COPY)
|
||||
if (rect->rop != ROP_COPY ||
|
||||
(fb->id == S9000_ID_HCRX && fb->info.var.bits_per_pixel == 32))
|
||||
return cfb_fillrect(info, rect);
|
||||
|
||||
SETUP_HW(fb);
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int xilinxfb_release(struct device *dev)
|
||||
static void xilinxfb_release(struct device *dev)
|
||||
{
|
||||
struct xilinxfb_drvdata *drvdata = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -402,8 +402,6 @@ static int xilinxfb_release(struct device *dev)
|
|||
if (!(drvdata->flags & BUS_ACCESS_FLAG))
|
||||
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
|
|
@ -480,7 +478,9 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
|
|||
|
||||
static int xilinxfb_of_remove(struct platform_device *op)
|
||||
{
|
||||
return xilinxfb_release(&op->dev);
|
||||
xilinxfb_release(&op->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Match table for of_platform binding */
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)
|
|||
server->session_key.response = NULL;
|
||||
server->session_key.len = 0;
|
||||
kfree(server->hostname);
|
||||
server->hostname = NULL;
|
||||
|
||||
task = xchg(&server->tsk, NULL);
|
||||
if (task)
|
||||
|
|
|
|||
|
|
@ -2434,12 +2434,16 @@ cifs_writev_complete(struct work_struct *work)
|
|||
struct cifs_writedata *
|
||||
cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete)
|
||||
{
|
||||
struct cifs_writedata *writedata = NULL;
|
||||
struct page **pages =
|
||||
kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
|
||||
if (pages)
|
||||
return cifs_writedata_direct_alloc(pages, complete);
|
||||
if (pages) {
|
||||
writedata = cifs_writedata_direct_alloc(pages, complete);
|
||||
if (!writedata)
|
||||
kvfree(pages);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return writedata;
|
||||
}
|
||||
|
||||
struct cifs_writedata *
|
||||
|
|
@ -3299,6 +3303,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
|
|||
cifs_uncached_writev_complete);
|
||||
if (!wdata) {
|
||||
rc = -ENOMEM;
|
||||
for (i = 0; i < nr_pages; i++)
|
||||
put_page(pagevec[i]);
|
||||
kvfree(pagevec);
|
||||
add_credits_and_wake_if(server, credits, 0);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -542,11 +542,10 @@ struct counter_array {
|
|||
#define DEFINE_COUNTER_ARRAY_CAPTURE(_name, _length) \
|
||||
DEFINE_COUNTER_ARRAY_U64(_name, _length)
|
||||
|
||||
#define DEFINE_COUNTER_ARRAY_POLARITY(_name, _enums, _length) \
|
||||
DEFINE_COUNTER_AVAILABLE(_name##_available, _enums); \
|
||||
#define DEFINE_COUNTER_ARRAY_POLARITY(_name, _available, _length) \
|
||||
struct counter_array _name = { \
|
||||
.type = COUNTER_COMP_SIGNAL_POLARITY, \
|
||||
.avail = &(_name##_available), \
|
||||
.avail = &(_available), \
|
||||
.length = (_length), \
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
|
|||
|
||||
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || \
|
||||
defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || \
|
||||
defined(__arm__) || defined(__aarch64__)
|
||||
defined(__arm__) || defined(__aarch64__) || defined(__mips__)
|
||||
|
||||
#define fb_readb __raw_readb
|
||||
#define fb_readw __raw_readw
|
||||
|
|
|
|||
|
|
@ -1337,7 +1337,7 @@ union perf_mem_data_src {
|
|||
#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
|
||||
#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
|
||||
/* 5-0x8 available */
|
||||
#define PERF_MEM_LVLNUM_EXTN_MEM 0x09 /* Extension memory */
|
||||
#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */
|
||||
#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */
|
||||
#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
|
||||
#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */
|
||||
|
|
|
|||
|
|
@ -9832,6 +9832,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
|
|||
|
||||
perf_sample_data_init(&data, 0, 0);
|
||||
data.raw = &raw;
|
||||
data.sample_flags |= PERF_SAMPLE_RAW;
|
||||
|
||||
perf_trace_buf_update(record, event_type);
|
||||
|
||||
|
|
|
|||
|
|
@ -547,6 +547,10 @@ static int calc_digits(int num)
|
|||
{
|
||||
int count = 0;
|
||||
|
||||
/* It takes a digit to represent zero */
|
||||
if (!num)
|
||||
return 1;
|
||||
|
||||
while (num != 0) {
|
||||
num /= 10;
|
||||
count++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user