Merge branch 'origin' into for-linus
Conflicts: MAINTAINERS
This commit is contained in:
@@ -41,8 +41,6 @@
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <acpi/acpi_numa.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
|
||||
enum acpi_irq_model_id {
|
||||
ACPI_IRQ_MODEL_PIC = 0,
|
||||
@@ -219,10 +217,8 @@ static inline int acpi_video_display_switch_support(void)
|
||||
#endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
|
||||
|
||||
extern int acpi_blacklisted(void);
|
||||
#ifdef CONFIG_DMI
|
||||
extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
|
||||
extern int acpi_osi_setup(char *str);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
int acpi_get_pxm(acpi_handle handle);
|
||||
@@ -292,7 +288,10 @@ void __init acpi_s4_no_nvs(void);
|
||||
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags);
|
||||
extern void acpi_early_init(void);
|
||||
|
||||
#else /* CONFIG_ACPI */
|
||||
#else /* !CONFIG_ACPI */
|
||||
|
||||
#define acpi_disabled 1
|
||||
|
||||
static inline void acpi_early_init(void) { }
|
||||
|
||||
static inline int early_acpi_boot_init(void)
|
||||
@@ -331,5 +330,11 @@ static inline int acpi_check_mem_region(resource_size_t start,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct acpi_table_header;
|
||||
static inline int acpi_table_parse(char *id,
|
||||
int (*handler)(struct acpi_table_header *))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif /* !CONFIG_ACPI */
|
||||
#endif /*_LINUX_ACPI_H*/
|
||||
|
||||
@@ -225,8 +225,6 @@ static inline void exit_aio(struct mm_struct *mm) { }
|
||||
|
||||
#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
|
||||
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
static inline struct kiocb *list_kiocb(struct list_head *h)
|
||||
{
|
||||
return list_entry(h, struct kiocb, ki_list);
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#ifndef _LINUX_ANON_INODES_H
|
||||
#define _LINUX_ANON_INODES_H
|
||||
|
||||
struct file *anon_inode_getfile(const char *name,
|
||||
const struct file_operations *fops,
|
||||
void *priv, int flags);
|
||||
int anon_inode_getfd(const char *name, const struct file_operations *fops,
|
||||
void *priv, int flags);
|
||||
|
||||
|
||||
@@ -58,25 +58,60 @@ struct dma_chan_ref {
|
||||
* array.
|
||||
* @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
|
||||
* dependency chain
|
||||
* @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
|
||||
* @ASYNC_TX_FENCE: specify that the next operation in the dependency
|
||||
* chain uses this operation's result as an input
|
||||
*/
|
||||
enum async_tx_flags {
|
||||
ASYNC_TX_XOR_ZERO_DST = (1 << 0),
|
||||
ASYNC_TX_XOR_DROP_DST = (1 << 1),
|
||||
ASYNC_TX_ACK = (1 << 3),
|
||||
ASYNC_TX_DEP_ACK = (1 << 4),
|
||||
ASYNC_TX_ACK = (1 << 2),
|
||||
ASYNC_TX_FENCE = (1 << 3),
|
||||
};
|
||||
|
||||
/**
|
||||
* struct async_submit_ctl - async_tx submission/completion modifiers
|
||||
* @flags: submission modifiers
|
||||
* @depend_tx: parent dependency of the current operation being submitted
|
||||
* @cb_fn: callback routine to run at operation completion
|
||||
* @cb_param: parameter for the callback routine
|
||||
* @scribble: caller provided space for dma/page address conversions
|
||||
*/
|
||||
struct async_submit_ctl {
|
||||
enum async_tx_flags flags;
|
||||
struct dma_async_tx_descriptor *depend_tx;
|
||||
dma_async_tx_callback cb_fn;
|
||||
void *cb_param;
|
||||
void *scribble;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
#define async_tx_issue_pending_all dma_issue_pending_all
|
||||
|
||||
/**
|
||||
* async_tx_issue_pending - send pending descriptor to the hardware channel
|
||||
* @tx: descriptor handle to retrieve hardware context
|
||||
*
|
||||
* Note: any dependent operations will have already been issued by
|
||||
* async_tx_channel_switch, or (in the case of no channel switch) will
|
||||
* be already pending on this channel.
|
||||
*/
|
||||
static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
if (likely(tx)) {
|
||||
struct dma_chan *chan = tx->chan;
|
||||
struct dma_device *dma = chan->device;
|
||||
|
||||
dma->device_issue_pending(chan);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
|
||||
#include <asm/async_tx.h>
|
||||
#else
|
||||
#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \
|
||||
__async_tx_find_channel(dep, type)
|
||||
struct dma_chan *
|
||||
__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
enum dma_transaction_type tx_type);
|
||||
__async_tx_find_channel(struct async_submit_ctl *submit,
|
||||
enum dma_transaction_type tx_type);
|
||||
#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */
|
||||
#else
|
||||
static inline void async_tx_issue_pending_all(void)
|
||||
@@ -84,10 +119,16 @@ static inline void async_tx_issue_pending_all(void)
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline struct dma_chan *
|
||||
async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
enum dma_transaction_type tx_type, struct page **dst, int dst_count,
|
||||
struct page **src, int src_count, size_t len)
|
||||
async_tx_find_channel(struct async_submit_ctl *submit,
|
||||
enum dma_transaction_type tx_type, struct page **dst,
|
||||
int dst_count, struct page **src, int src_count,
|
||||
size_t len)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -99,46 +140,70 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
* @cb_fn_param: parameter to pass to the callback routine
|
||||
*/
|
||||
static inline void
|
||||
async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param)
|
||||
async_tx_sync_epilog(struct async_submit_ctl *submit)
|
||||
{
|
||||
if (cb_fn)
|
||||
cb_fn(cb_fn_param);
|
||||
if (submit->cb_fn)
|
||||
submit->cb_fn(submit->cb_param);
|
||||
}
|
||||
|
||||
void
|
||||
async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
|
||||
enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
typedef union {
|
||||
unsigned long addr;
|
||||
struct page *page;
|
||||
dma_addr_t dma;
|
||||
} addr_conv_t;
|
||||
|
||||
static inline void
|
||||
init_async_submit(struct async_submit_ctl *args, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_param,
|
||||
addr_conv_t *scribble)
|
||||
{
|
||||
args->flags = flags;
|
||||
args->depend_tx = tx;
|
||||
args->cb_fn = cb_fn;
|
||||
args->cb_param = cb_param;
|
||||
args->scribble = scribble;
|
||||
}
|
||||
|
||||
void async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_xor(struct page *dest, struct page **src_list, unsigned int offset,
|
||||
int src_cnt, size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
int src_cnt, size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_xor_zero_sum(struct page *dest, struct page **src_list,
|
||||
unsigned int offset, int src_cnt, size_t len,
|
||||
u32 *result, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
async_xor_val(struct page *dest, struct page **src_list, unsigned int offset,
|
||||
int src_cnt, size_t len, enum sum_check_flags *result,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
|
||||
unsigned int src_offset, size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
unsigned int src_offset, size_t len,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_memset(struct page *dest, int val, unsigned int offset,
|
||||
size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_trigger_callback(enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
async_gen_syndrome(struct page **blocks, unsigned int offset, int src_cnt,
|
||||
size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_syndrome_val(struct page **blocks, unsigned int offset, int src_cnt,
|
||||
size_t len, enum sum_check_flags *pqres, struct page *spare,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_raid6_2data_recov(int src_num, size_t bytes, int faila, int failb,
|
||||
struct page **ptrs, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_raid6_datap_recov(int src_num, size_t bytes, int faila,
|
||||
struct page **ptrs, struct async_submit_ctl *submit);
|
||||
|
||||
void async_tx_quiesce(struct dma_async_tx_descriptor **tx);
|
||||
#endif /* _ASYNC_TX_H_ */
|
||||
|
||||
@@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
|
||||
extern int prepare_bprm_creds(struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern int set_binfmt(struct linux_binfmt *new);
|
||||
extern void set_binfmt(struct linux_binfmt *new);
|
||||
extern void free_bprm(struct linux_binprm *);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -132,9 +132,6 @@ static inline void *alloc_remap(int nid, unsigned long size)
|
||||
}
|
||||
#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
|
||||
|
||||
extern unsigned long __meminitdata nr_kernel_pages;
|
||||
extern unsigned long __meminitdata nr_all_pages;
|
||||
|
||||
extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
unsigned long numentries,
|
||||
@@ -145,6 +142,8 @@ extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long limit);
|
||||
|
||||
#define HASH_EARLY 0x00000001 /* Allocating during early boot? */
|
||||
#define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min
|
||||
* shift passed via *_hash_shift */
|
||||
|
||||
/* Only NUMA needs hash distribution. 64bit NUMA architectures have
|
||||
* sufficient vmalloc space.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* See here for the libcap library ("POSIX draft" compliance):
|
||||
*
|
||||
* ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
* ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
|
||||
@@ -141,6 +141,38 @@ enum {
|
||||
CGRP_WAIT_ON_RMDIR,
|
||||
};
|
||||
|
||||
/* which pidlist file are we talking about? */
|
||||
enum cgroup_filetype {
|
||||
CGROUP_FILE_PROCS,
|
||||
CGROUP_FILE_TASKS,
|
||||
};
|
||||
|
||||
/*
|
||||
* A pidlist is a list of pids that virtually represents the contents of one
|
||||
* of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists,
|
||||
* a pair (one each for procs, tasks) for each pid namespace that's relevant
|
||||
* to the cgroup.
|
||||
*/
|
||||
struct cgroup_pidlist {
|
||||
/*
|
||||
* used to find which pidlist is wanted. doesn't change as long as
|
||||
* this particular list stays in the list.
|
||||
*/
|
||||
struct { enum cgroup_filetype type; struct pid_namespace *ns; } key;
|
||||
/* array of xids */
|
||||
pid_t *list;
|
||||
/* how many elements the above list has */
|
||||
int length;
|
||||
/* how many files are using the current array */
|
||||
int use_count;
|
||||
/* each of these stored in a list by its cgroup */
|
||||
struct list_head links;
|
||||
/* pointer to the cgroup we belong to, for list removal purposes */
|
||||
struct cgroup *owner;
|
||||
/* protects the other fields */
|
||||
struct rw_semaphore mutex;
|
||||
};
|
||||
|
||||
struct cgroup {
|
||||
unsigned long flags; /* "unsigned long" so bitops work */
|
||||
|
||||
@@ -179,11 +211,12 @@ struct cgroup {
|
||||
*/
|
||||
struct list_head release_list;
|
||||
|
||||
/* pids_mutex protects pids_list and cached pid arrays. */
|
||||
struct rw_semaphore pids_mutex;
|
||||
|
||||
/* Linked list of struct cgroup_pids */
|
||||
struct list_head pids_list;
|
||||
/*
|
||||
* list of pidlists, up to two for each namespace (one for procs, one
|
||||
* for tasks); created on demand.
|
||||
*/
|
||||
struct list_head pidlists;
|
||||
struct mutex pidlist_mutex;
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
@@ -227,6 +260,9 @@ struct css_set {
|
||||
* during subsystem registration (at boot time).
|
||||
*/
|
||||
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -389,10 +425,11 @@ struct cgroup_subsys {
|
||||
struct cgroup *cgrp);
|
||||
int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
int (*can_attach)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cgrp, struct task_struct *tsk);
|
||||
int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct task_struct *tsk, bool threadgroup);
|
||||
void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk);
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk,
|
||||
bool threadgroup);
|
||||
void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
void (*exit)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
int (*populate)(struct cgroup_subsys *ss,
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@@ -148,14 +149,11 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
|
||||
* @disable: optional function to disable the clocksource
|
||||
* @mask: bitmask for two's complement
|
||||
* subtraction of non 64 bit counters
|
||||
* @mult: cycle to nanosecond multiplier (adjusted by NTP)
|
||||
* @mult_orig: cycle to nanosecond multiplier (unadjusted by NTP)
|
||||
* @mult: cycle to nanosecond multiplier
|
||||
* @shift: cycle to nanosecond divisor (power of two)
|
||||
* @flags: flags describing special properties
|
||||
* @vread: vsyscall based read
|
||||
* @resume: resume function for the clocksource, if necessary
|
||||
* @cycle_interval: Used internally by timekeeping core, please ignore.
|
||||
* @xtime_interval: Used internally by timekeeping core, please ignore.
|
||||
*/
|
||||
struct clocksource {
|
||||
/*
|
||||
@@ -169,7 +167,6 @@ struct clocksource {
|
||||
void (*disable)(struct clocksource *cs);
|
||||
cycle_t mask;
|
||||
u32 mult;
|
||||
u32 mult_orig;
|
||||
u32 shift;
|
||||
unsigned long flags;
|
||||
cycle_t (*vread)(void);
|
||||
@@ -181,19 +178,12 @@ struct clocksource {
|
||||
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
|
||||
#endif
|
||||
|
||||
/* timekeeping specific data, ignore */
|
||||
cycle_t cycle_interval;
|
||||
u64 xtime_interval;
|
||||
u32 raw_interval;
|
||||
/*
|
||||
* Second part is written at each timer interrupt
|
||||
* Keep it in a different cache line to dirty no
|
||||
* more than one cache line.
|
||||
*/
|
||||
cycle_t cycle_last ____cacheline_aligned_in_smp;
|
||||
u64 xtime_nsec;
|
||||
s64 error;
|
||||
struct timespec raw_time;
|
||||
|
||||
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
|
||||
/* Watchdog related data, used by the framework */
|
||||
@@ -202,8 +192,6 @@ struct clocksource {
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
/*
|
||||
* Clock source flags bits::
|
||||
*/
|
||||
@@ -212,6 +200,7 @@ extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
#define CLOCK_SOURCE_WATCHDOG 0x10
|
||||
#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
|
||||
#define CLOCK_SOURCE_UNSTABLE 0x40
|
||||
|
||||
/* simplify initialization of mask field */
|
||||
#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
|
||||
@@ -268,108 +257,15 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant)
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_read: - Access the clocksource's current cycle value
|
||||
* @cs: pointer to clocksource being read
|
||||
* clocksource_cyc2ns - converts clocksource cycles to nanoseconds
|
||||
*
|
||||
* Uses the clocksource to return the current cycle_t value
|
||||
*/
|
||||
static inline cycle_t clocksource_read(struct clocksource *cs)
|
||||
{
|
||||
return cs->read(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_enable: - enable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Enables the specified clocksource. The clocksource callback
|
||||
* function should start up the hardware and setup mult and field
|
||||
* members of struct clocksource to reflect hardware capabilities.
|
||||
*/
|
||||
static inline int clocksource_enable(struct clocksource *cs)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (cs->enable)
|
||||
ret = cs->enable(cs);
|
||||
|
||||
/*
|
||||
* The frequency may have changed while the clocksource
|
||||
* was disabled. If so the code in ->enable() must update
|
||||
* the mult value to reflect the new frequency. Make sure
|
||||
* mult_orig follows this change.
|
||||
*/
|
||||
cs->mult_orig = cs->mult;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_disable: - disable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Disables the specified clocksource. The clocksource callback
|
||||
* function should power down the now unused hardware block to
|
||||
* save power.
|
||||
*/
|
||||
static inline void clocksource_disable(struct clocksource *cs)
|
||||
{
|
||||
/*
|
||||
* Save mult_orig in mult so clocksource_enable() can
|
||||
* restore the value regardless if ->enable() updates
|
||||
* the value of mult or not.
|
||||
*/
|
||||
cs->mult = cs->mult_orig;
|
||||
|
||||
if (cs->disable)
|
||||
cs->disable(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* cyc2ns - converts clocksource cycles to nanoseconds
|
||||
* @cs: Pointer to clocksource
|
||||
* @cycles: Cycles
|
||||
*
|
||||
* Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds.
|
||||
* Converts cycles to nanoseconds, using the given mult and shift.
|
||||
*
|
||||
* XXX - This could use some mult_lxl_ll() asm optimization
|
||||
*/
|
||||
static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
|
||||
static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
|
||||
{
|
||||
u64 ret = (u64)cycles;
|
||||
ret = (ret * cs->mult) >> cs->shift;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_calculate_interval - Calculates a clocksource interval struct
|
||||
*
|
||||
* @c: Pointer to clocksource.
|
||||
* @length_nsec: Desired interval length in nanoseconds.
|
||||
*
|
||||
* Calculates a fixed cycle/nsec interval for a given clocksource/adjustment
|
||||
* pair and interval request.
|
||||
*
|
||||
* Unless you're the timekeeping code, you should not be using this!
|
||||
*/
|
||||
static inline void clocksource_calculate_interval(struct clocksource *c,
|
||||
unsigned long length_nsec)
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
/* Do the ns -> cycle conversion first, using original mult */
|
||||
tmp = length_nsec;
|
||||
tmp <<= c->shift;
|
||||
tmp += c->mult_orig/2;
|
||||
do_div(tmp, c->mult_orig);
|
||||
|
||||
c->cycle_interval = (cycle_t)tmp;
|
||||
if (c->cycle_interval == 0)
|
||||
c->cycle_interval = 1;
|
||||
|
||||
/* Go back from cycles -> shifted ns, this time use ntp adjused mult */
|
||||
c->xtime_interval = (u64)c->cycle_interval * c->mult;
|
||||
c->raw_interval = ((u64)c->cycle_interval * c->mult_orig) >> c->shift;
|
||||
return ((u64) cycles * mult) >> shift;
|
||||
}
|
||||
|
||||
|
||||
@@ -380,6 +276,8 @@ extern void clocksource_touch_watchdog(void);
|
||||
extern struct clocksource* clocksource_get_next(void);
|
||||
extern void clocksource_change_rating(struct clocksource *cs, int rating);
|
||||
extern void clocksource_resume(void);
|
||||
extern struct clocksource * __init __weak clocksource_default_clock(void);
|
||||
extern void clocksource_mark_unstable(struct clocksource *cs);
|
||||
|
||||
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
||||
extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
|
||||
@@ -394,4 +292,6 @@ static inline void update_vsyscall_tz(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void timekeeping_notify(struct clocksource *clock);
|
||||
|
||||
#endif /* _LINUX_CLOCKSOURCE_H */
|
||||
|
||||
@@ -52,6 +52,7 @@ struct proc_event {
|
||||
PROC_EVENT_EXEC = 0x00000002,
|
||||
PROC_EVENT_UID = 0x00000004,
|
||||
PROC_EVENT_GID = 0x00000040,
|
||||
PROC_EVENT_SID = 0x00000080,
|
||||
/* "next" should be 0x00000400 */
|
||||
/* "last" is the last process event: exit */
|
||||
PROC_EVENT_EXIT = 0x80000000
|
||||
@@ -89,6 +90,11 @@ struct proc_event {
|
||||
} e;
|
||||
} id;
|
||||
|
||||
struct sid_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
} sid;
|
||||
|
||||
struct exit_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
@@ -102,6 +108,7 @@ struct proc_event {
|
||||
void proc_fork_connector(struct task_struct *task);
|
||||
void proc_exec_connector(struct task_struct *task);
|
||||
void proc_id_connector(struct task_struct *task, int which_id);
|
||||
void proc_sid_connector(struct task_struct *task);
|
||||
void proc_exit_connector(struct task_struct *task);
|
||||
#else
|
||||
static inline void proc_fork_connector(struct task_struct *task)
|
||||
@@ -114,6 +121,9 @@ static inline void proc_id_connector(struct task_struct *task,
|
||||
int which_id)
|
||||
{}
|
||||
|
||||
static inline void proc_sid_connector(struct task_struct *task)
|
||||
{}
|
||||
|
||||
static inline void proc_exit_connector(struct task_struct *task)
|
||||
{}
|
||||
#endif /* CONFIG_PROC_EVENTS */
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
*
|
||||
* configfs Copyright (C) 2005 Oracle. All rights reserved.
|
||||
*
|
||||
* Please read Documentation/filesystems/configfs.txt before using the
|
||||
* configfs interface, ESPECIALLY the parts about reference counts and
|
||||
* Please read Documentation/filesystems/configfs/configfs.txt before using
|
||||
* the configfs interface, ESPECIALLY the parts about reference counts and
|
||||
* item destructors.
|
||||
*/
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
|
||||
|
||||
struct cpufreq_governor;
|
||||
|
||||
/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
|
||||
extern struct kobject *cpufreq_global_kobject;
|
||||
|
||||
#define CPUFREQ_ETERNAL (-1)
|
||||
struct cpufreq_cpuinfo {
|
||||
unsigned int max_freq;
|
||||
@@ -274,6 +277,13 @@ struct freq_attr {
|
||||
ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
|
||||
};
|
||||
|
||||
struct global_attr {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct kobject *kobj,
|
||||
struct attribute *attr, char *buf);
|
||||
ssize_t (*store)(struct kobject *a, struct attribute *b,
|
||||
const char *c, size_t count);
|
||||
};
|
||||
|
||||
/*********************************************************************
|
||||
* CPUFREQ 2.6. INTERFACE *
|
||||
|
||||
@@ -3,444 +3,37 @@
|
||||
|
||||
/*
|
||||
* Cpumasks provide a bitmap suitable for representing the
|
||||
* set of CPU's in a system, one bit position per CPU number.
|
||||
*
|
||||
* The new cpumask_ ops take a "struct cpumask *"; the old ones
|
||||
* use cpumask_t.
|
||||
*
|
||||
* See detailed comments in the file linux/bitmap.h describing the
|
||||
* data type on which these cpumasks are based.
|
||||
*
|
||||
* For details of cpumask_scnprintf() and cpumask_parse_user(),
|
||||
* see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c.
|
||||
* For details of cpulist_scnprintf() and cpulist_parse(), see
|
||||
* bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c.
|
||||
* For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c
|
||||
* For details of cpus_remap(), see bitmap_remap in lib/bitmap.c.
|
||||
* For details of cpus_onto(), see bitmap_onto in lib/bitmap.c.
|
||||
* For details of cpus_fold(), see bitmap_fold in lib/bitmap.c.
|
||||
*
|
||||
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
* Note: The alternate operations with the suffix "_nr" are used
|
||||
* to limit the range of the loop to nr_cpu_ids instead of
|
||||
* NR_CPUS when NR_CPUS > 64 for performance reasons.
|
||||
* If NR_CPUS is <= 64 then most assembler bitmask
|
||||
* operators execute faster with a constant range, so
|
||||
* the operator will continue to use NR_CPUS.
|
||||
*
|
||||
* Another consideration is that nr_cpu_ids is initialized
|
||||
* to NR_CPUS and isn't lowered until the possible cpus are
|
||||
* discovered (including any disabled cpus). So early uses
|
||||
* will span the entire range of NR_CPUS.
|
||||
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
*
|
||||
* The obsolescent cpumask operations are:
|
||||
*
|
||||
* void cpu_set(cpu, mask) turn on bit 'cpu' in mask
|
||||
* void cpu_clear(cpu, mask) turn off bit 'cpu' in mask
|
||||
* void cpus_setall(mask) set all bits
|
||||
* void cpus_clear(mask) clear all bits
|
||||
* int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask
|
||||
* int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask
|
||||
*
|
||||
* int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]
|
||||
* void cpus_or(dst, src1, src2) dst = src1 | src2 [union]
|
||||
* void cpus_xor(dst, src1, src2) dst = src1 ^ src2
|
||||
* int cpus_andnot(dst, src1, src2) dst = src1 & ~src2
|
||||
* void cpus_complement(dst, src) dst = ~src
|
||||
*
|
||||
* int cpus_equal(mask1, mask2) Does mask1 == mask2?
|
||||
* int cpus_intersects(mask1, mask2) Do mask1 and mask2 intersect?
|
||||
* int cpus_subset(mask1, mask2) Is mask1 a subset of mask2?
|
||||
* int cpus_empty(mask) Is mask empty (no bits sets)?
|
||||
* int cpus_full(mask) Is mask full (all bits sets)?
|
||||
* int cpus_weight(mask) Hamming weigh - number of set bits
|
||||
* int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS
|
||||
*
|
||||
* void cpus_shift_right(dst, src, n) Shift right
|
||||
* void cpus_shift_left(dst, src, n) Shift left
|
||||
*
|
||||
* int first_cpu(mask) Number lowest set bit, or NR_CPUS
|
||||
* int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS
|
||||
* int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids
|
||||
*
|
||||
* cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set
|
||||
* (can be used as an lvalue)
|
||||
* CPU_MASK_ALL Initializer - all bits set
|
||||
* CPU_MASK_NONE Initializer - no bits set
|
||||
* unsigned long *cpus_addr(mask) Array of unsigned long's in mask
|
||||
*
|
||||
* CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t
|
||||
* variables, and CPUMASK_PTR provides pointers to each field.
|
||||
*
|
||||
* The structure should be defined something like this:
|
||||
* struct my_cpumasks {
|
||||
* cpumask_t mask1;
|
||||
* cpumask_t mask2;
|
||||
* };
|
||||
*
|
||||
* Usage is then:
|
||||
* CPUMASK_ALLOC(my_cpumasks);
|
||||
* CPUMASK_PTR(mask1, my_cpumasks);
|
||||
* CPUMASK_PTR(mask2, my_cpumasks);
|
||||
*
|
||||
* --- DO NOT reference cpumask_t pointers until this check ---
|
||||
* if (my_cpumasks == NULL)
|
||||
* "kmalloc failed"...
|
||||
*
|
||||
* References are now pointers to the cpumask_t variables (*mask1, ...)
|
||||
*
|
||||
*if NR_CPUS > BITS_PER_LONG
|
||||
* CPUMASK_ALLOC(m) Declares and allocates struct m *m =
|
||||
* kmalloc(sizeof(*m), GFP_KERNEL)
|
||||
* CPUMASK_FREE(m) Macro for kfree(m)
|
||||
*else
|
||||
* CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m
|
||||
* CPUMASK_FREE(m) Nop
|
||||
*endif
|
||||
* CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v)
|
||||
* ------------------------------------------------------------------------
|
||||
*
|
||||
* int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
|
||||
* int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask
|
||||
* int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing
|
||||
* int cpulist_parse(buf, map) Parse ascii string as cpulist
|
||||
* int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit)
|
||||
* void cpus_remap(dst, src, old, new) *dst = map(old, new)(src)
|
||||
* void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap
|
||||
* void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz
|
||||
*
|
||||
* for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS
|
||||
* for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids
|
||||
*
|
||||
* int num_online_cpus() Number of online CPUs
|
||||
* int num_possible_cpus() Number of all possible CPUs
|
||||
* int num_present_cpus() Number of present CPUs
|
||||
*
|
||||
* int cpu_online(cpu) Is some cpu online?
|
||||
* int cpu_possible(cpu) Is some cpu possible?
|
||||
* int cpu_present(cpu) Is some cpu present (can schedule)?
|
||||
*
|
||||
* int any_online_cpu(mask) First online cpu in mask
|
||||
*
|
||||
* for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map
|
||||
* for_each_online_cpu(cpu) for-loop cpu over cpu_online_map
|
||||
* for_each_present_cpu(cpu) for-loop cpu over cpu_present_map
|
||||
*
|
||||
* Subtlety:
|
||||
* 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway)
|
||||
* to generate slightly worse code. Note for example the additional
|
||||
* 40 lines of assembly code compiling the "for each possible cpu"
|
||||
* loops buried in the disk_stat_read() macros calls when compiling
|
||||
* drivers/block/genhd.c (arch i386, CONFIG_SMP=y). So use a simple
|
||||
* one-line #define for cpu_isset(), instead of wrapping an inline
|
||||
* inside a macro, the way we do the other calls.
|
||||
* set of CPU's in a system, one bit position per CPU number. In general,
|
||||
* only nr_cpu_ids (<= NR_CPUS) bits are valid.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/bitmap.h>
|
||||
|
||||
typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
|
||||
extern cpumask_t _unused_cpumask_arg_;
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
set_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
|
||||
static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
clear_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
|
||||
static inline void __cpus_setall(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_fill(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
|
||||
static inline void __cpus_clear(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_zero(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
/* No static inline type checking - see Subtlety (1) above. */
|
||||
#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
|
||||
|
||||
#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
|
||||
static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
|
||||
{
|
||||
return test_and_set_bit(cpu, addr->bits);
|
||||
}
|
||||
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_andnot(dst, src1, src2) \
|
||||
__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
|
||||
static inline void __cpus_complement(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
bitmap_complement(dstp->bits, srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_equal(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_equal(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_intersects(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_subset(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_subset(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
|
||||
static inline int __cpus_empty(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_empty(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_full(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_full(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_weight(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_weight(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_right(dst, src, n) \
|
||||
__cpus_shift_right(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_right(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_left(dst, src, n) \
|
||||
__cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_left(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
* cpumask_bits - get the bits in a cpumask
|
||||
* @maskp: the struct cpumask *
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
* You should only assume nr_cpu_ids bits of this mask are valid. This is
|
||||
* a macro so it's const-correct.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special-case data structure for "single bit set only" constant CPU masks.
|
||||
*
|
||||
* We pre-generate all the 64 (or 32) possible bit positions, with enough
|
||||
* padding to the left and the right, and return the constant pointer
|
||||
* appropriately offset.
|
||||
*/
|
||||
extern const unsigned long
|
||||
cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)];
|
||||
|
||||
static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
p -= cpu / BITS_PER_LONG;
|
||||
return to_cpumask(p);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
/*
|
||||
* In cases where we take the address of the cpumask immediately,
|
||||
* gcc optimizes it out (it's a constant) and there's no huge stack
|
||||
* variable created:
|
||||
*/
|
||||
#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))
|
||||
|
||||
|
||||
#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)
|
||||
|
||||
#else
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
/* cpu_mask_all is in init/main.c */
|
||||
extern cpumask_t cpu_mask_all;
|
||||
#define CPU_MASK_ALL_PTR (&cpu_mask_all)
|
||||
|
||||
#endif
|
||||
|
||||
#define CPU_MASK_NONE \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_CPU0 \
|
||||
(cpumask_t) { { \
|
||||
[0] = 1UL \
|
||||
} }
|
||||
|
||||
#define cpus_addr(src) ((src).bits)
|
||||
|
||||
#if NR_CPUS > BITS_PER_LONG
|
||||
#define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL)
|
||||
#define CPUMASK_FREE(m) kfree(m)
|
||||
#else
|
||||
#define CPUMASK_ALLOC(m) struct m _m, *m = &_m
|
||||
#define CPUMASK_FREE(m)
|
||||
#endif
|
||||
#define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v)
|
||||
|
||||
#define cpu_remap(oldbit, old, new) \
|
||||
__cpu_remap((oldbit), &(old), &(new), NR_CPUS)
|
||||
static inline int __cpu_remap(int oldbit,
|
||||
const cpumask_t *oldp, const cpumask_t *newp, int nbits)
|
||||
{
|
||||
return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_remap(dst, src, old, new) \
|
||||
__cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS)
|
||||
static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
|
||||
const cpumask_t *oldp, const cpumask_t *newp, int nbits)
|
||||
{
|
||||
bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_onto(dst, orig, relmap) \
|
||||
__cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS)
|
||||
static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp,
|
||||
const cpumask_t *relmapp, int nbits)
|
||||
{
|
||||
bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_fold(dst, orig, sz) \
|
||||
__cpus_fold(&(dst), &(orig), sz, NR_CPUS)
|
||||
static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp,
|
||||
int sz, int nbits)
|
||||
{
|
||||
bitmap_fold(dstp->bits, origp->bits, sz, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#define cpumask_bits(maskp) ((maskp)->bits)
|
||||
|
||||
#if NR_CPUS == 1
|
||||
|
||||
#define nr_cpu_ids 1
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define first_cpu(src) ({ (void)(src); 0; })
|
||||
#define next_cpu(n, src) ({ (void)(src); 1; })
|
||||
#define any_online_cpu(mask) 0
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#else /* NR_CPUS > 1 */
|
||||
|
||||
#else
|
||||
extern int nr_cpu_ids;
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
int __first_cpu(const cpumask_t *srcp);
|
||||
int __next_cpu(int n, const cpumask_t *srcp);
|
||||
int __any_online_cpu(const cpumask_t *mask);
|
||||
|
||||
#define first_cpu(src) __first_cpu(&(src))
|
||||
#define next_cpu(n, src) __next_cpu((n), &(src))
|
||||
#define any_online_cpu(mask) __any_online_cpu(&(mask))
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu((cpu), (mask)), \
|
||||
(cpu) < NR_CPUS; )
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#if NR_CPUS <= 64
|
||||
|
||||
#define next_cpu_nr(n, src) next_cpu(n, src)
|
||||
#define cpus_weight_nr(cpumask) cpus_weight(cpumask)
|
||||
#define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask)
|
||||
|
||||
#else /* NR_CPUS > 64 */
|
||||
|
||||
int __next_cpu_nr(int n, const cpumask_t *srcp);
|
||||
#define next_cpu_nr(n, src) __next_cpu_nr((n), &(src))
|
||||
#define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids)
|
||||
#define for_each_cpu_mask_nr(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu_nr((cpu), (mask)), \
|
||||
(cpu) < nr_cpu_ids; )
|
||||
|
||||
#endif /* NR_CPUS > 64 */
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
|
||||
* not all bits may be allocated. */
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#else
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following particular system cpumasks and operations manage
|
||||
@@ -487,12 +80,6 @@ extern const struct cpumask *const cpu_online_mask;
|
||||
extern const struct cpumask *const cpu_present_mask;
|
||||
extern const struct cpumask *const cpu_active_mask;
|
||||
|
||||
/* These strip const, as traditionally they weren't const. */
|
||||
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
|
||||
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
|
||||
#define cpu_present_map (*(cpumask_t *)cpu_present_mask)
|
||||
#define cpu_active_map (*(cpumask_t *)cpu_active_mask)
|
||||
|
||||
#if NR_CPUS > 1
|
||||
#define num_online_cpus() cpumask_weight(cpu_online_mask)
|
||||
#define num_possible_cpus() cpumask_weight(cpu_possible_mask)
|
||||
@@ -511,35 +98,6 @@ extern const struct cpumask *const cpu_active_mask;
|
||||
#define cpu_active(cpu) ((cpu) == 0)
|
||||
#endif
|
||||
|
||||
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
|
||||
|
||||
/* These are the new versions of the cpumask operators: passed by pointer.
|
||||
* The older versions will be implemented in terms of these, then deleted. */
|
||||
#define cpumask_bits(maskp) ((maskp)->bits)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
#else /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
#endif /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
|
||||
* not all bits may be allocated. */
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#else
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
#endif
|
||||
|
||||
/* verify cpu argument to cpumask_* operators */
|
||||
static inline unsigned int cpumask_check(unsigned int cpu)
|
||||
{
|
||||
@@ -714,6 +272,18 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
|
||||
return test_and_set_bit(cpumask_check(cpu), cpumask_bits(cpumask));
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask
|
||||
* @cpu: cpu number (< nr_cpu_ids)
|
||||
* @cpumask: the cpumask pointer
|
||||
*
|
||||
* test_and_clear_bit wrapper for cpumasks.
|
||||
*/
|
||||
static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
|
||||
{
|
||||
return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask));
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask
|
||||
* @dstp: the cpumask pointer
|
||||
@@ -1088,4 +658,241 @@ void set_cpu_active(unsigned int cpu, bool active);
|
||||
void init_cpu_present(const struct cpumask *src);
|
||||
void init_cpu_possible(const struct cpumask *src);
|
||||
void init_cpu_online(const struct cpumask *src);
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special-case data structure for "single bit set only" constant CPU masks.
|
||||
*
|
||||
* We pre-generate all the 64 (or 32) possible bit positions, with enough
|
||||
* padding to the left and the right, and return the constant pointer
|
||||
* appropriately offset.
|
||||
*/
|
||||
extern const unsigned long
|
||||
cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)];
|
||||
|
||||
static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
p -= cpu / BITS_PER_LONG;
|
||||
return to_cpumask(p);
|
||||
}
|
||||
|
||||
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
#else /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
#endif /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
/*
|
||||
*
|
||||
* From here down, all obsolete. Use cpumask_ variants!
|
||||
*
|
||||
*/
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
/* These strip const, as traditionally they weren't const. */
|
||||
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
|
||||
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
|
||||
#define cpu_present_map (*(cpumask_t *)cpu_present_mask)
|
||||
#define cpu_active_map (*(cpumask_t *)cpu_active_mask)
|
||||
|
||||
#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))
|
||||
|
||||
#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#else
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#endif
|
||||
|
||||
#define CPU_MASK_NONE \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_CPU0 \
|
||||
(cpumask_t) { { \
|
||||
[0] = 1UL \
|
||||
} }
|
||||
|
||||
#if NR_CPUS == 1
|
||||
#define first_cpu(src) ({ (void)(src); 0; })
|
||||
#define next_cpu(n, src) ({ (void)(src); 1; })
|
||||
#define any_online_cpu(mask) 0
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
#else /* NR_CPUS > 1 */
|
||||
int __first_cpu(const cpumask_t *srcp);
|
||||
int __next_cpu(int n, const cpumask_t *srcp);
|
||||
int __any_online_cpu(const cpumask_t *mask);
|
||||
|
||||
#define first_cpu(src) __first_cpu(&(src))
|
||||
#define next_cpu(n, src) __next_cpu((n), &(src))
|
||||
#define any_online_cpu(mask) __any_online_cpu(&(mask))
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu((cpu), (mask)), \
|
||||
(cpu) < NR_CPUS; )
|
||||
#endif /* SMP */
|
||||
|
||||
#if NR_CPUS <= 64
|
||||
|
||||
#define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask)
|
||||
|
||||
#else /* NR_CPUS > 64 */
|
||||
|
||||
int __next_cpu_nr(int n, const cpumask_t *srcp);
|
||||
#define for_each_cpu_mask_nr(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = __next_cpu_nr((cpu), &(mask)), \
|
||||
(cpu) < nr_cpu_ids; )
|
||||
|
||||
#endif /* NR_CPUS > 64 */
|
||||
|
||||
#define cpus_addr(src) ((src).bits)
|
||||
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
set_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
|
||||
static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
clear_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
|
||||
static inline void __cpus_setall(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_fill(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
|
||||
static inline void __cpus_clear(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_zero(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
/* No static inline type checking - see Subtlety (1) above. */
|
||||
#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
|
||||
|
||||
#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
|
||||
static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
|
||||
{
|
||||
return test_and_set_bit(cpu, addr->bits);
|
||||
}
|
||||
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_andnot(dst, src1, src2) \
|
||||
__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_equal(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_equal(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_intersects(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_subset(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_subset(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
|
||||
static inline int __cpus_empty(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_empty(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_weight(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_weight(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_left(dst, src, n) \
|
||||
__cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_left(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
#endif /* __LINUX_CPUMASK_H */
|
||||
|
||||
@@ -176,23 +176,7 @@ extern void __invalid_creds(const struct cred *, const char *, unsigned);
|
||||
extern void __validate_process_creds(struct task_struct *,
|
||||
const char *, unsigned);
|
||||
|
||||
static inline bool creds_are_invalid(const struct cred *cred)
|
||||
{
|
||||
if (cred->magic != CRED_MAGIC)
|
||||
return true;
|
||||
if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
|
||||
return true;
|
||||
#ifdef CONFIG_SECURITY_SELINUX
|
||||
if (selinux_is_enabled()) {
|
||||
if ((unsigned long) cred->security < PAGE_SIZE)
|
||||
return true;
|
||||
if ((*(u32 *)cred->security & 0xffffff00) ==
|
||||
(POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
extern bool creds_are_invalid(const struct cred *cred);
|
||||
|
||||
static inline void __validate_creds(const struct cred *cred,
|
||||
const char *file, unsigned line)
|
||||
|
||||
@@ -499,6 +499,7 @@ struct cyclades_card {
|
||||
void __iomem *p9050;
|
||||
struct RUNTIME_9060 __iomem *p9060;
|
||||
} ctl_addr;
|
||||
struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
@@ -541,6 +542,15 @@ struct cyclades_port {
|
||||
int magic;
|
||||
struct tty_port port;
|
||||
struct cyclades_card *card;
|
||||
union {
|
||||
struct {
|
||||
void __iomem *base_addr;
|
||||
} cyy;
|
||||
struct {
|
||||
struct CH_CTRL __iomem *ch_ctrl;
|
||||
struct BUF_CTRL __iomem *buf_ctrl;
|
||||
} cyz;
|
||||
} u;
|
||||
int line;
|
||||
int flags; /* defined in tty.h */
|
||||
int type; /* UART type */
|
||||
@@ -568,7 +578,6 @@ struct cyclades_port {
|
||||
struct cyclades_idle_stats idle_stats;
|
||||
struct cyclades_icount icount;
|
||||
struct completion shutdown_wait;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
int throttle;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
*/
|
||||
#ifndef DCA_H
|
||||
#define DCA_H
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
/* DCA Provider API */
|
||||
|
||||
/* DCA Notifier Interface */
|
||||
@@ -36,6 +39,12 @@ struct dca_provider {
|
||||
int id;
|
||||
};
|
||||
|
||||
struct dca_domain {
|
||||
struct list_head node;
|
||||
struct list_head dca_providers;
|
||||
struct pci_bus *pci_rc;
|
||||
};
|
||||
|
||||
struct dca_ops {
|
||||
int (*add_requester) (struct dca_provider *, struct device *);
|
||||
int (*remove_requester) (struct dca_provider *, struct device *);
|
||||
@@ -47,7 +56,7 @@ struct dca_ops {
|
||||
struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size);
|
||||
void free_dca_provider(struct dca_provider *dca);
|
||||
int register_dca_provider(struct dca_provider *dca, struct device *dev);
|
||||
void unregister_dca_provider(struct dca_provider *dca);
|
||||
void unregister_dca_provider(struct dca_provider *dca, struct device *dev);
|
||||
|
||||
static inline void *dca_priv(struct dca_provider *dca)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* debugfs is for people to use instead of /proc or /sys.
|
||||
* See Documentation/DocBook/kernel-api for more details.
|
||||
* See Documentation/DocBook/filesystems for more details.
|
||||
*/
|
||||
|
||||
#ifndef _DEBUGFS_H_
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#define _LINUX_DELAYACCT_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/taskstats_kern.h>
|
||||
|
||||
/*
|
||||
* Per-task flags relevant to delay accounting
|
||||
|
||||
@@ -193,7 +193,7 @@ struct class {
|
||||
struct kobject *dev_kobj;
|
||||
|
||||
int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
|
||||
void (*class_release)(struct class *class);
|
||||
void (*dev_release)(struct device *dev);
|
||||
@@ -298,7 +298,7 @@ struct device_type {
|
||||
const char *name;
|
||||
const struct attribute_group **groups;
|
||||
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
void (*release)(struct device *dev);
|
||||
|
||||
const struct dev_pm_ops *pm;
|
||||
@@ -487,7 +487,8 @@ extern struct device *device_find_child(struct device *dev, void *data,
|
||||
extern int device_rename(struct device *dev, char *new_name);
|
||||
extern int device_move(struct device *dev, struct device *new_parent,
|
||||
enum dpm_order dpm_order);
|
||||
extern const char *device_get_nodename(struct device *dev, const char **tmp);
|
||||
extern const char *device_get_devnode(struct device *dev,
|
||||
mode_t *mode, const char **tmp);
|
||||
extern void *dev_get_drvdata(const struct device *dev);
|
||||
extern void dev_set_drvdata(struct device *dev, void *data);
|
||||
|
||||
|
||||
@@ -48,19 +48,20 @@ enum dma_status {
|
||||
|
||||
/**
|
||||
* enum dma_transaction_type - DMA transaction types/indexes
|
||||
*
|
||||
* Note: The DMA_ASYNC_TX capability is not to be set by drivers. It is
|
||||
* automatically set as dma devices are registered.
|
||||
*/
|
||||
enum dma_transaction_type {
|
||||
DMA_MEMCPY,
|
||||
DMA_XOR,
|
||||
DMA_PQ_XOR,
|
||||
DMA_DUAL_XOR,
|
||||
DMA_PQ_UPDATE,
|
||||
DMA_ZERO_SUM,
|
||||
DMA_PQ_ZERO_SUM,
|
||||
DMA_PQ,
|
||||
DMA_XOR_VAL,
|
||||
DMA_PQ_VAL,
|
||||
DMA_MEMSET,
|
||||
DMA_MEMCPY_CRC32C,
|
||||
DMA_INTERRUPT,
|
||||
DMA_PRIVATE,
|
||||
DMA_ASYNC_TX,
|
||||
DMA_SLAVE,
|
||||
};
|
||||
|
||||
@@ -70,18 +71,25 @@ enum dma_transaction_type {
|
||||
|
||||
/**
|
||||
* enum dma_ctrl_flags - DMA flags to augment operation preparation,
|
||||
* control completion, and communicate status.
|
||||
* control completion, and communicate status.
|
||||
* @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
|
||||
* this transaction
|
||||
* this transaction
|
||||
* @DMA_CTRL_ACK - the descriptor cannot be reused until the client
|
||||
* acknowledges receipt, i.e. has has a chance to establish any
|
||||
* dependency chains
|
||||
* acknowledges receipt, i.e. has has a chance to establish any dependency
|
||||
* chains
|
||||
* @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)
|
||||
* @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s)
|
||||
* @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single
|
||||
* (if not set, do the source dma-unmapping as page)
|
||||
* @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single
|
||||
* (if not set, do the destination dma-unmapping as page)
|
||||
* @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q
|
||||
* @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P
|
||||
* @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as
|
||||
* sources that were the result of a previous operation, in the case of a PQ
|
||||
* operation it continues the calculation with new sources
|
||||
* @DMA_PREP_FENCE - tell the driver that subsequent operations depend
|
||||
* on the result of this operation
|
||||
*/
|
||||
enum dma_ctrl_flags {
|
||||
DMA_PREP_INTERRUPT = (1 << 0),
|
||||
@@ -90,8 +98,31 @@ enum dma_ctrl_flags {
|
||||
DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3),
|
||||
DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4),
|
||||
DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5),
|
||||
DMA_PREP_PQ_DISABLE_P = (1 << 6),
|
||||
DMA_PREP_PQ_DISABLE_Q = (1 << 7),
|
||||
DMA_PREP_CONTINUE = (1 << 8),
|
||||
DMA_PREP_FENCE = (1 << 9),
|
||||
};
|
||||
|
||||
/**
|
||||
* enum sum_check_bits - bit position of pq_check_flags
|
||||
*/
|
||||
enum sum_check_bits {
|
||||
SUM_CHECK_P = 0,
|
||||
SUM_CHECK_Q = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pq_check_flags - result of async_{xor,pq}_zero_sum operations
|
||||
* @SUM_CHECK_P_RESULT - 1 if xor zero sum error, 0 otherwise
|
||||
* @SUM_CHECK_Q_RESULT - 1 if reed-solomon zero sum error, 0 otherwise
|
||||
*/
|
||||
enum sum_check_flags {
|
||||
SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P),
|
||||
SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q),
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
|
||||
* See linux/cpumask.h
|
||||
@@ -180,8 +211,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
||||
* @flags: flags to augment operation preparation, control completion, and
|
||||
* communicate status
|
||||
* @phys: physical address of the descriptor
|
||||
* @tx_list: driver common field for operations that require multiple
|
||||
* descriptors
|
||||
* @chan: target channel for this operation
|
||||
* @tx_submit: set the prepared descriptor(s) to be executed by the engine
|
||||
* @callback: routine to call after this operation is complete
|
||||
@@ -195,7 +224,6 @@ struct dma_async_tx_descriptor {
|
||||
dma_cookie_t cookie;
|
||||
enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */
|
||||
dma_addr_t phys;
|
||||
struct list_head tx_list;
|
||||
struct dma_chan *chan;
|
||||
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
|
||||
dma_async_tx_callback callback;
|
||||
@@ -213,6 +241,11 @@ struct dma_async_tx_descriptor {
|
||||
* @global_node: list_head for global dma_device_list
|
||||
* @cap_mask: one or more dma_capability flags
|
||||
* @max_xor: maximum number of xor sources, 0 if no capability
|
||||
* @max_pq: maximum number of PQ sources and PQ-continue capability
|
||||
* @copy_align: alignment shift for memcpy operations
|
||||
* @xor_align: alignment shift for xor operations
|
||||
* @pq_align: alignment shift for pq operations
|
||||
* @fill_align: alignment shift for memset operations
|
||||
* @dev_id: unique device ID
|
||||
* @dev: struct device reference for dma mapping api
|
||||
* @device_alloc_chan_resources: allocate resources and return the
|
||||
@@ -220,7 +253,9 @@ struct dma_async_tx_descriptor {
|
||||
* @device_free_chan_resources: release DMA channel's resources
|
||||
* @device_prep_dma_memcpy: prepares a memcpy operation
|
||||
* @device_prep_dma_xor: prepares a xor operation
|
||||
* @device_prep_dma_zero_sum: prepares a zero_sum operation
|
||||
* @device_prep_dma_xor_val: prepares a xor validation operation
|
||||
* @device_prep_dma_pq: prepares a pq operation
|
||||
* @device_prep_dma_pq_val: prepares a pqzero_sum operation
|
||||
* @device_prep_dma_memset: prepares a memset operation
|
||||
* @device_prep_dma_interrupt: prepares an end of chain interrupt operation
|
||||
* @device_prep_slave_sg: prepares a slave dma operation
|
||||
@@ -235,7 +270,13 @@ struct dma_device {
|
||||
struct list_head channels;
|
||||
struct list_head global_node;
|
||||
dma_cap_mask_t cap_mask;
|
||||
int max_xor;
|
||||
unsigned short max_xor;
|
||||
unsigned short max_pq;
|
||||
u8 copy_align;
|
||||
u8 xor_align;
|
||||
u8 pq_align;
|
||||
u8 fill_align;
|
||||
#define DMA_HAS_PQ_CONTINUE (1 << 15)
|
||||
|
||||
int dev_id;
|
||||
struct device *dev;
|
||||
@@ -249,9 +290,17 @@ struct dma_device {
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
|
||||
struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
|
||||
unsigned int src_cnt, size_t len, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)(
|
||||
struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
|
||||
size_t len, u32 *result, unsigned long flags);
|
||||
size_t len, enum sum_check_flags *result, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_pq)(
|
||||
struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf,
|
||||
size_t len, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_pq_val)(
|
||||
struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||
enum sum_check_flags *pqres, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
|
||||
struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
|
||||
unsigned long flags);
|
||||
@@ -270,6 +319,96 @@ struct dma_device {
|
||||
void (*device_issue_pending)(struct dma_chan *chan);
|
||||
};
|
||||
|
||||
static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len)
|
||||
{
|
||||
size_t mask;
|
||||
|
||||
if (!align)
|
||||
return true;
|
||||
mask = (1 << align) - 1;
|
||||
if (mask & (off1 | off2 | len))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool is_dma_copy_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->copy_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_xor_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->xor_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_pq_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->pq_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_fill_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->fill_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_set_maxpq(struct dma_device *dma, int maxpq, int has_pq_continue)
|
||||
{
|
||||
dma->max_pq = maxpq;
|
||||
if (has_pq_continue)
|
||||
dma->max_pq |= DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool dmaf_continue(enum dma_ctrl_flags flags)
|
||||
{
|
||||
return (flags & DMA_PREP_CONTINUE) == DMA_PREP_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool dmaf_p_disabled_continue(enum dma_ctrl_flags flags)
|
||||
{
|
||||
enum dma_ctrl_flags mask = DMA_PREP_CONTINUE | DMA_PREP_PQ_DISABLE_P;
|
||||
|
||||
return (flags & mask) == mask;
|
||||
}
|
||||
|
||||
static inline bool dma_dev_has_pq_continue(struct dma_device *dma)
|
||||
{
|
||||
return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
static unsigned short dma_dev_to_maxpq(struct dma_device *dma)
|
||||
{
|
||||
return dma->max_pq & ~DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
/* dma_maxpq - reduce maxpq in the face of continued operations
|
||||
* @dma - dma device with PQ capability
|
||||
* @flags - to check if DMA_PREP_CONTINUE and DMA_PREP_PQ_DISABLE_P are set
|
||||
*
|
||||
* When an engine does not support native continuation we need 3 extra
|
||||
* source slots to reuse P and Q with the following coefficients:
|
||||
* 1/ {00} * P : remove P from Q', but use it as a source for P'
|
||||
* 2/ {01} * Q : use Q to continue Q' calculation
|
||||
* 3/ {00} * Q : subtract Q from P' to cancel (2)
|
||||
*
|
||||
* In the case where P is disabled we only need 1 extra source:
|
||||
* 1/ {01} * Q : use Q to continue Q' calculation
|
||||
*/
|
||||
static inline int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags)
|
||||
{
|
||||
if (dma_dev_has_pq_continue(dma) || !dmaf_continue(flags))
|
||||
return dma_dev_to_maxpq(dma);
|
||||
else if (dmaf_p_disabled_continue(flags))
|
||||
return dma_dev_to_maxpq(dma) - 1;
|
||||
else if (dmaf_continue(flags))
|
||||
return dma_dev_to_maxpq(dma) - 3;
|
||||
BUG();
|
||||
}
|
||||
|
||||
/* --- public DMA engine API --- */
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
@@ -299,7 +438,11 @@ static inline void net_dmaengine_put(void)
|
||||
#ifdef CONFIG_ASYNC_TX_DMA
|
||||
#define async_dmaengine_get() dmaengine_get()
|
||||
#define async_dmaengine_put() dmaengine_put()
|
||||
#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
|
||||
#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX)
|
||||
#else
|
||||
#define async_dma_find_channel(type) dma_find_channel(type)
|
||||
#endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */
|
||||
#else
|
||||
static inline void async_dmaengine_get(void)
|
||||
{
|
||||
@@ -312,7 +455,7 @@ async_dma_find_channel(enum dma_transaction_type type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_ASYNC_TX_DMA */
|
||||
|
||||
dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
|
||||
void *dest, void *src, size_t len);
|
||||
|
||||
@@ -173,7 +173,8 @@ typedef enum fe_modulation {
|
||||
typedef enum fe_transmit_mode {
|
||||
TRANSMISSION_MODE_2K,
|
||||
TRANSMISSION_MODE_8K,
|
||||
TRANSMISSION_MODE_AUTO
|
||||
TRANSMISSION_MODE_AUTO,
|
||||
TRANSMISSION_MODE_4K
|
||||
} fe_transmit_mode_t;
|
||||
|
||||
typedef enum fe_bandwidth {
|
||||
@@ -268,15 +269,42 @@ struct dvb_frontend_event {
|
||||
#define DTV_FE_CAPABILITY 16
|
||||
#define DTV_DELIVERY_SYSTEM 17
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
/* ISDB-T and ISDB-Tsb */
|
||||
#define DTV_ISDBT_PARTIAL_RECEPTION 18
|
||||
#define DTV_ISDBT_SOUND_BROADCASTING 19
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_HIERARCHY
|
||||
#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
|
||||
#define DTV_ISDBT_SB_SEGMENT_IDX 21
|
||||
#define DTV_ISDBT_SB_SEGMENT_COUNT 22
|
||||
|
||||
#define DTV_ISDBT_LAYERA_FEC 23
|
||||
#define DTV_ISDBT_LAYERA_MODULATION 24
|
||||
#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
|
||||
#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
|
||||
|
||||
#define DTV_ISDBT_LAYERB_FEC 27
|
||||
#define DTV_ISDBT_LAYERB_MODULATION 28
|
||||
#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
|
||||
#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
|
||||
|
||||
#define DTV_ISDBT_LAYERC_FEC 31
|
||||
#define DTV_ISDBT_LAYERC_MODULATION 32
|
||||
#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
|
||||
#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
|
||||
#define DTV_ISDBT_LAYER_ENABLED 41
|
||||
|
||||
#define DTV_ISDBS_TS_ID 42
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID
|
||||
|
||||
typedef enum fe_pilot {
|
||||
PILOT_ON,
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
#define _DVBVERSION_H_
|
||||
|
||||
#define DVB_API_VERSION 5
|
||||
#define DVB_API_VERSION_MINOR 0
|
||||
#define DVB_API_VERSION_MINOR 1
|
||||
|
||||
#endif /*_DVBVERSION_H_*/
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#ifdef CONFIG_EVENTFD
|
||||
|
||||
struct file *eventfd_file_create(unsigned int count, int flags);
|
||||
struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx);
|
||||
void eventfd_ctx_put(struct eventfd_ctx *ctx);
|
||||
struct file *eventfd_fget(int fd);
|
||||
@@ -40,6 +41,11 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n);
|
||||
* Ugly ugly ugly error layer to support modules that uses eventfd but
|
||||
* pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO.
|
||||
*/
|
||||
static inline struct file *eventfd_file_create(unsigned int count, int flags)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
|
||||
@@ -134,20 +134,6 @@ struct fw_card {
|
||||
u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
||||
};
|
||||
|
||||
static inline struct fw_card *fw_card_get(struct fw_card *card)
|
||||
{
|
||||
kref_get(&card->kref);
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
void fw_card_release(struct kref *kref);
|
||||
|
||||
static inline void fw_card_put(struct fw_card *card)
|
||||
{
|
||||
kref_put(&card->kref, fw_card_release);
|
||||
}
|
||||
|
||||
struct fw_attribute_group {
|
||||
struct attribute_group *groups[2];
|
||||
struct attribute_group group;
|
||||
|
||||
@@ -31,10 +31,32 @@ struct flex_array {
|
||||
};
|
||||
};
|
||||
|
||||
#define FLEX_ARRAY_INIT(size, total) { { {\
|
||||
.element_size = (size), \
|
||||
.total_nr_elements = (total), \
|
||||
} } }
|
||||
/* Number of bytes left in base struct flex_array, excluding metadata */
|
||||
#define FLEX_ARRAY_BASE_BYTES_LEFT \
|
||||
(FLEX_ARRAY_BASE_SIZE - offsetof(struct flex_array, parts))
|
||||
|
||||
/* Number of pointers in base to struct flex_array_part pages */
|
||||
#define FLEX_ARRAY_NR_BASE_PTRS \
|
||||
(FLEX_ARRAY_BASE_BYTES_LEFT / sizeof(struct flex_array_part *))
|
||||
|
||||
/* Number of elements of size that fit in struct flex_array_part */
|
||||
#define FLEX_ARRAY_ELEMENTS_PER_PART(size) \
|
||||
(FLEX_ARRAY_PART_SIZE / size)
|
||||
|
||||
/*
|
||||
* Defines a statically allocated flex array and ensures its parameters are
|
||||
* valid.
|
||||
*/
|
||||
#define DEFINE_FLEX_ARRAY(__arrayname, __element_size, __total) \
|
||||
struct flex_array __arrayname = { { { \
|
||||
.element_size = (__element_size), \
|
||||
.total_nr_elements = (__total), \
|
||||
} } }; \
|
||||
static inline void __arrayname##_invalid_parameter(void) \
|
||||
{ \
|
||||
BUILD_BUG_ON((__total) > FLEX_ARRAY_NR_BASE_PTRS * \
|
||||
FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \
|
||||
}
|
||||
|
||||
struct flex_array *flex_array_alloc(int element_size, unsigned int total,
|
||||
gfp_t flags);
|
||||
@@ -44,6 +66,8 @@ void flex_array_free(struct flex_array *fa);
|
||||
void flex_array_free_parts(struct flex_array *fa);
|
||||
int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,
|
||||
gfp_t flags);
|
||||
int flex_array_clear(struct flex_array *fa, unsigned int element_nr);
|
||||
void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
|
||||
int flex_array_shrink(struct flex_array *fa);
|
||||
|
||||
#endif /* _FLEX_ARRAY_H */
|
||||
|
||||
@@ -595,6 +595,7 @@ struct address_space_operations {
|
||||
int (*launder_page) (struct page *);
|
||||
int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
|
||||
unsigned long);
|
||||
int (*error_remove_page)(struct address_space *, struct page *);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -640,7 +641,6 @@ struct block_device {
|
||||
struct super_block * bd_super;
|
||||
int bd_openers;
|
||||
struct mutex bd_mutex; /* open/close mutex */
|
||||
struct semaphore bd_mount_sem;
|
||||
struct list_head bd_inodes;
|
||||
void * bd_holder;
|
||||
int bd_holders;
|
||||
@@ -1066,8 +1066,8 @@ struct file_lock {
|
||||
struct fasync_struct * fl_fasync; /* for lease break notifications */
|
||||
unsigned long fl_break_time; /* for nonblocking lease breaks */
|
||||
|
||||
struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
union {
|
||||
struct nfs_lock_info nfs_fl;
|
||||
struct nfs4_lock_info nfs4_fl;
|
||||
@@ -1315,11 +1315,11 @@ struct super_block {
|
||||
unsigned long s_blocksize;
|
||||
unsigned char s_blocksize_bits;
|
||||
unsigned char s_dirt;
|
||||
unsigned long long s_maxbytes; /* Max file size */
|
||||
loff_t s_maxbytes; /* Max file size */
|
||||
struct file_system_type *s_type;
|
||||
const struct super_operations *s_op;
|
||||
struct dquot_operations *dq_op;
|
||||
struct quotactl_ops *s_qcop;
|
||||
const struct dquot_operations *dq_op;
|
||||
const struct quotactl_ops *s_qcop;
|
||||
const struct export_operations *s_export_op;
|
||||
unsigned long s_flags;
|
||||
unsigned long s_magic;
|
||||
@@ -2156,6 +2156,7 @@ extern ino_t iunique(struct super_block *, ino_t);
|
||||
extern int inode_needs_sync(struct inode *inode);
|
||||
extern void generic_delete_inode(struct inode *inode);
|
||||
extern void generic_drop_inode(struct inode *inode);
|
||||
extern int generic_detach_inode(struct inode *inode);
|
||||
|
||||
extern struct inode *ilookup5_nowait(struct super_block *sb,
|
||||
unsigned long hashval, int (*test)(struct inode *, void *),
|
||||
@@ -2334,6 +2335,7 @@ extern void get_filesystem(struct file_system_type *fs);
|
||||
extern void put_filesystem(struct file_system_type *fs);
|
||||
extern struct file_system_type *get_fs_type(const char *name);
|
||||
extern struct super_block *get_super(struct block_device *);
|
||||
extern struct super_block *get_active_super(struct block_device *bdev);
|
||||
extern struct super_block *user_get_super(dev_t);
|
||||
extern void drop_super(struct super_block *sb);
|
||||
|
||||
@@ -2381,7 +2383,8 @@ extern int buffer_migrate_page(struct address_space *,
|
||||
#define buffer_migrate_page NULL
|
||||
#endif
|
||||
|
||||
extern int inode_change_ok(struct inode *, struct iattr *);
|
||||
extern int inode_change_ok(const struct inode *, struct iattr *);
|
||||
extern int inode_newsize_ok(const struct inode *, loff_t offset);
|
||||
extern int __must_check inode_setattr(struct inode *, struct iattr *);
|
||||
|
||||
extern void file_update_time(struct file *file);
|
||||
@@ -2467,7 +2470,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
|
||||
size_t len, loff_t *ppos);
|
||||
|
||||
struct ctl_table;
|
||||
int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
|
||||
int proc_nr_files(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos);
|
||||
|
||||
int __init get_filesystem_list(char *buf);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
extern int ftrace_enabled;
|
||||
extern int
|
||||
ftrace_enable_sysctl(struct ctl_table *table, int write,
|
||||
struct file *filp, void __user *buffer, size_t *lenp,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
|
||||
@@ -94,7 +94,7 @@ static inline void ftrace_start(void) { }
|
||||
extern int stack_tracer_enabled;
|
||||
int
|
||||
stack_trace_sysctl(struct ctl_table *table, int write,
|
||||
struct file *file, void __user *buffer, size_t *lenp,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
#endif
|
||||
|
||||
@@ -446,7 +446,6 @@ static inline void unpause_graph_tracing(void) { }
|
||||
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|
||||
|
||||
#ifdef CONFIG_TRACING
|
||||
#include <linux/sched.h>
|
||||
|
||||
/* flags for current->trace */
|
||||
enum {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <linux/ring_buffer.h>
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
struct trace_array;
|
||||
struct tracer;
|
||||
@@ -130,10 +131,15 @@ struct ftrace_event_call {
|
||||
void *data;
|
||||
|
||||
atomic_t profile_count;
|
||||
int (*profile_enable)(struct ftrace_event_call *);
|
||||
void (*profile_disable)(struct ftrace_event_call *);
|
||||
int (*profile_enable)(void);
|
||||
void (*profile_disable)(void);
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_PROFILE_SIZE 2048
|
||||
|
||||
extern char *trace_profile_buf;
|
||||
extern char *trace_profile_buf_nmi;
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
* - add umask flag to input argument of open, mknod and mkdir
|
||||
* - add notification messages for invalidation of inodes and
|
||||
* directory entries
|
||||
*
|
||||
* 7.13
|
||||
* - make max number of background requests and congestion threshold
|
||||
* tunables
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
@@ -37,11 +41,31 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Version negotiation:
|
||||
*
|
||||
* Both the kernel and userspace send the version they support in the
|
||||
* INIT request and reply respectively.
|
||||
*
|
||||
* If the major versions match then both shall use the smallest
|
||||
* of the two minor versions for communication.
|
||||
*
|
||||
* If the kernel supports a larger major version, then userspace shall
|
||||
* reply with the major version it supports, ignore the rest of the
|
||||
* INIT message and expect a new INIT message from the kernel with a
|
||||
* matching major version.
|
||||
*
|
||||
* If the library supports a larger major version, then it shall fall
|
||||
* back to the major protocol version sent by the kernel for
|
||||
* communication and reply with that major version (and an arbitrary
|
||||
* supported minor version).
|
||||
*/
|
||||
|
||||
/** Version number of this interface */
|
||||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 12
|
||||
#define FUSE_KERNEL_MINOR_VERSION 13
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
@@ -427,7 +451,8 @@ struct fuse_init_out {
|
||||
__u32 minor;
|
||||
__u32 max_readahead;
|
||||
__u32 flags;
|
||||
__u32 unused;
|
||||
__u16 max_background;
|
||||
__u16 congestion_threshold;
|
||||
__u32 max_write;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct inode;
|
||||
struct mm_struct;
|
||||
struct task_struct;
|
||||
union ktime;
|
||||
|
||||
/* Second argument to futex syscall */
|
||||
|
||||
|
||||
@@ -129,6 +124,11 @@ struct robust_list_head {
|
||||
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct inode;
|
||||
struct mm_struct;
|
||||
struct task_struct;
|
||||
union ktime;
|
||||
|
||||
long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout,
|
||||
u32 __user *uaddr2, u32 val2, u32 val3);
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ struct gendisk {
|
||||
* disks that can't be partitioned. */
|
||||
|
||||
char disk_name[DISK_NAME_LEN]; /* name of major driver */
|
||||
char *(*nodename)(struct gendisk *gd);
|
||||
char *(*devnode)(struct gendisk *gd, mode_t *mode);
|
||||
/* Array of pointers to partitions indexed by partno.
|
||||
* Protected with matching bdev lock but stat and other
|
||||
* non-critical accesses use RCU. Always access through
|
||||
@@ -151,7 +151,7 @@ struct gendisk {
|
||||
struct disk_part_tbl *part_tbl;
|
||||
struct hd_struct part0;
|
||||
|
||||
struct block_device_operations *fops;
|
||||
const struct block_device_operations *fops;
|
||||
struct request_queue *queue;
|
||||
void *private_data;
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
((1 << ZONES_SHIFT) - 1);
|
||||
|
||||
if (__builtin_constant_p(bit))
|
||||
BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
else {
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
|
||||
extern void __free_pages(struct page *page, unsigned int order);
|
||||
extern void free_pages(unsigned long addr, unsigned int order);
|
||||
extern void free_hot_page(struct page *page);
|
||||
extern void free_cold_page(struct page *page);
|
||||
|
||||
#define __free_page(page) __free_pages((page), 0)
|
||||
#define free_page(addr) free_pages((addr),0)
|
||||
@@ -336,18 +335,6 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
||||
void drain_all_pages(void);
|
||||
void drain_local_pages(void *dummy);
|
||||
|
||||
extern bool oom_killer_disabled;
|
||||
|
||||
static inline void oom_killer_disable(void)
|
||||
{
|
||||
oom_killer_disabled = true;
|
||||
}
|
||||
|
||||
static inline void oom_killer_enable(void)
|
||||
{
|
||||
oom_killer_disabled = false;
|
||||
}
|
||||
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
static inline void set_gfp_allowed_mask(gfp_t mask)
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
struct device;
|
||||
|
||||
/*
|
||||
* Some platforms don't support the GPIO programming interface.
|
||||
*
|
||||
@@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
WARN_ON(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static inline void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
|
||||
@@ -96,7 +96,6 @@ struct esp_struct {
|
||||
int xmit_head;
|
||||
int xmit_tail;
|
||||
int xmit_cnt;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
wait_queue_head_t break_wait;
|
||||
struct async_icount icount; /* kernel counters for the 4 input interrupts */
|
||||
struct hayes_esp_config config; /* port configuration */
|
||||
|
||||
@@ -494,6 +494,7 @@ struct hid_device { /* device report descriptor */
|
||||
|
||||
/* hiddev event handler */
|
||||
int (*hiddev_connect)(struct hid_device *, unsigned int);
|
||||
void (*hiddev_disconnect)(struct hid_device *);
|
||||
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
||||
struct hid_usage *, __s32);
|
||||
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
||||
@@ -691,6 +692,7 @@ struct hid_device *hid_allocate_device(void);
|
||||
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
|
||||
int hid_check_keys_pressed(struct hid_device *hid);
|
||||
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
|
||||
void hid_disconnect(struct hid_device *hid);
|
||||
|
||||
/**
|
||||
* hid_map_usage - map usage input bits
|
||||
@@ -800,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
|
||||
*/
|
||||
static inline void hid_hw_stop(struct hid_device *hdev)
|
||||
{
|
||||
hid_disconnect(hdev);
|
||||
hdev->ll_driver->stop(hdev);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ enum hrtimer_restart {
|
||||
* @function: timer expiry callback function
|
||||
* @base: pointer to the timer base (per cpu and per clock)
|
||||
* @state: state information (See bit values above)
|
||||
* @cb_entry: list head to enqueue an expired timer into the callback list
|
||||
* @start_site: timer statistics field to store the site where the timer
|
||||
* was started
|
||||
* @start_comm: timer statistics field to store the name of the process which
|
||||
@@ -108,7 +107,6 @@ struct hrtimer {
|
||||
enum hrtimer_restart (*function)(struct hrtimer *);
|
||||
struct hrtimer_clock_base *base;
|
||||
unsigned long state;
|
||||
struct list_head cb_entry;
|
||||
#ifdef CONFIG_TIMER_STATS
|
||||
int start_pid;
|
||||
void *start_site;
|
||||
|
||||
@@ -20,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
|
||||
}
|
||||
|
||||
void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
|
||||
int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
|
||||
int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
|
||||
int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
|
||||
struct page **, struct vm_area_struct **,
|
||||
unsigned long *, int *, int, unsigned int flags);
|
||||
void unmap_hugepage_range(struct vm_area_struct *,
|
||||
unsigned long, unsigned long, struct page *);
|
||||
void __unmap_hugepage_range(struct vm_area_struct *,
|
||||
@@ -110,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
||||
|
||||
#endif /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
#define HUGETLB_ANON_FILE "anon_hugepage"
|
||||
|
||||
enum {
|
||||
/*
|
||||
* The file will be used as an shm file so shmfs accounting rules
|
||||
* apply
|
||||
*/
|
||||
HUGETLB_SHMFS_INODE = 1,
|
||||
/*
|
||||
* The file is being created on the internal vfs mount and shmfs
|
||||
* accounting rules do not apply
|
||||
*/
|
||||
HUGETLB_ANONHUGE_INODE = 2,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_HUGETLBFS
|
||||
struct hugetlbfs_config {
|
||||
uid_t uid;
|
||||
@@ -148,7 +165,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
|
||||
extern const struct file_operations hugetlbfs_file_operations;
|
||||
extern struct vm_operations_struct hugetlb_vm_ops;
|
||||
struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
|
||||
struct user_struct **user);
|
||||
struct user_struct **user, int creat_flags);
|
||||
int hugetlb_get_quota(struct address_space *mapping, long delta);
|
||||
void hugetlb_put_quota(struct address_space *mapping, long delta);
|
||||
|
||||
@@ -170,7 +187,7 @@ static inline void set_file_hugepages(struct file *file)
|
||||
|
||||
#define is_file_hugepages(file) 0
|
||||
#define set_file_hugepages(file) BUG()
|
||||
#define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS)
|
||||
#define hugetlb_file_setup(name,size,acct,user,creat) ERR_PTR(-ENOSYS)
|
||||
|
||||
#endif /* !CONFIG_HUGETLBFS */
|
||||
|
||||
@@ -185,7 +202,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
||||
#define HSTATE_NAME_LEN 32
|
||||
/* Defines one hugetlb page size */
|
||||
struct hstate {
|
||||
int hugetlb_next_nid;
|
||||
int next_nid_to_alloc;
|
||||
int next_nid_to_free;
|
||||
unsigned int order;
|
||||
unsigned long mask;
|
||||
unsigned long max_huge_pages;
|
||||
|
||||
@@ -27,17 +27,6 @@
|
||||
legacy chip driver needs to identify a bus or a bus driver needs to
|
||||
identify a legacy client. If you don't need them, just don't set them. */
|
||||
|
||||
/*
|
||||
* ---- Driver types -----------------------------------------------------
|
||||
*/
|
||||
|
||||
#define I2C_DRIVERID_MSP3400 1
|
||||
#define I2C_DRIVERID_TUNER 2
|
||||
#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */
|
||||
#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */
|
||||
#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
|
||||
#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
|
||||
|
||||
/*
|
||||
* ---- Adapter types ----------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
|
||||
/**
|
||||
* struct i2c_driver - represent an I2C device driver
|
||||
* @id: Unique driver ID (optional)
|
||||
* @class: What kind of i2c device we instantiate (for detect)
|
||||
* @attach_adapter: Callback for bus addition (for legacy drivers)
|
||||
* @detach_adapter: Callback for bus removal (for legacy drivers)
|
||||
@@ -135,7 +134,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
* not allowed.
|
||||
*/
|
||||
struct i2c_driver {
|
||||
int id;
|
||||
unsigned int class;
|
||||
|
||||
/* Notifies the driver that a new bus has appeared or is about to be
|
||||
|
||||
92
include/linux/i2c/adp5588.h
Normal file
92
include/linux/i2c/adp5588.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller
|
||||
*
|
||||
* Copyright 2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef _ADP5588_H
|
||||
#define _ADP5588_H
|
||||
|
||||
#define DEV_ID 0x00 /* Device ID */
|
||||
#define CFG 0x01 /* Configuration Register1 */
|
||||
#define INT_STAT 0x02 /* Interrupt Status Register */
|
||||
#define KEY_LCK_EC_STAT 0x03 /* Key Lock and Event Counter Register */
|
||||
#define Key_EVENTA 0x04 /* Key Event Register A */
|
||||
#define Key_EVENTB 0x05 /* Key Event Register B */
|
||||
#define Key_EVENTC 0x06 /* Key Event Register C */
|
||||
#define Key_EVENTD 0x07 /* Key Event Register D */
|
||||
#define Key_EVENTE 0x08 /* Key Event Register E */
|
||||
#define Key_EVENTF 0x09 /* Key Event Register F */
|
||||
#define Key_EVENTG 0x0A /* Key Event Register G */
|
||||
#define Key_EVENTH 0x0B /* Key Event Register H */
|
||||
#define Key_EVENTI 0x0C /* Key Event Register I */
|
||||
#define Key_EVENTJ 0x0D /* Key Event Register J */
|
||||
#define KP_LCK_TMR 0x0E /* Keypad Lock1 to Lock2 Timer */
|
||||
#define UNLOCK1 0x0F /* Unlock Key1 */
|
||||
#define UNLOCK2 0x10 /* Unlock Key2 */
|
||||
#define GPIO_INT_STAT1 0x11 /* GPIO Interrupt Status */
|
||||
#define GPIO_INT_STAT2 0x12 /* GPIO Interrupt Status */
|
||||
#define GPIO_INT_STAT3 0x13 /* GPIO Interrupt Status */
|
||||
#define GPIO_DAT_STAT1 0x14 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_STAT2 0x15 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_STAT3 0x16 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_OUT1 0x17 /* GPIO DATA OUT */
|
||||
#define GPIO_DAT_OUT2 0x18 /* GPIO DATA OUT */
|
||||
#define GPIO_DAT_OUT3 0x19 /* GPIO DATA OUT */
|
||||
#define GPIO_INT_EN1 0x1A /* GPIO Interrupt Enable */
|
||||
#define GPIO_INT_EN2 0x1B /* GPIO Interrupt Enable */
|
||||
#define GPIO_INT_EN3 0x1C /* GPIO Interrupt Enable */
|
||||
#define KP_GPIO1 0x1D /* Keypad or GPIO Selection */
|
||||
#define KP_GPIO2 0x1E /* Keypad or GPIO Selection */
|
||||
#define KP_GPIO3 0x1F /* Keypad or GPIO Selection */
|
||||
#define GPI_EM1 0x20 /* GPI Event Mode 1 */
|
||||
#define GPI_EM2 0x21 /* GPI Event Mode 2 */
|
||||
#define GPI_EM3 0x22 /* GPI Event Mode 3 */
|
||||
#define GPIO_DIR1 0x23 /* GPIO Data Direction */
|
||||
#define GPIO_DIR2 0x24 /* GPIO Data Direction */
|
||||
#define GPIO_DIR3 0x25 /* GPIO Data Direction */
|
||||
#define GPIO_INT_LVL1 0x26 /* GPIO Edge/Level Detect */
|
||||
#define GPIO_INT_LVL2 0x27 /* GPIO Edge/Level Detect */
|
||||
#define GPIO_INT_LVL3 0x28 /* GPIO Edge/Level Detect */
|
||||
#define Debounce_DIS1 0x29 /* Debounce Disable */
|
||||
#define Debounce_DIS2 0x2A /* Debounce Disable */
|
||||
#define Debounce_DIS3 0x2B /* Debounce Disable */
|
||||
#define GPIO_PULL1 0x2C /* GPIO Pull Disable */
|
||||
#define GPIO_PULL2 0x2D /* GPIO Pull Disable */
|
||||
#define GPIO_PULL3 0x2E /* GPIO Pull Disable */
|
||||
#define CMP_CFG_STAT 0x30 /* Comparator Configuration and Status Register */
|
||||
#define CMP_CONFG_SENS1 0x31 /* Sensor1 Comparator Configuration Register */
|
||||
#define CMP_CONFG_SENS2 0x32 /* L2 Light Sensor Reference Level, Output Falling for Sensor 1 */
|
||||
#define CMP1_LVL2_TRIP 0x33 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 1 */
|
||||
#define CMP1_LVL2_HYS 0x34 /* L3 Light Sensor Reference Level, Output Falling For Sensor 1 */
|
||||
#define CMP1_LVL3_TRIP 0x35 /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 1 */
|
||||
#define CMP1_LVL3_HYS 0x36 /* Sensor 2 Comparator Configuration Register */
|
||||
#define CMP2_LVL2_TRIP 0x37 /* L2 Light Sensor Reference Level, Output Falling for Sensor 2 */
|
||||
#define CMP2_LVL2_HYS 0x38 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 2 */
|
||||
#define CMP2_LVL3_TRIP 0x39 /* L3 Light Sensor Reference Level, Output Falling For Sensor 2 */
|
||||
#define CMP2_LVL3_HYS 0x3A /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 2 */
|
||||
#define CMP1_ADC_DAT_R1 0x3B /* Comparator 1 ADC data Register1 */
|
||||
#define CMP1_ADC_DAT_R2 0x3C /* Comparator 1 ADC data Register2 */
|
||||
#define CMP2_ADC_DAT_R1 0x3D /* Comparator 2 ADC data Register1 */
|
||||
#define CMP2_ADC_DAT_R2 0x3E /* Comparator 2 ADC data Register2 */
|
||||
|
||||
#define ADP5588_DEVICE_ID_MASK 0xF
|
||||
|
||||
/* Put one of these structures in i2c_board_info platform_data */
|
||||
|
||||
#define ADP5588_KEYMAPSIZE 80
|
||||
|
||||
struct adp5588_kpad_platform_data {
|
||||
int rows; /* Number of rows */
|
||||
int cols; /* Number of columns */
|
||||
const unsigned short *keymap; /* Pointer to keymap */
|
||||
unsigned short keymapsize; /* Keymap size */
|
||||
unsigned repeat:1; /* Enable key repeat */
|
||||
unsigned en_keylock:1; /* Enable Key Lock feature */
|
||||
unsigned short unlock_key1; /* Unlock Key 1 */
|
||||
unsigned short unlock_key2; /* Unlock Key 2 */
|
||||
};
|
||||
|
||||
#endif
|
||||
24
include/linux/i2c/mcs5000_ts.h
Normal file
24
include/linux/i2c/mcs5000_ts.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* mcs5000_ts.h
|
||||
*
|
||||
* Copyright (C) 2009 Samsung Electronics Co.Ltd
|
||||
* Author: Joonyoung Shim <jy0922.shim@samsung.com>
|
||||
*
|
||||
* 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_MCS5000_TS_H
|
||||
#define __LINUX_MCS5000_TS_H
|
||||
|
||||
/* platform data for the MELFAS MCS-5000 touchscreen driver */
|
||||
struct mcs5000_ts_platform_data {
|
||||
void (*cfg_pin)(void);
|
||||
int x_size;
|
||||
int y_size;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MCS5000_TS_H */
|
||||
@@ -223,19 +223,28 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
|
||||
/* Power bus message definitions */
|
||||
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1
|
||||
#define DEV_GRP_P2 0x2
|
||||
#define DEV_GRP_P3 0x4
|
||||
/* The TWL4030/5030 splits its power-management resources (the various
|
||||
* regulators, clock and reset lines) into 3 processor groups - P1, P2 and
|
||||
* P3. These groups can then be configured to transition between sleep, wait-on
|
||||
* and active states by sending messages to the power bus. See Section 5.4.2
|
||||
* Power Resources of TWL4030 TRM
|
||||
*/
|
||||
|
||||
#define RES_GRP_RES 0x0
|
||||
#define RES_GRP_PP 0x1
|
||||
#define RES_GRP_RC 0x2
|
||||
/* Processor groups */
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */
|
||||
#define DEV_GRP_P2 0x2 /* P2: all Modem devices */
|
||||
#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */
|
||||
|
||||
/* Resource groups */
|
||||
#define RES_GRP_RES 0x0 /* Reserved */
|
||||
#define RES_GRP_PP 0x1 /* Power providers */
|
||||
#define RES_GRP_RC 0x2 /* Reset and control */
|
||||
#define RES_GRP_PP_RC 0x3
|
||||
#define RES_GRP_PR 0x4
|
||||
#define RES_GRP_PR 0x4 /* Power references */
|
||||
#define RES_GRP_PP_PR 0x5
|
||||
#define RES_GRP_RC_PR 0x6
|
||||
#define RES_GRP_ALL 0x7
|
||||
#define RES_GRP_ALL 0x7 /* All resource groups */
|
||||
|
||||
#define RES_TYPE2_R0 0x0
|
||||
|
||||
@@ -246,6 +255,41 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
#define RES_STATE_SLEEP 0x8
|
||||
#define RES_STATE_OFF 0x0
|
||||
|
||||
/* Power resources */
|
||||
|
||||
/* Power providers */
|
||||
#define RES_VAUX1 1
|
||||
#define RES_VAUX2 2
|
||||
#define RES_VAUX3 3
|
||||
#define RES_VAUX4 4
|
||||
#define RES_VMMC1 5
|
||||
#define RES_VMMC2 6
|
||||
#define RES_VPLL1 7
|
||||
#define RES_VPLL2 8
|
||||
#define RES_VSIM 9
|
||||
#define RES_VDAC 10
|
||||
#define RES_VINTANA1 11
|
||||
#define RES_VINTANA2 12
|
||||
#define RES_VINTDIG 13
|
||||
#define RES_VIO 14
|
||||
#define RES_VDD1 15
|
||||
#define RES_VDD2 16
|
||||
#define RES_VUSB_1V5 17
|
||||
#define RES_VUSB_1V8 18
|
||||
#define RES_VUSB_3V1 19
|
||||
#define RES_VUSBCP 20
|
||||
#define RES_REGEN 21
|
||||
/* Reset and control */
|
||||
#define RES_NRES_PWRON 22
|
||||
#define RES_CLKEN 23
|
||||
#define RES_SYSEN 24
|
||||
#define RES_HFCLKOUT 25
|
||||
#define RES_32KCLKOUT 26
|
||||
#define RES_RESET 27
|
||||
/* Power Reference */
|
||||
#define RES_Main_Ref 28
|
||||
|
||||
#define TOTAL_RESOURCES 28
|
||||
/*
|
||||
* Power Bus Message Format ... these can be sent individually by Linux,
|
||||
* but are usually part of downloaded scripts that are run when various
|
||||
@@ -327,6 +371,36 @@ struct twl4030_usb_data {
|
||||
enum twl4030_usb_mode usb_mode;
|
||||
};
|
||||
|
||||
struct twl4030_ins {
|
||||
u16 pmb_message;
|
||||
u8 delay;
|
||||
};
|
||||
|
||||
struct twl4030_script {
|
||||
struct twl4030_ins *script;
|
||||
unsigned size;
|
||||
u8 flags;
|
||||
#define TWL4030_WRST_SCRIPT (1<<0)
|
||||
#define TWL4030_WAKEUP12_SCRIPT (1<<1)
|
||||
#define TWL4030_WAKEUP3_SCRIPT (1<<2)
|
||||
#define TWL4030_SLEEP_SCRIPT (1<<3)
|
||||
};
|
||||
|
||||
struct twl4030_resconfig {
|
||||
u8 resource;
|
||||
u8 devgroup; /* Processor group that Power resource belongs to */
|
||||
u8 type; /* Power resource addressed, 6 / broadcast message */
|
||||
u8 type2; /* Power resource addressed, 3 / broadcast message */
|
||||
};
|
||||
|
||||
struct twl4030_power_data {
|
||||
struct twl4030_script **scripts;
|
||||
unsigned num;
|
||||
struct twl4030_resconfig *resource_config;
|
||||
};
|
||||
|
||||
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
|
||||
|
||||
struct twl4030_platform_data {
|
||||
unsigned irq_base, irq_end;
|
||||
struct twl4030_bci_platform_data *bci;
|
||||
@@ -334,6 +408,7 @@ struct twl4030_platform_data {
|
||||
struct twl4030_madc_platform_data *madc;
|
||||
struct twl4030_keypad_data *keypad;
|
||||
struct twl4030_usb_data *usb;
|
||||
struct twl4030_power_data *power;
|
||||
|
||||
/* LDO regulators */
|
||||
struct regulator_init_data *vdac;
|
||||
@@ -364,7 +439,6 @@ int twl4030_sih_setup(int module);
|
||||
#define TWL4030_VAUX3_DEV_GRP 0x1F
|
||||
#define TWL4030_VAUX3_DEDICATED 0x22
|
||||
|
||||
|
||||
#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
|
||||
defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
|
||||
extern int twl4030charger_usb_en(int enable);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Standard commands.
|
||||
@@ -30,6 +31,35 @@
|
||||
#define I8042_CMD_MUX_PFX 0x0090
|
||||
#define I8042_CMD_MUX_SEND 0x1090
|
||||
|
||||
struct serio;
|
||||
|
||||
#if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
|
||||
|
||||
void i8042_lock_chip(void);
|
||||
void i8042_unlock_chip(void);
|
||||
int i8042_command(unsigned char *param, int command);
|
||||
bool i8042_check_port_owner(const struct serio *);
|
||||
|
||||
#else
|
||||
|
||||
void i8042_lock_chip(void)
|
||||
{
|
||||
}
|
||||
|
||||
void i8042_unlock_chip(void)
|
||||
{
|
||||
}
|
||||
|
||||
int i8042_command(unsigned char *param, int command)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
bool i8042_check_port_owner(const struct serio *serio)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -106,13 +106,13 @@ extern struct group_info init_groups;
|
||||
|
||||
extern struct cred init_cred;
|
||||
|
||||
#ifdef CONFIG_PERF_COUNTERS
|
||||
# define INIT_PERF_COUNTERS(tsk) \
|
||||
.perf_counter_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.perf_counter_mutex), \
|
||||
.perf_counter_list = LIST_HEAD_INIT(tsk.perf_counter_list),
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
# define INIT_PERF_EVENTS(tsk) \
|
||||
.perf_event_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.perf_event_mutex), \
|
||||
.perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
|
||||
#else
|
||||
# define INIT_PERF_COUNTERS(tsk)
|
||||
# define INIT_PERF_EVENTS(tsk)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -178,7 +178,7 @@ extern struct cred init_cred;
|
||||
}, \
|
||||
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
|
||||
INIT_IDS \
|
||||
INIT_PERF_COUNTERS(tsk) \
|
||||
INIT_PERF_EVENTS(tsk) \
|
||||
INIT_TRACE_IRQFLAGS \
|
||||
INIT_LOCKDEP \
|
||||
INIT_FTRACE_GRAPH \
|
||||
|
||||
@@ -1123,7 +1123,7 @@ struct input_dev {
|
||||
struct mutex mutex;
|
||||
|
||||
unsigned int users;
|
||||
int going_away;
|
||||
bool going_away;
|
||||
|
||||
struct device dev;
|
||||
|
||||
|
||||
@@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
|
||||
|
||||
extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
|
||||
|
||||
extern int dmar_ir_support(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
|
||||
* struct irqaction - per interrupt action descriptor
|
||||
* @handler: interrupt handler function
|
||||
* @flags: flags (see IRQF_* above)
|
||||
* @mask: no comment as it is useless and about to be removed
|
||||
* @name: name of the device
|
||||
* @dev_id: cookie to identify the device
|
||||
* @next: pointer to the next irqaction for shared interrupts
|
||||
@@ -97,7 +96,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
|
||||
struct irqaction {
|
||||
irq_handler_t handler;
|
||||
unsigned long flags;
|
||||
cpumask_t mask;
|
||||
const char *name;
|
||||
void *dev_id;
|
||||
struct irqaction *next;
|
||||
|
||||
@@ -184,5 +184,9 @@ extern void __devm_release_region(struct device *dev, struct resource *parent,
|
||||
extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
|
||||
extern int iomem_is_exclusive(u64 addr);
|
||||
|
||||
extern int
|
||||
walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
|
||||
void *arg, int (*func)(unsigned long, unsigned long, void *));
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _LINUX_IOPORT_H */
|
||||
|
||||
@@ -28,7 +28,6 @@ struct iova {
|
||||
|
||||
/* holds all the iova translations for a domain */
|
||||
struct iova_domain {
|
||||
spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */
|
||||
spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */
|
||||
struct rb_root rbroot; /* iova domain rbtree root */
|
||||
struct rb_node *cached32_node; /* Save last alloced node */
|
||||
|
||||
@@ -446,7 +446,7 @@ struct transaction_s
|
||||
/*
|
||||
* Where in the log does this transaction's commit start? [no locking]
|
||||
*/
|
||||
unsigned long t_log_start;
|
||||
unsigned int t_log_start;
|
||||
|
||||
/* Number of buffers on the t_buffers list [j_list_lock] */
|
||||
int t_nr_buffers;
|
||||
@@ -556,7 +556,7 @@ struct transaction_s
|
||||
* This transaction is being forced and some process is
|
||||
* waiting for it to finish.
|
||||
*/
|
||||
int t_synchronous_commit:1;
|
||||
unsigned int t_synchronous_commit:1;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -701,26 +701,26 @@ struct journal_s
|
||||
* Journal head: identifies the first unused block in the journal.
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_head;
|
||||
unsigned int j_head;
|
||||
|
||||
/*
|
||||
* Journal tail: identifies the oldest still-used block in the journal.
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_tail;
|
||||
unsigned int j_tail;
|
||||
|
||||
/*
|
||||
* Journal free: how many free blocks are there in the journal?
|
||||
* [j_state_lock]
|
||||
*/
|
||||
unsigned long j_free;
|
||||
unsigned int j_free;
|
||||
|
||||
/*
|
||||
* Journal start and end: the block numbers of the first usable block
|
||||
* and one beyond the last usable block in the journal. [j_state_lock]
|
||||
*/
|
||||
unsigned long j_first;
|
||||
unsigned long j_last;
|
||||
unsigned int j_first;
|
||||
unsigned int j_last;
|
||||
|
||||
/*
|
||||
* Device, blocksize and starting block offset for the location where we
|
||||
@@ -728,7 +728,7 @@ struct journal_s
|
||||
*/
|
||||
struct block_device *j_dev;
|
||||
int j_blocksize;
|
||||
unsigned long j_blk_offset;
|
||||
unsigned int j_blk_offset;
|
||||
|
||||
/*
|
||||
* Device which holds the client fs. For internal journal this will be
|
||||
@@ -859,7 +859,7 @@ extern void __journal_clean_data_list(transaction_t *transaction);
|
||||
|
||||
/* Log buffer allocation */
|
||||
extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
|
||||
int journal_next_log_block(journal_t *, unsigned long *);
|
||||
int journal_next_log_block(journal_t *, unsigned int *);
|
||||
|
||||
/* Commit management */
|
||||
extern void journal_commit_transaction(journal_t *);
|
||||
@@ -874,7 +874,7 @@ extern int
|
||||
journal_write_metadata_buffer(transaction_t *transaction,
|
||||
struct journal_head *jh_in,
|
||||
struct journal_head **jh_out,
|
||||
unsigned long blocknr);
|
||||
unsigned int blocknr);
|
||||
|
||||
/* Transaction locking */
|
||||
extern void __wait_on_journal (journal_t *);
|
||||
@@ -942,7 +942,7 @@ extern void journal_abort (journal_t *, int);
|
||||
extern int journal_errno (journal_t *);
|
||||
extern void journal_ack_err (journal_t *);
|
||||
extern int journal_clear_err (journal_t *);
|
||||
extern int journal_bmap(journal_t *, unsigned long, unsigned long *);
|
||||
extern int journal_bmap(journal_t *, unsigned int, unsigned int *);
|
||||
extern int journal_force_commit(journal_t *);
|
||||
|
||||
/*
|
||||
@@ -976,14 +976,14 @@ extern int journal_init_revoke_caches(void);
|
||||
|
||||
extern void journal_destroy_revoke(journal_t *);
|
||||
extern int journal_revoke (handle_t *,
|
||||
unsigned long, struct buffer_head *);
|
||||
unsigned int, struct buffer_head *);
|
||||
extern int journal_cancel_revoke(handle_t *, struct journal_head *);
|
||||
extern void journal_write_revoke_records(journal_t *,
|
||||
transaction_t *, int);
|
||||
|
||||
/* Recovery revoke support */
|
||||
extern int journal_set_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern int journal_test_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern int journal_set_revoke(journal_t *, unsigned int, tid_t);
|
||||
extern int journal_test_revoke(journal_t *, unsigned int, tid_t);
|
||||
extern void journal_clear_revoke(journal_t *);
|
||||
extern void journal_switch_revoke_table(journal_t *journal);
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ struct transaction_s
|
||||
* This transaction is being forced and some process is
|
||||
* waiting for it to finish.
|
||||
*/
|
||||
int t_synchronous_commit:1;
|
||||
unsigned int t_synchronous_commit:1;
|
||||
|
||||
/*
|
||||
* For use by the filesystem to store fs-specific data
|
||||
|
||||
@@ -146,7 +146,7 @@ extern int _cond_resched(void);
|
||||
#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
|
||||
|
||||
#define abs(x) ({ \
|
||||
int __x = (x); \
|
||||
long __x = (x); \
|
||||
(__x < 0) ? -__x : __x; \
|
||||
})
|
||||
|
||||
@@ -246,14 +246,16 @@ extern int printk_ratelimit(void);
|
||||
extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
|
||||
unsigned int interval_msec);
|
||||
|
||||
extern int printk_delay_msec;
|
||||
|
||||
/*
|
||||
* Print a one-time message (analogous to WARN_ONCE() et al):
|
||||
*/
|
||||
#define printk_once(x...) ({ \
|
||||
static int __print_once = 1; \
|
||||
static bool __print_once = true; \
|
||||
\
|
||||
if (__print_once) { \
|
||||
__print_once = 0; \
|
||||
__print_once = false; \
|
||||
printk(x); \
|
||||
} \
|
||||
})
|
||||
@@ -676,13 +678,17 @@ struct sysinfo {
|
||||
};
|
||||
|
||||
/* Force a compilation error if condition is true */
|
||||
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
|
||||
#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
|
||||
|
||||
/* Force a compilation error if condition is constant and true */
|
||||
#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
|
||||
|
||||
/* Force a compilation error if condition is true, but also produce a
|
||||
result (of value 0 and type size_t), so the expression can be used
|
||||
e.g. in a structure initializer (or where-ever else comma expressions
|
||||
aren't permitted). */
|
||||
#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
|
||||
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
|
||||
#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
|
||||
|
||||
/* Trap pasters of __FUNCTION__ at compile-time */
|
||||
#define __FUNCTION__ (__func__)
|
||||
|
||||
@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
|
||||
spinlock_t *lock);
|
||||
extern void kfifo_free(struct kfifo *fifo);
|
||||
extern unsigned int __kfifo_put(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len);
|
||||
const unsigned char *buffer, unsigned int len);
|
||||
extern unsigned int __kfifo_get(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len);
|
||||
|
||||
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
|
||||
* bytes copied.
|
||||
*/
|
||||
static inline unsigned int kfifo_put(struct kfifo *fifo,
|
||||
unsigned char *buffer, unsigned int len)
|
||||
const unsigned char *buffer, unsigned int len)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int ret;
|
||||
|
||||
@@ -144,10 +144,15 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
|
||||
int name##_end[0];
|
||||
|
||||
#define kmemcheck_annotate_bitfield(ptr, name) \
|
||||
do if (ptr) { \
|
||||
int _n = (long) &((ptr)->name##_end) \
|
||||
do { \
|
||||
int _n; \
|
||||
\
|
||||
if (!ptr) \
|
||||
break; \
|
||||
\
|
||||
_n = (long) &((ptr)->name##_end) \
|
||||
- (long) &((ptr)->name##_begin); \
|
||||
BUILD_BUG_ON(_n < 0); \
|
||||
MAYBE_BUILD_BUG_ON(_n < 0); \
|
||||
\
|
||||
kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
|
||||
} while (0)
|
||||
|
||||
79
include/linux/ksm.h
Normal file
79
include/linux/ksm.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef __LINUX_KSM_H
|
||||
#define __LINUX_KSM_H
|
||||
/*
|
||||
* Memory merging support.
|
||||
*
|
||||
* This code enables dynamic sharing of identical pages found in different
|
||||
* memory areas, even if they are not shared by fork().
|
||||
*/
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/vmstat.h>
|
||||
|
||||
#ifdef CONFIG_KSM
|
||||
int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, int advice, unsigned long *vm_flags);
|
||||
int __ksm_enter(struct mm_struct *mm);
|
||||
void __ksm_exit(struct mm_struct *mm);
|
||||
|
||||
static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
{
|
||||
if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags))
|
||||
return __ksm_enter(mm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ksm_exit(struct mm_struct *mm)
|
||||
{
|
||||
if (test_bit(MMF_VM_MERGEABLE, &mm->flags))
|
||||
__ksm_exit(mm);
|
||||
}
|
||||
|
||||
/*
|
||||
* A KSM page is one of those write-protected "shared pages" or "merged pages"
|
||||
* which KSM maps into multiple mms, wherever identical anonymous page content
|
||||
* is found in VM_MERGEABLE vmas. It's a PageAnon page, with NULL anon_vma.
|
||||
*/
|
||||
static inline int PageKsm(struct page *page)
|
||||
{
|
||||
return ((unsigned long)page->mapping == PAGE_MAPPING_ANON);
|
||||
}
|
||||
|
||||
/*
|
||||
* But we have to avoid the checking which page_add_anon_rmap() performs.
|
||||
*/
|
||||
static inline void page_add_ksm_rmap(struct page *page)
|
||||
{
|
||||
if (atomic_inc_and_test(&page->_mapcount)) {
|
||||
page->mapping = (void *) PAGE_MAPPING_ANON;
|
||||
__inc_zone_page_state(page, NR_ANON_PAGES);
|
||||
}
|
||||
}
|
||||
#else /* !CONFIG_KSM */
|
||||
|
||||
static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, int advice, unsigned long *vm_flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ksm_exit(struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int PageKsm(struct page *page)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No stub required for page_add_ksm_rmap(page) */
|
||||
#endif /* !CONFIG_KSM */
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/marker.h>
|
||||
#include <linux/msi.h>
|
||||
#include <asm/signal.h>
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ struct ps2dev {
|
||||
void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
|
||||
int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
|
||||
void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
|
||||
void ps2_begin_command(struct ps2dev *ps2dev);
|
||||
void ps2_end_command(struct ps2dev *ps2dev);
|
||||
int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
|
||||
int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
|
||||
int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#ifndef LINKER_SCRIPT
|
||||
#define ALIGN __ALIGN
|
||||
#define ALIGN_STR __ALIGN_STR
|
||||
|
||||
@@ -66,6 +67,7 @@
|
||||
ALIGN; \
|
||||
name:
|
||||
#endif
|
||||
#endif /* LINKER_SCRIPT */
|
||||
|
||||
#ifndef WEAK
|
||||
#define WEAK(name) \
|
||||
|
||||
@@ -32,8 +32,17 @@ struct lis3lv02d_platform_data {
|
||||
#define LIS3_IRQ2_DATA_READY (4 << 3)
|
||||
#define LIS3_IRQ2_CLICK (7 << 3)
|
||||
#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
|
||||
#define LIS3_IRQ_ACTIVE_HIGH (1 << 7)
|
||||
#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
|
||||
unsigned char irq_cfg;
|
||||
|
||||
#define LIS3_WAKEUP_X_LO (1 << 0)
|
||||
#define LIS3_WAKEUP_X_HI (1 << 1)
|
||||
#define LIS3_WAKEUP_Y_LO (1 << 2)
|
||||
#define LIS3_WAKEUP_Y_HI (1 << 3)
|
||||
#define LIS3_WAKEUP_Z_LO (1 << 4)
|
||||
#define LIS3_WAKEUP_Z_HI (1 << 5)
|
||||
unsigned char wakeup_flags;
|
||||
unsigned char wakeup_thresh;
|
||||
};
|
||||
|
||||
#endif /* __LIS3LV02D_H_ */
|
||||
|
||||
@@ -338,49 +338,6 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp)
|
||||
}
|
||||
}
|
||||
|
||||
static inline int __nlm_cmp_addr4(const struct sockaddr *sap1,
|
||||
const struct sockaddr *sap2)
|
||||
{
|
||||
const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1;
|
||||
const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2;
|
||||
return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
|
||||
const struct sockaddr *sap2)
|
||||
{
|
||||
const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1;
|
||||
const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
|
||||
return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
|
||||
}
|
||||
#else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
|
||||
static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
|
||||
const struct sockaddr *sap2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
|
||||
|
||||
/*
|
||||
* Compare two host addresses
|
||||
*
|
||||
* Return TRUE if the addresses are the same; otherwise FALSE.
|
||||
*/
|
||||
static inline int nlm_cmp_addr(const struct sockaddr *sap1,
|
||||
const struct sockaddr *sap2)
|
||||
{
|
||||
if (sap1->sa_family == sap2->sa_family) {
|
||||
switch (sap1->sa_family) {
|
||||
case AF_INET:
|
||||
return __nlm_cmp_addr4(sap1, sap2);
|
||||
case AF_INET6:
|
||||
return __nlm_cmp_addr6(sap1, sap2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare two NLM locks.
|
||||
* When the second lock is of type F_UNLCK, this acts like a wildcard.
|
||||
@@ -395,7 +352,7 @@ static inline int nlm_compare_locks(const struct file_lock *fl1,
|
||||
&&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK);
|
||||
}
|
||||
|
||||
extern struct lock_manager_operations nlmsvc_lock_operations;
|
||||
extern const struct lock_manager_operations nlmsvc_lock_operations;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
#define DL_UNITDATA_IND 0x3108
|
||||
#define DL_INFORMATION_IND 0x0008
|
||||
|
||||
/* intern layer 2 managment */
|
||||
/* intern layer 2 management */
|
||||
#define MDL_ASSIGN_REQ 0x1804
|
||||
#define MDL_ASSIGN_IND 0x1904
|
||||
#define MDL_REMOVE_REQ 0x1A04
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
#define SYSFS_MAGIC 0x62656572
|
||||
#define SECURITYFS_MAGIC 0x73636673
|
||||
#define SELINUX_MAGIC 0xf97cff8c
|
||||
#define RAMFS_MAGIC 0x858458f6 /* some random number */
|
||||
#define TMPFS_MAGIC 0x01021994
|
||||
#define HUGETLBFS_MAGIC 0x958458f6 /* some random number */
|
||||
#define SQUASHFS_MAGIC 0x73717368
|
||||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
#define EXT2_SUPER_MAGIC 0xEF53
|
||||
@@ -53,4 +55,8 @@
|
||||
#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
|
||||
|
||||
#define STACK_END_MAGIC 0x57AC6E9D
|
||||
|
||||
#define DEVPTS_SUPER_MAGIC 0x1cd1
|
||||
#define SOCKFS_MAGIC 0x534F434B
|
||||
|
||||
#endif /* __LINUX_MAGIC_H__ */
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
#ifndef _LINUX_MARKER_H
|
||||
#define _LINUX_MARKER_H
|
||||
|
||||
/*
|
||||
* Code markup for dynamic and static tracing.
|
||||
*
|
||||
* See Documentation/marker.txt.
|
||||
*
|
||||
* (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
* See the file COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct module;
|
||||
struct marker;
|
||||
|
||||
/**
|
||||
* marker_probe_func - Type of a marker probe function
|
||||
* @probe_private: probe private data
|
||||
* @call_private: call site private data
|
||||
* @fmt: format string
|
||||
* @args: variable argument list pointer. Use a pointer to overcome C's
|
||||
* inability to pass this around as a pointer in a portable manner in
|
||||
* the callee otherwise.
|
||||
*
|
||||
* Type of marker probe functions. They receive the mdata and need to parse the
|
||||
* format string to recover the variable argument list.
|
||||
*/
|
||||
typedef void marker_probe_func(void *probe_private, void *call_private,
|
||||
const char *fmt, va_list *args);
|
||||
|
||||
struct marker_probe_closure {
|
||||
marker_probe_func *func; /* Callback */
|
||||
void *probe_private; /* Private probe data */
|
||||
};
|
||||
|
||||
struct marker {
|
||||
const char *name; /* Marker name */
|
||||
const char *format; /* Marker format string, describing the
|
||||
* variable argument list.
|
||||
*/
|
||||
char state; /* Marker state. */
|
||||
char ptype; /* probe type : 0 : single, 1 : multi */
|
||||
/* Probe wrapper */
|
||||
void (*call)(const struct marker *mdata, void *call_private, ...);
|
||||
struct marker_probe_closure single;
|
||||
struct marker_probe_closure *multi;
|
||||
const char *tp_name; /* Optional tracepoint name */
|
||||
void *tp_cb; /* Optional tracepoint callback */
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
#ifdef CONFIG_MARKERS
|
||||
|
||||
#define _DEFINE_MARKER(name, tp_name_str, tp_cb, format) \
|
||||
static const char __mstrtab_##name[] \
|
||||
__attribute__((section("__markers_strings"))) \
|
||||
= #name "\0" format; \
|
||||
static struct marker __mark_##name \
|
||||
__attribute__((section("__markers"), aligned(8))) = \
|
||||
{ __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \
|
||||
0, 0, marker_probe_cb, { __mark_empty_function, NULL},\
|
||||
NULL, tp_name_str, tp_cb }
|
||||
|
||||
#define DEFINE_MARKER(name, format) \
|
||||
_DEFINE_MARKER(name, NULL, NULL, format)
|
||||
|
||||
#define DEFINE_MARKER_TP(name, tp_name, tp_cb, format) \
|
||||
_DEFINE_MARKER(name, #tp_name, tp_cb, format)
|
||||
|
||||
/*
|
||||
* Note : the empty asm volatile with read constraint is used here instead of a
|
||||
* "used" attribute to fix a gcc 4.1.x bug.
|
||||
* Make sure the alignment of the structure in the __markers section will
|
||||
* not add unwanted padding between the beginning of the section and the
|
||||
* structure. Force alignment to the same alignment as the section start.
|
||||
*
|
||||
* The "generic" argument controls which marker enabling mechanism must be used.
|
||||
* If generic is true, a variable read is used.
|
||||
* If generic is false, immediate values are used.
|
||||
*/
|
||||
#define __trace_mark(generic, name, call_private, format, args...) \
|
||||
do { \
|
||||
DEFINE_MARKER(name, format); \
|
||||
__mark_check_format(format, ## args); \
|
||||
if (unlikely(__mark_##name.state)) { \
|
||||
(*__mark_##name.call) \
|
||||
(&__mark_##name, call_private, ## args);\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \
|
||||
do { \
|
||||
void __check_tp_type(void) \
|
||||
{ \
|
||||
register_trace_##tp_name(tp_cb); \
|
||||
} \
|
||||
DEFINE_MARKER_TP(name, tp_name, tp_cb, format); \
|
||||
__mark_check_format(format, ## args); \
|
||||
(*__mark_##name.call)(&__mark_##name, call_private, \
|
||||
## args); \
|
||||
} while (0)
|
||||
|
||||
extern void marker_update_probe_range(struct marker *begin,
|
||||
struct marker *end);
|
||||
|
||||
#define GET_MARKER(name) (__mark_##name)
|
||||
|
||||
#else /* !CONFIG_MARKERS */
|
||||
#define DEFINE_MARKER(name, tp_name, tp_cb, format)
|
||||
#define __trace_mark(generic, name, call_private, format, args...) \
|
||||
__mark_check_format(format, ## args)
|
||||
#define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \
|
||||
do { \
|
||||
void __check_tp_type(void) \
|
||||
{ \
|
||||
register_trace_##tp_name(tp_cb); \
|
||||
} \
|
||||
__mark_check_format(format, ## args); \
|
||||
} while (0)
|
||||
static inline void marker_update_probe_range(struct marker *begin,
|
||||
struct marker *end)
|
||||
{ }
|
||||
#define GET_MARKER(name)
|
||||
#endif /* CONFIG_MARKERS */
|
||||
|
||||
/**
|
||||
* trace_mark - Marker using code patching
|
||||
* @name: marker name, not quoted.
|
||||
* @format: format string
|
||||
* @args...: variable argument list
|
||||
*
|
||||
* Places a marker using optimized code patching technique (imv_read())
|
||||
* to be enabled when immediate values are present.
|
||||
*/
|
||||
#define trace_mark(name, format, args...) \
|
||||
__trace_mark(0, name, NULL, format, ## args)
|
||||
|
||||
/**
|
||||
* _trace_mark - Marker using variable read
|
||||
* @name: marker name, not quoted.
|
||||
* @format: format string
|
||||
* @args...: variable argument list
|
||||
*
|
||||
* Places a marker using a standard memory read (_imv_read()) to be
|
||||
* enabled. Should be used for markers in code paths where instruction
|
||||
* modification based enabling is not welcome. (__init and __exit functions,
|
||||
* lockdep, some traps, printk).
|
||||
*/
|
||||
#define _trace_mark(name, format, args...) \
|
||||
__trace_mark(1, name, NULL, format, ## args)
|
||||
|
||||
/**
|
||||
* trace_mark_tp - Marker in a tracepoint callback
|
||||
* @name: marker name, not quoted.
|
||||
* @tp_name: tracepoint name, not quoted.
|
||||
* @tp_cb: tracepoint callback. Should have an associated global symbol so it
|
||||
* is not optimized away by the compiler (should not be static).
|
||||
* @format: format string
|
||||
* @args...: variable argument list
|
||||
*
|
||||
* Places a marker in a tracepoint callback.
|
||||
*/
|
||||
#define trace_mark_tp(name, tp_name, tp_cb, format, args...) \
|
||||
__trace_mark_tp(name, NULL, tp_name, tp_cb, format, ## args)
|
||||
|
||||
/**
|
||||
* MARK_NOARGS - Format string for a marker with no argument.
|
||||
*/
|
||||
#define MARK_NOARGS " "
|
||||
|
||||
/* To be used for string format validity checking with gcc */
|
||||
static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...)
|
||||
{
|
||||
}
|
||||
|
||||
#define __mark_check_format(format, args...) \
|
||||
do { \
|
||||
if (0) \
|
||||
___mark_check_format(format, ## args); \
|
||||
} while (0)
|
||||
|
||||
extern marker_probe_func __mark_empty_function;
|
||||
|
||||
extern void marker_probe_cb(const struct marker *mdata,
|
||||
void *call_private, ...);
|
||||
|
||||
/*
|
||||
* Connect a probe to a marker.
|
||||
* private data pointer must be a valid allocated memory address, or NULL.
|
||||
*/
|
||||
extern int marker_probe_register(const char *name, const char *format,
|
||||
marker_probe_func *probe, void *probe_private);
|
||||
|
||||
/*
|
||||
* Returns the private data given to marker_probe_register.
|
||||
*/
|
||||
extern int marker_probe_unregister(const char *name,
|
||||
marker_probe_func *probe, void *probe_private);
|
||||
/*
|
||||
* Unregister a marker by providing the registered private data.
|
||||
*/
|
||||
extern int marker_probe_unregister_private_data(marker_probe_func *probe,
|
||||
void *probe_private);
|
||||
|
||||
extern void *marker_get_private_data(const char *name, marker_probe_func *probe,
|
||||
int num);
|
||||
|
||||
/*
|
||||
* marker_synchronize_unregister must be called between the last marker probe
|
||||
* unregistration and the first one of
|
||||
* - the end of module exit function
|
||||
* - the free of any resource used by the probes
|
||||
* to ensure the code and data are valid for any possibly running probes.
|
||||
*/
|
||||
#define marker_synchronize_unregister() synchronize_sched()
|
||||
|
||||
#endif
|
||||
@@ -118,6 +118,9 @@ static inline bool mem_cgroup_disabled(void)
|
||||
|
||||
extern bool mem_cgroup_oom_called(struct task_struct *task);
|
||||
void mem_cgroup_update_mapped_file_stat(struct page *page, int val);
|
||||
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
|
||||
gfp_t gfp_mask, int nid,
|
||||
int zid);
|
||||
#else /* CONFIG_CGROUP_MEM_RES_CTLR */
|
||||
struct mem_cgroup;
|
||||
|
||||
@@ -276,6 +279,13 @@ static inline void mem_cgroup_update_mapped_file_stat(struct page *page,
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
|
||||
gfp_t gfp_mask, int nid, int zid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CGROUP_MEM_CONT */
|
||||
|
||||
#endif /* _LINUX_MEMCONTROL_H */
|
||||
|
||||
@@ -191,14 +191,6 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
|
||||
|
||||
#endif /* ! CONFIG_MEMORY_HOTPLUG */
|
||||
|
||||
/*
|
||||
* Walk through all memory which is registered as resource.
|
||||
* arg is (start_pfn, nr_pages, private_arg_pointer)
|
||||
*/
|
||||
extern int walk_memory_resource(unsigned long start_pfn,
|
||||
unsigned long nr_pages, void *arg,
|
||||
int (*func)(unsigned long, unsigned long, void *));
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTREMOVE
|
||||
|
||||
extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
|
||||
|
||||
@@ -47,22 +47,16 @@ mempool_create_slab_pool(int min_nr, struct kmem_cache *kc)
|
||||
}
|
||||
|
||||
/*
|
||||
* 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree
|
||||
* the amount of memory specified by pool_data
|
||||
* a mempool_alloc_t and a mempool_free_t to kmalloc and kfree the
|
||||
* amount of memory specified by pool_data
|
||||
*/
|
||||
void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data);
|
||||
void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data);
|
||||
void mempool_kfree(void *element, void *pool_data);
|
||||
static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size)
|
||||
{
|
||||
return mempool_create(min_nr, mempool_kmalloc, mempool_kfree,
|
||||
(void *) size);
|
||||
}
|
||||
static inline mempool_t *mempool_create_kzalloc_pool(int min_nr, size_t size)
|
||||
{
|
||||
return mempool_create(min_nr, mempool_kzalloc, mempool_kfree,
|
||||
(void *) size);
|
||||
}
|
||||
|
||||
/*
|
||||
* A mempool_alloc_t and mempool_free_t for a simple page allocator that
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
|
||||
#ifndef MFD_AB3100_H
|
||||
#define MFD_AB3100_H
|
||||
@@ -56,6 +58,14 @@
|
||||
#define AB3100_STR_BATT_REMOVAL (0x40)
|
||||
#define AB3100_STR_VBUS (0x80)
|
||||
|
||||
/*
|
||||
* AB3100 contains 8 regulators, one external regulator controller
|
||||
* and a buck converter, further the LDO E and buck converter can
|
||||
* have separate settings if they are in sleep mode, this is
|
||||
* modeled as a separate regulator.
|
||||
*/
|
||||
#define AB3100_NUM_REGULATORS 10
|
||||
|
||||
/**
|
||||
* struct ab3100
|
||||
* @access_mutex: lock out concurrent accesses to the AB3100 registers
|
||||
@@ -86,11 +96,30 @@ struct ab3100 {
|
||||
bool startup_events_read;
|
||||
};
|
||||
|
||||
int ab3100_set_register(struct ab3100 *ab3100, u8 reg, u8 regval);
|
||||
int ab3100_get_register(struct ab3100 *ab3100, u8 reg, u8 *regval);
|
||||
int ab3100_get_register_page(struct ab3100 *ab3100,
|
||||
/**
|
||||
* struct ab3100_platform_data
|
||||
* Data supplied to initialize board connections to the AB3100
|
||||
* @reg_constraints: regulator constraints for target board
|
||||
* the order of these constraints are: LDO A, C, D, E,
|
||||
* F, G, H, K, EXT and BUCK.
|
||||
* @reg_initvals: initial values for the regulator registers
|
||||
* plus two sleep settings for LDO E and the BUCK converter.
|
||||
* exactly AB3100_NUM_REGULATORS+2 values must be sent in.
|
||||
* Order: LDO A, C, E, E sleep, F, G, H, K, EXT, BUCK,
|
||||
* BUCK sleep, LDO D. (LDO D need to be initialized last.)
|
||||
* @external_voltage: voltage level of the external regulator.
|
||||
*/
|
||||
struct ab3100_platform_data {
|
||||
struct regulator_init_data reg_constraints[AB3100_NUM_REGULATORS];
|
||||
u8 reg_initvals[AB3100_NUM_REGULATORS+2];
|
||||
int external_voltage;
|
||||
};
|
||||
|
||||
int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval);
|
||||
int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval);
|
||||
int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
|
||||
u8 first_reg, u8 *regvals, u8 numregs);
|
||||
int ab3100_mask_and_set_register(struct ab3100 *ab3100,
|
||||
int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
|
||||
u8 reg, u8 andmask, u8 ormask);
|
||||
u8 ab3100_get_chip_type(struct ab3100 *ab3100);
|
||||
int ab3100_event_register(struct ab3100 *ab3100,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
struct mfd_cell {
|
||||
const char *name;
|
||||
int id;
|
||||
|
||||
int (*enable)(struct platform_device *dev);
|
||||
int (*disable)(struct platform_device *dev);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __LINUX_PMIC_DA903X_H
|
||||
#define __LINUX_PMIC_DA903X_H
|
||||
|
||||
/* Unified sub device IDs for DA9030/DA9034 */
|
||||
/* Unified sub device IDs for DA9030/DA9034/DA9035 */
|
||||
enum {
|
||||
DA9030_ID_LED_1,
|
||||
DA9030_ID_LED_2,
|
||||
@@ -57,6 +57,8 @@ enum {
|
||||
DA9034_ID_LDO13,
|
||||
DA9034_ID_LDO14,
|
||||
DA9034_ID_LDO15,
|
||||
|
||||
DA9035_ID_BUCK3,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -25,9 +25,12 @@ struct pcap_chip;
|
||||
|
||||
int ezx_pcap_write(struct pcap_chip *, u8, u32);
|
||||
int ezx_pcap_read(struct pcap_chip *, u8, u32 *);
|
||||
int ezx_pcap_set_bits(struct pcap_chip *, u8, u32, u32);
|
||||
int pcap_to_irq(struct pcap_chip *, int);
|
||||
int irq_to_pcap(struct pcap_chip *, int);
|
||||
int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *);
|
||||
int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]);
|
||||
void pcap_set_ts_bits(struct pcap_chip *, u32);
|
||||
|
||||
#define PCAP_SECOND_PORT 1
|
||||
#define PCAP_CS_AH 2
|
||||
@@ -224,7 +227,6 @@ int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]);
|
||||
#define PCAP_LED1 1
|
||||
#define PCAP_BL0 2
|
||||
#define PCAP_BL1 3
|
||||
#define PCAP_VIB 4
|
||||
#define PCAP_LED_3MA 0
|
||||
#define PCAP_LED_4MA 1
|
||||
#define PCAP_LED_5MA 2
|
||||
@@ -243,9 +245,6 @@ int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]);
|
||||
#define PCAP_LED0_C_SHIFT 15
|
||||
#define PCAP_LED1_C_SHIFT 17
|
||||
#define PCAP_BL1_SHIFT 20
|
||||
#define PCAP_VIB_MASK 0x3
|
||||
#define PCAP_VIB_SHIFT 20
|
||||
#define PCAP_VIB_EN (1 << 19)
|
||||
|
||||
/* RTC */
|
||||
#define PCAP_RTC_DAY_MASK 0x3fff
|
||||
|
||||
396
include/linux/mfd/mc13783-private.h
Normal file
396
include/linux/mfd/mc13783-private.h
Normal file
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
* Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
|
||||
*
|
||||
* Initial development of this code was funded by
|
||||
* Phytec Messtechnik GmbH, http://www.phytec.de
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MFD_MC13783_PRIV_H
|
||||
#define __LINUX_MFD_MC13783_PRIV_H
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mfd/mc13783.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
struct mc13783_irq {
|
||||
void (*handler)(int, void *);
|
||||
void *data;
|
||||
};
|
||||
|
||||
#define MC13783_NUM_IRQ 2
|
||||
#define MC13783_IRQ_TS 0
|
||||
#define MC13783_IRQ_REGULATOR 1
|
||||
|
||||
#define MC13783_ADC_MODE_TS 1
|
||||
#define MC13783_ADC_MODE_SINGLE_CHAN 2
|
||||
#define MC13783_ADC_MODE_MULT_CHAN 3
|
||||
|
||||
struct mc13783 {
|
||||
int revision;
|
||||
struct device *dev;
|
||||
struct spi_device *spi_device;
|
||||
|
||||
int (*read_dev)(void *data, char reg, int count, u32 *dst);
|
||||
int (*write_dev)(void *data, char reg, int count, const u32 *src);
|
||||
|
||||
struct mutex io_lock;
|
||||
void *io_data;
|
||||
int irq;
|
||||
unsigned int flags;
|
||||
|
||||
struct mc13783_irq irq_handler[MC13783_NUM_IRQ];
|
||||
struct work_struct work;
|
||||
struct completion adc_done;
|
||||
unsigned int ts_active;
|
||||
struct mutex adc_conv_lock;
|
||||
|
||||
struct mc13783_regulator_init_data *regulators;
|
||||
int num_regulators;
|
||||
};
|
||||
|
||||
int mc13783_reg_read(struct mc13783 *, int reg_num, u32 *);
|
||||
int mc13783_reg_write(struct mc13783 *, int, u32);
|
||||
int mc13783_set_bits(struct mc13783 *, int, u32, u32);
|
||||
int mc13783_free_irq(struct mc13783 *mc13783, int irq);
|
||||
int mc13783_register_irq(struct mc13783 *mc13783, int irq,
|
||||
void (*handler) (int, void *), void *data);
|
||||
|
||||
#define MC13783_REG_INTERRUPT_STATUS_0 0
|
||||
#define MC13783_REG_INTERRUPT_MASK_0 1
|
||||
#define MC13783_REG_INTERRUPT_SENSE_0 2
|
||||
#define MC13783_REG_INTERRUPT_STATUS_1 3
|
||||
#define MC13783_REG_INTERRUPT_MASK_1 4
|
||||
#define MC13783_REG_INTERRUPT_SENSE_1 5
|
||||
#define MC13783_REG_POWER_UP_MODE_SENSE 6
|
||||
#define MC13783_REG_REVISION 7
|
||||
#define MC13783_REG_SEMAPHORE 8
|
||||
#define MC13783_REG_ARBITRATION_PERIPHERAL_AUDIO 9
|
||||
#define MC13783_REG_ARBITRATION_SWITCHERS 10
|
||||
#define MC13783_REG_ARBITRATION_REGULATORS_0 11
|
||||
#define MC13783_REG_ARBITRATION_REGULATORS_1 12
|
||||
#define MC13783_REG_POWER_CONTROL_0 13
|
||||
#define MC13783_REG_POWER_CONTROL_1 14
|
||||
#define MC13783_REG_POWER_CONTROL_2 15
|
||||
#define MC13783_REG_REGEN_ASSIGNMENT 16
|
||||
#define MC13783_REG_CONTROL_SPARE 17
|
||||
#define MC13783_REG_MEMORY_A 18
|
||||
#define MC13783_REG_MEMORY_B 19
|
||||
#define MC13783_REG_RTC_TIME 20
|
||||
#define MC13783_REG_RTC_ALARM 21
|
||||
#define MC13783_REG_RTC_DAY 22
|
||||
#define MC13783_REG_RTC_DAY_ALARM 23
|
||||
#define MC13783_REG_SWITCHERS_0 24
|
||||
#define MC13783_REG_SWITCHERS_1 25
|
||||
#define MC13783_REG_SWITCHERS_2 26
|
||||
#define MC13783_REG_SWITCHERS_3 27
|
||||
#define MC13783_REG_SWITCHERS_4 28
|
||||
#define MC13783_REG_SWITCHERS_5 29
|
||||
#define MC13783_REG_REGULATOR_SETTING_0 30
|
||||
#define MC13783_REG_REGULATOR_SETTING_1 31
|
||||
#define MC13783_REG_REGULATOR_MODE_0 32
|
||||
#define MC13783_REG_REGULATOR_MODE_1 33
|
||||
#define MC13783_REG_POWER_MISCELLANEOUS 34
|
||||
#define MC13783_REG_POWER_SPARE 35
|
||||
#define MC13783_REG_AUDIO_RX_0 36
|
||||
#define MC13783_REG_AUDIO_RX_1 37
|
||||
#define MC13783_REG_AUDIO_TX 38
|
||||
#define MC13783_REG_AUDIO_SSI_NETWORK 39
|
||||
#define MC13783_REG_AUDIO_CODEC 40
|
||||
#define MC13783_REG_AUDIO_STEREO_DAC 41
|
||||
#define MC13783_REG_AUDIO_SPARE 42
|
||||
#define MC13783_REG_ADC_0 43
|
||||
#define MC13783_REG_ADC_1 44
|
||||
#define MC13783_REG_ADC_2 45
|
||||
#define MC13783_REG_ADC_3 46
|
||||
#define MC13783_REG_ADC_4 47
|
||||
#define MC13783_REG_CHARGER 48
|
||||
#define MC13783_REG_USB 49
|
||||
#define MC13783_REG_CHARGE_USB_SPARE 50
|
||||
#define MC13783_REG_LED_CONTROL_0 51
|
||||
#define MC13783_REG_LED_CONTROL_1 52
|
||||
#define MC13783_REG_LED_CONTROL_2 53
|
||||
#define MC13783_REG_LED_CONTROL_3 54
|
||||
#define MC13783_REG_LED_CONTROL_4 55
|
||||
#define MC13783_REG_LED_CONTROL_5 56
|
||||
#define MC13783_REG_SPARE 57
|
||||
#define MC13783_REG_TRIM_0 58
|
||||
#define MC13783_REG_TRIM_1 59
|
||||
#define MC13783_REG_TEST_0 60
|
||||
#define MC13783_REG_TEST_1 61
|
||||
#define MC13783_REG_TEST_2 62
|
||||
#define MC13783_REG_TEST_3 63
|
||||
#define MC13783_REG_NB 64
|
||||
|
||||
|
||||
/*
|
||||
* Interrupt Status
|
||||
*/
|
||||
#define MC13783_INT_STAT_ADCDONEI (1 << 0)
|
||||
#define MC13783_INT_STAT_ADCBISDONEI (1 << 1)
|
||||
#define MC13783_INT_STAT_TSI (1 << 2)
|
||||
#define MC13783_INT_STAT_WHIGHI (1 << 3)
|
||||
#define MC13783_INT_STAT_WLOWI (1 << 4)
|
||||
#define MC13783_INT_STAT_CHGDETI (1 << 6)
|
||||
#define MC13783_INT_STAT_CHGOVI (1 << 7)
|
||||
#define MC13783_INT_STAT_CHGREVI (1 << 8)
|
||||
#define MC13783_INT_STAT_CHGSHORTI (1 << 9)
|
||||
#define MC13783_INT_STAT_CCCVI (1 << 10)
|
||||
#define MC13783_INT_STAT_CHGCURRI (1 << 11)
|
||||
#define MC13783_INT_STAT_BPONI (1 << 12)
|
||||
#define MC13783_INT_STAT_LOBATLI (1 << 13)
|
||||
#define MC13783_INT_STAT_LOBATHI (1 << 14)
|
||||
#define MC13783_INT_STAT_UDPI (1 << 15)
|
||||
#define MC13783_INT_STAT_USBI (1 << 16)
|
||||
#define MC13783_INT_STAT_IDI (1 << 19)
|
||||
#define MC13783_INT_STAT_Unused (1 << 20)
|
||||
#define MC13783_INT_STAT_SE1I (1 << 21)
|
||||
#define MC13783_INT_STAT_CKDETI (1 << 22)
|
||||
#define MC13783_INT_STAT_UDMI (1 << 23)
|
||||
|
||||
/*
|
||||
* Interrupt Mask
|
||||
*/
|
||||
#define MC13783_INT_MASK_ADCDONEM (1 << 0)
|
||||
#define MC13783_INT_MASK_ADCBISDONEM (1 << 1)
|
||||
#define MC13783_INT_MASK_TSM (1 << 2)
|
||||
#define MC13783_INT_MASK_WHIGHM (1 << 3)
|
||||
#define MC13783_INT_MASK_WLOWM (1 << 4)
|
||||
#define MC13783_INT_MASK_CHGDETM (1 << 6)
|
||||
#define MC13783_INT_MASK_CHGOVM (1 << 7)
|
||||
#define MC13783_INT_MASK_CHGREVM (1 << 8)
|
||||
#define MC13783_INT_MASK_CHGSHORTM (1 << 9)
|
||||
#define MC13783_INT_MASK_CCCVM (1 << 10)
|
||||
#define MC13783_INT_MASK_CHGCURRM (1 << 11)
|
||||
#define MC13783_INT_MASK_BPONM (1 << 12)
|
||||
#define MC13783_INT_MASK_LOBATLM (1 << 13)
|
||||
#define MC13783_INT_MASK_LOBATHM (1 << 14)
|
||||
#define MC13783_INT_MASK_UDPM (1 << 15)
|
||||
#define MC13783_INT_MASK_USBM (1 << 16)
|
||||
#define MC13783_INT_MASK_IDM (1 << 19)
|
||||
#define MC13783_INT_MASK_SE1M (1 << 21)
|
||||
#define MC13783_INT_MASK_CKDETM (1 << 22)
|
||||
|
||||
/*
|
||||
* Reg Regulator Mode 0
|
||||
*/
|
||||
#define MC13783_REGCTRL_VAUDIO_EN (1 << 0)
|
||||
#define MC13783_REGCTRL_VAUDIO_STBY (1 << 1)
|
||||
#define MC13783_REGCTRL_VAUDIO_MODE (1 << 2)
|
||||
#define MC13783_REGCTRL_VIOHI_EN (1 << 3)
|
||||
#define MC13783_REGCTRL_VIOHI_STBY (1 << 4)
|
||||
#define MC13783_REGCTRL_VIOHI_MODE (1 << 5)
|
||||
#define MC13783_REGCTRL_VIOLO_EN (1 << 6)
|
||||
#define MC13783_REGCTRL_VIOLO_STBY (1 << 7)
|
||||
#define MC13783_REGCTRL_VIOLO_MODE (1 << 8)
|
||||
#define MC13783_REGCTRL_VDIG_EN (1 << 9)
|
||||
#define MC13783_REGCTRL_VDIG_STBY (1 << 10)
|
||||
#define MC13783_REGCTRL_VDIG_MODE (1 << 11)
|
||||
#define MC13783_REGCTRL_VGEN_EN (1 << 12)
|
||||
#define MC13783_REGCTRL_VGEN_STBY (1 << 13)
|
||||
#define MC13783_REGCTRL_VGEN_MODE (1 << 14)
|
||||
#define MC13783_REGCTRL_VRFDIG_EN (1 << 15)
|
||||
#define MC13783_REGCTRL_VRFDIG_STBY (1 << 16)
|
||||
#define MC13783_REGCTRL_VRFDIG_MODE (1 << 17)
|
||||
#define MC13783_REGCTRL_VRFREF_EN (1 << 18)
|
||||
#define MC13783_REGCTRL_VRFREF_STBY (1 << 19)
|
||||
#define MC13783_REGCTRL_VRFREF_MODE (1 << 20)
|
||||
#define MC13783_REGCTRL_VRFCP_EN (1 << 21)
|
||||
#define MC13783_REGCTRL_VRFCP_STBY (1 << 22)
|
||||
#define MC13783_REGCTRL_VRFCP_MODE (1 << 23)
|
||||
|
||||
/*
|
||||
* Reg Regulator Mode 1
|
||||
*/
|
||||
#define MC13783_REGCTRL_VSIM_EN (1 << 0)
|
||||
#define MC13783_REGCTRL_VSIM_STBY (1 << 1)
|
||||
#define MC13783_REGCTRL_VSIM_MODE (1 << 2)
|
||||
#define MC13783_REGCTRL_VESIM_EN (1 << 3)
|
||||
#define MC13783_REGCTRL_VESIM_STBY (1 << 4)
|
||||
#define MC13783_REGCTRL_VESIM_MODE (1 << 5)
|
||||
#define MC13783_REGCTRL_VCAM_EN (1 << 6)
|
||||
#define MC13783_REGCTRL_VCAM_STBY (1 << 7)
|
||||
#define MC13783_REGCTRL_VCAM_MODE (1 << 8)
|
||||
#define MC13783_REGCTRL_VRFBG_EN (1 << 9)
|
||||
#define MC13783_REGCTRL_VRFBG_STBY (1 << 10)
|
||||
#define MC13783_REGCTRL_VVIB_EN (1 << 11)
|
||||
#define MC13783_REGCTRL_VRF1_EN (1 << 12)
|
||||
#define MC13783_REGCTRL_VRF1_STBY (1 << 13)
|
||||
#define MC13783_REGCTRL_VRF1_MODE (1 << 14)
|
||||
#define MC13783_REGCTRL_VRF2_EN (1 << 15)
|
||||
#define MC13783_REGCTRL_VRF2_STBY (1 << 16)
|
||||
#define MC13783_REGCTRL_VRF2_MODE (1 << 17)
|
||||
#define MC13783_REGCTRL_VMMC1_EN (1 << 18)
|
||||
#define MC13783_REGCTRL_VMMC1_STBY (1 << 19)
|
||||
#define MC13783_REGCTRL_VMMC1_MODE (1 << 20)
|
||||
#define MC13783_REGCTRL_VMMC2_EN (1 << 21)
|
||||
#define MC13783_REGCTRL_VMMC2_STBY (1 << 22)
|
||||
#define MC13783_REGCTRL_VMMC2_MODE (1 << 23)
|
||||
|
||||
/*
|
||||
* Reg Regulator Misc.
|
||||
*/
|
||||
#define MC13783_REGCTRL_GPO1_EN (1 << 6)
|
||||
#define MC13783_REGCTRL_GPO2_EN (1 << 8)
|
||||
#define MC13783_REGCTRL_GPO3_EN (1 << 10)
|
||||
#define MC13783_REGCTRL_GPO4_EN (1 << 12)
|
||||
#define MC13783_REGCTRL_VIBPINCTRL (1 << 14)
|
||||
|
||||
/*
|
||||
* Reg Switcher 4
|
||||
*/
|
||||
#define MC13783_SWCTRL_SW1A_MODE (1 << 0)
|
||||
#define MC13783_SWCTRL_SW1A_STBY_MODE (1 << 2)
|
||||
#define MC13783_SWCTRL_SW1A_DVS_SPEED (1 << 6)
|
||||
#define MC13783_SWCTRL_SW1A_PANIC_MODE (1 << 8)
|
||||
#define MC13783_SWCTRL_SW1A_SOFTSTART (1 << 9)
|
||||
#define MC13783_SWCTRL_SW1B_MODE (1 << 10)
|
||||
#define MC13783_SWCTRL_SW1B_STBY_MODE (1 << 12)
|
||||
#define MC13783_SWCTRL_SW1B_DVS_SPEED (1 << 14)
|
||||
#define MC13783_SWCTRL_SW1B_PANIC_MODE (1 << 16)
|
||||
#define MC13783_SWCTRL_SW1B_SOFTSTART (1 << 17)
|
||||
#define MC13783_SWCTRL_PLL_EN (1 << 18)
|
||||
#define MC13783_SWCTRL_PLL_FACTOR (1 << 19)
|
||||
|
||||
/*
|
||||
* Reg Switcher 5
|
||||
*/
|
||||
#define MC13783_SWCTRL_SW2A_MODE (1 << 0)
|
||||
#define MC13783_SWCTRL_SW2A_STBY_MODE (1 << 2)
|
||||
#define MC13783_SWCTRL_SW2A_DVS_SPEED (1 << 6)
|
||||
#define MC13783_SWCTRL_SW2A_PANIC_MODE (1 << 8)
|
||||
#define MC13783_SWCTRL_SW2A_SOFTSTART (1 << 9)
|
||||
#define MC13783_SWCTRL_SW2B_MODE (1 << 10)
|
||||
#define MC13783_SWCTRL_SW2B_STBY_MODE (1 << 12)
|
||||
#define MC13783_SWCTRL_SW2B_DVS_SPEED (1 << 14)
|
||||
#define MC13783_SWCTRL_SW2B_PANIC_MODE (1 << 16)
|
||||
#define MC13783_SWCTRL_SW2B_SOFTSTART (1 << 17)
|
||||
#define MC13783_SWSET_SW3 (1 << 18)
|
||||
#define MC13783_SWCTRL_SW3_EN (1 << 20)
|
||||
#define MC13783_SWCTRL_SW3_STBY (1 << 21)
|
||||
#define MC13783_SWCTRL_SW3_MODE (1 << 22)
|
||||
|
||||
/*
|
||||
* ADC/Touch
|
||||
*/
|
||||
#define MC13783_ADC0_LICELLCON (1 << 0)
|
||||
#define MC13783_ADC0_CHRGICON (1 << 1)
|
||||
#define MC13783_ADC0_BATICON (1 << 2)
|
||||
#define MC13783_ADC0_RTHEN (1 << 3)
|
||||
#define MC13783_ADC0_DTHEN (1 << 4)
|
||||
#define MC13783_ADC0_UIDEN (1 << 5)
|
||||
#define MC13783_ADC0_ADOUTEN (1 << 6)
|
||||
#define MC13783_ADC0_ADOUTPER (1 << 7)
|
||||
#define MC13783_ADC0_ADREFEN (1 << 10)
|
||||
#define MC13783_ADC0_ADREFMODE (1 << 11)
|
||||
#define MC13783_ADC0_TSMOD0 (1 << 12)
|
||||
#define MC13783_ADC0_TSMOD1 (1 << 13)
|
||||
#define MC13783_ADC0_TSMOD2 (1 << 14)
|
||||
#define MC13783_ADC0_CHRGRAWDIV (1 << 15)
|
||||
#define MC13783_ADC0_ADINC1 (1 << 16)
|
||||
#define MC13783_ADC0_ADINC2 (1 << 17)
|
||||
#define MC13783_ADC0_WCOMP (1 << 18)
|
||||
#define MC13783_ADC0_ADCBIS0 (1 << 23)
|
||||
|
||||
#define MC13783_ADC1_ADEN (1 << 0)
|
||||
#define MC13783_ADC1_RAND (1 << 1)
|
||||
#define MC13783_ADC1_ADSEL (1 << 3)
|
||||
#define MC13783_ADC1_TRIGMASK (1 << 4)
|
||||
#define MC13783_ADC1_ADA10 (1 << 5)
|
||||
#define MC13783_ADC1_ADA11 (1 << 6)
|
||||
#define MC13783_ADC1_ADA12 (1 << 7)
|
||||
#define MC13783_ADC1_ADA20 (1 << 8)
|
||||
#define MC13783_ADC1_ADA21 (1 << 9)
|
||||
#define MC13783_ADC1_ADA22 (1 << 10)
|
||||
#define MC13783_ADC1_ATO0 (1 << 11)
|
||||
#define MC13783_ADC1_ATO1 (1 << 12)
|
||||
#define MC13783_ADC1_ATO2 (1 << 13)
|
||||
#define MC13783_ADC1_ATO3 (1 << 14)
|
||||
#define MC13783_ADC1_ATO4 (1 << 15)
|
||||
#define MC13783_ADC1_ATO5 (1 << 16)
|
||||
#define MC13783_ADC1_ATO6 (1 << 17)
|
||||
#define MC13783_ADC1_ATO7 (1 << 18)
|
||||
#define MC13783_ADC1_ATOX (1 << 19)
|
||||
#define MC13783_ADC1_ASC (1 << 20)
|
||||
#define MC13783_ADC1_ADTRIGIGN (1 << 21)
|
||||
#define MC13783_ADC1_ADONESHOT (1 << 22)
|
||||
#define MC13783_ADC1_ADCBIS1 (1 << 23)
|
||||
|
||||
#define MC13783_ADC1_CHAN0_SHIFT 5
|
||||
#define MC13783_ADC1_CHAN1_SHIFT 8
|
||||
|
||||
#define MC13783_ADC2_ADD10 (1 << 2)
|
||||
#define MC13783_ADC2_ADD11 (1 << 3)
|
||||
#define MC13783_ADC2_ADD12 (1 << 4)
|
||||
#define MC13783_ADC2_ADD13 (1 << 5)
|
||||
#define MC13783_ADC2_ADD14 (1 << 6)
|
||||
#define MC13783_ADC2_ADD15 (1 << 7)
|
||||
#define MC13783_ADC2_ADD16 (1 << 8)
|
||||
#define MC13783_ADC2_ADD17 (1 << 9)
|
||||
#define MC13783_ADC2_ADD18 (1 << 10)
|
||||
#define MC13783_ADC2_ADD19 (1 << 11)
|
||||
#define MC13783_ADC2_ADD20 (1 << 14)
|
||||
#define MC13783_ADC2_ADD21 (1 << 15)
|
||||
#define MC13783_ADC2_ADD22 (1 << 16)
|
||||
#define MC13783_ADC2_ADD23 (1 << 17)
|
||||
#define MC13783_ADC2_ADD24 (1 << 18)
|
||||
#define MC13783_ADC2_ADD25 (1 << 19)
|
||||
#define MC13783_ADC2_ADD26 (1 << 20)
|
||||
#define MC13783_ADC2_ADD27 (1 << 21)
|
||||
#define MC13783_ADC2_ADD28 (1 << 22)
|
||||
#define MC13783_ADC2_ADD29 (1 << 23)
|
||||
|
||||
#define MC13783_ADC3_WHIGH0 (1 << 0)
|
||||
#define MC13783_ADC3_WHIGH1 (1 << 1)
|
||||
#define MC13783_ADC3_WHIGH2 (1 << 2)
|
||||
#define MC13783_ADC3_WHIGH3 (1 << 3)
|
||||
#define MC13783_ADC3_WHIGH4 (1 << 4)
|
||||
#define MC13783_ADC3_WHIGH5 (1 << 5)
|
||||
#define MC13783_ADC3_ICID0 (1 << 6)
|
||||
#define MC13783_ADC3_ICID1 (1 << 7)
|
||||
#define MC13783_ADC3_ICID2 (1 << 8)
|
||||
#define MC13783_ADC3_WLOW0 (1 << 9)
|
||||
#define MC13783_ADC3_WLOW1 (1 << 10)
|
||||
#define MC13783_ADC3_WLOW2 (1 << 11)
|
||||
#define MC13783_ADC3_WLOW3 (1 << 12)
|
||||
#define MC13783_ADC3_WLOW4 (1 << 13)
|
||||
#define MC13783_ADC3_WLOW5 (1 << 14)
|
||||
#define MC13783_ADC3_ADCBIS2 (1 << 23)
|
||||
|
||||
#define MC13783_ADC4_ADDBIS10 (1 << 2)
|
||||
#define MC13783_ADC4_ADDBIS11 (1 << 3)
|
||||
#define MC13783_ADC4_ADDBIS12 (1 << 4)
|
||||
#define MC13783_ADC4_ADDBIS13 (1 << 5)
|
||||
#define MC13783_ADC4_ADDBIS14 (1 << 6)
|
||||
#define MC13783_ADC4_ADDBIS15 (1 << 7)
|
||||
#define MC13783_ADC4_ADDBIS16 (1 << 8)
|
||||
#define MC13783_ADC4_ADDBIS17 (1 << 9)
|
||||
#define MC13783_ADC4_ADDBIS18 (1 << 10)
|
||||
#define MC13783_ADC4_ADDBIS19 (1 << 11)
|
||||
#define MC13783_ADC4_ADDBIS20 (1 << 14)
|
||||
#define MC13783_ADC4_ADDBIS21 (1 << 15)
|
||||
#define MC13783_ADC4_ADDBIS22 (1 << 16)
|
||||
#define MC13783_ADC4_ADDBIS23 (1 << 17)
|
||||
#define MC13783_ADC4_ADDBIS24 (1 << 18)
|
||||
#define MC13783_ADC4_ADDBIS25 (1 << 19)
|
||||
#define MC13783_ADC4_ADDBIS26 (1 << 20)
|
||||
#define MC13783_ADC4_ADDBIS27 (1 << 21)
|
||||
#define MC13783_ADC4_ADDBIS28 (1 << 22)
|
||||
#define MC13783_ADC4_ADDBIS29 (1 << 23)
|
||||
|
||||
#endif /* __LINUX_MFD_MC13783_PRIV_H */
|
||||
|
||||
84
include/linux/mfd/mc13783.h
Normal file
84
include/linux/mfd/mc13783.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
|
||||
*
|
||||
* Initial development of this code was funded by
|
||||
* Phytec Messtechnik GmbH, http://www.phytec.de
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_LINUX_MFD_MC13783_H
|
||||
#define __INCLUDE_LINUX_MFD_MC13783_H
|
||||
|
||||
struct mc13783;
|
||||
struct regulator_init_data;
|
||||
|
||||
struct mc13783_regulator_init_data {
|
||||
int id;
|
||||
struct regulator_init_data *init_data;
|
||||
};
|
||||
|
||||
struct mc13783_platform_data {
|
||||
struct mc13783_regulator_init_data *regulators;
|
||||
int num_regulators;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
/* mc13783_platform_data flags */
|
||||
#define MC13783_USE_TOUCHSCREEN (1 << 0)
|
||||
#define MC13783_USE_CODEC (1 << 1)
|
||||
#define MC13783_USE_ADC (1 << 2)
|
||||
#define MC13783_USE_RTC (1 << 3)
|
||||
#define MC13783_USE_REGULATOR (1 << 4)
|
||||
|
||||
int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
|
||||
unsigned int channel, unsigned int *sample);
|
||||
|
||||
void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status);
|
||||
|
||||
#define MC13783_SW_SW1A 0
|
||||
#define MC13783_SW_SW1B 1
|
||||
#define MC13783_SW_SW2A 2
|
||||
#define MC13783_SW_SW2B 3
|
||||
#define MC13783_SW_SW3 4
|
||||
#define MC13783_SW_PLL 5
|
||||
#define MC13783_REGU_VAUDIO 6
|
||||
#define MC13783_REGU_VIOHI 7
|
||||
#define MC13783_REGU_VIOLO 8
|
||||
#define MC13783_REGU_VDIG 9
|
||||
#define MC13783_REGU_VGEN 10
|
||||
#define MC13783_REGU_VRFDIG 11
|
||||
#define MC13783_REGU_VRFREF 12
|
||||
#define MC13783_REGU_VRFCP 13
|
||||
#define MC13783_REGU_VSIM 14
|
||||
#define MC13783_REGU_VESIM 15
|
||||
#define MC13783_REGU_VCAM 16
|
||||
#define MC13783_REGU_VRFBG 17
|
||||
#define MC13783_REGU_VVIB 18
|
||||
#define MC13783_REGU_VRF1 19
|
||||
#define MC13783_REGU_VRF2 20
|
||||
#define MC13783_REGU_VMMC1 21
|
||||
#define MC13783_REGU_VMMC2 22
|
||||
#define MC13783_REGU_GPO1 23
|
||||
#define MC13783_REGU_GPO2 24
|
||||
#define MC13783_REGU_GPO3 25
|
||||
#define MC13783_REGU_GPO4 26
|
||||
#define MC13783_REGU_V1 27
|
||||
#define MC13783_REGU_V2 28
|
||||
#define MC13783_REGU_V3 29
|
||||
#define MC13783_REGU_V4 30
|
||||
|
||||
#endif /* __INCLUDE_LINUX_MFD_MC13783_H */
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
#define PCF50633_REG_ADCS3 0x57
|
||||
|
||||
#define PCF50633_ADCC1_ADCSTART 0x01
|
||||
#define PCF50633_ADCC1_RES_10BIT 0x02
|
||||
#define PCF50633_ADCC1_RES_8BIT 0x02
|
||||
#define PCF50633_ADCC1_RES_10BIT 0x00
|
||||
#define PCF50633_ADCC1_AVERAGE_NO 0x00
|
||||
#define PCF50633_ADCC1_AVERAGE_4 0x04
|
||||
#define PCF50633_ADCC1_AVERAGE_8 0x08
|
||||
|
||||
@@ -136,6 +136,7 @@ struct pcf50633 {
|
||||
int irq;
|
||||
struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ];
|
||||
struct work_struct irq_work;
|
||||
struct workqueue_struct *work_queue;
|
||||
struct mutex lock;
|
||||
|
||||
u8 mask_regs[5];
|
||||
|
||||
216
include/linux/mfd/wm831x/auxadc.h
Normal file
216
include/linux/mfd/wm831x/auxadc.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/auxadc.h -- Auxiliary ADC interface for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_AUXADC_H__
|
||||
#define __MFD_WM831X_AUXADC_H__
|
||||
|
||||
/*
|
||||
* R16429 (0x402D) - AuxADC Data
|
||||
*/
|
||||
#define WM831X_AUX_DATA_SRC_MASK 0xF000 /* AUX_DATA_SRC - [15:12] */
|
||||
#define WM831X_AUX_DATA_SRC_SHIFT 12 /* AUX_DATA_SRC - [15:12] */
|
||||
#define WM831X_AUX_DATA_SRC_WIDTH 4 /* AUX_DATA_SRC - [15:12] */
|
||||
#define WM831X_AUX_DATA_MASK 0x0FFF /* AUX_DATA - [11:0] */
|
||||
#define WM831X_AUX_DATA_SHIFT 0 /* AUX_DATA - [11:0] */
|
||||
#define WM831X_AUX_DATA_WIDTH 12 /* AUX_DATA - [11:0] */
|
||||
|
||||
/*
|
||||
* R16430 (0x402E) - AuxADC Control
|
||||
*/
|
||||
#define WM831X_AUX_ENA 0x8000 /* AUX_ENA */
|
||||
#define WM831X_AUX_ENA_MASK 0x8000 /* AUX_ENA */
|
||||
#define WM831X_AUX_ENA_SHIFT 15 /* AUX_ENA */
|
||||
#define WM831X_AUX_ENA_WIDTH 1 /* AUX_ENA */
|
||||
#define WM831X_AUX_CVT_ENA 0x4000 /* AUX_CVT_ENA */
|
||||
#define WM831X_AUX_CVT_ENA_MASK 0x4000 /* AUX_CVT_ENA */
|
||||
#define WM831X_AUX_CVT_ENA_SHIFT 14 /* AUX_CVT_ENA */
|
||||
#define WM831X_AUX_CVT_ENA_WIDTH 1 /* AUX_CVT_ENA */
|
||||
#define WM831X_AUX_SLPENA 0x1000 /* AUX_SLPENA */
|
||||
#define WM831X_AUX_SLPENA_MASK 0x1000 /* AUX_SLPENA */
|
||||
#define WM831X_AUX_SLPENA_SHIFT 12 /* AUX_SLPENA */
|
||||
#define WM831X_AUX_SLPENA_WIDTH 1 /* AUX_SLPENA */
|
||||
#define WM831X_AUX_FRC_ENA 0x0800 /* AUX_FRC_ENA */
|
||||
#define WM831X_AUX_FRC_ENA_MASK 0x0800 /* AUX_FRC_ENA */
|
||||
#define WM831X_AUX_FRC_ENA_SHIFT 11 /* AUX_FRC_ENA */
|
||||
#define WM831X_AUX_FRC_ENA_WIDTH 1 /* AUX_FRC_ENA */
|
||||
#define WM831X_AUX_RATE_MASK 0x003F /* AUX_RATE - [5:0] */
|
||||
#define WM831X_AUX_RATE_SHIFT 0 /* AUX_RATE - [5:0] */
|
||||
#define WM831X_AUX_RATE_WIDTH 6 /* AUX_RATE - [5:0] */
|
||||
|
||||
/*
|
||||
* R16431 (0x402F) - AuxADC Source
|
||||
*/
|
||||
#define WM831X_AUX_CAL_SEL 0x8000 /* AUX_CAL_SEL */
|
||||
#define WM831X_AUX_CAL_SEL_MASK 0x8000 /* AUX_CAL_SEL */
|
||||
#define WM831X_AUX_CAL_SEL_SHIFT 15 /* AUX_CAL_SEL */
|
||||
#define WM831X_AUX_CAL_SEL_WIDTH 1 /* AUX_CAL_SEL */
|
||||
#define WM831X_AUX_BKUP_BATT_SEL 0x0400 /* AUX_BKUP_BATT_SEL */
|
||||
#define WM831X_AUX_BKUP_BATT_SEL_MASK 0x0400 /* AUX_BKUP_BATT_SEL */
|
||||
#define WM831X_AUX_BKUP_BATT_SEL_SHIFT 10 /* AUX_BKUP_BATT_SEL */
|
||||
#define WM831X_AUX_BKUP_BATT_SEL_WIDTH 1 /* AUX_BKUP_BATT_SEL */
|
||||
#define WM831X_AUX_WALL_SEL 0x0200 /* AUX_WALL_SEL */
|
||||
#define WM831X_AUX_WALL_SEL_MASK 0x0200 /* AUX_WALL_SEL */
|
||||
#define WM831X_AUX_WALL_SEL_SHIFT 9 /* AUX_WALL_SEL */
|
||||
#define WM831X_AUX_WALL_SEL_WIDTH 1 /* AUX_WALL_SEL */
|
||||
#define WM831X_AUX_BATT_SEL 0x0100 /* AUX_BATT_SEL */
|
||||
#define WM831X_AUX_BATT_SEL_MASK 0x0100 /* AUX_BATT_SEL */
|
||||
#define WM831X_AUX_BATT_SEL_SHIFT 8 /* AUX_BATT_SEL */
|
||||
#define WM831X_AUX_BATT_SEL_WIDTH 1 /* AUX_BATT_SEL */
|
||||
#define WM831X_AUX_USB_SEL 0x0080 /* AUX_USB_SEL */
|
||||
#define WM831X_AUX_USB_SEL_MASK 0x0080 /* AUX_USB_SEL */
|
||||
#define WM831X_AUX_USB_SEL_SHIFT 7 /* AUX_USB_SEL */
|
||||
#define WM831X_AUX_USB_SEL_WIDTH 1 /* AUX_USB_SEL */
|
||||
#define WM831X_AUX_SYSVDD_SEL 0x0040 /* AUX_SYSVDD_SEL */
|
||||
#define WM831X_AUX_SYSVDD_SEL_MASK 0x0040 /* AUX_SYSVDD_SEL */
|
||||
#define WM831X_AUX_SYSVDD_SEL_SHIFT 6 /* AUX_SYSVDD_SEL */
|
||||
#define WM831X_AUX_SYSVDD_SEL_WIDTH 1 /* AUX_SYSVDD_SEL */
|
||||
#define WM831X_AUX_BATT_TEMP_SEL 0x0020 /* AUX_BATT_TEMP_SEL */
|
||||
#define WM831X_AUX_BATT_TEMP_SEL_MASK 0x0020 /* AUX_BATT_TEMP_SEL */
|
||||
#define WM831X_AUX_BATT_TEMP_SEL_SHIFT 5 /* AUX_BATT_TEMP_SEL */
|
||||
#define WM831X_AUX_BATT_TEMP_SEL_WIDTH 1 /* AUX_BATT_TEMP_SEL */
|
||||
#define WM831X_AUX_CHIP_TEMP_SEL 0x0010 /* AUX_CHIP_TEMP_SEL */
|
||||
#define WM831X_AUX_CHIP_TEMP_SEL_MASK 0x0010 /* AUX_CHIP_TEMP_SEL */
|
||||
#define WM831X_AUX_CHIP_TEMP_SEL_SHIFT 4 /* AUX_CHIP_TEMP_SEL */
|
||||
#define WM831X_AUX_CHIP_TEMP_SEL_WIDTH 1 /* AUX_CHIP_TEMP_SEL */
|
||||
#define WM831X_AUX_AUX4_SEL 0x0008 /* AUX_AUX4_SEL */
|
||||
#define WM831X_AUX_AUX4_SEL_MASK 0x0008 /* AUX_AUX4_SEL */
|
||||
#define WM831X_AUX_AUX4_SEL_SHIFT 3 /* AUX_AUX4_SEL */
|
||||
#define WM831X_AUX_AUX4_SEL_WIDTH 1 /* AUX_AUX4_SEL */
|
||||
#define WM831X_AUX_AUX3_SEL 0x0004 /* AUX_AUX3_SEL */
|
||||
#define WM831X_AUX_AUX3_SEL_MASK 0x0004 /* AUX_AUX3_SEL */
|
||||
#define WM831X_AUX_AUX3_SEL_SHIFT 2 /* AUX_AUX3_SEL */
|
||||
#define WM831X_AUX_AUX3_SEL_WIDTH 1 /* AUX_AUX3_SEL */
|
||||
#define WM831X_AUX_AUX2_SEL 0x0002 /* AUX_AUX2_SEL */
|
||||
#define WM831X_AUX_AUX2_SEL_MASK 0x0002 /* AUX_AUX2_SEL */
|
||||
#define WM831X_AUX_AUX2_SEL_SHIFT 1 /* AUX_AUX2_SEL */
|
||||
#define WM831X_AUX_AUX2_SEL_WIDTH 1 /* AUX_AUX2_SEL */
|
||||
#define WM831X_AUX_AUX1_SEL 0x0001 /* AUX_AUX1_SEL */
|
||||
#define WM831X_AUX_AUX1_SEL_MASK 0x0001 /* AUX_AUX1_SEL */
|
||||
#define WM831X_AUX_AUX1_SEL_SHIFT 0 /* AUX_AUX1_SEL */
|
||||
#define WM831X_AUX_AUX1_SEL_WIDTH 1 /* AUX_AUX1_SEL */
|
||||
|
||||
/*
|
||||
* R16432 (0x4030) - Comparator Control
|
||||
*/
|
||||
#define WM831X_DCOMP4_STS 0x0800 /* DCOMP4_STS */
|
||||
#define WM831X_DCOMP4_STS_MASK 0x0800 /* DCOMP4_STS */
|
||||
#define WM831X_DCOMP4_STS_SHIFT 11 /* DCOMP4_STS */
|
||||
#define WM831X_DCOMP4_STS_WIDTH 1 /* DCOMP4_STS */
|
||||
#define WM831X_DCOMP3_STS 0x0400 /* DCOMP3_STS */
|
||||
#define WM831X_DCOMP3_STS_MASK 0x0400 /* DCOMP3_STS */
|
||||
#define WM831X_DCOMP3_STS_SHIFT 10 /* DCOMP3_STS */
|
||||
#define WM831X_DCOMP3_STS_WIDTH 1 /* DCOMP3_STS */
|
||||
#define WM831X_DCOMP2_STS 0x0200 /* DCOMP2_STS */
|
||||
#define WM831X_DCOMP2_STS_MASK 0x0200 /* DCOMP2_STS */
|
||||
#define WM831X_DCOMP2_STS_SHIFT 9 /* DCOMP2_STS */
|
||||
#define WM831X_DCOMP2_STS_WIDTH 1 /* DCOMP2_STS */
|
||||
#define WM831X_DCOMP1_STS 0x0100 /* DCOMP1_STS */
|
||||
#define WM831X_DCOMP1_STS_MASK 0x0100 /* DCOMP1_STS */
|
||||
#define WM831X_DCOMP1_STS_SHIFT 8 /* DCOMP1_STS */
|
||||
#define WM831X_DCOMP1_STS_WIDTH 1 /* DCOMP1_STS */
|
||||
#define WM831X_DCMP4_ENA 0x0008 /* DCMP4_ENA */
|
||||
#define WM831X_DCMP4_ENA_MASK 0x0008 /* DCMP4_ENA */
|
||||
#define WM831X_DCMP4_ENA_SHIFT 3 /* DCMP4_ENA */
|
||||
#define WM831X_DCMP4_ENA_WIDTH 1 /* DCMP4_ENA */
|
||||
#define WM831X_DCMP3_ENA 0x0004 /* DCMP3_ENA */
|
||||
#define WM831X_DCMP3_ENA_MASK 0x0004 /* DCMP3_ENA */
|
||||
#define WM831X_DCMP3_ENA_SHIFT 2 /* DCMP3_ENA */
|
||||
#define WM831X_DCMP3_ENA_WIDTH 1 /* DCMP3_ENA */
|
||||
#define WM831X_DCMP2_ENA 0x0002 /* DCMP2_ENA */
|
||||
#define WM831X_DCMP2_ENA_MASK 0x0002 /* DCMP2_ENA */
|
||||
#define WM831X_DCMP2_ENA_SHIFT 1 /* DCMP2_ENA */
|
||||
#define WM831X_DCMP2_ENA_WIDTH 1 /* DCMP2_ENA */
|
||||
#define WM831X_DCMP1_ENA 0x0001 /* DCMP1_ENA */
|
||||
#define WM831X_DCMP1_ENA_MASK 0x0001 /* DCMP1_ENA */
|
||||
#define WM831X_DCMP1_ENA_SHIFT 0 /* DCMP1_ENA */
|
||||
#define WM831X_DCMP1_ENA_WIDTH 1 /* DCMP1_ENA */
|
||||
|
||||
/*
|
||||
* R16433 (0x4031) - Comparator 1
|
||||
*/
|
||||
#define WM831X_DCMP1_SRC_MASK 0xE000 /* DCMP1_SRC - [15:13] */
|
||||
#define WM831X_DCMP1_SRC_SHIFT 13 /* DCMP1_SRC - [15:13] */
|
||||
#define WM831X_DCMP1_SRC_WIDTH 3 /* DCMP1_SRC - [15:13] */
|
||||
#define WM831X_DCMP1_GT 0x1000 /* DCMP1_GT */
|
||||
#define WM831X_DCMP1_GT_MASK 0x1000 /* DCMP1_GT */
|
||||
#define WM831X_DCMP1_GT_SHIFT 12 /* DCMP1_GT */
|
||||
#define WM831X_DCMP1_GT_WIDTH 1 /* DCMP1_GT */
|
||||
#define WM831X_DCMP1_THR_MASK 0x0FFF /* DCMP1_THR - [11:0] */
|
||||
#define WM831X_DCMP1_THR_SHIFT 0 /* DCMP1_THR - [11:0] */
|
||||
#define WM831X_DCMP1_THR_WIDTH 12 /* DCMP1_THR - [11:0] */
|
||||
|
||||
/*
|
||||
* R16434 (0x4032) - Comparator 2
|
||||
*/
|
||||
#define WM831X_DCMP2_SRC_MASK 0xE000 /* DCMP2_SRC - [15:13] */
|
||||
#define WM831X_DCMP2_SRC_SHIFT 13 /* DCMP2_SRC - [15:13] */
|
||||
#define WM831X_DCMP2_SRC_WIDTH 3 /* DCMP2_SRC - [15:13] */
|
||||
#define WM831X_DCMP2_GT 0x1000 /* DCMP2_GT */
|
||||
#define WM831X_DCMP2_GT_MASK 0x1000 /* DCMP2_GT */
|
||||
#define WM831X_DCMP2_GT_SHIFT 12 /* DCMP2_GT */
|
||||
#define WM831X_DCMP2_GT_WIDTH 1 /* DCMP2_GT */
|
||||
#define WM831X_DCMP2_THR_MASK 0x0FFF /* DCMP2_THR - [11:0] */
|
||||
#define WM831X_DCMP2_THR_SHIFT 0 /* DCMP2_THR - [11:0] */
|
||||
#define WM831X_DCMP2_THR_WIDTH 12 /* DCMP2_THR - [11:0] */
|
||||
|
||||
/*
|
||||
* R16435 (0x4033) - Comparator 3
|
||||
*/
|
||||
#define WM831X_DCMP3_SRC_MASK 0xE000 /* DCMP3_SRC - [15:13] */
|
||||
#define WM831X_DCMP3_SRC_SHIFT 13 /* DCMP3_SRC - [15:13] */
|
||||
#define WM831X_DCMP3_SRC_WIDTH 3 /* DCMP3_SRC - [15:13] */
|
||||
#define WM831X_DCMP3_GT 0x1000 /* DCMP3_GT */
|
||||
#define WM831X_DCMP3_GT_MASK 0x1000 /* DCMP3_GT */
|
||||
#define WM831X_DCMP3_GT_SHIFT 12 /* DCMP3_GT */
|
||||
#define WM831X_DCMP3_GT_WIDTH 1 /* DCMP3_GT */
|
||||
#define WM831X_DCMP3_THR_MASK 0x0FFF /* DCMP3_THR - [11:0] */
|
||||
#define WM831X_DCMP3_THR_SHIFT 0 /* DCMP3_THR - [11:0] */
|
||||
#define WM831X_DCMP3_THR_WIDTH 12 /* DCMP3_THR - [11:0] */
|
||||
|
||||
/*
|
||||
* R16436 (0x4034) - Comparator 4
|
||||
*/
|
||||
#define WM831X_DCMP4_SRC_MASK 0xE000 /* DCMP4_SRC - [15:13] */
|
||||
#define WM831X_DCMP4_SRC_SHIFT 13 /* DCMP4_SRC - [15:13] */
|
||||
#define WM831X_DCMP4_SRC_WIDTH 3 /* DCMP4_SRC - [15:13] */
|
||||
#define WM831X_DCMP4_GT 0x1000 /* DCMP4_GT */
|
||||
#define WM831X_DCMP4_GT_MASK 0x1000 /* DCMP4_GT */
|
||||
#define WM831X_DCMP4_GT_SHIFT 12 /* DCMP4_GT */
|
||||
#define WM831X_DCMP4_GT_WIDTH 1 /* DCMP4_GT */
|
||||
#define WM831X_DCMP4_THR_MASK 0x0FFF /* DCMP4_THR - [11:0] */
|
||||
#define WM831X_DCMP4_THR_SHIFT 0 /* DCMP4_THR - [11:0] */
|
||||
#define WM831X_DCMP4_THR_WIDTH 12 /* DCMP4_THR - [11:0] */
|
||||
|
||||
#define WM831X_AUX_CAL_FACTOR 0xfff
|
||||
#define WM831X_AUX_CAL_NOMINAL 0x222
|
||||
|
||||
enum wm831x_auxadc {
|
||||
WM831X_AUX_CAL = 15,
|
||||
WM831X_AUX_BKUP_BATT = 10,
|
||||
WM831X_AUX_WALL = 9,
|
||||
WM831X_AUX_BATT = 8,
|
||||
WM831X_AUX_USB = 7,
|
||||
WM831X_AUX_SYSVDD = 6,
|
||||
WM831X_AUX_BATT_TEMP = 5,
|
||||
WM831X_AUX_CHIP_TEMP = 4,
|
||||
WM831X_AUX_AUX4 = 3,
|
||||
WM831X_AUX_AUX3 = 2,
|
||||
WM831X_AUX_AUX2 = 1,
|
||||
WM831X_AUX_AUX1 = 0,
|
||||
};
|
||||
|
||||
int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input);
|
||||
int wm831x_auxadc_read_uv(struct wm831x *wm831x, enum wm831x_auxadc input);
|
||||
|
||||
#endif
|
||||
289
include/linux/mfd/wm831x/core.h
Normal file
289
include/linux/mfd/wm831x/core.h
Normal file
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/core.h -- Core interface for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_CORE_H__
|
||||
#define __MFD_WM831X_CORE_H__
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
/*
|
||||
* Register values.
|
||||
*/
|
||||
#define WM831X_RESET_ID 0x00
|
||||
#define WM831X_REVISION 0x01
|
||||
#define WM831X_PARENT_ID 0x4000
|
||||
#define WM831X_SYSVDD_CONTROL 0x4001
|
||||
#define WM831X_THERMAL_MONITORING 0x4002
|
||||
#define WM831X_POWER_STATE 0x4003
|
||||
#define WM831X_WATCHDOG 0x4004
|
||||
#define WM831X_ON_PIN_CONTROL 0x4005
|
||||
#define WM831X_RESET_CONTROL 0x4006
|
||||
#define WM831X_CONTROL_INTERFACE 0x4007
|
||||
#define WM831X_SECURITY_KEY 0x4008
|
||||
#define WM831X_SOFTWARE_SCRATCH 0x4009
|
||||
#define WM831X_OTP_CONTROL 0x400A
|
||||
#define WM831X_GPIO_LEVEL 0x400C
|
||||
#define WM831X_SYSTEM_STATUS 0x400D
|
||||
#define WM831X_ON_SOURCE 0x400E
|
||||
#define WM831X_OFF_SOURCE 0x400F
|
||||
#define WM831X_SYSTEM_INTERRUPTS 0x4010
|
||||
#define WM831X_INTERRUPT_STATUS_1 0x4011
|
||||
#define WM831X_INTERRUPT_STATUS_2 0x4012
|
||||
#define WM831X_INTERRUPT_STATUS_3 0x4013
|
||||
#define WM831X_INTERRUPT_STATUS_4 0x4014
|
||||
#define WM831X_INTERRUPT_STATUS_5 0x4015
|
||||
#define WM831X_IRQ_CONFIG 0x4017
|
||||
#define WM831X_SYSTEM_INTERRUPTS_MASK 0x4018
|
||||
#define WM831X_INTERRUPT_STATUS_1_MASK 0x4019
|
||||
#define WM831X_INTERRUPT_STATUS_2_MASK 0x401A
|
||||
#define WM831X_INTERRUPT_STATUS_3_MASK 0x401B
|
||||
#define WM831X_INTERRUPT_STATUS_4_MASK 0x401C
|
||||
#define WM831X_INTERRUPT_STATUS_5_MASK 0x401D
|
||||
#define WM831X_RTC_WRITE_COUNTER 0x4020
|
||||
#define WM831X_RTC_TIME_1 0x4021
|
||||
#define WM831X_RTC_TIME_2 0x4022
|
||||
#define WM831X_RTC_ALARM_1 0x4023
|
||||
#define WM831X_RTC_ALARM_2 0x4024
|
||||
#define WM831X_RTC_CONTROL 0x4025
|
||||
#define WM831X_RTC_TRIM 0x4026
|
||||
#define WM831X_TOUCH_CONTROL_1 0x4028
|
||||
#define WM831X_TOUCH_CONTROL_2 0x4029
|
||||
#define WM831X_TOUCH_DATA_X 0x402A
|
||||
#define WM831X_TOUCH_DATA_Y 0x402B
|
||||
#define WM831X_TOUCH_DATA_Z 0x402C
|
||||
#define WM831X_AUXADC_DATA 0x402D
|
||||
#define WM831X_AUXADC_CONTROL 0x402E
|
||||
#define WM831X_AUXADC_SOURCE 0x402F
|
||||
#define WM831X_COMPARATOR_CONTROL 0x4030
|
||||
#define WM831X_COMPARATOR_1 0x4031
|
||||
#define WM831X_COMPARATOR_2 0x4032
|
||||
#define WM831X_COMPARATOR_3 0x4033
|
||||
#define WM831X_COMPARATOR_4 0x4034
|
||||
#define WM831X_GPIO1_CONTROL 0x4038
|
||||
#define WM831X_GPIO2_CONTROL 0x4039
|
||||
#define WM831X_GPIO3_CONTROL 0x403A
|
||||
#define WM831X_GPIO4_CONTROL 0x403B
|
||||
#define WM831X_GPIO5_CONTROL 0x403C
|
||||
#define WM831X_GPIO6_CONTROL 0x403D
|
||||
#define WM831X_GPIO7_CONTROL 0x403E
|
||||
#define WM831X_GPIO8_CONTROL 0x403F
|
||||
#define WM831X_GPIO9_CONTROL 0x4040
|
||||
#define WM831X_GPIO10_CONTROL 0x4041
|
||||
#define WM831X_GPIO11_CONTROL 0x4042
|
||||
#define WM831X_GPIO12_CONTROL 0x4043
|
||||
#define WM831X_GPIO13_CONTROL 0x4044
|
||||
#define WM831X_GPIO14_CONTROL 0x4045
|
||||
#define WM831X_GPIO15_CONTROL 0x4046
|
||||
#define WM831X_GPIO16_CONTROL 0x4047
|
||||
#define WM831X_CHARGER_CONTROL_1 0x4048
|
||||
#define WM831X_CHARGER_CONTROL_2 0x4049
|
||||
#define WM831X_CHARGER_STATUS 0x404A
|
||||
#define WM831X_BACKUP_CHARGER_CONTROL 0x404B
|
||||
#define WM831X_STATUS_LED_1 0x404C
|
||||
#define WM831X_STATUS_LED_2 0x404D
|
||||
#define WM831X_CURRENT_SINK_1 0x404E
|
||||
#define WM831X_CURRENT_SINK_2 0x404F
|
||||
#define WM831X_DCDC_ENABLE 0x4050
|
||||
#define WM831X_LDO_ENABLE 0x4051
|
||||
#define WM831X_DCDC_STATUS 0x4052
|
||||
#define WM831X_LDO_STATUS 0x4053
|
||||
#define WM831X_DCDC_UV_STATUS 0x4054
|
||||
#define WM831X_LDO_UV_STATUS 0x4055
|
||||
#define WM831X_DC1_CONTROL_1 0x4056
|
||||
#define WM831X_DC1_CONTROL_2 0x4057
|
||||
#define WM831X_DC1_ON_CONFIG 0x4058
|
||||
#define WM831X_DC1_SLEEP_CONTROL 0x4059
|
||||
#define WM831X_DC1_DVS_CONTROL 0x405A
|
||||
#define WM831X_DC2_CONTROL_1 0x405B
|
||||
#define WM831X_DC2_CONTROL_2 0x405C
|
||||
#define WM831X_DC2_ON_CONFIG 0x405D
|
||||
#define WM831X_DC2_SLEEP_CONTROL 0x405E
|
||||
#define WM831X_DC2_DVS_CONTROL 0x405F
|
||||
#define WM831X_DC3_CONTROL_1 0x4060
|
||||
#define WM831X_DC3_CONTROL_2 0x4061
|
||||
#define WM831X_DC3_ON_CONFIG 0x4062
|
||||
#define WM831X_DC3_SLEEP_CONTROL 0x4063
|
||||
#define WM831X_DC4_CONTROL 0x4064
|
||||
#define WM831X_DC4_SLEEP_CONTROL 0x4065
|
||||
#define WM831X_EPE1_CONTROL 0x4066
|
||||
#define WM831X_EPE2_CONTROL 0x4067
|
||||
#define WM831X_LDO1_CONTROL 0x4068
|
||||
#define WM831X_LDO1_ON_CONTROL 0x4069
|
||||
#define WM831X_LDO1_SLEEP_CONTROL 0x406A
|
||||
#define WM831X_LDO2_CONTROL 0x406B
|
||||
#define WM831X_LDO2_ON_CONTROL 0x406C
|
||||
#define WM831X_LDO2_SLEEP_CONTROL 0x406D
|
||||
#define WM831X_LDO3_CONTROL 0x406E
|
||||
#define WM831X_LDO3_ON_CONTROL 0x406F
|
||||
#define WM831X_LDO3_SLEEP_CONTROL 0x4070
|
||||
#define WM831X_LDO4_CONTROL 0x4071
|
||||
#define WM831X_LDO4_ON_CONTROL 0x4072
|
||||
#define WM831X_LDO4_SLEEP_CONTROL 0x4073
|
||||
#define WM831X_LDO5_CONTROL 0x4074
|
||||
#define WM831X_LDO5_ON_CONTROL 0x4075
|
||||
#define WM831X_LDO5_SLEEP_CONTROL 0x4076
|
||||
#define WM831X_LDO6_CONTROL 0x4077
|
||||
#define WM831X_LDO6_ON_CONTROL 0x4078
|
||||
#define WM831X_LDO6_SLEEP_CONTROL 0x4079
|
||||
#define WM831X_LDO7_CONTROL 0x407A
|
||||
#define WM831X_LDO7_ON_CONTROL 0x407B
|
||||
#define WM831X_LDO7_SLEEP_CONTROL 0x407C
|
||||
#define WM831X_LDO8_CONTROL 0x407D
|
||||
#define WM831X_LDO8_ON_CONTROL 0x407E
|
||||
#define WM831X_LDO8_SLEEP_CONTROL 0x407F
|
||||
#define WM831X_LDO9_CONTROL 0x4080
|
||||
#define WM831X_LDO9_ON_CONTROL 0x4081
|
||||
#define WM831X_LDO9_SLEEP_CONTROL 0x4082
|
||||
#define WM831X_LDO10_CONTROL 0x4083
|
||||
#define WM831X_LDO10_ON_CONTROL 0x4084
|
||||
#define WM831X_LDO10_SLEEP_CONTROL 0x4085
|
||||
#define WM831X_LDO11_ON_CONTROL 0x4087
|
||||
#define WM831X_LDO11_SLEEP_CONTROL 0x4088
|
||||
#define WM831X_POWER_GOOD_SOURCE_1 0x408E
|
||||
#define WM831X_POWER_GOOD_SOURCE_2 0x408F
|
||||
#define WM831X_CLOCK_CONTROL_1 0x4090
|
||||
#define WM831X_CLOCK_CONTROL_2 0x4091
|
||||
#define WM831X_FLL_CONTROL_1 0x4092
|
||||
#define WM831X_FLL_CONTROL_2 0x4093
|
||||
#define WM831X_FLL_CONTROL_3 0x4094
|
||||
#define WM831X_FLL_CONTROL_4 0x4095
|
||||
#define WM831X_FLL_CONTROL_5 0x4096
|
||||
#define WM831X_UNIQUE_ID_1 0x7800
|
||||
#define WM831X_UNIQUE_ID_2 0x7801
|
||||
#define WM831X_UNIQUE_ID_3 0x7802
|
||||
#define WM831X_UNIQUE_ID_4 0x7803
|
||||
#define WM831X_UNIQUE_ID_5 0x7804
|
||||
#define WM831X_UNIQUE_ID_6 0x7805
|
||||
#define WM831X_UNIQUE_ID_7 0x7806
|
||||
#define WM831X_UNIQUE_ID_8 0x7807
|
||||
#define WM831X_FACTORY_OTP_ID 0x7808
|
||||
#define WM831X_FACTORY_OTP_1 0x7809
|
||||
#define WM831X_FACTORY_OTP_2 0x780A
|
||||
#define WM831X_FACTORY_OTP_3 0x780B
|
||||
#define WM831X_FACTORY_OTP_4 0x780C
|
||||
#define WM831X_FACTORY_OTP_5 0x780D
|
||||
#define WM831X_CUSTOMER_OTP_ID 0x7810
|
||||
#define WM831X_DC1_OTP_CONTROL 0x7811
|
||||
#define WM831X_DC2_OTP_CONTROL 0x7812
|
||||
#define WM831X_DC3_OTP_CONTROL 0x7813
|
||||
#define WM831X_LDO1_2_OTP_CONTROL 0x7814
|
||||
#define WM831X_LDO3_4_OTP_CONTROL 0x7815
|
||||
#define WM831X_LDO5_6_OTP_CONTROL 0x7816
|
||||
#define WM831X_LDO7_8_OTP_CONTROL 0x7817
|
||||
#define WM831X_LDO9_10_OTP_CONTROL 0x7818
|
||||
#define WM831X_LDO11_EPE_CONTROL 0x7819
|
||||
#define WM831X_GPIO1_OTP_CONTROL 0x781A
|
||||
#define WM831X_GPIO2_OTP_CONTROL 0x781B
|
||||
#define WM831X_GPIO3_OTP_CONTROL 0x781C
|
||||
#define WM831X_GPIO4_OTP_CONTROL 0x781D
|
||||
#define WM831X_GPIO5_OTP_CONTROL 0x781E
|
||||
#define WM831X_GPIO6_OTP_CONTROL 0x781F
|
||||
#define WM831X_DBE_CHECK_DATA 0x7827
|
||||
|
||||
/*
|
||||
* R0 (0x00) - Reset ID
|
||||
*/
|
||||
#define WM831X_CHIP_ID_MASK 0xFFFF /* CHIP_ID - [15:0] */
|
||||
#define WM831X_CHIP_ID_SHIFT 0 /* CHIP_ID - [15:0] */
|
||||
#define WM831X_CHIP_ID_WIDTH 16 /* CHIP_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R1 (0x01) - Revision
|
||||
*/
|
||||
#define WM831X_PARENT_REV_MASK 0xFF00 /* PARENT_REV - [15:8] */
|
||||
#define WM831X_PARENT_REV_SHIFT 8 /* PARENT_REV - [15:8] */
|
||||
#define WM831X_PARENT_REV_WIDTH 8 /* PARENT_REV - [15:8] */
|
||||
#define WM831X_CHILD_REV_MASK 0x00FF /* CHILD_REV - [7:0] */
|
||||
#define WM831X_CHILD_REV_SHIFT 0 /* CHILD_REV - [7:0] */
|
||||
#define WM831X_CHILD_REV_WIDTH 8 /* CHILD_REV - [7:0] */
|
||||
|
||||
/*
|
||||
* R16384 (0x4000) - Parent ID
|
||||
*/
|
||||
#define WM831X_PARENT_ID_MASK 0xFFFF /* PARENT_ID - [15:0] */
|
||||
#define WM831X_PARENT_ID_SHIFT 0 /* PARENT_ID - [15:0] */
|
||||
#define WM831X_PARENT_ID_WIDTH 16 /* PARENT_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R16389 (0x4005) - ON Pin Control
|
||||
*/
|
||||
#define WM831X_ON_PIN_SECACT_MASK 0x0300 /* ON_PIN_SECACT - [9:8] */
|
||||
#define WM831X_ON_PIN_SECACT_SHIFT 8 /* ON_PIN_SECACT - [9:8] */
|
||||
#define WM831X_ON_PIN_SECACT_WIDTH 2 /* ON_PIN_SECACT - [9:8] */
|
||||
#define WM831X_ON_PIN_PRIMACT_MASK 0x0030 /* ON_PIN_PRIMACT - [5:4] */
|
||||
#define WM831X_ON_PIN_PRIMACT_SHIFT 4 /* ON_PIN_PRIMACT - [5:4] */
|
||||
#define WM831X_ON_PIN_PRIMACT_WIDTH 2 /* ON_PIN_PRIMACT - [5:4] */
|
||||
#define WM831X_ON_PIN_STS 0x0008 /* ON_PIN_STS */
|
||||
#define WM831X_ON_PIN_STS_MASK 0x0008 /* ON_PIN_STS */
|
||||
#define WM831X_ON_PIN_STS_SHIFT 3 /* ON_PIN_STS */
|
||||
#define WM831X_ON_PIN_STS_WIDTH 1 /* ON_PIN_STS */
|
||||
#define WM831X_ON_PIN_TO_MASK 0x0003 /* ON_PIN_TO - [1:0] */
|
||||
#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */
|
||||
#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */
|
||||
|
||||
struct regulator_dev;
|
||||
|
||||
struct wm831x {
|
||||
struct mutex io_lock;
|
||||
|
||||
struct device *dev;
|
||||
int (*read_dev)(struct wm831x *wm831x, unsigned short reg,
|
||||
int bytes, void *dest);
|
||||
int (*write_dev)(struct wm831x *wm831x, unsigned short reg,
|
||||
int bytes, void *src);
|
||||
|
||||
void *control_data;
|
||||
|
||||
int irq; /* Our chip IRQ */
|
||||
struct mutex irq_lock;
|
||||
struct workqueue_struct *irq_wq;
|
||||
struct work_struct irq_work;
|
||||
unsigned int irq_base;
|
||||
int irq_masks[5];
|
||||
|
||||
struct mutex auxadc_lock;
|
||||
|
||||
/* The WM831x has a security key blocking access to certain
|
||||
* registers. The mutex is taken by the accessors for locking
|
||||
* and unlocking the security key, locked is used to fail
|
||||
* writes if the lock is held.
|
||||
*/
|
||||
struct mutex key_lock;
|
||||
unsigned int locked:1;
|
||||
};
|
||||
|
||||
/* Device I/O API */
|
||||
int wm831x_reg_read(struct wm831x *wm831x, unsigned short reg);
|
||||
int wm831x_reg_write(struct wm831x *wm831x, unsigned short reg,
|
||||
unsigned short val);
|
||||
void wm831x_reg_lock(struct wm831x *wm831x);
|
||||
int wm831x_reg_unlock(struct wm831x *wm831x);
|
||||
int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
|
||||
unsigned short mask, unsigned short val);
|
||||
int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
|
||||
int count, u16 *buf);
|
||||
|
||||
int wm831x_irq_init(struct wm831x *wm831x, int irq);
|
||||
void wm831x_irq_exit(struct wm831x *wm831x);
|
||||
|
||||
int __must_check wm831x_request_irq(struct wm831x *wm831x,
|
||||
unsigned int irq, irq_handler_t handler,
|
||||
unsigned long flags, const char *name,
|
||||
void *dev);
|
||||
void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *);
|
||||
void wm831x_disable_irq(struct wm831x *wm831x, int irq);
|
||||
void wm831x_enable_irq(struct wm831x *wm831x, int irq);
|
||||
|
||||
#endif
|
||||
55
include/linux/mfd/wm831x/gpio.h
Normal file
55
include/linux/mfd/wm831x/gpio.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/gpio.h -- GPIO for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_GPIO_H__
|
||||
#define __MFD_WM831X_GPIO_H__
|
||||
|
||||
/*
|
||||
* R16440-16455 (0x4038-0x4047) - GPIOx Control
|
||||
*/
|
||||
#define WM831X_GPN_DIR 0x8000 /* GPN_DIR */
|
||||
#define WM831X_GPN_DIR_MASK 0x8000 /* GPN_DIR */
|
||||
#define WM831X_GPN_DIR_SHIFT 15 /* GPN_DIR */
|
||||
#define WM831X_GPN_DIR_WIDTH 1 /* GPN_DIR */
|
||||
#define WM831X_GPN_PULL_MASK 0x6000 /* GPN_PULL - [14:13] */
|
||||
#define WM831X_GPN_PULL_SHIFT 13 /* GPN_PULL - [14:13] */
|
||||
#define WM831X_GPN_PULL_WIDTH 2 /* GPN_PULL - [14:13] */
|
||||
#define WM831X_GPN_INT_MODE 0x1000 /* GPN_INT_MODE */
|
||||
#define WM831X_GPN_INT_MODE_MASK 0x1000 /* GPN_INT_MODE */
|
||||
#define WM831X_GPN_INT_MODE_SHIFT 12 /* GPN_INT_MODE */
|
||||
#define WM831X_GPN_INT_MODE_WIDTH 1 /* GPN_INT_MODE */
|
||||
#define WM831X_GPN_PWR_DOM 0x0800 /* GPN_PWR_DOM */
|
||||
#define WM831X_GPN_PWR_DOM_MASK 0x0800 /* GPN_PWR_DOM */
|
||||
#define WM831X_GPN_PWR_DOM_SHIFT 11 /* GPN_PWR_DOM */
|
||||
#define WM831X_GPN_PWR_DOM_WIDTH 1 /* GPN_PWR_DOM */
|
||||
#define WM831X_GPN_POL 0x0400 /* GPN_POL */
|
||||
#define WM831X_GPN_POL_MASK 0x0400 /* GPN_POL */
|
||||
#define WM831X_GPN_POL_SHIFT 10 /* GPN_POL */
|
||||
#define WM831X_GPN_POL_WIDTH 1 /* GPN_POL */
|
||||
#define WM831X_GPN_OD 0x0200 /* GPN_OD */
|
||||
#define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */
|
||||
#define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */
|
||||
#define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */
|
||||
#define WM831X_GPN_TRI 0x0080 /* GPN_TRI */
|
||||
#define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */
|
||||
#define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */
|
||||
#define WM831X_GPN_TRI_WIDTH 1 /* GPN_TRI */
|
||||
#define WM831X_GPN_FN_MASK 0x000F /* GPN_FN - [3:0] */
|
||||
#define WM831X_GPN_FN_SHIFT 0 /* GPN_FN - [3:0] */
|
||||
#define WM831X_GPN_FN_WIDTH 4 /* GPN_FN - [3:0] */
|
||||
|
||||
#define WM831X_GPIO_PULL_NONE (0 << WM831X_GPN_PULL_SHIFT)
|
||||
#define WM831X_GPIO_PULL_DOWN (1 << WM831X_GPN_PULL_SHIFT)
|
||||
#define WM831X_GPIO_PULL_UP (2 << WM831X_GPN_PULL_SHIFT)
|
||||
#endif
|
||||
764
include/linux/mfd/wm831x/irq.h
Normal file
764
include/linux/mfd/wm831x/irq.h
Normal file
@@ -0,0 +1,764 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/irq.h -- Interrupt controller for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_IRQ_H__
|
||||
#define __MFD_WM831X_IRQ_H__
|
||||
|
||||
/* Interrupt number assignments within Linux */
|
||||
#define WM831X_IRQ_TEMP_THW 0
|
||||
#define WM831X_IRQ_GPIO_1 1
|
||||
#define WM831X_IRQ_GPIO_2 2
|
||||
#define WM831X_IRQ_GPIO_3 3
|
||||
#define WM831X_IRQ_GPIO_4 4
|
||||
#define WM831X_IRQ_GPIO_5 5
|
||||
#define WM831X_IRQ_GPIO_6 6
|
||||
#define WM831X_IRQ_GPIO_7 7
|
||||
#define WM831X_IRQ_GPIO_8 8
|
||||
#define WM831X_IRQ_GPIO_9 9
|
||||
#define WM831X_IRQ_GPIO_10 10
|
||||
#define WM831X_IRQ_GPIO_11 11
|
||||
#define WM831X_IRQ_GPIO_12 12
|
||||
#define WM831X_IRQ_GPIO_13 13
|
||||
#define WM831X_IRQ_GPIO_14 14
|
||||
#define WM831X_IRQ_GPIO_15 15
|
||||
#define WM831X_IRQ_GPIO_16 16
|
||||
#define WM831X_IRQ_ON 17
|
||||
#define WM831X_IRQ_PPM_SYSLO 18
|
||||
#define WM831X_IRQ_PPM_PWR_SRC 19
|
||||
#define WM831X_IRQ_PPM_USB_CURR 20
|
||||
#define WM831X_IRQ_WDOG_TO 21
|
||||
#define WM831X_IRQ_RTC_PER 22
|
||||
#define WM831X_IRQ_RTC_ALM 23
|
||||
#define WM831X_IRQ_CHG_BATT_HOT 24
|
||||
#define WM831X_IRQ_CHG_BATT_COLD 25
|
||||
#define WM831X_IRQ_CHG_BATT_FAIL 26
|
||||
#define WM831X_IRQ_CHG_OV 27
|
||||
#define WM831X_IRQ_CHG_END 29
|
||||
#define WM831X_IRQ_CHG_TO 30
|
||||
#define WM831X_IRQ_CHG_MODE 31
|
||||
#define WM831X_IRQ_CHG_START 32
|
||||
#define WM831X_IRQ_TCHDATA 33
|
||||
#define WM831X_IRQ_TCHPD 34
|
||||
#define WM831X_IRQ_AUXADC_DATA 35
|
||||
#define WM831X_IRQ_AUXADC_DCOMP1 36
|
||||
#define WM831X_IRQ_AUXADC_DCOMP2 37
|
||||
#define WM831X_IRQ_AUXADC_DCOMP3 38
|
||||
#define WM831X_IRQ_AUXADC_DCOMP4 39
|
||||
#define WM831X_IRQ_CS1 40
|
||||
#define WM831X_IRQ_CS2 41
|
||||
#define WM831X_IRQ_HC_DC1 42
|
||||
#define WM831X_IRQ_HC_DC2 43
|
||||
#define WM831X_IRQ_UV_LDO1 44
|
||||
#define WM831X_IRQ_UV_LDO2 45
|
||||
#define WM831X_IRQ_UV_LDO3 46
|
||||
#define WM831X_IRQ_UV_LDO4 47
|
||||
#define WM831X_IRQ_UV_LDO5 48
|
||||
#define WM831X_IRQ_UV_LDO6 49
|
||||
#define WM831X_IRQ_UV_LDO7 50
|
||||
#define WM831X_IRQ_UV_LDO8 51
|
||||
#define WM831X_IRQ_UV_LDO9 52
|
||||
#define WM831X_IRQ_UV_LDO10 53
|
||||
#define WM831X_IRQ_UV_DC1 54
|
||||
#define WM831X_IRQ_UV_DC2 55
|
||||
#define WM831X_IRQ_UV_DC3 56
|
||||
#define WM831X_IRQ_UV_DC4 57
|
||||
|
||||
#define WM831X_NUM_IRQS 58
|
||||
|
||||
/*
|
||||
* R16400 (0x4010) - System Interrupts
|
||||
*/
|
||||
#define WM831X_PS_INT 0x8000 /* PS_INT */
|
||||
#define WM831X_PS_INT_MASK 0x8000 /* PS_INT */
|
||||
#define WM831X_PS_INT_SHIFT 15 /* PS_INT */
|
||||
#define WM831X_PS_INT_WIDTH 1 /* PS_INT */
|
||||
#define WM831X_TEMP_INT 0x4000 /* TEMP_INT */
|
||||
#define WM831X_TEMP_INT_MASK 0x4000 /* TEMP_INT */
|
||||
#define WM831X_TEMP_INT_SHIFT 14 /* TEMP_INT */
|
||||
#define WM831X_TEMP_INT_WIDTH 1 /* TEMP_INT */
|
||||
#define WM831X_GP_INT 0x2000 /* GP_INT */
|
||||
#define WM831X_GP_INT_MASK 0x2000 /* GP_INT */
|
||||
#define WM831X_GP_INT_SHIFT 13 /* GP_INT */
|
||||
#define WM831X_GP_INT_WIDTH 1 /* GP_INT */
|
||||
#define WM831X_ON_PIN_INT 0x1000 /* ON_PIN_INT */
|
||||
#define WM831X_ON_PIN_INT_MASK 0x1000 /* ON_PIN_INT */
|
||||
#define WM831X_ON_PIN_INT_SHIFT 12 /* ON_PIN_INT */
|
||||
#define WM831X_ON_PIN_INT_WIDTH 1 /* ON_PIN_INT */
|
||||
#define WM831X_WDOG_INT 0x0800 /* WDOG_INT */
|
||||
#define WM831X_WDOG_INT_MASK 0x0800 /* WDOG_INT */
|
||||
#define WM831X_WDOG_INT_SHIFT 11 /* WDOG_INT */
|
||||
#define WM831X_WDOG_INT_WIDTH 1 /* WDOG_INT */
|
||||
#define WM831X_TCHDATA_INT 0x0400 /* TCHDATA_INT */
|
||||
#define WM831X_TCHDATA_INT_MASK 0x0400 /* TCHDATA_INT */
|
||||
#define WM831X_TCHDATA_INT_SHIFT 10 /* TCHDATA_INT */
|
||||
#define WM831X_TCHDATA_INT_WIDTH 1 /* TCHDATA_INT */
|
||||
#define WM831X_TCHPD_INT 0x0200 /* TCHPD_INT */
|
||||
#define WM831X_TCHPD_INT_MASK 0x0200 /* TCHPD_INT */
|
||||
#define WM831X_TCHPD_INT_SHIFT 9 /* TCHPD_INT */
|
||||
#define WM831X_TCHPD_INT_WIDTH 1 /* TCHPD_INT */
|
||||
#define WM831X_AUXADC_INT 0x0100 /* AUXADC_INT */
|
||||
#define WM831X_AUXADC_INT_MASK 0x0100 /* AUXADC_INT */
|
||||
#define WM831X_AUXADC_INT_SHIFT 8 /* AUXADC_INT */
|
||||
#define WM831X_AUXADC_INT_WIDTH 1 /* AUXADC_INT */
|
||||
#define WM831X_PPM_INT 0x0080 /* PPM_INT */
|
||||
#define WM831X_PPM_INT_MASK 0x0080 /* PPM_INT */
|
||||
#define WM831X_PPM_INT_SHIFT 7 /* PPM_INT */
|
||||
#define WM831X_PPM_INT_WIDTH 1 /* PPM_INT */
|
||||
#define WM831X_CS_INT 0x0040 /* CS_INT */
|
||||
#define WM831X_CS_INT_MASK 0x0040 /* CS_INT */
|
||||
#define WM831X_CS_INT_SHIFT 6 /* CS_INT */
|
||||
#define WM831X_CS_INT_WIDTH 1 /* CS_INT */
|
||||
#define WM831X_RTC_INT 0x0020 /* RTC_INT */
|
||||
#define WM831X_RTC_INT_MASK 0x0020 /* RTC_INT */
|
||||
#define WM831X_RTC_INT_SHIFT 5 /* RTC_INT */
|
||||
#define WM831X_RTC_INT_WIDTH 1 /* RTC_INT */
|
||||
#define WM831X_OTP_INT 0x0010 /* OTP_INT */
|
||||
#define WM831X_OTP_INT_MASK 0x0010 /* OTP_INT */
|
||||
#define WM831X_OTP_INT_SHIFT 4 /* OTP_INT */
|
||||
#define WM831X_OTP_INT_WIDTH 1 /* OTP_INT */
|
||||
#define WM831X_CHILD_INT 0x0008 /* CHILD_INT */
|
||||
#define WM831X_CHILD_INT_MASK 0x0008 /* CHILD_INT */
|
||||
#define WM831X_CHILD_INT_SHIFT 3 /* CHILD_INT */
|
||||
#define WM831X_CHILD_INT_WIDTH 1 /* CHILD_INT */
|
||||
#define WM831X_CHG_INT 0x0004 /* CHG_INT */
|
||||
#define WM831X_CHG_INT_MASK 0x0004 /* CHG_INT */
|
||||
#define WM831X_CHG_INT_SHIFT 2 /* CHG_INT */
|
||||
#define WM831X_CHG_INT_WIDTH 1 /* CHG_INT */
|
||||
#define WM831X_HC_INT 0x0002 /* HC_INT */
|
||||
#define WM831X_HC_INT_MASK 0x0002 /* HC_INT */
|
||||
#define WM831X_HC_INT_SHIFT 1 /* HC_INT */
|
||||
#define WM831X_HC_INT_WIDTH 1 /* HC_INT */
|
||||
#define WM831X_UV_INT 0x0001 /* UV_INT */
|
||||
#define WM831X_UV_INT_MASK 0x0001 /* UV_INT */
|
||||
#define WM831X_UV_INT_SHIFT 0 /* UV_INT */
|
||||
#define WM831X_UV_INT_WIDTH 1 /* UV_INT */
|
||||
|
||||
/*
|
||||
* R16401 (0x4011) - Interrupt Status 1
|
||||
*/
|
||||
#define WM831X_PPM_SYSLO_EINT 0x8000 /* PPM_SYSLO_EINT */
|
||||
#define WM831X_PPM_SYSLO_EINT_MASK 0x8000 /* PPM_SYSLO_EINT */
|
||||
#define WM831X_PPM_SYSLO_EINT_SHIFT 15 /* PPM_SYSLO_EINT */
|
||||
#define WM831X_PPM_SYSLO_EINT_WIDTH 1 /* PPM_SYSLO_EINT */
|
||||
#define WM831X_PPM_PWR_SRC_EINT 0x4000 /* PPM_PWR_SRC_EINT */
|
||||
#define WM831X_PPM_PWR_SRC_EINT_MASK 0x4000 /* PPM_PWR_SRC_EINT */
|
||||
#define WM831X_PPM_PWR_SRC_EINT_SHIFT 14 /* PPM_PWR_SRC_EINT */
|
||||
#define WM831X_PPM_PWR_SRC_EINT_WIDTH 1 /* PPM_PWR_SRC_EINT */
|
||||
#define WM831X_PPM_USB_CURR_EINT 0x2000 /* PPM_USB_CURR_EINT */
|
||||
#define WM831X_PPM_USB_CURR_EINT_MASK 0x2000 /* PPM_USB_CURR_EINT */
|
||||
#define WM831X_PPM_USB_CURR_EINT_SHIFT 13 /* PPM_USB_CURR_EINT */
|
||||
#define WM831X_PPM_USB_CURR_EINT_WIDTH 1 /* PPM_USB_CURR_EINT */
|
||||
#define WM831X_ON_PIN_EINT 0x1000 /* ON_PIN_EINT */
|
||||
#define WM831X_ON_PIN_EINT_MASK 0x1000 /* ON_PIN_EINT */
|
||||
#define WM831X_ON_PIN_EINT_SHIFT 12 /* ON_PIN_EINT */
|
||||
#define WM831X_ON_PIN_EINT_WIDTH 1 /* ON_PIN_EINT */
|
||||
#define WM831X_WDOG_TO_EINT 0x0800 /* WDOG_TO_EINT */
|
||||
#define WM831X_WDOG_TO_EINT_MASK 0x0800 /* WDOG_TO_EINT */
|
||||
#define WM831X_WDOG_TO_EINT_SHIFT 11 /* WDOG_TO_EINT */
|
||||
#define WM831X_WDOG_TO_EINT_WIDTH 1 /* WDOG_TO_EINT */
|
||||
#define WM831X_TCHDATA_EINT 0x0400 /* TCHDATA_EINT */
|
||||
#define WM831X_TCHDATA_EINT_MASK 0x0400 /* TCHDATA_EINT */
|
||||
#define WM831X_TCHDATA_EINT_SHIFT 10 /* TCHDATA_EINT */
|
||||
#define WM831X_TCHDATA_EINT_WIDTH 1 /* TCHDATA_EINT */
|
||||
#define WM831X_TCHPD_EINT 0x0200 /* TCHPD_EINT */
|
||||
#define WM831X_TCHPD_EINT_MASK 0x0200 /* TCHPD_EINT */
|
||||
#define WM831X_TCHPD_EINT_SHIFT 9 /* TCHPD_EINT */
|
||||
#define WM831X_TCHPD_EINT_WIDTH 1 /* TCHPD_EINT */
|
||||
#define WM831X_AUXADC_DATA_EINT 0x0100 /* AUXADC_DATA_EINT */
|
||||
#define WM831X_AUXADC_DATA_EINT_MASK 0x0100 /* AUXADC_DATA_EINT */
|
||||
#define WM831X_AUXADC_DATA_EINT_SHIFT 8 /* AUXADC_DATA_EINT */
|
||||
#define WM831X_AUXADC_DATA_EINT_WIDTH 1 /* AUXADC_DATA_EINT */
|
||||
#define WM831X_AUXADC_DCOMP4_EINT 0x0080 /* AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_AUXADC_DCOMP4_EINT_MASK 0x0080 /* AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_AUXADC_DCOMP4_EINT_SHIFT 7 /* AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_AUXADC_DCOMP4_EINT_WIDTH 1 /* AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_AUXADC_DCOMP3_EINT 0x0040 /* AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_AUXADC_DCOMP3_EINT_MASK 0x0040 /* AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_AUXADC_DCOMP3_EINT_SHIFT 6 /* AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_AUXADC_DCOMP3_EINT_WIDTH 1 /* AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_AUXADC_DCOMP2_EINT 0x0020 /* AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_AUXADC_DCOMP2_EINT_MASK 0x0020 /* AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_AUXADC_DCOMP2_EINT_SHIFT 5 /* AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_AUXADC_DCOMP2_EINT_WIDTH 1 /* AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_AUXADC_DCOMP1_EINT 0x0010 /* AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_AUXADC_DCOMP1_EINT_MASK 0x0010 /* AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_AUXADC_DCOMP1_EINT_SHIFT 4 /* AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_AUXADC_DCOMP1_EINT_WIDTH 1 /* AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_RTC_PER_EINT 0x0008 /* RTC_PER_EINT */
|
||||
#define WM831X_RTC_PER_EINT_MASK 0x0008 /* RTC_PER_EINT */
|
||||
#define WM831X_RTC_PER_EINT_SHIFT 3 /* RTC_PER_EINT */
|
||||
#define WM831X_RTC_PER_EINT_WIDTH 1 /* RTC_PER_EINT */
|
||||
#define WM831X_RTC_ALM_EINT 0x0004 /* RTC_ALM_EINT */
|
||||
#define WM831X_RTC_ALM_EINT_MASK 0x0004 /* RTC_ALM_EINT */
|
||||
#define WM831X_RTC_ALM_EINT_SHIFT 2 /* RTC_ALM_EINT */
|
||||
#define WM831X_RTC_ALM_EINT_WIDTH 1 /* RTC_ALM_EINT */
|
||||
#define WM831X_TEMP_THW_EINT 0x0002 /* TEMP_THW_EINT */
|
||||
#define WM831X_TEMP_THW_EINT_MASK 0x0002 /* TEMP_THW_EINT */
|
||||
#define WM831X_TEMP_THW_EINT_SHIFT 1 /* TEMP_THW_EINT */
|
||||
#define WM831X_TEMP_THW_EINT_WIDTH 1 /* TEMP_THW_EINT */
|
||||
|
||||
/*
|
||||
* R16402 (0x4012) - Interrupt Status 2
|
||||
*/
|
||||
#define WM831X_CHG_BATT_HOT_EINT 0x8000 /* CHG_BATT_HOT_EINT */
|
||||
#define WM831X_CHG_BATT_HOT_EINT_MASK 0x8000 /* CHG_BATT_HOT_EINT */
|
||||
#define WM831X_CHG_BATT_HOT_EINT_SHIFT 15 /* CHG_BATT_HOT_EINT */
|
||||
#define WM831X_CHG_BATT_HOT_EINT_WIDTH 1 /* CHG_BATT_HOT_EINT */
|
||||
#define WM831X_CHG_BATT_COLD_EINT 0x4000 /* CHG_BATT_COLD_EINT */
|
||||
#define WM831X_CHG_BATT_COLD_EINT_MASK 0x4000 /* CHG_BATT_COLD_EINT */
|
||||
#define WM831X_CHG_BATT_COLD_EINT_SHIFT 14 /* CHG_BATT_COLD_EINT */
|
||||
#define WM831X_CHG_BATT_COLD_EINT_WIDTH 1 /* CHG_BATT_COLD_EINT */
|
||||
#define WM831X_CHG_BATT_FAIL_EINT 0x2000 /* CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_CHG_BATT_FAIL_EINT_MASK 0x2000 /* CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_CHG_BATT_FAIL_EINT_SHIFT 13 /* CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_CHG_BATT_FAIL_EINT_WIDTH 1 /* CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_CHG_OV_EINT 0x1000 /* CHG_OV_EINT */
|
||||
#define WM831X_CHG_OV_EINT_MASK 0x1000 /* CHG_OV_EINT */
|
||||
#define WM831X_CHG_OV_EINT_SHIFT 12 /* CHG_OV_EINT */
|
||||
#define WM831X_CHG_OV_EINT_WIDTH 1 /* CHG_OV_EINT */
|
||||
#define WM831X_CHG_END_EINT 0x0800 /* CHG_END_EINT */
|
||||
#define WM831X_CHG_END_EINT_MASK 0x0800 /* CHG_END_EINT */
|
||||
#define WM831X_CHG_END_EINT_SHIFT 11 /* CHG_END_EINT */
|
||||
#define WM831X_CHG_END_EINT_WIDTH 1 /* CHG_END_EINT */
|
||||
#define WM831X_CHG_TO_EINT 0x0400 /* CHG_TO_EINT */
|
||||
#define WM831X_CHG_TO_EINT_MASK 0x0400 /* CHG_TO_EINT */
|
||||
#define WM831X_CHG_TO_EINT_SHIFT 10 /* CHG_TO_EINT */
|
||||
#define WM831X_CHG_TO_EINT_WIDTH 1 /* CHG_TO_EINT */
|
||||
#define WM831X_CHG_MODE_EINT 0x0200 /* CHG_MODE_EINT */
|
||||
#define WM831X_CHG_MODE_EINT_MASK 0x0200 /* CHG_MODE_EINT */
|
||||
#define WM831X_CHG_MODE_EINT_SHIFT 9 /* CHG_MODE_EINT */
|
||||
#define WM831X_CHG_MODE_EINT_WIDTH 1 /* CHG_MODE_EINT */
|
||||
#define WM831X_CHG_START_EINT 0x0100 /* CHG_START_EINT */
|
||||
#define WM831X_CHG_START_EINT_MASK 0x0100 /* CHG_START_EINT */
|
||||
#define WM831X_CHG_START_EINT_SHIFT 8 /* CHG_START_EINT */
|
||||
#define WM831X_CHG_START_EINT_WIDTH 1 /* CHG_START_EINT */
|
||||
#define WM831X_CS2_EINT 0x0080 /* CS2_EINT */
|
||||
#define WM831X_CS2_EINT_MASK 0x0080 /* CS2_EINT */
|
||||
#define WM831X_CS2_EINT_SHIFT 7 /* CS2_EINT */
|
||||
#define WM831X_CS2_EINT_WIDTH 1 /* CS2_EINT */
|
||||
#define WM831X_CS1_EINT 0x0040 /* CS1_EINT */
|
||||
#define WM831X_CS1_EINT_MASK 0x0040 /* CS1_EINT */
|
||||
#define WM831X_CS1_EINT_SHIFT 6 /* CS1_EINT */
|
||||
#define WM831X_CS1_EINT_WIDTH 1 /* CS1_EINT */
|
||||
#define WM831X_OTP_CMD_END_EINT 0x0020 /* OTP_CMD_END_EINT */
|
||||
#define WM831X_OTP_CMD_END_EINT_MASK 0x0020 /* OTP_CMD_END_EINT */
|
||||
#define WM831X_OTP_CMD_END_EINT_SHIFT 5 /* OTP_CMD_END_EINT */
|
||||
#define WM831X_OTP_CMD_END_EINT_WIDTH 1 /* OTP_CMD_END_EINT */
|
||||
#define WM831X_OTP_ERR_EINT 0x0010 /* OTP_ERR_EINT */
|
||||
#define WM831X_OTP_ERR_EINT_MASK 0x0010 /* OTP_ERR_EINT */
|
||||
#define WM831X_OTP_ERR_EINT_SHIFT 4 /* OTP_ERR_EINT */
|
||||
#define WM831X_OTP_ERR_EINT_WIDTH 1 /* OTP_ERR_EINT */
|
||||
#define WM831X_PS_POR_EINT 0x0004 /* PS_POR_EINT */
|
||||
#define WM831X_PS_POR_EINT_MASK 0x0004 /* PS_POR_EINT */
|
||||
#define WM831X_PS_POR_EINT_SHIFT 2 /* PS_POR_EINT */
|
||||
#define WM831X_PS_POR_EINT_WIDTH 1 /* PS_POR_EINT */
|
||||
#define WM831X_PS_SLEEP_OFF_EINT 0x0002 /* PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_PS_SLEEP_OFF_EINT_MASK 0x0002 /* PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_PS_SLEEP_OFF_EINT_SHIFT 1 /* PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_PS_SLEEP_OFF_EINT_WIDTH 1 /* PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_PS_ON_WAKE_EINT 0x0001 /* PS_ON_WAKE_EINT */
|
||||
#define WM831X_PS_ON_WAKE_EINT_MASK 0x0001 /* PS_ON_WAKE_EINT */
|
||||
#define WM831X_PS_ON_WAKE_EINT_SHIFT 0 /* PS_ON_WAKE_EINT */
|
||||
#define WM831X_PS_ON_WAKE_EINT_WIDTH 1 /* PS_ON_WAKE_EINT */
|
||||
|
||||
/*
|
||||
* R16403 (0x4013) - Interrupt Status 3
|
||||
*/
|
||||
#define WM831X_UV_LDO10_EINT 0x0200 /* UV_LDO10_EINT */
|
||||
#define WM831X_UV_LDO10_EINT_MASK 0x0200 /* UV_LDO10_EINT */
|
||||
#define WM831X_UV_LDO10_EINT_SHIFT 9 /* UV_LDO10_EINT */
|
||||
#define WM831X_UV_LDO10_EINT_WIDTH 1 /* UV_LDO10_EINT */
|
||||
#define WM831X_UV_LDO9_EINT 0x0100 /* UV_LDO9_EINT */
|
||||
#define WM831X_UV_LDO9_EINT_MASK 0x0100 /* UV_LDO9_EINT */
|
||||
#define WM831X_UV_LDO9_EINT_SHIFT 8 /* UV_LDO9_EINT */
|
||||
#define WM831X_UV_LDO9_EINT_WIDTH 1 /* UV_LDO9_EINT */
|
||||
#define WM831X_UV_LDO8_EINT 0x0080 /* UV_LDO8_EINT */
|
||||
#define WM831X_UV_LDO8_EINT_MASK 0x0080 /* UV_LDO8_EINT */
|
||||
#define WM831X_UV_LDO8_EINT_SHIFT 7 /* UV_LDO8_EINT */
|
||||
#define WM831X_UV_LDO8_EINT_WIDTH 1 /* UV_LDO8_EINT */
|
||||
#define WM831X_UV_LDO7_EINT 0x0040 /* UV_LDO7_EINT */
|
||||
#define WM831X_UV_LDO7_EINT_MASK 0x0040 /* UV_LDO7_EINT */
|
||||
#define WM831X_UV_LDO7_EINT_SHIFT 6 /* UV_LDO7_EINT */
|
||||
#define WM831X_UV_LDO7_EINT_WIDTH 1 /* UV_LDO7_EINT */
|
||||
#define WM831X_UV_LDO6_EINT 0x0020 /* UV_LDO6_EINT */
|
||||
#define WM831X_UV_LDO6_EINT_MASK 0x0020 /* UV_LDO6_EINT */
|
||||
#define WM831X_UV_LDO6_EINT_SHIFT 5 /* UV_LDO6_EINT */
|
||||
#define WM831X_UV_LDO6_EINT_WIDTH 1 /* UV_LDO6_EINT */
|
||||
#define WM831X_UV_LDO5_EINT 0x0010 /* UV_LDO5_EINT */
|
||||
#define WM831X_UV_LDO5_EINT_MASK 0x0010 /* UV_LDO5_EINT */
|
||||
#define WM831X_UV_LDO5_EINT_SHIFT 4 /* UV_LDO5_EINT */
|
||||
#define WM831X_UV_LDO5_EINT_WIDTH 1 /* UV_LDO5_EINT */
|
||||
#define WM831X_UV_LDO4_EINT 0x0008 /* UV_LDO4_EINT */
|
||||
#define WM831X_UV_LDO4_EINT_MASK 0x0008 /* UV_LDO4_EINT */
|
||||
#define WM831X_UV_LDO4_EINT_SHIFT 3 /* UV_LDO4_EINT */
|
||||
#define WM831X_UV_LDO4_EINT_WIDTH 1 /* UV_LDO4_EINT */
|
||||
#define WM831X_UV_LDO3_EINT 0x0004 /* UV_LDO3_EINT */
|
||||
#define WM831X_UV_LDO3_EINT_MASK 0x0004 /* UV_LDO3_EINT */
|
||||
#define WM831X_UV_LDO3_EINT_SHIFT 2 /* UV_LDO3_EINT */
|
||||
#define WM831X_UV_LDO3_EINT_WIDTH 1 /* UV_LDO3_EINT */
|
||||
#define WM831X_UV_LDO2_EINT 0x0002 /* UV_LDO2_EINT */
|
||||
#define WM831X_UV_LDO2_EINT_MASK 0x0002 /* UV_LDO2_EINT */
|
||||
#define WM831X_UV_LDO2_EINT_SHIFT 1 /* UV_LDO2_EINT */
|
||||
#define WM831X_UV_LDO2_EINT_WIDTH 1 /* UV_LDO2_EINT */
|
||||
#define WM831X_UV_LDO1_EINT 0x0001 /* UV_LDO1_EINT */
|
||||
#define WM831X_UV_LDO1_EINT_MASK 0x0001 /* UV_LDO1_EINT */
|
||||
#define WM831X_UV_LDO1_EINT_SHIFT 0 /* UV_LDO1_EINT */
|
||||
#define WM831X_UV_LDO1_EINT_WIDTH 1 /* UV_LDO1_EINT */
|
||||
|
||||
/*
|
||||
* R16404 (0x4014) - Interrupt Status 4
|
||||
*/
|
||||
#define WM831X_HC_DC2_EINT 0x0200 /* HC_DC2_EINT */
|
||||
#define WM831X_HC_DC2_EINT_MASK 0x0200 /* HC_DC2_EINT */
|
||||
#define WM831X_HC_DC2_EINT_SHIFT 9 /* HC_DC2_EINT */
|
||||
#define WM831X_HC_DC2_EINT_WIDTH 1 /* HC_DC2_EINT */
|
||||
#define WM831X_HC_DC1_EINT 0x0100 /* HC_DC1_EINT */
|
||||
#define WM831X_HC_DC1_EINT_MASK 0x0100 /* HC_DC1_EINT */
|
||||
#define WM831X_HC_DC1_EINT_SHIFT 8 /* HC_DC1_EINT */
|
||||
#define WM831X_HC_DC1_EINT_WIDTH 1 /* HC_DC1_EINT */
|
||||
#define WM831X_UV_DC4_EINT 0x0008 /* UV_DC4_EINT */
|
||||
#define WM831X_UV_DC4_EINT_MASK 0x0008 /* UV_DC4_EINT */
|
||||
#define WM831X_UV_DC4_EINT_SHIFT 3 /* UV_DC4_EINT */
|
||||
#define WM831X_UV_DC4_EINT_WIDTH 1 /* UV_DC4_EINT */
|
||||
#define WM831X_UV_DC3_EINT 0x0004 /* UV_DC3_EINT */
|
||||
#define WM831X_UV_DC3_EINT_MASK 0x0004 /* UV_DC3_EINT */
|
||||
#define WM831X_UV_DC3_EINT_SHIFT 2 /* UV_DC3_EINT */
|
||||
#define WM831X_UV_DC3_EINT_WIDTH 1 /* UV_DC3_EINT */
|
||||
#define WM831X_UV_DC2_EINT 0x0002 /* UV_DC2_EINT */
|
||||
#define WM831X_UV_DC2_EINT_MASK 0x0002 /* UV_DC2_EINT */
|
||||
#define WM831X_UV_DC2_EINT_SHIFT 1 /* UV_DC2_EINT */
|
||||
#define WM831X_UV_DC2_EINT_WIDTH 1 /* UV_DC2_EINT */
|
||||
#define WM831X_UV_DC1_EINT 0x0001 /* UV_DC1_EINT */
|
||||
#define WM831X_UV_DC1_EINT_MASK 0x0001 /* UV_DC1_EINT */
|
||||
#define WM831X_UV_DC1_EINT_SHIFT 0 /* UV_DC1_EINT */
|
||||
#define WM831X_UV_DC1_EINT_WIDTH 1 /* UV_DC1_EINT */
|
||||
|
||||
/*
|
||||
* R16405 (0x4015) - Interrupt Status 5
|
||||
*/
|
||||
#define WM831X_GP16_EINT 0x8000 /* GP16_EINT */
|
||||
#define WM831X_GP16_EINT_MASK 0x8000 /* GP16_EINT */
|
||||
#define WM831X_GP16_EINT_SHIFT 15 /* GP16_EINT */
|
||||
#define WM831X_GP16_EINT_WIDTH 1 /* GP16_EINT */
|
||||
#define WM831X_GP15_EINT 0x4000 /* GP15_EINT */
|
||||
#define WM831X_GP15_EINT_MASK 0x4000 /* GP15_EINT */
|
||||
#define WM831X_GP15_EINT_SHIFT 14 /* GP15_EINT */
|
||||
#define WM831X_GP15_EINT_WIDTH 1 /* GP15_EINT */
|
||||
#define WM831X_GP14_EINT 0x2000 /* GP14_EINT */
|
||||
#define WM831X_GP14_EINT_MASK 0x2000 /* GP14_EINT */
|
||||
#define WM831X_GP14_EINT_SHIFT 13 /* GP14_EINT */
|
||||
#define WM831X_GP14_EINT_WIDTH 1 /* GP14_EINT */
|
||||
#define WM831X_GP13_EINT 0x1000 /* GP13_EINT */
|
||||
#define WM831X_GP13_EINT_MASK 0x1000 /* GP13_EINT */
|
||||
#define WM831X_GP13_EINT_SHIFT 12 /* GP13_EINT */
|
||||
#define WM831X_GP13_EINT_WIDTH 1 /* GP13_EINT */
|
||||
#define WM831X_GP12_EINT 0x0800 /* GP12_EINT */
|
||||
#define WM831X_GP12_EINT_MASK 0x0800 /* GP12_EINT */
|
||||
#define WM831X_GP12_EINT_SHIFT 11 /* GP12_EINT */
|
||||
#define WM831X_GP12_EINT_WIDTH 1 /* GP12_EINT */
|
||||
#define WM831X_GP11_EINT 0x0400 /* GP11_EINT */
|
||||
#define WM831X_GP11_EINT_MASK 0x0400 /* GP11_EINT */
|
||||
#define WM831X_GP11_EINT_SHIFT 10 /* GP11_EINT */
|
||||
#define WM831X_GP11_EINT_WIDTH 1 /* GP11_EINT */
|
||||
#define WM831X_GP10_EINT 0x0200 /* GP10_EINT */
|
||||
#define WM831X_GP10_EINT_MASK 0x0200 /* GP10_EINT */
|
||||
#define WM831X_GP10_EINT_SHIFT 9 /* GP10_EINT */
|
||||
#define WM831X_GP10_EINT_WIDTH 1 /* GP10_EINT */
|
||||
#define WM831X_GP9_EINT 0x0100 /* GP9_EINT */
|
||||
#define WM831X_GP9_EINT_MASK 0x0100 /* GP9_EINT */
|
||||
#define WM831X_GP9_EINT_SHIFT 8 /* GP9_EINT */
|
||||
#define WM831X_GP9_EINT_WIDTH 1 /* GP9_EINT */
|
||||
#define WM831X_GP8_EINT 0x0080 /* GP8_EINT */
|
||||
#define WM831X_GP8_EINT_MASK 0x0080 /* GP8_EINT */
|
||||
#define WM831X_GP8_EINT_SHIFT 7 /* GP8_EINT */
|
||||
#define WM831X_GP8_EINT_WIDTH 1 /* GP8_EINT */
|
||||
#define WM831X_GP7_EINT 0x0040 /* GP7_EINT */
|
||||
#define WM831X_GP7_EINT_MASK 0x0040 /* GP7_EINT */
|
||||
#define WM831X_GP7_EINT_SHIFT 6 /* GP7_EINT */
|
||||
#define WM831X_GP7_EINT_WIDTH 1 /* GP7_EINT */
|
||||
#define WM831X_GP6_EINT 0x0020 /* GP6_EINT */
|
||||
#define WM831X_GP6_EINT_MASK 0x0020 /* GP6_EINT */
|
||||
#define WM831X_GP6_EINT_SHIFT 5 /* GP6_EINT */
|
||||
#define WM831X_GP6_EINT_WIDTH 1 /* GP6_EINT */
|
||||
#define WM831X_GP5_EINT 0x0010 /* GP5_EINT */
|
||||
#define WM831X_GP5_EINT_MASK 0x0010 /* GP5_EINT */
|
||||
#define WM831X_GP5_EINT_SHIFT 4 /* GP5_EINT */
|
||||
#define WM831X_GP5_EINT_WIDTH 1 /* GP5_EINT */
|
||||
#define WM831X_GP4_EINT 0x0008 /* GP4_EINT */
|
||||
#define WM831X_GP4_EINT_MASK 0x0008 /* GP4_EINT */
|
||||
#define WM831X_GP4_EINT_SHIFT 3 /* GP4_EINT */
|
||||
#define WM831X_GP4_EINT_WIDTH 1 /* GP4_EINT */
|
||||
#define WM831X_GP3_EINT 0x0004 /* GP3_EINT */
|
||||
#define WM831X_GP3_EINT_MASK 0x0004 /* GP3_EINT */
|
||||
#define WM831X_GP3_EINT_SHIFT 2 /* GP3_EINT */
|
||||
#define WM831X_GP3_EINT_WIDTH 1 /* GP3_EINT */
|
||||
#define WM831X_GP2_EINT 0x0002 /* GP2_EINT */
|
||||
#define WM831X_GP2_EINT_MASK 0x0002 /* GP2_EINT */
|
||||
#define WM831X_GP2_EINT_SHIFT 1 /* GP2_EINT */
|
||||
#define WM831X_GP2_EINT_WIDTH 1 /* GP2_EINT */
|
||||
#define WM831X_GP1_EINT 0x0001 /* GP1_EINT */
|
||||
#define WM831X_GP1_EINT_MASK 0x0001 /* GP1_EINT */
|
||||
#define WM831X_GP1_EINT_SHIFT 0 /* GP1_EINT */
|
||||
#define WM831X_GP1_EINT_WIDTH 1 /* GP1_EINT */
|
||||
|
||||
/*
|
||||
* R16407 (0x4017) - IRQ Config
|
||||
*/
|
||||
#define WM831X_IRQ_OD 0x0002 /* IRQ_OD */
|
||||
#define WM831X_IRQ_OD_MASK 0x0002 /* IRQ_OD */
|
||||
#define WM831X_IRQ_OD_SHIFT 1 /* IRQ_OD */
|
||||
#define WM831X_IRQ_OD_WIDTH 1 /* IRQ_OD */
|
||||
#define WM831X_IM_IRQ 0x0001 /* IM_IRQ */
|
||||
#define WM831X_IM_IRQ_MASK 0x0001 /* IM_IRQ */
|
||||
#define WM831X_IM_IRQ_SHIFT 0 /* IM_IRQ */
|
||||
#define WM831X_IM_IRQ_WIDTH 1 /* IM_IRQ */
|
||||
|
||||
/*
|
||||
* R16408 (0x4018) - System Interrupts Mask
|
||||
*/
|
||||
#define WM831X_IM_PS_INT 0x8000 /* IM_PS_INT */
|
||||
#define WM831X_IM_PS_INT_MASK 0x8000 /* IM_PS_INT */
|
||||
#define WM831X_IM_PS_INT_SHIFT 15 /* IM_PS_INT */
|
||||
#define WM831X_IM_PS_INT_WIDTH 1 /* IM_PS_INT */
|
||||
#define WM831X_IM_TEMP_INT 0x4000 /* IM_TEMP_INT */
|
||||
#define WM831X_IM_TEMP_INT_MASK 0x4000 /* IM_TEMP_INT */
|
||||
#define WM831X_IM_TEMP_INT_SHIFT 14 /* IM_TEMP_INT */
|
||||
#define WM831X_IM_TEMP_INT_WIDTH 1 /* IM_TEMP_INT */
|
||||
#define WM831X_IM_GP_INT 0x2000 /* IM_GP_INT */
|
||||
#define WM831X_IM_GP_INT_MASK 0x2000 /* IM_GP_INT */
|
||||
#define WM831X_IM_GP_INT_SHIFT 13 /* IM_GP_INT */
|
||||
#define WM831X_IM_GP_INT_WIDTH 1 /* IM_GP_INT */
|
||||
#define WM831X_IM_ON_PIN_INT 0x1000 /* IM_ON_PIN_INT */
|
||||
#define WM831X_IM_ON_PIN_INT_MASK 0x1000 /* IM_ON_PIN_INT */
|
||||
#define WM831X_IM_ON_PIN_INT_SHIFT 12 /* IM_ON_PIN_INT */
|
||||
#define WM831X_IM_ON_PIN_INT_WIDTH 1 /* IM_ON_PIN_INT */
|
||||
#define WM831X_IM_WDOG_INT 0x0800 /* IM_WDOG_INT */
|
||||
#define WM831X_IM_WDOG_INT_MASK 0x0800 /* IM_WDOG_INT */
|
||||
#define WM831X_IM_WDOG_INT_SHIFT 11 /* IM_WDOG_INT */
|
||||
#define WM831X_IM_WDOG_INT_WIDTH 1 /* IM_WDOG_INT */
|
||||
#define WM831X_IM_TCHDATA_INT 0x0400 /* IM_TCHDATA_INT */
|
||||
#define WM831X_IM_TCHDATA_INT_MASK 0x0400 /* IM_TCHDATA_INT */
|
||||
#define WM831X_IM_TCHDATA_INT_SHIFT 10 /* IM_TCHDATA_INT */
|
||||
#define WM831X_IM_TCHDATA_INT_WIDTH 1 /* IM_TCHDATA_INT */
|
||||
#define WM831X_IM_TCHPD_INT 0x0200 /* IM_TCHPD_INT */
|
||||
#define WM831X_IM_TCHPD_INT_MASK 0x0200 /* IM_TCHPD_INT */
|
||||
#define WM831X_IM_TCHPD_INT_SHIFT 9 /* IM_TCHPD_INT */
|
||||
#define WM831X_IM_TCHPD_INT_WIDTH 1 /* IM_TCHPD_INT */
|
||||
#define WM831X_IM_AUXADC_INT 0x0100 /* IM_AUXADC_INT */
|
||||
#define WM831X_IM_AUXADC_INT_MASK 0x0100 /* IM_AUXADC_INT */
|
||||
#define WM831X_IM_AUXADC_INT_SHIFT 8 /* IM_AUXADC_INT */
|
||||
#define WM831X_IM_AUXADC_INT_WIDTH 1 /* IM_AUXADC_INT */
|
||||
#define WM831X_IM_PPM_INT 0x0080 /* IM_PPM_INT */
|
||||
#define WM831X_IM_PPM_INT_MASK 0x0080 /* IM_PPM_INT */
|
||||
#define WM831X_IM_PPM_INT_SHIFT 7 /* IM_PPM_INT */
|
||||
#define WM831X_IM_PPM_INT_WIDTH 1 /* IM_PPM_INT */
|
||||
#define WM831X_IM_CS_INT 0x0040 /* IM_CS_INT */
|
||||
#define WM831X_IM_CS_INT_MASK 0x0040 /* IM_CS_INT */
|
||||
#define WM831X_IM_CS_INT_SHIFT 6 /* IM_CS_INT */
|
||||
#define WM831X_IM_CS_INT_WIDTH 1 /* IM_CS_INT */
|
||||
#define WM831X_IM_RTC_INT 0x0020 /* IM_RTC_INT */
|
||||
#define WM831X_IM_RTC_INT_MASK 0x0020 /* IM_RTC_INT */
|
||||
#define WM831X_IM_RTC_INT_SHIFT 5 /* IM_RTC_INT */
|
||||
#define WM831X_IM_RTC_INT_WIDTH 1 /* IM_RTC_INT */
|
||||
#define WM831X_IM_OTP_INT 0x0010 /* IM_OTP_INT */
|
||||
#define WM831X_IM_OTP_INT_MASK 0x0010 /* IM_OTP_INT */
|
||||
#define WM831X_IM_OTP_INT_SHIFT 4 /* IM_OTP_INT */
|
||||
#define WM831X_IM_OTP_INT_WIDTH 1 /* IM_OTP_INT */
|
||||
#define WM831X_IM_CHILD_INT 0x0008 /* IM_CHILD_INT */
|
||||
#define WM831X_IM_CHILD_INT_MASK 0x0008 /* IM_CHILD_INT */
|
||||
#define WM831X_IM_CHILD_INT_SHIFT 3 /* IM_CHILD_INT */
|
||||
#define WM831X_IM_CHILD_INT_WIDTH 1 /* IM_CHILD_INT */
|
||||
#define WM831X_IM_CHG_INT 0x0004 /* IM_CHG_INT */
|
||||
#define WM831X_IM_CHG_INT_MASK 0x0004 /* IM_CHG_INT */
|
||||
#define WM831X_IM_CHG_INT_SHIFT 2 /* IM_CHG_INT */
|
||||
#define WM831X_IM_CHG_INT_WIDTH 1 /* IM_CHG_INT */
|
||||
#define WM831X_IM_HC_INT 0x0002 /* IM_HC_INT */
|
||||
#define WM831X_IM_HC_INT_MASK 0x0002 /* IM_HC_INT */
|
||||
#define WM831X_IM_HC_INT_SHIFT 1 /* IM_HC_INT */
|
||||
#define WM831X_IM_HC_INT_WIDTH 1 /* IM_HC_INT */
|
||||
#define WM831X_IM_UV_INT 0x0001 /* IM_UV_INT */
|
||||
#define WM831X_IM_UV_INT_MASK 0x0001 /* IM_UV_INT */
|
||||
#define WM831X_IM_UV_INT_SHIFT 0 /* IM_UV_INT */
|
||||
#define WM831X_IM_UV_INT_WIDTH 1 /* IM_UV_INT */
|
||||
|
||||
/*
|
||||
* R16409 (0x4019) - Interrupt Status 1 Mask
|
||||
*/
|
||||
#define WM831X_IM_PPM_SYSLO_EINT 0x8000 /* IM_PPM_SYSLO_EINT */
|
||||
#define WM831X_IM_PPM_SYSLO_EINT_MASK 0x8000 /* IM_PPM_SYSLO_EINT */
|
||||
#define WM831X_IM_PPM_SYSLO_EINT_SHIFT 15 /* IM_PPM_SYSLO_EINT */
|
||||
#define WM831X_IM_PPM_SYSLO_EINT_WIDTH 1 /* IM_PPM_SYSLO_EINT */
|
||||
#define WM831X_IM_PPM_PWR_SRC_EINT 0x4000 /* IM_PPM_PWR_SRC_EINT */
|
||||
#define WM831X_IM_PPM_PWR_SRC_EINT_MASK 0x4000 /* IM_PPM_PWR_SRC_EINT */
|
||||
#define WM831X_IM_PPM_PWR_SRC_EINT_SHIFT 14 /* IM_PPM_PWR_SRC_EINT */
|
||||
#define WM831X_IM_PPM_PWR_SRC_EINT_WIDTH 1 /* IM_PPM_PWR_SRC_EINT */
|
||||
#define WM831X_IM_PPM_USB_CURR_EINT 0x2000 /* IM_PPM_USB_CURR_EINT */
|
||||
#define WM831X_IM_PPM_USB_CURR_EINT_MASK 0x2000 /* IM_PPM_USB_CURR_EINT */
|
||||
#define WM831X_IM_PPM_USB_CURR_EINT_SHIFT 13 /* IM_PPM_USB_CURR_EINT */
|
||||
#define WM831X_IM_PPM_USB_CURR_EINT_WIDTH 1 /* IM_PPM_USB_CURR_EINT */
|
||||
#define WM831X_IM_ON_PIN_EINT 0x1000 /* IM_ON_PIN_EINT */
|
||||
#define WM831X_IM_ON_PIN_EINT_MASK 0x1000 /* IM_ON_PIN_EINT */
|
||||
#define WM831X_IM_ON_PIN_EINT_SHIFT 12 /* IM_ON_PIN_EINT */
|
||||
#define WM831X_IM_ON_PIN_EINT_WIDTH 1 /* IM_ON_PIN_EINT */
|
||||
#define WM831X_IM_WDOG_TO_EINT 0x0800 /* IM_WDOG_TO_EINT */
|
||||
#define WM831X_IM_WDOG_TO_EINT_MASK 0x0800 /* IM_WDOG_TO_EINT */
|
||||
#define WM831X_IM_WDOG_TO_EINT_SHIFT 11 /* IM_WDOG_TO_EINT */
|
||||
#define WM831X_IM_WDOG_TO_EINT_WIDTH 1 /* IM_WDOG_TO_EINT */
|
||||
#define WM831X_IM_TCHDATA_EINT 0x0400 /* IM_TCHDATA_EINT */
|
||||
#define WM831X_IM_TCHDATA_EINT_MASK 0x0400 /* IM_TCHDATA_EINT */
|
||||
#define WM831X_IM_TCHDATA_EINT_SHIFT 10 /* IM_TCHDATA_EINT */
|
||||
#define WM831X_IM_TCHDATA_EINT_WIDTH 1 /* IM_TCHDATA_EINT */
|
||||
#define WM831X_IM_TCHPD_EINT 0x0200 /* IM_TCHPD_EINT */
|
||||
#define WM831X_IM_TCHPD_EINT_MASK 0x0200 /* IM_TCHPD_EINT */
|
||||
#define WM831X_IM_TCHPD_EINT_SHIFT 9 /* IM_TCHPD_EINT */
|
||||
#define WM831X_IM_TCHPD_EINT_WIDTH 1 /* IM_TCHPD_EINT */
|
||||
#define WM831X_IM_AUXADC_DATA_EINT 0x0100 /* IM_AUXADC_DATA_EINT */
|
||||
#define WM831X_IM_AUXADC_DATA_EINT_MASK 0x0100 /* IM_AUXADC_DATA_EINT */
|
||||
#define WM831X_IM_AUXADC_DATA_EINT_SHIFT 8 /* IM_AUXADC_DATA_EINT */
|
||||
#define WM831X_IM_AUXADC_DATA_EINT_WIDTH 1 /* IM_AUXADC_DATA_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP4_EINT 0x0080 /* IM_AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP4_EINT_MASK 0x0080 /* IM_AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP4_EINT_SHIFT 7 /* IM_AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP4_EINT_WIDTH 1 /* IM_AUXADC_DCOMP4_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP3_EINT 0x0040 /* IM_AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP3_EINT_MASK 0x0040 /* IM_AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP3_EINT_SHIFT 6 /* IM_AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP3_EINT_WIDTH 1 /* IM_AUXADC_DCOMP3_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP2_EINT 0x0020 /* IM_AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP2_EINT_MASK 0x0020 /* IM_AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP2_EINT_SHIFT 5 /* IM_AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP2_EINT_WIDTH 1 /* IM_AUXADC_DCOMP2_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP1_EINT 0x0010 /* IM_AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP1_EINT_MASK 0x0010 /* IM_AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP1_EINT_SHIFT 4 /* IM_AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_IM_AUXADC_DCOMP1_EINT_WIDTH 1 /* IM_AUXADC_DCOMP1_EINT */
|
||||
#define WM831X_IM_RTC_PER_EINT 0x0008 /* IM_RTC_PER_EINT */
|
||||
#define WM831X_IM_RTC_PER_EINT_MASK 0x0008 /* IM_RTC_PER_EINT */
|
||||
#define WM831X_IM_RTC_PER_EINT_SHIFT 3 /* IM_RTC_PER_EINT */
|
||||
#define WM831X_IM_RTC_PER_EINT_WIDTH 1 /* IM_RTC_PER_EINT */
|
||||
#define WM831X_IM_RTC_ALM_EINT 0x0004 /* IM_RTC_ALM_EINT */
|
||||
#define WM831X_IM_RTC_ALM_EINT_MASK 0x0004 /* IM_RTC_ALM_EINT */
|
||||
#define WM831X_IM_RTC_ALM_EINT_SHIFT 2 /* IM_RTC_ALM_EINT */
|
||||
#define WM831X_IM_RTC_ALM_EINT_WIDTH 1 /* IM_RTC_ALM_EINT */
|
||||
#define WM831X_IM_TEMP_THW_EINT 0x0002 /* IM_TEMP_THW_EINT */
|
||||
#define WM831X_IM_TEMP_THW_EINT_MASK 0x0002 /* IM_TEMP_THW_EINT */
|
||||
#define WM831X_IM_TEMP_THW_EINT_SHIFT 1 /* IM_TEMP_THW_EINT */
|
||||
#define WM831X_IM_TEMP_THW_EINT_WIDTH 1 /* IM_TEMP_THW_EINT */
|
||||
|
||||
/*
|
||||
* R16410 (0x401A) - Interrupt Status 2 Mask
|
||||
*/
|
||||
#define WM831X_IM_CHG_BATT_HOT_EINT 0x8000 /* IM_CHG_BATT_HOT_EINT */
|
||||
#define WM831X_IM_CHG_BATT_HOT_EINT_MASK 0x8000 /* IM_CHG_BATT_HOT_EINT */
|
||||
#define WM831X_IM_CHG_BATT_HOT_EINT_SHIFT 15 /* IM_CHG_BATT_HOT_EINT */
|
||||
#define WM831X_IM_CHG_BATT_HOT_EINT_WIDTH 1 /* IM_CHG_BATT_HOT_EINT */
|
||||
#define WM831X_IM_CHG_BATT_COLD_EINT 0x4000 /* IM_CHG_BATT_COLD_EINT */
|
||||
#define WM831X_IM_CHG_BATT_COLD_EINT_MASK 0x4000 /* IM_CHG_BATT_COLD_EINT */
|
||||
#define WM831X_IM_CHG_BATT_COLD_EINT_SHIFT 14 /* IM_CHG_BATT_COLD_EINT */
|
||||
#define WM831X_IM_CHG_BATT_COLD_EINT_WIDTH 1 /* IM_CHG_BATT_COLD_EINT */
|
||||
#define WM831X_IM_CHG_BATT_FAIL_EINT 0x2000 /* IM_CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_IM_CHG_BATT_FAIL_EINT_MASK 0x2000 /* IM_CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_IM_CHG_BATT_FAIL_EINT_SHIFT 13 /* IM_CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_IM_CHG_BATT_FAIL_EINT_WIDTH 1 /* IM_CHG_BATT_FAIL_EINT */
|
||||
#define WM831X_IM_CHG_OV_EINT 0x1000 /* IM_CHG_OV_EINT */
|
||||
#define WM831X_IM_CHG_OV_EINT_MASK 0x1000 /* IM_CHG_OV_EINT */
|
||||
#define WM831X_IM_CHG_OV_EINT_SHIFT 12 /* IM_CHG_OV_EINT */
|
||||
#define WM831X_IM_CHG_OV_EINT_WIDTH 1 /* IM_CHG_OV_EINT */
|
||||
#define WM831X_IM_CHG_END_EINT 0x0800 /* IM_CHG_END_EINT */
|
||||
#define WM831X_IM_CHG_END_EINT_MASK 0x0800 /* IM_CHG_END_EINT */
|
||||
#define WM831X_IM_CHG_END_EINT_SHIFT 11 /* IM_CHG_END_EINT */
|
||||
#define WM831X_IM_CHG_END_EINT_WIDTH 1 /* IM_CHG_END_EINT */
|
||||
#define WM831X_IM_CHG_TO_EINT 0x0400 /* IM_CHG_TO_EINT */
|
||||
#define WM831X_IM_CHG_TO_EINT_MASK 0x0400 /* IM_CHG_TO_EINT */
|
||||
#define WM831X_IM_CHG_TO_EINT_SHIFT 10 /* IM_CHG_TO_EINT */
|
||||
#define WM831X_IM_CHG_TO_EINT_WIDTH 1 /* IM_CHG_TO_EINT */
|
||||
#define WM831X_IM_CHG_MODE_EINT 0x0200 /* IM_CHG_MODE_EINT */
|
||||
#define WM831X_IM_CHG_MODE_EINT_MASK 0x0200 /* IM_CHG_MODE_EINT */
|
||||
#define WM831X_IM_CHG_MODE_EINT_SHIFT 9 /* IM_CHG_MODE_EINT */
|
||||
#define WM831X_IM_CHG_MODE_EINT_WIDTH 1 /* IM_CHG_MODE_EINT */
|
||||
#define WM831X_IM_CHG_START_EINT 0x0100 /* IM_CHG_START_EINT */
|
||||
#define WM831X_IM_CHG_START_EINT_MASK 0x0100 /* IM_CHG_START_EINT */
|
||||
#define WM831X_IM_CHG_START_EINT_SHIFT 8 /* IM_CHG_START_EINT */
|
||||
#define WM831X_IM_CHG_START_EINT_WIDTH 1 /* IM_CHG_START_EINT */
|
||||
#define WM831X_IM_CS2_EINT 0x0080 /* IM_CS2_EINT */
|
||||
#define WM831X_IM_CS2_EINT_MASK 0x0080 /* IM_CS2_EINT */
|
||||
#define WM831X_IM_CS2_EINT_SHIFT 7 /* IM_CS2_EINT */
|
||||
#define WM831X_IM_CS2_EINT_WIDTH 1 /* IM_CS2_EINT */
|
||||
#define WM831X_IM_CS1_EINT 0x0040 /* IM_CS1_EINT */
|
||||
#define WM831X_IM_CS1_EINT_MASK 0x0040 /* IM_CS1_EINT */
|
||||
#define WM831X_IM_CS1_EINT_SHIFT 6 /* IM_CS1_EINT */
|
||||
#define WM831X_IM_CS1_EINT_WIDTH 1 /* IM_CS1_EINT */
|
||||
#define WM831X_IM_OTP_CMD_END_EINT 0x0020 /* IM_OTP_CMD_END_EINT */
|
||||
#define WM831X_IM_OTP_CMD_END_EINT_MASK 0x0020 /* IM_OTP_CMD_END_EINT */
|
||||
#define WM831X_IM_OTP_CMD_END_EINT_SHIFT 5 /* IM_OTP_CMD_END_EINT */
|
||||
#define WM831X_IM_OTP_CMD_END_EINT_WIDTH 1 /* IM_OTP_CMD_END_EINT */
|
||||
#define WM831X_IM_OTP_ERR_EINT 0x0010 /* IM_OTP_ERR_EINT */
|
||||
#define WM831X_IM_OTP_ERR_EINT_MASK 0x0010 /* IM_OTP_ERR_EINT */
|
||||
#define WM831X_IM_OTP_ERR_EINT_SHIFT 4 /* IM_OTP_ERR_EINT */
|
||||
#define WM831X_IM_OTP_ERR_EINT_WIDTH 1 /* IM_OTP_ERR_EINT */
|
||||
#define WM831X_IM_PS_POR_EINT 0x0004 /* IM_PS_POR_EINT */
|
||||
#define WM831X_IM_PS_POR_EINT_MASK 0x0004 /* IM_PS_POR_EINT */
|
||||
#define WM831X_IM_PS_POR_EINT_SHIFT 2 /* IM_PS_POR_EINT */
|
||||
#define WM831X_IM_PS_POR_EINT_WIDTH 1 /* IM_PS_POR_EINT */
|
||||
#define WM831X_IM_PS_SLEEP_OFF_EINT 0x0002 /* IM_PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_IM_PS_SLEEP_OFF_EINT_MASK 0x0002 /* IM_PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_IM_PS_SLEEP_OFF_EINT_SHIFT 1 /* IM_PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_IM_PS_SLEEP_OFF_EINT_WIDTH 1 /* IM_PS_SLEEP_OFF_EINT */
|
||||
#define WM831X_IM_PS_ON_WAKE_EINT 0x0001 /* IM_PS_ON_WAKE_EINT */
|
||||
#define WM831X_IM_PS_ON_WAKE_EINT_MASK 0x0001 /* IM_PS_ON_WAKE_EINT */
|
||||
#define WM831X_IM_PS_ON_WAKE_EINT_SHIFT 0 /* IM_PS_ON_WAKE_EINT */
|
||||
#define WM831X_IM_PS_ON_WAKE_EINT_WIDTH 1 /* IM_PS_ON_WAKE_EINT */
|
||||
|
||||
/*
|
||||
* R16411 (0x401B) - Interrupt Status 3 Mask
|
||||
*/
|
||||
#define WM831X_IM_UV_LDO10_EINT 0x0200 /* IM_UV_LDO10_EINT */
|
||||
#define WM831X_IM_UV_LDO10_EINT_MASK 0x0200 /* IM_UV_LDO10_EINT */
|
||||
#define WM831X_IM_UV_LDO10_EINT_SHIFT 9 /* IM_UV_LDO10_EINT */
|
||||
#define WM831X_IM_UV_LDO10_EINT_WIDTH 1 /* IM_UV_LDO10_EINT */
|
||||
#define WM831X_IM_UV_LDO9_EINT 0x0100 /* IM_UV_LDO9_EINT */
|
||||
#define WM831X_IM_UV_LDO9_EINT_MASK 0x0100 /* IM_UV_LDO9_EINT */
|
||||
#define WM831X_IM_UV_LDO9_EINT_SHIFT 8 /* IM_UV_LDO9_EINT */
|
||||
#define WM831X_IM_UV_LDO9_EINT_WIDTH 1 /* IM_UV_LDO9_EINT */
|
||||
#define WM831X_IM_UV_LDO8_EINT 0x0080 /* IM_UV_LDO8_EINT */
|
||||
#define WM831X_IM_UV_LDO8_EINT_MASK 0x0080 /* IM_UV_LDO8_EINT */
|
||||
#define WM831X_IM_UV_LDO8_EINT_SHIFT 7 /* IM_UV_LDO8_EINT */
|
||||
#define WM831X_IM_UV_LDO8_EINT_WIDTH 1 /* IM_UV_LDO8_EINT */
|
||||
#define WM831X_IM_UV_LDO7_EINT 0x0040 /* IM_UV_LDO7_EINT */
|
||||
#define WM831X_IM_UV_LDO7_EINT_MASK 0x0040 /* IM_UV_LDO7_EINT */
|
||||
#define WM831X_IM_UV_LDO7_EINT_SHIFT 6 /* IM_UV_LDO7_EINT */
|
||||
#define WM831X_IM_UV_LDO7_EINT_WIDTH 1 /* IM_UV_LDO7_EINT */
|
||||
#define WM831X_IM_UV_LDO6_EINT 0x0020 /* IM_UV_LDO6_EINT */
|
||||
#define WM831X_IM_UV_LDO6_EINT_MASK 0x0020 /* IM_UV_LDO6_EINT */
|
||||
#define WM831X_IM_UV_LDO6_EINT_SHIFT 5 /* IM_UV_LDO6_EINT */
|
||||
#define WM831X_IM_UV_LDO6_EINT_WIDTH 1 /* IM_UV_LDO6_EINT */
|
||||
#define WM831X_IM_UV_LDO5_EINT 0x0010 /* IM_UV_LDO5_EINT */
|
||||
#define WM831X_IM_UV_LDO5_EINT_MASK 0x0010 /* IM_UV_LDO5_EINT */
|
||||
#define WM831X_IM_UV_LDO5_EINT_SHIFT 4 /* IM_UV_LDO5_EINT */
|
||||
#define WM831X_IM_UV_LDO5_EINT_WIDTH 1 /* IM_UV_LDO5_EINT */
|
||||
#define WM831X_IM_UV_LDO4_EINT 0x0008 /* IM_UV_LDO4_EINT */
|
||||
#define WM831X_IM_UV_LDO4_EINT_MASK 0x0008 /* IM_UV_LDO4_EINT */
|
||||
#define WM831X_IM_UV_LDO4_EINT_SHIFT 3 /* IM_UV_LDO4_EINT */
|
||||
#define WM831X_IM_UV_LDO4_EINT_WIDTH 1 /* IM_UV_LDO4_EINT */
|
||||
#define WM831X_IM_UV_LDO3_EINT 0x0004 /* IM_UV_LDO3_EINT */
|
||||
#define WM831X_IM_UV_LDO3_EINT_MASK 0x0004 /* IM_UV_LDO3_EINT */
|
||||
#define WM831X_IM_UV_LDO3_EINT_SHIFT 2 /* IM_UV_LDO3_EINT */
|
||||
#define WM831X_IM_UV_LDO3_EINT_WIDTH 1 /* IM_UV_LDO3_EINT */
|
||||
#define WM831X_IM_UV_LDO2_EINT 0x0002 /* IM_UV_LDO2_EINT */
|
||||
#define WM831X_IM_UV_LDO2_EINT_MASK 0x0002 /* IM_UV_LDO2_EINT */
|
||||
#define WM831X_IM_UV_LDO2_EINT_SHIFT 1 /* IM_UV_LDO2_EINT */
|
||||
#define WM831X_IM_UV_LDO2_EINT_WIDTH 1 /* IM_UV_LDO2_EINT */
|
||||
#define WM831X_IM_UV_LDO1_EINT 0x0001 /* IM_UV_LDO1_EINT */
|
||||
#define WM831X_IM_UV_LDO1_EINT_MASK 0x0001 /* IM_UV_LDO1_EINT */
|
||||
#define WM831X_IM_UV_LDO1_EINT_SHIFT 0 /* IM_UV_LDO1_EINT */
|
||||
#define WM831X_IM_UV_LDO1_EINT_WIDTH 1 /* IM_UV_LDO1_EINT */
|
||||
|
||||
/*
|
||||
* R16412 (0x401C) - Interrupt Status 4 Mask
|
||||
*/
|
||||
#define WM831X_IM_HC_DC2_EINT 0x0200 /* IM_HC_DC2_EINT */
|
||||
#define WM831X_IM_HC_DC2_EINT_MASK 0x0200 /* IM_HC_DC2_EINT */
|
||||
#define WM831X_IM_HC_DC2_EINT_SHIFT 9 /* IM_HC_DC2_EINT */
|
||||
#define WM831X_IM_HC_DC2_EINT_WIDTH 1 /* IM_HC_DC2_EINT */
|
||||
#define WM831X_IM_HC_DC1_EINT 0x0100 /* IM_HC_DC1_EINT */
|
||||
#define WM831X_IM_HC_DC1_EINT_MASK 0x0100 /* IM_HC_DC1_EINT */
|
||||
#define WM831X_IM_HC_DC1_EINT_SHIFT 8 /* IM_HC_DC1_EINT */
|
||||
#define WM831X_IM_HC_DC1_EINT_WIDTH 1 /* IM_HC_DC1_EINT */
|
||||
#define WM831X_IM_UV_DC4_EINT 0x0008 /* IM_UV_DC4_EINT */
|
||||
#define WM831X_IM_UV_DC4_EINT_MASK 0x0008 /* IM_UV_DC4_EINT */
|
||||
#define WM831X_IM_UV_DC4_EINT_SHIFT 3 /* IM_UV_DC4_EINT */
|
||||
#define WM831X_IM_UV_DC4_EINT_WIDTH 1 /* IM_UV_DC4_EINT */
|
||||
#define WM831X_IM_UV_DC3_EINT 0x0004 /* IM_UV_DC3_EINT */
|
||||
#define WM831X_IM_UV_DC3_EINT_MASK 0x0004 /* IM_UV_DC3_EINT */
|
||||
#define WM831X_IM_UV_DC3_EINT_SHIFT 2 /* IM_UV_DC3_EINT */
|
||||
#define WM831X_IM_UV_DC3_EINT_WIDTH 1 /* IM_UV_DC3_EINT */
|
||||
#define WM831X_IM_UV_DC2_EINT 0x0002 /* IM_UV_DC2_EINT */
|
||||
#define WM831X_IM_UV_DC2_EINT_MASK 0x0002 /* IM_UV_DC2_EINT */
|
||||
#define WM831X_IM_UV_DC2_EINT_SHIFT 1 /* IM_UV_DC2_EINT */
|
||||
#define WM831X_IM_UV_DC2_EINT_WIDTH 1 /* IM_UV_DC2_EINT */
|
||||
#define WM831X_IM_UV_DC1_EINT 0x0001 /* IM_UV_DC1_EINT */
|
||||
#define WM831X_IM_UV_DC1_EINT_MASK 0x0001 /* IM_UV_DC1_EINT */
|
||||
#define WM831X_IM_UV_DC1_EINT_SHIFT 0 /* IM_UV_DC1_EINT */
|
||||
#define WM831X_IM_UV_DC1_EINT_WIDTH 1 /* IM_UV_DC1_EINT */
|
||||
|
||||
/*
|
||||
* R16413 (0x401D) - Interrupt Status 5 Mask
|
||||
*/
|
||||
#define WM831X_IM_GP16_EINT 0x8000 /* IM_GP16_EINT */
|
||||
#define WM831X_IM_GP16_EINT_MASK 0x8000 /* IM_GP16_EINT */
|
||||
#define WM831X_IM_GP16_EINT_SHIFT 15 /* IM_GP16_EINT */
|
||||
#define WM831X_IM_GP16_EINT_WIDTH 1 /* IM_GP16_EINT */
|
||||
#define WM831X_IM_GP15_EINT 0x4000 /* IM_GP15_EINT */
|
||||
#define WM831X_IM_GP15_EINT_MASK 0x4000 /* IM_GP15_EINT */
|
||||
#define WM831X_IM_GP15_EINT_SHIFT 14 /* IM_GP15_EINT */
|
||||
#define WM831X_IM_GP15_EINT_WIDTH 1 /* IM_GP15_EINT */
|
||||
#define WM831X_IM_GP14_EINT 0x2000 /* IM_GP14_EINT */
|
||||
#define WM831X_IM_GP14_EINT_MASK 0x2000 /* IM_GP14_EINT */
|
||||
#define WM831X_IM_GP14_EINT_SHIFT 13 /* IM_GP14_EINT */
|
||||
#define WM831X_IM_GP14_EINT_WIDTH 1 /* IM_GP14_EINT */
|
||||
#define WM831X_IM_GP13_EINT 0x1000 /* IM_GP13_EINT */
|
||||
#define WM831X_IM_GP13_EINT_MASK 0x1000 /* IM_GP13_EINT */
|
||||
#define WM831X_IM_GP13_EINT_SHIFT 12 /* IM_GP13_EINT */
|
||||
#define WM831X_IM_GP13_EINT_WIDTH 1 /* IM_GP13_EINT */
|
||||
#define WM831X_IM_GP12_EINT 0x0800 /* IM_GP12_EINT */
|
||||
#define WM831X_IM_GP12_EINT_MASK 0x0800 /* IM_GP12_EINT */
|
||||
#define WM831X_IM_GP12_EINT_SHIFT 11 /* IM_GP12_EINT */
|
||||
#define WM831X_IM_GP12_EINT_WIDTH 1 /* IM_GP12_EINT */
|
||||
#define WM831X_IM_GP11_EINT 0x0400 /* IM_GP11_EINT */
|
||||
#define WM831X_IM_GP11_EINT_MASK 0x0400 /* IM_GP11_EINT */
|
||||
#define WM831X_IM_GP11_EINT_SHIFT 10 /* IM_GP11_EINT */
|
||||
#define WM831X_IM_GP11_EINT_WIDTH 1 /* IM_GP11_EINT */
|
||||
#define WM831X_IM_GP10_EINT 0x0200 /* IM_GP10_EINT */
|
||||
#define WM831X_IM_GP10_EINT_MASK 0x0200 /* IM_GP10_EINT */
|
||||
#define WM831X_IM_GP10_EINT_SHIFT 9 /* IM_GP10_EINT */
|
||||
#define WM831X_IM_GP10_EINT_WIDTH 1 /* IM_GP10_EINT */
|
||||
#define WM831X_IM_GP9_EINT 0x0100 /* IM_GP9_EINT */
|
||||
#define WM831X_IM_GP9_EINT_MASK 0x0100 /* IM_GP9_EINT */
|
||||
#define WM831X_IM_GP9_EINT_SHIFT 8 /* IM_GP9_EINT */
|
||||
#define WM831X_IM_GP9_EINT_WIDTH 1 /* IM_GP9_EINT */
|
||||
#define WM831X_IM_GP8_EINT 0x0080 /* IM_GP8_EINT */
|
||||
#define WM831X_IM_GP8_EINT_MASK 0x0080 /* IM_GP8_EINT */
|
||||
#define WM831X_IM_GP8_EINT_SHIFT 7 /* IM_GP8_EINT */
|
||||
#define WM831X_IM_GP8_EINT_WIDTH 1 /* IM_GP8_EINT */
|
||||
#define WM831X_IM_GP7_EINT 0x0040 /* IM_GP7_EINT */
|
||||
#define WM831X_IM_GP7_EINT_MASK 0x0040 /* IM_GP7_EINT */
|
||||
#define WM831X_IM_GP7_EINT_SHIFT 6 /* IM_GP7_EINT */
|
||||
#define WM831X_IM_GP7_EINT_WIDTH 1 /* IM_GP7_EINT */
|
||||
#define WM831X_IM_GP6_EINT 0x0020 /* IM_GP6_EINT */
|
||||
#define WM831X_IM_GP6_EINT_MASK 0x0020 /* IM_GP6_EINT */
|
||||
#define WM831X_IM_GP6_EINT_SHIFT 5 /* IM_GP6_EINT */
|
||||
#define WM831X_IM_GP6_EINT_WIDTH 1 /* IM_GP6_EINT */
|
||||
#define WM831X_IM_GP5_EINT 0x0010 /* IM_GP5_EINT */
|
||||
#define WM831X_IM_GP5_EINT_MASK 0x0010 /* IM_GP5_EINT */
|
||||
#define WM831X_IM_GP5_EINT_SHIFT 4 /* IM_GP5_EINT */
|
||||
#define WM831X_IM_GP5_EINT_WIDTH 1 /* IM_GP5_EINT */
|
||||
#define WM831X_IM_GP4_EINT 0x0008 /* IM_GP4_EINT */
|
||||
#define WM831X_IM_GP4_EINT_MASK 0x0008 /* IM_GP4_EINT */
|
||||
#define WM831X_IM_GP4_EINT_SHIFT 3 /* IM_GP4_EINT */
|
||||
#define WM831X_IM_GP4_EINT_WIDTH 1 /* IM_GP4_EINT */
|
||||
#define WM831X_IM_GP3_EINT 0x0004 /* IM_GP3_EINT */
|
||||
#define WM831X_IM_GP3_EINT_MASK 0x0004 /* IM_GP3_EINT */
|
||||
#define WM831X_IM_GP3_EINT_SHIFT 2 /* IM_GP3_EINT */
|
||||
#define WM831X_IM_GP3_EINT_WIDTH 1 /* IM_GP3_EINT */
|
||||
#define WM831X_IM_GP2_EINT 0x0002 /* IM_GP2_EINT */
|
||||
#define WM831X_IM_GP2_EINT_MASK 0x0002 /* IM_GP2_EINT */
|
||||
#define WM831X_IM_GP2_EINT_SHIFT 1 /* IM_GP2_EINT */
|
||||
#define WM831X_IM_GP2_EINT_WIDTH 1 /* IM_GP2_EINT */
|
||||
#define WM831X_IM_GP1_EINT 0x0001 /* IM_GP1_EINT */
|
||||
#define WM831X_IM_GP1_EINT_MASK 0x0001 /* IM_GP1_EINT */
|
||||
#define WM831X_IM_GP1_EINT_SHIFT 0 /* IM_GP1_EINT */
|
||||
#define WM831X_IM_GP1_EINT_WIDTH 1 /* IM_GP1_EINT */
|
||||
|
||||
|
||||
#endif
|
||||
162
include/linux/mfd/wm831x/otp.h
Normal file
162
include/linux/mfd/wm831x/otp.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/otp.h -- OTP interface for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_OTP_H__
|
||||
#define __MFD_WM831X_OTP_H__
|
||||
|
||||
int wm831x_otp_init(struct wm831x *wm831x);
|
||||
void wm831x_otp_exit(struct wm831x *wm831x);
|
||||
|
||||
/*
|
||||
* R30720 (0x7800) - Unique ID 1
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30721 (0x7801) - Unique ID 2
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30722 (0x7802) - Unique ID 3
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30723 (0x7803) - Unique ID 4
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30724 (0x7804) - Unique ID 5
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30725 (0x7805) - Unique ID 6
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30726 (0x7806) - Unique ID 7
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30727 (0x7807) - Unique ID 8
|
||||
*/
|
||||
#define WM831X_UNIQUE_ID_MASK 0xFFFF /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_SHIFT 0 /* UNIQUE_ID - [15:0] */
|
||||
#define WM831X_UNIQUE_ID_WIDTH 16 /* UNIQUE_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30728 (0x7808) - Factory OTP ID
|
||||
*/
|
||||
#define WM831X_OTP_FACT_ID_MASK 0xFFFE /* OTP_FACT_ID - [15:1] */
|
||||
#define WM831X_OTP_FACT_ID_SHIFT 1 /* OTP_FACT_ID - [15:1] */
|
||||
#define WM831X_OTP_FACT_ID_WIDTH 15 /* OTP_FACT_ID - [15:1] */
|
||||
#define WM831X_OTP_FACT_FINAL 0x0001 /* OTP_FACT_FINAL */
|
||||
#define WM831X_OTP_FACT_FINAL_MASK 0x0001 /* OTP_FACT_FINAL */
|
||||
#define WM831X_OTP_FACT_FINAL_SHIFT 0 /* OTP_FACT_FINAL */
|
||||
#define WM831X_OTP_FACT_FINAL_WIDTH 1 /* OTP_FACT_FINAL */
|
||||
|
||||
/*
|
||||
* R30729 (0x7809) - Factory OTP 1
|
||||
*/
|
||||
#define WM831X_DC3_TRIM_MASK 0xF000 /* DC3_TRIM - [15:12] */
|
||||
#define WM831X_DC3_TRIM_SHIFT 12 /* DC3_TRIM - [15:12] */
|
||||
#define WM831X_DC3_TRIM_WIDTH 4 /* DC3_TRIM - [15:12] */
|
||||
#define WM831X_DC2_TRIM_MASK 0x0FC0 /* DC2_TRIM - [11:6] */
|
||||
#define WM831X_DC2_TRIM_SHIFT 6 /* DC2_TRIM - [11:6] */
|
||||
#define WM831X_DC2_TRIM_WIDTH 6 /* DC2_TRIM - [11:6] */
|
||||
#define WM831X_DC1_TRIM_MASK 0x003F /* DC1_TRIM - [5:0] */
|
||||
#define WM831X_DC1_TRIM_SHIFT 0 /* DC1_TRIM - [5:0] */
|
||||
#define WM831X_DC1_TRIM_WIDTH 6 /* DC1_TRIM - [5:0] */
|
||||
|
||||
/*
|
||||
* R30730 (0x780A) - Factory OTP 2
|
||||
*/
|
||||
#define WM831X_CHIP_ID_MASK 0xFFFF /* CHIP_ID - [15:0] */
|
||||
#define WM831X_CHIP_ID_SHIFT 0 /* CHIP_ID - [15:0] */
|
||||
#define WM831X_CHIP_ID_WIDTH 16 /* CHIP_ID - [15:0] */
|
||||
|
||||
/*
|
||||
* R30731 (0x780B) - Factory OTP 3
|
||||
*/
|
||||
#define WM831X_OSC_TRIM_MASK 0x0780 /* OSC_TRIM - [10:7] */
|
||||
#define WM831X_OSC_TRIM_SHIFT 7 /* OSC_TRIM - [10:7] */
|
||||
#define WM831X_OSC_TRIM_WIDTH 4 /* OSC_TRIM - [10:7] */
|
||||
#define WM831X_BG_TRIM_MASK 0x0078 /* BG_TRIM - [6:3] */
|
||||
#define WM831X_BG_TRIM_SHIFT 3 /* BG_TRIM - [6:3] */
|
||||
#define WM831X_BG_TRIM_WIDTH 4 /* BG_TRIM - [6:3] */
|
||||
#define WM831X_LPBG_TRIM_MASK 0x0007 /* LPBG_TRIM - [2:0] */
|
||||
#define WM831X_LPBG_TRIM_SHIFT 0 /* LPBG_TRIM - [2:0] */
|
||||
#define WM831X_LPBG_TRIM_WIDTH 3 /* LPBG_TRIM - [2:0] */
|
||||
|
||||
/*
|
||||
* R30732 (0x780C) - Factory OTP 4
|
||||
*/
|
||||
#define WM831X_CHILD_I2C_ADDR_MASK 0x00FE /* CHILD_I2C_ADDR - [7:1] */
|
||||
#define WM831X_CHILD_I2C_ADDR_SHIFT 1 /* CHILD_I2C_ADDR - [7:1] */
|
||||
#define WM831X_CHILD_I2C_ADDR_WIDTH 7 /* CHILD_I2C_ADDR - [7:1] */
|
||||
#define WM831X_CH_AW 0x0001 /* CH_AW */
|
||||
#define WM831X_CH_AW_MASK 0x0001 /* CH_AW */
|
||||
#define WM831X_CH_AW_SHIFT 0 /* CH_AW */
|
||||
#define WM831X_CH_AW_WIDTH 1 /* CH_AW */
|
||||
|
||||
/*
|
||||
* R30733 (0x780D) - Factory OTP 5
|
||||
*/
|
||||
#define WM831X_CHARGE_TRIM_MASK 0x003F /* CHARGE_TRIM - [5:0] */
|
||||
#define WM831X_CHARGE_TRIM_SHIFT 0 /* CHARGE_TRIM - [5:0] */
|
||||
#define WM831X_CHARGE_TRIM_WIDTH 6 /* CHARGE_TRIM - [5:0] */
|
||||
|
||||
/*
|
||||
* R30736 (0x7810) - Customer OTP ID
|
||||
*/
|
||||
#define WM831X_OTP_AUTO_PROG 0x8000 /* OTP_AUTO_PROG */
|
||||
#define WM831X_OTP_AUTO_PROG_MASK 0x8000 /* OTP_AUTO_PROG */
|
||||
#define WM831X_OTP_AUTO_PROG_SHIFT 15 /* OTP_AUTO_PROG */
|
||||
#define WM831X_OTP_AUTO_PROG_WIDTH 1 /* OTP_AUTO_PROG */
|
||||
#define WM831X_OTP_CUST_ID_MASK 0x7FFE /* OTP_CUST_ID - [14:1] */
|
||||
#define WM831X_OTP_CUST_ID_SHIFT 1 /* OTP_CUST_ID - [14:1] */
|
||||
#define WM831X_OTP_CUST_ID_WIDTH 14 /* OTP_CUST_ID - [14:1] */
|
||||
#define WM831X_OTP_CUST_FINAL 0x0001 /* OTP_CUST_FINAL */
|
||||
#define WM831X_OTP_CUST_FINAL_MASK 0x0001 /* OTP_CUST_FINAL */
|
||||
#define WM831X_OTP_CUST_FINAL_SHIFT 0 /* OTP_CUST_FINAL */
|
||||
#define WM831X_OTP_CUST_FINAL_WIDTH 1 /* OTP_CUST_FINAL */
|
||||
|
||||
/*
|
||||
* R30759 (0x7827) - DBE CHECK DATA
|
||||
*/
|
||||
#define WM831X_DBE_VALID_DATA_MASK 0xFFFF /* DBE_VALID_DATA - [15:0] */
|
||||
#define WM831X_DBE_VALID_DATA_SHIFT 0 /* DBE_VALID_DATA - [15:0] */
|
||||
#define WM831X_DBE_VALID_DATA_WIDTH 16 /* DBE_VALID_DATA - [15:0] */
|
||||
|
||||
|
||||
#endif
|
||||
113
include/linux/mfd/wm831x/pdata.h
Normal file
113
include/linux/mfd/wm831x/pdata.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/pdata.h -- Platform data for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_PDATA_H__
|
||||
#define __MFD_WM831X_PDATA_H__
|
||||
|
||||
struct wm831x;
|
||||
struct regulator_init_data;
|
||||
|
||||
struct wm831x_backlight_pdata {
|
||||
int isink; /** ISINK to use, 1 or 2 */
|
||||
int max_uA; /** Maximum current to allow */
|
||||
};
|
||||
|
||||
struct wm831x_backup_pdata {
|
||||
int charger_enable;
|
||||
int no_constant_voltage; /** Disable constant voltage charging */
|
||||
int vlim; /** Voltage limit in milivolts */
|
||||
int ilim; /** Current limit in microamps */
|
||||
};
|
||||
|
||||
struct wm831x_battery_pdata {
|
||||
int enable; /** Enable charging */
|
||||
int fast_enable; /** Enable fast charging */
|
||||
int off_mask; /** Mask OFF while charging */
|
||||
int trickle_ilim; /** Trickle charge current limit, in mA */
|
||||
int vsel; /** Target voltage, in mV */
|
||||
int eoc_iterm; /** End of trickle charge current, in mA */
|
||||
int fast_ilim; /** Fast charge current limit, in mA */
|
||||
int timeout; /** Charge cycle timeout, in minutes */
|
||||
};
|
||||
|
||||
/* Sources for status LED configuration. Values are register values
|
||||
* plus 1 to allow for a zero default for preserve.
|
||||
*/
|
||||
enum wm831x_status_src {
|
||||
WM831X_STATUS_PRESERVE = 0, /* Keep the current hardware setting */
|
||||
WM831X_STATUS_OTP = 1,
|
||||
WM831X_STATUS_POWER = 2,
|
||||
WM831X_STATUS_CHARGER = 3,
|
||||
WM831X_STATUS_MANUAL = 4,
|
||||
};
|
||||
|
||||
struct wm831x_status_pdata {
|
||||
enum wm831x_status_src default_src;
|
||||
const char *name;
|
||||
const char *default_trigger;
|
||||
};
|
||||
|
||||
struct wm831x_touch_pdata {
|
||||
int fivewire; /** 1 for five wire mode, 0 for 4 wire */
|
||||
int isel; /** Current for pen down (uA) */
|
||||
int rpu; /** Pen down sensitivity resistor divider */
|
||||
int pressure; /** Report pressure (boolean) */
|
||||
int data_irq; /** Touch data ready IRQ */
|
||||
};
|
||||
|
||||
enum wm831x_watchdog_action {
|
||||
WM831X_WDOG_NONE = 0,
|
||||
WM831X_WDOG_INTERRUPT = 1,
|
||||
WM831X_WDOG_RESET = 2,
|
||||
WM831X_WDOG_WAKE = 3,
|
||||
};
|
||||
|
||||
struct wm831x_watchdog_pdata {
|
||||
enum wm831x_watchdog_action primary, secondary;
|
||||
int update_gpio;
|
||||
unsigned int software:1;
|
||||
};
|
||||
|
||||
#define WM831X_MAX_STATUS 2
|
||||
#define WM831X_MAX_DCDC 4
|
||||
#define WM831X_MAX_EPE 2
|
||||
#define WM831X_MAX_LDO 11
|
||||
#define WM831X_MAX_ISINK 2
|
||||
|
||||
struct wm831x_pdata {
|
||||
/** Called before subdevices are set up */
|
||||
int (*pre_init)(struct wm831x *wm831x);
|
||||
/** Called after subdevices are set up */
|
||||
int (*post_init)(struct wm831x *wm831x);
|
||||
|
||||
int gpio_base;
|
||||
struct wm831x_backlight_pdata *backlight;
|
||||
struct wm831x_backup_pdata *backup;
|
||||
struct wm831x_battery_pdata *battery;
|
||||
struct wm831x_touch_pdata *touch;
|
||||
struct wm831x_watchdog_pdata *watchdog;
|
||||
|
||||
/** LED1 = 0 and so on */
|
||||
struct wm831x_status_pdata *status[WM831X_MAX_STATUS];
|
||||
/** DCDC1 = 0 and so on */
|
||||
struct regulator_init_data *dcdc[WM831X_MAX_DCDC];
|
||||
/** EPE1 = 0 and so on */
|
||||
struct regulator_init_data *epe[WM831X_MAX_EPE];
|
||||
/** LDO1 = 0 and so on */
|
||||
struct regulator_init_data *ldo[WM831X_MAX_LDO];
|
||||
/** ISINK1 = 0 and so on*/
|
||||
struct regulator_init_data *isink[WM831X_MAX_ISINK];
|
||||
};
|
||||
|
||||
#endif
|
||||
189
include/linux/mfd/wm831x/pmu.h
Normal file
189
include/linux/mfd/wm831x/pmu.h
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/pmu.h -- PMU for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_PMU_H__
|
||||
#define __MFD_WM831X_PMU_H__
|
||||
|
||||
/*
|
||||
* R16387 (0x4003) - Power State
|
||||
*/
|
||||
#define WM831X_CHIP_ON 0x8000 /* CHIP_ON */
|
||||
#define WM831X_CHIP_ON_MASK 0x8000 /* CHIP_ON */
|
||||
#define WM831X_CHIP_ON_SHIFT 15 /* CHIP_ON */
|
||||
#define WM831X_CHIP_ON_WIDTH 1 /* CHIP_ON */
|
||||
#define WM831X_CHIP_SLP 0x4000 /* CHIP_SLP */
|
||||
#define WM831X_CHIP_SLP_MASK 0x4000 /* CHIP_SLP */
|
||||
#define WM831X_CHIP_SLP_SHIFT 14 /* CHIP_SLP */
|
||||
#define WM831X_CHIP_SLP_WIDTH 1 /* CHIP_SLP */
|
||||
#define WM831X_REF_LP 0x1000 /* REF_LP */
|
||||
#define WM831X_REF_LP_MASK 0x1000 /* REF_LP */
|
||||
#define WM831X_REF_LP_SHIFT 12 /* REF_LP */
|
||||
#define WM831X_REF_LP_WIDTH 1 /* REF_LP */
|
||||
#define WM831X_PWRSTATE_DLY_MASK 0x0C00 /* PWRSTATE_DLY - [11:10] */
|
||||
#define WM831X_PWRSTATE_DLY_SHIFT 10 /* PWRSTATE_DLY - [11:10] */
|
||||
#define WM831X_PWRSTATE_DLY_WIDTH 2 /* PWRSTATE_DLY - [11:10] */
|
||||
#define WM831X_SWRST_DLY 0x0200 /* SWRST_DLY */
|
||||
#define WM831X_SWRST_DLY_MASK 0x0200 /* SWRST_DLY */
|
||||
#define WM831X_SWRST_DLY_SHIFT 9 /* SWRST_DLY */
|
||||
#define WM831X_SWRST_DLY_WIDTH 1 /* SWRST_DLY */
|
||||
#define WM831X_USB100MA_STARTUP_MASK 0x0030 /* USB100MA_STARTUP - [5:4] */
|
||||
#define WM831X_USB100MA_STARTUP_SHIFT 4 /* USB100MA_STARTUP - [5:4] */
|
||||
#define WM831X_USB100MA_STARTUP_WIDTH 2 /* USB100MA_STARTUP - [5:4] */
|
||||
#define WM831X_USB_CURR_STS 0x0008 /* USB_CURR_STS */
|
||||
#define WM831X_USB_CURR_STS_MASK 0x0008 /* USB_CURR_STS */
|
||||
#define WM831X_USB_CURR_STS_SHIFT 3 /* USB_CURR_STS */
|
||||
#define WM831X_USB_CURR_STS_WIDTH 1 /* USB_CURR_STS */
|
||||
#define WM831X_USB_ILIM_MASK 0x0007 /* USB_ILIM - [2:0] */
|
||||
#define WM831X_USB_ILIM_SHIFT 0 /* USB_ILIM - [2:0] */
|
||||
#define WM831X_USB_ILIM_WIDTH 3 /* USB_ILIM - [2:0] */
|
||||
|
||||
/*
|
||||
* R16397 (0x400D) - System Status
|
||||
*/
|
||||
#define WM831X_THW_STS 0x8000 /* THW_STS */
|
||||
#define WM831X_THW_STS_MASK 0x8000 /* THW_STS */
|
||||
#define WM831X_THW_STS_SHIFT 15 /* THW_STS */
|
||||
#define WM831X_THW_STS_WIDTH 1 /* THW_STS */
|
||||
#define WM831X_PWR_SRC_BATT 0x0400 /* PWR_SRC_BATT */
|
||||
#define WM831X_PWR_SRC_BATT_MASK 0x0400 /* PWR_SRC_BATT */
|
||||
#define WM831X_PWR_SRC_BATT_SHIFT 10 /* PWR_SRC_BATT */
|
||||
#define WM831X_PWR_SRC_BATT_WIDTH 1 /* PWR_SRC_BATT */
|
||||
#define WM831X_PWR_WALL 0x0200 /* PWR_WALL */
|
||||
#define WM831X_PWR_WALL_MASK 0x0200 /* PWR_WALL */
|
||||
#define WM831X_PWR_WALL_SHIFT 9 /* PWR_WALL */
|
||||
#define WM831X_PWR_WALL_WIDTH 1 /* PWR_WALL */
|
||||
#define WM831X_PWR_USB 0x0100 /* PWR_USB */
|
||||
#define WM831X_PWR_USB_MASK 0x0100 /* PWR_USB */
|
||||
#define WM831X_PWR_USB_SHIFT 8 /* PWR_USB */
|
||||
#define WM831X_PWR_USB_WIDTH 1 /* PWR_USB */
|
||||
#define WM831X_MAIN_STATE_MASK 0x001F /* MAIN_STATE - [4:0] */
|
||||
#define WM831X_MAIN_STATE_SHIFT 0 /* MAIN_STATE - [4:0] */
|
||||
#define WM831X_MAIN_STATE_WIDTH 5 /* MAIN_STATE - [4:0] */
|
||||
|
||||
/*
|
||||
* R16456 (0x4048) - Charger Control 1
|
||||
*/
|
||||
#define WM831X_CHG_ENA 0x8000 /* CHG_ENA */
|
||||
#define WM831X_CHG_ENA_MASK 0x8000 /* CHG_ENA */
|
||||
#define WM831X_CHG_ENA_SHIFT 15 /* CHG_ENA */
|
||||
#define WM831X_CHG_ENA_WIDTH 1 /* CHG_ENA */
|
||||
#define WM831X_CHG_FRC 0x4000 /* CHG_FRC */
|
||||
#define WM831X_CHG_FRC_MASK 0x4000 /* CHG_FRC */
|
||||
#define WM831X_CHG_FRC_SHIFT 14 /* CHG_FRC */
|
||||
#define WM831X_CHG_FRC_WIDTH 1 /* CHG_FRC */
|
||||
#define WM831X_CHG_ITERM_MASK 0x1C00 /* CHG_ITERM - [12:10] */
|
||||
#define WM831X_CHG_ITERM_SHIFT 10 /* CHG_ITERM - [12:10] */
|
||||
#define WM831X_CHG_ITERM_WIDTH 3 /* CHG_ITERM - [12:10] */
|
||||
#define WM831X_CHG_FAST 0x0020 /* CHG_FAST */
|
||||
#define WM831X_CHG_FAST_MASK 0x0020 /* CHG_FAST */
|
||||
#define WM831X_CHG_FAST_SHIFT 5 /* CHG_FAST */
|
||||
#define WM831X_CHG_FAST_WIDTH 1 /* CHG_FAST */
|
||||
#define WM831X_CHG_IMON_ENA 0x0002 /* CHG_IMON_ENA */
|
||||
#define WM831X_CHG_IMON_ENA_MASK 0x0002 /* CHG_IMON_ENA */
|
||||
#define WM831X_CHG_IMON_ENA_SHIFT 1 /* CHG_IMON_ENA */
|
||||
#define WM831X_CHG_IMON_ENA_WIDTH 1 /* CHG_IMON_ENA */
|
||||
#define WM831X_CHG_CHIP_TEMP_MON 0x0001 /* CHG_CHIP_TEMP_MON */
|
||||
#define WM831X_CHG_CHIP_TEMP_MON_MASK 0x0001 /* CHG_CHIP_TEMP_MON */
|
||||
#define WM831X_CHG_CHIP_TEMP_MON_SHIFT 0 /* CHG_CHIP_TEMP_MON */
|
||||
#define WM831X_CHG_CHIP_TEMP_MON_WIDTH 1 /* CHG_CHIP_TEMP_MON */
|
||||
|
||||
/*
|
||||
* R16457 (0x4049) - Charger Control 2
|
||||
*/
|
||||
#define WM831X_CHG_OFF_MSK 0x4000 /* CHG_OFF_MSK */
|
||||
#define WM831X_CHG_OFF_MSK_MASK 0x4000 /* CHG_OFF_MSK */
|
||||
#define WM831X_CHG_OFF_MSK_SHIFT 14 /* CHG_OFF_MSK */
|
||||
#define WM831X_CHG_OFF_MSK_WIDTH 1 /* CHG_OFF_MSK */
|
||||
#define WM831X_CHG_TIME_MASK 0x0F00 /* CHG_TIME - [11:8] */
|
||||
#define WM831X_CHG_TIME_SHIFT 8 /* CHG_TIME - [11:8] */
|
||||
#define WM831X_CHG_TIME_WIDTH 4 /* CHG_TIME - [11:8] */
|
||||
#define WM831X_CHG_TRKL_ILIM_MASK 0x00C0 /* CHG_TRKL_ILIM - [7:6] */
|
||||
#define WM831X_CHG_TRKL_ILIM_SHIFT 6 /* CHG_TRKL_ILIM - [7:6] */
|
||||
#define WM831X_CHG_TRKL_ILIM_WIDTH 2 /* CHG_TRKL_ILIM - [7:6] */
|
||||
#define WM831X_CHG_VSEL_MASK 0x0030 /* CHG_VSEL - [5:4] */
|
||||
#define WM831X_CHG_VSEL_SHIFT 4 /* CHG_VSEL - [5:4] */
|
||||
#define WM831X_CHG_VSEL_WIDTH 2 /* CHG_VSEL - [5:4] */
|
||||
#define WM831X_CHG_FAST_ILIM_MASK 0x000F /* CHG_FAST_ILIM - [3:0] */
|
||||
#define WM831X_CHG_FAST_ILIM_SHIFT 0 /* CHG_FAST_ILIM - [3:0] */
|
||||
#define WM831X_CHG_FAST_ILIM_WIDTH 4 /* CHG_FAST_ILIM - [3:0] */
|
||||
|
||||
/*
|
||||
* R16458 (0x404A) - Charger Status
|
||||
*/
|
||||
#define WM831X_BATT_OV_STS 0x8000 /* BATT_OV_STS */
|
||||
#define WM831X_BATT_OV_STS_MASK 0x8000 /* BATT_OV_STS */
|
||||
#define WM831X_BATT_OV_STS_SHIFT 15 /* BATT_OV_STS */
|
||||
#define WM831X_BATT_OV_STS_WIDTH 1 /* BATT_OV_STS */
|
||||
#define WM831X_CHG_STATE_MASK 0x7000 /* CHG_STATE - [14:12] */
|
||||
#define WM831X_CHG_STATE_SHIFT 12 /* CHG_STATE - [14:12] */
|
||||
#define WM831X_CHG_STATE_WIDTH 3 /* CHG_STATE - [14:12] */
|
||||
#define WM831X_BATT_HOT_STS 0x0800 /* BATT_HOT_STS */
|
||||
#define WM831X_BATT_HOT_STS_MASK 0x0800 /* BATT_HOT_STS */
|
||||
#define WM831X_BATT_HOT_STS_SHIFT 11 /* BATT_HOT_STS */
|
||||
#define WM831X_BATT_HOT_STS_WIDTH 1 /* BATT_HOT_STS */
|
||||
#define WM831X_BATT_COLD_STS 0x0400 /* BATT_COLD_STS */
|
||||
#define WM831X_BATT_COLD_STS_MASK 0x0400 /* BATT_COLD_STS */
|
||||
#define WM831X_BATT_COLD_STS_SHIFT 10 /* BATT_COLD_STS */
|
||||
#define WM831X_BATT_COLD_STS_WIDTH 1 /* BATT_COLD_STS */
|
||||
#define WM831X_CHG_TOPOFF 0x0200 /* CHG_TOPOFF */
|
||||
#define WM831X_CHG_TOPOFF_MASK 0x0200 /* CHG_TOPOFF */
|
||||
#define WM831X_CHG_TOPOFF_SHIFT 9 /* CHG_TOPOFF */
|
||||
#define WM831X_CHG_TOPOFF_WIDTH 1 /* CHG_TOPOFF */
|
||||
#define WM831X_CHG_ACTIVE 0x0100 /* CHG_ACTIVE */
|
||||
#define WM831X_CHG_ACTIVE_MASK 0x0100 /* CHG_ACTIVE */
|
||||
#define WM831X_CHG_ACTIVE_SHIFT 8 /* CHG_ACTIVE */
|
||||
#define WM831X_CHG_ACTIVE_WIDTH 1 /* CHG_ACTIVE */
|
||||
#define WM831X_CHG_TIME_ELAPSED_MASK 0x00FF /* CHG_TIME_ELAPSED - [7:0] */
|
||||
#define WM831X_CHG_TIME_ELAPSED_SHIFT 0 /* CHG_TIME_ELAPSED - [7:0] */
|
||||
#define WM831X_CHG_TIME_ELAPSED_WIDTH 8 /* CHG_TIME_ELAPSED - [7:0] */
|
||||
|
||||
#define WM831X_CHG_STATE_OFF (0 << WM831X_CHG_STATE_SHIFT)
|
||||
#define WM831X_CHG_STATE_TRICKLE (1 << WM831X_CHG_STATE_SHIFT)
|
||||
#define WM831X_CHG_STATE_FAST (2 << WM831X_CHG_STATE_SHIFT)
|
||||
#define WM831X_CHG_STATE_TRICKLE_OT (3 << WM831X_CHG_STATE_SHIFT)
|
||||
#define WM831X_CHG_STATE_FAST_OT (4 << WM831X_CHG_STATE_SHIFT)
|
||||
#define WM831X_CHG_STATE_DEFECTIVE (5 << WM831X_CHG_STATE_SHIFT)
|
||||
|
||||
/*
|
||||
* R16459 (0x404B) - Backup Charger Control
|
||||
*/
|
||||
#define WM831X_BKUP_CHG_ENA 0x8000 /* BKUP_CHG_ENA */
|
||||
#define WM831X_BKUP_CHG_ENA_MASK 0x8000 /* BKUP_CHG_ENA */
|
||||
#define WM831X_BKUP_CHG_ENA_SHIFT 15 /* BKUP_CHG_ENA */
|
||||
#define WM831X_BKUP_CHG_ENA_WIDTH 1 /* BKUP_CHG_ENA */
|
||||
#define WM831X_BKUP_CHG_STS 0x4000 /* BKUP_CHG_STS */
|
||||
#define WM831X_BKUP_CHG_STS_MASK 0x4000 /* BKUP_CHG_STS */
|
||||
#define WM831X_BKUP_CHG_STS_SHIFT 14 /* BKUP_CHG_STS */
|
||||
#define WM831X_BKUP_CHG_STS_WIDTH 1 /* BKUP_CHG_STS */
|
||||
#define WM831X_BKUP_CHG_MODE 0x1000 /* BKUP_CHG_MODE */
|
||||
#define WM831X_BKUP_CHG_MODE_MASK 0x1000 /* BKUP_CHG_MODE */
|
||||
#define WM831X_BKUP_CHG_MODE_SHIFT 12 /* BKUP_CHG_MODE */
|
||||
#define WM831X_BKUP_CHG_MODE_WIDTH 1 /* BKUP_CHG_MODE */
|
||||
#define WM831X_BKUP_BATT_DET_ENA 0x0800 /* BKUP_BATT_DET_ENA */
|
||||
#define WM831X_BKUP_BATT_DET_ENA_MASK 0x0800 /* BKUP_BATT_DET_ENA */
|
||||
#define WM831X_BKUP_BATT_DET_ENA_SHIFT 11 /* BKUP_BATT_DET_ENA */
|
||||
#define WM831X_BKUP_BATT_DET_ENA_WIDTH 1 /* BKUP_BATT_DET_ENA */
|
||||
#define WM831X_BKUP_BATT_STS 0x0400 /* BKUP_BATT_STS */
|
||||
#define WM831X_BKUP_BATT_STS_MASK 0x0400 /* BKUP_BATT_STS */
|
||||
#define WM831X_BKUP_BATT_STS_SHIFT 10 /* BKUP_BATT_STS */
|
||||
#define WM831X_BKUP_BATT_STS_WIDTH 1 /* BKUP_BATT_STS */
|
||||
#define WM831X_BKUP_CHG_VLIM 0x0010 /* BKUP_CHG_VLIM */
|
||||
#define WM831X_BKUP_CHG_VLIM_MASK 0x0010 /* BKUP_CHG_VLIM */
|
||||
#define WM831X_BKUP_CHG_VLIM_SHIFT 4 /* BKUP_CHG_VLIM */
|
||||
#define WM831X_BKUP_CHG_VLIM_WIDTH 1 /* BKUP_CHG_VLIM */
|
||||
#define WM831X_BKUP_CHG_ILIM_MASK 0x0003 /* BKUP_CHG_ILIM - [1:0] */
|
||||
#define WM831X_BKUP_CHG_ILIM_SHIFT 0 /* BKUP_CHG_ILIM - [1:0] */
|
||||
#define WM831X_BKUP_CHG_ILIM_WIDTH 2 /* BKUP_CHG_ILIM - [1:0] */
|
||||
|
||||
#endif
|
||||
1218
include/linux/mfd/wm831x/regulator.h
Normal file
1218
include/linux/mfd/wm831x/regulator.h
Normal file
File diff suppressed because it is too large
Load Diff
52
include/linux/mfd/wm831x/watchdog.h
Normal file
52
include/linux/mfd/wm831x/watchdog.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* include/linux/mfd/wm831x/watchdog.h -- Watchdog for WM831x
|
||||
*
|
||||
* Copyright 2009 Wolfson Microelectronics PLC.
|
||||
*
|
||||
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
*
|
||||
* 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 __MFD_WM831X_WATCHDOG_H__
|
||||
#define __MFD_WM831X_WATCHDOG_H__
|
||||
|
||||
|
||||
/*
|
||||
* R16388 (0x4004) - Watchdog
|
||||
*/
|
||||
#define WM831X_WDOG_ENA 0x8000 /* WDOG_ENA */
|
||||
#define WM831X_WDOG_ENA_MASK 0x8000 /* WDOG_ENA */
|
||||
#define WM831X_WDOG_ENA_SHIFT 15 /* WDOG_ENA */
|
||||
#define WM831X_WDOG_ENA_WIDTH 1 /* WDOG_ENA */
|
||||
#define WM831X_WDOG_DEBUG 0x4000 /* WDOG_DEBUG */
|
||||
#define WM831X_WDOG_DEBUG_MASK 0x4000 /* WDOG_DEBUG */
|
||||
#define WM831X_WDOG_DEBUG_SHIFT 14 /* WDOG_DEBUG */
|
||||
#define WM831X_WDOG_DEBUG_WIDTH 1 /* WDOG_DEBUG */
|
||||
#define WM831X_WDOG_RST_SRC 0x2000 /* WDOG_RST_SRC */
|
||||
#define WM831X_WDOG_RST_SRC_MASK 0x2000 /* WDOG_RST_SRC */
|
||||
#define WM831X_WDOG_RST_SRC_SHIFT 13 /* WDOG_RST_SRC */
|
||||
#define WM831X_WDOG_RST_SRC_WIDTH 1 /* WDOG_RST_SRC */
|
||||
#define WM831X_WDOG_SLPENA 0x1000 /* WDOG_SLPENA */
|
||||
#define WM831X_WDOG_SLPENA_MASK 0x1000 /* WDOG_SLPENA */
|
||||
#define WM831X_WDOG_SLPENA_SHIFT 12 /* WDOG_SLPENA */
|
||||
#define WM831X_WDOG_SLPENA_WIDTH 1 /* WDOG_SLPENA */
|
||||
#define WM831X_WDOG_RESET 0x0800 /* WDOG_RESET */
|
||||
#define WM831X_WDOG_RESET_MASK 0x0800 /* WDOG_RESET */
|
||||
#define WM831X_WDOG_RESET_SHIFT 11 /* WDOG_RESET */
|
||||
#define WM831X_WDOG_RESET_WIDTH 1 /* WDOG_RESET */
|
||||
#define WM831X_WDOG_SECACT_MASK 0x0300 /* WDOG_SECACT - [9:8] */
|
||||
#define WM831X_WDOG_SECACT_SHIFT 8 /* WDOG_SECACT - [9:8] */
|
||||
#define WM831X_WDOG_SECACT_WIDTH 2 /* WDOG_SECACT - [9:8] */
|
||||
#define WM831X_WDOG_PRIMACT_MASK 0x0030 /* WDOG_PRIMACT - [5:4] */
|
||||
#define WM831X_WDOG_PRIMACT_SHIFT 4 /* WDOG_PRIMACT - [5:4] */
|
||||
#define WM831X_WDOG_PRIMACT_WIDTH 2 /* WDOG_PRIMACT - [5:4] */
|
||||
#define WM831X_WDOG_TO_MASK 0x0007 /* WDOG_TO - [2:0] */
|
||||
#define WM831X_WDOG_TO_SHIFT 0 /* WDOG_TO - [2:0] */
|
||||
#define WM831X_WDOG_TO_WIDTH 3 /* WDOG_TO - [2:0] */
|
||||
|
||||
#endif
|
||||
@@ -605,6 +605,11 @@ struct wm8350_irq {
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wm8350_hwmon {
|
||||
struct platform_device *pdev;
|
||||
struct device *classdev;
|
||||
};
|
||||
|
||||
struct wm8350 {
|
||||
struct device *dev;
|
||||
|
||||
@@ -621,7 +626,6 @@ struct wm8350 {
|
||||
struct mutex auxadc_mutex;
|
||||
|
||||
/* Interrupt handling */
|
||||
struct work_struct irq_work;
|
||||
struct mutex irq_mutex; /* IRQ table mutex */
|
||||
struct wm8350_irq irq[WM8350_NUM_IRQ];
|
||||
int chip_irq;
|
||||
@@ -629,6 +633,7 @@ struct wm8350 {
|
||||
/* Client devices */
|
||||
struct wm8350_codec codec;
|
||||
struct wm8350_gpio gpio;
|
||||
struct wm8350_hwmon hwmon;
|
||||
struct wm8350_pmic pmic;
|
||||
struct wm8350_power power;
|
||||
struct wm8350_rtc rtc;
|
||||
|
||||
@@ -41,7 +41,8 @@ struct miscdevice {
|
||||
struct list_head list;
|
||||
struct device *parent;
|
||||
struct device *this_device;
|
||||
const char *devnode;
|
||||
const char *nodename;
|
||||
mode_t mode;
|
||||
};
|
||||
|
||||
extern int misc_register(struct miscdevice * misc);
|
||||
|
||||
@@ -25,6 +25,7 @@ extern unsigned long max_mapnr;
|
||||
#endif
|
||||
|
||||
extern unsigned long num_physpages;
|
||||
extern unsigned long totalram_pages;
|
||||
extern void * high_memory;
|
||||
extern int page_cluster;
|
||||
|
||||
@@ -103,6 +104,7 @@ extern unsigned int kobjsize(const void *objp);
|
||||
#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
|
||||
#define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */
|
||||
#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
|
||||
#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
|
||||
|
||||
#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
|
||||
#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
|
||||
@@ -283,6 +285,14 @@ static inline int is_vmalloc_addr(const void *x)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_MMU
|
||||
extern int is_vmalloc_or_module_addr(const void *x);
|
||||
#else
|
||||
static int is_vmalloc_or_module_addr(const void *x)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline struct page *compound_head(struct page *page)
|
||||
{
|
||||
@@ -685,11 +695,12 @@ static inline int page_mapped(struct page *page)
|
||||
#define VM_FAULT_SIGBUS 0x0002
|
||||
#define VM_FAULT_MAJOR 0x0004
|
||||
#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
|
||||
#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */
|
||||
|
||||
#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
|
||||
#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
|
||||
|
||||
#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS)
|
||||
#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON)
|
||||
|
||||
/*
|
||||
* Can be called by the pagefault handler when it gets a VM_FAULT_OOM.
|
||||
@@ -700,17 +711,8 @@ extern void pagefault_out_of_memory(void);
|
||||
|
||||
extern void show_free_areas(void);
|
||||
|
||||
#ifdef CONFIG_SHMEM
|
||||
extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
|
||||
#else
|
||||
static inline int shmem_lock(struct file *file, int lock,
|
||||
struct user_struct *user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
int shmem_lock(struct file *file, int lock, struct user_struct *user);
|
||||
struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
|
||||
|
||||
int shmem_zero_setup(struct vm_area_struct *);
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
@@ -790,8 +792,14 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
|
||||
unmap_mapping_range(mapping, holebegin, holelen, 0);
|
||||
}
|
||||
|
||||
extern int vmtruncate(struct inode * inode, loff_t offset);
|
||||
extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
|
||||
extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
|
||||
extern int vmtruncate(struct inode *inode, loff_t offset);
|
||||
extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end);
|
||||
|
||||
int truncate_inode_page(struct address_space *mapping, struct page *page);
|
||||
int generic_error_remove_page(struct address_space *mapping, struct page *page);
|
||||
|
||||
int invalidate_inode_page(struct page *page);
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
@@ -815,6 +823,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
|
||||
struct page **pages, struct vm_area_struct **vmas);
|
||||
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 try_to_release_page(struct page * page, gfp_t gfp_mask);
|
||||
extern void do_invalidatepage(struct page *page, unsigned long offset);
|
||||
@@ -1058,6 +1067,8 @@ extern void setup_per_cpu_pageset(void);
|
||||
static inline void setup_per_cpu_pageset(void) {}
|
||||
#endif
|
||||
|
||||
extern void zone_pcp_update(struct zone *zone);
|
||||
|
||||
/* nommu.c */
|
||||
extern atomic_long_t mmap_pages_allocated;
|
||||
|
||||
@@ -1226,7 +1237,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
|
||||
#define FOLL_WRITE 0x01 /* check pte is writable */
|
||||
#define FOLL_TOUCH 0x02 /* mark page accessed */
|
||||
#define FOLL_GET 0x04 /* do get_page on page */
|
||||
#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
|
||||
#define FOLL_DUMP 0x08 /* give error on hole if it would be zero */
|
||||
#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */
|
||||
|
||||
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
|
||||
void *data);
|
||||
@@ -1274,7 +1286,7 @@ int in_gate_area_no_task(unsigned long addr);
|
||||
#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
|
||||
#endif /* __HAVE_ARCH_GATE_AREA */
|
||||
|
||||
int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
|
||||
int drop_caches_sysctl_handler(struct ctl_table *, int,
|
||||
void __user *, size_t *, loff_t *);
|
||||
unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
|
||||
unsigned long lru_pages);
|
||||
@@ -1303,5 +1315,12 @@ void vmemmap_populate_print_last(void);
|
||||
extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
|
||||
size_t size);
|
||||
extern void refund_locked_memory(struct mm_struct *mm, size_t size);
|
||||
|
||||
extern void memory_failure(unsigned long pfn, int trapno);
|
||||
extern int __memory_failure(unsigned long pfn, int trapno, int ref);
|
||||
extern int sysctl_memory_failure_early_kill;
|
||||
extern int sysctl_memory_failure_recovery;
|
||||
extern atomic_long_t mce_bad_pages;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_MM_H */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* page_is_file_cache - should the page be on a file LRU or anon LRU?
|
||||
* @page: the page to test
|
||||
*
|
||||
* Returns LRU_FILE if @page is page cache page backed by a regular filesystem,
|
||||
* Returns 1 if @page is page cache page backed by a regular filesystem,
|
||||
* or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed.
|
||||
* Used by functions that manipulate the LRU lists, to sort a page
|
||||
* onto the right LRU list.
|
||||
@@ -16,11 +16,7 @@
|
||||
*/
|
||||
static inline int page_is_file_cache(struct page *page)
|
||||
{
|
||||
if (PageSwapBacked(page))
|
||||
return 0;
|
||||
|
||||
/* The page is page cache backed by a normal filesystem. */
|
||||
return LRU_FILE;
|
||||
return !PageSwapBacked(page);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -39,21 +35,36 @@ del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l)
|
||||
mem_cgroup_del_lru_list(page, l);
|
||||
}
|
||||
|
||||
/**
|
||||
* page_lru_base_type - which LRU list type should a page be on?
|
||||
* @page: the page to test
|
||||
*
|
||||
* Used for LRU list index arithmetic.
|
||||
*
|
||||
* Returns the base LRU type - file or anon - @page should be on.
|
||||
*/
|
||||
static inline enum lru_list page_lru_base_type(struct page *page)
|
||||
{
|
||||
if (page_is_file_cache(page))
|
||||
return LRU_INACTIVE_FILE;
|
||||
return LRU_INACTIVE_ANON;
|
||||
}
|
||||
|
||||
static inline void
|
||||
del_page_from_lru(struct zone *zone, struct page *page)
|
||||
{
|
||||
enum lru_list l = LRU_BASE;
|
||||
enum lru_list l;
|
||||
|
||||
list_del(&page->lru);
|
||||
if (PageUnevictable(page)) {
|
||||
__ClearPageUnevictable(page);
|
||||
l = LRU_UNEVICTABLE;
|
||||
} else {
|
||||
l = page_lru_base_type(page);
|
||||
if (PageActive(page)) {
|
||||
__ClearPageActive(page);
|
||||
l += LRU_ACTIVE;
|
||||
}
|
||||
l += page_is_file_cache(page);
|
||||
}
|
||||
__dec_zone_state(zone, NR_LRU_BASE + l);
|
||||
mem_cgroup_del_lru_list(page, l);
|
||||
@@ -68,14 +79,14 @@ del_page_from_lru(struct zone *zone, struct page *page)
|
||||
*/
|
||||
static inline enum lru_list page_lru(struct page *page)
|
||||
{
|
||||
enum lru_list lru = LRU_BASE;
|
||||
enum lru_list lru;
|
||||
|
||||
if (PageUnevictable(page))
|
||||
lru = LRU_UNEVICTABLE;
|
||||
else {
|
||||
lru = page_lru_base_type(page);
|
||||
if (PageActive(page))
|
||||
lru += LRU_ACTIVE;
|
||||
lru += page_is_file_cache(page);
|
||||
}
|
||||
|
||||
return lru;
|
||||
|
||||
@@ -240,6 +240,8 @@ struct mm_struct {
|
||||
|
||||
unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
|
||||
|
||||
struct linux_binfmt *binfmt;
|
||||
|
||||
cpumask_t cpu_vm_mask;
|
||||
|
||||
/* Architecture-specific MM context */
|
||||
@@ -259,11 +261,10 @@ struct mm_struct {
|
||||
unsigned long flags; /* Must use atomic bitops to access the bits */
|
||||
|
||||
struct core_state *core_state; /* coredumping support */
|
||||
|
||||
/* aio bits */
|
||||
#ifdef CONFIG_AIO
|
||||
spinlock_t ioctx_lock;
|
||||
struct hlist_head ioctx_list;
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_MM_OWNER
|
||||
/*
|
||||
* "owner" points to a task that is regarded as the canonical
|
||||
|
||||
@@ -40,6 +40,8 @@ struct mmc_csd {
|
||||
};
|
||||
|
||||
struct mmc_ext_csd {
|
||||
u8 rev;
|
||||
unsigned int sa_timeout; /* Units: 100ns */
|
||||
unsigned int hs_max_dtr;
|
||||
unsigned int sectors;
|
||||
};
|
||||
@@ -62,7 +64,8 @@ struct sdio_cccr {
|
||||
low_speed:1,
|
||||
wide_bus:1,
|
||||
high_power:1,
|
||||
high_speed:1;
|
||||
high_speed:1,
|
||||
disable_cd:1;
|
||||
};
|
||||
|
||||
struct sdio_cis {
|
||||
@@ -94,6 +97,8 @@ struct mmc_card {
|
||||
#define MMC_STATE_READONLY (1<<1) /* card is read-only */
|
||||
#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */
|
||||
#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
|
||||
unsigned int quirks; /* card quirks */
|
||||
#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
|
||||
|
||||
u32 raw_cid[4]; /* raw card CID */
|
||||
u32 raw_csd[4]; /* raw card CSD */
|
||||
@@ -129,6 +134,11 @@ struct mmc_card {
|
||||
#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
|
||||
#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
|
||||
|
||||
static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
|
||||
{
|
||||
return c->quirks & MMC_QUIRK_LENIENT_FN0;
|
||||
}
|
||||
|
||||
#define mmc_card_name(c) ((c)->cid.prod_name)
|
||||
#define mmc_card_id(c) (dev_name(&(c)->dev))
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
|
||||
|
||||
extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
|
||||
extern void mmc_release_host(struct mmc_host *host);
|
||||
extern int mmc_try_claim_host(struct mmc_host *host);
|
||||
|
||||
/**
|
||||
* mmc_claim_host - exclusively claim a host
|
||||
|
||||
@@ -51,6 +51,35 @@ struct mmc_ios {
|
||||
};
|
||||
|
||||
struct mmc_host_ops {
|
||||
/*
|
||||
* Hosts that support power saving can use the 'enable' and 'disable'
|
||||
* methods to exit and enter power saving states. 'enable' is called
|
||||
* when the host is claimed and 'disable' is called (or scheduled with
|
||||
* a delay) when the host is released. The 'disable' is scheduled if
|
||||
* the disable delay set by 'mmc_set_disable_delay()' is non-zero,
|
||||
* otherwise 'disable' is called immediately. 'disable' may be
|
||||
* scheduled repeatedly, to permit ever greater power saving at the
|
||||
* expense of ever greater latency to re-enable. Rescheduling is
|
||||
* determined by the return value of the 'disable' method. A positive
|
||||
* value gives the delay in milliseconds.
|
||||
*
|
||||
* In the case where a host function (like set_ios) may be called
|
||||
* with or without the host claimed, enabling and disabling can be
|
||||
* done directly and will nest correctly. Call 'mmc_host_enable()' and
|
||||
* 'mmc_host_lazy_disable()' for this purpose, but note that these
|
||||
* functions must be paired.
|
||||
*
|
||||
* Alternatively, 'mmc_host_enable()' may be paired with
|
||||
* 'mmc_host_disable()' which calls 'disable' immediately. In this
|
||||
* case the 'disable' method will be called with 'lazy' set to 0.
|
||||
* This is mainly useful for error paths.
|
||||
*
|
||||
* Because lazy disable may be called from a work queue, the 'disable'
|
||||
* method must claim the host when 'lazy' != 0, which will work
|
||||
* correctly because recursion is detected and handled.
|
||||
*/
|
||||
int (*enable)(struct mmc_host *host);
|
||||
int (*disable)(struct mmc_host *host, int lazy);
|
||||
void (*request)(struct mmc_host *host, struct mmc_request *req);
|
||||
/*
|
||||
* Avoid calling these three functions too often or in a "fast path",
|
||||
@@ -118,6 +147,9 @@ struct mmc_host {
|
||||
#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */
|
||||
#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
|
||||
#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */
|
||||
#define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */
|
||||
#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
|
||||
#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
|
||||
|
||||
/* host specific block data */
|
||||
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
|
||||
@@ -142,9 +174,18 @@ struct mmc_host {
|
||||
unsigned int removed:1; /* host is being removed */
|
||||
#endif
|
||||
|
||||
/* Only used with MMC_CAP_DISABLE */
|
||||
int enabled; /* host is enabled */
|
||||
int nesting_cnt; /* "enable" nesting count */
|
||||
int en_dis_recurs; /* detect recursion */
|
||||
unsigned int disable_delay; /* disable delay in msecs */
|
||||
struct delayed_work disable; /* disabling work */
|
||||
|
||||
struct mmc_card *card; /* device attached to this host */
|
||||
|
||||
wait_queue_head_t wq;
|
||||
struct task_struct *claimer; /* task that has host claimed */
|
||||
int claim_cnt; /* "claim" nesting count */
|
||||
|
||||
struct delayed_work detect;
|
||||
|
||||
@@ -183,6 +224,9 @@ static inline void *mmc_priv(struct mmc_host *host)
|
||||
extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
|
||||
extern int mmc_resume_host(struct mmc_host *);
|
||||
|
||||
extern void mmc_power_save_host(struct mmc_host *host);
|
||||
extern void mmc_power_restore_host(struct mmc_host *host);
|
||||
|
||||
extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
|
||||
extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
|
||||
|
||||
@@ -197,5 +241,19 @@ struct regulator;
|
||||
int mmc_regulator_get_ocrmask(struct regulator *supply);
|
||||
int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit);
|
||||
|
||||
int mmc_card_awake(struct mmc_host *host);
|
||||
int mmc_card_sleep(struct mmc_host *host);
|
||||
int mmc_card_can_sleep(struct mmc_host *host);
|
||||
|
||||
int mmc_host_enable(struct mmc_host *host);
|
||||
int mmc_host_disable(struct mmc_host *host);
|
||||
int mmc_host_lazy_disable(struct mmc_host *host);
|
||||
|
||||
static inline void mmc_set_disable_delay(struct mmc_host *host,
|
||||
unsigned int disable_delay)
|
||||
{
|
||||
host->disable_delay = disable_delay;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define MMC_ALL_SEND_CID 2 /* bcr R2 */
|
||||
#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
|
||||
#define MMC_SET_DSR 4 /* bc [31:16] RCA */
|
||||
#define MMC_SLEEP_AWAKE 5 /* ac [31:16] RCA 15:flg R1b */
|
||||
#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
|
||||
#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */
|
||||
#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
|
||||
@@ -127,6 +128,7 @@
|
||||
#define R1_STATUS(x) (x & 0xFFFFE000)
|
||||
#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
|
||||
#define R1_READY_FOR_DATA (1 << 8) /* sx, a */
|
||||
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
|
||||
#define R1_APP_CMD (1 << 5) /* sr, c */
|
||||
|
||||
/*
|
||||
@@ -254,6 +256,7 @@ struct _mmc_csd {
|
||||
#define EXT_CSD_CARD_TYPE 196 /* RO */
|
||||
#define EXT_CSD_REV 192 /* RO */
|
||||
#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
|
||||
#define EXT_CSD_S_A_TIMEOUT 217
|
||||
|
||||
/*
|
||||
* EXT_CSD field definitions
|
||||
|
||||
@@ -67,6 +67,7 @@ struct sdio_func {
|
||||
|
||||
#define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev)
|
||||
#define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d)
|
||||
#define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev)
|
||||
|
||||
/*
|
||||
* SDIO function device driver
|
||||
@@ -81,6 +82,8 @@ struct sdio_driver {
|
||||
struct device_driver drv;
|
||||
};
|
||||
|
||||
#define to_sdio_driver(d) container_of(d, struct sdio_driver, drv)
|
||||
|
||||
/**
|
||||
* SDIO_DEVICE - macro used to describe a specific SDIO device
|
||||
* @vend: the 16 bit manufacturer code
|
||||
|
||||
9
include/linux/mmu_context.h
Normal file
9
include/linux/mmu_context.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _LINUX_MMU_CONTEXT_H
|
||||
#define _LINUX_MMU_CONTEXT_H
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
void use_mm(struct mm_struct *mm);
|
||||
void unuse_mm(struct mm_struct *mm);
|
||||
|
||||
#endif
|
||||
@@ -61,6 +61,15 @@ struct mmu_notifier_ops {
|
||||
struct mm_struct *mm,
|
||||
unsigned long address);
|
||||
|
||||
/*
|
||||
* change_pte is called in cases that pte mapping to page is changed:
|
||||
* for example, when ksm remaps pte to point to a new shared page.
|
||||
*/
|
||||
void (*change_pte)(struct mmu_notifier *mn,
|
||||
struct mm_struct *mm,
|
||||
unsigned long address,
|
||||
pte_t pte);
|
||||
|
||||
/*
|
||||
* Before this is invoked any secondary MMU is still ok to
|
||||
* read/write to the page previously pointed to by the Linux
|
||||
@@ -154,6 +163,8 @@ extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);
|
||||
extern void __mmu_notifier_release(struct mm_struct *mm);
|
||||
extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
|
||||
unsigned long address);
|
||||
extern void __mmu_notifier_change_pte(struct mm_struct *mm,
|
||||
unsigned long address, pte_t pte);
|
||||
extern void __mmu_notifier_invalidate_page(struct mm_struct *mm,
|
||||
unsigned long address);
|
||||
extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
|
||||
@@ -175,6 +186,13 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mmu_notifier_change_pte(struct mm_struct *mm,
|
||||
unsigned long address, pte_t pte)
|
||||
{
|
||||
if (mm_has_notifiers(mm))
|
||||
__mmu_notifier_change_pte(mm, address, pte);
|
||||
}
|
||||
|
||||
static inline void mmu_notifier_invalidate_page(struct mm_struct *mm,
|
||||
unsigned long address)
|
||||
{
|
||||
@@ -236,6 +254,16 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
|
||||
__young; \
|
||||
})
|
||||
|
||||
#define set_pte_at_notify(__mm, __address, __ptep, __pte) \
|
||||
({ \
|
||||
struct mm_struct *___mm = __mm; \
|
||||
unsigned long ___address = __address; \
|
||||
pte_t ___pte = __pte; \
|
||||
\
|
||||
set_pte_at(___mm, ___address, __ptep, ___pte); \
|
||||
mmu_notifier_change_pte(___mm, ___address, ___pte); \
|
||||
})
|
||||
|
||||
#else /* CONFIG_MMU_NOTIFIER */
|
||||
|
||||
static inline void mmu_notifier_release(struct mm_struct *mm)
|
||||
@@ -248,6 +276,11 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mmu_notifier_change_pte(struct mm_struct *mm,
|
||||
unsigned long address, pte_t pte)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mmu_notifier_invalidate_page(struct mm_struct *mm,
|
||||
unsigned long address)
|
||||
{
|
||||
@@ -273,6 +306,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
|
||||
|
||||
#define ptep_clear_flush_young_notify ptep_clear_flush_young
|
||||
#define ptep_clear_flush_notify ptep_clear_flush
|
||||
#define set_pte_at_notify set_pte_at
|
||||
|
||||
#endif /* CONFIG_MMU_NOTIFIER */
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define MIGRATE_UNMOVABLE 0
|
||||
#define MIGRATE_RECLAIMABLE 1
|
||||
#define MIGRATE_MOVABLE 2
|
||||
#define MIGRATE_PCPTYPES 3 /* the number of types on the pcp lists */
|
||||
#define MIGRATE_RESERVE 3
|
||||
#define MIGRATE_ISOLATE 4 /* can't allocate from here */
|
||||
#define MIGRATE_TYPES 5
|
||||
@@ -94,11 +95,15 @@ enum zone_stat_item {
|
||||
NR_SLAB_RECLAIMABLE,
|
||||
NR_SLAB_UNRECLAIMABLE,
|
||||
NR_PAGETABLE, /* used for pagetables */
|
||||
NR_KERNEL_STACK,
|
||||
/* Second 128 byte cacheline */
|
||||
NR_UNSTABLE_NFS, /* NFS unstable pages */
|
||||
NR_BOUNCE,
|
||||
NR_VMSCAN_WRITE,
|
||||
/* Second 128 byte cacheline */
|
||||
NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */
|
||||
NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
|
||||
NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
|
||||
NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
|
||||
#ifdef CONFIG_NUMA
|
||||
NUMA_HIT, /* allocated in intended node */
|
||||
NUMA_MISS, /* allocated in non intended node */
|
||||
@@ -165,7 +170,9 @@ struct per_cpu_pages {
|
||||
int count; /* number of pages in the list */
|
||||
int high; /* high watermark, emptying needed */
|
||||
int batch; /* chunk size for buddy add/remove */
|
||||
struct list_head list; /* the list of pages */
|
||||
|
||||
/* Lists of pages, one per migrate type stored on the pcp-lists */
|
||||
struct list_head lists[MIGRATE_PCPTYPES];
|
||||
};
|
||||
|
||||
struct per_cpu_pageset {
|
||||
@@ -269,6 +276,11 @@ struct zone_reclaim_stat {
|
||||
*/
|
||||
unsigned long recent_rotated[2];
|
||||
unsigned long recent_scanned[2];
|
||||
|
||||
/*
|
||||
* accumulated for batching
|
||||
*/
|
||||
unsigned long nr_saved_scan[NR_LRU_LISTS];
|
||||
};
|
||||
|
||||
struct zone {
|
||||
@@ -323,7 +335,6 @@ struct zone {
|
||||
spinlock_t lru_lock;
|
||||
struct zone_lru {
|
||||
struct list_head list;
|
||||
unsigned long nr_saved_scan; /* accumulated for batching */
|
||||
} lru[NR_LRU_LISTS];
|
||||
|
||||
struct zone_reclaim_stat reclaim_stat;
|
||||
@@ -744,21 +755,20 @@ static inline int is_dma(struct zone *zone)
|
||||
|
||||
/* These two functions are used to setup the per zone pages min values */
|
||||
struct ctl_table;
|
||||
struct file;
|
||||
int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *,
|
||||
int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
|
||||
void __user *, size_t *, loff_t *);
|
||||
extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1];
|
||||
int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
|
||||
int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
|
||||
void __user *, size_t *, loff_t *);
|
||||
int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *,
|
||||
int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,
|
||||
void __user *, size_t *, loff_t *);
|
||||
int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
|
||||
struct file *, void __user *, size_t *, loff_t *);
|
||||
void __user *, size_t *, loff_t *);
|
||||
int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
|
||||
struct file *, void __user *, size_t *, loff_t *);
|
||||
void __user *, size_t *, loff_t *);
|
||||
|
||||
extern int numa_zonelist_order_handler(struct ctl_table *, int,
|
||||
struct file *, void __user *, size_t *, loff_t *);
|
||||
void __user *, size_t *, loff_t *);
|
||||
extern char numa_zonelist_order[];
|
||||
#define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */
|
||||
|
||||
|
||||
@@ -399,6 +399,17 @@ struct i2c_device_id {
|
||||
__attribute__((aligned(sizeof(kernel_ulong_t))));
|
||||
};
|
||||
|
||||
/* spi */
|
||||
|
||||
#define SPI_NAME_SIZE 32
|
||||
#define SPI_MODULE_PREFIX "spi:"
|
||||
|
||||
struct spi_device_id {
|
||||
char name[SPI_NAME_SIZE];
|
||||
kernel_ulong_t driver_data /* Data private to the driver */
|
||||
__attribute__((aligned(sizeof(kernel_ulong_t))));
|
||||
};
|
||||
|
||||
/* dmi */
|
||||
enum dmi_field {
|
||||
DMI_NONE,
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/marker.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#include <asm/local.h>
|
||||
@@ -129,7 +128,10 @@ extern struct module __this_module;
|
||||
*/
|
||||
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
|
||||
|
||||
/* Author, ideally of form NAME[, NAME]*[ and NAME] */
|
||||
/*
|
||||
* Author(s), use "Name <email>" or just "Name", for multiple
|
||||
* authors use multiple MODULE_AUTHOR() statements/lines.
|
||||
*/
|
||||
#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
|
||||
|
||||
/* What your module does. */
|
||||
@@ -309,10 +311,14 @@ struct module
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KALLSYMS
|
||||
/* We keep the symbol and string tables for kallsyms. */
|
||||
Elf_Sym *symtab;
|
||||
unsigned int num_symtab;
|
||||
char *strtab;
|
||||
/*
|
||||
* We keep the symbol and string tables for kallsyms.
|
||||
* The core_* fields below are temporary, loader-only (they
|
||||
* could really be discarded after module init).
|
||||
*/
|
||||
Elf_Sym *symtab, *core_symtab;
|
||||
unsigned int num_symtab, core_num_syms;
|
||||
char *strtab, *core_strtab;
|
||||
|
||||
/* Section attributes */
|
||||
struct module_sect_attrs *sect_attrs;
|
||||
@@ -327,10 +333,6 @@ struct module
|
||||
/* The command line arguments (may be mangled). People like
|
||||
keeping pointers to this stuff */
|
||||
char *args;
|
||||
#ifdef CONFIG_MARKERS
|
||||
struct marker *markers;
|
||||
unsigned int num_markers;
|
||||
#endif
|
||||
#ifdef CONFIG_TRACEPOINTS
|
||||
struct tracepoint *tracepoints;
|
||||
unsigned int num_tracepoints;
|
||||
@@ -535,8 +537,6 @@ int unregister_module_notifier(struct notifier_block * nb);
|
||||
|
||||
extern void print_modules(void);
|
||||
|
||||
extern void module_update_markers(void);
|
||||
|
||||
extern void module_update_tracepoints(void);
|
||||
extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
|
||||
|
||||
@@ -651,10 +651,6 @@ static inline void print_modules(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void module_update_markers(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void module_update_tracepoints(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ typedef enum {
|
||||
NAND_ECC_SOFT,
|
||||
NAND_ECC_HW,
|
||||
NAND_ECC_HW_SYNDROME,
|
||||
NAND_ECC_HW_OOB_FIRST,
|
||||
} nand_ecc_modes_t;
|
||||
|
||||
/*
|
||||
@@ -271,13 +272,13 @@ struct nand_ecc_ctrl {
|
||||
uint8_t *calc_ecc);
|
||||
int (*read_page_raw)(struct mtd_info *mtd,
|
||||
struct nand_chip *chip,
|
||||
uint8_t *buf);
|
||||
uint8_t *buf, int page);
|
||||
void (*write_page_raw)(struct mtd_info *mtd,
|
||||
struct nand_chip *chip,
|
||||
const uint8_t *buf);
|
||||
int (*read_page)(struct mtd_info *mtd,
|
||||
struct nand_chip *chip,
|
||||
uint8_t *buf);
|
||||
uint8_t *buf, int page);
|
||||
int (*read_subpage)(struct mtd_info *mtd,
|
||||
struct nand_chip *chip,
|
||||
uint32_t offs, uint32_t len,
|
||||
|
||||
@@ -20,6 +20,12 @@ struct mtd_info;
|
||||
*/
|
||||
int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
|
||||
|
||||
/*
|
||||
* Detect and correct a 1 bit error for eccsize byte block
|
||||
*/
|
||||
int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc,
|
||||
unsigned int eccsize);
|
||||
|
||||
/*
|
||||
* Detect and correct a 1 bit error for 256 byte block
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user