Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/staging/Kconfig drivers/staging/Makefile drivers/staging/cpc-usb/TODO drivers/staging/cpc-usb/cpc-usb_drv.c drivers/staging/cpc-usb/cpc.h drivers/staging/cpc-usb/cpc_int.h drivers/staging/cpc-usb/cpcusb.h
This commit is contained in:
commit
8b3f6af863
6498 changed files with 724877 additions and 342383 deletions
|
@ -268,6 +268,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
|||
$(srctree)/include/asm-$(SRCARCH)/kvm.h),)
|
||||
unifdef-y += kvm.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
|
||||
unifdef-y += kvm_para.h
|
||||
endif
|
||||
unifdef-y += llc.h
|
||||
unifdef-y += loop.h
|
||||
unifdef-y += lp.h
|
||||
|
|
|
@ -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*/
|
||||
|
|
|
@ -79,9 +79,12 @@ struct agp_memory {
|
|||
u32 physical;
|
||||
bool is_bound;
|
||||
bool is_flushed;
|
||||
bool vmalloc_flag;
|
||||
bool vmalloc_flag;
|
||||
/* list of agp_memory mapped to the aperture */
|
||||
struct list_head mapped_list;
|
||||
/* DMA-mapped addresses */
|
||||
struct scatterlist *sg_list;
|
||||
int num_sg;
|
||||
};
|
||||
|
||||
#define AGP_NORMAL_MEMORY 0
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -36,6 +36,11 @@ struct amba_driver {
|
|||
struct amba_id *id_table;
|
||||
};
|
||||
|
||||
enum amba_vendor {
|
||||
AMBA_VENDOR_ARM = 0x41,
|
||||
AMBA_VENDOR_ST = 0x80,
|
||||
};
|
||||
|
||||
#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
|
||||
#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
|
||||
|
||||
|
|
80
include/linux/amba/pl093.h
Normal file
80
include/linux/amba/pl093.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* linux/amba/pl093.h
|
||||
*
|
||||
* Copyright (c) 2008 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* AMBA PL093 SSMC (synchronous static memory controller)
|
||||
* See DDI0236.pdf (r0p4) for more details
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */
|
||||
|
||||
/* Offsets for SMBxxxxRy registers */
|
||||
|
||||
#define SMBIDCYR (0x00)
|
||||
#define SMBWSTRDR (0x04)
|
||||
#define SMBWSTWRR (0x08)
|
||||
#define SMBWSTOENR (0x0C)
|
||||
#define SMBWSTWENR (0x10)
|
||||
#define SMBCR (0x14)
|
||||
#define SMBSR (0x18)
|
||||
#define SMBWSTBRDR (0x1C)
|
||||
|
||||
/* Masks for SMB registers */
|
||||
#define IDCY_MASK (0xf)
|
||||
#define WSTRD_MASK (0xf)
|
||||
#define WSTWR_MASK (0xf)
|
||||
#define WSTOEN_MASK (0xf)
|
||||
#define WSTWEN_MASK (0xf)
|
||||
|
||||
/* Notes from datasheet:
|
||||
* WSTOEN <= WSTRD
|
||||
* WSTWEN <= WSTWR
|
||||
*
|
||||
* WSTOEN is not used with nWAIT
|
||||
*/
|
||||
|
||||
/* SMBCR bit definitions */
|
||||
#define SMBCR_BIWRITEEN (1 << 21)
|
||||
#define SMBCR_ADDRVALIDWRITEEN (1 << 20)
|
||||
#define SMBCR_SYNCWRITE (1 << 17)
|
||||
#define SMBCR_BMWRITE (1 << 16)
|
||||
#define SMBCR_WRAPREAD (1 << 14)
|
||||
#define SMBCR_BIREADEN (1 << 13)
|
||||
#define SMBCR_ADDRVALIDREADEN (1 << 12)
|
||||
#define SMBCR_SYNCREAD (1 << 9)
|
||||
#define SMBCR_BMREAD (1 << 8)
|
||||
#define SMBCR_SMBLSPOL (1 << 6)
|
||||
#define SMBCR_WP (1 << 3)
|
||||
#define SMBCR_WAITEN (1 << 2)
|
||||
#define SMBCR_WAITPOL (1 << 1)
|
||||
#define SMBCR_RBLE (1 << 0)
|
||||
|
||||
#define SMBCR_BURSTLENWRITE_MASK (3 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_4 (0 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_8 (1 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_RESERVED (2 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18)
|
||||
|
||||
#define SMBCR_BURSTLENREAD_MASK (3 << 10)
|
||||
#define SMBCR_BURSTLENREAD_4 (0 << 10)
|
||||
#define SMBCR_BURSTLENREAD_8 (1 << 10)
|
||||
#define SMBCR_BURSTLENREAD_16 (2 << 10)
|
||||
#define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10)
|
||||
|
||||
#define SMBCR_MW_MASK (3 << 4)
|
||||
#define SMBCR_MW_8BIT (0 << 4)
|
||||
#define SMBCR_MW_16BIT (1 << 4)
|
||||
#define SMBCR_MW_M32BIT (2 << 4)
|
||||
|
||||
/* SSMC status registers */
|
||||
#define SSMCCSR (0x200)
|
||||
#define SSMCCR (0x204)
|
||||
#define SSMCITCR (0x208)
|
||||
#define SSMCITIP (0x20C)
|
||||
#define SSMCITIOP (0x210)
|
|
@ -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_ */
|
||||
|
|
|
@ -17,7 +17,7 @@ struct attribute_container {
|
|||
struct list_head node;
|
||||
struct klist containers;
|
||||
struct class *class;
|
||||
struct attribute_group *grp;
|
||||
const struct attribute_group *grp;
|
||||
struct device_attribute **attrs;
|
||||
int (*match)(struct attribute_container *, struct device *);
|
||||
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
|
||||
|
|
|
@ -59,6 +59,7 @@ struct bdi_writeback {
|
|||
|
||||
struct backing_dev_info {
|
||||
struct list_head bdi_list;
|
||||
struct rcu_head rcu_head;
|
||||
unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
|
||||
unsigned long state; /* Always use atomic bitops on this */
|
||||
unsigned int capabilities; /* Device capabilities */
|
||||
|
@ -100,7 +101,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
|
|||
const char *fmt, ...);
|
||||
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
|
||||
void bdi_unregister(struct backing_dev_info *bdi);
|
||||
void bdi_start_writeback(struct writeback_control *wbc);
|
||||
void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages);
|
||||
int bdi_writeback_task(struct bdi_writeback *wb);
|
||||
int bdi_has_dirty_io(struct backing_dev_info *bdi);
|
||||
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -142,56 +142,51 @@ struct bio {
|
|||
*
|
||||
* bit 0 -- data direction
|
||||
* If not set, bio is a read from device. If set, it's a write to device.
|
||||
* bit 1 -- rw-ahead when set
|
||||
* bit 2 -- barrier
|
||||
* bit 1 -- fail fast device errors
|
||||
* bit 2 -- fail fast transport errors
|
||||
* bit 3 -- fail fast driver errors
|
||||
* bit 4 -- rw-ahead when set
|
||||
* bit 5 -- barrier
|
||||
* Insert a serialization point in the IO queue, forcing previously
|
||||
* submitted IO to be completed before this one is issued.
|
||||
* bit 3 -- synchronous I/O hint.
|
||||
* bit 4 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 5 -- metadata request
|
||||
* bit 6 -- synchronous I/O hint.
|
||||
* bit 7 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 8 -- metadata request
|
||||
* Used for tracing to differentiate metadata and data IO. May also
|
||||
* get some preferential treatment in the IO scheduler
|
||||
* bit 6 -- discard sectors
|
||||
* bit 9 -- discard sectors
|
||||
* Informs the lower level device that this range of sectors is no longer
|
||||
* used by the file system and may thus be freed by the device. Used
|
||||
* for flash based storage.
|
||||
* bit 7 -- fail fast device errors
|
||||
* bit 8 -- fail fast transport errors
|
||||
* bit 9 -- fail fast driver errors
|
||||
* Don't want driver retries for any fast fail whatever the reason.
|
||||
* bit 10 -- Tell the IO scheduler not to wait for more requests after this
|
||||
one has been submitted, even if it is a SYNC request.
|
||||
*/
|
||||
#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
|
||||
#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
|
||||
#define BIO_RW_BARRIER 2
|
||||
#define BIO_RW_SYNCIO 3
|
||||
#define BIO_RW_UNPLUG 4
|
||||
#define BIO_RW_META 5
|
||||
#define BIO_RW_DISCARD 6
|
||||
#define BIO_RW_FAILFAST_DEV 7
|
||||
#define BIO_RW_FAILFAST_TRANSPORT 8
|
||||
#define BIO_RW_FAILFAST_DRIVER 9
|
||||
#define BIO_RW_NOIDLE 10
|
||||
|
||||
#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
|
||||
enum bio_rw_flags {
|
||||
BIO_RW,
|
||||
BIO_RW_FAILFAST_DEV,
|
||||
BIO_RW_FAILFAST_TRANSPORT,
|
||||
BIO_RW_FAILFAST_DRIVER,
|
||||
/* above flags must match REQ_* */
|
||||
BIO_RW_AHEAD,
|
||||
BIO_RW_BARRIER,
|
||||
BIO_RW_SYNCIO,
|
||||
BIO_RW_UNPLUG,
|
||||
BIO_RW_META,
|
||||
BIO_RW_DISCARD,
|
||||
BIO_RW_NOIDLE,
|
||||
};
|
||||
|
||||
/*
|
||||
* Old defines, these should eventually be replaced by direct usage of
|
||||
* bio_rw_flagged()
|
||||
* First four bits must match between bio->bi_rw and rq->cmd_flags, make
|
||||
* that explicit here.
|
||||
*/
|
||||
#define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER)
|
||||
#define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO)
|
||||
#define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG)
|
||||
#define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV)
|
||||
#define bio_failfast_transport(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT)
|
||||
#define bio_failfast_driver(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER)
|
||||
#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
|
||||
#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
|
||||
#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
|
||||
#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
|
||||
#define BIO_RW_RQ_MASK 0xf
|
||||
|
||||
static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag)
|
||||
{
|
||||
return (bio->bi_rw & (1 << flag)) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* upper 16 bits of bi_rw define the io priority of this bio
|
||||
|
@ -216,7 +211,7 @@ struct bio {
|
|||
#define bio_offset(bio) bio_iovec((bio))->bv_offset
|
||||
#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
|
||||
#define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD))
|
||||
|
||||
static inline unsigned int bio_cur_bytes(struct bio *bio)
|
||||
{
|
||||
|
|
48
include/linux/blk-iopoll.h
Normal file
48
include/linux/blk-iopoll.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef BLK_IOPOLL_H
|
||||
#define BLK_IOPOLL_H
|
||||
|
||||
struct blk_iopoll;
|
||||
typedef int (blk_iopoll_fn)(struct blk_iopoll *, int);
|
||||
|
||||
struct blk_iopoll {
|
||||
struct list_head list;
|
||||
unsigned long state;
|
||||
unsigned long data;
|
||||
int weight;
|
||||
int max;
|
||||
blk_iopoll_fn *poll;
|
||||
};
|
||||
|
||||
enum {
|
||||
IOPOLL_F_SCHED = 0,
|
||||
IOPOLL_F_DISABLE = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating
|
||||
* that we were the first to acquire this iop for scheduling. If this iop
|
||||
* is currently disabled, return "failure".
|
||||
*/
|
||||
static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop)
|
||||
{
|
||||
if (!test_bit(IOPOLL_F_DISABLE, &iop->state))
|
||||
return test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop)
|
||||
{
|
||||
return test_bit(IOPOLL_F_DISABLE, &iop->state);
|
||||
}
|
||||
|
||||
extern void blk_iopoll_sched(struct blk_iopoll *);
|
||||
extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *);
|
||||
extern void blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void __blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void blk_iopoll_enable(struct blk_iopoll *);
|
||||
extern void blk_iopoll_disable(struct blk_iopoll *);
|
||||
|
||||
extern int blk_iopoll_enabled;
|
||||
|
||||
#endif
|
|
@ -86,13 +86,14 @@ enum {
|
|||
};
|
||||
|
||||
/*
|
||||
* request type modified bits. first two bits match BIO_RW* bits, important
|
||||
* request type modified bits. first four bits match BIO_RW* bits, important
|
||||
*/
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW, /* not set, read. set, write */
|
||||
__REQ_FAILFAST_DEV, /* no driver retries of device errors */
|
||||
__REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
|
||||
__REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
|
||||
/* above flags must match BIO_RW_* */
|
||||
__REQ_DISCARD, /* request to discard sectors */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
|
@ -114,6 +115,7 @@ enum rq_flag_bits {
|
|||
__REQ_INTEGRITY, /* integrity metadata has been remapped */
|
||||
__REQ_NOIDLE, /* Don't anticipate more IO after this one */
|
||||
__REQ_IO_STAT, /* account I/O stat */
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
|
@ -142,6 +144,10 @@ enum rq_flag_bits {
|
|||
#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
|
||||
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
|
||||
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
|
||||
|
||||
#define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \
|
||||
REQ_FAILFAST_DRIVER)
|
||||
|
||||
#define BLK_MAX_CDB 16
|
||||
|
||||
|
@ -453,10 +459,12 @@ struct request_queue
|
|||
#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
|
||||
#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
|
||||
#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
|
||||
#define QUEUE_FLAG_CQ 16 /* hardware does queuing */
|
||||
|
||||
#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_CLUSTER) | \
|
||||
(1 << QUEUE_FLAG_STACKABLE))
|
||||
(1 << QUEUE_FLAG_STACKABLE) | \
|
||||
(1 << QUEUE_FLAG_SAME_COMP))
|
||||
|
||||
static inline int queue_is_locked(struct request_queue *q)
|
||||
{
|
||||
|
@ -575,6 +583,7 @@ enum {
|
|||
|
||||
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
|
||||
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
|
||||
#define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags)
|
||||
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
|
||||
#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
|
||||
#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
|
||||
|
@ -828,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping)
|
|||
}
|
||||
|
||||
/*
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_err_bytes() : bytes left till the next error boundary
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_err_sectors() : sectors left till the next error boundary
|
||||
*/
|
||||
static inline sector_t blk_rq_pos(const struct request *rq)
|
||||
{
|
||||
|
@ -849,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq)
|
|||
return rq->bio ? bio_cur_bytes(rq->bio) : 0;
|
||||
}
|
||||
|
||||
extern unsigned int blk_rq_err_bytes(const struct request *rq);
|
||||
|
||||
static inline unsigned int blk_rq_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_bytes(rq) >> 9;
|
||||
|
@ -859,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
|||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_err_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_err_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* Request issue related functions.
|
||||
*/
|
||||
|
@ -885,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error,
|
|||
unsigned int nr_bytes);
|
||||
extern void blk_end_request_all(struct request *rq, int error);
|
||||
extern bool blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool blk_end_request_err(struct request *rq, int error);
|
||||
extern bool __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void __blk_end_request_all(struct request *rq, int error);
|
||||
extern bool __blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool __blk_end_request_err(struct request *rq, int error);
|
||||
|
||||
extern void blk_complete_request(struct request *);
|
||||
extern void __blk_complete_request(struct request *);
|
||||
|
@ -915,6 +935,7 @@ extern void blk_queue_alignment_offset(struct request_queue *q,
|
|||
unsigned int alignment);
|
||||
extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
|
||||
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
|
||||
extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);
|
||||
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
|
||||
extern void blk_set_default_limits(struct queue_limits *lim);
|
||||
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
|
@ -977,15 +998,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
|
|||
}
|
||||
|
||||
extern int blkdev_issue_flush(struct block_device *, sector_t *);
|
||||
extern int blkdev_issue_discard(struct block_device *,
|
||||
sector_t sector, sector_t nr_sects, gfp_t);
|
||||
#define DISCARD_FL_WAIT 0x01 /* wait for completion */
|
||||
#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */
|
||||
extern int blkdev_issue_discard(struct block_device *, sector_t sector,
|
||||
sector_t nr_sects, gfp_t, int flags);
|
||||
|
||||
static inline int sb_issue_discard(struct super_block *sb,
|
||||
sector_t block, sector_t nr_blocks)
|
||||
{
|
||||
block <<= (sb->s_blocksize_bits - 9);
|
||||
nr_blocks <<= (sb->s_blocksize_bits - 9);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
|
||||
DISCARD_FL_BARRIER);
|
||||
}
|
||||
|
||||
extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/capability.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/key.h>
|
||||
#include <linux/selinux.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct user_struct;
|
||||
|
@ -175,21 +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 ((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
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
* device.h - generic, centralized driver model
|
||||
*
|
||||
* Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
|
||||
* Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2008-2009 Novell Inc.
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*
|
||||
|
@ -62,7 +63,7 @@ struct bus_type {
|
|||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct bus_type_private *p;
|
||||
};
|
||||
|
@ -130,9 +131,9 @@ struct device_driver {
|
|||
void (*shutdown) (struct device *dev);
|
||||
int (*suspend) (struct device *dev, pm_message_t state);
|
||||
int (*resume) (struct device *dev);
|
||||
struct attribute_group **groups;
|
||||
const struct attribute_group **groups;
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct driver_private *p;
|
||||
};
|
||||
|
@ -192,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);
|
||||
|
@ -200,7 +201,8 @@ struct class {
|
|||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct class_private *p;
|
||||
};
|
||||
|
||||
|
@ -223,6 +225,14 @@ extern void class_unregister(struct class *class);
|
|||
__class_register(class, &__key); \
|
||||
})
|
||||
|
||||
struct class_compat;
|
||||
struct class_compat *class_compat_register(const char *name);
|
||||
void class_compat_unregister(struct class_compat *cls);
|
||||
int class_compat_create_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
|
||||
extern void class_dev_iter_init(struct class_dev_iter *iter,
|
||||
struct class *class,
|
||||
struct device *start,
|
||||
|
@ -286,12 +296,12 @@ extern void class_destroy(struct class *cls);
|
|||
*/
|
||||
struct device_type {
|
||||
const char *name;
|
||||
struct attribute_group **groups;
|
||||
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);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
};
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
|
@ -380,7 +390,6 @@ struct device {
|
|||
struct bus_type *bus; /* type of bus device is on */
|
||||
struct device_driver *driver; /* which driver has allocated this
|
||||
device */
|
||||
void *driver_data; /* data private to the driver */
|
||||
void *platform_data; /* Platform specific data, device
|
||||
core doesn't touch it */
|
||||
struct dev_pm_info power;
|
||||
|
@ -411,7 +420,7 @@ struct device {
|
|||
|
||||
struct klist_node knode_class;
|
||||
struct class *class;
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
const struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device *dev);
|
||||
};
|
||||
|
@ -446,16 +455,6 @@ static inline void set_dev_node(struct device *dev, int node)
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline void *dev_get_drvdata(const struct device *dev)
|
||||
{
|
||||
return dev->driver_data;
|
||||
}
|
||||
|
||||
static inline void dev_set_drvdata(struct device *dev, void *data)
|
||||
{
|
||||
dev->driver_data = data;
|
||||
}
|
||||
|
||||
static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
|
||||
{
|
||||
return dev->kobj.uevent_suppress;
|
||||
|
@ -488,7 +487,10 @@ 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);
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
|
@ -501,6 +503,11 @@ static inline struct device *root_device_register(const char *name)
|
|||
}
|
||||
extern void root_device_unregister(struct device *root);
|
||||
|
||||
static inline void *dev_get_platdata(const struct device *dev)
|
||||
{
|
||||
return dev->platform_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
|
@ -546,6 +553,16 @@ extern void put_device(struct device *dev);
|
|||
|
||||
extern void wait_for_device_probe(void);
|
||||
|
||||
#ifdef CONFIG_DEVTMPFS
|
||||
extern int devtmpfs_create_node(struct device *dev);
|
||||
extern int devtmpfs_delete_node(struct device *dev);
|
||||
extern int devtmpfs_mount(const char *mountpoint);
|
||||
#else
|
||||
static inline int devtmpfs_create_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
|
||||
#endif
|
||||
|
||||
/* drivers/base/power/shutdown.c */
|
||||
extern void device_shutdown(void);
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ struct dma_map_ops {
|
|||
enum dma_data_direction dir);
|
||||
int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
|
||||
int (*dma_supported)(struct device *dev, u64 mask);
|
||||
int (*set_dma_mask)(struct device *dev, u64 mask);
|
||||
int is_phys;
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,22 +1,3 @@
|
|||
#if 0
|
||||
|
||||
#define TRACE_TXT(text) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
{ \
|
||||
console_print(text); \
|
||||
console_print("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define TRACE_CHR(chr) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
console_print(chr); \
|
||||
} \
|
||||
|
||||
#endif
|
||||
|
||||
#define DTLK_MINOR 0
|
||||
#define DTLK_IO_EXTENT 0x02
|
||||
|
||||
|
|
|
@ -151,5 +151,7 @@ struct dmx_stc {
|
|||
#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
|
||||
#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
|
||||
#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
|
||||
#define DMX_ADD_PID _IOW('o', 51, __u16)
|
||||
#define DMX_REMOVE_PID _IOW('o', 52, __u16)
|
||||
|
||||
#endif /*_DVBDMX_H_*/
|
||||
|
|
|
@ -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_*/
|
||||
|
|
|
@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int,
|
|||
enum enclosure_component_type, const char *);
|
||||
int enclosure_add_device(struct enclosure_device *enclosure, int component,
|
||||
struct device *dev);
|
||||
int enclosure_remove_device(struct enclosure_device *enclosure, int component);
|
||||
struct enclosure_device *enclosure_find(struct device *dev);
|
||||
int enclosure_remove_device(struct enclosure_device *, struct device *);
|
||||
struct enclosure_device *enclosure_find(struct device *dev,
|
||||
struct enclosure_device *start);
|
||||
int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
|
||||
void *data);
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -161,8 +161,8 @@ struct inodes_stat_t {
|
|||
* These aren't really reads or writes, they pass down information about
|
||||
* parts of device that are now unused by the file system.
|
||||
*/
|
||||
#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
|
||||
#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
|
||||
#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD))
|
||||
#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER))
|
||||
|
||||
#define SEL_IN 1
|
||||
#define SEL_OUT 2
|
||||
|
@ -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;
|
||||
|
@ -655,7 +655,6 @@ struct block_device {
|
|||
int bd_invalidated;
|
||||
struct gendisk * bd_disk;
|
||||
struct list_head bd_list;
|
||||
struct backing_dev_info *bd_inode_backing_dev_info;
|
||||
/*
|
||||
* Private data. You must have bd_claim'ed the block_device
|
||||
* to use this. NOTE: bd_claim allows an owner to claim
|
||||
|
@ -1067,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;
|
||||
|
@ -1316,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;
|
||||
|
@ -1343,6 +1342,7 @@ struct super_block {
|
|||
int s_nr_dentry_unused; /* # of dentry on lru */
|
||||
|
||||
struct block_device *s_bdev;
|
||||
struct backing_dev_info *s_bdi;
|
||||
struct mtd_info *s_mtd;
|
||||
struct list_head s_instances;
|
||||
struct quota_info s_dquot; /* Diskquota specific options */
|
||||
|
@ -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 {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef _LINUX_FTRACE_EVENT_H
|
||||
#define _LINUX_FTRACE_EVENT_H
|
||||
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/ring_buffer.h>
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
struct trace_array;
|
||||
struct tracer;
|
||||
|
@ -34,7 +35,7 @@ struct trace_entry {
|
|||
unsigned char flags;
|
||||
unsigned char preempt_count;
|
||||
int pid;
|
||||
int tgid;
|
||||
int lock_depth;
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_EVENT \
|
||||
|
@ -130,12 +131,17 @@ 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 128
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
||||
extern void destroy_preds(struct ftrace_event_call *call);
|
||||
extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ struct hd_struct {
|
|||
int make_it_fail;
|
||||
#endif
|
||||
unsigned long stamp;
|
||||
int in_flight;
|
||||
int in_flight[2];
|
||||
#ifdef CONFIG_SMP
|
||||
struct disk_stats *dkstats;
|
||||
#else
|
||||
|
@ -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;
|
||||
|
||||
|
@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part)
|
|||
#define part_stat_sub(cpu, gendiskp, field, subnd) \
|
||||
part_stat_add(cpu, gendiskp, field, -subnd)
|
||||
|
||||
static inline void part_inc_in_flight(struct hd_struct *part)
|
||||
static inline void part_inc_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight++;
|
||||
part->in_flight[rw]++;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight++;
|
||||
part_to_disk(part)->part0.in_flight[rw]++;
|
||||
}
|
||||
|
||||
static inline void part_dec_in_flight(struct hd_struct *part)
|
||||
static inline void part_dec_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight--;
|
||||
part->in_flight[rw]--;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight--;
|
||||
part_to_disk(part)->part0.in_flight[rw]--;
|
||||
}
|
||||
|
||||
static inline int part_in_flight(struct hd_struct *part)
|
||||
{
|
||||
return part->in_flight[0] + part->in_flight[1];
|
||||
}
|
||||
|
||||
/* block/blk-core.c */
|
||||
|
@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev,
|
|||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_stat_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_inflight_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
#ifdef CONFIG_FAIL_MAKE_REQUEST
|
||||
extern ssize_t part_fail_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __HID_DEBUG_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Jiri Kosina
|
||||
* Copyright (c) 2007-2009 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -22,24 +22,44 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define HID_DEBUG_BUFSIZE 512
|
||||
|
||||
void hid_dump_input(struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *);
|
||||
void hid_dump_field(struct hid_field *, int);
|
||||
void hid_resolv_usage(unsigned);
|
||||
void hid_resolv_event(__u8, __u16);
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *, struct seq_file *);
|
||||
void hid_dump_field(struct hid_field *, int, struct seq_file *);
|
||||
char *hid_resolv_usage(unsigned, struct seq_file *);
|
||||
void hid_debug_register(struct hid_device *, const char *);
|
||||
void hid_debug_unregister(struct hid_device *);
|
||||
void hid_debug_init(void);
|
||||
void hid_debug_exit(void);
|
||||
void hid_debug_event(struct hid_device *, char *);
|
||||
|
||||
|
||||
struct hid_debug_list {
|
||||
char *hid_debug_buf;
|
||||
int head;
|
||||
int tail;
|
||||
struct fasync_struct *fasync;
|
||||
struct hid_device *hdev;
|
||||
struct list_head node;
|
||||
struct mutex read_mutex;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#define hid_dump_input(a,b) do { } while (0)
|
||||
#define hid_dump_device(c) do { } while (0)
|
||||
#define hid_dump_field(a,b) do { } while (0)
|
||||
#define hid_resolv_usage(a) do { } while (0)
|
||||
#define hid_resolv_event(a,b) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_HID_DEBUG */
|
||||
|
||||
#define hid_dump_input(a,b,c) do { } while (0)
|
||||
#define hid_dump_device(a,b) do { } while (0)
|
||||
#define hid_dump_field(a,b,c) do { } while (0)
|
||||
#define hid_resolv_usage(a,b) do { } while (0)
|
||||
#define hid_debug_register(a, b) do { } while (0)
|
||||
#define hid_debug_unregister(a) do { } while (0)
|
||||
#define hid_debug_init() do { } while (0)
|
||||
#define hid_debug_exit() do { } while (0)
|
||||
#define hid_debug_event(a,b) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -494,12 +494,21 @@ 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 *);
|
||||
|
||||
/* handler for raw output data, used by hidraw */
|
||||
int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
|
||||
|
||||
/* debugging support via debugfs */
|
||||
unsigned short debug;
|
||||
struct dentry *debug_dir;
|
||||
struct dentry *debug_rdesc;
|
||||
struct dentry *debug_events;
|
||||
struct list_head debug_list;
|
||||
wait_queue_head_t debug_wait;
|
||||
};
|
||||
|
||||
static inline void *hid_get_drvdata(struct hid_device *hdev)
|
||||
|
@ -657,9 +666,7 @@ struct hid_ll_driver {
|
|||
|
||||
/* HID core API */
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
extern int hid_debug;
|
||||
#endif
|
||||
|
||||
extern int hid_add_device(struct hid_device *);
|
||||
extern void hid_destroy_device(struct hid_device *);
|
||||
|
@ -685,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
|
||||
|
@ -794,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);
|
||||
}
|
||||
|
||||
|
@ -815,21 +824,9 @@ int hid_pidff_init(struct hid_device *hid);
|
|||
#define hid_pidff_init NULL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define dbg_hid(format, arg...) if (hid_debug) \
|
||||
printk(KERN_DEBUG "%s: " format ,\
|
||||
__FILE__ , ## arg)
|
||||
#define dbg_hid_line(format, arg...) if (hid_debug) \
|
||||
printk(format, ## arg)
|
||||
#else
|
||||
static inline int __attribute__((format(printf, 1, 2)))
|
||||
dbg_hid(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#define dbg_hid_line dbg_hid
|
||||
#endif /* HID_DEBUG */
|
||||
|
||||
#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#endif /* HID_FF */
|
||||
|
|
|
@ -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 */
|
|
@ -25,6 +25,9 @@
|
|||
#ifndef __TWL4030_H_
|
||||
#define __TWL4030_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
|
||||
/*
|
||||
* Using the twl4030 core we address registers using a pair
|
||||
* { module id, relative register offset }
|
||||
|
@ -220,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
|
||||
|
||||
|
@ -243,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
|
||||
|
@ -302,13 +349,17 @@ struct twl4030_madc_platform_data {
|
|||
int irq_line;
|
||||
};
|
||||
|
||||
/* Boards have uniqe mappings of {col, row} --> keycode.
|
||||
* Column and row are 4 bits, but range only from 0..7.
|
||||
* a PERSISTENT_KEY is "always on" and never reported.
|
||||
*/
|
||||
#define PERSISTENT_KEY(c, r) KEY((c), (r), KEY_RESERVED)
|
||||
|
||||
struct twl4030_keypad_data {
|
||||
int rows;
|
||||
int cols;
|
||||
int *keymap;
|
||||
int irq;
|
||||
unsigned int keymapsize;
|
||||
unsigned int rep:1;
|
||||
const struct matrix_keymap_data *keymap_data;
|
||||
unsigned rows;
|
||||
unsigned cols;
|
||||
bool rep;
|
||||
};
|
||||
|
||||
enum twl4030_usb_mode {
|
||||
|
@ -320,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;
|
||||
|
@ -327,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;
|
||||
|
@ -357,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
|
||||
|
|
|
@ -258,6 +258,7 @@ enum {
|
|||
IDE_TFLAG_DYN = (1 << 5),
|
||||
IDE_TFLAG_FS = (1 << 6),
|
||||
IDE_TFLAG_MULTI_PIO = (1 << 7),
|
||||
IDE_TFLAG_SET_XFER = (1 << 8),
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -294,7 +295,7 @@ struct ide_cmd {
|
|||
} out, in;
|
||||
} valid;
|
||||
|
||||
u8 tf_flags;
|
||||
u16 tf_flags;
|
||||
u8 ftf_flags; /* for TASKFILE ioctl */
|
||||
int protocol;
|
||||
|
||||
|
@ -918,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
|
|||
typedef struct {
|
||||
const char *name;
|
||||
mode_t mode;
|
||||
read_proc_t *read_proc;
|
||||
write_proc_t *write_proc;
|
||||
const struct file_operations *proc_fops;
|
||||
} ide_proc_entry_t;
|
||||
|
||||
void proc_ide_create(void);
|
||||
|
@ -931,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *);
|
|||
void ide_proc_register_driver(ide_drive_t *, struct ide_driver *);
|
||||
void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *);
|
||||
|
||||
read_proc_t proc_ide_read_capacity;
|
||||
read_proc_t proc_ide_read_geometry;
|
||||
|
||||
/*
|
||||
* Standard exit stuff:
|
||||
*/
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \
|
||||
{ \
|
||||
len -= off; \
|
||||
if (len < count) { \
|
||||
*eof = 1; \
|
||||
if (len <= 0) \
|
||||
return 0; \
|
||||
} else \
|
||||
len = count; \
|
||||
*start = page + off; \
|
||||
return len; \
|
||||
}
|
||||
extern const struct file_operations ide_capacity_proc_fops;
|
||||
extern const struct file_operations ide_geometry_proc_fops;
|
||||
#else
|
||||
static inline void proc_ide_create(void) { ; }
|
||||
static inline void proc_ide_destroy(void) { ; }
|
||||
|
@ -960,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive,
|
|||
struct ide_driver *driver) { ; }
|
||||
static inline void ide_proc_unregister_driver(ide_drive_t *drive,
|
||||
struct ide_driver *driver) { ; }
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
|
@ -1081,6 +1064,7 @@ extern void ide_fixstring(u8 *, const int, const int);
|
|||
|
||||
int ide_busy_sleep(ide_drive_t *, unsigned long, int);
|
||||
|
||||
int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long, u8 *);
|
||||
int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
|
||||
|
||||
ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
|
||||
|
@ -1169,7 +1153,7 @@ int ide_no_data_taskfile(ide_drive_t *, struct ide_cmd *);
|
|||
|
||||
int ide_taskfile_ioctl(ide_drive_t *, unsigned long);
|
||||
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *);
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *, int);
|
||||
|
||||
extern int ide_driveid_update(ide_drive_t *);
|
||||
extern int ide_config_drive_speed(ide_drive_t *, u8);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
9
include/linux/input/eeti_ts.h
Normal file
9
include/linux/input/eeti_ts.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef LINUX_INPUT_EETI_TS_H
|
||||
#define LINUX_INPUT_EETI_TS_H
|
||||
|
||||
struct eeti_ts_platform_data {
|
||||
unsigned int irq_active_high;
|
||||
};
|
||||
|
||||
#endif /* LINUX_INPUT_EETI_TS_H */
|
||||
|
|
@ -63,4 +63,36 @@ struct matrix_keypad_platform_data {
|
|||
bool wakeup;
|
||||
};
|
||||
|
||||
/**
|
||||
* matrix_keypad_build_keymap - convert platform keymap into matrix keymap
|
||||
* @keymap_data: keymap supplied by the platform code
|
||||
* @row_shift: number of bits to shift row value by to advance to the next
|
||||
* line in the keymap
|
||||
* @keymap: expanded version of keymap that is suitable for use by
|
||||
* matrix keyboad driver
|
||||
* @keybit: pointer to bitmap of keys supported by input device
|
||||
*
|
||||
* This function converts platform keymap (encoded with KEY() macro) into
|
||||
* an array of keycodes that is suitable for using in a standard matrix
|
||||
* keyboard driver that uses row and col as indices.
|
||||
*/
|
||||
static inline void
|
||||
matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
|
||||
unsigned int row_shift,
|
||||
unsigned short *keymap, unsigned long *keybit)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < keymap_data->keymap_size; i++) {
|
||||
unsigned int key = keymap_data->keymap[i];
|
||||
unsigned int row = KEY_ROW(key);
|
||||
unsigned int col = KEY_COL(key);
|
||||
unsigned short code = KEY_VAL(key);
|
||||
|
||||
keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code;
|
||||
__set_bit(code, keybit);
|
||||
}
|
||||
__clear_bit(KEY_RESERVED, keybit);
|
||||
}
|
||||
|
||||
#endif /* _MATRIX_KEYPAD_H */
|
||||
|
|
|
@ -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;
|
||||
|
@ -348,6 +346,7 @@ enum
|
|||
NET_TX_SOFTIRQ,
|
||||
NET_RX_SOFTIRQ,
|
||||
BLOCK_SOFTIRQ,
|
||||
BLOCK_IOPOLL_SOFTIRQ,
|
||||
TASKLET_SOFTIRQ,
|
||||
SCHED_SOFTIRQ,
|
||||
HRTIMER_SOFTIRQ,
|
||||
|
|
|
@ -49,23 +49,30 @@ static inline struct io_mapping *
|
|||
io_mapping_create_wc(resource_size_t base, unsigned long size)
|
||||
{
|
||||
struct io_mapping *iomap;
|
||||
|
||||
if (!is_io_mapping_possible(base, size))
|
||||
return NULL;
|
||||
pgprot_t prot;
|
||||
|
||||
iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
|
||||
if (!iomap)
|
||||
return NULL;
|
||||
goto out_err;
|
||||
|
||||
if (iomap_create_wc(base, size, &prot))
|
||||
goto out_free;
|
||||
|
||||
iomap->base = base;
|
||||
iomap->size = size;
|
||||
iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
|
||||
iomap->prot = prot;
|
||||
return iomap;
|
||||
|
||||
out_free:
|
||||
kfree(iomap);
|
||||
out_err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
io_mapping_free(struct io_mapping *mapping)
|
||||
{
|
||||
iomap_free(mapping->base, mapping->size);
|
||||
kfree(mapping);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
#define KPROBE_HIT_SSDONE 0x00000008
|
||||
|
||||
/* Attach to insert probes on any functions which should be ignored*/
|
||||
#define __kprobes __attribute__((__section__(".kprobes.text"))) notrace
|
||||
#define __kprobes __attribute__((__section__(".kprobes.text")))
|
||||
#else /* CONFIG_KPROBES */
|
||||
typedef int kprobe_opcode_t;
|
||||
struct arch_specific_insn {
|
||||
int dummy;
|
||||
};
|
||||
#define __kprobes notrace
|
||||
#define __kprobes
|
||||
#endif /* CONFIG_KPROBES */
|
||||
|
||||
struct kprobe;
|
||||
|
|
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
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#define KVM_API_VERSION 12
|
||||
|
||||
/* for KVM_TRACE_ENABLE */
|
||||
/* for KVM_TRACE_ENABLE, deprecated */
|
||||
struct kvm_user_trace_setup {
|
||||
__u32 buf_size; /* sub_buffer size of each per-cpu */
|
||||
__u32 buf_nr; /* the number of sub_buffers of each per-cpu */
|
||||
|
@ -70,6 +70,14 @@ struct kvm_irqchip {
|
|||
} chip;
|
||||
};
|
||||
|
||||
/* for KVM_CREATE_PIT2 */
|
||||
struct kvm_pit_config {
|
||||
__u32 flags;
|
||||
__u32 pad[15];
|
||||
};
|
||||
|
||||
#define KVM_PIT_SPEAKER_DUMMY 1
|
||||
|
||||
#define KVM_EXIT_UNKNOWN 0
|
||||
#define KVM_EXIT_EXCEPTION 1
|
||||
#define KVM_EXIT_IO 2
|
||||
|
@ -87,6 +95,10 @@ struct kvm_irqchip {
|
|||
#define KVM_EXIT_S390_RESET 14
|
||||
#define KVM_EXIT_DCR 15
|
||||
#define KVM_EXIT_NMI 16
|
||||
#define KVM_EXIT_INTERNAL_ERROR 17
|
||||
|
||||
/* For KVM_EXIT_INTERNAL_ERROR */
|
||||
#define KVM_INTERNAL_ERROR_EMULATION 1
|
||||
|
||||
/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
|
||||
struct kvm_run {
|
||||
|
@ -173,6 +185,9 @@ struct kvm_run {
|
|||
__u32 data;
|
||||
__u8 is_write;
|
||||
} dcr;
|
||||
struct {
|
||||
__u32 suberror;
|
||||
} internal;
|
||||
/* Fix the size of the union. */
|
||||
char padding[256];
|
||||
};
|
||||
|
@ -292,6 +307,28 @@ struct kvm_guest_debug {
|
|||
struct kvm_guest_debug_arch arch;
|
||||
};
|
||||
|
||||
enum {
|
||||
kvm_ioeventfd_flag_nr_datamatch,
|
||||
kvm_ioeventfd_flag_nr_pio,
|
||||
kvm_ioeventfd_flag_nr_deassign,
|
||||
kvm_ioeventfd_flag_nr_max,
|
||||
};
|
||||
|
||||
#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
|
||||
#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
|
||||
#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
|
||||
|
||||
#define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1)
|
||||
|
||||
struct kvm_ioeventfd {
|
||||
__u64 datamatch;
|
||||
__u64 addr; /* legal pio/mmio address */
|
||||
__u32 len; /* 1, 2, 4, or 8 bytes */
|
||||
__s32 fd;
|
||||
__u32 flags;
|
||||
__u8 pad[36];
|
||||
};
|
||||
|
||||
#define KVM_TRC_SHIFT 16
|
||||
/*
|
||||
* kvm trace categories
|
||||
|
@ -310,35 +347,6 @@ struct kvm_guest_debug {
|
|||
#define KVM_TRC_CYCLE_SIZE 8
|
||||
#define KVM_TRC_EXTRA_MAX 7
|
||||
|
||||
/* This structure represents a single trace buffer record. */
|
||||
struct kvm_trace_rec {
|
||||
/* variable rec_val
|
||||
* is split into:
|
||||
* bits 0 - 27 -> event id
|
||||
* bits 28 -30 -> number of extra data args of size u32
|
||||
* bits 31 -> binary indicator for if tsc is in record
|
||||
*/
|
||||
__u32 rec_val;
|
||||
__u32 pid;
|
||||
__u32 vcpu_id;
|
||||
union {
|
||||
struct {
|
||||
__u64 timestamp;
|
||||
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
|
||||
} __attribute__((packed)) timestamp;
|
||||
struct {
|
||||
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
|
||||
} notimestamp;
|
||||
} u;
|
||||
};
|
||||
|
||||
#define TRACE_REC_EVENT_ID(val) \
|
||||
(0x0fffffff & (val))
|
||||
#define TRACE_REC_NUM_DATA_ARGS(val) \
|
||||
(0x70000000 & ((val) << 28))
|
||||
#define TRACE_REC_TCS(val) \
|
||||
(0x80000000 & ((val) << 31))
|
||||
|
||||
#define KVMIO 0xAE
|
||||
|
||||
/*
|
||||
|
@ -415,6 +423,19 @@ struct kvm_trace_rec {
|
|||
#define KVM_CAP_ASSIGN_DEV_IRQ 29
|
||||
/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */
|
||||
#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
|
||||
#ifdef __KVM_HAVE_MCE
|
||||
#define KVM_CAP_MCE 31
|
||||
#endif
|
||||
#define KVM_CAP_IRQFD 32
|
||||
#ifdef __KVM_HAVE_PIT
|
||||
#define KVM_CAP_PIT2 33
|
||||
#endif
|
||||
#define KVM_CAP_SET_BOOT_CPU_ID 34
|
||||
#ifdef __KVM_HAVE_PIT_STATE2
|
||||
#define KVM_CAP_PIT_STATE2 35
|
||||
#endif
|
||||
#define KVM_CAP_IOEVENTFD 36
|
||||
#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
|
@ -454,15 +475,32 @@ struct kvm_irq_routing {
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef KVM_CAP_MCE
|
||||
/* x86 MCE */
|
||||
struct kvm_x86_mce {
|
||||
__u64 status;
|
||||
__u64 addr;
|
||||
__u64 misc;
|
||||
__u64 mcg_status;
|
||||
__u8 bank;
|
||||
__u8 pad1[7];
|
||||
__u64 pad2[3];
|
||||
};
|
||||
#endif
|
||||
|
||||
#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
|
||||
|
||||
struct kvm_irqfd {
|
||||
__u32 fd;
|
||||
__u32 gsi;
|
||||
__u32 flags;
|
||||
__u8 pad[20];
|
||||
};
|
||||
|
||||
/*
|
||||
* ioctls for VM fds
|
||||
*/
|
||||
#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
|
||||
#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
|
||||
#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
|
||||
#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
|
||||
struct kvm_userspace_memory_region)
|
||||
#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
|
||||
/*
|
||||
* KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
|
||||
* a vcpu fd.
|
||||
|
@ -470,6 +508,12 @@ struct kvm_irq_routing {
|
|||
#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
|
||||
#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
|
||||
#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
|
||||
#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
|
||||
#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
|
||||
#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
|
||||
struct kvm_userspace_memory_region)
|
||||
#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
|
||||
#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
|
||||
/* Device model IOC */
|
||||
#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
|
||||
#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
|
||||
|
@ -498,6 +542,10 @@ struct kvm_irq_routing {
|
|||
#define KVM_ASSIGN_SET_MSIX_ENTRY \
|
||||
_IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry)
|
||||
#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
|
||||
#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
|
||||
#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
|
||||
#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
|
||||
#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
|
||||
|
||||
/*
|
||||
* ioctls for vcpu fds
|
||||
|
@ -541,6 +589,10 @@ struct kvm_irq_routing {
|
|||
#define KVM_NMI _IO(KVMIO, 0x9a)
|
||||
/* Available with KVM_CAP_SET_GUEST_DEBUG */
|
||||
#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
|
||||
/* MCE for x86 */
|
||||
#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
|
||||
#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
|
||||
#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
|
||||
|
||||
/*
|
||||
* Deprecated interfaces
|
||||
|
@ -563,6 +615,9 @@ struct kvm_debug_guest {
|
|||
#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
|
||||
#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
|
||||
|
||||
#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
|
||||
#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
|
||||
|
||||
#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
|
||||
#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
|
||||
#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
|
||||
|
@ -633,7 +688,7 @@ struct kvm_assigned_msix_nr {
|
|||
__u16 padding;
|
||||
};
|
||||
|
||||
#define KVM_MAX_MSIX_PER_DEV 512
|
||||
#define KVM_MAX_MSIX_PER_DEV 256
|
||||
struct kvm_assigned_msix_entry {
|
||||
__u32 assigned_dev_id;
|
||||
__u32 gsi;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
@ -42,6 +41,7 @@
|
|||
|
||||
#define KVM_USERSPACE_IRQ_SOURCE_ID 0
|
||||
|
||||
struct kvm;
|
||||
struct kvm_vcpu;
|
||||
extern struct kmem_cache *kvm_vcpu_cache;
|
||||
|
||||
|
@ -59,10 +59,18 @@ struct kvm_io_bus {
|
|||
|
||||
void kvm_io_bus_init(struct kvm_io_bus *bus);
|
||||
void kvm_io_bus_destroy(struct kvm_io_bus *bus);
|
||||
struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus,
|
||||
gpa_t addr, int len, int is_write);
|
||||
void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
const void *val);
|
||||
int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len,
|
||||
void *val);
|
||||
int __kvm_io_bus_register_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus,
|
||||
struct kvm_io_device *dev);
|
||||
|
||||
struct kvm_vcpu {
|
||||
struct kvm *kvm;
|
||||
|
@ -103,7 +111,7 @@ struct kvm_memory_slot {
|
|||
struct {
|
||||
unsigned long rmap_pde;
|
||||
int write_count;
|
||||
} *lpage_info;
|
||||
} *lpage_info[KVM_NR_PAGE_SIZES - 1];
|
||||
unsigned long userspace_addr;
|
||||
int user_alloc;
|
||||
};
|
||||
|
@ -124,7 +132,6 @@ struct kvm_kernel_irq_routing_entry {
|
|||
};
|
||||
|
||||
struct kvm {
|
||||
struct mutex lock; /* protects the vcpus array and APIC accesses */
|
||||
spinlock_t mmu_lock;
|
||||
spinlock_t requests_lock;
|
||||
struct rw_semaphore slots_lock;
|
||||
|
@ -132,10 +139,23 @@ struct kvm {
|
|||
int nmemslots;
|
||||
struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
|
||||
KVM_PRIVATE_MEM_SLOTS];
|
||||
#ifdef CONFIG_KVM_APIC_ARCHITECTURE
|
||||
u32 bsp_vcpu_id;
|
||||
struct kvm_vcpu *bsp_vcpu;
|
||||
#endif
|
||||
struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
|
||||
atomic_t online_vcpus;
|
||||
struct list_head vm_list;
|
||||
struct mutex lock;
|
||||
struct kvm_io_bus mmio_bus;
|
||||
struct kvm_io_bus pio_bus;
|
||||
#ifdef CONFIG_HAVE_KVM_EVENTFD
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
struct list_head items;
|
||||
} irqfds;
|
||||
struct list_head ioeventfds;
|
||||
#endif
|
||||
struct kvm_vm_stat stat;
|
||||
struct kvm_arch arch;
|
||||
atomic_t users_count;
|
||||
|
@ -144,6 +164,7 @@ struct kvm {
|
|||
struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
|
||||
#endif
|
||||
|
||||
struct mutex irq_lock;
|
||||
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
||||
struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */
|
||||
struct hlist_head mask_notifier_list;
|
||||
|
@ -167,6 +188,17 @@ struct kvm {
|
|||
#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
|
||||
#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
|
||||
|
||||
static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
|
||||
{
|
||||
smp_rmb();
|
||||
return kvm->vcpus[i];
|
||||
}
|
||||
|
||||
#define kvm_for_each_vcpu(idx, vcpup, kvm) \
|
||||
for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \
|
||||
idx < atomic_read(&kvm->online_vcpus) && vcpup; \
|
||||
vcpup = kvm_get_vcpu(kvm, ++idx))
|
||||
|
||||
int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id);
|
||||
void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
|
||||
|
||||
|
@ -201,6 +233,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
|
|||
struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot old,
|
||||
int user_alloc);
|
||||
void kvm_disable_largepages(void);
|
||||
void kvm_arch_flush_shadow(struct kvm *kvm);
|
||||
gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
|
||||
struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
|
||||
|
@ -243,8 +276,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
|
|||
unsigned int ioctl, unsigned long arg);
|
||||
long kvm_arch_vcpu_ioctl(struct file *filp,
|
||||
unsigned int ioctl, unsigned long arg);
|
||||
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
|
||||
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
|
||||
|
||||
int kvm_dev_ioctl_check_extension(long ext);
|
||||
|
||||
|
@ -300,7 +331,6 @@ int kvm_arch_hardware_setup(void);
|
|||
void kvm_arch_hardware_unsetup(void);
|
||||
void kvm_arch_check_processor_compat(void *rtn);
|
||||
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
|
||||
int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
|
||||
|
||||
void kvm_free_physmem(struct kvm *kvm);
|
||||
|
||||
|
@ -309,8 +339,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm);
|
|||
void kvm_free_all_assigned_devices(struct kvm *kvm);
|
||||
void kvm_arch_sync_events(struct kvm *kvm);
|
||||
|
||||
int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
|
||||
int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
|
||||
int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
|
||||
void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
|
||||
|
||||
|
@ -366,7 +394,8 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
|
|||
void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
|
||||
void kvm_register_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian);
|
||||
void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
|
||||
struct kvm_irq_ack_notifier *kian);
|
||||
int kvm_request_irq_source_id(struct kvm *kvm);
|
||||
void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
|
||||
|
||||
|
@ -459,37 +488,6 @@ struct kvm_stats_debugfs_item {
|
|||
extern struct kvm_stats_debugfs_item debugfs_entries[];
|
||||
extern struct dentry *kvm_debugfs_dir;
|
||||
|
||||
#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 5, d1, d2, d3, d4, d5)
|
||||
#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 4, d1, d2, d3, d4, 0)
|
||||
#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 3, d1, d2, d3, 0, 0)
|
||||
#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 2, d1, d2, 0, 0, 0)
|
||||
#define KVMTRACE_1D(evt, vcpu, d1, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 1, d1, 0, 0, 0, 0)
|
||||
#define KVMTRACE_0D(evt, vcpu, name) \
|
||||
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
|
||||
vcpu, 0, 0, 0, 0, 0, 0)
|
||||
|
||||
#ifdef CONFIG_KVM_TRACE
|
||||
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
|
||||
void kvm_trace_cleanup(void);
|
||||
#else
|
||||
static inline
|
||||
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#define kvm_trace_cleanup() ((void)0)
|
||||
#endif
|
||||
|
||||
#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
|
||||
static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
|
||||
{
|
||||
|
@ -525,4 +523,33 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_KVM_EVENTFD
|
||||
|
||||
void kvm_eventfd_init(struct kvm *kvm);
|
||||
int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags);
|
||||
void kvm_irqfd_release(struct kvm *kvm);
|
||||
int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
|
||||
|
||||
#else
|
||||
|
||||
static inline void kvm_eventfd_init(struct kvm *kvm) {}
|
||||
static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void kvm_irqfd_release(struct kvm *kvm) {}
|
||||
static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_KVM_EVENTFD */
|
||||
|
||||
#ifdef CONFIG_KVM_APIC_ARCHITECTURE
|
||||
static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#define KVM_ENOSYS 1000
|
||||
#define KVM_EFAULT EFAULT
|
||||
#define KVM_E2BIG E2BIG
|
||||
#define KVM_EPERM EPERM
|
||||
|
||||
#define KVM_HC_VAPIC_POLL_IRQ 1
|
||||
#define KVM_HC_MMU_OP 2
|
||||
|
|
|
@ -44,6 +44,9 @@ 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);
|
||||
int ps2_handle_response(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
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue