mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.
This commit is contained in:
commit
e060c38434
3980 changed files with 199093 additions and 61476 deletions
|
|
@ -238,7 +238,6 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
|
|||
extern int pnpacpi_disabled;
|
||||
|
||||
#define PXM_INVAL (-1)
|
||||
#define NID_INVAL (-1)
|
||||
|
||||
int acpi_check_resource_conflict(const struct resource *res);
|
||||
|
||||
|
|
@ -280,6 +279,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
|||
#define OSC_SB_CPUHP_OST_SUPPORT 8
|
||||
#define OSC_SB_APEI_SUPPORT 16
|
||||
|
||||
extern bool osc_sb_apei_support_acked;
|
||||
|
||||
/* PCI defined _OSC bits */
|
||||
/* _OSC DW1 Definition (OS Support Fields) */
|
||||
#define OSC_EXT_PCI_CONFIG_SUPPORT 1
|
||||
|
|
|
|||
|
|
@ -51,5 +51,8 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
|
|||
|
||||
extern void cper_print_aer(const char *prefix, int cper_severity,
|
||||
struct aer_capability_regs *aer);
|
||||
extern int cper_severity_to_aer(int cper_severity);
|
||||
extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
|
||||
int severity);
|
||||
#endif //_AER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <linux/uio.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define AIO_MAXSEGS 4
|
||||
#define AIO_KIOGRP_NR_ATOMIC 8
|
||||
|
|
|
|||
|
|
@ -172,8 +172,11 @@ struct pl08x_dma_chan {
|
|||
int phychan_hold;
|
||||
struct tasklet_struct tasklet;
|
||||
char *name;
|
||||
struct pl08x_channel_data *cd;
|
||||
dma_addr_t runtime_addr;
|
||||
const struct pl08x_channel_data *cd;
|
||||
dma_addr_t src_addr;
|
||||
dma_addr_t dst_addr;
|
||||
u32 src_cctl;
|
||||
u32 dst_cctl;
|
||||
enum dma_data_direction runtime_direction;
|
||||
dma_cookie_t lc;
|
||||
struct list_head pend_list;
|
||||
|
|
@ -202,7 +205,7 @@ struct pl08x_dma_chan {
|
|||
* @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
|
||||
*/
|
||||
struct pl08x_platform_data {
|
||||
struct pl08x_channel_data *slave_channels;
|
||||
const struct pl08x_channel_data *slave_channels;
|
||||
unsigned int num_slave_channels;
|
||||
struct pl08x_channel_data memcpy_channel;
|
||||
int (*get_signal)(struct pl08x_dma_chan *);
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ struct atm_cirange {
|
|||
#include <linux/skbuff.h> /* struct sk_buff */
|
||||
#include <linux/uio.h>
|
||||
#include <net/sock.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
#include <linux/proc_fs.h>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,31 @@
|
|||
/* Atomic operations usable in machine independent code */
|
||||
#ifndef _LINUX_ATOMIC_H
|
||||
#define _LINUX_ATOMIC_H
|
||||
#include <asm/atomic.h>
|
||||
|
||||
/**
|
||||
* atomic_add_unless - add unless the number is already a given value
|
||||
* @v: pointer of type atomic_t
|
||||
* @a: the amount to add to v...
|
||||
* @u: ...unless v is equal to u.
|
||||
*
|
||||
* Atomically adds @a to @v, so long as @v was not already @u.
|
||||
* Returns non-zero if @v was not @u, and zero otherwise.
|
||||
*/
|
||||
static inline int atomic_add_unless(atomic_t *v, int a, int u)
|
||||
{
|
||||
return __atomic_add_unless(v, a, u) != u;
|
||||
}
|
||||
|
||||
/**
|
||||
* atomic_inc_not_zero - increment unless the number is zero
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically increments @v by 1, so long as @v is non-zero.
|
||||
* Returns non-zero if @v was non-zero, and zero otherwise.
|
||||
*/
|
||||
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
|
||||
|
||||
/**
|
||||
* atomic_inc_not_zero_hint - increment if not null
|
||||
* @v: pointer of type atomic_t
|
||||
|
|
@ -73,4 +97,8 @@ static inline void atomic_or(int i, atomic_t *v)
|
|||
}
|
||||
#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */
|
||||
|
||||
#include <asm-generic/atomic-long.h>
|
||||
#ifdef CONFIG_GENERIC_ATOMIC64
|
||||
#include <asm-generic/atomic64.h>
|
||||
#endif
|
||||
#endif /* _LINUX_ATOMIC_H */
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
struct page;
|
||||
struct device;
|
||||
|
|
@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
|
|||
enum bdi_stat_item {
|
||||
BDI_RECLAIMABLE,
|
||||
BDI_WRITEBACK,
|
||||
BDI_WRITTEN,
|
||||
NR_BDI_STAT_ITEMS
|
||||
};
|
||||
|
||||
|
|
@ -57,6 +58,7 @@ struct bdi_writeback {
|
|||
struct list_head b_dirty; /* dirty inodes */
|
||||
struct list_head b_io; /* parked for writeback */
|
||||
struct list_head b_more_io; /* parked for more writeback */
|
||||
spinlock_t list_lock; /* protects the b_* lists */
|
||||
};
|
||||
|
||||
struct backing_dev_info {
|
||||
|
|
@ -71,6 +73,11 @@ struct backing_dev_info {
|
|||
|
||||
struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
|
||||
|
||||
unsigned long bw_time_stamp; /* last time write bw is updated */
|
||||
unsigned long written_stamp; /* pages written at bw_time_stamp */
|
||||
unsigned long write_bandwidth; /* the estimated write bandwidth */
|
||||
unsigned long avg_write_bandwidth; /* further smoothed write bw */
|
||||
|
||||
struct prop_local_percpu completions;
|
||||
int dirty_exceeded;
|
||||
|
||||
|
|
@ -106,6 +113,7 @@ int bdi_writeback_thread(void *data);
|
|||
int bdi_has_dirty_io(struct backing_dev_info *bdi);
|
||||
void bdi_arm_supers_timer(void);
|
||||
void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
|
||||
void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2);
|
||||
|
||||
extern spinlock_t bdi_lock;
|
||||
extern struct list_head bdi_list;
|
||||
|
|
|
|||
|
|
@ -63,15 +63,10 @@ static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc)
|
|||
return container_of(gc, struct bgpio_chip, gc);
|
||||
}
|
||||
|
||||
int __devexit bgpio_remove(struct bgpio_chip *bgc);
|
||||
int __devinit bgpio_init(struct bgpio_chip *bgc,
|
||||
struct device *dev,
|
||||
unsigned long sz,
|
||||
void __iomem *dat,
|
||||
void __iomem *set,
|
||||
void __iomem *clr,
|
||||
void __iomem *dirout,
|
||||
void __iomem *dirin,
|
||||
bool big_endian);
|
||||
int bgpio_remove(struct bgpio_chip *bgc);
|
||||
int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
|
||||
unsigned long sz, void __iomem *dat, void __iomem *set,
|
||||
void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
|
||||
bool big_endian);
|
||||
|
||||
#endif /* __BASIC_MMIO_GPIO_H */
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/*
|
||||
* bit-based spin_lock()
|
||||
|
|
|
|||
|
|
@ -144,7 +144,9 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
|
|||
extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
|
||||
extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
|
||||
extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits);
|
||||
extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits);
|
||||
|
||||
#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
|
||||
#define BITMAP_LAST_WORD_MASK(nbits) \
|
||||
( \
|
||||
((nbits) % BITS_PER_LONG) ? \
|
||||
|
|
|
|||
|
|
@ -125,7 +125,11 @@ enum rq_flag_bits {
|
|||
__REQ_SYNC, /* request is sync (sync write or read) */
|
||||
__REQ_META, /* metadata io request */
|
||||
__REQ_DISCARD, /* request to discard sectors */
|
||||
__REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
|
||||
|
||||
__REQ_NOIDLE, /* don't anticipate more IO after this one */
|
||||
__REQ_FUA, /* forced unit access */
|
||||
__REQ_FLUSH, /* request for cache flush */
|
||||
|
||||
/* bio only flags */
|
||||
__REQ_RAHEAD, /* read ahead, can fail anytime */
|
||||
|
|
@ -135,7 +139,6 @@ enum rq_flag_bits {
|
|||
/* request only flags */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
__REQ_FUA, /* forced unit access */
|
||||
__REQ_NOMERGE, /* don't touch this for merging */
|
||||
__REQ_STARTED, /* drive already may have started this one */
|
||||
__REQ_DONTPREP, /* don't call prep for this one */
|
||||
|
|
@ -146,11 +149,9 @@ enum rq_flag_bits {
|
|||
__REQ_PREEMPT, /* set for "ide_preempt" requests */
|
||||
__REQ_ALLOCED, /* request came from our alloc pool */
|
||||
__REQ_COPY_USER, /* contains copies of user pages */
|
||||
__REQ_FLUSH, /* request for cache flush */
|
||||
__REQ_FLUSH_SEQ, /* request for flush sequence */
|
||||
__REQ_IO_STAT, /* account I/O stat */
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ struct request_pm_state;
|
|||
struct blk_trace;
|
||||
struct request;
|
||||
struct sg_io_hdr;
|
||||
struct bsg_job;
|
||||
|
||||
#define BLKDEV_MIN_RQ 4
|
||||
#define BLKDEV_MAX_RQ 128 /* Default maximum */
|
||||
|
|
@ -117,6 +118,7 @@ struct request {
|
|||
struct {
|
||||
unsigned int seq;
|
||||
struct list_head list;
|
||||
rq_end_io_fn *saved_end_io;
|
||||
} flush;
|
||||
};
|
||||
|
||||
|
|
@ -209,6 +211,7 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
|
|||
typedef void (softirq_done_fn)(struct request *);
|
||||
typedef int (dma_drain_needed_fn)(struct request *);
|
||||
typedef int (lld_busy_fn) (struct request_queue *q);
|
||||
typedef int (bsg_job_fn) (struct bsg_job *);
|
||||
|
||||
enum blk_eh_timer_return {
|
||||
BLK_EH_NOT_HANDLED,
|
||||
|
|
@ -375,6 +378,8 @@ struct request_queue {
|
|||
struct mutex sysfs_lock;
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_BSG)
|
||||
bsg_job_fn *bsg_job_fn;
|
||||
int bsg_job_size;
|
||||
struct bsg_class_device bsg_dev;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
enum blktrace_cat {
|
||||
BLK_TC_READ = 1 << 0, /* reads */
|
||||
BLK_TC_WRITE = 1 << 1, /* writes */
|
||||
BLK_TC_BARRIER = 1 << 2, /* barrier */
|
||||
BLK_TC_FLUSH = 1 << 2, /* flush */
|
||||
BLK_TC_SYNC = 1 << 3, /* sync IO */
|
||||
BLK_TC_SYNCIO = BLK_TC_SYNC,
|
||||
BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
|
||||
|
|
@ -28,8 +28,9 @@ enum blktrace_cat {
|
|||
BLK_TC_META = 1 << 12, /* metadata */
|
||||
BLK_TC_DISCARD = 1 << 13, /* discard requests */
|
||||
BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
|
||||
BLK_TC_FUA = 1 << 15, /* fua requests */
|
||||
|
||||
BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
|
||||
BLK_TC_END = 1 << 15, /* we've run out of bits! */
|
||||
};
|
||||
|
||||
#define BLK_TC_SHIFT (16)
|
||||
|
|
|
|||
73
include/linux/bsg-lib.h
Normal file
73
include/linux/bsg-lib.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* BSG helper library
|
||||
*
|
||||
* Copyright (C) 2008 James Smart, Emulex Corporation
|
||||
* Copyright (C) 2011 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (C) 2011 Mike Christie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _BLK_BSG_
|
||||
#define _BLK_BSG_
|
||||
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
struct request;
|
||||
struct device;
|
||||
struct scatterlist;
|
||||
struct request_queue;
|
||||
|
||||
struct bsg_buffer {
|
||||
unsigned int payload_len;
|
||||
int sg_cnt;
|
||||
struct scatterlist *sg_list;
|
||||
};
|
||||
|
||||
struct bsg_job {
|
||||
struct device *dev;
|
||||
struct request *req;
|
||||
|
||||
/* Transport/driver specific request/reply structs */
|
||||
void *request;
|
||||
void *reply;
|
||||
|
||||
unsigned int request_len;
|
||||
unsigned int reply_len;
|
||||
/*
|
||||
* On entry : reply_len indicates the buffer size allocated for
|
||||
* the reply.
|
||||
*
|
||||
* Upon completion : the message handler must set reply_len
|
||||
* to indicates the size of the reply to be returned to the
|
||||
* caller.
|
||||
*/
|
||||
|
||||
/* DMA payloads for the request/response */
|
||||
struct bsg_buffer request_payload;
|
||||
struct bsg_buffer reply_payload;
|
||||
|
||||
void *dd_data; /* Used for driver-specific storage */
|
||||
};
|
||||
|
||||
void bsg_job_done(struct bsg_job *job, int result,
|
||||
unsigned int reply_payload_rcv_len);
|
||||
int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
|
||||
bsg_job_fn *job_fn, int dd_job_size);
|
||||
void bsg_request_fn(struct request_queue *q);
|
||||
void bsg_remove_queue(struct request_queue *q);
|
||||
void bsg_goose_queue(struct request_queue *q);
|
||||
|
||||
#endif
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
#include <linux/linkage.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/wait.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ struct ceph_msg {
|
|||
bool more_to_follow;
|
||||
bool needs_out_seq;
|
||||
int front_max;
|
||||
unsigned long ack_stamp; /* tx: when we were acked */
|
||||
|
||||
struct ceph_msgpool *pool;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -438,7 +438,6 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
|
|||
struct compat_timespec __user *tsp,
|
||||
const compat_sigset_t __user *sigmask,
|
||||
compat_size_t sigsetsize);
|
||||
asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
|
||||
asmlinkage long compat_sys_signalfd4(int ufd,
|
||||
const compat_sigset_t __user *sigmask,
|
||||
compat_size_t sigsetsize, int flags);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#include <linux/mutex.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define CONFIGFS_ITEM_NAME_LEN 20
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* connector.h
|
||||
*
|
||||
* 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
* 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -75,7 +75,7 @@ struct cn_msg {
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
|
|
|||
|
|
@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu)
|
|||
/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
unsigned int cpufreq_quick_get(unsigned int cpu);
|
||||
unsigned int cpufreq_quick_get_max(unsigned int cpu);
|
||||
#else
|
||||
static inline unsigned int cpufreq_quick_get(unsigned int cpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ struct cpuidle_driver {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE
|
||||
extern void disable_cpuidle(void);
|
||||
extern int cpuidle_idle_call(void);
|
||||
|
||||
extern int cpuidle_register_driver(struct cpuidle_driver *drv);
|
||||
struct cpuidle_driver *cpuidle_get_driver(void);
|
||||
|
|
@ -135,6 +137,8 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev);
|
|||
extern void cpuidle_disable_device(struct cpuidle_device *dev);
|
||||
|
||||
#else
|
||||
static inline void disable_cpuidle(void) { }
|
||||
static inline int cpuidle_idle_call(void) { return -ENODEV; }
|
||||
|
||||
static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
|
||||
{return -ENODEV; }
|
||||
|
|
|
|||
|
|
@ -617,6 +617,20 @@ static inline size_t cpumask_size(void)
|
|||
* ... use 'tmpmask' like a normal struct cpumask * ...
|
||||
*
|
||||
* free_cpumask_var(tmpmask);
|
||||
*
|
||||
*
|
||||
* However, one notable exception is there. alloc_cpumask_var() allocates
|
||||
* only nr_cpumask_bits bits (in the other hand, real cpumask_t always has
|
||||
* NR_CPUS bits). Therefore you don't have to dereference cpumask_var_t.
|
||||
*
|
||||
* cpumask_var_t tmpmask;
|
||||
* if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL))
|
||||
* return -ENOMEM;
|
||||
*
|
||||
* var = *tmpmask;
|
||||
*
|
||||
* This code makes NR_CPUS length memcopy and brings to a memory corruption.
|
||||
* cpumask_copy() provide safe copy functionality.
|
||||
*/
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
typedef struct cpumask *cpumask_var_t;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/key.h>
|
||||
#include <linux/selinux.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
struct user_struct;
|
||||
struct cred;
|
||||
|
|
@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred)
|
|||
/**
|
||||
* current_cred - Access the current task's subjective credentials
|
||||
*
|
||||
* Access the subjective credentials of the current task.
|
||||
* Access the subjective credentials of the current task. RCU-safe,
|
||||
* since nobody else can modify it.
|
||||
*/
|
||||
#define current_cred() \
|
||||
(current->cred)
|
||||
rcu_dereference_protected(current->cred, 1)
|
||||
|
||||
/**
|
||||
* __task_cred - Access a task's objective credentials
|
||||
|
|
@ -306,8 +307,8 @@ static inline void put_cred(const struct cred *_cred)
|
|||
#define get_current_user() \
|
||||
({ \
|
||||
struct user_struct *__u; \
|
||||
struct cred *__cred; \
|
||||
__cred = (struct cred *) current_cred(); \
|
||||
const struct cred *__cred; \
|
||||
__cred = current_cred(); \
|
||||
__u = get_uid(__cred->user); \
|
||||
__u; \
|
||||
})
|
||||
|
|
@ -321,8 +322,8 @@ static inline void put_cred(const struct cred *_cred)
|
|||
#define get_current_groups() \
|
||||
({ \
|
||||
struct group_info *__groups; \
|
||||
struct cred *__cred; \
|
||||
__cred = (struct cred *) current_cred(); \
|
||||
const struct cred *__cred; \
|
||||
__cred = current_cred(); \
|
||||
__groups = get_group_info(__cred->group_info); \
|
||||
__groups; \
|
||||
})
|
||||
|
|
@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred)
|
|||
|
||||
#define current_cred_xxx(xxx) \
|
||||
({ \
|
||||
current->cred->xxx; \
|
||||
current_cred()->xxx; \
|
||||
})
|
||||
|
||||
#define current_uid() (current_cred_xxx(uid))
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#ifndef _LINUX_CRYPTO_H
|
||||
#define _LINUX_CRYPTO_H
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/list.h>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,16 @@
|
|||
|
||||
#define SHA_DIGEST_WORDS 5
|
||||
#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
|
||||
#define SHA_WORKSPACE_WORDS 80
|
||||
#define SHA_WORKSPACE_WORDS 16
|
||||
|
||||
void sha_init(__u32 *buf);
|
||||
void sha_transform(__u32 *digest, const char *data, __u32 *W);
|
||||
|
||||
#define MD5_DIGEST_WORDS 4
|
||||
#define MD5_MESSAGE_BYTES 64
|
||||
|
||||
void md5_transform(__u32 *hash, __u32 const *in);
|
||||
|
||||
__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#ifndef _CS5535_H
|
||||
#define _CS5535_H
|
||||
|
||||
#include <asm/msr.h>
|
||||
|
||||
/* MSRs */
|
||||
#define MSR_GLIU_P2D_RO0 0x10000029
|
||||
|
||||
|
|
@ -38,17 +40,75 @@
|
|||
#define MSR_MFGPT_NR 0x51400029
|
||||
#define MSR_MFGPT_SETUP 0x5140002B
|
||||
|
||||
#define MSR_RTC_DOMA_OFFSET 0x51400055
|
||||
#define MSR_RTC_MONA_OFFSET 0x51400056
|
||||
#define MSR_RTC_CEN_OFFSET 0x51400057
|
||||
|
||||
#define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */
|
||||
|
||||
#define MSR_GX_GLD_MSR_CONFIG 0xC0002001
|
||||
#define MSR_GX_MSR_PADSEL 0xC0002011
|
||||
|
||||
static inline int cs5535_pic_unreqz_select_high(unsigned int group,
|
||||
unsigned int irq)
|
||||
{
|
||||
uint32_t lo, hi;
|
||||
|
||||
rdmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
|
||||
lo &= ~(0xF << (group * 4));
|
||||
lo |= (irq & 0xF) << (group * 4);
|
||||
wrmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* PIC registers */
|
||||
#define CS5536_PIC_INT_SEL1 0x4d0
|
||||
#define CS5536_PIC_INT_SEL2 0x4d1
|
||||
|
||||
/* resource sizes */
|
||||
#define LBAR_GPIO_SIZE 0xFF
|
||||
#define LBAR_MFGPT_SIZE 0x40
|
||||
#define LBAR_ACPI_SIZE 0x40
|
||||
#define LBAR_PMS_SIZE 0x80
|
||||
|
||||
/*
|
||||
* PMC registers (PMS block)
|
||||
* It is only safe to access these registers as dword accesses.
|
||||
* See CS5536 Specification Update erratas 17 & 18
|
||||
*/
|
||||
#define CS5536_PM_SCLK 0x10
|
||||
#define CS5536_PM_IN_SLPCTL 0x20
|
||||
#define CS5536_PM_WKXD 0x34
|
||||
#define CS5536_PM_WKD 0x30
|
||||
#define CS5536_PM_SSC 0x54
|
||||
|
||||
/*
|
||||
* PM registers (ACPI block)
|
||||
* It is only safe to access these registers as dword accesses.
|
||||
* See CS5536 Specification Update erratas 17 & 18
|
||||
*/
|
||||
#define CS5536_PM1_STS 0x00
|
||||
#define CS5536_PM1_EN 0x02
|
||||
#define CS5536_PM1_CNT 0x08
|
||||
#define CS5536_PM_GPE0_STS 0x18
|
||||
#define CS5536_PM_GPE0_EN 0x1c
|
||||
|
||||
/* CS5536_PM1_STS bits */
|
||||
#define CS5536_WAK_FLAG (1 << 15)
|
||||
#define CS5536_PWRBTN_FLAG (1 << 8)
|
||||
|
||||
/* CS5536_PM1_EN bits */
|
||||
#define CS5536_PM_PWRBTN (1 << 8)
|
||||
#define CS5536_PM_RTC (1 << 10)
|
||||
|
||||
/* CS5536_PM_GPE0_STS bits */
|
||||
#define CS5536_GPIOM7_PME_FLAG (1 << 31)
|
||||
#define CS5536_GPIOM6_PME_FLAG (1 << 30)
|
||||
|
||||
/* CS5536_PM_GPE0_EN bits */
|
||||
#define CS5536_GPIOM7_PME_EN (1 << 31)
|
||||
#define CS5536_GPIOM6_PME_EN (1 << 30)
|
||||
|
||||
/* VSA2 magic values */
|
||||
#define VSA_VRC_INDEX 0xAC1C
|
||||
#define VSA_VRC_DATA 0xAC1E
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __LINUX_DCACHE_H
|
||||
#define __LINUX_DCACHE_H
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <linux/rculist_bl.h>
|
||||
|
|
@ -180,12 +180,12 @@ struct dentry_operations {
|
|||
*/
|
||||
|
||||
/* d_flags entries */
|
||||
#define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */
|
||||
#define DCACHE_NFSFS_RENAMED 0x0002
|
||||
/* this dentry has been "silly renamed" and has to be deleted on the last
|
||||
* dput() */
|
||||
#define DCACHE_OP_HASH 0x0001
|
||||
#define DCACHE_OP_COMPARE 0x0002
|
||||
#define DCACHE_OP_REVALIDATE 0x0004
|
||||
#define DCACHE_OP_DELETE 0x0008
|
||||
|
||||
#define DCACHE_DISCONNECTED 0x0004
|
||||
#define DCACHE_DISCONNECTED 0x0010
|
||||
/* This dentry is possibly not currently connected to the dcache tree, in
|
||||
* which case its parent will either be itself, or will have this flag as
|
||||
* well. nfsd will not use a dentry with this bit set, but will first
|
||||
|
|
@ -196,22 +196,18 @@ struct dentry_operations {
|
|||
* dentry into place and return that dentry rather than the passed one,
|
||||
* typically using d_splice_alias. */
|
||||
|
||||
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
|
||||
#define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */
|
||||
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020
|
||||
/* Parent inode is watched by inotify */
|
||||
|
||||
#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
|
||||
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080
|
||||
/* Parent inode is watched by some fsnotify listener */
|
||||
#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */
|
||||
#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */
|
||||
|
||||
#define DCACHE_CANT_MOUNT 0x0100
|
||||
#define DCACHE_GENOCIDE 0x0200
|
||||
|
||||
#define DCACHE_OP_HASH 0x1000
|
||||
#define DCACHE_OP_COMPARE 0x2000
|
||||
#define DCACHE_OP_REVALIDATE 0x4000
|
||||
#define DCACHE_OP_DELETE 0x8000
|
||||
#define DCACHE_NFSFS_RENAMED 0x1000
|
||||
/* this dentry has been "silly renamed" and has to be deleted on the last
|
||||
* dput() */
|
||||
#define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */
|
||||
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000
|
||||
/* Parent inode is watched by some fsnotify listener */
|
||||
|
||||
#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
|
||||
#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define __LINUX_DEBUG_LOCKING_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
struct task_struct;
|
||||
|
|
|
|||
|
|
@ -208,6 +208,49 @@ struct dm_target_callbacks {
|
|||
int dm_register_target(struct target_type *t);
|
||||
void dm_unregister_target(struct target_type *t);
|
||||
|
||||
/*
|
||||
* Target argument parsing.
|
||||
*/
|
||||
struct dm_arg_set {
|
||||
unsigned argc;
|
||||
char **argv;
|
||||
};
|
||||
|
||||
/*
|
||||
* The minimum and maximum value of a numeric argument, together with
|
||||
* the error message to use if the number is found to be outside that range.
|
||||
*/
|
||||
struct dm_arg {
|
||||
unsigned min;
|
||||
unsigned max;
|
||||
char *error;
|
||||
};
|
||||
|
||||
/*
|
||||
* Validate the next argument, either returning it as *value or, if invalid,
|
||||
* returning -EINVAL and setting *error.
|
||||
*/
|
||||
int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set,
|
||||
unsigned *value, char **error);
|
||||
|
||||
/*
|
||||
* Process the next argument as the start of a group containing between
|
||||
* arg->min and arg->max further arguments. Either return the size as
|
||||
* *num_args or, if invalid, return -EINVAL and set *error.
|
||||
*/
|
||||
int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set,
|
||||
unsigned *num_args, char **error);
|
||||
|
||||
/*
|
||||
* Return the current argument and shift to the next.
|
||||
*/
|
||||
const char *dm_shift_arg(struct dm_arg_set *as);
|
||||
|
||||
/*
|
||||
* Move through num_args arguments.
|
||||
*/
|
||||
void dm_consume_args(struct dm_arg_set *as, unsigned num_args);
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* Functions for creating and manipulating mapped devices.
|
||||
* Drop the reference with dm_put when you finish with the object.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/device.h>
|
||||
|
||||
struct device;
|
||||
|
|
|
|||
|
|
@ -267,9 +267,9 @@ enum {
|
|||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 20
|
||||
#define DM_VERSION_MINOR 21
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2011-02-02)"
|
||||
#define DM_VERSION_EXTRA "-ioctl (2011-07-06)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
|
|
|
|||
|
|
@ -42,5 +42,20 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
|
|||
unsigned num_dests, struct dm_io_region *dests,
|
||||
unsigned flags, dm_kcopyd_notify_fn fn, void *context);
|
||||
|
||||
/*
|
||||
* Prepare a callback and submit it via the kcopyd thread.
|
||||
*
|
||||
* dm_kcopyd_prepare_callback allocates a callback structure and returns it.
|
||||
* It must not be called from interrupt context.
|
||||
* The returned value should be passed into dm_kcopyd_do_callback.
|
||||
*
|
||||
* dm_kcopyd_do_callback submits the callback.
|
||||
* It may be called from interrupt context.
|
||||
* The callback is issued from the kcopyd thread.
|
||||
*/
|
||||
void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
|
||||
dm_kcopyd_notify_fn fn, void *context);
|
||||
void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_DM_KCOPYD_H */
|
||||
|
|
|
|||
|
|
@ -46,27 +46,6 @@ struct dma_map_ops {
|
|||
|
||||
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
|
||||
|
||||
typedef u64 DMA_nnBIT_MASK __deprecated;
|
||||
|
||||
/*
|
||||
* NOTE: do not use the below macros in new code and do not add new definitions
|
||||
* here.
|
||||
*
|
||||
* Instead, just open-code DMA_BIT_MASK(n) within your driver
|
||||
*/
|
||||
#define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64)
|
||||
#define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48)
|
||||
#define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47)
|
||||
#define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40)
|
||||
#define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39)
|
||||
#define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35)
|
||||
#define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32)
|
||||
#define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31)
|
||||
#define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30)
|
||||
#define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29)
|
||||
#define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28)
|
||||
#define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24)
|
||||
|
||||
#define DMA_MASK_NONE 0x0ULL
|
||||
|
||||
static inline int valid_dma_direction(int dma_direction)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ typedef struct audio_status {
|
|||
|
||||
|
||||
typedef
|
||||
struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
|
||||
struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */
|
||||
int vocal1; /* into left and right t at 70% each */
|
||||
int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
|
||||
int melody; /* mixed into the left channel and */
|
||||
|
|
|
|||
113
include/linux/ecryptfs.h
Normal file
113
include/linux/ecryptfs.h
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
#ifndef _LINUX_ECRYPTFS_H
|
||||
#define _LINUX_ECRYPTFS_H
|
||||
|
||||
/* Version verification for shared data structures w/ userspace */
|
||||
#define ECRYPTFS_VERSION_MAJOR 0x00
|
||||
#define ECRYPTFS_VERSION_MINOR 0x04
|
||||
#define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03
|
||||
/* These flags indicate which features are supported by the kernel
|
||||
* module; userspace tools such as the mount helper read
|
||||
* ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine
|
||||
* how to behave. */
|
||||
#define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001
|
||||
#define ECRYPTFS_VERSIONING_PUBKEY 0x00000002
|
||||
#define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004
|
||||
#define ECRYPTFS_VERSIONING_POLICY 0x00000008
|
||||
#define ECRYPTFS_VERSIONING_XATTR 0x00000010
|
||||
#define ECRYPTFS_VERSIONING_MULTKEY 0x00000020
|
||||
#define ECRYPTFS_VERSIONING_DEVMISC 0x00000040
|
||||
#define ECRYPTFS_VERSIONING_HMAC 0x00000080
|
||||
#define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100
|
||||
#define ECRYPTFS_VERSIONING_GCM 0x00000200
|
||||
#define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \
|
||||
| ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \
|
||||
| ECRYPTFS_VERSIONING_PUBKEY \
|
||||
| ECRYPTFS_VERSIONING_XATTR \
|
||||
| ECRYPTFS_VERSIONING_MULTKEY \
|
||||
| ECRYPTFS_VERSIONING_DEVMISC \
|
||||
| ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION)
|
||||
#define ECRYPTFS_MAX_PASSWORD_LENGTH 64
|
||||
#define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH
|
||||
#define ECRYPTFS_SALT_SIZE 8
|
||||
#define ECRYPTFS_SALT_SIZE_HEX (ECRYPTFS_SALT_SIZE*2)
|
||||
/* The original signature size is only for what is stored on disk; all
|
||||
* in-memory representations are expanded hex, so it better adapted to
|
||||
* be passed around or referenced on the command line */
|
||||
#define ECRYPTFS_SIG_SIZE 8
|
||||
#define ECRYPTFS_SIG_SIZE_HEX (ECRYPTFS_SIG_SIZE*2)
|
||||
#define ECRYPTFS_PASSWORD_SIG_SIZE ECRYPTFS_SIG_SIZE_HEX
|
||||
#define ECRYPTFS_MAX_KEY_BYTES 64
|
||||
#define ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES 512
|
||||
#define ECRYPTFS_FILE_VERSION 0x03
|
||||
#define ECRYPTFS_MAX_PKI_NAME_BYTES 16
|
||||
|
||||
#define RFC2440_CIPHER_DES3_EDE 0x02
|
||||
#define RFC2440_CIPHER_CAST_5 0x03
|
||||
#define RFC2440_CIPHER_BLOWFISH 0x04
|
||||
#define RFC2440_CIPHER_AES_128 0x07
|
||||
#define RFC2440_CIPHER_AES_192 0x08
|
||||
#define RFC2440_CIPHER_AES_256 0x09
|
||||
#define RFC2440_CIPHER_TWOFISH 0x0a
|
||||
#define RFC2440_CIPHER_CAST_6 0x0b
|
||||
|
||||
#define RFC2440_CIPHER_RSA 0x01
|
||||
|
||||
/**
|
||||
* For convenience, we may need to pass around the encrypted session
|
||||
* key between kernel and userspace because the authentication token
|
||||
* may not be extractable. For example, the TPM may not release the
|
||||
* private key, instead requiring the encrypted data and returning the
|
||||
* decrypted data.
|
||||
*/
|
||||
struct ecryptfs_session_key {
|
||||
#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_DECRYPT 0x00000001
|
||||
#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_ENCRYPT 0x00000002
|
||||
#define ECRYPTFS_CONTAINS_DECRYPTED_KEY 0x00000004
|
||||
#define ECRYPTFS_CONTAINS_ENCRYPTED_KEY 0x00000008
|
||||
u32 flags;
|
||||
u32 encrypted_key_size;
|
||||
u32 decrypted_key_size;
|
||||
u8 encrypted_key[ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES];
|
||||
u8 decrypted_key[ECRYPTFS_MAX_KEY_BYTES];
|
||||
};
|
||||
|
||||
struct ecryptfs_password {
|
||||
u32 password_bytes;
|
||||
s32 hash_algo;
|
||||
u32 hash_iterations;
|
||||
u32 session_key_encryption_key_bytes;
|
||||
#define ECRYPTFS_PERSISTENT_PASSWORD 0x01
|
||||
#define ECRYPTFS_SESSION_KEY_ENCRYPTION_KEY_SET 0x02
|
||||
u32 flags;
|
||||
/* Iterated-hash concatenation of salt and passphrase */
|
||||
u8 session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES];
|
||||
u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
|
||||
/* Always in expanded hex */
|
||||
u8 salt[ECRYPTFS_SALT_SIZE];
|
||||
};
|
||||
|
||||
enum ecryptfs_token_types {ECRYPTFS_PASSWORD, ECRYPTFS_PRIVATE_KEY};
|
||||
|
||||
struct ecryptfs_private_key {
|
||||
u32 key_size;
|
||||
u32 data_len;
|
||||
u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
|
||||
char pki_type[ECRYPTFS_MAX_PKI_NAME_BYTES + 1];
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
/* May be a password or a private key */
|
||||
struct ecryptfs_auth_tok {
|
||||
u16 version; /* 8-bit major and 8-bit minor */
|
||||
u16 token_type;
|
||||
#define ECRYPTFS_ENCRYPT_ONLY 0x00000001
|
||||
u32 flags;
|
||||
struct ecryptfs_session_key session_key;
|
||||
u8 reserved[32];
|
||||
union {
|
||||
struct ecryptfs_password password;
|
||||
struct ecryptfs_private_key private_key;
|
||||
} token;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* _LINUX_ECRYPTFS_H */
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef _LINUX_EDAC_H_
|
||||
#define _LINUX_EDAC_H_
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/sysdev.h>
|
||||
|
||||
#define EDAC_OPSTATE_INVAL -1
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/rtc.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/pfn.h>
|
||||
#include <linux/pstore.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/system.h>
|
||||
|
|
@ -232,6 +233,9 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
|
|||
#define UV_SYSTEM_TABLE_GUID \
|
||||
EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 )
|
||||
|
||||
#define LINUX_EFI_CRASH_GUID \
|
||||
EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
|
||||
|
||||
typedef struct {
|
||||
efi_guid_t guid;
|
||||
unsigned long table;
|
||||
|
|
@ -458,6 +462,8 @@ struct efivars {
|
|||
struct kset *kset;
|
||||
struct bin_attribute *new_var, *del_var;
|
||||
const struct efivar_operations *ops;
|
||||
struct efivar_entry *walk_entry;
|
||||
struct pstore_info efi_pstore_info;
|
||||
};
|
||||
|
||||
int register_efivars(struct efivars *efivars,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
/*
|
||||
* The second extended filesystem constants/structures
|
||||
|
|
|
|||
|
|
@ -418,12 +418,11 @@ struct ext3_inode {
|
|||
#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
|
||||
#endif
|
||||
|
||||
#define ext3_set_bit __test_and_set_bit_le
|
||||
#define ext3_set_bit __set_bit_le
|
||||
#define ext3_set_bit_atomic ext2_set_bit_atomic
|
||||
#define ext3_clear_bit __test_and_clear_bit_le
|
||||
#define ext3_clear_bit __clear_bit_le
|
||||
#define ext3_clear_bit_atomic ext2_clear_bit_atomic
|
||||
#define ext3_test_bit test_bit_le
|
||||
#define ext3_find_first_zero_bit find_first_zero_bit_le
|
||||
#define ext3_find_next_zero_bit find_next_zero_bit_le
|
||||
|
||||
/*
|
||||
|
|
@ -913,7 +912,7 @@ extern void ext3_dirty_inode(struct inode *, int);
|
|||
extern int ext3_change_inode_journal_flag(struct inode *, int);
|
||||
extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *);
|
||||
extern int ext3_can_truncate(struct inode *inode);
|
||||
extern void ext3_truncate (struct inode *);
|
||||
extern void ext3_truncate(struct inode *inode);
|
||||
extern void ext3_set_inode_flags(struct inode *);
|
||||
extern void ext3_get_inode_flags(struct ext3_inode_info *);
|
||||
extern void ext3_set_aops(struct inode *inode);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/*
|
||||
* For explanation of the elements of this struct, see
|
||||
|
|
@ -25,26 +25,6 @@ struct fault_attr {
|
|||
unsigned long reject_end;
|
||||
|
||||
unsigned long count;
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
|
||||
|
||||
struct {
|
||||
struct dentry *dir;
|
||||
|
||||
struct dentry *probability_file;
|
||||
struct dentry *interval_file;
|
||||
struct dentry *times_file;
|
||||
struct dentry *space_file;
|
||||
struct dentry *verbose_file;
|
||||
struct dentry *task_filter_file;
|
||||
struct dentry *stacktrace_depth_file;
|
||||
struct dentry *require_start_file;
|
||||
struct dentry *require_end_file;
|
||||
struct dentry *reject_start_file;
|
||||
struct dentry *reject_end_file;
|
||||
} dentries;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#define FAULT_ATTR_INITIALIZER { \
|
||||
|
|
@ -57,24 +37,19 @@ struct fault_attr {
|
|||
|
||||
#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
|
||||
int setup_fault_attr(struct fault_attr *attr, char *str);
|
||||
void should_fail_srandom(unsigned long entropy);
|
||||
bool should_fail(struct fault_attr *attr, ssize_t size);
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
|
||||
|
||||
int init_fault_attr_dentries(struct fault_attr *attr, const char *name);
|
||||
void cleanup_fault_attr_dentries(struct fault_attr *attr);
|
||||
struct dentry *fault_create_debugfs_attr(const char *name,
|
||||
struct dentry *parent, struct fault_attr *attr);
|
||||
|
||||
#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
|
||||
|
||||
static inline int init_fault_attr_dentries(struct fault_attr *attr,
|
||||
const char *name)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
|
||||
static inline struct dentry *fault_create_debugfs_attr(const char *name,
|
||||
struct dentry *parent, struct fault_attr *attr)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/*
|
||||
* The default fd array needs to be at least BITS_PER_LONG,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <linux/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
|
||||
|
|
|
|||
|
|
@ -738,22 +738,54 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
|
|||
struct posix_acl;
|
||||
#define ACL_NOT_CACHED ((void *)(-1))
|
||||
|
||||
#define IOP_FASTPERM 0x0001
|
||||
#define IOP_LOOKUP 0x0002
|
||||
#define IOP_NOFOLLOW 0x0004
|
||||
|
||||
/*
|
||||
* Keep mostly read-only and often accessed (especially for
|
||||
* the RCU path lookup and 'stat' data) fields at the beginning
|
||||
* of the 'struct inode'
|
||||
*/
|
||||
struct inode {
|
||||
/* RCU path lookup touches following: */
|
||||
umode_t i_mode;
|
||||
unsigned short i_opflags;
|
||||
uid_t i_uid;
|
||||
gid_t i_gid;
|
||||
unsigned int i_flags;
|
||||
|
||||
#ifdef CONFIG_FS_POSIX_ACL
|
||||
struct posix_acl *i_acl;
|
||||
struct posix_acl *i_default_acl;
|
||||
#endif
|
||||
|
||||
const struct inode_operations *i_op;
|
||||
struct super_block *i_sb;
|
||||
struct address_space *i_mapping;
|
||||
|
||||
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
|
||||
unsigned int i_flags;
|
||||
unsigned long i_state;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *i_security;
|
||||
#endif
|
||||
struct mutex i_mutex;
|
||||
|
||||
/* Stat data, not accessed from path walking */
|
||||
unsigned long i_ino;
|
||||
unsigned int i_nlink;
|
||||
dev_t i_rdev;
|
||||
loff_t i_size;
|
||||
struct timespec i_atime;
|
||||
struct timespec i_mtime;
|
||||
struct timespec i_ctime;
|
||||
unsigned int i_blkbits;
|
||||
blkcnt_t i_blocks;
|
||||
|
||||
#ifdef __NEED_I_SIZE_ORDERED
|
||||
seqcount_t i_size_seqcount;
|
||||
#endif
|
||||
|
||||
/* Misc */
|
||||
unsigned long i_state;
|
||||
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
|
||||
struct mutex i_mutex;
|
||||
|
||||
unsigned long dirtied_when; /* jiffies of first dirtying */
|
||||
|
||||
|
|
@ -765,25 +797,12 @@ struct inode {
|
|||
struct list_head i_dentry;
|
||||
struct rcu_head i_rcu;
|
||||
};
|
||||
unsigned long i_ino;
|
||||
atomic_t i_count;
|
||||
unsigned int i_nlink;
|
||||
dev_t i_rdev;
|
||||
unsigned int i_blkbits;
|
||||
u64 i_version;
|
||||
loff_t i_size;
|
||||
#ifdef __NEED_I_SIZE_ORDERED
|
||||
seqcount_t i_size_seqcount;
|
||||
#endif
|
||||
struct timespec i_atime;
|
||||
struct timespec i_mtime;
|
||||
struct timespec i_ctime;
|
||||
blkcnt_t i_blocks;
|
||||
unsigned short i_bytes;
|
||||
atomic_t i_dio_count;
|
||||
const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
|
||||
struct file_lock *i_flock;
|
||||
struct address_space *i_mapping;
|
||||
struct address_space i_data;
|
||||
#ifdef CONFIG_QUOTA
|
||||
struct dquot *i_dquot[MAXQUOTAS];
|
||||
|
|
@ -806,10 +825,6 @@ struct inode {
|
|||
atomic_t i_readcount; /* struct files open RO */
|
||||
#endif
|
||||
atomic_t i_writecount;
|
||||
#ifdef CONFIG_FS_POSIX_ACL
|
||||
struct posix_acl *i_acl;
|
||||
struct posix_acl *i_default_acl;
|
||||
#endif
|
||||
void *i_private; /* fs or device private pointer */
|
||||
};
|
||||
|
||||
|
|
@ -2303,6 +2318,11 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
|
|||
extern struct inode * iget_locked(struct super_block *, unsigned long);
|
||||
extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
|
||||
extern int insert_inode_locked(struct inode *);
|
||||
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
||||
extern void lockdep_annotate_inode_mutex_key(struct inode *inode);
|
||||
#else
|
||||
static inline void lockdep_annotate_inode_mutex_key(struct inode *inode) { };
|
||||
#endif
|
||||
extern void unlock_new_inode(struct inode *);
|
||||
extern unsigned int get_next_ino(void);
|
||||
|
||||
|
|
@ -2310,17 +2330,25 @@ extern void __iget(struct inode * inode);
|
|||
extern void iget_failed(struct inode *);
|
||||
extern void end_writeback(struct inode *);
|
||||
extern void __destroy_inode(struct inode *);
|
||||
extern struct inode *new_inode(struct super_block *);
|
||||
extern struct inode *new_inode_pseudo(struct super_block *sb);
|
||||
extern struct inode *new_inode(struct super_block *sb);
|
||||
extern void free_inode_nonrcu(struct inode *inode);
|
||||
extern int should_remove_suid(struct dentry *);
|
||||
extern int file_remove_suid(struct file *);
|
||||
|
||||
extern void __insert_inode_hash(struct inode *, unsigned long hashval);
|
||||
extern void remove_inode_hash(struct inode *);
|
||||
static inline void insert_inode_hash(struct inode *inode)
|
||||
{
|
||||
__insert_inode_hash(inode, inode->i_ino);
|
||||
}
|
||||
|
||||
extern void __remove_inode_hash(struct inode *);
|
||||
static inline void remove_inode_hash(struct inode *inode)
|
||||
{
|
||||
if (!inode_unhashed(inode))
|
||||
__remove_inode_hash(inode);
|
||||
}
|
||||
|
||||
extern void inode_sb_list_add(struct inode *inode);
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/*
|
||||
* IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@
|
|||
* - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
|
||||
* fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
|
||||
* - add FUSE_IOCTL_32BIT flag
|
||||
*
|
||||
* 7.17
|
||||
* - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
|
|
@ -78,7 +81,7 @@
|
|||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 16
|
||||
#define FUSE_KERNEL_MINOR_VERSION 17
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
|
|
@ -153,8 +156,10 @@ struct fuse_file_lock {
|
|||
/**
|
||||
* INIT request/reply flags
|
||||
*
|
||||
* FUSE_POSIX_LOCKS: remote locking for POSIX file locks
|
||||
* FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
|
||||
* FUSE_DONT_MASK: don't apply umask to file mode on create operations
|
||||
* FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
|
||||
*/
|
||||
#define FUSE_ASYNC_READ (1 << 0)
|
||||
#define FUSE_POSIX_LOCKS (1 << 1)
|
||||
|
|
@ -163,6 +168,7 @@ struct fuse_file_lock {
|
|||
#define FUSE_EXPORT_SUPPORT (1 << 4)
|
||||
#define FUSE_BIG_WRITES (1 << 5)
|
||||
#define FUSE_DONT_MASK (1 << 6)
|
||||
#define FUSE_FLOCK_LOCKS (1 << 10)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
|
|
@ -175,6 +181,7 @@ struct fuse_file_lock {
|
|||
* Release flags
|
||||
*/
|
||||
#define FUSE_RELEASE_FLUSH (1 << 0)
|
||||
#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
|
||||
|
||||
/**
|
||||
* Getattr flags
|
||||
|
|
|
|||
|
|
@ -1,8 +1,26 @@
|
|||
/*
|
||||
* Basic general purpose allocator for managing special purpose memory
|
||||
* not managed by the regular kmalloc/kfree interface.
|
||||
* Uses for this includes on-device special memory, uncached memory
|
||||
* etc.
|
||||
* Basic general purpose allocator for managing special purpose
|
||||
* memory, for example, memory that is not managed by the regular
|
||||
* kmalloc/kfree interface. Uses for this includes on-device special
|
||||
* memory, uncached memory etc.
|
||||
*
|
||||
* It is safe to use the allocator in NMI handlers and other special
|
||||
* unblockable contexts that could otherwise deadlock on locks. This
|
||||
* is implemented by using atomic operations and retries on any
|
||||
* conflicts. The disadvantage is that there may be livelocks in
|
||||
* extreme cases. For better scalability, one allocator can be used
|
||||
* for each CPU.
|
||||
*
|
||||
* The lockless operation only works if there is enough memory
|
||||
* available. If new memory is added to the pool a lock has to be
|
||||
* still taken. So any user relying on locklessness has to ensure
|
||||
* that sufficient memory is preallocated.
|
||||
*
|
||||
* The basic atomic operation of this allocator is cmpxchg on long.
|
||||
* On architectures that don't have NMI-safe cmpxchg implementation,
|
||||
* the allocator can NOT be used in NMI handler. So code uses the
|
||||
* allocator in NMI handler should depend on
|
||||
* CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
|
||||
*
|
||||
* This source code is licensed under the GNU General Public License,
|
||||
* Version 2. See the file COPYING for more details.
|
||||
|
|
@ -15,7 +33,7 @@
|
|||
* General purpose special memory pool descriptor.
|
||||
*/
|
||||
struct gen_pool {
|
||||
rwlock_t lock;
|
||||
spinlock_t lock;
|
||||
struct list_head chunks; /* list of chunks in this pool */
|
||||
int min_alloc_order; /* minimum allocation order */
|
||||
};
|
||||
|
|
@ -24,8 +42,8 @@ struct gen_pool {
|
|||
* General purpose special memory pool chunk descriptor.
|
||||
*/
|
||||
struct gen_pool_chunk {
|
||||
spinlock_t lock;
|
||||
struct list_head next_chunk; /* next chunk in pool */
|
||||
atomic_t avail;
|
||||
phys_addr_t phys_addr; /* physical starting address of memory chunk */
|
||||
unsigned long start_addr; /* starting address of memory chunk */
|
||||
unsigned long end_addr; /* ending address of memory chunk */
|
||||
|
|
@ -56,4 +74,8 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr,
|
|||
extern void gen_pool_destroy(struct gen_pool *);
|
||||
extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
|
||||
extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
|
||||
extern void gen_pool_for_each_chunk(struct gen_pool *,
|
||||
void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
|
||||
extern size_t gen_pool_avail(struct gen_pool *);
|
||||
extern size_t gen_pool_size(struct gen_pool *);
|
||||
#endif /* __GENALLOC_H__ */
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ struct vm_area_struct;
|
|||
*/
|
||||
#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
|
||||
|
||||
#define __GFP_BITS_SHIFT 23 /* Room for 23 __GFP_FOO bits */
|
||||
#define __GFP_BITS_SHIFT 24 /* Room for N __GFP_FOO bits */
|
||||
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
|
||||
|
||||
/* This equals 0, but use constants in case they ever change */
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits)
|
|||
return hash >> (32 - bits);
|
||||
}
|
||||
|
||||
static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
|
||||
static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
|
||||
{
|
||||
return hash_long((unsigned long)ptr, bits);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,33 @@
|
|||
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
/*
|
||||
* Version 2 of the I2C peripheral unit has a different register
|
||||
* layout and extra registers. The ID register in the V2 peripheral
|
||||
* unit on the OMAP4430 reports the same ID as the V1 peripheral
|
||||
* unit on the OMAP3530, so we must inform the driver which IP
|
||||
* version we know it is running on from platform / cpu-specific
|
||||
* code using these constants in the hwmod class definition.
|
||||
*/
|
||||
|
||||
#define OMAP_I2C_IP_VERSION_1 1
|
||||
#define OMAP_I2C_IP_VERSION_2 2
|
||||
|
||||
/* struct omap_i2c_bus_platform_data .flags meanings */
|
||||
|
||||
#define OMAP_I2C_FLAG_NO_FIFO BIT(0)
|
||||
#define OMAP_I2C_FLAG_SIMPLE_CLOCK BIT(1)
|
||||
#define OMAP_I2C_FLAG_16BIT_DATA_REG BIT(2)
|
||||
#define OMAP_I2C_FLAG_RESET_REGS_POSTIDLE BIT(3)
|
||||
#define OMAP_I2C_FLAG_APPLY_ERRATA_I207 BIT(4)
|
||||
#define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK BIT(5)
|
||||
#define OMAP_I2C_FLAG_FORCE_19200_INT_CLK BIT(6)
|
||||
/* how the CPU address bus must be translated for I2C unit access */
|
||||
#define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
|
||||
#define OMAP_I2C_FLAG_BUS_SHIFT_1 BIT(7)
|
||||
#define OMAP_I2C_FLAG_BUS_SHIFT_2 BIT(8)
|
||||
#define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
|
||||
|
||||
struct omap_i2c_bus_platform_data {
|
||||
u32 clkrate;
|
||||
void (*set_mpu_wkup_lat)(struct device *dev, long set);
|
||||
|
|
|
|||
|
|
@ -657,28 +657,41 @@ struct twl4030_power_data {
|
|||
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
|
||||
extern int twl4030_remove_script(u8 flags);
|
||||
|
||||
struct twl4030_codec_audio_data {
|
||||
struct twl4030_codec_data {
|
||||
unsigned int digimic_delay; /* in ms */
|
||||
unsigned int ramp_delay_value;
|
||||
unsigned int offset_cncl_path;
|
||||
unsigned int check_defaults:1;
|
||||
unsigned int reset_registers:1;
|
||||
unsigned int hs_extmute:1;
|
||||
u16 hs_left_step;
|
||||
u16 hs_right_step;
|
||||
u16 hf_left_step;
|
||||
u16 hf_right_step;
|
||||
void (*set_hs_extmute)(int mute);
|
||||
};
|
||||
|
||||
struct twl4030_codec_vibra_data {
|
||||
struct twl4030_vibra_data {
|
||||
unsigned int coexist;
|
||||
|
||||
/* twl6040 */
|
||||
unsigned int vibldrv_res; /* left driver resistance */
|
||||
unsigned int vibrdrv_res; /* right driver resistance */
|
||||
unsigned int viblmotor_res; /* left motor resistance */
|
||||
unsigned int vibrmotor_res; /* right motor resistance */
|
||||
int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */
|
||||
int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */
|
||||
};
|
||||
|
||||
struct twl4030_codec_data {
|
||||
struct twl4030_audio_data {
|
||||
unsigned int audio_mclk;
|
||||
struct twl4030_codec_audio_data *audio;
|
||||
struct twl4030_codec_vibra_data *vibra;
|
||||
struct twl4030_codec_data *codec;
|
||||
struct twl4030_vibra_data *vibra;
|
||||
|
||||
/* twl6040 */
|
||||
int audpwron_gpio; /* audio power-on gpio */
|
||||
int naudint_irq; /* audio interrupt */
|
||||
unsigned int irq_base;
|
||||
};
|
||||
|
||||
struct twl4030_platform_data {
|
||||
|
|
@ -690,7 +703,7 @@ struct twl4030_platform_data {
|
|||
struct twl4030_keypad_data *keypad;
|
||||
struct twl4030_usb_data *usb;
|
||||
struct twl4030_power_data *power;
|
||||
struct twl4030_codec_data *codec;
|
||||
struct twl4030_audio_data *audio;
|
||||
|
||||
/* Common LDO regulators for TWL4030/TWL6030 */
|
||||
struct regulator_init_data *vdac;
|
||||
|
|
|
|||
|
|
@ -146,6 +146,10 @@ void ida_remove(struct ida *ida, int id);
|
|||
void ida_destroy(struct ida *ida);
|
||||
void ida_init(struct ida *ida);
|
||||
|
||||
int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
|
||||
gfp_t gfp_mask);
|
||||
void ida_simple_remove(struct ida *ida, unsigned int id);
|
||||
|
||||
void __init idr_init_cache(void);
|
||||
|
||||
#endif /* __IDR_H__ */
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@
|
|||
#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */
|
||||
#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch
|
||||
* datapath port */
|
||||
#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
|
||||
* skbs on transmit */
|
||||
|
||||
#define IF_GET_IFACE 0x0001 /* for querying only */
|
||||
#define IF_GET_PROTO 0x0002
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ struct input_keymap_entry {
|
|||
#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
|
||||
#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
|
||||
|
||||
#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
|
||||
#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
|
||||
#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
|
||||
#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */
|
||||
#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */
|
||||
#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */
|
||||
|
||||
#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
|
||||
#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
|
||||
|
|
@ -438,6 +438,8 @@ struct input_keymap_entry {
|
|||
#define KEY_WIMAX 246
|
||||
#define KEY_RFKILL 247 /* Key that controls all radios */
|
||||
|
||||
#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
|
||||
|
||||
/* Code 255 is reserved for special needs of AT keyboard driver */
|
||||
|
||||
#define BTN_MISC 0x100
|
||||
|
|
|
|||
70
include/linux/input/kxtj9.h
Normal file
70
include/linux/input/kxtj9.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Copyright (C) 2011 Kionix, Inc.
|
||||
* Written by Chris Hudson <chudson@kionix.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifndef __KXTJ9_H__
|
||||
#define __KXTJ9_H__
|
||||
|
||||
#define KXTJ9_I2C_ADDR 0x0F
|
||||
|
||||
struct kxtj9_platform_data {
|
||||
unsigned int min_interval; /* minimum poll interval (in milli-seconds) */
|
||||
|
||||
/*
|
||||
* By default, x is axis 0, y is axis 1, z is axis 2; these can be
|
||||
* changed to account for sensor orientation within the host device.
|
||||
*/
|
||||
u8 axis_map_x;
|
||||
u8 axis_map_y;
|
||||
u8 axis_map_z;
|
||||
|
||||
/*
|
||||
* Each axis can be negated to account for sensor orientation within
|
||||
* the host device.
|
||||
*/
|
||||
bool negate_x;
|
||||
bool negate_y;
|
||||
bool negate_z;
|
||||
|
||||
/* CTRL_REG1: set resolution, g-range, data ready enable */
|
||||
/* Output resolution: 8-bit valid or 12-bit valid */
|
||||
#define RES_8BIT 0
|
||||
#define RES_12BIT (1 << 6)
|
||||
u8 res_12bit;
|
||||
/* Output g-range: +/-2g, 4g, or 8g */
|
||||
#define KXTJ9_G_2G 0
|
||||
#define KXTJ9_G_4G (1 << 3)
|
||||
#define KXTJ9_G_8G (1 << 4)
|
||||
u8 g_range;
|
||||
|
||||
/* DATA_CTRL_REG: controls the output data rate of the part */
|
||||
#define ODR12_5F 0
|
||||
#define ODR25F 1
|
||||
#define ODR50F 2
|
||||
#define ODR100F 3
|
||||
#define ODR200F 4
|
||||
#define ODR400F 5
|
||||
#define ODR800F 6
|
||||
u8 data_odr_init;
|
||||
|
||||
int (*init)(void);
|
||||
void (*exit)(void);
|
||||
int (*power_on)(void);
|
||||
int (*power_off)(void);
|
||||
};
|
||||
#endif /* __KXTJ9_H__ */
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
#include <linux/kref.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/system.h>
|
||||
#include <trace/events/irq.h>
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
|
|||
resource_size_t,
|
||||
resource_size_t),
|
||||
void *alignf_data);
|
||||
struct resource *lookup_resource(struct resource *root, resource_size_t start);
|
||||
int adjust_resource(struct resource *res, resource_size_t start,
|
||||
resource_size_t size);
|
||||
resource_size_t resource_alignment(struct resource *res);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ struct ipc_namespace {
|
|||
size_t shm_ctlall;
|
||||
int shm_ctlmni;
|
||||
int shm_tot;
|
||||
/*
|
||||
* Defines whether IPC_RMID is forced for _all_ shm segments regardless
|
||||
* of shmctl()
|
||||
*/
|
||||
int shm_rmid_forced;
|
||||
|
||||
struct notifier_block ipcns_nb;
|
||||
|
||||
|
|
@ -72,6 +77,7 @@ extern int register_ipcns_notifier(struct ipc_namespace *);
|
|||
extern int cond_register_ipcns_notifier(struct ipc_namespace *);
|
||||
extern void unregister_ipcns_notifier(struct ipc_namespace *);
|
||||
extern int ipcns_notify(unsigned long);
|
||||
extern void shm_destroy_orphaned(struct ipc_namespace *ns);
|
||||
#else /* CONFIG_SYSVIPC */
|
||||
static inline int register_ipcns_notifier(struct ipc_namespace *ns)
|
||||
{ return 0; }
|
||||
|
|
@ -79,6 +85,7 @@ static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns)
|
|||
{ return 0; }
|
||||
static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { }
|
||||
static inline int ipcns_notify(unsigned long l) { return 0; }
|
||||
static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {}
|
||||
#endif /* CONFIG_SYSVIPC */
|
||||
|
||||
#ifdef CONFIG_POSIX_MQUEUE
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/errno.h>
|
||||
#include <linux/topology.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
|
@ -108,14 +109,18 @@ enum {
|
|||
};
|
||||
|
||||
struct msi_desc;
|
||||
struct irq_domain;
|
||||
|
||||
/**
|
||||
* struct irq_data - per irq and irq chip data passed down to chip functions
|
||||
* @irq: interrupt number
|
||||
* @hwirq: hardware interrupt number, local to the interrupt domain
|
||||
* @node: node index useful for balancing
|
||||
* @state_use_accessors: status information for irq chip functions.
|
||||
* Use accessor functions to deal with it
|
||||
* @chip: low level interrupt hardware access
|
||||
* @domain: Interrupt translation domain; responsible for mapping
|
||||
* between hwirq number and linux irq number.
|
||||
* @handler_data: per-IRQ data for the irq_chip methods
|
||||
* @chip_data: platform-specific per-chip private data for the chip
|
||||
* methods, to allow shared chip implementations
|
||||
|
|
@ -128,9 +133,11 @@ struct msi_desc;
|
|||
*/
|
||||
struct irq_data {
|
||||
unsigned int irq;
|
||||
unsigned long hwirq;
|
||||
unsigned int node;
|
||||
unsigned int state_use_accessors;
|
||||
struct irq_chip *chip;
|
||||
struct irq_domain *domain;
|
||||
void *handler_data;
|
||||
void *chip_data;
|
||||
struct msi_desc *msi_desc;
|
||||
|
|
@ -541,7 +548,15 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
|
|||
return d->msi_desc;
|
||||
}
|
||||
|
||||
int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node);
|
||||
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
|
||||
struct module *owner);
|
||||
|
||||
static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
|
||||
int node)
|
||||
{
|
||||
return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
|
||||
}
|
||||
|
||||
void irq_free_descs(unsigned int irq, unsigned int cnt);
|
||||
int irq_reserve_irqs(unsigned int from, unsigned int cnt);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ struct irq_desc {
|
|||
#ifdef CONFIG_PROC_FS
|
||||
struct proc_dir_entry *dir;
|
||||
#endif
|
||||
struct module *owner;
|
||||
const char *name;
|
||||
} ____cacheline_internodealigned_in_smp;
|
||||
|
||||
|
|
|
|||
91
include/linux/irqdomain.h
Normal file
91
include/linux/irqdomain.h
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* irq_domain - IRQ translation domains
|
||||
*
|
||||
* Translation infrastructure between hw and linux irq numbers. This is
|
||||
* helpful for interrupt controllers to implement mapping between hardware
|
||||
* irq numbers and the Linux irq number space.
|
||||
*
|
||||
* irq_domains also have a hook for translating device tree interrupt
|
||||
* representation into a hardware irq number that can be mapped back to a
|
||||
* Linux irq number without any extra platform support code.
|
||||
*
|
||||
* irq_domain is expected to be embedded in an interrupt controller's private
|
||||
* data structure.
|
||||
*/
|
||||
#ifndef _LINUX_IRQDOMAIN_H
|
||||
#define _LINUX_IRQDOMAIN_H
|
||||
|
||||
#include <linux/irq.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#ifdef CONFIG_IRQ_DOMAIN
|
||||
struct device_node;
|
||||
struct irq_domain;
|
||||
|
||||
/**
|
||||
* struct irq_domain_ops - Methods for irq_domain objects
|
||||
* @to_irq: (optional) given a local hardware irq number, return the linux
|
||||
* irq number. If to_irq is not implemented, then the irq_domain
|
||||
* will use this translation: irq = (domain->irq_base + hwirq)
|
||||
* @dt_translate: Given a device tree node and interrupt specifier, decode
|
||||
* the hardware irq number and linux irq type value.
|
||||
*/
|
||||
struct irq_domain_ops {
|
||||
unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
int (*dt_translate)(struct irq_domain *d, struct device_node *node,
|
||||
const u32 *intspec, unsigned int intsize,
|
||||
unsigned long *out_hwirq, unsigned int *out_type);
|
||||
#endif /* CONFIG_OF */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct irq_domain - Hardware interrupt number translation object
|
||||
* @list: Element in global irq_domain list.
|
||||
* @irq_base: Start of irq_desc range assigned to the irq_domain. The creator
|
||||
* of the irq_domain is responsible for allocating the array of
|
||||
* irq_desc structures.
|
||||
* @nr_irq: Number of irqs managed by the irq domain
|
||||
* @ops: pointer to irq_domain methods
|
||||
* @priv: private data pointer for use by owner. Not touched by irq_domain
|
||||
* core code.
|
||||
* @of_node: (optional) Pointer to device tree nodes associated with the
|
||||
* irq_domain. Used when decoding device tree interrupt specifiers.
|
||||
*/
|
||||
struct irq_domain {
|
||||
struct list_head list;
|
||||
unsigned int irq_base;
|
||||
unsigned int nr_irq;
|
||||
const struct irq_domain_ops *ops;
|
||||
void *priv;
|
||||
struct device_node *of_node;
|
||||
};
|
||||
|
||||
/**
|
||||
* irq_domain_to_irq() - Translate from a hardware irq to a linux irq number
|
||||
*
|
||||
* Returns the linux irq number associated with a hardware irq. By default,
|
||||
* the mapping is irq == domain->irq_base + hwirq, but this mapping can
|
||||
* be overridden if the irq_domain implements a .to_irq() hook.
|
||||
*/
|
||||
static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
|
||||
unsigned long hwirq)
|
||||
{
|
||||
return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq;
|
||||
}
|
||||
|
||||
extern void irq_domain_add(struct irq_domain *domain);
|
||||
extern void irq_domain_del(struct irq_domain *domain);
|
||||
#endif /* CONFIG_IRQ_DOMAIN */
|
||||
|
||||
#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
|
||||
extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
|
||||
extern void irq_domain_generate_simple(const struct of_device_id *match,
|
||||
u64 phys_base, unsigned int irq_start);
|
||||
#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
|
||||
static inline void irq_domain_generate_simple(const struct of_device_id *match,
|
||||
u64 phys_base, unsigned int irq_start) { }
|
||||
#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
|
||||
|
||||
#endif /* _LINUX_IRQDOMAIN_H */
|
||||
|
|
@ -940,7 +940,6 @@ extern int journal_force_commit(journal_t *);
|
|||
*/
|
||||
struct journal_head *journal_add_journal_head(struct buffer_head *bh);
|
||||
struct journal_head *journal_grab_journal_head(struct buffer_head *bh);
|
||||
void journal_remove_journal_head(struct buffer_head *bh);
|
||||
void journal_put_journal_head(struct journal_head *jh);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1329,12 +1329,6 @@ extern int jbd_blocks_per_page(struct inode *inode);
|
|||
#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
|
||||
#define JBUFFER_TRACE(jh, info) do {} while (0)
|
||||
|
||||
/*
|
||||
* jbd2_dev_to_name is a utility function used by the jbd2 and ext4
|
||||
* tracing infrastructure to map a dev_t to a device name.
|
||||
*/
|
||||
extern const char *jbd2_dev_to_name(dev_t device);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_JBD2_H */
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ struct journal_head {
|
|||
* has been cowed
|
||||
* [jbd_lock_bh_state()]
|
||||
*/
|
||||
unsigned b_cow_tid;
|
||||
tid_t b_cow_tid;
|
||||
|
||||
/*
|
||||
* Copy of the buffer data frozen for writing to the log.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ extern void jump_label_apply_nops(struct module *mod);
|
|||
|
||||
#else
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define JUMP_LABEL_INIT {ATOMIC_INIT(0)}
|
||||
|
||||
|
|
|
|||
32
include/linux/kconfig.h
Normal file
32
include/linux/kconfig.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef __LINUX_KCONFIG_H
|
||||
#define __LINUX_KCONFIG_H
|
||||
|
||||
#include <generated/autoconf.h>
|
||||
|
||||
/*
|
||||
* Helper macros to use CONFIG_ options in C expressions. Note that
|
||||
* these only work with boolean and tristate options.
|
||||
*/
|
||||
|
||||
/*
|
||||
* IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
|
||||
* 0 otherwise.
|
||||
*
|
||||
*/
|
||||
#define IS_ENABLED(option) \
|
||||
(__enabled_ ## option || __enabled_ ## option ## _MODULE)
|
||||
|
||||
/*
|
||||
* IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
|
||||
* otherwise. For boolean options, this is equivalent to
|
||||
* IS_ENABLED(CONFIG_FOO).
|
||||
*/
|
||||
#define IS_BUILTIN(option) __enabled_ ## option
|
||||
|
||||
/*
|
||||
* IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
|
||||
* otherwise.
|
||||
*/
|
||||
#define IS_MODULE(option) __enabled_ ## option ## _MODULE
|
||||
|
||||
#endif /* __LINUX_KCONFIG_H */
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
#ifdef CONFIG_KGDB_KDB
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define KDB_POLL_FUNC_MAX 5
|
||||
extern int kdb_poll_idx;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,14 @@
|
|||
|
||||
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define DIV_ROUND_UP_ULL(ll,d) \
|
||||
({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
|
||||
|
||||
#if BITS_PER_LONG == 32
|
||||
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
|
||||
#else
|
||||
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
|
||||
#endif
|
||||
|
||||
/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
|
||||
#define roundup(x, y) ( \
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include <linux/rcupdate.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <linux/serial_8250.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#ifdef CONFIG_HAVE_ARCH_KGDB
|
||||
#include <asm/kgdb.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <linux/kobject_ns.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/wait.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define UEVENT_HELPER_PATH_LEN 256
|
||||
#define UEVENT_NUM_ENVP 32 /* number of env pointers */
|
||||
|
|
|
|||
126
include/linux/llist.h
Normal file
126
include/linux/llist.h
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
#ifndef LLIST_H
|
||||
#define LLIST_H
|
||||
/*
|
||||
* Lock-less NULL terminated single linked list
|
||||
*
|
||||
* If there are multiple producers and multiple consumers, llist_add
|
||||
* can be used in producers and llist_del_all can be used in
|
||||
* consumers. They can work simultaneously without lock. But
|
||||
* llist_del_first can not be used here. Because llist_del_first
|
||||
* depends on list->first->next does not changed if list->first is not
|
||||
* changed during its operation, but llist_del_first, llist_add,
|
||||
* llist_add (or llist_del_all, llist_add, llist_add) sequence in
|
||||
* another consumer may violate that.
|
||||
*
|
||||
* If there are multiple producers and one consumer, llist_add can be
|
||||
* used in producers and llist_del_all or llist_del_first can be used
|
||||
* in the consumer.
|
||||
*
|
||||
* This can be summarized as follow:
|
||||
*
|
||||
* | add | del_first | del_all
|
||||
* add | - | - | -
|
||||
* del_first | | L | L
|
||||
* del_all | | | -
|
||||
*
|
||||
* Where "-" stands for no lock is needed, while "L" stands for lock
|
||||
* is needed.
|
||||
*
|
||||
* The list entries deleted via llist_del_all can be traversed with
|
||||
* traversing function such as llist_for_each etc. But the list
|
||||
* entries can not be traversed safely before deleted from the list.
|
||||
* The order of deleted entries is from the newest to the oldest added
|
||||
* one. If you want to traverse from the oldest to the newest, you
|
||||
* must reverse the order by yourself before traversing.
|
||||
*
|
||||
* The basic atomic operation of this list is cmpxchg on long. On
|
||||
* architectures that don't have NMI-safe cmpxchg implementation, the
|
||||
* list can NOT be used in NMI handler. So code uses the list in NMI
|
||||
* handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
|
||||
*/
|
||||
|
||||
struct llist_head {
|
||||
struct llist_node *first;
|
||||
};
|
||||
|
||||
struct llist_node {
|
||||
struct llist_node *next;
|
||||
};
|
||||
|
||||
#define LLIST_HEAD_INIT(name) { NULL }
|
||||
#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
|
||||
|
||||
/**
|
||||
* init_llist_head - initialize lock-less list head
|
||||
* @head: the head for your lock-less list
|
||||
*/
|
||||
static inline void init_llist_head(struct llist_head *list)
|
||||
{
|
||||
list->first = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* llist_entry - get the struct of this entry
|
||||
* @ptr: the &struct llist_node pointer.
|
||||
* @type: the type of the struct this is embedded in.
|
||||
* @member: the name of the llist_node within the struct.
|
||||
*/
|
||||
#define llist_entry(ptr, type, member) \
|
||||
container_of(ptr, type, member)
|
||||
|
||||
/**
|
||||
* llist_for_each - iterate over some deleted entries of a lock-less list
|
||||
* @pos: the &struct llist_node to use as a loop cursor
|
||||
* @node: the first entry of deleted list entries
|
||||
*
|
||||
* In general, some entries of the lock-less list can be traversed
|
||||
* safely only after being deleted from list, so start with an entry
|
||||
* instead of list head.
|
||||
*
|
||||
* If being used on entries deleted from lock-less list directly, the
|
||||
* traverse order is from the newest to the oldest added entry. If
|
||||
* you want to traverse from the oldest to the newest, you must
|
||||
* reverse the order by yourself before traversing.
|
||||
*/
|
||||
#define llist_for_each(pos, node) \
|
||||
for ((pos) = (node); pos; (pos) = (pos)->next)
|
||||
|
||||
/**
|
||||
* llist_for_each_entry - iterate over some deleted entries of lock-less list of given type
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @node: the fist entry of deleted list entries.
|
||||
* @member: the name of the llist_node with the struct.
|
||||
*
|
||||
* In general, some entries of the lock-less list can be traversed
|
||||
* safely only after being removed from list, so start with an entry
|
||||
* instead of list head.
|
||||
*
|
||||
* If being used on entries deleted from lock-less list directly, the
|
||||
* traverse order is from the newest to the oldest added entry. If
|
||||
* you want to traverse from the oldest to the newest, you must
|
||||
* reverse the order by yourself before traversing.
|
||||
*/
|
||||
#define llist_for_each_entry(pos, node, member) \
|
||||
for ((pos) = llist_entry((node), typeof(*(pos)), member); \
|
||||
&(pos)->member != NULL; \
|
||||
(pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
|
||||
|
||||
/**
|
||||
* llist_empty - tests whether a lock-less list is empty
|
||||
* @head: the list to test
|
||||
*
|
||||
* Not guaranteed to be accurate or up to date. Just a quick way to
|
||||
* test whether the list is empty without deleting something from the
|
||||
* list.
|
||||
*/
|
||||
static inline int llist_empty(const struct llist_head *head)
|
||||
{
|
||||
return ACCESS_ONCE(head->first) == NULL;
|
||||
}
|
||||
|
||||
void llist_add(struct llist_node *new, struct llist_head *head);
|
||||
void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
|
||||
struct llist_head *head);
|
||||
struct llist_node *llist_del_first(struct llist_head *head);
|
||||
struct llist_node *llist_del_all(struct llist_head *head);
|
||||
#endif /* LLIST_H */
|
||||
|
|
@ -64,7 +64,6 @@ struct loop_device {
|
|||
|
||||
struct request_queue *lo_queue;
|
||||
struct gendisk *lo_disk;
|
||||
struct list_head lo_list;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
|
@ -161,4 +160,8 @@ int loop_unregister_transfer(int number);
|
|||
#define LOOP_CHANGE_FD 0x4C06
|
||||
#define LOOP_SET_CAPACITY 0x4C07
|
||||
|
||||
/* /dev/loop-control interface */
|
||||
#define LOOP_CTL_ADD 0x4C80
|
||||
#define LOOP_CTL_REMOVE 0x4C81
|
||||
#define LOOP_CTL_GET_FREE 0x4C82
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ extern void mem_cgroup_uncharge_end(void);
|
|||
|
||||
extern void mem_cgroup_uncharge_page(struct page *page);
|
||||
extern void mem_cgroup_uncharge_cache_page(struct page *page);
|
||||
extern int mem_cgroup_shmem_charge_fallback(struct page *page,
|
||||
struct mm_struct *mm, gfp_t gfp_mask);
|
||||
|
||||
extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
|
||||
int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
|
||||
|
|
@ -111,8 +109,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
|
|||
int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg);
|
||||
int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
|
||||
unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
|
||||
struct zone *zone,
|
||||
enum lru_list lru);
|
||||
int nid, int zid, unsigned int lrumask);
|
||||
struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
|
||||
struct zone *zone);
|
||||
struct zone_reclaim_stat*
|
||||
|
|
@ -207,12 +204,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page)
|
|||
{
|
||||
}
|
||||
|
||||
static inline int mem_cgroup_shmem_charge_fallback(struct page *page,
|
||||
struct mm_struct *mm, gfp_t gfp_mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_add_lru_list(struct page *page, int lru)
|
||||
{
|
||||
}
|
||||
|
|
@ -313,8 +304,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg)
|
|||
}
|
||||
|
||||
static inline unsigned long
|
||||
mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone,
|
||||
enum lru_list lru)
|
||||
mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
|
||||
unsigned int lru_mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
181
include/linux/mfd/aat2870.h
Normal file
181
include/linux/mfd/aat2870.h
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
* linux/include/linux/mfd/aat2870.h
|
||||
*
|
||||
* Copyright (c) 2011, NVIDIA Corporation.
|
||||
* Author: Jin Park <jinyoungp@nvidia.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MFD_AAT2870_H
|
||||
#define __LINUX_MFD_AAT2870_H
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/i2c.h>
|
||||
|
||||
/* Register offsets */
|
||||
#define AAT2870_BL_CH_EN 0x00
|
||||
#define AAT2870_BLM 0x01
|
||||
#define AAT2870_BLS 0x02
|
||||
#define AAT2870_BL1 0x03
|
||||
#define AAT2870_BL2 0x04
|
||||
#define AAT2870_BL3 0x05
|
||||
#define AAT2870_BL4 0x06
|
||||
#define AAT2870_BL5 0x07
|
||||
#define AAT2870_BL6 0x08
|
||||
#define AAT2870_BL7 0x09
|
||||
#define AAT2870_BL8 0x0A
|
||||
#define AAT2870_FLR 0x0B
|
||||
#define AAT2870_FM 0x0C
|
||||
#define AAT2870_FS 0x0D
|
||||
#define AAT2870_ALS_CFG0 0x0E
|
||||
#define AAT2870_ALS_CFG1 0x0F
|
||||
#define AAT2870_ALS_CFG2 0x10
|
||||
#define AAT2870_AMB 0x11
|
||||
#define AAT2870_ALS0 0x12
|
||||
#define AAT2870_ALS1 0x13
|
||||
#define AAT2870_ALS2 0x14
|
||||
#define AAT2870_ALS3 0x15
|
||||
#define AAT2870_ALS4 0x16
|
||||
#define AAT2870_ALS5 0x17
|
||||
#define AAT2870_ALS6 0x18
|
||||
#define AAT2870_ALS7 0x19
|
||||
#define AAT2870_ALS8 0x1A
|
||||
#define AAT2870_ALS9 0x1B
|
||||
#define AAT2870_ALSA 0x1C
|
||||
#define AAT2870_ALSB 0x1D
|
||||
#define AAT2870_ALSC 0x1E
|
||||
#define AAT2870_ALSD 0x1F
|
||||
#define AAT2870_ALSE 0x20
|
||||
#define AAT2870_ALSF 0x21
|
||||
#define AAT2870_SUB_SET 0x22
|
||||
#define AAT2870_SUB_CTRL 0x23
|
||||
#define AAT2870_LDO_AB 0x24
|
||||
#define AAT2870_LDO_CD 0x25
|
||||
#define AAT2870_LDO_EN 0x26
|
||||
#define AAT2870_REG_NUM 0x27
|
||||
|
||||
/* Device IDs */
|
||||
enum aat2870_id {
|
||||
AAT2870_ID_BL,
|
||||
AAT2870_ID_LDOA,
|
||||
AAT2870_ID_LDOB,
|
||||
AAT2870_ID_LDOC,
|
||||
AAT2870_ID_LDOD
|
||||
};
|
||||
|
||||
/* Backlight channels */
|
||||
#define AAT2870_BL_CH1 0x01
|
||||
#define AAT2870_BL_CH2 0x02
|
||||
#define AAT2870_BL_CH3 0x04
|
||||
#define AAT2870_BL_CH4 0x08
|
||||
#define AAT2870_BL_CH5 0x10
|
||||
#define AAT2870_BL_CH6 0x20
|
||||
#define AAT2870_BL_CH7 0x40
|
||||
#define AAT2870_BL_CH8 0x80
|
||||
#define AAT2870_BL_CH_ALL 0xFF
|
||||
|
||||
/* Backlight current magnitude (mA) */
|
||||
enum aat2870_current {
|
||||
AAT2870_CURRENT_0_45 = 1,
|
||||
AAT2870_CURRENT_0_90,
|
||||
AAT2870_CURRENT_1_80,
|
||||
AAT2870_CURRENT_2_70,
|
||||
AAT2870_CURRENT_3_60,
|
||||
AAT2870_CURRENT_4_50,
|
||||
AAT2870_CURRENT_5_40,
|
||||
AAT2870_CURRENT_6_30,
|
||||
AAT2870_CURRENT_7_20,
|
||||
AAT2870_CURRENT_8_10,
|
||||
AAT2870_CURRENT_9_00,
|
||||
AAT2870_CURRENT_9_90,
|
||||
AAT2870_CURRENT_10_8,
|
||||
AAT2870_CURRENT_11_7,
|
||||
AAT2870_CURRENT_12_6,
|
||||
AAT2870_CURRENT_13_5,
|
||||
AAT2870_CURRENT_14_4,
|
||||
AAT2870_CURRENT_15_3,
|
||||
AAT2870_CURRENT_16_2,
|
||||
AAT2870_CURRENT_17_1,
|
||||
AAT2870_CURRENT_18_0,
|
||||
AAT2870_CURRENT_18_9,
|
||||
AAT2870_CURRENT_19_8,
|
||||
AAT2870_CURRENT_20_7,
|
||||
AAT2870_CURRENT_21_6,
|
||||
AAT2870_CURRENT_22_5,
|
||||
AAT2870_CURRENT_23_4,
|
||||
AAT2870_CURRENT_24_3,
|
||||
AAT2870_CURRENT_25_2,
|
||||
AAT2870_CURRENT_26_1,
|
||||
AAT2870_CURRENT_27_0,
|
||||
AAT2870_CURRENT_27_9
|
||||
};
|
||||
|
||||
struct aat2870_register {
|
||||
bool readable;
|
||||
bool writeable;
|
||||
u8 value;
|
||||
};
|
||||
|
||||
struct aat2870_data {
|
||||
struct device *dev;
|
||||
struct i2c_client *client;
|
||||
|
||||
struct mutex io_lock;
|
||||
struct aat2870_register *reg_cache; /* register cache */
|
||||
int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
|
||||
bool is_enable;
|
||||
|
||||
/* init and uninit for platform specified */
|
||||
int (*init)(struct aat2870_data *aat2870);
|
||||
void (*uninit)(struct aat2870_data *aat2870);
|
||||
|
||||
/* i2c io funcntions */
|
||||
int (*read)(struct aat2870_data *aat2870, u8 addr, u8 *val);
|
||||
int (*write)(struct aat2870_data *aat2870, u8 addr, u8 val);
|
||||
int (*update)(struct aat2870_data *aat2870, u8 addr, u8 mask, u8 val);
|
||||
|
||||
/* for debugfs */
|
||||
struct dentry *dentry_root;
|
||||
struct dentry *dentry_reg;
|
||||
};
|
||||
|
||||
struct aat2870_subdev_info {
|
||||
int id;
|
||||
const char *name;
|
||||
void *platform_data;
|
||||
};
|
||||
|
||||
struct aat2870_platform_data {
|
||||
int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
|
||||
|
||||
struct aat2870_subdev_info *subdevs;
|
||||
int num_subdevs;
|
||||
|
||||
/* init and uninit for platform specified */
|
||||
int (*init)(struct aat2870_data *aat2870);
|
||||
void (*uninit)(struct aat2870_data *aat2870);
|
||||
};
|
||||
|
||||
struct aat2870_bl_platform_data {
|
||||
/* backlight channels, default is AAT2870_BL_CH_ALL */
|
||||
int channels;
|
||||
/* backlight current magnitude, default is AAT2870_CURRENT_27_9 */
|
||||
int max_current;
|
||||
/* maximum brightness, default is 255 */
|
||||
int max_brightness;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MFD_AAT2870_H */
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
#define AB8500_INTERRUPT 0xE
|
||||
#define AB8500_RTC 0xF
|
||||
#define AB8500_MISC 0x10
|
||||
#define AB8500_DEVELOPMENT 0x11
|
||||
#define AB8500_DEBUG 0x12
|
||||
#define AB8500_PROD_TEST 0x13
|
||||
#define AB8500_OTP_EMUL 0x15
|
||||
|
|
@ -74,13 +75,6 @@
|
|||
#define AB8500_INT_ACC_DETECT_21DB_F 37
|
||||
#define AB8500_INT_ACC_DETECT_21DB_R 38
|
||||
#define AB8500_INT_GP_SW_ADC_CONV_END 39
|
||||
#define AB8500_INT_ACC_DETECT_1DB_F 33
|
||||
#define AB8500_INT_ACC_DETECT_1DB_R 34
|
||||
#define AB8500_INT_ACC_DETECT_22DB_F 35
|
||||
#define AB8500_INT_ACC_DETECT_22DB_R 36
|
||||
#define AB8500_INT_ACC_DETECT_21DB_F 37
|
||||
#define AB8500_INT_ACC_DETECT_21DB_R 38
|
||||
#define AB8500_INT_GP_SW_ADC_CONV_END 39
|
||||
#define AB8500_INT_GPIO6R 40
|
||||
#define AB8500_INT_GPIO7R 41
|
||||
#define AB8500_INT_GPIO8R 42
|
||||
|
|
|
|||
|
|
@ -107,11 +107,16 @@ struct max8997_platform_data {
|
|||
unsigned int buck5_voltage[8];
|
||||
bool buck5_gpiodvs;
|
||||
|
||||
/* ---- Charger control ---- */
|
||||
/* eoc stands for 'end of charge' */
|
||||
int eoc_mA; /* 50 ~ 200mA by 10mA step */
|
||||
/* charge Full Timeout */
|
||||
int timeout; /* 0 (no timeout), 5, 6, 7 hours */
|
||||
|
||||
/* MUIC: Not implemented */
|
||||
/* HAPTIC: Not implemented */
|
||||
/* RTC: Not implemented */
|
||||
/* Flash: Not implemented */
|
||||
/* Charger control: Not implemented */
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MFD_MAX8998_H */
|
||||
|
|
|
|||
|
|
@ -87,6 +87,15 @@ struct max8998_regulator_data {
|
|||
* @wakeup: Allow to wake up from suspend
|
||||
* @rtc_delay: LP3974 RTC chip bug that requires delay after a register
|
||||
* write before reading it.
|
||||
* @eoc: End of Charge Level in percent: 10% ~ 45% by 5% step
|
||||
* If it equals 0, leave it unchanged.
|
||||
* Otherwise, it is a invalid value.
|
||||
* @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
|
||||
* If it equals 0, leave it unchanged.
|
||||
* Otherwise, it is a invalid value.
|
||||
* @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
|
||||
* If it equals 0, leave it unchanged.
|
||||
* Otherwise, leave it unchanged.
|
||||
*/
|
||||
struct max8998_platform_data {
|
||||
struct max8998_regulator_data *regulators;
|
||||
|
|
@ -107,6 +116,9 @@ struct max8998_platform_data {
|
|||
int buck2_default_idx;
|
||||
bool wakeup;
|
||||
bool rtc_delay;
|
||||
int eoc;
|
||||
int restart;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MFD_MAX8998_H */
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ struct stmpe_variant_info;
|
|||
* @irq_lock: IRQ bus lock
|
||||
* @dev: device, mostly for dev_dbg()
|
||||
* @i2c: i2c client
|
||||
* @partnum: part number
|
||||
* @variant: the detected STMPE model number
|
||||
* @regs: list of addresses of registers which are at different addresses on
|
||||
* different variants. Indexed by one of STMPE_IDX_*.
|
||||
|
|
@ -121,6 +122,8 @@ struct stmpe_keypad_platform_data {
|
|||
* @norequest_mask: bitmask specifying which GPIOs should _not_ be
|
||||
* requestable due to different usage (e.g. touch, keypad)
|
||||
* STMPE_GPIO_NOREQ_* macros can be used here.
|
||||
* @setup: board specific setup callback.
|
||||
* @remove: board specific remove callback
|
||||
*/
|
||||
struct stmpe_gpio_platform_data {
|
||||
int gpio_base;
|
||||
|
|
|
|||
|
|
@ -791,6 +791,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
|
|||
void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
|
||||
int tps65910_irq_init(struct tps65910 *tps65910, int irq,
|
||||
struct tps65910_platform_data *pdata);
|
||||
int tps65910_irq_exit(struct tps65910 *tps65910);
|
||||
|
||||
static inline int tps65910_chip_id(struct tps65910 *tps65910)
|
||||
{
|
||||
|
|
|
|||
327
include/linux/mfd/tps65912.h
Normal file
327
include/linux/mfd/tps65912.h
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
/*
|
||||
* tps65912.h -- TI TPS6591x
|
||||
*
|
||||
* Copyright 2011 Texas Instruments Inc.
|
||||
*
|
||||
* Author: Margarita Olaya <magi@slimlogic.co.uk>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MFD_TPS65912_H
|
||||
#define __LINUX_MFD_TPS65912_H
|
||||
|
||||
/* TPS regulator type list */
|
||||
#define REGULATOR_LDO 0
|
||||
#define REGULATOR_DCDC 1
|
||||
|
||||
/*
|
||||
* List of registers for TPS65912
|
||||
*/
|
||||
|
||||
#define TPS65912_DCDC1_CTRL 0x00
|
||||
#define TPS65912_DCDC2_CTRL 0x01
|
||||
#define TPS65912_DCDC3_CTRL 0x02
|
||||
#define TPS65912_DCDC4_CTRL 0x03
|
||||
#define TPS65912_DCDC1_OP 0x04
|
||||
#define TPS65912_DCDC1_AVS 0x05
|
||||
#define TPS65912_DCDC1_LIMIT 0x06
|
||||
#define TPS65912_DCDC2_OP 0x07
|
||||
#define TPS65912_DCDC2_AVS 0x08
|
||||
#define TPS65912_DCDC2_LIMIT 0x09
|
||||
#define TPS65912_DCDC3_OP 0x0A
|
||||
#define TPS65912_DCDC3_AVS 0x0B
|
||||
#define TPS65912_DCDC3_LIMIT 0x0C
|
||||
#define TPS65912_DCDC4_OP 0x0D
|
||||
#define TPS65912_DCDC4_AVS 0x0E
|
||||
#define TPS65912_DCDC4_LIMIT 0x0F
|
||||
#define TPS65912_LDO1_OP 0x10
|
||||
#define TPS65912_LDO1_AVS 0x11
|
||||
#define TPS65912_LDO1_LIMIT 0x12
|
||||
#define TPS65912_LDO2_OP 0x13
|
||||
#define TPS65912_LDO2_AVS 0x14
|
||||
#define TPS65912_LDO2_LIMIT 0x15
|
||||
#define TPS65912_LDO3_OP 0x16
|
||||
#define TPS65912_LDO3_AVS 0x17
|
||||
#define TPS65912_LDO3_LIMIT 0x18
|
||||
#define TPS65912_LDO4_OP 0x19
|
||||
#define TPS65912_LDO4_AVS 0x1A
|
||||
#define TPS65912_LDO4_LIMIT 0x1B
|
||||
#define TPS65912_LDO5 0x1C
|
||||
#define TPS65912_LDO6 0x1D
|
||||
#define TPS65912_LDO7 0x1E
|
||||
#define TPS65912_LDO8 0x1F
|
||||
#define TPS65912_LDO9 0x20
|
||||
#define TPS65912_LDO10 0x21
|
||||
#define TPS65912_THRM 0x22
|
||||
#define TPS65912_CLK32OUT 0x23
|
||||
#define TPS65912_DEVCTRL 0x24
|
||||
#define TPS65912_DEVCTRL2 0x25
|
||||
#define TPS65912_I2C_SPI_CFG 0x26
|
||||
#define TPS65912_KEEP_ON 0x27
|
||||
#define TPS65912_KEEP_ON2 0x28
|
||||
#define TPS65912_SET_OFF1 0x29
|
||||
#define TPS65912_SET_OFF2 0x2A
|
||||
#define TPS65912_DEF_VOLT 0x2B
|
||||
#define TPS65912_DEF_VOLT_MAPPING 0x2C
|
||||
#define TPS65912_DISCHARGE 0x2D
|
||||
#define TPS65912_DISCHARGE2 0x2E
|
||||
#define TPS65912_EN1_SET1 0x2F
|
||||
#define TPS65912_EN1_SET2 0x30
|
||||
#define TPS65912_EN2_SET1 0x31
|
||||
#define TPS65912_EN2_SET2 0x32
|
||||
#define TPS65912_EN3_SET1 0x33
|
||||
#define TPS65912_EN3_SET2 0x34
|
||||
#define TPS65912_EN4_SET1 0x35
|
||||
#define TPS65912_EN4_SET2 0x36
|
||||
#define TPS65912_PGOOD 0x37
|
||||
#define TPS65912_PGOOD2 0x38
|
||||
#define TPS65912_INT_STS 0x39
|
||||
#define TPS65912_INT_MSK 0x3A
|
||||
#define TPS65912_INT_STS2 0x3B
|
||||
#define TPS65912_INT_MSK2 0x3C
|
||||
#define TPS65912_INT_STS3 0x3D
|
||||
#define TPS65912_INT_MSK3 0x3E
|
||||
#define TPS65912_INT_STS4 0x3F
|
||||
#define TPS65912_INT_MSK4 0x40
|
||||
#define TPS65912_GPIO1 0x41
|
||||
#define TPS65912_GPIO2 0x42
|
||||
#define TPS65912_GPIO3 0x43
|
||||
#define TPS65912_GPIO4 0x44
|
||||
#define TPS65912_GPIO5 0x45
|
||||
#define TPS65912_VMON 0x46
|
||||
#define TPS65912_LEDA_CTRL1 0x47
|
||||
#define TPS65912_LEDA_CTRL2 0x48
|
||||
#define TPS65912_LEDA_CTRL3 0x49
|
||||
#define TPS65912_LEDA_CTRL4 0x4A
|
||||
#define TPS65912_LEDA_CTRL5 0x4B
|
||||
#define TPS65912_LEDA_CTRL6 0x4C
|
||||
#define TPS65912_LEDA_CTRL7 0x4D
|
||||
#define TPS65912_LEDA_CTRL8 0x4E
|
||||
#define TPS65912_LEDB_CTRL1 0x4F
|
||||
#define TPS65912_LEDB_CTRL2 0x50
|
||||
#define TPS65912_LEDB_CTRL3 0x51
|
||||
#define TPS65912_LEDB_CTRL4 0x52
|
||||
#define TPS65912_LEDB_CTRL5 0x53
|
||||
#define TPS65912_LEDB_CTRL6 0x54
|
||||
#define TPS65912_LEDB_CTRL7 0x55
|
||||
#define TPS65912_LEDB_CTRL8 0x56
|
||||
#define TPS65912_LEDC_CTRL1 0x57
|
||||
#define TPS65912_LEDC_CTRL2 0x58
|
||||
#define TPS65912_LEDC_CTRL3 0x59
|
||||
#define TPS65912_LEDC_CTRL4 0x5A
|
||||
#define TPS65912_LEDC_CTRL5 0x5B
|
||||
#define TPS65912_LEDC_CTRL6 0x5C
|
||||
#define TPS65912_LEDC_CTRL7 0x5D
|
||||
#define TPS65912_LEDC_CTRL8 0x5E
|
||||
#define TPS65912_LED_RAMP_UP_TIME 0x5F
|
||||
#define TPS65912_LED_RAMP_DOWN_TIME 0x60
|
||||
#define TPS65912_LED_SEQ_EN 0x61
|
||||
#define TPS65912_LOADSWITCH 0x62
|
||||
#define TPS65912_SPARE 0x63
|
||||
#define TPS65912_VERNUM 0x64
|
||||
#define TPS6591X_MAX_REGISTER 0x64
|
||||
|
||||
/* IRQ Definitions */
|
||||
#define TPS65912_IRQ_PWRHOLD_F 0
|
||||
#define TPS65912_IRQ_VMON 1
|
||||
#define TPS65912_IRQ_PWRON 2
|
||||
#define TPS65912_IRQ_PWRON_LP 3
|
||||
#define TPS65912_IRQ_PWRHOLD_R 4
|
||||
#define TPS65912_IRQ_HOTDIE 5
|
||||
#define TPS65912_IRQ_GPIO1_R 6
|
||||
#define TPS65912_IRQ_GPIO1_F 7
|
||||
#define TPS65912_IRQ_GPIO2_R 8
|
||||
#define TPS65912_IRQ_GPIO2_F 9
|
||||
#define TPS65912_IRQ_GPIO3_R 10
|
||||
#define TPS65912_IRQ_GPIO3_F 11
|
||||
#define TPS65912_IRQ_GPIO4_R 12
|
||||
#define TPS65912_IRQ_GPIO4_F 13
|
||||
#define TPS65912_IRQ_GPIO5_R 14
|
||||
#define TPS65912_IRQ_GPIO5_F 15
|
||||
#define TPS65912_IRQ_PGOOD_DCDC1 16
|
||||
#define TPS65912_IRQ_PGOOD_DCDC2 17
|
||||
#define TPS65912_IRQ_PGOOD_DCDC3 18
|
||||
#define TPS65912_IRQ_PGOOD_DCDC4 19
|
||||
#define TPS65912_IRQ_PGOOD_LDO1 20
|
||||
#define TPS65912_IRQ_PGOOD_LDO2 21
|
||||
#define TPS65912_IRQ_PGOOD_LDO3 22
|
||||
#define TPS65912_IRQ_PGOOD_LDO4 23
|
||||
#define TPS65912_IRQ_PGOOD_LDO5 24
|
||||
#define TPS65912_IRQ_PGOOD_LDO6 25
|
||||
#define TPS65912_IRQ_PGOOD_LDO7 26
|
||||
#define TPS65912_IRQ_PGOOD_LD08 27
|
||||
#define TPS65912_IRQ_PGOOD_LDO9 28
|
||||
#define TPS65912_IRQ_PGOOD_LDO10 29
|
||||
|
||||
#define TPS65912_NUM_IRQ 30
|
||||
|
||||
/* GPIO 1 and 2 Register Definitions */
|
||||
#define GPIO_SLEEP_MASK 0x80
|
||||
#define GPIO_SLEEP_SHIFT 7
|
||||
#define GPIO_DEB_MASK 0x10
|
||||
#define GPIO_DEB_SHIFT 4
|
||||
#define GPIO_CFG_MASK 0x04
|
||||
#define GPIO_CFG_SHIFT 2
|
||||
#define GPIO_STS_MASK 0x02
|
||||
#define GPIO_STS_SHIFT 1
|
||||
#define GPIO_SET_MASK 0x01
|
||||
#define GPIO_SET_SHIFT 0
|
||||
|
||||
/* GPIO 3 Register Definitions */
|
||||
#define GPIO3_SLEEP_MASK 0x80
|
||||
#define GPIO3_SLEEP_SHIFT 7
|
||||
#define GPIO3_SEL_MASK 0x40
|
||||
#define GPIO3_SEL_SHIFT 6
|
||||
#define GPIO3_ODEN_MASK 0x20
|
||||
#define GPIO3_ODEN_SHIFT 5
|
||||
#define GPIO3_DEB_MASK 0x10
|
||||
#define GPIO3_DEB_SHIFT 4
|
||||
#define GPIO3_PDEN_MASK 0x08
|
||||
#define GPIO3_PDEN_SHIFT 3
|
||||
#define GPIO3_CFG_MASK 0x04
|
||||
#define GPIO3_CFG_SHIFT 2
|
||||
#define GPIO3_STS_MASK 0x02
|
||||
#define GPIO3_STS_SHIFT 1
|
||||
#define GPIO3_SET_MASK 0x01
|
||||
#define GPIO3_SET_SHIFT 0
|
||||
|
||||
/* GPIO 4 Register Definitions */
|
||||
#define GPIO4_SLEEP_MASK 0x80
|
||||
#define GPIO4_SLEEP_SHIFT 7
|
||||
#define GPIO4_SEL_MASK 0x40
|
||||
#define GPIO4_SEL_SHIFT 6
|
||||
#define GPIO4_ODEN_MASK 0x20
|
||||
#define GPIO4_ODEN_SHIFT 5
|
||||
#define GPIO4_DEB_MASK 0x10
|
||||
#define GPIO4_DEB_SHIFT 4
|
||||
#define GPIO4_PDEN_MASK 0x08
|
||||
#define GPIO4_PDEN_SHIFT 3
|
||||
#define GPIO4_CFG_MASK 0x04
|
||||
#define GPIO4_CFG_SHIFT 2
|
||||
#define GPIO4_STS_MASK 0x02
|
||||
#define GPIO4_STS_SHIFT 1
|
||||
#define GPIO4_SET_MASK 0x01
|
||||
#define GPIO4_SET_SHIFT 0
|
||||
|
||||
/* Register THERM (0x80) register.RegisterDescription */
|
||||
#define THERM_THERM_HD_MASK 0x20
|
||||
#define THERM_THERM_HD_SHIFT 5
|
||||
#define THERM_THERM_TS_MASK 0x10
|
||||
#define THERM_THERM_TS_SHIFT 4
|
||||
#define THERM_THERM_HDSEL_MASK 0x0C
|
||||
#define THERM_THERM_HDSEL_SHIFT 2
|
||||
#define THERM_RSVD1_MASK 0x02
|
||||
#define THERM_RSVD1_SHIFT 1
|
||||
#define THERM_THERM_STATE_MASK 0x01
|
||||
#define THERM_THERM_STATE_SHIFT 0
|
||||
|
||||
/* Register DCDCCTRL1 register.RegisterDescription */
|
||||
#define DCDCCTRL_VCON_ENABLE_MASK 0x80
|
||||
#define DCDCCTRL_VCON_ENABLE_SHIFT 7
|
||||
#define DCDCCTRL_VCON_RANGE1_MASK 0x40
|
||||
#define DCDCCTRL_VCON_RANGE1_SHIFT 6
|
||||
#define DCDCCTRL_VCON_RANGE0_MASK 0x20
|
||||
#define DCDCCTRL_VCON_RANGE0_SHIFT 5
|
||||
#define DCDCCTRL_TSTEP2_MASK 0x10
|
||||
#define DCDCCTRL_TSTEP2_SHIFT 4
|
||||
#define DCDCCTRL_TSTEP1_MASK 0x08
|
||||
#define DCDCCTRL_TSTEP1_SHIFT 3
|
||||
#define DCDCCTRL_TSTEP0_MASK 0x04
|
||||
#define DCDCCTRL_TSTEP0_SHIFT 2
|
||||
#define DCDCCTRL_DCDC1_MODE_MASK 0x02
|
||||
#define DCDCCTRL_DCDC1_MODE_SHIFT 1
|
||||
|
||||
/* Register DCDCCTRL2 and DCDCCTRL3 register.RegisterDescription */
|
||||
#define DCDCCTRL_TSTEP2_MASK 0x10
|
||||
#define DCDCCTRL_TSTEP2_SHIFT 4
|
||||
#define DCDCCTRL_TSTEP1_MASK 0x08
|
||||
#define DCDCCTRL_TSTEP1_SHIFT 3
|
||||
#define DCDCCTRL_TSTEP0_MASK 0x04
|
||||
#define DCDCCTRL_TSTEP0_SHIFT 2
|
||||
#define DCDCCTRL_DCDC_MODE_MASK 0x02
|
||||
#define DCDCCTRL_DCDC_MODE_SHIFT 1
|
||||
#define DCDCCTRL_RSVD0_MASK 0x01
|
||||
#define DCDCCTRL_RSVD0_SHIFT 0
|
||||
|
||||
/* Register DCDCCTRL4 register.RegisterDescription */
|
||||
#define DCDCCTRL_RAMP_TIME_MASK 0x01
|
||||
#define DCDCCTRL_RAMP_TIME_SHIFT 0
|
||||
|
||||
/* Register DCDCx_AVS */
|
||||
#define DCDC_AVS_ENABLE_MASK 0x80
|
||||
#define DCDC_AVS_ENABLE_SHIFT 7
|
||||
#define DCDC_AVS_ECO_MASK 0x40
|
||||
#define DCDC_AVS_ECO_SHIFT 6
|
||||
|
||||
/* Register DCDCx_LIMIT */
|
||||
#define DCDC_LIMIT_RANGE_MASK 0xC0
|
||||
#define DCDC_LIMIT_RANGE_SHIFT 6
|
||||
#define DCDC_LIMIT_MAX_SEL_MASK 0x3F
|
||||
#define DCDC_LIMIT_MAX_SEL_SHIFT 0
|
||||
|
||||
/**
|
||||
* struct tps65912_board
|
||||
* Board platform dat may be used to initialize regulators.
|
||||
*/
|
||||
struct tps65912_board {
|
||||
int is_dcdc1_avs;
|
||||
int is_dcdc2_avs;
|
||||
int is_dcdc3_avs;
|
||||
int is_dcdc4_avs;
|
||||
int irq;
|
||||
int irq_base;
|
||||
int gpio_base;
|
||||
struct regulator_init_data *tps65912_pmic_init_data;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct tps65912 - tps65912 sub-driver chip access routines
|
||||
*/
|
||||
|
||||
struct tps65912 {
|
||||
struct device *dev;
|
||||
/* for read/write acces */
|
||||
struct mutex io_mutex;
|
||||
|
||||
/* For device IO interfaces: I2C or SPI */
|
||||
void *control_data;
|
||||
|
||||
int (*read)(struct tps65912 *tps65912, u8 reg, int size, void *dest);
|
||||
int (*write)(struct tps65912 *tps65912, u8 reg, int size, void *src);
|
||||
|
||||
/* Client devices */
|
||||
struct tps65912_pmic *pmic;
|
||||
|
||||
/* GPIO Handling */
|
||||
struct gpio_chip gpio;
|
||||
|
||||
/* IRQ Handling */
|
||||
struct mutex irq_lock;
|
||||
int chip_irq;
|
||||
int irq_base;
|
||||
int irq_num;
|
||||
u32 irq_mask;
|
||||
};
|
||||
|
||||
struct tps65912_platform_data {
|
||||
int irq;
|
||||
int irq_base;
|
||||
};
|
||||
|
||||
unsigned int tps_chip(void);
|
||||
|
||||
int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
|
||||
int tps65912_clear_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
|
||||
int tps65912_reg_read(struct tps65912 *tps65912, u8 reg);
|
||||
int tps65912_reg_write(struct tps65912 *tps65912, u8 reg, u8 val);
|
||||
int tps65912_device_init(struct tps65912 *tps65912);
|
||||
void tps65912_device_exit(struct tps65912 *tps65912);
|
||||
int tps65912_irq_init(struct tps65912 *tps65912, int irq,
|
||||
struct tps65912_platform_data *pdata);
|
||||
|
||||
#endif /* __LINUX_MFD_TPS65912_H */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* MFD driver for twl4030 codec submodule
|
||||
* MFD driver for twl4030 audio submodule
|
||||
*
|
||||
* Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
|
||||
*
|
||||
|
|
@ -259,14 +259,14 @@
|
|||
#define TWL4030_VIBRA_DIR_SEL 0x20
|
||||
|
||||
/* TWL4030 codec resource IDs */
|
||||
enum twl4030_codec_res {
|
||||
TWL4030_CODEC_RES_POWER = 0,
|
||||
TWL4030_CODEC_RES_APLL,
|
||||
TWL4030_CODEC_RES_MAX,
|
||||
enum twl4030_audio_res {
|
||||
TWL4030_AUDIO_RES_POWER = 0,
|
||||
TWL4030_AUDIO_RES_APLL,
|
||||
TWL4030_AUDIO_RES_MAX,
|
||||
};
|
||||
|
||||
int twl4030_codec_disable_resource(enum twl4030_codec_res id);
|
||||
int twl4030_codec_enable_resource(enum twl4030_codec_res id);
|
||||
unsigned int twl4030_codec_get_mclk(void);
|
||||
int twl4030_audio_disable_resource(enum twl4030_audio_res id);
|
||||
int twl4030_audio_enable_resource(enum twl4030_audio_res id);
|
||||
unsigned int twl4030_audio_get_mclk(void);
|
||||
|
||||
#endif /* End of __TWL4030_CODEC_H__ */
|
||||
228
include/linux/mfd/twl6040.h
Normal file
228
include/linux/mfd/twl6040.h
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
/*
|
||||
* MFD driver for twl6040
|
||||
*
|
||||
* Authors: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
|
||||
* Misael Lopez Cruz <misael.lopez@ti.com>
|
||||
*
|
||||
* Copyright: (C) 2011 Texas Instruments, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TWL6040_CODEC_H__
|
||||
#define __TWL6040_CODEC_H__
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mfd/core.h>
|
||||
|
||||
#define TWL6040_REG_ASICID 0x01
|
||||
#define TWL6040_REG_ASICREV 0x02
|
||||
#define TWL6040_REG_INTID 0x03
|
||||
#define TWL6040_REG_INTMR 0x04
|
||||
#define TWL6040_REG_NCPCTL 0x05
|
||||
#define TWL6040_REG_LDOCTL 0x06
|
||||
#define TWL6040_REG_HPPLLCTL 0x07
|
||||
#define TWL6040_REG_LPPLLCTL 0x08
|
||||
#define TWL6040_REG_LPPLLDIV 0x09
|
||||
#define TWL6040_REG_AMICBCTL 0x0A
|
||||
#define TWL6040_REG_DMICBCTL 0x0B
|
||||
#define TWL6040_REG_MICLCTL 0x0C
|
||||
#define TWL6040_REG_MICRCTL 0x0D
|
||||
#define TWL6040_REG_MICGAIN 0x0E
|
||||
#define TWL6040_REG_LINEGAIN 0x0F
|
||||
#define TWL6040_REG_HSLCTL 0x10
|
||||
#define TWL6040_REG_HSRCTL 0x11
|
||||
#define TWL6040_REG_HSGAIN 0x12
|
||||
#define TWL6040_REG_EARCTL 0x13
|
||||
#define TWL6040_REG_HFLCTL 0x14
|
||||
#define TWL6040_REG_HFLGAIN 0x15
|
||||
#define TWL6040_REG_HFRCTL 0x16
|
||||
#define TWL6040_REG_HFRGAIN 0x17
|
||||
#define TWL6040_REG_VIBCTLL 0x18
|
||||
#define TWL6040_REG_VIBDATL 0x19
|
||||
#define TWL6040_REG_VIBCTLR 0x1A
|
||||
#define TWL6040_REG_VIBDATR 0x1B
|
||||
#define TWL6040_REG_HKCTL1 0x1C
|
||||
#define TWL6040_REG_HKCTL2 0x1D
|
||||
#define TWL6040_REG_GPOCTL 0x1E
|
||||
#define TWL6040_REG_ALB 0x1F
|
||||
#define TWL6040_REG_DLB 0x20
|
||||
#define TWL6040_REG_TRIM1 0x28
|
||||
#define TWL6040_REG_TRIM2 0x29
|
||||
#define TWL6040_REG_TRIM3 0x2A
|
||||
#define TWL6040_REG_HSOTRIM 0x2B
|
||||
#define TWL6040_REG_HFOTRIM 0x2C
|
||||
#define TWL6040_REG_ACCCTL 0x2D
|
||||
#define TWL6040_REG_STATUS 0x2E
|
||||
|
||||
#define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1)
|
||||
|
||||
#define TWL6040_VIOREGNUM 18
|
||||
#define TWL6040_VDDREGNUM 21
|
||||
|
||||
/* INTID (0x03) fields */
|
||||
|
||||
#define TWL6040_THINT 0x01
|
||||
#define TWL6040_PLUGINT 0x02
|
||||
#define TWL6040_UNPLUGINT 0x04
|
||||
#define TWL6040_HOOKINT 0x08
|
||||
#define TWL6040_HFINT 0x10
|
||||
#define TWL6040_VIBINT 0x20
|
||||
#define TWL6040_READYINT 0x40
|
||||
|
||||
/* INTMR (0x04) fields */
|
||||
|
||||
#define TWL6040_THMSK 0x01
|
||||
#define TWL6040_PLUGMSK 0x02
|
||||
#define TWL6040_HOOKMSK 0x08
|
||||
#define TWL6040_HFMSK 0x10
|
||||
#define TWL6040_VIBMSK 0x20
|
||||
#define TWL6040_READYMSK 0x40
|
||||
#define TWL6040_ALLINT_MSK 0x7B
|
||||
|
||||
/* NCPCTL (0x05) fields */
|
||||
|
||||
#define TWL6040_NCPENA 0x01
|
||||
#define TWL6040_NCPOPEN 0x40
|
||||
|
||||
/* LDOCTL (0x06) fields */
|
||||
|
||||
#define TWL6040_LSLDOENA 0x01
|
||||
#define TWL6040_HSLDOENA 0x04
|
||||
#define TWL6040_REFENA 0x40
|
||||
#define TWL6040_OSCENA 0x80
|
||||
|
||||
/* HPPLLCTL (0x07) fields */
|
||||
|
||||
#define TWL6040_HPLLENA 0x01
|
||||
#define TWL6040_HPLLRST 0x02
|
||||
#define TWL6040_HPLLBP 0x04
|
||||
#define TWL6040_HPLLSQRENA 0x08
|
||||
#define TWL6040_MCLK_12000KHZ (0 << 5)
|
||||
#define TWL6040_MCLK_19200KHZ (1 << 5)
|
||||
#define TWL6040_MCLK_26000KHZ (2 << 5)
|
||||
#define TWL6040_MCLK_38400KHZ (3 << 5)
|
||||
#define TWL6040_MCLK_MSK 0x60
|
||||
|
||||
/* LPPLLCTL (0x08) fields */
|
||||
|
||||
#define TWL6040_LPLLENA 0x01
|
||||
#define TWL6040_LPLLRST 0x02
|
||||
#define TWL6040_LPLLSEL 0x04
|
||||
#define TWL6040_LPLLFIN 0x08
|
||||
#define TWL6040_HPLLSEL 0x10
|
||||
|
||||
/* HSLCTL (0x10) fields */
|
||||
|
||||
#define TWL6040_HSDACMODEL 0x02
|
||||
#define TWL6040_HSDRVMODEL 0x08
|
||||
|
||||
/* HSRCTL (0x11) fields */
|
||||
|
||||
#define TWL6040_HSDACMODER 0x02
|
||||
#define TWL6040_HSDRVMODER 0x08
|
||||
|
||||
/* VIBCTLL (0x18) fields */
|
||||
|
||||
#define TWL6040_VIBENAL 0x01
|
||||
#define TWL6040_VIBCTRLL 0x04
|
||||
#define TWL6040_VIBCTRLLP 0x08
|
||||
#define TWL6040_VIBCTRLLN 0x10
|
||||
|
||||
/* VIBDATL (0x19) fields */
|
||||
|
||||
#define TWL6040_VIBDAT_MAX 0x64
|
||||
|
||||
/* VIBCTLR (0x1A) fields */
|
||||
|
||||
#define TWL6040_VIBENAR 0x01
|
||||
#define TWL6040_VIBCTRLR 0x04
|
||||
#define TWL6040_VIBCTRLRP 0x08
|
||||
#define TWL6040_VIBCTRLRN 0x10
|
||||
|
||||
/* GPOCTL (0x1E) fields */
|
||||
|
||||
#define TWL6040_GPO1 0x01
|
||||
#define TWL6040_GPO2 0x02
|
||||
#define TWL6040_GPO3 0x03
|
||||
|
||||
/* ACCCTL (0x2D) fields */
|
||||
|
||||
#define TWL6040_I2CSEL 0x01
|
||||
#define TWL6040_RESETSPLIT 0x04
|
||||
#define TWL6040_INTCLRMODE 0x08
|
||||
|
||||
/* STATUS (0x2E) fields */
|
||||
|
||||
#define TWL6040_PLUGCOMP 0x02
|
||||
#define TWL6040_VIBLOCDET 0x10
|
||||
#define TWL6040_VIBROCDET 0x20
|
||||
#define TWL6040_TSHUTDET 0x40
|
||||
|
||||
#define TWL6040_CELLS 2
|
||||
|
||||
#define TWL6040_REV_ES1_0 0x00
|
||||
#define TWL6040_REV_ES1_1 0x01
|
||||
#define TWL6040_REV_ES1_2 0x02
|
||||
|
||||
#define TWL6040_IRQ_TH 0
|
||||
#define TWL6040_IRQ_PLUG 1
|
||||
#define TWL6040_IRQ_HOOK 2
|
||||
#define TWL6040_IRQ_HF 3
|
||||
#define TWL6040_IRQ_VIB 4
|
||||
#define TWL6040_IRQ_READY 5
|
||||
|
||||
/* PLL selection */
|
||||
#define TWL6040_SYSCLK_SEL_LPPLL 0
|
||||
#define TWL6040_SYSCLK_SEL_HPPLL 1
|
||||
|
||||
struct twl6040 {
|
||||
struct device *dev;
|
||||
struct mutex mutex;
|
||||
struct mutex io_mutex;
|
||||
struct mutex irq_mutex;
|
||||
struct mfd_cell cells[TWL6040_CELLS];
|
||||
struct completion ready;
|
||||
|
||||
int audpwron;
|
||||
int power_count;
|
||||
int rev;
|
||||
|
||||
int pll;
|
||||
unsigned int sysclk;
|
||||
|
||||
unsigned int irq;
|
||||
unsigned int irq_base;
|
||||
u8 irq_masks_cur;
|
||||
u8 irq_masks_cache;
|
||||
};
|
||||
|
||||
int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg);
|
||||
int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg,
|
||||
u8 val);
|
||||
int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg,
|
||||
u8 mask);
|
||||
int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg,
|
||||
u8 mask);
|
||||
int twl6040_power(struct twl6040 *twl6040, int on);
|
||||
int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
|
||||
unsigned int freq_in, unsigned int freq_out);
|
||||
int twl6040_get_pll(struct twl6040 *twl6040);
|
||||
unsigned int twl6040_get_sysclk(struct twl6040 *twl6040);
|
||||
int twl6040_irq_init(struct twl6040 *twl6040);
|
||||
void twl6040_irq_exit(struct twl6040 *twl6040);
|
||||
|
||||
#endif /* End of __TWL6040_CODEC_H__ */
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <linux/completion.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
/*
|
||||
* Register values.
|
||||
|
|
@ -234,9 +235,111 @@
|
|||
#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */
|
||||
#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */
|
||||
|
||||
/*
|
||||
* R16528 (0x4090) - Clock Control 1
|
||||
*/
|
||||
#define WM831X_CLKOUT_ENA 0x8000 /* CLKOUT_ENA */
|
||||
#define WM831X_CLKOUT_ENA_MASK 0x8000 /* CLKOUT_ENA */
|
||||
#define WM831X_CLKOUT_ENA_SHIFT 15 /* CLKOUT_ENA */
|
||||
#define WM831X_CLKOUT_ENA_WIDTH 1 /* CLKOUT_ENA */
|
||||
#define WM831X_CLKOUT_OD 0x2000 /* CLKOUT_OD */
|
||||
#define WM831X_CLKOUT_OD_MASK 0x2000 /* CLKOUT_OD */
|
||||
#define WM831X_CLKOUT_OD_SHIFT 13 /* CLKOUT_OD */
|
||||
#define WM831X_CLKOUT_OD_WIDTH 1 /* CLKOUT_OD */
|
||||
#define WM831X_CLKOUT_SLOT_MASK 0x0700 /* CLKOUT_SLOT - [10:8] */
|
||||
#define WM831X_CLKOUT_SLOT_SHIFT 8 /* CLKOUT_SLOT - [10:8] */
|
||||
#define WM831X_CLKOUT_SLOT_WIDTH 3 /* CLKOUT_SLOT - [10:8] */
|
||||
#define WM831X_CLKOUT_SLPSLOT_MASK 0x0070 /* CLKOUT_SLPSLOT - [6:4] */
|
||||
#define WM831X_CLKOUT_SLPSLOT_SHIFT 4 /* CLKOUT_SLPSLOT - [6:4] */
|
||||
#define WM831X_CLKOUT_SLPSLOT_WIDTH 3 /* CLKOUT_SLPSLOT - [6:4] */
|
||||
#define WM831X_CLKOUT_SRC 0x0001 /* CLKOUT_SRC */
|
||||
#define WM831X_CLKOUT_SRC_MASK 0x0001 /* CLKOUT_SRC */
|
||||
#define WM831X_CLKOUT_SRC_SHIFT 0 /* CLKOUT_SRC */
|
||||
#define WM831X_CLKOUT_SRC_WIDTH 1 /* CLKOUT_SRC */
|
||||
|
||||
/*
|
||||
* R16529 (0x4091) - Clock Control 2
|
||||
*/
|
||||
#define WM831X_XTAL_INH 0x8000 /* XTAL_INH */
|
||||
#define WM831X_XTAL_INH_MASK 0x8000 /* XTAL_INH */
|
||||
#define WM831X_XTAL_INH_SHIFT 15 /* XTAL_INH */
|
||||
#define WM831X_XTAL_INH_WIDTH 1 /* XTAL_INH */
|
||||
#define WM831X_XTAL_ENA 0x2000 /* XTAL_ENA */
|
||||
#define WM831X_XTAL_ENA_MASK 0x2000 /* XTAL_ENA */
|
||||
#define WM831X_XTAL_ENA_SHIFT 13 /* XTAL_ENA */
|
||||
#define WM831X_XTAL_ENA_WIDTH 1 /* XTAL_ENA */
|
||||
#define WM831X_XTAL_BKUPENA 0x1000 /* XTAL_BKUPENA */
|
||||
#define WM831X_XTAL_BKUPENA_MASK 0x1000 /* XTAL_BKUPENA */
|
||||
#define WM831X_XTAL_BKUPENA_SHIFT 12 /* XTAL_BKUPENA */
|
||||
#define WM831X_XTAL_BKUPENA_WIDTH 1 /* XTAL_BKUPENA */
|
||||
#define WM831X_FLL_AUTO 0x0080 /* FLL_AUTO */
|
||||
#define WM831X_FLL_AUTO_MASK 0x0080 /* FLL_AUTO */
|
||||
#define WM831X_FLL_AUTO_SHIFT 7 /* FLL_AUTO */
|
||||
#define WM831X_FLL_AUTO_WIDTH 1 /* FLL_AUTO */
|
||||
#define WM831X_FLL_AUTO_FREQ_MASK 0x0007 /* FLL_AUTO_FREQ - [2:0] */
|
||||
#define WM831X_FLL_AUTO_FREQ_SHIFT 0 /* FLL_AUTO_FREQ - [2:0] */
|
||||
#define WM831X_FLL_AUTO_FREQ_WIDTH 3 /* FLL_AUTO_FREQ - [2:0] */
|
||||
|
||||
/*
|
||||
* R16530 (0x4092) - FLL Control 1
|
||||
*/
|
||||
#define WM831X_FLL_FRAC 0x0004 /* FLL_FRAC */
|
||||
#define WM831X_FLL_FRAC_MASK 0x0004 /* FLL_FRAC */
|
||||
#define WM831X_FLL_FRAC_SHIFT 2 /* FLL_FRAC */
|
||||
#define WM831X_FLL_FRAC_WIDTH 1 /* FLL_FRAC */
|
||||
#define WM831X_FLL_OSC_ENA 0x0002 /* FLL_OSC_ENA */
|
||||
#define WM831X_FLL_OSC_ENA_MASK 0x0002 /* FLL_OSC_ENA */
|
||||
#define WM831X_FLL_OSC_ENA_SHIFT 1 /* FLL_OSC_ENA */
|
||||
#define WM831X_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */
|
||||
#define WM831X_FLL_ENA 0x0001 /* FLL_ENA */
|
||||
#define WM831X_FLL_ENA_MASK 0x0001 /* FLL_ENA */
|
||||
#define WM831X_FLL_ENA_SHIFT 0 /* FLL_ENA */
|
||||
#define WM831X_FLL_ENA_WIDTH 1 /* FLL_ENA */
|
||||
|
||||
/*
|
||||
* R16531 (0x4093) - FLL Control 2
|
||||
*/
|
||||
#define WM831X_FLL_OUTDIV_MASK 0x3F00 /* FLL_OUTDIV - [13:8] */
|
||||
#define WM831X_FLL_OUTDIV_SHIFT 8 /* FLL_OUTDIV - [13:8] */
|
||||
#define WM831X_FLL_OUTDIV_WIDTH 6 /* FLL_OUTDIV - [13:8] */
|
||||
#define WM831X_FLL_CTRL_RATE_MASK 0x0070 /* FLL_CTRL_RATE - [6:4] */
|
||||
#define WM831X_FLL_CTRL_RATE_SHIFT 4 /* FLL_CTRL_RATE - [6:4] */
|
||||
#define WM831X_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [6:4] */
|
||||
#define WM831X_FLL_FRATIO_MASK 0x0007 /* FLL_FRATIO - [2:0] */
|
||||
#define WM831X_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [2:0] */
|
||||
#define WM831X_FLL_FRATIO_WIDTH 3 /* FLL_FRATIO - [2:0] */
|
||||
|
||||
/*
|
||||
* R16532 (0x4094) - FLL Control 3
|
||||
*/
|
||||
#define WM831X_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */
|
||||
#define WM831X_FLL_K_SHIFT 0 /* FLL_K - [15:0] */
|
||||
#define WM831X_FLL_K_WIDTH 16 /* FLL_K - [15:0] */
|
||||
|
||||
/*
|
||||
* R16533 (0x4095) - FLL Control 4
|
||||
*/
|
||||
#define WM831X_FLL_N_MASK 0x7FE0 /* FLL_N - [14:5] */
|
||||
#define WM831X_FLL_N_SHIFT 5 /* FLL_N - [14:5] */
|
||||
#define WM831X_FLL_N_WIDTH 10 /* FLL_N - [14:5] */
|
||||
#define WM831X_FLL_GAIN_MASK 0x000F /* FLL_GAIN - [3:0] */
|
||||
#define WM831X_FLL_GAIN_SHIFT 0 /* FLL_GAIN - [3:0] */
|
||||
#define WM831X_FLL_GAIN_WIDTH 4 /* FLL_GAIN - [3:0] */
|
||||
|
||||
/*
|
||||
* R16534 (0x4096) - FLL Control 5
|
||||
*/
|
||||
#define WM831X_FLL_CLK_REF_DIV_MASK 0x0018 /* FLL_CLK_REF_DIV - [4:3] */
|
||||
#define WM831X_FLL_CLK_REF_DIV_SHIFT 3 /* FLL_CLK_REF_DIV - [4:3] */
|
||||
#define WM831X_FLL_CLK_REF_DIV_WIDTH 2 /* FLL_CLK_REF_DIV - [4:3] */
|
||||
#define WM831X_FLL_CLK_SRC_MASK 0x0003 /* FLL_CLK_SRC - [1:0] */
|
||||
#define WM831X_FLL_CLK_SRC_SHIFT 0 /* FLL_CLK_SRC - [1:0] */
|
||||
#define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */
|
||||
|
||||
struct regulator_dev;
|
||||
|
||||
#define WM831X_NUM_IRQ_REGS 5
|
||||
#define WM831X_NUM_GPIO_REGS 16
|
||||
|
||||
enum wm831x_parent {
|
||||
WM8310 = 0x8310,
|
||||
|
|
@ -248,6 +351,12 @@ enum wm831x_parent {
|
|||
WM8326 = 0x8326,
|
||||
};
|
||||
|
||||
struct wm831x;
|
||||
enum wm831x_auxadc;
|
||||
|
||||
typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
|
||||
enum wm831x_auxadc input);
|
||||
|
||||
struct wm831x {
|
||||
struct mutex io_lock;
|
||||
|
||||
|
|
@ -261,7 +370,7 @@ struct wm831x {
|
|||
|
||||
int irq; /* Our chip IRQ */
|
||||
struct mutex irq_lock;
|
||||
unsigned int irq_base;
|
||||
int irq_base;
|
||||
int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
|
||||
int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
|
||||
|
||||
|
|
@ -272,8 +381,13 @@ struct wm831x {
|
|||
|
||||
int num_gpio;
|
||||
|
||||
/* Used by the interrupt controller code to post writes */
|
||||
int gpio_update[WM831X_NUM_GPIO_REGS];
|
||||
|
||||
struct mutex auxadc_lock;
|
||||
struct completion auxadc_done;
|
||||
struct list_head auxadc_pending;
|
||||
u16 auxadc_active;
|
||||
wm831x_auxadc_read_fn auxadc_read;
|
||||
|
||||
/* The WM831x has a security key blocking access to certain
|
||||
* registers. The mutex is taken by the accessors for locking
|
||||
|
|
@ -300,5 +414,6 @@ void wm831x_device_exit(struct wm831x *wm831x);
|
|||
int wm831x_device_suspend(struct wm831x *wm831x);
|
||||
int wm831x_irq_init(struct wm831x *wm831x, int irq);
|
||||
void wm831x_irq_exit(struct wm831x *wm831x);
|
||||
void wm831x_auxadc_init(struct wm831x *wm831x);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -120,6 +120,9 @@ struct wm831x_pdata {
|
|||
/** Put the /IRQ line into CMOS mode */
|
||||
bool irq_cmos;
|
||||
|
||||
/** Disable the touchscreen */
|
||||
bool disable_touch;
|
||||
|
||||
int irq_base;
|
||||
int gpio_base;
|
||||
int gpio_defaults[WM831X_GPIO_NUM];
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#define BTRFS_MINOR 234
|
||||
#define AUTOFS_MINOR 235
|
||||
#define MAPPER_CTRL_MINOR 236
|
||||
#define LOOP_CTRL_MINOR 237
|
||||
#define MISC_DYNAMIC_MINOR 255
|
||||
|
||||
struct device;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#include <linux/completion.h>
|
||||
#include <linux/radix-tree.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#define MAX_MSIX_P_PORT 17
|
||||
#define MAX_MSIX 64
|
||||
|
|
|
|||
|
|
@ -685,7 +685,7 @@ static inline void set_page_section(struct page *page, unsigned long section)
|
|||
page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
|
||||
}
|
||||
|
||||
static inline unsigned long page_to_section(struct page *page)
|
||||
static inline unsigned long page_to_section(const struct page *page)
|
||||
{
|
||||
return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
|
||||
}
|
||||
|
|
@ -720,7 +720,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
|
|||
|
||||
static __always_inline void *lowmem_page_address(const struct page *page)
|
||||
{
|
||||
return __va(PFN_PHYS(page_to_pfn((struct page *)page)));
|
||||
return __va(PFN_PHYS(page_to_pfn(page)));
|
||||
}
|
||||
|
||||
#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
|
||||
|
|
@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
|
|||
#endif
|
||||
|
||||
#if defined(HASHED_PAGE_VIRTUAL)
|
||||
void *page_address(struct page *page);
|
||||
void *page_address(const struct page *page);
|
||||
void set_page_address(struct page *page, void *virtual);
|
||||
void page_address_init(void);
|
||||
#endif
|
||||
|
|
@ -962,6 +962,8 @@ int invalidate_inode_page(struct page *page);
|
|||
#ifdef CONFIG_MMU
|
||||
extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
unsigned long address, unsigned int flags);
|
||||
extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
|
||||
unsigned long address, unsigned int fault_flags);
|
||||
#else
|
||||
static inline int handle_mm_fault(struct mm_struct *mm,
|
||||
struct vm_area_struct *vma, unsigned long address,
|
||||
|
|
@ -971,6 +973,14 @@ static inline int handle_mm_fault(struct mm_struct *mm,
|
|||
BUG();
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
static inline int fixup_user_fault(struct task_struct *tsk,
|
||||
struct mm_struct *mm, unsigned long address,
|
||||
unsigned int fault_flags)
|
||||
{
|
||||
/* should never happen if there's no MMU */
|
||||
BUG();
|
||||
return -EFAULT;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int make_pages_present(unsigned long addr, unsigned long end);
|
||||
|
|
@ -988,8 +998,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
|
|||
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||
struct page **pages);
|
||||
struct page *get_dump_page(unsigned long addr);
|
||||
extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
|
||||
unsigned long address, unsigned int fault_flags);
|
||||
|
||||
extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
|
||||
extern void do_invalidatepage(struct page *page, unsigned long offset);
|
||||
|
|
@ -1600,6 +1608,7 @@ enum mf_flags {
|
|||
};
|
||||
extern void memory_failure(unsigned long pfn, int trapno);
|
||||
extern int __memory_failure(unsigned long pfn, int trapno, int flags);
|
||||
extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
|
||||
extern int unpoison_memory(unsigned long pfn);
|
||||
extern int sysctl_memory_failure_early_kill;
|
||||
extern int sysctl_memory_failure_recovery;
|
||||
|
|
|
|||
|
|
@ -30,23 +30,61 @@ struct address_space;
|
|||
* moment. Note that we have no way to track which tasks are using
|
||||
* a page, though if it is a pagecache page, rmap structures can tell us
|
||||
* who is mapping it.
|
||||
*
|
||||
* The objects in struct page are organized in double word blocks in
|
||||
* order to allows us to use atomic double word operations on portions
|
||||
* of struct page. That is currently only used by slub but the arrangement
|
||||
* allows the use of atomic double word operations on the flags/mapping
|
||||
* and lru list pointers also.
|
||||
*/
|
||||
struct page {
|
||||
/* First double word block */
|
||||
unsigned long flags; /* Atomic flags, some possibly
|
||||
* updated asynchronously */
|
||||
atomic_t _count; /* Usage count, see below. */
|
||||
union {
|
||||
atomic_t _mapcount; /* Count of ptes mapped in mms,
|
||||
* to show when page is mapped
|
||||
* & limit reverse map searches.
|
||||
struct address_space *mapping; /* If low bit clear, points to
|
||||
* inode address_space, or NULL.
|
||||
* If page mapped as anonymous
|
||||
* memory, low bit is set, and
|
||||
* it points to anon_vma object:
|
||||
* see PAGE_MAPPING_ANON below.
|
||||
*/
|
||||
struct { /* SLUB */
|
||||
u16 inuse;
|
||||
u16 objects;
|
||||
/* Second double word */
|
||||
struct {
|
||||
union {
|
||||
pgoff_t index; /* Our offset within mapping. */
|
||||
void *freelist; /* slub first free object */
|
||||
};
|
||||
|
||||
union {
|
||||
/* Used for cmpxchg_double in slub */
|
||||
unsigned long counters;
|
||||
|
||||
struct {
|
||||
|
||||
union {
|
||||
atomic_t _mapcount; /* Count of ptes mapped in mms,
|
||||
* to show when page is mapped
|
||||
* & limit reverse map searches.
|
||||
*/
|
||||
|
||||
struct {
|
||||
unsigned inuse:16;
|
||||
unsigned objects:15;
|
||||
unsigned frozen:1;
|
||||
};
|
||||
};
|
||||
atomic_t _count; /* Usage count, see below. */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* Third double word block */
|
||||
struct list_head lru; /* Pageout list, eg. active_list
|
||||
* protected by zone->lru_lock !
|
||||
*/
|
||||
|
||||
/* Remainder is not double word aligned */
|
||||
union {
|
||||
struct {
|
||||
unsigned long private; /* Mapping-private opaque data:
|
||||
* usually used for buffer_heads
|
||||
* if PagePrivate set; used for
|
||||
|
|
@ -54,27 +92,13 @@ struct page {
|
|||
* indicates order in the buddy
|
||||
* system if PG_buddy is set.
|
||||
*/
|
||||
struct address_space *mapping; /* If low bit clear, points to
|
||||
* inode address_space, or NULL.
|
||||
* If page mapped as anonymous
|
||||
* memory, low bit is set, and
|
||||
* it points to anon_vma object:
|
||||
* see PAGE_MAPPING_ANON below.
|
||||
*/
|
||||
};
|
||||
#if USE_SPLIT_PTLOCKS
|
||||
spinlock_t ptl;
|
||||
spinlock_t ptl;
|
||||
#endif
|
||||
struct kmem_cache *slab; /* SLUB: Pointer to slab */
|
||||
struct page *first_page; /* Compound tail pages */
|
||||
struct kmem_cache *slab; /* SLUB: Pointer to slab */
|
||||
struct page *first_page; /* Compound tail pages */
|
||||
};
|
||||
union {
|
||||
pgoff_t index; /* Our offset within mapping. */
|
||||
void *freelist; /* SLUB: freelist req. slab lock */
|
||||
};
|
||||
struct list_head lru; /* Pageout list, eg. active_list
|
||||
* protected by zone->lru_lock !
|
||||
*/
|
||||
|
||||
/*
|
||||
* On machines where all RAM is mapped into kernel address space,
|
||||
* we can simply calculate the virtual address. On machines with
|
||||
|
|
@ -100,7 +124,16 @@ struct page {
|
|||
*/
|
||||
void *shadow;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
/*
|
||||
* If another subsystem starts using the double word pairing for atomic
|
||||
* operations on struct page then it must change the #if to ensure
|
||||
* proper alignment of the page struct.
|
||||
*/
|
||||
#if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL)
|
||||
__attribute__((__aligned__(2*sizeof(unsigned long))))
|
||||
#endif
|
||||
;
|
||||
|
||||
typedef unsigned long __nocast vm_flags_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/percpu_counter.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
extern int sysctl_overcommit_memory;
|
||||
extern int sysctl_overcommit_ratio;
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ struct mmc_ios {
|
|||
#define MMC_TIMING_UHS_SDR104 4
|
||||
#define MMC_TIMING_UHS_DDR50 5
|
||||
|
||||
unsigned char ddr; /* dual data rate used */
|
||||
|
||||
#define MMC_SDR_MODE 0
|
||||
#define MMC_1_2V_DDR_MODE 1
|
||||
#define MMC_1_8V_DDR_MODE 2
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <linux/nodemask.h>
|
||||
#include <linux/pageblock-flags.h>
|
||||
#include <generated/bounds.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/* Free memory management - zoned buddy allocator. */
|
||||
|
|
@ -158,6 +158,12 @@ static inline int is_unevictable_lru(enum lru_list l)
|
|||
return (l == LRU_UNEVICTABLE);
|
||||
}
|
||||
|
||||
/* Mask used at gathering information at once (see memcontrol.c) */
|
||||
#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
|
||||
#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
|
||||
#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
|
||||
#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
|
||||
|
||||
enum zone_watermarks {
|
||||
WMARK_MIN,
|
||||
WMARK_LOW,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <linux/nodemask.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/seqlock.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
struct super_block;
|
||||
struct vfsmount;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <linux/linkage.h>
|
||||
#include <linux/lockdep.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/*
|
||||
* Simple, straightforward mutexes with strict semantics:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include <linux/pm_qos_params.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/delay.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
|
|
@ -1132,7 +1132,7 @@ struct net_device {
|
|||
spinlock_t addr_list_lock;
|
||||
struct netdev_hw_addr_list uc; /* Unicast mac addresses */
|
||||
struct netdev_hw_addr_list mc; /* Multicast mac addresses */
|
||||
int uc_promisc;
|
||||
bool uc_promisc;
|
||||
unsigned int promiscuity;
|
||||
unsigned int allmulti;
|
||||
|
||||
|
|
@ -1679,9 +1679,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
|
|||
static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
|
||||
unsigned int offset)
|
||||
{
|
||||
if (!pskb_may_pull(skb, hlen))
|
||||
return NULL;
|
||||
|
||||
NAPI_GRO_CB(skb)->frag0 = NULL;
|
||||
NAPI_GRO_CB(skb)->frag0_len = 0;
|
||||
return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL;
|
||||
return skb->data + offset;
|
||||
}
|
||||
|
||||
static inline void *skb_gro_mac_header(struct sk_buff *skb)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#define MAX_LINKS 32
|
||||
|
||||
struct sockaddr_nl {
|
||||
sa_family_t nl_family; /* AF_NETLINK */
|
||||
__kernel_sa_family_t nl_family; /* AF_NETLINK */
|
||||
unsigned short nl_pad; /* zero */
|
||||
__u32 nl_pid; /* port ID */
|
||||
__u32 nl_groups; /* multicast groups mask */
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
#define NFS_MNT_VERSION 1
|
||||
#define NFS_MNT3_VERSION 3
|
||||
|
||||
#define NFS_PIPE_DIRNAME "/nfs"
|
||||
|
||||
/*
|
||||
* NFS stats. The good thing with these values is that NFSv3 errors are
|
||||
* a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
|
||||
|
|
|
|||
|
|
@ -563,6 +563,10 @@ enum {
|
|||
NFSPROC4_CLNT_GETDEVICEINFO,
|
||||
NFSPROC4_CLNT_LAYOUTCOMMIT,
|
||||
NFSPROC4_CLNT_LAYOUTRETURN,
|
||||
NFSPROC4_CLNT_SECINFO_NO_NAME,
|
||||
NFSPROC4_CLNT_TEST_STATEID,
|
||||
NFSPROC4_CLNT_FREE_STATEID,
|
||||
NFSPROC4_CLNT_GETDEVICELIST,
|
||||
};
|
||||
|
||||
/* nfs41 types */
|
||||
|
|
|
|||
|
|
@ -99,9 +99,10 @@ struct nfs_open_context {
|
|||
|
||||
struct nfs_open_dir_context {
|
||||
struct rpc_cred *cred;
|
||||
unsigned long attr_gencount;
|
||||
__u64 dir_cookie;
|
||||
__u64 dup_cookie;
|
||||
int duped;
|
||||
signed char duped;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -568,12 +569,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
|
|||
extern int nfs3_proc_setacl(struct inode *inode, int type,
|
||||
struct posix_acl *acl);
|
||||
extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
|
||||
mode_t mode);
|
||||
umode_t mode);
|
||||
extern void nfs3_forget_cached_acls(struct inode *inode);
|
||||
#else
|
||||
static inline int nfs3_proc_set_default_acl(struct inode *dir,
|
||||
struct inode *inode,
|
||||
mode_t mode)
|
||||
umode_t mode)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <linux/nfs_xdr.h>
|
||||
#include <linux/sunrpc/xprt.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
struct nfs4_session;
|
||||
struct nfs_iostats;
|
||||
|
|
@ -16,6 +16,7 @@ struct nfs4_sequence_args;
|
|||
struct nfs4_sequence_res;
|
||||
struct nfs_server;
|
||||
struct nfs4_minor_version_ops;
|
||||
struct server_scope;
|
||||
|
||||
/*
|
||||
* The nfs_client identifies our client state to the server.
|
||||
|
|
@ -77,12 +78,13 @@ struct nfs_client {
|
|||
/* The flags used for obtaining the clientid during EXCHANGE_ID */
|
||||
u32 cl_exchange_flags;
|
||||
struct nfs4_session *cl_session; /* sharred session */
|
||||
struct list_head cl_layouts;
|
||||
#endif /* CONFIG_NFS_V4 */
|
||||
|
||||
#ifdef CONFIG_NFS_FSCACHE
|
||||
struct fscache_cookie *fscache; /* client index cache cookie */
|
||||
#endif
|
||||
|
||||
struct server_scope *server_scope; /* from exchange_id */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -129,8 +131,9 @@ struct nfs_server {
|
|||
struct fscache_cookie *fscache; /* superblock cookie */
|
||||
#endif
|
||||
|
||||
u32 pnfs_blksize; /* layout_blksize attr */
|
||||
#ifdef CONFIG_NFS_V4
|
||||
u32 attr_bitmask[2];/* V4 bitmask representing the set
|
||||
u32 attr_bitmask[3];/* V4 bitmask representing the set
|
||||
of attributes supported on this
|
||||
filesystem */
|
||||
u32 cache_consistency_bitmask[2];
|
||||
|
|
@ -143,12 +146,14 @@ struct nfs_server {
|
|||
filesystem */
|
||||
struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
|
||||
struct rpc_wait_queue roc_rpcwaitq;
|
||||
void *pnfs_ld_data; /* per mount point data */
|
||||
|
||||
/* the following fields are protected by nfs_client->cl_lock */
|
||||
struct rb_root state_owners;
|
||||
struct rb_root openowner_id;
|
||||
struct rb_root lockowner_id;
|
||||
#endif
|
||||
struct list_head layouts;
|
||||
struct list_head delegations;
|
||||
void (*destroy)(struct nfs_server *);
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue