Merge branch 'cm-11.0' into stable/cm-11.0
Conflicts: net/bluetooth/hci_conn.c Change-Id: I04be423e07ee329fe745779beaa2d67738d74597
This commit is contained in:
commit
c55a5d6fae
|
@ -0,0 +1,163 @@
|
|||
SECure COMPuting with filters
|
||||
=============================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
A large number of system calls are exposed to every userland process
|
||||
with many of them going unused for the entire lifetime of the process.
|
||||
As system calls change and mature, bugs are found and eradicated. A
|
||||
certain subset of userland applications benefit by having a reduced set
|
||||
of available system calls. The resulting set reduces the total kernel
|
||||
surface exposed to the application. System call filtering is meant for
|
||||
use with those applications.
|
||||
|
||||
Seccomp filtering provides a means for a process to specify a filter for
|
||||
incoming system calls. The filter is expressed as a Berkeley Packet
|
||||
Filter (BPF) program, as with socket filters, except that the data
|
||||
operated on is related to the system call being made: system call
|
||||
number and the system call arguments. This allows for expressive
|
||||
filtering of system calls using a filter program language with a long
|
||||
history of being exposed to userland and a straightforward data set.
|
||||
|
||||
Additionally, BPF makes it impossible for users of seccomp to fall prey
|
||||
to time-of-check-time-of-use (TOCTOU) attacks that are common in system
|
||||
call interposition frameworks. BPF programs may not dereference
|
||||
pointers which constrains all filters to solely evaluating the system
|
||||
call arguments directly.
|
||||
|
||||
What it isn't
|
||||
-------------
|
||||
|
||||
System call filtering isn't a sandbox. It provides a clearly defined
|
||||
mechanism for minimizing the exposed kernel surface. It is meant to be
|
||||
a tool for sandbox developers to use. Beyond that, policy for logical
|
||||
behavior and information flow should be managed with a combination of
|
||||
other system hardening techniques and, potentially, an LSM of your
|
||||
choosing. Expressive, dynamic filters provide further options down this
|
||||
path (avoiding pathological sizes or selecting which of the multiplexed
|
||||
system calls in socketcall() is allowed, for instance) which could be
|
||||
construed, incorrectly, as a more complete sandboxing solution.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
An additional seccomp mode is added and is enabled using the same
|
||||
prctl(2) call as the strict seccomp. If the architecture has
|
||||
CONFIG_HAVE_ARCH_SECCOMP_FILTER, then filters may be added as below:
|
||||
|
||||
PR_SET_SECCOMP:
|
||||
Now takes an additional argument which specifies a new filter
|
||||
using a BPF program.
|
||||
The BPF program will be executed over struct seccomp_data
|
||||
reflecting the system call number, arguments, and other
|
||||
metadata. The BPF program must then return one of the
|
||||
acceptable values to inform the kernel which action should be
|
||||
taken.
|
||||
|
||||
Usage:
|
||||
prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, prog);
|
||||
|
||||
The 'prog' argument is a pointer to a struct sock_fprog which
|
||||
will contain the filter program. If the program is invalid, the
|
||||
call will return -1 and set errno to EINVAL.
|
||||
|
||||
If fork/clone and execve are allowed by @prog, any child
|
||||
processes will be constrained to the same filters and system
|
||||
call ABI as the parent.
|
||||
|
||||
Prior to use, the task must call prctl(PR_SET_NO_NEW_PRIVS, 1) or
|
||||
run with CAP_SYS_ADMIN privileges in its namespace. If these are not
|
||||
true, -EACCES will be returned. This requirement ensures that filter
|
||||
programs cannot be applied to child processes with greater privileges
|
||||
than the task that installed them.
|
||||
|
||||
Additionally, if prctl(2) is allowed by the attached filter,
|
||||
additional filters may be layered on which will increase evaluation
|
||||
time, but allow for further decreasing the attack surface during
|
||||
execution of a process.
|
||||
|
||||
The above call returns 0 on success and non-zero on error.
|
||||
|
||||
Return values
|
||||
-------------
|
||||
A seccomp filter may return any of the following values. If multiple
|
||||
filters exist, the return value for the evaluation of a given system
|
||||
call will always use the highest precedent value. (For example,
|
||||
SECCOMP_RET_KILL will always take precedence.)
|
||||
|
||||
In precedence order, they are:
|
||||
|
||||
SECCOMP_RET_KILL:
|
||||
Results in the task exiting immediately without executing the
|
||||
system call. The exit status of the task (status & 0x7f) will
|
||||
be SIGSYS, not SIGKILL.
|
||||
|
||||
SECCOMP_RET_TRAP:
|
||||
Results in the kernel sending a SIGSYS signal to the triggering
|
||||
task without executing the system call. The kernel will
|
||||
rollback the register state to just before the system call
|
||||
entry such that a signal handler in the task will be able to
|
||||
inspect the ucontext_t->uc_mcontext registers and emulate
|
||||
system call success or failure upon return from the signal
|
||||
handler.
|
||||
|
||||
The SECCOMP_RET_DATA portion of the return value will be passed
|
||||
as si_errno.
|
||||
|
||||
SIGSYS triggered by seccomp will have a si_code of SYS_SECCOMP.
|
||||
|
||||
SECCOMP_RET_ERRNO:
|
||||
Results in the lower 16-bits of the return value being passed
|
||||
to userland as the errno without executing the system call.
|
||||
|
||||
SECCOMP_RET_TRACE:
|
||||
When returned, this value will cause the kernel to attempt to
|
||||
notify a ptrace()-based tracer prior to executing the system
|
||||
call. If there is no tracer present, -ENOSYS is returned to
|
||||
userland and the system call is not executed.
|
||||
|
||||
A tracer will be notified if it requests PTRACE_O_TRACESECCOMP
|
||||
using ptrace(PTRACE_SETOPTIONS). The tracer will be notified
|
||||
of a PTRACE_EVENT_SECCOMP and the SECCOMP_RET_DATA portion of
|
||||
the BPF program return value will be available to the tracer
|
||||
via PTRACE_GETEVENTMSG.
|
||||
|
||||
SECCOMP_RET_ALLOW:
|
||||
Results in the system call being executed.
|
||||
|
||||
If multiple filters exist, the return value for the evaluation of a
|
||||
given system call will always use the highest precedent value.
|
||||
|
||||
Precedence is only determined using the SECCOMP_RET_ACTION mask. When
|
||||
multiple filters return values of the same precedence, only the
|
||||
SECCOMP_RET_DATA from the most recently installed filter will be
|
||||
returned.
|
||||
|
||||
Pitfalls
|
||||
--------
|
||||
|
||||
The biggest pitfall to avoid during use is filtering on system call
|
||||
number without checking the architecture value. Why? On any
|
||||
architecture that supports multiple system call invocation conventions,
|
||||
the system call numbers may vary based on the specific invocation. If
|
||||
the numbers in the different calling conventions overlap, then checks in
|
||||
the filters may be abused. Always check the arch value!
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
The samples/seccomp/ directory contains both an x86-specific example
|
||||
and a more generic example of a higher level macro interface for BPF
|
||||
program generation.
|
||||
|
||||
|
||||
|
||||
Adding architecture support
|
||||
-----------------------
|
||||
|
||||
See arch/Kconfig for the authoritative requirements. In general, if an
|
||||
architecture supports both ptrace_event and seccomp, it will be able to
|
||||
support seccomp filter with minor fixup: SIGSYS support and seccomp return
|
||||
value checking. Then it must just add CONFIG_HAVE_ARCH_SECCOMP_FILTER
|
||||
to its arch-specific Kconfig.
|
|
@ -29,6 +29,9 @@ Rules on what kind of patches are accepted, and which ones are not, into the
|
|||
|
||||
Procedure for submitting patches to the -stable tree:
|
||||
|
||||
- If the patch covers files in net/ or drivers/net please follow netdev stable
|
||||
submission guidelines as described in
|
||||
Documentation/networking/netdev-FAQ.txt
|
||||
- Send the patch, after verifying that it follows the above rules, to
|
||||
stable@vger.kernel.org. You must note the upstream commit ID in the
|
||||
changelog of your submission, as well as the kernel version you wish
|
||||
|
|
10
MAINTAINERS
10
MAINTAINERS
|
@ -5948,6 +5948,16 @@ S: Maintained
|
|||
F: drivers/mmc/host/sdhci.*
|
||||
F: drivers/mmc/host/sdhci-pltfm.[ch]
|
||||
|
||||
SECURE COMPUTING
|
||||
M: Kees Cook <keescook@chromium.org>
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git seccomp
|
||||
S: Supported
|
||||
F: kernel/seccomp.c
|
||||
F: include/uapi/linux/seccomp.h
|
||||
F: include/linux/seccomp.h
|
||||
K: \bsecure_computing
|
||||
K: \bTIF_SECCOMP\b
|
||||
|
||||
SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
|
||||
M: Anton Vorontsov <avorontsov@ru.mvista.com>
|
||||
L: linuxppc-dev@lists.ozlabs.org
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
|||
VERSION = 3
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 103
|
||||
SUBLEVEL = 104
|
||||
EXTRAVERSION =
|
||||
NAME = Saber-toothed Squirrel
|
||||
|
||||
|
|
24
arch/Kconfig
24
arch/Kconfig
|
@ -222,4 +222,28 @@ config HAVE_CMPXCHG_DOUBLE
|
|||
config ARCH_WANT_OLD_COMPAT_IPC
|
||||
bool
|
||||
|
||||
config HAVE_ARCH_SECCOMP_FILTER
|
||||
bool
|
||||
help
|
||||
An arch should select this symbol if it provides all of these things:
|
||||
- syscall_get_arch()
|
||||
- syscall_get_arguments()
|
||||
- syscall_rollback()
|
||||
- syscall_set_return_value()
|
||||
- SIGSYS siginfo_t support
|
||||
- secure_computing is called from a ptrace_event()-safe context
|
||||
- secure_computing return value is checked and a return value of -1
|
||||
results in the system call being skipped immediately.
|
||||
- seccomp syscall wired up
|
||||
|
||||
config SECCOMP_FILTER
|
||||
def_bool y
|
||||
depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
|
||||
help
|
||||
Enable tasks to build secure computing environments defined
|
||||
in terms of Berkeley Packet Filter programs which implement
|
||||
task-defined system call filtering polices.
|
||||
|
||||
See Documentation/prctl/seccomp_filter.txt for details.
|
||||
|
||||
source "kernel/gcov/Kconfig"
|
||||
|
|
|
@ -489,6 +489,11 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
|
|||
}
|
||||
#endif
|
||||
|
||||
#define ioread16be(p) be16_to_cpu(ioread16(p))
|
||||
#define ioread32be(p) be32_to_cpu(ioread32(p))
|
||||
#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
|
||||
#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
|
||||
|
||||
#define inb_p inb
|
||||
#define inw_p inw
|
||||
#define inl_p inl
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/smp.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/special_insns.h>
|
||||
|
||||
#include "op_impl.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ config ARM
|
|||
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_GENERIC_HARDIRQS
|
||||
select HAVE_SPARSE_IRQ
|
||||
select HAVE_ARCH_SECCOMP_FILTER
|
||||
select GENERIC_IRQ_SHOW
|
||||
select CPU_PM if (SUSPEND || CPU_IDLE)
|
||||
select GENERIC_PCI_IOMAP
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Access to user system call parameters and results
|
||||
*
|
||||
* Copyright (C) 2012 The Chromium OS Authors <chromium-os-dev@chromium.org>
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU General Public License v.2.
|
||||
*
|
||||
* See asm-generic/syscall.h for descriptions of what we must do here.
|
||||
*/
|
||||
#ifndef _ASM_ARM_SYSCALL_H
|
||||
#define _ASM_ARM_SYSCALL_H
|
||||
|
||||
#include <linux/audit.h> /* for AUDIT_ARCH_* */
|
||||
#include <linux/elf.h> /* for ELF_EM */
|
||||
#include <linux/sched.h>
|
||||
#include <linux/thread_info.h> /* for task_thread_info */
|
||||
#include <linux/err.h>
|
||||
|
||||
static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
|
||||
{
|
||||
return task_thread_info(task)->syscall;
|
||||
}
|
||||
|
||||
static inline void syscall_rollback(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
regs->ARM_r0 = regs->ARM_ORIG_r0;
|
||||
}
|
||||
|
||||
static inline long syscall_get_error(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
unsigned long error = regs->ARM_r0;
|
||||
return IS_ERR_VALUE(error) ? error : 0;
|
||||
}
|
||||
|
||||
static inline long syscall_get_return_value(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
return regs->ARM_r0;
|
||||
}
|
||||
|
||||
static inline void syscall_set_return_value(struct task_struct *task,
|
||||
struct pt_regs *regs,
|
||||
int error, long val)
|
||||
{
|
||||
regs->ARM_r0 = (long) error ?: val;
|
||||
}
|
||||
|
||||
static inline void syscall_get_arguments(struct task_struct *task,
|
||||
struct pt_regs *regs,
|
||||
unsigned int i, unsigned int n,
|
||||
unsigned long *args)
|
||||
{
|
||||
BUG_ON(i + n > 6);
|
||||
memcpy(args, ®s->ARM_r0 + i, n * sizeof(args[0]));
|
||||
}
|
||||
|
||||
static inline void syscall_set_arguments(struct task_struct *task,
|
||||
struct pt_regs *regs,
|
||||
unsigned int i, unsigned int n,
|
||||
const unsigned long *args)
|
||||
{
|
||||
BUG_ON(i + n > 6);
|
||||
memcpy(®s->ARM_r0 + i, args, n * sizeof(args[0]));
|
||||
}
|
||||
|
||||
static inline int syscall_get_arch(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
/* ARM tasks don't change audit architectures on the fly. */
|
||||
#ifdef __ARMEB__
|
||||
return AUDIT_ARCH_ARMEB;
|
||||
#else
|
||||
return AUDIT_ARCH_ARM;
|
||||
#endif
|
||||
}
|
||||
#endif /* _ASM_ARM_SYSCALL_H */
|
|
@ -404,6 +404,7 @@
|
|||
#define __NR_setns (__NR_SYSCALL_BASE+375)
|
||||
#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
|
||||
#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
|
||||
#define __NR_seccomp (__NR_SYSCALL_BASE+383)
|
||||
|
||||
/*
|
||||
* The following SWIs are ARM private.
|
||||
|
|
|
@ -387,6 +387,12 @@
|
|||
/* 375 */ CALL(sys_setns)
|
||||
CALL(sys_process_vm_readv)
|
||||
CALL(sys_process_vm_writev)
|
||||
CALL(sys_ni_syscall)
|
||||
CALL(sys_ni_syscall)
|
||||
/* 380 */ CALL(sys_ni_syscall)
|
||||
CALL(sys_ni_syscall)
|
||||
CALL(sys_ni_syscall)
|
||||
CALL(sys_seccomp)
|
||||
#ifndef syscalls_counted
|
||||
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
|
||||
#define syscalls_counted
|
||||
|
|
|
@ -452,12 +452,7 @@ ENTRY(vector_swi)
|
|||
|
||||
#ifdef CONFIG_SECCOMP
|
||||
tst r10, #_TIF_SECCOMP
|
||||
beq 1f
|
||||
mov r0, scno
|
||||
bl __secure_computing
|
||||
add r0, sp, #S_R0 + S_OFF @ pointer to regs
|
||||
ldmia r0, {r0 - r3} @ have to reload r0 - r3
|
||||
1:
|
||||
bne __sys_trace
|
||||
#endif
|
||||
|
||||
tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls?
|
||||
|
|
|
@ -84,26 +84,21 @@
|
|||
#ifndef CONFIG_THUMB2_KERNEL
|
||||
.macro svc_exit, rpsr
|
||||
msr spsr_cxsf, \rpsr
|
||||
#if defined(CONFIG_CPU_V6)
|
||||
ldr r0, [sp]
|
||||
strex r1, r2, [sp] @ clear the exclusive monitor
|
||||
ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr
|
||||
#elif defined(CONFIG_CPU_32v6K)
|
||||
clrex @ clear the exclusive monitor
|
||||
ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
|
||||
#else
|
||||
ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K)
|
||||
@ We must avoid clrex due to Cortex-A15 erratum #830321
|
||||
sub r0, sp, #4 @ uninhabited address
|
||||
strex r1, r2, [r0] @ clear the exclusive monitor
|
||||
#endif
|
||||
ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
|
||||
.endm
|
||||
|
||||
.macro restore_user_regs, fast = 0, offset = 0
|
||||
ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
|
||||
ldr lr, [sp, #\offset + S_PC]! @ get pc
|
||||
msr spsr_cxsf, r1 @ save in spsr_svc
|
||||
#if defined(CONFIG_CPU_V6)
|
||||
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K)
|
||||
@ We must avoid clrex due to Cortex-A15 erratum #830321
|
||||
strex r1, r2, [sp] @ clear the exclusive monitor
|
||||
#elif defined(CONFIG_CPU_32v6K)
|
||||
clrex @ clear the exclusive monitor
|
||||
#endif
|
||||
.if \fast
|
||||
ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
|
||||
|
@ -131,7 +126,10 @@
|
|||
.macro svc_exit, rpsr
|
||||
ldr lr, [sp, #S_SP] @ top of the stack
|
||||
ldrd r0, r1, [sp, #S_LR] @ calling lr and pc
|
||||
clrex @ clear the exclusive monitor
|
||||
|
||||
@ We must avoid clrex due to Cortex-A15 erratum #830321
|
||||
strex r2, r1, [sp, #S_LR] @ clear the exclusive monitor
|
||||
|
||||
stmdb lr!, {r0, r1, \rpsr} @ calling lr and rfe context
|
||||
ldmia sp, {r0 - r12}
|
||||
mov sp, lr
|
||||
|
@ -140,13 +138,16 @@
|
|||
.endm
|
||||
|
||||
.macro restore_user_regs, fast = 0, offset = 0
|
||||
clrex @ clear the exclusive monitor
|
||||
mov r2, sp
|
||||
load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr
|
||||
ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
|
||||
ldr lr, [sp, #\offset + S_PC] @ get pc
|
||||
add sp, sp, #\offset + S_SP
|
||||
msr spsr_cxsf, r1 @ save in spsr_svc
|
||||
|
||||
@ We must avoid clrex due to Cortex-A15 erratum #830321
|
||||
strex r1, r2, [sp] @ clear the exclusive monitor
|
||||
|
||||
.if \fast
|
||||
ldmdb sp, {r1 - r12} @ get calling r1 - r12
|
||||
.else
|
||||
|
|
|
@ -910,12 +910,16 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
||||
{
|
||||
unsigned long ip;
|
||||
current_thread_info()->syscall = scno;
|
||||
|
||||
if (why)
|
||||
audit_syscall_exit(regs);
|
||||
else
|
||||
else {
|
||||
if (secure_computing(scno) == -1)
|
||||
return -1;
|
||||
audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
|
||||
regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
|
||||
}
|
||||
|
||||
if (why == 0 && test_and_clear_thread_flag(TIF_SYSCALL_RESTARTSYS))
|
||||
scno = __NR_restart_syscall - __NR_SYSCALL_BASE;
|
||||
|
@ -924,7 +928,12 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
|||
if (!(current->ptrace & PT_PTRACED))
|
||||
return scno;
|
||||
|
||||
current_thread_info()->syscall = scno;
|
||||
/*
|
||||
* IP is used to denote syscall entry/exit:
|
||||
* IP = 0 -> entry, =1 -> exit
|
||||
*/
|
||||
ip = regs->ARM_ip;
|
||||
regs->ARM_ip = why;
|
||||
|
||||
/*
|
||||
* IP is used to denote syscall entry/exit:
|
||||
|
|
|
@ -554,6 +554,10 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
|
|||
struct thread_info *thread = current_thread_info();
|
||||
siginfo_t info;
|
||||
|
||||
/* Emulate/fallthrough. */
|
||||
if (no == -1)
|
||||
return regs->ARM_r0;
|
||||
|
||||
if ((no >> 16) != (__ARM_NR_BASE>> 16))
|
||||
return bad_syscall(no, regs);
|
||||
|
||||
|
|
|
@ -2570,7 +2570,7 @@ static ssize_t show_waketime(struct device *dev,
|
|||
if (!bamDmux_pkt_dev)
|
||||
return 0;
|
||||
|
||||
return snprintf(buf, sizeof(buf), "%u\n", wakelock_timeout);
|
||||
return snprintf(buf, (int)sizeof(buf), "%u\n", wakelock_timeout);
|
||||
}
|
||||
|
||||
static ssize_t store_waketime(struct device *dev,
|
||||
|
|
|
@ -81,7 +81,11 @@ static struct gpiomux_setting cam_settings[] = {
|
|||
|
||||
{
|
||||
.func = GPIOMUX_FUNC_1, /*active 1*/
|
||||
#if defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
.drv = GPIOMUX_DRV_4MA,
|
||||
#else
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
#endif
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
.dir = GPIOMUX_OUT_LOW,
|
||||
},
|
||||
|
@ -89,7 +93,11 @@ static struct gpiomux_setting cam_settings[] = {
|
|||
{
|
||||
.func = GPIOMUX_FUNC_GPIO, /*active 2*/
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
#else
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
#endif
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -145,7 +153,11 @@ static struct gpiomux_setting cam_settings[] = {
|
|||
},
|
||||
{
|
||||
.func = GPIOMUX_FUNC_4, /*active 12*/
|
||||
#if defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
.drv = GPIOMUX_DRV_4MA,
|
||||
#else
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
#endif
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
.dir = GPIOMUX_OUT_LOW,
|
||||
},
|
||||
|
|
|
@ -387,6 +387,9 @@ static bool oled_power_on;
|
|||
/* [junesok] Power on for samsung oled */
|
||||
#if defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
#define LCD_22V_EN 33
|
||||
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
#define LCD_22V_EN_2 20
|
||||
#endif
|
||||
#define PMIC_GPIO_LED_DRIVER 31
|
||||
#elif defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
#define LCD_22V_EN 33
|
||||
|
@ -556,6 +559,21 @@ static int mipi_dsi_power_tft_request(void)
|
|||
pr_info("[lcd] configure LCD_22V_EN\n");
|
||||
gpio_tlmm_config(GPIO_CFG(LCD_22V_EN, 0, GPIO_CFG_OUTPUT,
|
||||
GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
|
||||
|
||||
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
if( system_rev >= 16 ) // rev0.6 + 10
|
||||
{
|
||||
pr_info("[lcd] request gpio lcd_22v_en_2\n");
|
||||
rc = gpio_request(LCD_22V_EN_2, "lcd_22v_en_2");
|
||||
if (rc) {
|
||||
pr_err("request gpio lcd_22v_en_2 failed, rc=%d\n", rc);
|
||||
return -ENODEV;
|
||||
}
|
||||
pr_info("[lcd] configure LCD_22V_EN_2\n");
|
||||
gpio_tlmm_config(GPIO_CFG(LCD_22V_EN_2, 0, GPIO_CFG_OUTPUT,
|
||||
GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (system_rev == 0) {
|
||||
|
@ -595,6 +613,7 @@ static int mipi_dsi_power_tft_request(void)
|
|||
pr_err("gpio_config led_dirver failed (3), rc=%d\n", rc);
|
||||
return -EINVAL;
|
||||
}
|
||||
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
if(system_rev < 10)
|
||||
gpio_direction_output(gpio33, 0);
|
||||
|
@ -611,15 +630,26 @@ static int mipi_dsi_power_tft_request(void)
|
|||
&MLCD_RESET_LOW_CONFIG);
|
||||
|
||||
msleep(1000);
|
||||
|
||||
#endif
|
||||
gpio_direction_output(gpio27, 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
static int first_boot = 0;
|
||||
#endif
|
||||
|
||||
static int mipi_panel_power_tft(int enable)
|
||||
{
|
||||
int rc = 0;
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
if(first_boot < 2) {
|
||||
first_boot++;
|
||||
printk("<0> First init Occurred ..... Finished Successfully \n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
pr_info("%s %d", __func__, enable);
|
||||
if (enable) {
|
||||
|
@ -667,8 +697,16 @@ static int mipi_panel_power_tft(int enable)
|
|||
gpio_direction_output(LCD_22V_EN, 1);
|
||||
#else
|
||||
gpio_direction_output(LCD_22V_EN, 1);
|
||||
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
if( system_rev >= 16 ) // rev0.6 + 10
|
||||
{
|
||||
mdelay(10);
|
||||
gpio_direction_output(LCD_22V_EN_2, 1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
/*active_reset_ldi(gpio43);*/
|
||||
if (system_rev == 0)
|
||||
gpio_direction_output(gpio43, 1);
|
||||
|
@ -677,8 +715,9 @@ static int mipi_panel_power_tft(int enable)
|
|||
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
|
||||
&MLCD_RESET_HIGH_CONFIG);
|
||||
|
||||
msleep(20);
|
||||
|
||||
msleep(20);
|
||||
#endif
|
||||
#if defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
if( system_rev >= 15 ) // rev0.5 + 10
|
||||
{
|
||||
|
@ -726,6 +765,13 @@ static int mipi_panel_power_tft(int enable)
|
|||
else
|
||||
gpio_direction_output(LCD_22V_EN, 0);
|
||||
#else
|
||||
#if defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
if( system_rev >= 16 ) // rev0.6 + 10
|
||||
{
|
||||
gpio_direction_output(LCD_22V_EN_2, 0);
|
||||
mdelay(10);
|
||||
}
|
||||
#endif
|
||||
gpio_direction_output(LCD_22V_EN, 0);
|
||||
#endif
|
||||
usleep(2000); /*1ms delay(minimum) required between VDD off and AVDD off*/
|
||||
|
|
|
@ -735,6 +735,21 @@ sec_battery_platform_data_t sec_battery_pdata = {
|
|||
.temp_high_recovery_lpm = 430,
|
||||
.temp_low_threshold_lpm = -30,
|
||||
.temp_low_recovery_lpm = 0,
|
||||
#elif defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
.temp_high_threshold_event = 600,
|
||||
.temp_high_recovery_event = 400,
|
||||
.temp_low_threshold_event = -50,
|
||||
.temp_low_recovery_event = 0,
|
||||
|
||||
.temp_high_threshold_normal = 600,
|
||||
.temp_high_recovery_normal = 400,
|
||||
.temp_low_threshold_normal = -50,
|
||||
.temp_low_recovery_normal = 0,
|
||||
|
||||
.temp_high_threshold_lpm = 600,
|
||||
.temp_high_recovery_lpm = 400,
|
||||
.temp_low_threshold_lpm = -50,
|
||||
.temp_low_recovery_lpm = 0,
|
||||
#elif defined(CONFIG_MACH_JF_CRI)
|
||||
.temp_high_threshold_event = 600,
|
||||
.temp_high_recovery_event = 450,
|
||||
|
|
|
@ -27,14 +27,12 @@
|
|||
#include "board-8064.h"
|
||||
#include <mach/apq8064-gpio.h>
|
||||
|
||||
#if 0
|
||||
/* The SPI configurations apply to GSBI 5*/
|
||||
static struct gpiomux_setting gpio_spi_config = {
|
||||
.func = GPIOMUX_FUNC_2,
|
||||
.drv = GPIOMUX_DRV_12MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
|
||||
static struct gpiomux_setting gpio_eth_config = {
|
||||
|
@ -336,6 +334,13 @@ struct msm_gpiomux_config vcap_configs[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
static struct gpiomux_setting gpio_nc_config = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
|
||||
/*
|
||||
static struct gpiomux_setting gpio_i2c_config = {
|
||||
.func = GPIOMUX_FUNC_1,
|
||||
.drv = GPIOMUX_DRV_8MA,
|
||||
|
@ -347,6 +352,7 @@ static struct gpiomux_setting gpio_i2c_config_sus = {
|
|||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_KEEPER,
|
||||
};
|
||||
*/
|
||||
|
||||
static struct gpiomux_setting mbhc_hs_detect = {
|
||||
.func = GPIOMUX_FUNC_1,
|
||||
|
@ -517,13 +523,6 @@ static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
|
|||
[GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
|
||||
},
|
||||
},
|
||||
{ /* TS SLEEP */
|
||||
.gpio = 33,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
|
||||
},
|
||||
},
|
||||
};
|
||||
static struct msm_gpiomux_config cyts_gpio_alt_config[] __initdata = {
|
||||
{ /* TS INTERRUPT */
|
||||
|
@ -741,20 +740,6 @@ static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
|
|||
[GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 21, /* GSBI1 QUP I2C_CLK */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
|
||||
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 20, /* GSBI1 QUP I2C_DATA */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
|
||||
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 24, /* GSBI2 I2C QUP SDA */
|
||||
.settings = {
|
||||
|
@ -772,29 +757,29 @@ static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
|
|||
{
|
||||
.gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 53, /* Funny CS0 */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 54, /* GSBI5 QUP SPI_CLK */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
#if !defined(CONFIG_USB_EHCI_MSM_HSIC)
|
||||
|
@ -819,6 +804,50 @@ static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_nc_configs[] __initdata = {
|
||||
{
|
||||
.gpio = 20,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 21,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 29,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_nc_configs_rev05[] __initdata = {
|
||||
#if !defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
{
|
||||
.gpio = 20,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.gpio = 21,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 29,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_nc_config,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
|
||||
{
|
||||
.gpio = 40, /* slimbus clk */
|
||||
|
@ -1478,7 +1507,7 @@ static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
|
|||
static struct gpiomux_setting sd_det_line = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_UP,
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
.dir = GPIOMUX_IN,
|
||||
};
|
||||
|
||||
|
@ -1492,6 +1521,25 @@ static struct msm_gpiomux_config msm8064_sd_det_config[] = {
|
|||
},
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
|
||||
|
||||
static struct gpiomux_setting ls_en_suspended_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
.dir = GPIOMUX_OUT_LOW,
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config msm8064_ls_en_config[] = {
|
||||
{
|
||||
.gpio = 64, /* Level Shifter Enable */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &ls_en_suspended_cfg,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LEDS_AN30259A)
|
||||
static struct gpiomux_setting leds_active_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
|
@ -1745,6 +1793,9 @@ void __init apq8064_init_gpiomux(void)
|
|||
else
|
||||
msm_gpiomux_install(sdc2_interface,
|
||||
ARRAY_SIZE(sdc2_interface));
|
||||
|
||||
msm_gpiomux_install(msm8064_ls_en_config,
|
||||
ARRAY_SIZE(msm8064_ls_en_config));
|
||||
#else
|
||||
msm_gpiomux_install(wcnss_5wire_interface,
|
||||
ARRAY_SIZE(wcnss_5wire_interface));
|
||||
|
@ -1769,6 +1820,17 @@ void __init apq8064_init_gpiomux(void)
|
|||
msm_gpiomux_install(apq8064_gsbi_configs,
|
||||
ARRAY_SIZE(apq8064_gsbi_configs));
|
||||
}
|
||||
|
||||
if( system_rev >= 13 ) // rev0.5 + 8
|
||||
{
|
||||
msm_gpiomux_install(apq8064_nc_configs_rev05,
|
||||
ARRAY_SIZE(apq8064_nc_configs_rev05));
|
||||
}
|
||||
else
|
||||
{
|
||||
msm_gpiomux_install(apq8064_nc_configs,
|
||||
ARRAY_SIZE(apq8064_nc_configs));
|
||||
}
|
||||
|
||||
msm_gpiomux_install(sensorhub_configs,
|
||||
ARRAY_SIZE(sensorhub_configs));
|
||||
|
|
|
@ -1009,23 +1009,8 @@ static void __init reserve_ion_memory(void)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_ANDROID_RAM_CONSOLE
|
||||
static char bootreason[128] = {0,};
|
||||
int __init device_boot_reason(char *s)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (*s == '=')
|
||||
s++;
|
||||
n = snprintf(bootreason, sizeof(bootreason),
|
||||
"Boot info:\n"
|
||||
"Last boot reason: %s\n", s);
|
||||
bootreason[n] = '\0';
|
||||
return 1;
|
||||
}
|
||||
__setup("bootreason", device_boot_reason);
|
||||
|
||||
static struct ram_console_platform_data ram_console_pdata = {
|
||||
.bootinfo = bootreason,
|
||||
.bootinfo = NULL,
|
||||
};
|
||||
|
||||
static struct platform_device ram_console_device = {
|
||||
|
@ -1239,6 +1224,7 @@ static void __init apq8064_reserve(void)
|
|||
static void __init apq8064_early_reserve(void)
|
||||
{
|
||||
reserve_info = &apq8064_reserve_info;
|
||||
|
||||
}
|
||||
#ifdef CONFIG_USB_EHCI_MSM_HSIC
|
||||
/* Bandwidth requests (zero) if no vote placed */
|
||||
|
@ -3460,6 +3446,7 @@ static uint8_t spm_power_collapse_with_rpm_krait_v3[] __initdata = {
|
|||
0x24, 0x30, 0x0f,
|
||||
};
|
||||
|
||||
|
||||
static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = {
|
||||
[0] = {
|
||||
.mode = MSM_SPM_MODE_CLOCK_GATING,
|
||||
|
@ -4009,8 +3996,9 @@ static struct platform_device *common_devices[] __initdata = {
|
|||
&apq8064_device_hsusb_host,
|
||||
&android_usb_device,
|
||||
&msm_device_wcnss_wlan,
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
&apq8064_device_qup_spi_gsbi5,
|
||||
&apq8064_device_qup_spi_gsbi5, // Fortius AF
|
||||
#if 0
|
||||
&msm8930_device_qup_spi_gsbi1,
|
||||
#endif
|
||||
&msm_device_iris_fm,
|
||||
&apq8064_fmem_device,
|
||||
|
@ -4164,6 +4152,7 @@ static struct platform_device *cdp_devices[] __initdata = {
|
|||
#ifdef CONFIG_MSM_ROTATOR
|
||||
&msm_rotator_device,
|
||||
#endif
|
||||
&msm8064_pc_cntr,
|
||||
&msm8064_cpu_slp_status,
|
||||
&sec_device_jack,
|
||||
#ifdef CONFIG_SENSORS_SSP_C12SD
|
||||
|
@ -5066,7 +5055,6 @@ static void __init register_i2c_devices(void)
|
|||
apq8064_camera_board_info.board_info,
|
||||
apq8064_camera_board_info.num_i2c_board_info,
|
||||
};
|
||||
|
||||
struct i2c_registry apq8064_front_camera_i2c_devices = {
|
||||
I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
|
||||
APQ_8064_GSBI7_QUP_I2C_BUS_ID,
|
||||
|
@ -5114,6 +5102,7 @@ static void __init register_i2c_devices(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void enable_avc_i2c_bus(void)
|
||||
{
|
||||
int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
|
||||
|
@ -5318,12 +5307,11 @@ static void __init apq8064_common_init(void)
|
|||
if (cpu_is_apq8064ab())
|
||||
apq8064ab_update_krait_spm();
|
||||
if (cpu_is_krait_v3()) {
|
||||
struct msm_pm_init_data_type *pdata =
|
||||
msm8064_pm_8x60.dev.platform_data;
|
||||
pdata->retention_calls_tz = false;
|
||||
msm_pm_set_tz_retention_flag(0);
|
||||
apq8064ab_update_retention_spm();
|
||||
} else {
|
||||
msm_pm_set_tz_retention_flag(1);
|
||||
}
|
||||
platform_device_register(&msm8064_pm_8x60);
|
||||
msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
|
||||
msm_spm_l2_init(msm_spm_l2_data);
|
||||
msm_tsens_early_init(&apq_tsens_pdata);
|
||||
|
@ -5381,13 +5369,8 @@ static void __init apq8064_common_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
rpmrs_level =
|
||||
msm_rpmrs_levels[MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT];
|
||||
msm_hsic_pdata.swfi_latency = rpmrs_level.latency_us;
|
||||
rpmrs_level =
|
||||
msm_rpmrs_levels[MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE];
|
||||
msm_hsic_pdata.standalone_latency = rpmrs_level.latency_us;
|
||||
|
||||
msm_hsic_pdata.swfi_latency =
|
||||
msm_rpmrs_levels[0].latency_us;
|
||||
if (machine_is_apq8064_mtp() || machine_is_JF()) {
|
||||
msm_hsic_pdata.log2_irq_thresh = 5,
|
||||
apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
|
||||
|
@ -5573,17 +5556,6 @@ static void __init samsung_jf_init(void)
|
|||
#if defined(CONFIG_BATTERY_SAMSUNG)
|
||||
msm8960_init_battery();
|
||||
#endif
|
||||
|
||||
if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) {
|
||||
#ifdef CONFIG_SERIAL_MSM_HS
|
||||
/* GSBI6(2) - UARTDM_RX */
|
||||
mpq8064_gsbi6_uartdm_pdata.wakeup_irq = gpio_to_irq(15);
|
||||
mpq8064_device_uartdm_gsbi6.dev.platform_data =
|
||||
&mpq8064_gsbi6_uartdm_pdata;
|
||||
#endif
|
||||
platform_device_register(&mpq8064_device_uartdm_gsbi6);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SENSORS_SSP
|
||||
clear_ssp_gpio();
|
||||
sensor_power_on_vdd(SNS_PWR_ON, SNS_PWR_ON);
|
||||
|
|
|
@ -27,14 +27,76 @@
|
|||
#include "board-8064.h"
|
||||
#include <mach/apq8064-gpio.h>
|
||||
|
||||
#if 0
|
||||
|
||||
/* The SPI configurations apply to GSBI 5*/
|
||||
static struct gpiomux_setting gpio_spi_config = {
|
||||
.func = GPIOMUX_FUNC_2,
|
||||
.drv = GPIOMUX_DRV_12MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
|
||||
static struct gpiomux_setting nc_init_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
.dir = GPIOMUX_IN,
|
||||
};
|
||||
static struct gpiomux_setting nc_sleep_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
.dir = GPIOMUX_IN,
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_nc_config[] __initdata = {
|
||||
{
|
||||
.gpio = 20,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 21,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 29,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_nc_config_rev06[] __initdata = {
|
||||
#if !defined(CONFIG_FB_MSM_ENABLE_LCD_EN2)
|
||||
{
|
||||
.gpio = 20,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.gpio = 21,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 29,
|
||||
.settings = {
|
||||
[GPIOMUX_ACTIVE] = &nc_init_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &nc_sleep_cfg,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
|
||||
static struct gpiomux_setting gpio_eth_config = {
|
||||
|
@ -144,13 +206,7 @@ static struct gpiomux_setting gpio_vcap_config[] = {
|
|||
};
|
||||
|
||||
struct msm_gpiomux_config vcap_configs[] = {
|
||||
{
|
||||
.gpio = 20,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
|
||||
[GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
.gpio = 25,
|
||||
.settings = {
|
||||
|
@ -418,9 +474,9 @@ static struct gpiomux_setting gsbi7_func2_cfg = {
|
|||
};
|
||||
|
||||
static struct gpiomux_setting gsbi3_suspended_cfg = {
|
||||
.func = GPIOMUX_FUNC_1,
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_KEEPER,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
|
||||
static struct gpiomux_setting gsbi3_active_cfg = {
|
||||
|
@ -697,13 +753,7 @@ static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
|
|||
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 20, /* GSBI1 QUP I2C_DATA */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
|
||||
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
.gpio = 24, /* GSBI2 I2C QUP SDA */
|
||||
.settings = {
|
||||
|
@ -721,29 +771,29 @@ static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
|
|||
{
|
||||
.gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 53, /* Funny CS0 */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
{
|
||||
.gpio = 54, /* GSBI5 QUP SPI_CLK */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
|
||||
[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
|
||||
[GPIOMUX_SUSPENDED] = &gpio_spi_config,
|
||||
[GPIOMUX_ACTIVE] = &gpio_spi_config,
|
||||
},
|
||||
},
|
||||
#if !defined(CONFIG_USB_EHCI_MSM_HSIC)
|
||||
|
@ -1301,7 +1351,7 @@ static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
|
|||
static struct gpiomux_setting sd_det_line = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_UP,
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
.dir = GPIOMUX_IN,
|
||||
};
|
||||
|
||||
|
@ -1345,6 +1395,29 @@ static struct msm_gpiomux_config apq8064_leds_configs[] __initdata = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI
|
||||
static struct gpiomux_setting touch_irq_init_state = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
|
||||
static struct gpiomux_setting touch_irq_sleep_state = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_touch_irq_config[] = {
|
||||
{
|
||||
.gpio = 67, /* touch_irq__config */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &touch_irq_sleep_state,
|
||||
[GPIOMUX_ACTIVE] = &touch_irq_init_state,
|
||||
},
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_MFD_MAX77693
|
||||
static struct gpiomux_setting muic_init_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
|
@ -1370,6 +1443,56 @@ static struct msm_gpiomux_config apq8064_muic_config[] __initdata = {
|
|||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SAMSUNG_JACK
|
||||
static struct gpiomux_setting apq8064_sec_jack_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_NONE,
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_sec_jack_configs[] __initdata = {
|
||||
{
|
||||
.gpio = 81,
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &apq8064_sec_jack_cfg,
|
||||
[GPIOMUX_ACTIVE] = &apq8064_sec_jack_cfg,
|
||||
},
|
||||
},
|
||||
};
|
||||
#endif
|
||||
static struct gpiomux_setting auxpcm_sleep_cfg = {
|
||||
.func = GPIOMUX_FUNC_GPIO,
|
||||
.drv = GPIOMUX_DRV_2MA,
|
||||
.pull = GPIOMUX_PULL_DOWN,
|
||||
.dir = GPIOMUX_IN,
|
||||
};
|
||||
|
||||
static struct msm_gpiomux_config apq8064_auxpcm_configs[] __initdata = {
|
||||
{
|
||||
.gpio = 43, /* AUX_PCM_DOUT */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &auxpcm_sleep_cfg,
|
||||
}
|
||||
},
|
||||
{
|
||||
.gpio = 44, /* AUX_PCM_DIN */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &auxpcm_sleep_cfg,
|
||||
}
|
||||
},
|
||||
{
|
||||
.gpio = 45, /* AUX_PCM_SYNC */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &auxpcm_sleep_cfg,
|
||||
}
|
||||
},
|
||||
{
|
||||
.gpio = 46, /* AUX_PCM_CLK */
|
||||
.settings = {
|
||||
[GPIOMUX_SUSPENDED] = &auxpcm_sleep_cfg,
|
||||
}
|
||||
},
|
||||
};
|
||||
void __init apq8064_init_gpiomux(void)
|
||||
{
|
||||
int rc;
|
||||
|
@ -1430,6 +1553,9 @@ void __init apq8064_init_gpiomux(void)
|
|||
pr_debug("%s(): audio-auxpcm: Include GPIO configs"
|
||||
" as audio is not the primary user"
|
||||
" for these GPIO Pins\n", __func__);
|
||||
|
||||
msm_gpiomux_install(apq8064_auxpcm_configs,
|
||||
ARRAY_SIZE(apq8064_auxpcm_configs));
|
||||
|
||||
if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
|
||||
machine_is_mpq8064_dtv())
|
||||
|
@ -1474,8 +1600,29 @@ void __init apq8064_init_gpiomux(void)
|
|||
msm_gpiomux_install(apq8064_leds_configs,
|
||||
ARRAY_SIZE(apq8064_leds_configs));
|
||||
#endif
|
||||
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI
|
||||
printk(KERN_INFO "%s: config touch_irq config.\n",__func__);
|
||||
msm_gpiomux_install(apq8064_touch_irq_config,
|
||||
ARRAY_SIZE(apq8064_touch_irq_config));
|
||||
#endif
|
||||
#ifdef CONFIG_MFD_MAX77693
|
||||
msm_gpiomux_install(apq8064_muic_config,
|
||||
ARRAY_SIZE(apq8064_muic_config));
|
||||
#endif
|
||||
#if defined (CONFIG_MACH_JACTIVE_EUR)
|
||||
if( system_rev >= 16 ) // rev0.6 + 10
|
||||
{
|
||||
msm_gpiomux_install(apq8064_nc_config_rev06,
|
||||
ARRAY_SIZE(apq8064_nc_config_rev06));
|
||||
}
|
||||
else
|
||||
{
|
||||
msm_gpiomux_install(apq8064_nc_config,
|
||||
ARRAY_SIZE(apq8064_nc_config));
|
||||
}
|
||||
#ifdef CONFIG_SAMSUNG_JACK
|
||||
msm_gpiomux_install(apq8064_sec_jack_configs,
|
||||
ARRAY_SIZE(apq8064_sec_jack_configs));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -3312,6 +3312,11 @@ static uint8_t spm_power_collapse_without_rpm[] __initdata = {
|
|||
0x24, 0x30, 0x0f,
|
||||
};
|
||||
|
||||
static uint8_t spm_retention_cmd_sequence[] __initdata = {
|
||||
0x00, 0x05, 0x03, 0x0D,
|
||||
0x0B, 0x00, 0x0f,
|
||||
};
|
||||
|
||||
static uint8_t spm_retention_with_krait_v3_cmd_sequence[] __initdata = {
|
||||
0x42, 0x1B, 0x00,
|
||||
0x05, 0x03, 0x0D, 0x0B,
|
||||
|
|
|
@ -195,6 +195,9 @@ static struct synaptics_rmi4_platform_data rmi4_platformdata = {
|
|||
#ifdef CONFIG_FB_MSM_MIPI_SAMSUNG_OCTA_VIDEO_FULL_HD_PT_PANEL
|
||||
.tout1_on = touch_tout1_on,
|
||||
#endif
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
.hsync_onoff = lcd_hsync_onoff,
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct i2c_board_info bus2_i2c_devices[] = {
|
||||
|
|
|
@ -17,12 +17,6 @@
|
|||
*/
|
||||
.align 5
|
||||
ENTRY(v6_early_abort)
|
||||
#ifdef CONFIG_CPU_V6
|
||||
sub r1, sp, #4 @ Get unused stack location
|
||||
strex r0, r1, [r1] @ Clear the exclusive monitor
|
||||
#elif defined(CONFIG_CPU_32v6K)
|
||||
clrex
|
||||
#endif
|
||||
mrc p15, 0, r1, c5, c0, 0 @ get FSR
|
||||
mrc p15, 0, r0, c6, c0, 0 @ get FAR
|
||||
/*
|
||||
|
|
|
@ -13,12 +13,6 @@
|
|||
*/
|
||||
.align 5
|
||||
ENTRY(v7_early_abort)
|
||||
/*
|
||||
* The effect of data aborts on on the exclusive access monitor are
|
||||
* UNPREDICTABLE. Do a CLREX to clear the state
|
||||
*/
|
||||
clrex
|
||||
|
||||
mrc p15, 0, r1, c5, c0, 0 @ get FSR
|
||||
mrc p15, 0, r0, c6, c0, 0 @ get FAR
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|||
{
|
||||
long ret = 0;
|
||||
|
||||
secure_computing(regs->r12);
|
||||
secure_computing_strict(regs->r12);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
|
||||
tracehook_report_syscall_entry(regs))
|
||||
|
|
|
@ -265,6 +265,18 @@ static irqreturn_t octeon_rlm_interrupt(int cpl, void *dev_id)
|
|||
}
|
||||
#endif
|
||||
|
||||
static char __read_mostly octeon_system_type[80];
|
||||
|
||||
static int __init init_octeon_system_type(void)
|
||||
{
|
||||
snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
|
||||
cvmx_board_type_to_string(octeon_bootinfo->board_type),
|
||||
octeon_model_get_string(read_c0_prid()));
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_initcall(init_octeon_system_type);
|
||||
|
||||
/**
|
||||
* Return a string representing the system type
|
||||
*
|
||||
|
@ -272,11 +284,7 @@ static irqreturn_t octeon_rlm_interrupt(int cpl, void *dev_id)
|
|||
*/
|
||||
const char *octeon_board_type_string(void)
|
||||
{
|
||||
static char name[80];
|
||||
sprintf(name, "%s (%s)",
|
||||
cvmx_board_type_to_string(octeon_bootinfo->board_type),
|
||||
octeon_model_get_string(read_c0_prid()));
|
||||
return name;
|
||||
return octeon_system_type;
|
||||
}
|
||||
|
||||
const char *get_system_type(void)
|
||||
|
|
|
@ -162,11 +162,6 @@ static unsigned int counters_total_to_per_cpu(unsigned int counters)
|
|||
return counters >> vpe_shift();
|
||||
}
|
||||
|
||||
static unsigned int counters_per_cpu_to_total(unsigned int counters)
|
||||
{
|
||||
return counters << vpe_shift();
|
||||
}
|
||||
|
||||
#else /* !CONFIG_MIPS_MT_SMP */
|
||||
#define vpe_id() 0
|
||||
|
||||
|
|
|
@ -535,7 +535,7 @@ static inline int audit_arch(void)
|
|||
asmlinkage void syscall_trace_enter(struct pt_regs *regs)
|
||||
{
|
||||
/* do the secure computing check first */
|
||||
secure_computing(regs->regs[2]);
|
||||
secure_computing_strict(regs->regs[2]);
|
||||
|
||||
if (!(current->ptrace & PT_PTRACED))
|
||||
goto out;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/highmem.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/mm.h>
|
||||
|
@ -598,6 +599,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
|||
/* Catch bad driver code */
|
||||
BUG_ON(size == 0);
|
||||
|
||||
preempt_disable();
|
||||
if (cpu_has_inclusive_pcaches) {
|
||||
if (size >= scache_size)
|
||||
r4k_blast_scache();
|
||||
|
@ -618,6 +620,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
|||
R4600_HIT_CACHEOP_WAR_IMPL;
|
||||
blast_dcache_range(addr, addr + size);
|
||||
}
|
||||
preempt_enable();
|
||||
|
||||
bc_wback_inv(addr, size);
|
||||
__sync();
|
||||
|
@ -628,6 +631,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
|
|||
/* Catch bad driver code */
|
||||
BUG_ON(size == 0);
|
||||
|
||||
preempt_disable();
|
||||
if (cpu_has_inclusive_pcaches) {
|
||||
if (size >= scache_size)
|
||||
r4k_blast_scache();
|
||||
|
@ -663,6 +667,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
|
|||
cache_op(Hit_Writeback_Inv_D, (addr + size - 1) & almask);
|
||||
blast_inv_dcache_range(addr, addr + size);
|
||||
}
|
||||
preempt_enable();
|
||||
|
||||
bc_inv(addr, size);
|
||||
__sync();
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/threads.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/serial_reg.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/mmu.h>
|
||||
|
|
|
@ -1710,7 +1710,7 @@ long do_syscall_trace_enter(struct pt_regs *regs)
|
|||
{
|
||||
long ret = 0;
|
||||
|
||||
secure_computing(regs->gpr[0]);
|
||||
secure_computing_strict(regs->gpr[0]);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
|
||||
tracehook_report_syscall_entry(regs))
|
||||
|
|
|
@ -724,7 +724,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|||
long ret = 0;
|
||||
|
||||
/* Do the secure computing check first. */
|
||||
secure_computing(regs->gprs[2]);
|
||||
secure_computing_strict(regs->gprs[2]);
|
||||
|
||||
/*
|
||||
* The sysc_tracesys code in entry.S stored the system
|
||||
|
|
|
@ -503,7 +503,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
|
|||
{
|
||||
long ret = 0;
|
||||
|
||||
secure_computing(regs->regs[0]);
|
||||
secure_computing_strict(regs->regs[0]);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
|
||||
tracehook_report_syscall_entry(regs))
|
||||
|
|
|
@ -522,7 +522,7 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
|
|||
{
|
||||
long long ret = 0;
|
||||
|
||||
secure_computing(regs->regs[9]);
|
||||
secure_computing_strict(regs->regs[9]);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
|
||||
tracehook_report_syscall_entry(regs))
|
||||
|
|
|
@ -1062,7 +1062,7 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
|
|||
int ret = 0;
|
||||
|
||||
/* do the secure computing check first */
|
||||
secure_computing(regs->u_regs[UREG_G1]);
|
||||
secure_computing_strict(regs->u_regs[UREG_G1]);
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE))
|
||||
ret = tracehook_report_syscall_entry(regs);
|
||||
|
|
|
@ -6,6 +6,7 @@ config UNICORE32
|
|||
select HAVE_DMA_ATTRS
|
||||
select HAVE_KERNEL_GZIP
|
||||
select HAVE_KERNEL_BZIP2
|
||||
select GENERIC_ATOMIC64
|
||||
select HAVE_KERNEL_LZO
|
||||
select HAVE_KERNEL_LZMA
|
||||
select GENERIC_FIND_FIRST_BIT
|
||||
|
|
|
@ -19,9 +19,4 @@ extern void die(const char *msg, struct pt_regs *regs, int err);
|
|||
extern void uc32_notify_die(const char *str, struct pt_regs *regs,
|
||||
struct siginfo *info, unsigned long err, unsigned long trap);
|
||||
|
||||
extern asmlinkage void __backtrace(void);
|
||||
extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
|
||||
|
||||
extern void __show_regs(struct pt_regs *);
|
||||
|
||||
#endif /* __UNICORE_BUG_H__ */
|
||||
|
|
|
@ -35,7 +35,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
|
|||
: "memory", "cc");
|
||||
break;
|
||||
default:
|
||||
ret = __xchg_bad_pointer();
|
||||
__xchg_bad_pointer();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -30,4 +30,10 @@ extern char __vectors_start[], __vectors_end[];
|
|||
extern void kernel_thread_helper(void);
|
||||
|
||||
extern void __init early_signal_init(void);
|
||||
|
||||
extern asmlinkage void __backtrace(void);
|
||||
extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
|
||||
|
||||
extern void __show_regs(struct pt_regs *);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -82,7 +82,8 @@ config X86
|
|||
select CLKEVT_I8253
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||
select GENERIC_IOMAP
|
||||
select DCACHE_WORD_ACCESS
|
||||
select DCACHE_WORD_ACCESS if !DEBUG_PAGEALLOC
|
||||
select HAVE_ARCH_SECCOMP_FILTER
|
||||
|
||||
config INSTRUCTION_DECODER
|
||||
def_bool (KPROBES || PERF_EVENTS)
|
||||
|
|
|
@ -67,6 +67,10 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
|
|||
switch (from->si_code >> 16) {
|
||||
case __SI_FAULT >> 16:
|
||||
break;
|
||||
case __SI_SYS >> 16:
|
||||
put_user_ex(from->si_syscall, &to->si_syscall);
|
||||
put_user_ex(from->si_arch, &to->si_arch);
|
||||
break;
|
||||
case __SI_CHLD >> 16:
|
||||
if (ia32) {
|
||||
put_user_ex(from->si_utime, &to->si_utime);
|
||||
|
|
|
@ -144,6 +144,12 @@ typedef struct compat_siginfo {
|
|||
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
|
||||
int _fd;
|
||||
} _sigpoll;
|
||||
|
||||
struct {
|
||||
unsigned int _call_addr; /* calling insn */
|
||||
int _syscall; /* triggering system call number */
|
||||
unsigned int _arch; /* AUDIT_ARCH_* of syscall */
|
||||
} _sigsys;
|
||||
} _sifields;
|
||||
} compat_siginfo_t;
|
||||
|
||||
|
|
|
@ -13,9 +13,11 @@
|
|||
#ifndef _ASM_X86_SYSCALL_H
|
||||
#define _ASM_X86_SYSCALL_H
|
||||
|
||||
#include <linux/audit.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/err.h>
|
||||
#include <asm/asm-offsets.h> /* For NR_syscalls */
|
||||
#include <asm/thread_info.h> /* for TS_COMPAT */
|
||||
#include <asm/unistd.h>
|
||||
|
||||
extern const unsigned long sys_call_table[];
|
||||
|
@ -88,6 +90,12 @@ static inline void syscall_set_arguments(struct task_struct *task,
|
|||
memcpy(®s->bx + i, args, n * sizeof(args[0]));
|
||||
}
|
||||
|
||||
static inline int syscall_get_arch(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
return AUDIT_ARCH_I386;
|
||||
}
|
||||
|
||||
#else /* CONFIG_X86_64 */
|
||||
|
||||
static inline void syscall_get_arguments(struct task_struct *task,
|
||||
|
@ -212,6 +220,25 @@ static inline void syscall_set_arguments(struct task_struct *task,
|
|||
}
|
||||
}
|
||||
|
||||
static inline int syscall_get_arch(struct task_struct *task,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
#ifdef CONFIG_IA32_EMULATION
|
||||
/*
|
||||
* TS_COMPAT is set for 32-bit syscall entry and then
|
||||
* remains set until we return to user mode.
|
||||
*
|
||||
* TIF_IA32 tasks should always have TS_COMPAT set at
|
||||
* system call time.
|
||||
*
|
||||
* x32 tasks should be considered AUDIT_ARCH_X86_64.
|
||||
*/
|
||||
if (task_thread_info(task)->status & TS_COMPAT)
|
||||
return AUDIT_ARCH_I386;
|
||||
#endif
|
||||
/* Both x32 and x86_64 are considered "64-bit". */
|
||||
return AUDIT_ARCH_X86_64;
|
||||
}
|
||||
#endif /* CONFIG_X86_32 */
|
||||
|
||||
#endif /* _ASM_X86_SYSCALL_H */
|
||||
|
|
|
@ -1504,7 +1504,11 @@ long syscall_trace_enter(struct pt_regs *regs)
|
|||
regs->flags |= X86_EFLAGS_TF;
|
||||
|
||||
/* do the secure computing check first */
|
||||
secure_computing(regs->orig_ax);
|
||||
if (secure_computing(regs->orig_ax)) {
|
||||
/* seccomp failures shouldn't expose any additional code. */
|
||||
ret = -1L;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (unlikely(test_thread_flag(TIF_SYSCALL_EMU)))
|
||||
ret = -1L;
|
||||
|
@ -1529,6 +1533,7 @@ long syscall_trace_enter(struct pt_regs *regs)
|
|||
regs->dx, regs->r10);
|
||||
#endif
|
||||
|
||||
out:
|
||||
return ret ?: regs->orig_ax;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,3 +355,4 @@
|
|||
346 i386 setns sys_setns
|
||||
347 i386 process_vm_readv sys_process_vm_readv compat_sys_process_vm_readv
|
||||
348 i386 process_vm_writev sys_process_vm_writev compat_sys_process_vm_writev
|
||||
354 i386 seccomp sys_seccomp
|
||||
|
|
|
@ -318,6 +318,8 @@
|
|||
309 common getcpu sys_getcpu
|
||||
310 64 process_vm_readv sys_process_vm_readv
|
||||
311 64 process_vm_writev sys_process_vm_writev
|
||||
317 common seccomp sys_seccomp
|
||||
|
||||
#
|
||||
# x32-specific system call numbers start at 512 to avoid cache impact
|
||||
# for native 64-bit operation.
|
||||
|
|
|
@ -28,17 +28,17 @@
|
|||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
|
||||
#define TCGETA _IOR('t', 23, struct termio)
|
||||
#define TCSETA _IOW('t', 24, struct termio)
|
||||
#define TCSETAW _IOW('t', 25, struct termio)
|
||||
#define TCSETAF _IOW('t', 28, struct termio)
|
||||
#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
|
||||
#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
|
||||
#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
|
||||
#define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
|
||||
|
||||
#define TCSBRK _IO('t', 29)
|
||||
#define TCXONC _IO('t', 30)
|
||||
#define TCFLSH _IO('t', 31)
|
||||
|
||||
#define TIOCSWINSZ _IOW('t', 103, struct winsize)
|
||||
#define TIOCGWINSZ _IOR('t', 104, struct winsize)
|
||||
#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
|
||||
#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
|
||||
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
|
||||
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
|
||||
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
|
||||
|
@ -88,7 +88,6 @@
|
|||
#define TIOCSETD _IOW('T', 35, int)
|
||||
#define TIOCGETD _IOR('T', 36, int)
|
||||
#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
|
||||
#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
|
||||
#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
|
||||
#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
|
||||
#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
|
||||
|
@ -111,8 +110,10 @@
|
|||
#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
|
||||
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
||||
# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */
|
||||
#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
|
||||
#define TIOCSERGETMULTI 0x80a8545a /* Get multiport config */
|
||||
/* _IOR('T', 90, struct serial_multiport_struct) */
|
||||
#define TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
|
||||
/* _IOW('T', 91, struct serial_multiport_struct) */
|
||||
|
||||
#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
|
|
|
@ -68,7 +68,12 @@
|
|||
#define VMALLOC_START 0xC0000000
|
||||
#define VMALLOC_END 0xC7FEFFFF
|
||||
#define TLBTEMP_BASE_1 0xC7FF0000
|
||||
#define TLBTEMP_BASE_2 0xC7FF8000
|
||||
#define TLBTEMP_BASE_2 (TLBTEMP_BASE_1 + DCACHE_WAY_SIZE)
|
||||
#if 2 * DCACHE_WAY_SIZE > ICACHE_WAY_SIZE
|
||||
#define TLBTEMP_SIZE (2 * DCACHE_WAY_SIZE)
|
||||
#else
|
||||
#define TLBTEMP_SIZE ICACHE_WAY_SIZE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Xtensa Linux config PTE layout (when present):
|
||||
|
|
|
@ -1053,9 +1053,8 @@ ENTRY(fast_syscall_xtensa)
|
|||
movi a7, 4 # sizeof(unsigned int)
|
||||
access_ok a3, a7, a0, a2, .Leac # a0: scratch reg, a2: sp
|
||||
|
||||
addi a6, a6, -1 # assuming SYS_XTENSA_ATOMIC_SET = 1
|
||||
_bgeui a6, SYS_XTENSA_COUNT - 1, .Lill
|
||||
_bnei a6, SYS_XTENSA_ATOMIC_CMP_SWP - 1, .Lnswp
|
||||
_bgeui a6, SYS_XTENSA_COUNT, .Lill
|
||||
_bnei a6, SYS_XTENSA_ATOMIC_CMP_SWP, .Lnswp
|
||||
|
||||
/* Fall through for ATOMIC_CMP_SWP. */
|
||||
|
||||
|
@ -1067,27 +1066,26 @@ TRY s32i a5, a3, 0 # different, modify value
|
|||
l32i a7, a2, PT_AREG7 # restore a7
|
||||
l32i a0, a2, PT_AREG0 # restore a0
|
||||
movi a2, 1 # and return 1
|
||||
addi a6, a6, 1 # restore a6 (really necessary?)
|
||||
rfe
|
||||
|
||||
1: l32i a7, a2, PT_AREG7 # restore a7
|
||||
l32i a0, a2, PT_AREG0 # restore a0
|
||||
movi a2, 0 # return 0 (note that we cannot set
|
||||
addi a6, a6, 1 # restore a6 (really necessary?)
|
||||
rfe
|
||||
|
||||
.Lnswp: /* Atomic set, add, and exg_add. */
|
||||
|
||||
TRY l32i a7, a3, 0 # orig
|
||||
addi a6, a6, -SYS_XTENSA_ATOMIC_SET
|
||||
add a0, a4, a7 # + arg
|
||||
moveqz a0, a4, a6 # set
|
||||
addi a6, a6, SYS_XTENSA_ATOMIC_SET
|
||||
TRY s32i a0, a3, 0 # write new value
|
||||
|
||||
mov a0, a2
|
||||
mov a2, a7
|
||||
l32i a7, a0, PT_AREG7 # restore a7
|
||||
l32i a0, a0, PT_AREG0 # restore a0
|
||||
addi a6, a6, 1 # restore a6 (really necessary?)
|
||||
rfe
|
||||
|
||||
CATCH
|
||||
|
@ -1096,7 +1094,7 @@ CATCH
|
|||
movi a2, -EFAULT
|
||||
rfe
|
||||
|
||||
.Lill: l32i a7, a2, PT_AREG0 # restore a7
|
||||
.Lill: l32i a7, a2, PT_AREG7 # restore a7
|
||||
l32i a0, a2, PT_AREG0 # restore a0
|
||||
movi a2, -EINVAL
|
||||
rfe
|
||||
|
@ -1629,7 +1627,7 @@ ENTRY(fast_second_level_miss)
|
|||
rsr a0, EXCVADDR
|
||||
bltu a0, a3, 2f
|
||||
|
||||
addi a1, a0, -(2 << (DCACHE_ALIAS_ORDER + PAGE_SHIFT))
|
||||
addi a1, a0, -TLBTEMP_SIZE
|
||||
bgeu a1, a3, 2f
|
||||
|
||||
/* Check if we have to restore an ITLB mapping. */
|
||||
|
|
|
@ -48,9 +48,8 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag)
|
|||
|
||||
/* We currently don't support coherent memory outside KSEG */
|
||||
|
||||
if (ret < XCHAL_KSEG_CACHED_VADDR
|
||||
|| ret >= XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE)
|
||||
BUG();
|
||||
BUG_ON(ret < XCHAL_KSEG_CACHED_VADDR ||
|
||||
ret > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1);
|
||||
|
||||
|
||||
if (ret != 0) {
|
||||
|
@ -66,10 +65,11 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag)
|
|||
void dma_free_coherent(struct device *hwdev, size_t size,
|
||||
void *vaddr, dma_addr_t dma_handle)
|
||||
{
|
||||
long addr=(long)vaddr+XCHAL_KSEG_CACHED_VADDR-XCHAL_KSEG_BYPASS_VADDR;
|
||||
unsigned long addr = (unsigned long)vaddr +
|
||||
XCHAL_KSEG_CACHED_VADDR - XCHAL_KSEG_BYPASS_VADDR;
|
||||
|
||||
if (addr < 0 || addr >= XCHAL_KSEG_SIZE)
|
||||
BUG();
|
||||
BUG_ON(addr < XCHAL_KSEG_CACHED_VADDR ||
|
||||
addr > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1);
|
||||
|
||||
free_pages(addr, get_order(size));
|
||||
}
|
||||
|
|
|
@ -586,7 +586,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,
|
|||
* Note: Original code is ata_bus_softreset().
|
||||
*/
|
||||
|
||||
static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
|
||||
static int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
|
||||
unsigned long deadline)
|
||||
{
|
||||
struct ata_ioports *ioaddr = &ap->ioaddr;
|
||||
|
@ -600,9 +600,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
|
|||
udelay(20);
|
||||
out_be32(ioaddr->ctl_addr, ap->ctl);
|
||||
|
||||
scc_wait_after_reset(&ap->link, devmask, deadline);
|
||||
|
||||
return 0;
|
||||
return scc_wait_after_reset(&ap->link, devmask, deadline);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -619,7 +617,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
|
|||
{
|
||||
struct ata_port *ap = link->ap;
|
||||
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
|
||||
unsigned int devmask = 0, err_mask;
|
||||
unsigned int devmask = 0;
|
||||
int rc;
|
||||
u8 err;
|
||||
|
||||
DPRINTK("ENTER\n");
|
||||
|
@ -635,9 +634,9 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
|
|||
|
||||
/* issue bus reset */
|
||||
DPRINTK("about to softreset, devmask=%x\n", devmask);
|
||||
err_mask = scc_bus_softreset(ap, devmask, deadline);
|
||||
if (err_mask) {
|
||||
ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask);
|
||||
rc = scc_bus_softreset(ap, devmask, deadline);
|
||||
if (rc) {
|
||||
ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", rc);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
|
|
@ -801,7 +801,7 @@ static ssize_t show_target_loads(
|
|||
ret += sprintf(buf + ret, "%u%s", target_loads[i],
|
||||
i & 0x1 ? ":" : " ");
|
||||
|
||||
ret += sprintf(buf + --ret, "\n");
|
||||
sprintf(buf + ret - 1, "\n");
|
||||
spin_unlock_irqrestore(&target_loads_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
@ -844,7 +844,7 @@ static ssize_t show_above_hispeed_delay(
|
|||
ret += sprintf(buf + ret, "%u%s", above_hispeed_delay[i],
|
||||
i & 0x1 ? ":" : " ");
|
||||
|
||||
ret += sprintf(buf + --ret, "\n");
|
||||
sprintf(buf + ret - 1, "\n");
|
||||
spin_unlock_irqrestore(&above_hispeed_delay_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
unsigned int *rsize)
|
||||
{
|
||||
if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
|
||||
if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
|
||||
hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n");
|
||||
rdesc[11] = rdesc[16] = 0xff;
|
||||
rdesc[12] = rdesc[17] = 0x03;
|
||||
|
|
|
@ -282,7 +282,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|||
* - change the button usage range to 4-7 for the extra
|
||||
* buttons
|
||||
*/
|
||||
if (*rsize >= 74 &&
|
||||
if (*rsize >= 75 &&
|
||||
rdesc[61] == 0x05 && rdesc[62] == 0x08 &&
|
||||
rdesc[63] == 0x19 && rdesc[64] == 0x08 &&
|
||||
rdesc[65] == 0x29 && rdesc[66] == 0x0f &&
|
||||
|
|
|
@ -111,7 +111,7 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|||
{
|
||||
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
|
||||
|
||||
if ((quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&
|
||||
if ((quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&
|
||||
rdesc[84] == 0x8c && rdesc[85] == 0x02) {
|
||||
hid_info(hdev,
|
||||
"fixing up Logitech keyboard report descriptor\n");
|
||||
|
@ -120,7 +120,7 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|||
}
|
||||
if ((quirks & LG_RDESC_REL_ABS) && *rsize >= 50 &&
|
||||
rdesc[32] == 0x81 && rdesc[33] == 0x06 &&
|
||||
rdesc[49] == 0x81 && rdesc[50] == 0x06) {
|
||||
rdesc[49] == 0x81 && rdesc[51] == 0x06) {
|
||||
hid_info(hdev,
|
||||
"fixing up rel/abs in Logitech report descriptor\n");
|
||||
rdesc[33] = rdesc[50] = 0x02;
|
||||
|
|
|
@ -230,13 +230,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
|
|||
return;
|
||||
}
|
||||
|
||||
if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
|
||||
(dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
|
||||
dev_err(&djrcv_hdev->dev, "%s: invalid device index:%d\n",
|
||||
__func__, dj_report->device_index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (djrcv_dev->paired_dj_devices[dj_report->device_index]) {
|
||||
/* The device is already known. No need to reallocate it. */
|
||||
dbg_hid("%s: device is already known\n", __func__);
|
||||
|
@ -688,7 +681,6 @@ static int logi_dj_raw_event(struct hid_device *hdev,
|
|||
struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
|
||||
struct dj_report *dj_report = (struct dj_report *) data;
|
||||
unsigned long flags;
|
||||
bool report_processed = false;
|
||||
|
||||
dbg_hid("%s, size:%d\n", __func__, size);
|
||||
|
||||
|
@ -716,27 +708,41 @@ static int logi_dj_raw_event(struct hid_device *hdev,
|
|||
* anything else with it.
|
||||
*/
|
||||
|
||||
/* case 1) */
|
||||
if (data[0] != REPORT_ID_DJ_SHORT)
|
||||
return false;
|
||||
|
||||
if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
|
||||
(dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
|
||||
/*
|
||||
* Device index is wrong, bail out.
|
||||
* This driver can ignore safely the receiver notifications,
|
||||
* so ignore those reports too.
|
||||
*/
|
||||
if (dj_report->device_index != DJ_RECEIVER_INDEX)
|
||||
dev_err(&hdev->dev, "%s: invalid device index:%d\n",
|
||||
__func__, dj_report->device_index);
|
||||
return false;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&djrcv_dev->lock, flags);
|
||||
if (dj_report->report_id == REPORT_ID_DJ_SHORT) {
|
||||
switch (dj_report->report_type) {
|
||||
case REPORT_TYPE_NOTIF_DEVICE_PAIRED:
|
||||
case REPORT_TYPE_NOTIF_DEVICE_UNPAIRED:
|
||||
logi_dj_recv_queue_notification(djrcv_dev, dj_report);
|
||||
break;
|
||||
case REPORT_TYPE_NOTIF_CONNECTION_STATUS:
|
||||
if (dj_report->report_params[CONNECTION_STATUS_PARAM_STATUS] ==
|
||||
STATUS_LINKLOSS) {
|
||||
logi_dj_recv_forward_null_report(djrcv_dev, dj_report);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
logi_dj_recv_forward_report(djrcv_dev, dj_report);
|
||||
switch (dj_report->report_type) {
|
||||
case REPORT_TYPE_NOTIF_DEVICE_PAIRED:
|
||||
case REPORT_TYPE_NOTIF_DEVICE_UNPAIRED:
|
||||
logi_dj_recv_queue_notification(djrcv_dev, dj_report);
|
||||
break;
|
||||
case REPORT_TYPE_NOTIF_CONNECTION_STATUS:
|
||||
if (dj_report->report_params[CONNECTION_STATUS_PARAM_STATUS] ==
|
||||
STATUS_LINKLOSS) {
|
||||
logi_dj_recv_forward_null_report(djrcv_dev, dj_report);
|
||||
}
|
||||
report_processed = true;
|
||||
break;
|
||||
default:
|
||||
logi_dj_recv_forward_report(djrcv_dev, dj_report);
|
||||
}
|
||||
spin_unlock_irqrestore(&djrcv_dev->lock, flags);
|
||||
|
||||
return report_processed;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int logi_dj_probe(struct hid_device *hdev,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#define DJ_MAX_PAIRED_DEVICES 6
|
||||
#define DJ_MAX_NUMBER_NOTIFICATIONS 8
|
||||
#define DJ_RECEIVER_INDEX 0
|
||||
#define DJ_DEVICE_INDEX_MIN 1
|
||||
#define DJ_DEVICE_INDEX_MAX 6
|
||||
|
||||
|
|
|
@ -308,6 +308,11 @@ static int magicmouse_raw_event(struct hid_device *hdev,
|
|||
if (size < 4 || ((size - 4) % 9) != 0)
|
||||
return 0;
|
||||
npoints = (size - 4) / 9;
|
||||
if (npoints > 15) {
|
||||
hid_warn(hdev, "invalid size value (%d) for TRACKPAD_REPORT_ID\n",
|
||||
size);
|
||||
return 0;
|
||||
}
|
||||
msc->ntouches = 0;
|
||||
for (ii = 0; ii < npoints; ii++)
|
||||
magicmouse_emit_touch(msc, ii, data + ii * 9 + 4);
|
||||
|
@ -331,6 +336,11 @@ static int magicmouse_raw_event(struct hid_device *hdev,
|
|||
if (size < 6 || ((size - 6) % 8) != 0)
|
||||
return 0;
|
||||
npoints = (size - 6) / 8;
|
||||
if (npoints > 15) {
|
||||
hid_warn(hdev, "invalid size value (%d) for MOUSE_REPORT_ID\n",
|
||||
size);
|
||||
return 0;
|
||||
}
|
||||
msc->ntouches = 0;
|
||||
for (ii = 0; ii < npoints; ii++)
|
||||
magicmouse_emit_touch(msc, ii, data + ii * 8 + 6);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
unsigned int *rsize)
|
||||
{
|
||||
if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {
|
||||
if (*rsize >= 31 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {
|
||||
hid_info(hdev, "fixing up button/consumer in HID report descriptor\n");
|
||||
rdesc[30] = 0x0c;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
unsigned int *rsize)
|
||||
{
|
||||
if (*rsize >= 60 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
|
||||
if (*rsize >= 62 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
|
||||
rdesc[41] == 0x00 && rdesc[59] == 0x26 &&
|
||||
rdesc[60] == 0xf9 && rdesc[61] == 0x00) {
|
||||
hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n");
|
||||
|
|
|
@ -2370,6 +2370,12 @@ static int picolcd_raw_event(struct hid_device *hdev,
|
|||
if (!data)
|
||||
return 1;
|
||||
|
||||
if (size > 64) {
|
||||
hid_warn(hdev, "invalid size value (%d) for picolcd raw event\n",
|
||||
size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (report->id == REPORT_KEY_STATE) {
|
||||
if (data->input_keys)
|
||||
ret = picolcd_raw_keypad(data, report, raw_data+1, size-1);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
unsigned int *rsize)
|
||||
{
|
||||
if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
|
||||
if (*rsize >= 112 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
|
||||
rdesc[106] == 0x03) {
|
||||
hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n");
|
||||
rdesc[105] = rdesc[110] = 0x03;
|
||||
|
|
|
@ -493,7 +493,7 @@ static ssize_t brightness_level_show(struct device *dev,
|
|||
{
|
||||
int count;
|
||||
|
||||
count = snprintf(buf, sizeof(buf), "%d\n", vol_mv_level);
|
||||
count = snprintf(buf, (int)sizeof(buf), "%d\n", vol_mv_level);
|
||||
|
||||
printk(KERN_DEBUG "[TouchKey] Touch LED voltage = %d\n", vol_mv_level);
|
||||
return count;
|
||||
|
@ -1506,7 +1506,7 @@ static int __devinit cypress_touchkey_probe(struct i2c_client *client,
|
|||
info->power_onoff = pdata->power_onoff;
|
||||
info->touchkey_update_status = 0;
|
||||
memcpy(info->keycode, pdata->touchkey_keycode,
|
||||
sizeof(pdata->touchkey_keycode));
|
||||
(int)sizeof(pdata->touchkey_keycode));
|
||||
snprintf(info->phys, sizeof(info->phys),
|
||||
"%s/input0", dev_name(&client->dev));
|
||||
input_dev->name = "sec_touchkey";
|
||||
|
|
|
@ -509,6 +509,13 @@ config TOUCHSCREEN_SYNAPTICS_RMI4_I2C
|
|||
help
|
||||
This enables support for Synaptics RMI over I2C based touchscreens(ClearPad 3000).
|
||||
|
||||
config TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE
|
||||
bool "Synaptics prevent leakage i2c due to hsync"
|
||||
default n
|
||||
help
|
||||
There is leakage current on TSP I2C by HW defect. TSP I2C Failed.
|
||||
So To prevent leakage, hsync off, tsp on, hsync on.
|
||||
|
||||
config SYNA_MULTI_TOUCH
|
||||
tristate "Synaptics i2c touchscreen(ClearPad 3000) MutilTouch support"
|
||||
depends on TOUCHSCREEN_SYNAPTICS_RMI4_I2C
|
||||
|
|
|
@ -1031,39 +1031,48 @@ static void cyttsp_xy_handler(struct cyttsp *ts, bool is_ready_to_suspend)
|
|||
"Spurious err opmode (tt_mode=%02X hst_mode=%02X)\n", \
|
||||
g_xy_data.tt_mode, g_xy_data.hst_mode);
|
||||
cyttsp_debug("Reset TTSP Device; Terminating active tracks\n");
|
||||
/* terminate all active tracks */
|
||||
cur_tch = CY_NTCH;
|
||||
/* reset TTSP part and take it back out of Bootloader mode */
|
||||
/* reset TTSP Device back to bootloader mode */
|
||||
host_reg = CY_SOFT_RESET_MODE;
|
||||
retval = i2c_smbus_write_i2c_block_data(ts->client, CY_REG_BASE,
|
||||
sizeof(host_reg), &host_reg);
|
||||
/* wait for TTSP Device to complete reset back to bootloader */
|
||||
tries = 0;
|
||||
do {
|
||||
usleep_range(1000, 1000);
|
||||
cyttsp_putbl(ts, 1, false, false, false);
|
||||
} while (g_bl_data.bl_status != 0x10 &&
|
||||
g_bl_data.bl_status != 0x11 &&
|
||||
tries++ < 100);
|
||||
retval = cyttsp_putbl(ts, 1, true, true, true);
|
||||
/* switch back to operational mode */
|
||||
/* take TTSP device out of bootloader mode;
|
||||
* switch back to TrueTouch operational mode */
|
||||
if (!(retval < CY_OK)) {
|
||||
int tries;
|
||||
|
||||
if (!is_ready_to_suspend) {
|
||||
/* terminate all active tracks */
|
||||
cur_tch = CY_NTCH;
|
||||
/* reset TTSP part and take it back out of Bootloader
|
||||
mode */
|
||||
/* reset TTSP Device back to bootloader mode */
|
||||
host_reg = CY_SOFT_RESET_MODE;
|
||||
retval = i2c_smbus_write_i2c_block_data(ts->client,
|
||||
CY_REG_BASE,
|
||||
sizeof(bl_cmd), bl_cmd);
|
||||
/* wait for TTSP Device to complete
|
||||
* switch to Operational mode */
|
||||
CY_REG_BASE,
|
||||
sizeof(host_reg), &host_reg);
|
||||
/* wait for TTSP Device to complete reset back to
|
||||
bootloader */
|
||||
tries = 0;
|
||||
do {
|
||||
msleep(100);
|
||||
cyttsp_putbl(ts, 2, false, false, false);
|
||||
} while (GET_BOOTLOADERMODE(g_bl_data.bl_status) &&
|
||||
usleep_range(1000, 1000);
|
||||
cyttsp_putbl(ts, 1, false, false, false);
|
||||
} while (g_bl_data.bl_status != 0x10 &&
|
||||
g_bl_data.bl_status != 0x11 &&
|
||||
tries++ < 100);
|
||||
cyttsp_putbl(ts, 2, true, false, false);
|
||||
retval = cyttsp_putbl(ts, 1, true, true, true);
|
||||
/* switch back to operational mode */
|
||||
/* take TTSP device out of bootloader mode;
|
||||
* switch back to TrueTouch operational mode */
|
||||
if (!(retval < CY_OK)) {
|
||||
int tries;
|
||||
retval = i2c_smbus_write_i2c_block_data(
|
||||
ts->client,
|
||||
CY_REG_BASE,
|
||||
sizeof(bl_cmd), bl_cmd);
|
||||
/* wait for TTSP Device to complete
|
||||
* switch to Operational mode */
|
||||
tries = 0;
|
||||
do {
|
||||
msleep(100);
|
||||
cyttsp_putbl(ts, 2, false, false,
|
||||
false);
|
||||
} while (GET_BOOTLOADERMODE(
|
||||
g_bl_data.bl_status) &&
|
||||
tries++ < 100);
|
||||
cyttsp_putbl(ts, 2, true, false, false);
|
||||
}
|
||||
}
|
||||
goto exit_xy_handler;
|
||||
} else {
|
||||
|
|
|
@ -81,8 +81,9 @@
|
|||
#define STATUS_POLLING_PERIOD_US 3000
|
||||
|
||||
#if defined(CONFIG_MACH_JACTIVE_EUR) || defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
#define FW_SUPPORT_HYNC(x) ((strncmp(x->product_id, "SY 03", 5))
|
||||
#define FW_NOT_SUPPORT_HYNC(x) ((strncmp(x->product_id, "SY 01", 5) == 0) || (strncmp(x->product_id, "S5000B", 6) == 0) || (strncmp(x->product_id, "SY 02", 5) == 0))
|
||||
#define FW_SUPPORT_HSYNC03(x) (strncmp(x->product_id, "SY 03", 5) == 0)
|
||||
#define FW_SUPPORT_HSYNC04(x) ((strncmp(x->product_id, "SY 04", 5) == 0)|| (strncmp(x->product_id, "S5000B", 6) == 0))
|
||||
#define FW_NOT_SUPPORT_HSYNC(x) ((strncmp(x->product_id, "SY 01", 5) == 0) || (strncmp(x->product_id, "SY 02", 5) == 0))
|
||||
#endif
|
||||
|
||||
static ssize_t fwu_sysfs_show_image(struct file *data_file,
|
||||
|
@ -967,24 +968,31 @@ static int fwu_start_reflash(bool mode, bool factory_fw)
|
|||
dev_info(&fwu->rmi4_data->i2c_client->dev,
|
||||
"%s: run fw update for FACTORY FIRMWARE\n",
|
||||
__func__);
|
||||
if (FW_NOT_SUPPORT_HYNC(fwu))
|
||||
if (FW_NOT_SUPPORT_HSYNC(fwu))
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_NON_HSYNC_FAC);
|
||||
else
|
||||
else if (FW_SUPPORT_HSYNC03(fwu))
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_HSYNC_FAC);
|
||||
else // FW_SUPPORT_HSYNC04(fwu)
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_HSYNC04_FAC);
|
||||
} else {
|
||||
/* Read firmware according to ic revision */
|
||||
if ((fwu->rmi4_data->ic_revision_of_ic >> 4) == 0xB) {
|
||||
/* Read firmware according to panel ID */
|
||||
switch (fwu->rmi4_data->panel_revision) {
|
||||
case OCTA_PANEL_REVISION_34:
|
||||
if (FW_NOT_SUPPORT_HYNC(fwu))
|
||||
if (FW_NOT_SUPPORT_HSYNC(fwu))
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_NON_HSYNC);
|
||||
else
|
||||
else if (FW_SUPPORT_HSYNC03(fwu)){
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_HSYNC);
|
||||
}
|
||||
else // FW_SUPPORT_HSYNC04(fwu)
|
||||
snprintf(fw_path, SYNAPTICS_MAX_FW_PATH,
|
||||
"%s", FW_IMAGE_NAME_B0_HSYNC04);
|
||||
break;
|
||||
default:
|
||||
dev_info(&fwu->rmi4_data->i2c_client->dev,
|
||||
|
|
|
@ -3492,6 +3492,9 @@ int synaptics_rmi4_reset_device(struct synaptics_rmi4_data *rmi4_data)
|
|||
msleep(SYNAPTICS_HW_RESET_TIME);
|
||||
|
||||
} else {
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(false);
|
||||
#endif
|
||||
rmi4_data->board->power(false);
|
||||
msleep(30);
|
||||
rmi4_data->board->power(true);
|
||||
|
@ -3503,6 +3506,9 @@ int synaptics_rmi4_reset_device(struct synaptics_rmi4_data *rmi4_data)
|
|||
else
|
||||
msleep(SYNAPTICS_HW_RESET_TIME);
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(true);
|
||||
#endif
|
||||
retval = synaptics_rmi4_f54_set_control(rmi4_data);
|
||||
if (retval < 0)
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
|
@ -3822,8 +3828,14 @@ static int __devinit synaptics_rmi4_probe(struct i2c_client *client,
|
|||
/* define panel version : M4 / M4+ */
|
||||
rmi4_data->panel_revision = rmi4_data->board->panel_revision;
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(false);
|
||||
#endif
|
||||
rmi4_data->board->power(true);
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(true);
|
||||
#endif
|
||||
rmi4_data->i2c_read = synaptics_rmi4_i2c_read;
|
||||
rmi4_data->i2c_write = synaptics_rmi4_i2c_write;
|
||||
rmi4_data->irq_enable = synaptics_rmi4_irq_enable;
|
||||
|
@ -4126,9 +4138,15 @@ static int synaptics_rmi4_input_open(struct input_dev *dev)
|
|||
|
||||
if (rmi4_data->touch_stopped) {
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(false);
|
||||
#endif
|
||||
rmi4_data->board->power(true);
|
||||
rmi4_data->touch_stopped = false;
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(true);
|
||||
#endif
|
||||
ret = synaptics_rmi4_reinit_device(rmi4_data);
|
||||
if (ret < 0) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
|
@ -4230,10 +4248,16 @@ static void synaptics_rmi4_late_resume(struct early_suspend *h)
|
|||
if (rmi4_data->touch_stopped) {
|
||||
dev_info(&rmi4_data->i2c_client->dev, "%s\n", __func__);
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(false);
|
||||
#endif
|
||||
rmi4_data->board->power(true);
|
||||
rmi4_data->touch_stopped = false;
|
||||
rmi4_data->current_page = MASK_8BIT;
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
rmi4_data->board->hsync_onoff(true);
|
||||
#endif
|
||||
retval = gpio_request(rmi4_data->board->gpio, "tsp_int");
|
||||
if (retval != 0) {
|
||||
dev_info(&rmi4_data->i2c_client->dev, "%s: tsp int request failed, ret=%d", __func__, retval);
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
#if defined(CONFIG_MACH_JACTIVE_EUR) || defined(CONFIG_MACH_JACTIVE_ATT)
|
||||
#define FW_IMAGE_NAME_B0_HSYNC "tsp_synaptics/jactive/synaptics_b0_hsync.fw"
|
||||
#define FW_IMAGE_NAME_B0_HSYNC_FAC "tsp_synaptics/jactive/synaptics_b0_hsync_fac.fw"
|
||||
#define FW_IMAGE_NAME_B0_HSYNC04 "tsp_synaptics/jactive/synaptics_b0_hsync04.fw"
|
||||
#define FW_IMAGE_NAME_B0_HSYNC04_FAC "tsp_synaptics/jactive/synaptics_b0_hsync04_fac.fw"
|
||||
|
||||
/* NON HYNC F/W will be removed */
|
||||
/* PRODUCT ID : SY 01, SY 02, S5000B */
|
||||
|
|
|
@ -3028,14 +3028,16 @@ free_domains:
|
|||
|
||||
static void cleanup_domain(struct protection_domain *domain)
|
||||
{
|
||||
struct iommu_dev_data *dev_data, *next;
|
||||
struct iommu_dev_data *entry;
|
||||
unsigned long flags;
|
||||
|
||||
write_lock_irqsave(&amd_iommu_devtable_lock, flags);
|
||||
|
||||
list_for_each_entry_safe(dev_data, next, &domain->dev_list, list) {
|
||||
__detach_device(dev_data);
|
||||
atomic_set(&dev_data->bind, 0);
|
||||
while (!list_empty(&domain->dev_list)) {
|
||||
entry = list_first_entry(&domain->dev_list,
|
||||
struct iommu_dev_data, list);
|
||||
__detach_device(entry);
|
||||
atomic_set(&entry->bind, 0);
|
||||
}
|
||||
|
||||
write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
|
||||
|
|
|
@ -3433,6 +3433,8 @@ static void handle_stripe(struct stripe_head *sh)
|
|||
set_bit(R5_Wantwrite, &dev->flags);
|
||||
if (prexor)
|
||||
continue;
|
||||
if (s.failed > 1)
|
||||
continue;
|
||||
if (!test_bit(R5_Insync, &dev->flags) ||
|
||||
((i == sh->pd_idx || i == sh->qd_idx) &&
|
||||
s.failed == 0))
|
||||
|
|
|
@ -527,6 +527,7 @@ static int32_t msm_actuator_init(struct msm_actuator_ctrl_t *a_ctrl,
|
|||
a_ctrl->reg_tbl_size *
|
||||
sizeof(struct msm_actuator_reg_params_t))) {
|
||||
kfree(a_ctrl->i2c_reg_tbl);
|
||||
a_ctrl->i2c_reg_tbl = NULL;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
@ -537,6 +538,7 @@ static int32_t msm_actuator_init(struct msm_actuator_ctrl_t *a_ctrl,
|
|||
GFP_KERNEL);
|
||||
if (init_settings == NULL) {
|
||||
kfree(a_ctrl->i2c_reg_tbl);
|
||||
a_ctrl->i2c_reg_tbl = NULL;
|
||||
pr_err("%s Error allocating memory for init_settings\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
|
@ -547,6 +549,7 @@ static int32_t msm_actuator_init(struct msm_actuator_ctrl_t *a_ctrl,
|
|||
sizeof(struct reg_settings_t))) {
|
||||
kfree(init_settings);
|
||||
kfree(a_ctrl->i2c_reg_tbl);
|
||||
a_ctrl->i2c_reg_tbl = NULL;
|
||||
pr_err("%s Error copying init_settings\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
|
@ -558,6 +561,7 @@ static int32_t msm_actuator_init(struct msm_actuator_ctrl_t *a_ctrl,
|
|||
kfree(init_settings);
|
||||
if (rc < 0) {
|
||||
kfree(a_ctrl->i2c_reg_tbl);
|
||||
a_ctrl->i2c_reg_tbl = NULL;
|
||||
pr_err("%s Error actuator_init_focus\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
|
|
|
@ -176,6 +176,7 @@ struct qseecom_registered_app_list {
|
|||
struct list_head list;
|
||||
u32 app_id;
|
||||
u32 ref_cnt;
|
||||
char app_name[MAX_APP_NAME_SIZE];
|
||||
};
|
||||
|
||||
struct qseecom_registered_kclient_list {
|
||||
|
@ -200,6 +201,7 @@ struct qseecom_control {
|
|||
uint32_t qseos_version;
|
||||
struct device *pdev;
|
||||
struct cdev cdev;
|
||||
|
||||
};
|
||||
|
||||
struct qseecom_client_handle {
|
||||
|
@ -209,6 +211,7 @@ struct qseecom_client_handle {
|
|||
uint32_t user_virt_sb_base;
|
||||
size_t sb_length;
|
||||
struct ion_handle *ihandle; /* Retrieve phy addr */
|
||||
char app_name[MAX_APP_NAME_SIZE];
|
||||
};
|
||||
|
||||
struct qseecom_listener_handle {
|
||||
|
@ -381,7 +384,6 @@ static int qseecom_register_listener(struct qseecom_dev_handle *data,
|
|||
return ret;
|
||||
}
|
||||
data->listener.id = 0;
|
||||
data->type = QSEECOM_LISTENER_SERVICE;
|
||||
if (!__qseecom_is_svc_unique(data, &rcvd_lstnr)) {
|
||||
pr_err("Service is not unique and is already registered\n");
|
||||
data->released = true;
|
||||
|
@ -561,10 +563,13 @@ static int __qseecom_process_incomplete_cmd(struct qseecom_dev_handle *data,
|
|||
struct qseecom_command_scm_resp *resp)
|
||||
{
|
||||
int ret = 0;
|
||||
int rc = 0;
|
||||
uint32_t lstnr;
|
||||
unsigned long flags;
|
||||
struct qseecom_client_listener_data_irsp send_data_rsp;
|
||||
struct qseecom_registered_listener_list *ptr_svc = NULL;
|
||||
sigset_t new_sigset;
|
||||
sigset_t old_sigset;
|
||||
|
||||
|
||||
while (resp->result == QSEOS_RESULT_INCOMPLETE) {
|
||||
|
@ -595,16 +600,24 @@ static int __qseecom_process_incomplete_cmd(struct qseecom_dev_handle *data,
|
|||
}
|
||||
pr_debug("waking up rcv_req_wq and "
|
||||
"waiting for send_resp_wq\n");
|
||||
if (wait_event_freezable(qseecom.send_resp_wq,
|
||||
__qseecom_listener_has_sent_rsp(data))) {
|
||||
pr_warning("Interrupted: exiting send_cmd loop\n");
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
|
||||
/* initialize the new signal mask with all signals*/
|
||||
sigfillset(&new_sigset);
|
||||
/* block all signals */
|
||||
sigprocmask(SIG_SETMASK, &new_sigset, &old_sigset);
|
||||
|
||||
do {
|
||||
if (!wait_event_freezable(qseecom.send_resp_wq,
|
||||
__qseecom_listener_has_sent_rsp(data)))
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
/* restore signal mask */
|
||||
sigprocmask(SIG_SETMASK, &old_sigset, NULL);
|
||||
if (data->abort) {
|
||||
pr_err("Aborting listener service %d\n",
|
||||
data->listener.id);
|
||||
return -ENODEV;
|
||||
pr_err("Abort clnt %d waiting on lstnr svc %d, ret %d",
|
||||
data->client.app_id, lstnr, ret);
|
||||
rc = -ENODEV;
|
||||
}
|
||||
qseecom.send_resp_flag = 0;
|
||||
send_data_rsp.qsee_cmd_id = QSEOS_LISTENER_DATA_RSP_COMMAND;
|
||||
|
@ -780,7 +793,9 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
|
|||
}
|
||||
entry->app_id = app_id;
|
||||
entry->ref_cnt = 1;
|
||||
|
||||
memset((void *)entry->app_name, 0, MAX_APP_NAME_SIZE);
|
||||
memcpy((void *)entry->app_name,
|
||||
(void *)load_img_req.img_name, MAX_APP_NAME_SIZE);
|
||||
/* Deallocate the handle */
|
||||
if (!IS_ERR_OR_NULL(ihandle))
|
||||
ion_free(qseecom.ion_clnt, ihandle);
|
||||
|
@ -794,6 +809,9 @@ static int qseecom_load_app(struct qseecom_dev_handle *data, void __user *argp)
|
|||
(char *)(load_img_req.img_name));
|
||||
}
|
||||
data->client.app_id = app_id;
|
||||
memset((void *)data->client.app_name, 0, MAX_APP_NAME_SIZE);
|
||||
memcpy((void *)data->client.app_name,
|
||||
(void *)load_img_req.img_name, MAX_APP_NAME_SIZE);
|
||||
load_img_req.app_id = app_id;
|
||||
if (copy_to_user(argp, &load_img_req, sizeof(load_img_req))) {
|
||||
pr_err("copy_to_user failed\n");
|
||||
|
@ -831,51 +849,59 @@ static int qseecom_unmap_ion_allocated_memory(struct qseecom_dev_handle *data)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int qseecom_unload_app(struct qseecom_dev_handle *data)
|
||||
static int qseecom_unload_app(struct qseecom_dev_handle *data,
|
||||
bool app_crash)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long flags1;
|
||||
int ret = 0;
|
||||
struct qseecom_command_scm_resp resp;
|
||||
struct qseecom_registered_app_list *ptr_app;
|
||||
struct qseecom_registered_app_list *ptr_app = NULL;
|
||||
bool unload = false;
|
||||
bool found_app = false;
|
||||
bool found_dead_app = false;
|
||||
|
||||
if ((qseecom.qseos_version == QSEOS_VERSION_14) &&
|
||||
(data->client.app_id > 0)) {
|
||||
if (!memcmp(data->client.app_name, "keymaste", strlen("keymaste"))) {
|
||||
pr_warn("Do not unload keymaster app from tz\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (data->client.app_id > 0) {
|
||||
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
|
||||
list_for_each_entry(ptr_app, &qseecom.registered_app_list_head,
|
||||
list) {
|
||||
if (ptr_app->app_id == data->client.app_id) {
|
||||
found_app = true;
|
||||
if (ptr_app->ref_cnt == 1) {
|
||||
unload = true;
|
||||
if (!memcmp((void *)ptr_app->app_name,
|
||||
(void *)data->client.app_name,
|
||||
strlen(data->client.app_name))) {
|
||||
found_app = true;
|
||||
if (app_crash || ptr_app->ref_cnt == 1)
|
||||
unload = true;
|
||||
break;
|
||||
} else {
|
||||
ptr_app->ref_cnt--;
|
||||
pr_warn("Can't unload app(%d) inuse\n",
|
||||
ptr_app->app_id);
|
||||
found_dead_app = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&qseecom.registered_app_list_lock,
|
||||
flags);
|
||||
if (found_app == false) {
|
||||
pr_err("Cannot find app with id = %d\n",
|
||||
data->client.app_id);
|
||||
flags);
|
||||
if (found_app == false && found_dead_app == false) {
|
||||
pr_err("Cannot find app with id = %d (%s)\n",
|
||||
data->client.app_id,
|
||||
(char *)data->client.app_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if ((unload) && (qseecom.qseos_version == QSEOS_VERSION_14)) {
|
||||
struct qseecom_unload_app_ireq req;
|
||||
|
||||
if (found_dead_app) {
|
||||
pr_warn("cleanup dead app: app_id %d(%s)\n", data->client.app_id,
|
||||
(char *)data->client.app_name);
|
||||
__qseecom_cleanup_app(data);
|
||||
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
|
||||
list_del(&ptr_app->list);
|
||||
kzfree(ptr_app);
|
||||
spin_unlock_irqrestore(&qseecom.registered_app_list_lock,
|
||||
flags);
|
||||
}
|
||||
|
||||
if (unload) {
|
||||
struct qseecom_unload_app_ireq req;
|
||||
/* Populate the structure for sending scm call to load image */
|
||||
req.qsee_cmd_id = QSEOS_APP_SHUTDOWN_COMMAND;
|
||||
req.app_id = data->client.app_id;
|
||||
|
@ -886,11 +912,20 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data)
|
|||
&resp, sizeof(resp));
|
||||
if (ret) {
|
||||
pr_err("scm_call to unload app (id = %d) failed\n",
|
||||
req.app_id);
|
||||
req.app_id);
|
||||
return -EFAULT;
|
||||
} else {
|
||||
pr_warn("App id %d now unloaded\n", req.app_id);
|
||||
}
|
||||
if (resp.result == QSEOS_RESULT_FAILURE) {
|
||||
pr_err("app (%d) unload_failed!!\n",
|
||||
data->client.app_id);
|
||||
return -EFAULT;
|
||||
}
|
||||
if (resp.result == QSEOS_RESULT_SUCCESS)
|
||||
pr_info("App (%d) is unloaded!!\n",
|
||||
data->client.app_id);
|
||||
__qseecom_cleanup_app(data);
|
||||
if (resp.result == QSEOS_RESULT_INCOMPLETE) {
|
||||
ret = __qseecom_process_incomplete_cmd(data, &resp);
|
||||
if (ret) {
|
||||
|
@ -913,6 +948,28 @@ static int qseecom_unload_app(struct qseecom_dev_handle *data)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (found_app) {
|
||||
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags1);
|
||||
if (app_crash) {
|
||||
ptr_app->ref_cnt = 0;
|
||||
pr_debug("app_crash: ref_count = 0\n");
|
||||
} else {
|
||||
if (ptr_app->ref_cnt == 1) {
|
||||
ptr_app->ref_cnt = 0;
|
||||
pr_info("ref_count set to 0\n");
|
||||
} else {
|
||||
ptr_app->ref_cnt--;
|
||||
pr_info("Can't unload app(%d) inuse\n",
|
||||
ptr_app->app_id);
|
||||
}
|
||||
}
|
||||
if (unload) {
|
||||
list_del(&ptr_app->list);
|
||||
kzfree(ptr_app);
|
||||
}
|
||||
spin_unlock_irqrestore(&qseecom.registered_app_list_lock,
|
||||
flags1);
|
||||
}
|
||||
qseecom_unmap_ion_allocated_memory(data);
|
||||
data->released = true;
|
||||
return ret;
|
||||
|
@ -1023,6 +1080,9 @@ static int __qseecom_send_cmd(struct qseecom_dev_handle *data,
|
|||
u32 reqd_len_sb_in = 0;
|
||||
struct qseecom_client_send_data_ireq send_data_req;
|
||||
struct qseecom_command_scm_resp resp;
|
||||
unsigned long flags;
|
||||
struct qseecom_registered_app_list *ptr_app;
|
||||
bool found_app = false;
|
||||
|
||||
if (req->cmd_req_buf == NULL || req->resp_buf == NULL) {
|
||||
pr_err("cmd buffer or response buffer is null\n");
|
||||
|
@ -1064,6 +1124,26 @@ static int __qseecom_send_cmd(struct qseecom_dev_handle *data,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* find app_id & img_name from list */
|
||||
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
|
||||
list_for_each_entry(ptr_app, &qseecom.registered_app_list_head,
|
||||
list) {
|
||||
if ((ptr_app->app_id == data->client.app_id) &&
|
||||
(!memcmp((void *)ptr_app->app_name,
|
||||
(void *)data->client.app_name,
|
||||
strlen(data->client.app_name)))) {
|
||||
found_app = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&qseecom.registered_app_list_lock, flags);
|
||||
|
||||
if (!found_app) {
|
||||
pr_err("app_id %d (%s) is not found\n", data->client.app_id,
|
||||
(char *)data->client.app_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
send_data_req.qsee_cmd_id = QSEOS_CLIENT_SEND_DATA_COMMAND;
|
||||
send_data_req.app_id = data->client.app_id;
|
||||
send_data_req.req_ptr = (void *)(__qseecom_uvirt_to_kphys(data,
|
||||
|
@ -1641,7 +1721,7 @@ int qseecom_shutdown_app(struct qseecom_handle **handle)
|
|||
if (!found_handle)
|
||||
pr_err("Unable to find the handle, exiting\n");
|
||||
else
|
||||
ret = qseecom_unload_app(data);
|
||||
ret = qseecom_unload_app(data, false);
|
||||
if (ret == 0) {
|
||||
kzfree(data);
|
||||
kzfree(*handle);
|
||||
|
@ -2042,7 +2122,9 @@ static int qseecom_query_app_loaded(struct qseecom_dev_handle *data,
|
|||
&qseecom.registered_app_list_lock, flags);
|
||||
data->client.app_id = ret;
|
||||
query_req.app_id = ret;
|
||||
|
||||
memset((void *)data->client.app_name, 0, MAX_APP_NAME_SIZE);
|
||||
memcpy((void *)data->client.app_name,
|
||||
(void *)query_req.app_name, MAX_APP_NAME_SIZE);
|
||||
if (copy_to_user(argp, &query_req, sizeof(query_req))) {
|
||||
pr_err("copy_to_user failed\n");
|
||||
return -EFAULT;
|
||||
|
@ -2068,6 +2150,7 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
switch (cmd) {
|
||||
case QSEECOM_IOCTL_REGISTER_LISTENER_REQ: {
|
||||
pr_debug("ioctl register_listener_req()\n");
|
||||
data->type = QSEECOM_LISTENER_SERVICE;
|
||||
atomic_inc(&data->ioctl_count);
|
||||
ret = qseecom_register_listener(data, argp);
|
||||
atomic_dec(&data->ioctl_count);
|
||||
|
@ -2129,6 +2212,8 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
break;
|
||||
}
|
||||
case QSEECOM_IOCTL_SET_MEM_PARAM_REQ: {
|
||||
data->type = QSEECOM_CLIENT_APP;
|
||||
pr_debug("SET_MEM_PARAM: qseecom addr = 0x%x\n", (u32)data);
|
||||
ret = qseecom_set_client_mem_param(data, argp);
|
||||
if (ret)
|
||||
pr_err("failed Qqseecom_set_mem_param request: %d\n",
|
||||
|
@ -2136,6 +2221,8 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
break;
|
||||
}
|
||||
case QSEECOM_IOCTL_LOAD_APP_REQ: {
|
||||
data->type = QSEECOM_CLIENT_APP;
|
||||
pr_debug("LOAD_APP_REQ: qseecom_addr = 0x%x\n", (u32)data);
|
||||
mutex_lock(&app_access_lock);
|
||||
atomic_inc(&data->ioctl_count);
|
||||
ret = qseecom_load_app(data, argp);
|
||||
|
@ -2146,9 +2233,10 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
break;
|
||||
}
|
||||
case QSEECOM_IOCTL_UNLOAD_APP_REQ: {
|
||||
pr_debug("UNLOAD_APP: qseecom_addr = 0x%x\n", (u32)data);
|
||||
mutex_lock(&app_access_lock);
|
||||
atomic_inc(&data->ioctl_count);
|
||||
ret = qseecom_unload_app(data);
|
||||
ret = qseecom_unload_app(data, false);
|
||||
atomic_dec(&data->ioctl_count);
|
||||
mutex_unlock(&app_access_lock);
|
||||
if (ret)
|
||||
|
@ -2182,6 +2270,7 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
break;
|
||||
}
|
||||
case QSEECOM_IOCTL_LOAD_EXTERNAL_ELF_REQ: {
|
||||
data->type = QSEECOM_UNAVAILABLE_CLIENT_APP;
|
||||
data->released = true;
|
||||
if (qseecom.qseos_version == QSEOS_VERSION_13) {
|
||||
pr_err("Loading External elf image unsupported in rev 0x13\n");
|
||||
|
@ -2214,6 +2303,8 @@ static long qseecom_ioctl(struct file *file, unsigned cmd,
|
|||
break;
|
||||
}
|
||||
case QSEECOM_IOCTL_APP_LOADED_QUERY_REQ: {
|
||||
data->type = QSEECOM_CLIENT_APP;
|
||||
pr_debug("APP_LOAD_QUERY: qseecom_addr = 0x%x\n", (u32)data);
|
||||
mutex_lock(&app_access_lock);
|
||||
atomic_inc(&data->ioctl_count);
|
||||
ret = qseecom_query_app_loaded(data, argp);
|
||||
|
@ -2241,6 +2332,7 @@ static int qseecom_open(struct inode *inode, struct file *file)
|
|||
data->abort = 0;
|
||||
data->type = QSEECOM_GENERIC;
|
||||
data->released = false;
|
||||
memset((void *)data->client.app_name, 0, MAX_APP_NAME_SIZE);
|
||||
init_waitqueue_head(&data->abort_wq);
|
||||
atomic_set(&data->ioctl_count, 0);
|
||||
if (qseecom.qseos_version == QSEOS_VERSION_13) {
|
||||
|
@ -2269,28 +2361,34 @@ static int qseecom_release(struct inode *inode, struct file *file)
|
|||
int ret = 0;
|
||||
|
||||
if (data->released == false) {
|
||||
pr_warn("data->released == false\n");
|
||||
pr_warn("data: released = false, type = %d, data = 0x%x\n",
|
||||
data->type, (u32)data);
|
||||
switch (data->type) {
|
||||
case QSEECOM_LISTENER_SERVICE:
|
||||
ret = qseecom_unregister_listener(data);
|
||||
break;
|
||||
case QSEECOM_CLIENT_APP:
|
||||
ret = qseecom_unload_app(data);
|
||||
ret = qseecom_unload_app(data, true);
|
||||
break;
|
||||
case QSEECOM_SECURE_SERVICE:
|
||||
case QSEECOM_GENERIC:
|
||||
ret = qseecom_unmap_ion_allocated_memory(data);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
pr_err("Close failed\n");
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
case QSEECOM_UNAVAILABLE_CLIENT_APP:
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
pr_err("Unsupported clnt_handle_type %d",
|
||||
data->type);
|
||||
break;
|
||||
}
|
||||
if (ret) {
|
||||
pr_err("Close failed\n");
|
||||
kfree(data);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
if (qseecom.qseos_version == QSEOS_VERSION_13) {
|
||||
mutex_lock(&pil_access_lock);
|
||||
|
@ -2557,7 +2655,7 @@ static int __devinit qseecom_remove(struct platform_device *pdev)
|
|||
goto exit_free_kc_handle;
|
||||
|
||||
list_del(&kclient->list);
|
||||
ret = qseecom_unload_app(kclient->handle->dev);
|
||||
ret = qseecom_unload_app(kclient->handle->dev, false);
|
||||
if (!ret) {
|
||||
kzfree(kclient->handle->dev);
|
||||
kzfree(kclient->handle);
|
||||
|
|
|
@ -62,7 +62,7 @@ static struct miscdevice sec_misc_device = {
|
|||
static ssize_t emmc_checksum_done_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return snprintf(buf, sizeof(buf), "%d\n", emmc_checksum_done);
|
||||
return snprintf(buf, (int)sizeof(buf), "%d\n", emmc_checksum_done);
|
||||
}
|
||||
|
||||
static ssize_t emmc_checksum_done_store(struct device *dev,
|
||||
|
@ -83,7 +83,7 @@ static DEVICE_ATTR(emmc_checksum_done, S_IRUGO | S_IWUSR ,
|
|||
static ssize_t emmc_checksum_pass_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return snprintf(buf, sizeof(buf), "%d\n", emmc_checksum_pass);
|
||||
return snprintf(buf, (int)sizeof(buf), "%d\n", emmc_checksum_pass);
|
||||
}
|
||||
|
||||
static ssize_t emmc_checksum_pass_store(struct device *dev,
|
||||
|
@ -111,7 +111,7 @@ static ssize_t rory_control_show(struct device *dev,
|
|||
|
||||
sec_get_param(param_rory_control, &rory_control);
|
||||
|
||||
return snprintf(buf, sizeof(buf), "%d\n", rory_control);
|
||||
return snprintf(buf, (int)sizeof(buf), "%d\n", rory_control);
|
||||
}
|
||||
|
||||
static ssize_t rory_control_store(struct device *dev,
|
||||
|
|
|
@ -226,7 +226,7 @@ static ssize_t movinand_checksum_done_show
|
|||
pr_err("checksum is not in valuable range.\n");
|
||||
ret = 1;
|
||||
}
|
||||
return snprintf(buf, sizeof(buf), "%u\n", ret);
|
||||
return snprintf(buf, (int)sizeof(buf), "%u\n", ret);
|
||||
}
|
||||
static DEVICE_ATTR(movinand_checksum_done,
|
||||
0664, movinand_checksum_done_show, NULL);
|
||||
|
@ -241,7 +241,7 @@ static ssize_t movinand_checksum_pass_show
|
|||
pr_err("checksum is not in valuable range.\n");
|
||||
ret = 1;
|
||||
}
|
||||
return snprintf(buf, sizeof(buf), "%u\n", ret);
|
||||
return snprintf(buf, (int)sizeof(buf), "%u\n", ret);
|
||||
}
|
||||
static DEVICE_ATTR(movinand_checksum_pass,
|
||||
0664, movinand_checksum_pass_show, NULL);
|
||||
|
|
|
@ -293,6 +293,18 @@ failure:
|
|||
atomic_add(buffers_added, &(pool->available));
|
||||
}
|
||||
|
||||
/*
|
||||
* The final 8 bytes of the buffer list is a counter of frames dropped
|
||||
* because there was not a buffer in the buffer list capable of holding
|
||||
* the frame.
|
||||
*/
|
||||
static void ibmveth_update_rx_no_buffer(struct ibmveth_adapter *adapter)
|
||||
{
|
||||
__be64 *p = adapter->buffer_list_addr + 4096 - 8;
|
||||
|
||||
adapter->rx_no_buffer = be64_to_cpup(p);
|
||||
}
|
||||
|
||||
/* replenish routine */
|
||||
static void ibmveth_replenish_task(struct ibmveth_adapter *adapter)
|
||||
{
|
||||
|
@ -308,8 +320,7 @@ static void ibmveth_replenish_task(struct ibmveth_adapter *adapter)
|
|||
ibmveth_replenish_buffer_pool(adapter, pool);
|
||||
}
|
||||
|
||||
adapter->rx_no_buffer = *(u64 *)(((char*)adapter->buffer_list_addr) +
|
||||
4096 - 8);
|
||||
ibmveth_update_rx_no_buffer(adapter);
|
||||
}
|
||||
|
||||
/* empty and free ana buffer pool - also used to do cleanup in error paths */
|
||||
|
@ -692,8 +703,7 @@ static int ibmveth_close(struct net_device *netdev)
|
|||
|
||||
free_irq(netdev->irq, netdev);
|
||||
|
||||
adapter->rx_no_buffer = *(u64 *)(((char *)adapter->buffer_list_addr) +
|
||||
4096 - 8);
|
||||
ibmveth_update_rx_no_buffer(adapter);
|
||||
|
||||
ibmveth_cleanup(adapter);
|
||||
|
||||
|
|
|
@ -1478,22 +1478,16 @@ static int et131x_mii_read(struct et131x_adapter *adapter, u8 reg, u16 *value)
|
|||
*
|
||||
* Return 0 on success, errno on failure (as defined in errno.h)
|
||||
*/
|
||||
static int et131x_mii_write(struct et131x_adapter *adapter, u8 reg, u16 value)
|
||||
static int et131x_mii_write(struct et131x_adapter *adapter, u8 addr, u8 reg,
|
||||
u16 value)
|
||||
{
|
||||
struct mac_regs __iomem *mac = &adapter->regs->mac;
|
||||
struct phy_device *phydev = adapter->phydev;
|
||||
int status = 0;
|
||||
u8 addr;
|
||||
u32 delay = 0;
|
||||
u32 mii_addr;
|
||||
u32 mii_cmd;
|
||||
u32 mii_indicator;
|
||||
|
||||
if (!phydev)
|
||||
return -EIO;
|
||||
|
||||
addr = phydev->addr;
|
||||
|
||||
/* Save a local copy of the registers we are dealing with so we can
|
||||
* set them back
|
||||
*/
|
||||
|
@ -1550,6 +1544,7 @@ static void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
|
|||
{
|
||||
u16 reg;
|
||||
u16 mask = 0x0001 << bitnum;
|
||||
struct phy_device *phydev = adapter->phydev;
|
||||
|
||||
/* Read the requested register */
|
||||
et131x_mii_read(adapter, regnum, ®);
|
||||
|
@ -1560,11 +1555,11 @@ static void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
|
|||
break;
|
||||
|
||||
case TRUEPHY_BIT_SET:
|
||||
et131x_mii_write(adapter, regnum, reg | mask);
|
||||
et131x_mii_write(adapter, phydev->addr, regnum, reg | mask);
|
||||
break;
|
||||
|
||||
case TRUEPHY_BIT_CLEAR:
|
||||
et131x_mii_write(adapter, regnum, reg & ~mask);
|
||||
et131x_mii_write(adapter, phydev->addr, regnum, reg & ~mask);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1715,17 +1710,7 @@ static int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 val
|
|||
struct net_device *netdev = bus->priv;
|
||||
struct et131x_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
return et131x_mii_write(adapter, reg, value);
|
||||
}
|
||||
|
||||
static int et131x_mdio_reset(struct mii_bus *bus)
|
||||
{
|
||||
struct net_device *netdev = bus->priv;
|
||||
struct et131x_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
et131x_mii_write(adapter, MII_BMCR, BMCR_RESET);
|
||||
|
||||
return 0;
|
||||
return et131x_mii_write(adapter, phy_addr, reg, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1741,12 +1726,13 @@ static int et131x_mdio_reset(struct mii_bus *bus)
|
|||
static void et1310_phy_power_down(struct et131x_adapter *adapter, bool down)
|
||||
{
|
||||
u16 data;
|
||||
struct phy_device *phydev = adapter->phydev;
|
||||
|
||||
et131x_mii_read(adapter, MII_BMCR, &data);
|
||||
data &= ~BMCR_PDOWN;
|
||||
if (down)
|
||||
data |= BMCR_PDOWN;
|
||||
et131x_mii_write(adapter, MII_BMCR, data);
|
||||
et131x_mii_write(adapter, phydev->addr, MII_BMCR, data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1759,6 +1745,7 @@ static void et131x_xcvr_init(struct et131x_adapter *adapter)
|
|||
u16 imr;
|
||||
u16 isr;
|
||||
u16 lcr2;
|
||||
struct phy_device *phydev = adapter->phydev;
|
||||
|
||||
et131x_mii_read(adapter, PHY_INTERRUPT_STATUS, &isr);
|
||||
et131x_mii_read(adapter, PHY_INTERRUPT_MASK, &imr);
|
||||
|
@ -1770,7 +1757,7 @@ static void et131x_xcvr_init(struct et131x_adapter *adapter)
|
|||
ET_PHY_INT_MASK_LINKSTAT &
|
||||
ET_PHY_INT_MASK_ENABLE);
|
||||
|
||||
et131x_mii_write(adapter, PHY_INTERRUPT_MASK, imr);
|
||||
et131x_mii_write(adapter, phydev->addr, PHY_INTERRUPT_MASK, imr);
|
||||
|
||||
/* Set the LED behavior such that LED 1 indicates speed (off =
|
||||
* 10Mbits, blink = 100Mbits, on = 1000Mbits) and LED 2 indicates
|
||||
|
@ -1791,7 +1778,7 @@ static void et131x_xcvr_init(struct et131x_adapter *adapter)
|
|||
else
|
||||
lcr2 |= (LED_VAL_LINKON << LED_TXRX_SHIFT);
|
||||
|
||||
et131x_mii_write(adapter, PHY_LED_2, lcr2);
|
||||
et131x_mii_write(adapter, phydev->addr, PHY_LED_2, lcr2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4202,14 +4189,14 @@ static void et131x_adjust_link(struct net_device *netdev)
|
|||
|
||||
et131x_mii_read(adapter, PHY_MPHY_CONTROL_REG,
|
||||
®ister18);
|
||||
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
|
||||
register18 | 0x4);
|
||||
et131x_mii_write(adapter, PHY_INDEX_REG,
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_MPHY_CONTROL_REG, register18 | 0x4);
|
||||
et131x_mii_write(adapter, phydev->addr, PHY_INDEX_REG,
|
||||
register18 | 0x8402);
|
||||
et131x_mii_write(adapter, PHY_DATA_REG,
|
||||
et131x_mii_write(adapter, phydev->addr, PHY_DATA_REG,
|
||||
register18 | 511);
|
||||
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
|
||||
register18);
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_MPHY_CONTROL_REG, register18);
|
||||
}
|
||||
|
||||
et1310_config_flow_control(adapter);
|
||||
|
@ -4221,7 +4208,8 @@ static void et131x_adjust_link(struct net_device *netdev)
|
|||
et131x_mii_read(adapter, PHY_CONFIG, ®);
|
||||
reg &= ~ET_PHY_CONFIG_TX_FIFO_DEPTH;
|
||||
reg |= ET_PHY_CONFIG_FIFO_DEPTH_32;
|
||||
et131x_mii_write(adapter, PHY_CONFIG, reg);
|
||||
et131x_mii_write(adapter, phydev->addr, PHY_CONFIG,
|
||||
reg);
|
||||
}
|
||||
|
||||
et131x_set_rx_dma_timer(adapter);
|
||||
|
@ -4254,14 +4242,17 @@ static void et131x_adjust_link(struct net_device *netdev)
|
|||
|
||||
et131x_mii_read(adapter, PHY_MPHY_CONTROL_REG,
|
||||
®ister18);
|
||||
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
|
||||
register18 | 0x4);
|
||||
et131x_mii_write(adapter, PHY_INDEX_REG,
|
||||
register18 | 0x8402);
|
||||
et131x_mii_write(adapter, PHY_DATA_REG,
|
||||
register18 | 511);
|
||||
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
|
||||
register18);
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_MPHY_CONTROL_REG,
|
||||
register18 | 0x4);
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_INDEX_REG,
|
||||
register18 | 0x8402);
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_DATA_REG, register18 | 511);
|
||||
et131x_mii_write(adapter, phydev->addr,
|
||||
PHY_MPHY_CONTROL_REG,
|
||||
register18);
|
||||
}
|
||||
|
||||
/* Free the packets being actively sent & stopped */
|
||||
|
@ -5343,10 +5334,6 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
|
|||
/* Copy address into the net_device struct */
|
||||
memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN);
|
||||
|
||||
/* Init variable for counting how long we do not have link status */
|
||||
adapter->boot_coma = 0;
|
||||
et1310_disable_phy_coma(adapter);
|
||||
|
||||
rc = -ENOMEM;
|
||||
|
||||
/* Setup the mii_bus struct */
|
||||
|
@ -5362,7 +5349,6 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
|
|||
adapter->mii_bus->priv = netdev;
|
||||
adapter->mii_bus->read = et131x_mdio_read;
|
||||
adapter->mii_bus->write = et131x_mdio_write;
|
||||
adapter->mii_bus->reset = et131x_mdio_reset;
|
||||
adapter->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
|
||||
if (!adapter->mii_bus->irq) {
|
||||
dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
|
||||
|
@ -5387,6 +5373,10 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
|
|||
/* Setup et1310 as per the documentation */
|
||||
et131x_adapter_setup(adapter);
|
||||
|
||||
/* Init variable for counting how long we do not have link status */
|
||||
adapter->boot_coma = 0;
|
||||
et1310_disable_phy_coma(adapter);
|
||||
|
||||
/* We can enable interrupts now
|
||||
*
|
||||
* NOTE - Because registration of interrupt handler is done in the
|
||||
|
|
|
@ -82,23 +82,14 @@ static void rd_detach_hba(struct se_hba *hba)
|
|||
hba->hba_ptr = NULL;
|
||||
}
|
||||
|
||||
/* rd_release_device_space():
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void rd_release_device_space(struct rd_dev *rd_dev)
|
||||
static u32 rd_release_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table *sg_table,
|
||||
u32 sg_table_count)
|
||||
{
|
||||
u32 i, j, page_count = 0, sg_per_table;
|
||||
struct rd_dev_sg_table *sg_table;
|
||||
struct page *pg;
|
||||
struct scatterlist *sg;
|
||||
u32 i, j, page_count = 0, sg_per_table;
|
||||
|
||||
if (!rd_dev->sg_table_array || !rd_dev->sg_table_count)
|
||||
return;
|
||||
|
||||
sg_table = rd_dev->sg_table_array;
|
||||
|
||||
for (i = 0; i < rd_dev->sg_table_count; i++) {
|
||||
for (i = 0; i < sg_table_count; i++) {
|
||||
sg = sg_table[i].sg_table;
|
||||
sg_per_table = sg_table[i].rd_sg_count;
|
||||
|
||||
|
@ -109,16 +100,28 @@ static void rd_release_device_space(struct rd_dev *rd_dev)
|
|||
page_count++;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(sg);
|
||||
}
|
||||
|
||||
kfree(sg_table);
|
||||
return page_count;
|
||||
}
|
||||
|
||||
static void rd_release_device_space(struct rd_dev *rd_dev)
|
||||
{
|
||||
u32 page_count;
|
||||
|
||||
if (!rd_dev->sg_table_array || !rd_dev->sg_table_count)
|
||||
return;
|
||||
|
||||
page_count = rd_release_sgl_table(rd_dev, rd_dev->sg_table_array,
|
||||
rd_dev->sg_table_count);
|
||||
|
||||
pr_debug("CORE_RD[%u] - Released device space for Ramdisk"
|
||||
" Device ID: %u, pages %u in %u tables total bytes %lu\n",
|
||||
rd_dev->rd_host->rd_host_id, rd_dev->rd_dev_id, page_count,
|
||||
rd_dev->sg_table_count, (unsigned long)page_count * PAGE_SIZE);
|
||||
|
||||
kfree(sg_table);
|
||||
rd_dev->sg_table_array = NULL;
|
||||
rd_dev->sg_table_count = 0;
|
||||
}
|
||||
|
@ -128,33 +131,15 @@ static void rd_release_device_space(struct rd_dev *rd_dev)
|
|||
*
|
||||
*
|
||||
*/
|
||||
static int rd_build_device_space(struct rd_dev *rd_dev)
|
||||
static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table *sg_table,
|
||||
u32 total_sg_needed, unsigned char init_payload)
|
||||
{
|
||||
u32 i = 0, j, page_offset = 0, sg_per_table, sg_tables, total_sg_needed;
|
||||
u32 i = 0, j, page_offset = 0, sg_per_table;
|
||||
u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE /
|
||||
sizeof(struct scatterlist));
|
||||
struct rd_dev_sg_table *sg_table;
|
||||
struct page *pg;
|
||||
struct scatterlist *sg;
|
||||
|
||||
if (rd_dev->rd_page_count <= 0) {
|
||||
pr_err("Illegal page count: %u for Ramdisk device\n",
|
||||
rd_dev->rd_page_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
total_sg_needed = rd_dev->rd_page_count;
|
||||
|
||||
sg_tables = (total_sg_needed / max_sg_per_table) + 1;
|
||||
|
||||
sg_table = kzalloc(sg_tables * sizeof(struct rd_dev_sg_table), GFP_KERNEL);
|
||||
if (!sg_table) {
|
||||
pr_err("Unable to allocate memory for Ramdisk"
|
||||
" scatterlist tables\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rd_dev->sg_table_array = sg_table;
|
||||
rd_dev->sg_table_count = sg_tables;
|
||||
unsigned char *p;
|
||||
|
||||
while (total_sg_needed) {
|
||||
sg_per_table = (total_sg_needed > max_sg_per_table) ?
|
||||
|
@ -185,16 +170,59 @@ static int rd_build_device_space(struct rd_dev *rd_dev)
|
|||
}
|
||||
sg_assign_page(&sg[j], pg);
|
||||
sg[j].length = PAGE_SIZE;
|
||||
|
||||
p = kmap(pg);
|
||||
memset(p, init_payload, PAGE_SIZE);
|
||||
kunmap(pg);
|
||||
}
|
||||
|
||||
page_offset += sg_per_table;
|
||||
total_sg_needed -= sg_per_table;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rd_build_device_space(struct rd_dev *rd_dev)
|
||||
{
|
||||
struct rd_dev_sg_table *sg_table;
|
||||
u32 sg_tables, total_sg_needed;
|
||||
u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE /
|
||||
sizeof(struct scatterlist));
|
||||
int rc;
|
||||
|
||||
if (rd_dev->rd_page_count <= 0) {
|
||||
pr_err("Illegal page count: %u for Ramdisk device\n",
|
||||
rd_dev->rd_page_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Don't need backing pages for NULLIO */
|
||||
if (rd_dev->rd_flags & RDF_NULLIO)
|
||||
return 0;
|
||||
|
||||
total_sg_needed = rd_dev->rd_page_count;
|
||||
|
||||
sg_tables = (total_sg_needed / max_sg_per_table) + 1;
|
||||
|
||||
sg_table = kzalloc(sg_tables * sizeof(struct rd_dev_sg_table), GFP_KERNEL);
|
||||
if (!sg_table) {
|
||||
pr_err("Unable to allocate memory for Ramdisk"
|
||||
" scatterlist tables\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rd_dev->sg_table_array = sg_table;
|
||||
rd_dev->sg_table_count = sg_tables;
|
||||
|
||||
rc = rd_allocate_sgl_table(rd_dev, sg_table, total_sg_needed, 0x00);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
pr_debug("CORE_RD[%u] - Built Ramdisk Device ID: %u space of"
|
||||
" %u pages in %u tables\n", rd_dev->rd_host->rd_host_id,
|
||||
rd_dev->rd_dev_id, rd_dev->rd_page_count,
|
||||
rd_dev->sg_table_count);
|
||||
" %u pages in %u tables\n", rd_dev->rd_host->rd_host_id,
|
||||
rd_dev->rd_dev_id, rd_dev->rd_page_count,
|
||||
rd_dev->sg_table_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1080,12 +1080,12 @@ pci_omegapci_setup(struct serial_private *priv,
|
|||
static int
|
||||
pci_brcm_trumanage_setup(struct serial_private *priv,
|
||||
const struct pciserial_board *board,
|
||||
struct uart_8250_port *port, int idx)
|
||||
struct uart_port *port, int idx)
|
||||
{
|
||||
int ret = pci_default_setup(priv, board, port, idx);
|
||||
|
||||
port->port.type = PORT_BRCM_TRUMANAGE;
|
||||
port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
|
||||
port->type = PORT_BRCM_TRUMANAGE;
|
||||
port->flags = (port->flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -590,12 +590,18 @@ audio_bind(struct usb_configuration *c, struct usb_function *f)
|
|||
goto fail;
|
||||
ac_interface_desc.bInterfaceNumber = status;
|
||||
|
||||
/* AUDIO_AC_INTERFACE */
|
||||
ac_header_desc.baInterfaceNr[0] = status;
|
||||
|
||||
status = usb_interface_id(c, f);
|
||||
if (status < 0)
|
||||
goto fail;
|
||||
as_interface_alt_0_desc.bInterfaceNumber = status;
|
||||
as_interface_alt_1_desc.bInterfaceNumber = status;
|
||||
|
||||
/* AUDIO_AS_INTERFACE */
|
||||
ac_header_desc.baInterfaceNr[1] = status;
|
||||
|
||||
status = -ENODEV;
|
||||
|
||||
/* allocate our endpoint */
|
||||
|
|
|
@ -583,7 +583,7 @@ static int qdss_bind_config(struct usb_configuration *c, const char *name)
|
|||
|
||||
spin_lock_irqsave(&d_lock, flags);
|
||||
list_for_each_entry(ch, &usb_qdss_ch_list, list) {
|
||||
if (!strncmp(name, ch->name, sizeof(ch->name))) {
|
||||
if (!strncmp(name, ch->name, (int)sizeof(ch->name))) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -737,7 +737,7 @@ struct usb_qdss_ch *usb_qdss_open(const char *name, void *priv,
|
|||
spin_lock_irqsave(&d_lock, flags);
|
||||
/* Check if we already have a channel with this name */
|
||||
list_for_each_entry(ch, &usb_qdss_ch_list, list) {
|
||||
if (!strncmp(name, ch->name, sizeof(ch->name))) {
|
||||
if (!strncmp(name, ch->name, (int)sizeof(ch->name))) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -98,6 +98,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||
/* AMD PLL quirk */
|
||||
if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info())
|
||||
xhci->quirks |= XHCI_AMD_PLL_FIX;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_AMD)
|
||||
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||
pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) {
|
||||
xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
|
||||
|
|
|
@ -2528,7 +2528,8 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
|||
* last TRB of the previous TD. The command completion handle
|
||||
* will take care the rest.
|
||||
*/
|
||||
if (!event_seg && trb_comp_code == COMP_STOP_INVAL) {
|
||||
if (!event_seg && (trb_comp_code == COMP_STOP ||
|
||||
trb_comp_code == COMP_STOP_INVAL)) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -3248,6 +3248,7 @@ static const struct usb_device_id sisusb_table[] = {
|
|||
{ USB_DEVICE(0x0711, 0x0918) },
|
||||
{ USB_DEVICE(0x0711, 0x0920) },
|
||||
{ USB_DEVICE(0x0711, 0x0950) },
|
||||
{ USB_DEVICE(0x0711, 0x5200) },
|
||||
{ USB_DEVICE(0x182d, 0x021c) },
|
||||
{ USB_DEVICE(0x182d, 0x0269) },
|
||||
{ }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2009-2013, Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2009-2014, Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -2584,7 +2584,8 @@ static void msm_otg_sm_work(struct work_struct *w)
|
|||
* switch from ACA to PMIC. Check ID state
|
||||
* before entering into low power mode.
|
||||
*/
|
||||
if (!msm_otg_read_pmic_id_state(motg)) {
|
||||
if ((motg->pdata->otg_control == OTG_PMIC_CONTROL) &&
|
||||
!msm_otg_read_pmic_id_state(motg)) {
|
||||
pr_debug("process missed ID intr\n");
|
||||
clear_bit(ID, &motg->inputs);
|
||||
work = 1;
|
||||
|
@ -3369,9 +3370,12 @@ static int msm_otg_mode_show(struct seq_file *s, void *unused)
|
|||
struct usb_phy *phy = &motg->phy;
|
||||
|
||||
switch (phy->state) {
|
||||
case OTG_STATE_A_WAIT_BCON:
|
||||
case OTG_STATE_A_HOST:
|
||||
case OTG_STATE_A_SUSPEND:
|
||||
seq_printf(s, "host\n");
|
||||
break;
|
||||
case OTG_STATE_B_IDLE:
|
||||
case OTG_STATE_B_PERIPHERAL:
|
||||
seq_printf(s, "peripheral\n");
|
||||
break;
|
||||
|
@ -3419,7 +3423,9 @@ static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf,
|
|||
switch (req_mode) {
|
||||
case USB_NONE:
|
||||
switch (phy->state) {
|
||||
case OTG_STATE_A_WAIT_BCON:
|
||||
case OTG_STATE_A_HOST:
|
||||
case OTG_STATE_A_SUSPEND:
|
||||
case OTG_STATE_B_PERIPHERAL:
|
||||
set_bit(ID, &motg->inputs);
|
||||
clear_bit(B_SESS_VLD, &motg->inputs);
|
||||
|
@ -3431,7 +3437,9 @@ static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf,
|
|||
case USB_PERIPHERAL:
|
||||
switch (phy->state) {
|
||||
case OTG_STATE_B_IDLE:
|
||||
case OTG_STATE_A_WAIT_BCON:
|
||||
case OTG_STATE_A_HOST:
|
||||
case OTG_STATE_A_SUSPEND:
|
||||
set_bit(ID, &motg->inputs);
|
||||
set_bit(B_SESS_VLD, &motg->inputs);
|
||||
break;
|
||||
|
|
|
@ -162,6 +162,7 @@ static struct usb_device_id id_table_combined [] = {
|
|||
{ USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_BM_ATOM_NANO_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
|
||||
|
@ -956,6 +957,8 @@ static struct usb_device_id id_table_combined [] = {
|
|||
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) },
|
||||
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) },
|
||||
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) },
|
||||
/* ekey Devices */
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
|
||||
{ }, /* Optional parameter entry */
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
/* www.candapter.com Ewert Energy Systems CANdapter device */
|
||||
#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
|
||||
|
||||
#define FTDI_BM_ATOM_NANO_PID 0xa559 /* Basic Micro ATOM Nano USB2Serial */
|
||||
|
||||
/*
|
||||
* Texas Instruments XDS100v2 JTAG / BeagleBone A3
|
||||
* http://processors.wiki.ti.com/index.php/XDS100
|
||||
|
@ -1369,3 +1371,8 @@
|
|||
#define BRAINBOXES_US_160_6_PID 0x9006 /* US-160 16xRS232 1Mbaud Port 11 and 12 */
|
||||
#define BRAINBOXES_US_160_7_PID 0x9007 /* US-160 16xRS232 1Mbaud Port 13 and 14 */
|
||||
#define BRAINBOXES_US_160_8_PID 0x9008 /* US-160 16xRS232 1Mbaud Port 15 and 16 */
|
||||
|
||||
/*
|
||||
* ekey biometric systems GmbH (http://ekey.net/)
|
||||
*/
|
||||
#define FTDI_EKEY_CONV_USB_PID 0xCB08 /* Converter USB */
|
||||
|
|
|
@ -499,6 +499,10 @@ static void option_instat_callback(struct urb *urb);
|
|||
#define INOVIA_VENDOR_ID 0x20a6
|
||||
#define INOVIA_SEW858 0x1105
|
||||
|
||||
/* VIA Telecom */
|
||||
#define VIATELECOM_VENDOR_ID 0x15eb
|
||||
#define VIATELECOM_PRODUCT_CDS7 0x0001
|
||||
|
||||
/* some devices interfaces need special handling due to a number of reasons */
|
||||
enum option_blacklist_reason {
|
||||
OPTION_BLACKLIST_NONE = 0,
|
||||
|
@ -1744,6 +1748,7 @@ static const struct usb_device_id option_ids[] = {
|
|||
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
|
||||
{ USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) },
|
||||
{ USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
|
|
@ -51,6 +51,7 @@ static const struct usb_device_id id_table[] = {
|
|||
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) },
|
||||
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) },
|
||||
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) },
|
||||
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ZTEK) },
|
||||
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
|
||||
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
|
||||
{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define PL2303_PRODUCT_ID_GPRS 0x0609
|
||||
#define PL2303_PRODUCT_ID_HCR331 0x331a
|
||||
#define PL2303_PRODUCT_ID_MOTOROLA 0x0307
|
||||
#define PL2303_PRODUCT_ID_ZTEK 0xe1f1
|
||||
|
||||
#define ATEN_VENDOR_ID 0x0557
|
||||
#define ATEN_VENDOR_ID2 0x0547
|
||||
|
|
|
@ -794,29 +794,37 @@ int usb_serial_probe(struct usb_interface *interface,
|
|||
if (usb_endpoint_is_bulk_in(endpoint)) {
|
||||
/* we found a bulk in endpoint */
|
||||
dbg("found bulk in on endpoint %d", i);
|
||||
bulk_in_endpoint[num_bulk_in] = endpoint;
|
||||
++num_bulk_in;
|
||||
if (num_bulk_in < MAX_NUM_PORTS) {
|
||||
bulk_in_endpoint[num_bulk_in] = endpoint;
|
||||
++num_bulk_in;
|
||||
}
|
||||
}
|
||||
|
||||
if (usb_endpoint_is_bulk_out(endpoint)) {
|
||||
/* we found a bulk out endpoint */
|
||||
dbg("found bulk out on endpoint %d", i);
|
||||
bulk_out_endpoint[num_bulk_out] = endpoint;
|
||||
++num_bulk_out;
|
||||
if (num_bulk_out < MAX_NUM_PORTS) {
|
||||
bulk_out_endpoint[num_bulk_out] = endpoint;
|
||||
++num_bulk_out;
|
||||
}
|
||||
}
|
||||
|
||||
if (usb_endpoint_is_int_in(endpoint)) {
|
||||
/* we found a interrupt in endpoint */
|
||||
dbg("found interrupt in on endpoint %d", i);
|
||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||
++num_interrupt_in;
|
||||
if (num_interrupt_in < MAX_NUM_PORTS) {
|
||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||
++num_interrupt_in;
|
||||
}
|
||||
}
|
||||
|
||||
if (usb_endpoint_is_int_out(endpoint)) {
|
||||
/* we found an interrupt out endpoint */
|
||||
dbg("found interrupt out on endpoint %d", i);
|
||||
interrupt_out_endpoint[num_interrupt_out] = endpoint;
|
||||
++num_interrupt_out;
|
||||
if (num_interrupt_out < MAX_NUM_PORTS) {
|
||||
interrupt_out_endpoint[num_interrupt_out] = endpoint;
|
||||
++num_interrupt_out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -839,8 +847,10 @@ int usb_serial_probe(struct usb_interface *interface,
|
|||
if (usb_endpoint_is_int_in(endpoint)) {
|
||||
/* we found a interrupt in endpoint */
|
||||
dbg("found interrupt in for Prolific device on separate interface");
|
||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||
++num_interrupt_in;
|
||||
if (num_interrupt_in < MAX_NUM_PORTS) {
|
||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||
++num_interrupt_in;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -879,6 +889,11 @@ int usb_serial_probe(struct usb_interface *interface,
|
|||
num_ports = type->num_ports;
|
||||
}
|
||||
|
||||
if (num_ports > MAX_NUM_PORTS) {
|
||||
dev_warn(&interface->dev, "too many ports requested: %d\n", num_ports);
|
||||
num_ports = MAX_NUM_PORTS;
|
||||
}
|
||||
|
||||
serial->num_ports = num_ports;
|
||||
serial->num_bulk_in = num_bulk_in;
|
||||
serial->num_bulk_out = num_bulk_out;
|
||||
|
|
|
@ -953,6 +953,10 @@ static void command_port_read_callback(struct urb *urb)
|
|||
dbg("%s - command_info is NULL, exiting.", __func__);
|
||||
return;
|
||||
}
|
||||
if (!urb->actual_length) {
|
||||
dev_dbg(&urb->dev->dev, "%s - empty response, exiting.\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (status) {
|
||||
dbg("%s - nonzero urb status: %d", __func__, status);
|
||||
if (status != -ENOENT)
|
||||
|
@ -974,7 +978,8 @@ static void command_port_read_callback(struct urb *urb)
|
|||
/* These are unsolicited reports from the firmware, hence no
|
||||
waiting command to wakeup */
|
||||
dbg("%s - event received", __func__);
|
||||
} else if (data[0] == WHITEHEAT_GET_DTR_RTS) {
|
||||
} else if ((data[0] == WHITEHEAT_GET_DTR_RTS) &&
|
||||
(urb->actual_length - 1 <= sizeof(command_info->result_buffer))) {
|
||||
memcpy(command_info->result_buffer, &data[1],
|
||||
urb->actual_length - 1);
|
||||
command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
|
||||
|
|
|
@ -522,6 +522,12 @@ config FB_MSM_OVERLAY0_WRITEBACK
|
|||
---help---
|
||||
Support for MDP4 OVERLAY0 write back mode
|
||||
|
||||
config FB_MSM_ENABLE_LCD_EN2
|
||||
bool "LCD_EN2 Enable for J Active project"
|
||||
default n
|
||||
---help---
|
||||
Enable LCD EN2 pin to control AVDD
|
||||
|
||||
config FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT
|
||||
bool
|
||||
select FB_MSM_MIPI_DSI_RENESAS_TFT
|
||||
|
|
|
@ -71,7 +71,12 @@
|
|||
|
||||
int play_speed_1_5;
|
||||
#if defined(CONFIG_FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT_PANEL)
|
||||
#if defined (CONFIG_MACH_JACTIVE_EUR) || defined (CONFIG_MACH_JACTIVE_ATT)
|
||||
static int cabc = -1;
|
||||
#else
|
||||
static int cabc = 0;
|
||||
#endif
|
||||
|
||||
extern int mipi_samsung_cabc_onoff ( int enable );
|
||||
#endif
|
||||
|
||||
|
@ -1032,7 +1037,12 @@ static ssize_t cabc_store(struct device *dev,
|
|||
|
||||
return size;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT_PANEL)
|
||||
int is_cabc_on ( void )
|
||||
{
|
||||
return cabc;
|
||||
}
|
||||
#endif
|
||||
static DEVICE_ATTR(cabc, 0664,
|
||||
cabc_show,
|
||||
cabc_store);
|
||||
|
|
|
@ -133,6 +133,9 @@ struct mdnie_lite_tun_type {
|
|||
void mdnie_lite_tuning_init(void);
|
||||
void init_mdnie_class(void);
|
||||
void is_negative_on(void);
|
||||
#if defined(CONFIG_FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT_PANEL)
|
||||
int is_cabc_on ( void );
|
||||
#endif
|
||||
|
||||
void coordinate_tunning(int x, int y);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -170,6 +170,9 @@ static int mipi_dsi_on(struct platform_device *pdev)
|
|||
u32 dummy_xres, dummy_yres;
|
||||
int target_type = 0;
|
||||
u32 tmp;
|
||||
#if defined(CONFIG_FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT_PANEL)
|
||||
static int is_booting = 1;
|
||||
#endif
|
||||
|
||||
pr_debug("%s+:\n", __func__);
|
||||
|
||||
|
@ -185,6 +188,23 @@ static int mipi_dsi_on(struct platform_device *pdev)
|
|||
mipi_dsi_pdata->power_common();
|
||||
|
||||
#if defined(CONFIG_SUPPORT_SECOND_POWER)
|
||||
#if defined(CONFIG_FB_MSM_MIPI_RENESAS_TFT_VIDEO_FULL_HD_PT_PANEL)
|
||||
if( is_booting == 1 )
|
||||
{
|
||||
is_booting = 0;
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
usleep(5000);
|
||||
if (mipi_dsi_pdata && mipi_dsi_pdata->active_reset)
|
||||
mipi_dsi_pdata->active_reset(0); /* low */
|
||||
usleep(2000);
|
||||
|
||||
if (mipi_dsi_pdata && mipi_dsi_pdata->panel_power_save)
|
||||
mipi_dsi_pdata->panel_power_save(0);
|
||||
msleep(10);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mipi_dsi_pdata && mipi_dsi_pdata->panel_power_save)
|
||||
mipi_dsi_pdata->panel_power_save(1);
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,11 @@ static struct mipi_panel_data mipi_pd;
|
|||
enum {
|
||||
GAMMA_0CD = 1,
|
||||
GAMMA_5CD = 2,
|
||||
#if defined (CONFIG_MACH_JACTIVE_EUR) || defined (CONFIG_MACH_JACTIVE_ATT)
|
||||
GAMMA_10CD = 3, // MIN 10 from platform
|
||||
#else
|
||||
GAMMA_10CD = 4, // MIN 10 from platform
|
||||
#endif
|
||||
GAMMA_15CD = 7,
|
||||
GAMMA_20CD = 10,
|
||||
GAMMA_25CD = 13,
|
||||
|
@ -121,16 +125,23 @@ static char renesas_backlight_control[] = {
|
|||
0x2C,
|
||||
};
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
static char renesas_teon_control[] = {
|
||||
0x35,
|
||||
0x01,
|
||||
};
|
||||
|
||||
static char renesas_teoff_control[] = {
|
||||
0x35,
|
||||
0x00,
|
||||
};
|
||||
#endif
|
||||
|
||||
static char renesas_memory_access_control[] = {
|
||||
0x36,
|
||||
0xC0,
|
||||
};
|
||||
|
||||
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
static char renesas_F0_control[] = {
|
||||
0xF0,
|
||||
0x5A,0x5A,
|
||||
|
@ -157,12 +168,25 @@ static char renesas_FB_control[] = {
|
|||
0x19,0x1D,0x20,0x22,0x24,0x23,0x22,0x1C,0x14,0x10,
|
||||
0x12,0x15,0x1B,0x1A,0x18,0x15,0x10,0x05,0x06,
|
||||
};
|
||||
|
||||
#endif
|
||||
static char renesas_display_on[] = { 0x29, /* no param */ };
|
||||
static char renesas_display_off[] = { 0x28, /* no param */ };
|
||||
static char renesas_sleep_in[] = { 0x10, /* no param */ };
|
||||
static char renesas_sleep_out[] = { 0x11, /* no param */ };
|
||||
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
static char renesas_cabc_off_test[] = {
|
||||
0xCE,
|
||||
0x80, 0x19, 0x19, 0x19, 0x19,
|
||||
0x19, 0x19, 0x19, 0x19, 0x19,
|
||||
0x19, 0x19, 0x19, 0x19,
|
||||
};
|
||||
|
||||
static char renesas_cabc_on_test[] = {
|
||||
0xCE,
|
||||
0x00,
|
||||
};
|
||||
#endif
|
||||
static struct dsi_cmd_desc renesas_ready_to_on_cmds[] = {
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_brightness_setting), renesas_brightness_setting},
|
||||
|
@ -173,24 +197,34 @@ static struct dsi_cmd_desc renesas_ready_to_on_cmds[] = {
|
|||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_backlight_control), renesas_backlight_control},
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_teon_control), renesas_teon_control},
|
||||
#endif
|
||||
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 120,
|
||||
sizeof(renesas_sleep_out), renesas_sleep_out},
|
||||
|
||||
#if !defined(CONFIG_MACH_JACTIVE_ATT) && !defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0, sizeof(renesas_F0_control), renesas_F0_control},
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0, sizeof(renesas_FA_control), renesas_FA_control},
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0, sizeof(renesas_FB_control), renesas_FB_control},
|
||||
|
||||
#endif
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_display_on), renesas_display_on},
|
||||
};
|
||||
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
static struct dsi_cmd_desc panel_off_cmds[] = {
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 40, sizeof(renesas_display_off), renesas_display_off},
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 120, sizeof(renesas_sleep_in), renesas_sleep_in},
|
||||
};
|
||||
#else
|
||||
static struct dsi_cmd_desc panel_off_cmds[] = {
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_display_off), renesas_display_off},
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
static struct dsi_cmd_desc panel_late_on_cmds[] = {
|
||||
{DTYPE_DCS_LWRITE, 1, 0, 0, 5,
|
||||
|
@ -231,16 +265,35 @@ static struct dsi_cmd_desc brightness_packet[] = {
|
|||
|
||||
#if defined(AUTO_BRIGHTNESS_CABC_FUNCTION)
|
||||
static struct dsi_cmd_desc panel_cabc_enable_cmds[] = {
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_cabc_on_test), renesas_cabc_on_test},
|
||||
#endif
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_cabc_enable_control), renesas_cabc_enable_control},
|
||||
};
|
||||
|
||||
static struct dsi_cmd_desc panel_cabc_disable_cmds[] = {
|
||||
#if defined(CONFIG_MACH_JACTIVE_ATT) || defined(CONFIG_MACH_JACTIVE_EUR)
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_cabc_off_test), renesas_cabc_off_test},
|
||||
#endif
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_cabc_disable_control), renesas_cabc_disable_control},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
static struct dsi_cmd_desc panel_hsync_on_cmds[] = {
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_teon_control), renesas_teon_control},
|
||||
};
|
||||
|
||||
static struct dsi_cmd_desc panel_hsync_off_cmds[] = {
|
||||
{DTYPE_GEN_LWRITE, 1, 0, 0, 0,
|
||||
sizeof(renesas_teoff_control), renesas_teoff_control},
|
||||
};
|
||||
#endif
|
||||
static int get_candela_index(int bl_level)
|
||||
{
|
||||
int backlightlevel;
|
||||
|
@ -462,6 +515,12 @@ static struct mipi_panel_data mipi_pd = {
|
|||
.cabc_disable = {panel_cabc_disable_cmds
|
||||
, ARRAY_SIZE(panel_cabc_disable_cmds)},
|
||||
#endif
|
||||
#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_PREVENT_HSYNC_LEAKAGE)
|
||||
.hsync_on = {panel_hsync_on_cmds
|
||||
, ARRAY_SIZE(panel_hsync_on_cmds)},
|
||||
.hsync_off = {panel_hsync_off_cmds
|
||||
, ARRAY_SIZE(panel_hsync_off_cmds)},
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
|
||||
|
@ -469,8 +528,13 @@ static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
|
|||
/* regulator */
|
||||
.regulator = {0x03, 0x0a, 0x04, 0x00, 0x20},
|
||||
/* timing */
|
||||
#if defined (CONFIG_MACH_JACTIVE_EUR) || defined (CONFIG_MACH_JACTIVE_ATT)
|
||||
.timing = {0x5C, 0x37, 0x39, 0x00, 0x62, 0x57, 0x3B, 0x3B,
|
||||
0x44, 0x03, 0x04, 0xa0},
|
||||
#else
|
||||
.timing = {0xD9, 0x40, 0x3C, 0x00, 0x52, 0x5E, 0x32, 0x40,
|
||||
0x3C, 0x03, 0x04, 0xa0},
|
||||
#endif
|
||||
/* phy ctrl */
|
||||
.ctrl = {0x5f, 0x00, 0x00, 0x10},
|
||||
/* strength */
|
||||
|
@ -526,9 +590,11 @@ static int __init mipi_cmd_samsung_tft_full_hd_pt_init(void)
|
|||
pinfo.bl_max = 255;
|
||||
pinfo.bl_min = 1;
|
||||
pinfo.fb_num = 2;
|
||||
|
||||
#if defined (CONFIG_MACH_JACTIVE_EUR) || defined (CONFIG_MACH_JACTIVE_ATT)
|
||||
pinfo.clk_rate = 906000000;
|
||||
#else
|
||||
pinfo.clk_rate = 898000000;
|
||||
|
||||
#endif
|
||||
pinfo.mipi.mode = DSI_VIDEO_MODE;
|
||||
pinfo.mipi.pulse_mode_hsa_he = FALSE;
|
||||
pinfo.mipi.hfp_power_stop = TRUE;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue