aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/actbl1.h2
-rw-r--r--include/asm-generic/gpio.h10
-rw-r--r--include/asm-generic/vmlinux.lds.h3
-rw-r--r--include/crypto/if_alg.h92
-rw-r--r--include/crypto/padlock.h29
-rw-r--r--include/crypto/scatterwalk.h15
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/binfmts.h5
-rw-r--r--include/linux/cdev.h2
-rw-r--r--include/linux/ceph/ceph_fs.h16
-rw-r--r--include/linux/ceph/messenger.h5
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/coda_cache.h22
-rw-r--r--include/linux/coda_fs_i.h58
-rw-r--r--include/linux/coda_linux.h99
-rw-r--r--include/linux/cramfs_fs.h2
-rw-r--r--include/linux/cs5535.h6
-rw-r--r--include/linux/decompress/inflate.h3
-rw-r--r--include/linux/decompress/mm.h6
-rw-r--r--include/linux/decompress/unxz.h19
-rw-r--r--include/linux/falloc.h1
-rw-r--r--include/linux/firewire-cdev.h2
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/gpio.h26
-rw-r--r--include/linux/hid.h6
-rw-r--r--include/linux/if_alg.h40
-rw-r--r--include/linux/input.h1
-rw-r--r--include/linux/input/as5011.h20
-rw-r--r--include/linux/kernel.h19
-rw-r--r--include/linux/kmsg_dump.h4
-rw-r--r--include/linux/kvm.h1
-rw-r--r--include/linux/kvm_host.h101
-rw-r--r--include/linux/kvm_types.h7
-rw-r--r--include/linux/leds-lp5521.h1
-rw-r--r--include/linux/leds-lp5523.h1
-rw-r--r--include/linux/mfd/ab8500.h5
-rw-r--r--include/linux/mfd/core.h2
-rw-r--r--include/linux/mfd/mc13783.h67
-rw-r--r--include/linux/mfd/mc13892.h39
-rw-r--r--include/linux/mfd/wm8994/core.h8
-rw-r--r--include/linux/mfd/wm8994/pdata.h17
-rw-r--r--include/linux/mfd/wm8994/registers.h302
-rw-r--r--include/linux/mmc/sh_mmcif.h37
-rw-r--r--include/linux/ncp_fs.h100
-rw-r--r--include/linux/ncp_fs_i.h29
-rw-r--r--include/linux/ncp_fs_sb.h164
-rw-r--r--include/linux/ncp_mount.h22
-rw-r--r--include/linux/nfc/pn544.h97
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/pps.h7
-rw-r--r--include/linux/pps_kernel.h61
-rw-r--r--include/linux/printk.h248
-rw-r--r--include/linux/regulator/ab8500.h24
-rw-r--r--include/linux/regulator/consumer.h1
-rw-r--r--include/linux/regulator/driver.h19
-rw-r--r--include/linux/rio.h100
-rw-r--r--include/linux/rio_drv.h72
-rw-r--r--include/linux/rio_ids.h2
-rw-r--r--include/linux/romfs_fs.h3
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/serial_core.h5
-rw-r--r--include/linux/serial_sci.h22
-rw-r--r--include/linux/socket.h5
-rw-r--r--include/linux/suspend.h8
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/timex.h1
-rw-r--r--include/linux/toshiba.h2
-rw-r--r--include/linux/tty_ldisc.h7
-rw-r--r--include/linux/u64_stats_sync.h12
-rw-r--r--include/linux/unaligned/packed_struct.h6
-rw-r--r--include/linux/user_namespace.h2
-rw-r--r--include/linux/xz.h264
-rw-r--r--include/media/davinci/vpss.h2
-rw-r--r--include/net/sctp/user.h4
-rw-r--r--include/scsi/fc/fc_fcp.h4
-rw-r--r--include/sound/alc5623.h15
-rw-r--r--include/sound/asound.h3
-rw-r--r--include/sound/control.h4
-rw-r--r--include/sound/hdsp.h1
-rw-r--r--include/sound/minors.h4
-rw-r--r--include/sound/pcm.h1
-rw-r--r--include/sound/soc-dai.h4
-rw-r--r--include/sound/soc-dapm.h99
-rw-r--r--include/sound/soc.h116
-rw-r--r--include/trace/events/asoc.h235
-rw-r--r--include/trace/events/kvm.h121
-rw-r--r--include/trace/events/regulator.h141
88 files changed, 2227 insertions, 927 deletions
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index c637b75b9f3f..cd77aa75c962 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -119,7 +119,7 @@ struct acpi_whea_header {
119struct acpi_table_bert { 119struct acpi_table_bert {
120 struct acpi_table_header header; /* Common ACPI table header */ 120 struct acpi_table_header header; /* Common ACPI table header */
121 u32 region_length; /* Length of the boot error region */ 121 u32 region_length; /* Length of the boot error region */
122 u64 address; /* Physical addresss of the error region */ 122 u64 address; /* Physical address of the error region */
123}; 123};
124 124
125/* Boot Error Region (not a subtable, pointed to by Address field above) */ 125/* Boot Error Region (not a subtable, pointed to by Address field above) */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index ff5c66080c8c..6098cae2af8e 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -147,11 +147,11 @@ extern struct gpio_chip *gpiochip_find(void *data,
147/* Always use the library code for GPIO management calls, 147/* Always use the library code for GPIO management calls,
148 * or when sleeping may be involved. 148 * or when sleeping may be involved.
149 */ 149 */
150extern int gpio_request(unsigned gpio, const char *label); 150extern int __must_check gpio_request(unsigned gpio, const char *label);
151extern void gpio_free(unsigned gpio); 151extern void gpio_free(unsigned gpio);
152 152
153extern int gpio_direction_input(unsigned gpio); 153extern int __must_check gpio_direction_input(unsigned gpio);
154extern int gpio_direction_output(unsigned gpio, int value); 154extern int __must_check gpio_direction_output(unsigned gpio, int value);
155 155
156extern int gpio_set_debounce(unsigned gpio, unsigned debounce); 156extern int gpio_set_debounce(unsigned gpio, unsigned debounce);
157 157
@@ -192,8 +192,8 @@ struct gpio {
192 const char *label; 192 const char *label;
193}; 193};
194 194
195extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); 195extern int __must_check gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
196extern int gpio_request_array(struct gpio *array, size_t num); 196extern int __must_check gpio_request_array(struct gpio *array, size_t num);
197extern void gpio_free_array(struct gpio *array, size_t num); 197extern void gpio_free_array(struct gpio *array, size_t num);
198 198
199#ifdef CONFIG_GPIO_SYSFS 199#ifdef CONFIG_GPIO_SYSFS
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 05cbad03c5ab..68649336c4ad 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -200,7 +200,8 @@
200 200
201#define READ_MOSTLY_DATA(align) \ 201#define READ_MOSTLY_DATA(align) \
202 . = ALIGN(align); \ 202 . = ALIGN(align); \
203 *(.data..read_mostly) 203 *(.data..read_mostly) \
204 . = ALIGN(align);
204 205
205#define CACHELINE_ALIGNED_DATA(align) \ 206#define CACHELINE_ALIGNED_DATA(align) \
206 . = ALIGN(align); \ 207 . = ALIGN(align); \
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
new file mode 100644
index 000000000000..c5813c87de06
--- /dev/null
+++ b/include/crypto/if_alg.h
@@ -0,0 +1,92 @@
1/*
2 * if_alg: User-space algorithm interface
3 *
4 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _CRYPTO_IF_ALG_H
14#define _CRYPTO_IF_ALG_H
15
16#include <linux/compiler.h>
17#include <linux/completion.h>
18#include <linux/if_alg.h>
19#include <linux/types.h>
20#include <net/sock.h>
21
22#define ALG_MAX_PAGES 16
23
24struct crypto_async_request;
25
26struct alg_sock {
27 /* struct sock must be the first member of struct alg_sock */
28 struct sock sk;
29
30 struct sock *parent;
31
32 const struct af_alg_type *type;
33 void *private;
34};
35
36struct af_alg_completion {
37 struct completion completion;
38 int err;
39};
40
41struct af_alg_control {
42 struct af_alg_iv *iv;
43 int op;
44};
45
46struct af_alg_type {
47 void *(*bind)(const char *name, u32 type, u32 mask);
48 void (*release)(void *private);
49 int (*setkey)(void *private, const u8 *key, unsigned int keylen);
50 int (*accept)(void *private, struct sock *sk);
51
52 struct proto_ops *ops;
53 struct module *owner;
54 char name[14];
55};
56
57struct af_alg_sgl {
58 struct scatterlist sg[ALG_MAX_PAGES];
59 struct page *pages[ALG_MAX_PAGES];
60};
61
62int af_alg_register_type(const struct af_alg_type *type);
63int af_alg_unregister_type(const struct af_alg_type *type);
64
65int af_alg_release(struct socket *sock);
66int af_alg_accept(struct sock *sk, struct socket *newsock);
67
68int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len,
69 int write);
70void af_alg_free_sg(struct af_alg_sgl *sgl);
71
72int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con);
73
74int af_alg_wait_for_completion(int err, struct af_alg_completion *completion);
75void af_alg_complete(struct crypto_async_request *req, int err);
76
77static inline struct alg_sock *alg_sk(struct sock *sk)
78{
79 return (struct alg_sock *)sk;
80}
81
82static inline void af_alg_release_parent(struct sock *sk)
83{
84 sock_put(alg_sk(sk)->parent);
85}
86
87static inline void af_alg_init_completion(struct af_alg_completion *completion)
88{
89 init_completion(&completion->completion);
90}
91
92#endif /* _CRYPTO_IF_ALG_H */
diff --git a/include/crypto/padlock.h b/include/crypto/padlock.h
new file mode 100644
index 000000000000..d2cfa2ef49e8
--- /dev/null
+++ b/include/crypto/padlock.h
@@ -0,0 +1,29 @@
1/*
2 * Driver for VIA PadLock
3 *
4 * Copyright (c) 2004 Michal Ludvig <michal@logix.cz>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _CRYPTO_PADLOCK_H
14#define _CRYPTO_PADLOCK_H
15
16#define PADLOCK_ALIGNMENT 16
17
18#define PFX KBUILD_MODNAME ": "
19
20#define PADLOCK_CRA_PRIORITY 300
21#define PADLOCK_COMPOSITE_PRIORITY 400
22
23#ifdef CONFIG_64BIT
24#define STACK_ALIGN 16
25#else
26#define STACK_ALIGN 4
27#endif
28
29#endif /* _CRYPTO_PADLOCK_H */
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 833d208c25d6..4fd95a323beb 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -68,6 +68,21 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
68 return (++sg)->length ? sg : (void *)sg_page(sg); 68 return (++sg)->length ? sg : (void *)sg_page(sg);
69} 69}
70 70
71static inline void scatterwalk_crypto_chain(struct scatterlist *head,
72 struct scatterlist *sg,
73 int chain, int num)
74{
75 if (chain) {
76 head->length += sg->length;
77 sg = scatterwalk_sg_next(sg);
78 }
79
80 if (sg)
81 scatterwalk_sg_chain(head, num, sg);
82 else
83 sg_mark_end(head);
84}
85
71static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, 86static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
72 struct scatter_walk *walk_out) 87 struct scatter_walk *walk_out)
73{ 88{
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index d1580c17cab3..2296d8b1931f 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -158,6 +158,7 @@ header-y += icmpv6.h
158header-y += if.h 158header-y += if.h
159header-y += if_addr.h 159header-y += if_addr.h
160header-y += if_addrlabel.h 160header-y += if_addrlabel.h
161header-y += if_alg.h
161header-y += if_arcnet.h 162header-y += if_arcnet.h
162header-y += if_arp.h 163header-y += if_arp.h
163header-y += if_bonding.h 164header-y += if_bonding.h
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 64a7114a9394..c3d6512eded1 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -25,7 +25,7 @@ struct pt_regs;
25/* 25/*
26 * This structure is used to hold the arguments that are used when loading binaries. 26 * This structure is used to hold the arguments that are used when loading binaries.
27 */ 27 */
28struct linux_binprm{ 28struct linux_binprm {
29 char buf[BINPRM_BUF_SIZE]; 29 char buf[BINPRM_BUF_SIZE];
30#ifdef CONFIG_MMU 30#ifdef CONFIG_MMU
31 struct vm_area_struct *vma; 31 struct vm_area_struct *vma;
@@ -93,7 +93,6 @@ struct linux_binfmt {
93 int (*load_shlib)(struct file *); 93 int (*load_shlib)(struct file *);
94 int (*core_dump)(struct coredump_params *cprm); 94 int (*core_dump)(struct coredump_params *cprm);
95 unsigned long min_coredump; /* minimal dump size */ 95 unsigned long min_coredump; /* minimal dump size */
96 int hasvdso;
97}; 96};
98 97
99extern int __register_binfmt(struct linux_binfmt *fmt, int insert); 98extern int __register_binfmt(struct linux_binfmt *fmt, int insert);
@@ -113,7 +112,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
113 112
114extern int prepare_binprm(struct linux_binprm *); 113extern int prepare_binprm(struct linux_binprm *);
115extern int __must_check remove_arg_zero(struct linux_binprm *); 114extern int __must_check remove_arg_zero(struct linux_binprm *);
116extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 115extern int search_binary_handler(struct linux_binprm *, struct pt_regs *);
117extern int flush_old_exec(struct linux_binprm * bprm); 116extern int flush_old_exec(struct linux_binprm * bprm);
118extern void setup_new_exec(struct linux_binprm * bprm); 117extern void setup_new_exec(struct linux_binprm * bprm);
119 118
diff --git a/include/linux/cdev.h b/include/linux/cdev.h
index f389e319a454..fb4591977b03 100644
--- a/include/linux/cdev.h
+++ b/include/linux/cdev.h
@@ -28,8 +28,6 @@ int cdev_add(struct cdev *, dev_t, unsigned);
28 28
29void cdev_del(struct cdev *); 29void cdev_del(struct cdev *);
30 30
31int cdev_index(struct inode *inode);
32
33void cd_forget(struct inode *); 31void cd_forget(struct inode *);
34 32
35extern struct backing_dev_info directly_mappable_cdev_bdi; 33extern struct backing_dev_info directly_mappable_cdev_bdi;
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index c3c74aef289d..09dcc0c2ffd5 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -43,6 +43,10 @@
43#define CEPH_FEATURE_NOSRCADDR (1<<1) 43#define CEPH_FEATURE_NOSRCADDR (1<<1)
44#define CEPH_FEATURE_MONCLOCKCHECK (1<<2) 44#define CEPH_FEATURE_MONCLOCKCHECK (1<<2)
45#define CEPH_FEATURE_FLOCK (1<<3) 45#define CEPH_FEATURE_FLOCK (1<<3)
46#define CEPH_FEATURE_SUBSCRIBE2 (1<<4)
47#define CEPH_FEATURE_MONNAMES (1<<5)
48#define CEPH_FEATURE_RECONNECT_SEQ (1<<6)
49#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7)
46 50
47 51
48/* 52/*
@@ -55,10 +59,10 @@ struct ceph_file_layout {
55 __le32 fl_stripe_count; /* over this many objects */ 59 __le32 fl_stripe_count; /* over this many objects */
56 __le32 fl_object_size; /* until objects are this big, then move to 60 __le32 fl_object_size; /* until objects are this big, then move to
57 new objects */ 61 new objects */
58 __le32 fl_cas_hash; /* 0 = none; 1 = sha256 */ 62 __le32 fl_cas_hash; /* UNUSED. 0 = none; 1 = sha256 */
59 63
60 /* pg -> disk layout */ 64 /* pg -> disk layout */
61 __le32 fl_object_stripe_unit; /* for per-object parity, if any */ 65 __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */
62 66
63 /* object -> pg layout */ 67 /* object -> pg layout */
64 __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */ 68 __le32 fl_pg_preferred; /* preferred primary for pg (-1 for none) */
@@ -69,6 +73,12 @@ struct ceph_file_layout {
69 73
70int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); 74int ceph_file_layout_is_valid(const struct ceph_file_layout *layout);
71 75
76struct ceph_dir_layout {
77 __u8 dl_dir_hash; /* see ceph_hash.h for ids */
78 __u8 dl_unused1;
79 __u16 dl_unused2;
80 __u32 dl_unused3;
81} __attribute__ ((packed));
72 82
73/* crypto algorithms */ 83/* crypto algorithms */
74#define CEPH_CRYPTO_NONE 0x0 84#define CEPH_CRYPTO_NONE 0x0
@@ -457,7 +467,7 @@ struct ceph_mds_reply_inode {
457 struct ceph_timespec rctime; 467 struct ceph_timespec rctime;
458 struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */ 468 struct ceph_frag_tree_head fragtree; /* (must be at end of struct) */
459} __attribute__ ((packed)); 469} __attribute__ ((packed));
460/* followed by frag array, then symlink string, then xattr blob */ 470/* followed by frag array, symlink string, dir layout, xattr blob */
461 471
462/* reply_lease follows dname, and reply_inode */ 472/* reply_lease follows dname, and reply_inode */
463struct ceph_mds_reply_lease { 473struct ceph_mds_reply_lease {
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index a108b425fee2..c3011beac30d 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -110,17 +110,12 @@ struct ceph_msg_pos {
110 110
111/* 111/*
112 * ceph_connection state bit flags 112 * ceph_connection state bit flags
113 *
114 * QUEUED and BUSY are used together to ensure that only a single
115 * thread is currently opening, reading or writing data to the socket.
116 */ 113 */
117#define LOSSYTX 0 /* we can close channel or drop messages on errors */ 114#define LOSSYTX 0 /* we can close channel or drop messages on errors */
118#define CONNECTING 1 115#define CONNECTING 1
119#define NEGOTIATING 2 116#define NEGOTIATING 2
120#define KEEPALIVE_PENDING 3 117#define KEEPALIVE_PENDING 3
121#define WRITE_PENDING 4 /* we have data ready to send */ 118#define WRITE_PENDING 4 /* we have data ready to send */
122#define QUEUED 5 /* there is work queued on this connection */
123#define BUSY 6 /* work is being done */
124#define STANDBY 8 /* no outgoing messages, socket closed. we keep 119#define STANDBY 8 /* no outgoing messages, socket closed. we keep
125 * the ceph_connection around to maintain shared 120 * the ceph_connection around to maintain shared
126 * state with the peer. */ 121 * state with the peer. */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index ed4ba111bc8d..ce104e33cd22 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -564,7 +564,7 @@ struct cgroup_iter {
564/* 564/*
565 * To iterate across the tasks in a cgroup: 565 * To iterate across the tasks in a cgroup:
566 * 566 *
567 * 1) call cgroup_iter_start to intialize an iterator 567 * 1) call cgroup_iter_start to initialize an iterator
568 * 568 *
569 * 2) call cgroup_iter_next() to retrieve member tasks until it 569 * 2) call cgroup_iter_next() to retrieve member tasks until it
570 * returns NULL or until you want to end the iteration 570 * returns NULL or until you want to end the iteration
diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h
deleted file mode 100644
index c910b5eb1ceb..000000000000
--- a/include/linux/coda_cache.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* Coda filesystem -- Linux Minicache
2 *
3 * Copyright (C) 1989 - 1997 Carnegie Mellon University
4 *
5 * Carnegie Mellon University encourages users of this software to
6 * contribute improvements to the Coda project. Contact Peter Braam
7 * <coda@cs.cmu.edu>
8 */
9
10#ifndef _CFSNC_HEADER_
11#define _CFSNC_HEADER_
12
13/* credential cache */
14void coda_cache_enter(struct inode *inode, int mask);
15void coda_cache_clear_inode(struct inode *);
16void coda_cache_clear_all(struct super_block *sb);
17int coda_cache_check(struct inode *inode, int mask);
18
19/* for downcalls and attributes and lookups */
20void coda_flag_inode_children(struct inode *inode, int flag);
21
22#endif /* _CFSNC_HEADER_ */
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h
deleted file mode 100644
index e35071b1de0e..000000000000
--- a/include/linux/coda_fs_i.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * coda_fs_i.h
3 *
4 * Copyright (C) 1998 Carnegie Mellon University
5 *
6 */
7
8#ifndef _LINUX_CODA_FS_I
9#define _LINUX_CODA_FS_I
10
11#include <linux/types.h>
12#include <linux/list.h>
13#include <linux/spinlock.h>
14#include <linux/coda.h>
15
16/*
17 * coda fs inode data
18 * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and
19 * c_cached_perm.
20 * vfs_inode is set only when the inode is created and never changes.
21 * c_fid is set when the inode is created and should be considered immutable.
22 */
23struct coda_inode_info {
24 struct CodaFid c_fid; /* Coda identifier */
25 u_short c_flags; /* flags (see below) */
26 unsigned int c_mapcount; /* nr of times this inode is mapped */
27 unsigned int c_cached_epoch; /* epoch for cached permissions */
28 vuid_t c_uid; /* fsuid for cached permissions */
29 unsigned int c_cached_perm; /* cached access permissions */
30 spinlock_t c_lock;
31 struct inode vfs_inode;
32};
33
34/*
35 * coda fs file private data
36 */
37#define CODA_MAGIC 0xC0DAC0DA
38struct coda_file_info {
39 int cfi_magic; /* magic number */
40 struct file *cfi_container; /* container file for this cnode */
41 unsigned int cfi_mapcount; /* nr of times this file is mapped */
42};
43
44#define CODA_FTOC(file) ((struct coda_file_info *)((file)->private_data))
45
46/* flags */
47#define C_VATTR 0x1 /* Validity of vattr in inode */
48#define C_FLUSH 0x2 /* used after a flush */
49#define C_DYING 0x4 /* from venus (which died) */
50#define C_PURGE 0x8
51
52int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *);
53struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr);
54int coda_cnode_makectl(struct inode **inode, struct super_block *sb);
55struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb);
56void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *);
57
58#endif
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
deleted file mode 100644
index 4ccc59c1ea82..000000000000
--- a/include/linux/coda_linux.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Coda File System, Linux Kernel module
3 *
4 * Original version, adapted from cfs_mach.c, (C) Carnegie Mellon University
5 * Linux modifications (C) 1996, Peter J. Braam
6 * Rewritten for Linux 2.1 (C) 1997 Carnegie Mellon University
7 *
8 * Carnegie Mellon University encourages users of this software to
9 * contribute improvements to the Coda project.
10 */
11
12#ifndef _LINUX_CODA_FS
13#define _LINUX_CODA_FS
14
15#include <linux/kernel.h>
16#include <linux/param.h>
17#include <linux/mm.h>
18#include <linux/vmalloc.h>
19#include <linux/slab.h>
20#include <linux/wait.h>
21#include <linux/types.h>
22#include <linux/fs.h>
23#include <linux/coda_fs_i.h>
24
25/* operations */
26extern const struct inode_operations coda_dir_inode_operations;
27extern const struct inode_operations coda_file_inode_operations;
28extern const struct inode_operations coda_ioctl_inode_operations;
29
30extern const struct address_space_operations coda_file_aops;
31extern const struct address_space_operations coda_symlink_aops;
32
33extern const struct file_operations coda_dir_operations;
34extern const struct file_operations coda_file_operations;
35extern const struct file_operations coda_ioctl_operations;
36
37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f);
39int coda_release(struct inode *i, struct file *f);
40int coda_permission(struct inode *inode, int mask, unsigned int flags);
41int coda_revalidate_inode(struct dentry *);
42int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
43int coda_setattr(struct dentry *, struct iattr *);
44
45/* this file: heloers */
46char *coda_f2s(struct CodaFid *f);
47int coda_isroot(struct inode *i);
48int coda_iscontrol(const char *name, size_t length);
49
50void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
51void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
52unsigned short coda_flags_to_cflags(unsigned short);
53
54/* sysctl.h */
55void coda_sysctl_init(void);
56void coda_sysctl_clean(void);
57
58#define CODA_ALLOC(ptr, cast, size) do { \
59 if (size < PAGE_SIZE) \
60 ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
61 else \
62 ptr = (cast)vmalloc((unsigned long) size); \
63 if (!ptr) \
64 printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
65 else memset( ptr, 0, size ); \
66} while (0)
67
68
69#define CODA_FREE(ptr,size) \
70 do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0)
71
72/* inode to cnode access functions */
73
74static inline struct coda_inode_info *ITOC(struct inode *inode)
75{
76 return list_entry(inode, struct coda_inode_info, vfs_inode);
77}
78
79static __inline__ struct CodaFid *coda_i2f(struct inode *inode)
80{
81 return &(ITOC(inode)->c_fid);
82}
83
84static __inline__ char *coda_i2s(struct inode *inode)
85{
86 return coda_f2s(&(ITOC(inode)->c_fid));
87}
88
89/* this will not zap the inode away */
90static __inline__ void coda_flag_inode(struct inode *inode, int flag)
91{
92 struct coda_inode_info *cii = ITOC(inode);
93
94 spin_lock(&cii->c_lock);
95 cii->c_flags |= flag;
96 spin_unlock(&cii->c_lock);
97}
98
99#endif
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index 6fc2bed368b8..0e7bf272ec2f 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -84,9 +84,11 @@ struct cramfs_super {
84 | CRAMFS_FLAG_WRONG_SIGNATURE \ 84 | CRAMFS_FLAG_WRONG_SIGNATURE \
85 | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) 85 | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
86 86
87#ifdef __KERNEL__
87/* Uncompression interfaces to the underlying zlib */ 88/* Uncompression interfaces to the underlying zlib */
88int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); 89int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
89int cramfs_uncompress_init(void); 90int cramfs_uncompress_init(void);
90void cramfs_uncompress_exit(void); 91void cramfs_uncompress_exit(void);
92#endif /* __KERNEL__ */
91 93
92#endif 94#endif
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index d5a1d4810b80..6fe2114f8ad2 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -103,14 +103,20 @@ static inline int cs5535_has_vsa2(void)
103#define GPIO_POSITIVE_EDGE_STS 0x48 103#define GPIO_POSITIVE_EDGE_STS 0x48
104#define GPIO_NEGATIVE_EDGE_STS 0x4C 104#define GPIO_NEGATIVE_EDGE_STS 0x4C
105 105
106#define GPIO_FLTR7_AMOUNT 0xD8
107
106#define GPIO_MAP_X 0xE0 108#define GPIO_MAP_X 0xE0
107#define GPIO_MAP_Y 0xE4 109#define GPIO_MAP_Y 0xE4
108#define GPIO_MAP_Z 0xE8 110#define GPIO_MAP_Z 0xE8
109#define GPIO_MAP_W 0xEC 111#define GPIO_MAP_W 0xEC
110 112
113#define GPIO_FE7_SEL 0xF7
114
111void cs5535_gpio_set(unsigned offset, unsigned int reg); 115void cs5535_gpio_set(unsigned offset, unsigned int reg);
112void cs5535_gpio_clear(unsigned offset, unsigned int reg); 116void cs5535_gpio_clear(unsigned offset, unsigned int reg);
113int cs5535_gpio_isset(unsigned offset, unsigned int reg); 117int cs5535_gpio_isset(unsigned offset, unsigned int reg);
118int cs5535_gpio_set_irq(unsigned group, unsigned irq);
119void cs5535_gpio_setup_event(unsigned offset, int pair, int pme);
114 120
115/* MFGPTs */ 121/* MFGPTs */
116 122
diff --git a/include/linux/decompress/inflate.h b/include/linux/decompress/inflate.h
index f9b06ccc3e5c..8c0aef1ba5f5 100644
--- a/include/linux/decompress/inflate.h
+++ b/include/linux/decompress/inflate.h
@@ -1,9 +1,6 @@
1#ifndef INFLATE_H 1#ifndef INFLATE_H
2#define INFLATE_H 2#define INFLATE_H
3 3
4/* Other housekeeping constants */
5#define INBUFSIZ 4096
6
7int gunzip(unsigned char *inbuf, int len, 4int gunzip(unsigned char *inbuf, int len,
8 int(*fill)(void*, unsigned int), 5 int(*fill)(void*, unsigned int),
9 int(*flush)(void*, unsigned int), 6 int(*flush)(void*, unsigned int),
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index ad5ec1d0475e..4cb72b920c74 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -61,8 +61,6 @@ static void free(void *where)
61#define large_malloc(a) malloc(a) 61#define large_malloc(a) malloc(a)
62#define large_free(a) free(a) 62#define large_free(a) free(a)
63 63
64#define set_error_fn(x)
65
66#define INIT 64#define INIT
67 65
68#else /* STATIC */ 66#else /* STATIC */
@@ -72,6 +70,7 @@ static void free(void *where)
72#include <linux/kernel.h> 70#include <linux/kernel.h>
73#include <linux/fs.h> 71#include <linux/fs.h>
74#include <linux/string.h> 72#include <linux/string.h>
73#include <linux/slab.h>
75#include <linux/vmalloc.h> 74#include <linux/vmalloc.h>
76 75
77/* Use defines rather than static inline in order to avoid spurious 76/* Use defines rather than static inline in order to avoid spurious
@@ -84,9 +83,6 @@ static void free(void *where)
84#define large_malloc(a) vmalloc(a) 83#define large_malloc(a) vmalloc(a)
85#define large_free(a) vfree(a) 84#define large_free(a) vfree(a)
86 85
87static void(*error)(char *m);
88#define set_error_fn(x) error = x;
89
90#define INIT __init 86#define INIT __init
91#define STATIC 87#define STATIC
92 88
diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h
new file mode 100644
index 000000000000..41728fc6c8a1
--- /dev/null
+++ b/include/linux/decompress/unxz.h
@@ -0,0 +1,19 @@
1/*
2 * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd
3 *
4 * Author: Lasse Collin <lasse.collin@tukaani.org>
5 *
6 * This file has been put into the public domain.
7 * You can do whatever you want with this file.
8 */
9
10#ifndef DECOMPRESS_UNXZ_H
11#define DECOMPRESS_UNXZ_H
12
13int unxz(unsigned char *in, int in_size,
14 int (*fill)(void *dest, unsigned int size),
15 int (*flush)(void *src, unsigned int size),
16 unsigned char *out, int *in_used,
17 void (*error)(char *x));
18
19#endif
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
index 3c155107d61f..73e0b628e058 100644
--- a/include/linux/falloc.h
+++ b/include/linux/falloc.h
@@ -2,6 +2,7 @@
2#define _FALLOC_H_ 2#define _FALLOC_H_
3 3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ 4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
5 6
6#ifdef __KERNEL__ 7#ifdef __KERNEL__
7 8
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 68c642d8843d..59ea406be7f6 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -273,7 +273,7 @@ struct fw_cdev_event_iso_interrupt {
273 * @closure: See &fw_cdev_event_common; 273 * @closure: See &fw_cdev_event_common;
274 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl 274 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
275 * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 275 * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
276 * @completed: Offset into the receive buffer; data before this offest is valid 276 * @completed: Offset into the receive buffer; data before this offset is valid
277 * 277 *
278 * This event is sent in multichannel contexts (context type 278 * This event is sent in multichannel contexts (context type
279 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer 279 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f84d9928bdb1..c0701288d204 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1423,6 +1423,7 @@ struct super_block {
1423 * generic_show_options() 1423 * generic_show_options()
1424 */ 1424 */
1425 char __rcu *s_options; 1425 char __rcu *s_options;
1426 const struct dentry_operations *s_d_op; /* default d_op for dentries */
1426}; 1427};
1427 1428
1428extern struct timespec current_fs_time(struct super_block *sb); 1429extern struct timespec current_fs_time(struct super_block *sb);
@@ -1834,7 +1835,9 @@ struct super_block *sget(struct file_system_type *type,
1834 int (*set)(struct super_block *,void *), 1835 int (*set)(struct super_block *,void *),
1835 void *data); 1836 void *data);
1836extern struct dentry *mount_pseudo(struct file_system_type *, char *, 1837extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1837 const struct super_operations *ops, unsigned long); 1838 const struct super_operations *ops,
1839 const struct dentry_operations *dops,
1840 unsigned long);
1838extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1841extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1839 1842
1840static inline void sb_mark_dirty(struct super_block *sb) 1843static inline void sb_mark_dirty(struct super_block *sb)
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index e41f7dd1ae67..f79d67f413e4 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -13,6 +13,7 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14 14
15struct device; 15struct device;
16struct gpio;
16struct gpio_chip; 17struct gpio_chip;
17 18
18/* 19/*
@@ -29,7 +30,18 @@ static inline int gpio_is_valid(int number)
29 return 0; 30 return 0;
30} 31}
31 32
32static inline int gpio_request(unsigned gpio, const char *label) 33static inline int __must_check gpio_request(unsigned gpio, const char *label)
34{
35 return -ENOSYS;
36}
37
38static inline int __must_check gpio_request_one(unsigned gpio,
39 unsigned long flags, const char *label)
40{
41 return -ENOSYS;
42}
43
44static inline int __must_check gpio_request_array(struct gpio *array, size_t num)
33{ 45{
34 return -ENOSYS; 46 return -ENOSYS;
35} 47}
@@ -42,12 +54,20 @@ static inline void gpio_free(unsigned gpio)
42 WARN_ON(1); 54 WARN_ON(1);
43} 55}
44 56
45static inline int gpio_direction_input(unsigned gpio) 57static inline void gpio_free_array(struct gpio *array, size_t num)
58{
59 might_sleep();
60
61 /* GPIO can never have been requested */
62 WARN_ON(1);
63}
64
65static inline int __must_check gpio_direction_input(unsigned gpio)
46{ 66{
47 return -ENOSYS; 67 return -ENOSYS;
48} 68}
49 69
50static inline int gpio_direction_output(unsigned gpio, int value) 70static inline int __must_check gpio_direction_output(unsigned gpio, int value)
51{ 71{
52 return -ENOSYS; 72 return -ENOSYS;
53} 73}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 20b9801f669b..d91c25e253c8 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -402,7 +402,7 @@ struct hid_field {
402 __u16 dpad; /* dpad input code */ 402 __u16 dpad; /* dpad input code */
403}; 403};
404 404
405#define HID_MAX_FIELDS 64 405#define HID_MAX_FIELDS 128
406 406
407struct hid_report { 407struct hid_report {
408 struct list_head list; 408 struct list_head list;
@@ -593,6 +593,7 @@ struct hid_usage_id {
593 * @report_fixup: called before report descriptor parsing (NULL means nop) 593 * @report_fixup: called before report descriptor parsing (NULL means nop)
594 * @input_mapping: invoked on input registering before mapping an usage 594 * @input_mapping: invoked on input registering before mapping an usage
595 * @input_mapped: invoked on input registering after mapping an usage 595 * @input_mapped: invoked on input registering after mapping an usage
596 * @feature_mapping: invoked on feature registering
596 * @suspend: invoked on suspend (NULL means nop) 597 * @suspend: invoked on suspend (NULL means nop)
597 * @resume: invoked on resume if device was not reset (NULL means nop) 598 * @resume: invoked on resume if device was not reset (NULL means nop)
598 * @reset_resume: invoked on resume if device was reset (NULL means nop) 599 * @reset_resume: invoked on resume if device was reset (NULL means nop)
@@ -636,6 +637,9 @@ struct hid_driver {
636 int (*input_mapped)(struct hid_device *hdev, 637 int (*input_mapped)(struct hid_device *hdev,
637 struct hid_input *hidinput, struct hid_field *field, 638 struct hid_input *hidinput, struct hid_field *field,
638 struct hid_usage *usage, unsigned long **bit, int *max); 639 struct hid_usage *usage, unsigned long **bit, int *max);
640 void (*feature_mapping)(struct hid_device *hdev,
641 struct hid_input *hidinput, struct hid_field *field,
642 struct hid_usage *usage);
639#ifdef CONFIG_PM 643#ifdef CONFIG_PM
640 int (*suspend)(struct hid_device *hdev, pm_message_t message); 644 int (*suspend)(struct hid_device *hdev, pm_message_t message);
641 int (*resume)(struct hid_device *hdev); 645 int (*resume)(struct hid_device *hdev);
diff --git a/include/linux/if_alg.h b/include/linux/if_alg.h
new file mode 100644
index 000000000000..0f9acce5b1ff
--- /dev/null
+++ b/include/linux/if_alg.h
@@ -0,0 +1,40 @@
1/*
2 * if_alg: User-space algorithm interface
3 *
4 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _LINUX_IF_ALG_H
14#define _LINUX_IF_ALG_H
15
16#include <linux/types.h>
17
18struct sockaddr_alg {
19 __u16 salg_family;
20 __u8 salg_type[14];
21 __u32 salg_feat;
22 __u32 salg_mask;
23 __u8 salg_name[64];
24};
25
26struct af_alg_iv {
27 __u32 ivlen;
28 __u8 iv[0];
29};
30
31/* Socket options */
32#define ALG_SET_KEY 1
33#define ALG_SET_IV 2
34#define ALG_SET_OP 3
35
36/* Operations */
37#define ALG_OP_DECRYPT 0
38#define ALG_OP_ENCRYPT 1
39
40#endif /* _LINUX_IF_ALG_H */
diff --git a/include/linux/input.h b/include/linux/input.h
index c4e9d91ec979..e428382ca28a 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -802,6 +802,7 @@ struct input_keymap_entry {
802#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ 802#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */
803#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ 803#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */
804#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ 804#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
805#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
805#define SW_MAX 0x0f 806#define SW_MAX 0x0f
806#define SW_CNT (SW_MAX+1) 807#define SW_CNT (SW_MAX+1)
807 808
diff --git a/include/linux/input/as5011.h b/include/linux/input/as5011.h
new file mode 100644
index 000000000000..1affd0ddfa9d
--- /dev/null
+++ b/include/linux/input/as5011.h
@@ -0,0 +1,20 @@
1#ifndef _AS5011_H
2#define _AS5011_H
3
4/*
5 * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12struct as5011_platform_data {
13 unsigned int button_gpio;
14 unsigned int axis_irq; /* irq number */
15 unsigned long axis_irqflags;
16 char xp, xn; /* threshold for x axis */
17 char yp, yn; /* threshold for y axis */
18};
19
20#endif /* _AS5011_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d0fbc043de60..57dac7022b63 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -143,9 +143,22 @@ extern int _cond_resched(void);
143 143
144#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) 144#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
145 145
146#define abs(x) ({ \ 146/*
147 long __x = (x); \ 147 * abs() handles unsigned and signed longs, ints, shorts and chars. For all
148 (__x < 0) ? -__x : __x; \ 148 * input types abs() returns a signed long.
149 * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()
150 * for those.
151 */
152#define abs(x) ({ \
153 long ret; \
154 if (sizeof(x) == sizeof(long)) { \
155 long __x = (x); \
156 ret = (__x < 0) ? -__x : __x; \
157 } else { \
158 int __x = (x); \
159 ret = (__x < 0) ? -__x : __x; \
160 } \
161 ret; \
149 }) 162 })
150 163
151#define abs64(x) ({ \ 164#define abs64(x) ({ \
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index 24b44145a886..2a0d7d651dc3 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -18,6 +18,10 @@ enum kmsg_dump_reason {
18 KMSG_DUMP_OOPS, 18 KMSG_DUMP_OOPS,
19 KMSG_DUMP_PANIC, 19 KMSG_DUMP_PANIC,
20 KMSG_DUMP_KEXEC, 20 KMSG_DUMP_KEXEC,
21 KMSG_DUMP_RESTART,
22 KMSG_DUMP_HALT,
23 KMSG_DUMP_POWEROFF,
24 KMSG_DUMP_EMERG,
21}; 25};
22 26
23/** 27/**
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 919ae53adc5c..ea2dc1a2e13d 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -540,6 +540,7 @@ struct kvm_ppc_pvinfo {
540#endif 540#endif
541#define KVM_CAP_PPC_GET_PVINFO 57 541#define KVM_CAP_PPC_GET_PVINFO 57
542#define KVM_CAP_PPC_IRQ_LEVEL 58 542#define KVM_CAP_PPC_IRQ_LEVEL 58
543#define KVM_CAP_ASYNC_PF 59
543 544
544#ifdef KVM_CAP_IRQ_ROUTING 545#ifdef KVM_CAP_IRQ_ROUTING
545 546
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a0557422715e..b5021db21858 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -16,6 +16,8 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/preempt.h> 17#include <linux/preempt.h>
18#include <linux/msi.h> 18#include <linux/msi.h>
19#include <linux/slab.h>
20#include <linux/rcupdate.h>
19#include <asm/signal.h> 21#include <asm/signal.h>
20 22
21#include <linux/kvm.h> 23#include <linux/kvm.h>
@@ -40,6 +42,7 @@
40#define KVM_REQ_KICK 9 42#define KVM_REQ_KICK 9
41#define KVM_REQ_DEACTIVATE_FPU 10 43#define KVM_REQ_DEACTIVATE_FPU 10
42#define KVM_REQ_EVENT 11 44#define KVM_REQ_EVENT 11
45#define KVM_REQ_APF_HALT 12
43 46
44#define KVM_USERSPACE_IRQ_SOURCE_ID 0 47#define KVM_USERSPACE_IRQ_SOURCE_ID 0
45 48
@@ -74,6 +77,27 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
74int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 77int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
75 struct kvm_io_device *dev); 78 struct kvm_io_device *dev);
76 79
80#ifdef CONFIG_KVM_ASYNC_PF
81struct kvm_async_pf {
82 struct work_struct work;
83 struct list_head link;
84 struct list_head queue;
85 struct kvm_vcpu *vcpu;
86 struct mm_struct *mm;
87 gva_t gva;
88 unsigned long addr;
89 struct kvm_arch_async_pf arch;
90 struct page *page;
91 bool done;
92};
93
94void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu);
95void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu);
96int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
97 struct kvm_arch_async_pf *arch);
98int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu);
99#endif
100
77struct kvm_vcpu { 101struct kvm_vcpu {
78 struct kvm *kvm; 102 struct kvm *kvm;
79#ifdef CONFIG_PREEMPT_NOTIFIERS 103#ifdef CONFIG_PREEMPT_NOTIFIERS
@@ -104,6 +128,15 @@ struct kvm_vcpu {
104 gpa_t mmio_phys_addr; 128 gpa_t mmio_phys_addr;
105#endif 129#endif
106 130
131#ifdef CONFIG_KVM_ASYNC_PF
132 struct {
133 u32 queued;
134 struct list_head queue;
135 struct list_head done;
136 spinlock_t lock;
137 } async_pf;
138#endif
139
107 struct kvm_vcpu_arch arch; 140 struct kvm_vcpu_arch arch;
108}; 141};
109 142
@@ -113,16 +146,19 @@ struct kvm_vcpu {
113 */ 146 */
114#define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) 147#define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1)
115 148
149struct kvm_lpage_info {
150 unsigned long rmap_pde;
151 int write_count;
152};
153
116struct kvm_memory_slot { 154struct kvm_memory_slot {
117 gfn_t base_gfn; 155 gfn_t base_gfn;
118 unsigned long npages; 156 unsigned long npages;
119 unsigned long flags; 157 unsigned long flags;
120 unsigned long *rmap; 158 unsigned long *rmap;
121 unsigned long *dirty_bitmap; 159 unsigned long *dirty_bitmap;
122 struct { 160 unsigned long *dirty_bitmap_head;
123 unsigned long rmap_pde; 161 struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1];
124 int write_count;
125 } *lpage_info[KVM_NR_PAGE_SIZES - 1];
126 unsigned long userspace_addr; 162 unsigned long userspace_addr;
127 int user_alloc; 163 int user_alloc;
128 int id; 164 int id;
@@ -169,6 +205,7 @@ struct kvm_irq_routing_table {};
169 205
170struct kvm_memslots { 206struct kvm_memslots {
171 int nmemslots; 207 int nmemslots;
208 u64 generation;
172 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + 209 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
173 KVM_PRIVATE_MEM_SLOTS]; 210 KVM_PRIVATE_MEM_SLOTS];
174}; 211};
@@ -206,6 +243,10 @@ struct kvm {
206 243
207 struct mutex irq_lock; 244 struct mutex irq_lock;
208#ifdef CONFIG_HAVE_KVM_IRQCHIP 245#ifdef CONFIG_HAVE_KVM_IRQCHIP
246 /*
247 * Update side is protected by irq_lock and,
248 * if configured, irqfds.lock.
249 */
209 struct kvm_irq_routing_table __rcu *irq_routing; 250 struct kvm_irq_routing_table __rcu *irq_routing;
210 struct hlist_head mask_notifier_list; 251 struct hlist_head mask_notifier_list;
211 struct hlist_head irq_ack_notifier_list; 252 struct hlist_head irq_ack_notifier_list;
@@ -216,6 +257,7 @@ struct kvm {
216 unsigned long mmu_notifier_seq; 257 unsigned long mmu_notifier_seq;
217 long mmu_notifier_count; 258 long mmu_notifier_count;
218#endif 259#endif
260 long tlbs_dirty;
219}; 261};
220 262
221/* The guest did something we don't support. */ 263/* The guest did something we don't support. */
@@ -302,7 +344,11 @@ void kvm_set_page_accessed(struct page *page);
302 344
303pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); 345pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr);
304pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); 346pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
347pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async,
348 bool write_fault, bool *writable);
305pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 349pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
350pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
351 bool *writable);
306pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 352pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
307 struct kvm_memory_slot *slot, gfn_t gfn); 353 struct kvm_memory_slot *slot, gfn_t gfn);
308int memslot_id(struct kvm *kvm, gfn_t gfn); 354int memslot_id(struct kvm *kvm, gfn_t gfn);
@@ -321,18 +367,25 @@ int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data,
321 int offset, int len); 367 int offset, int len);
322int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, 368int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,
323 unsigned long len); 369 unsigned long len);
370int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
371 void *data, unsigned long len);
372int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
373 gpa_t gpa);
324int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); 374int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
325int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); 375int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
326struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); 376struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
327int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); 377int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
328unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); 378unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn);
329void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 379void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
380void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot,
381 gfn_t gfn);
330 382
331void kvm_vcpu_block(struct kvm_vcpu *vcpu); 383void kvm_vcpu_block(struct kvm_vcpu *vcpu);
332void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); 384void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
333void kvm_resched(struct kvm_vcpu *vcpu); 385void kvm_resched(struct kvm_vcpu *vcpu);
334void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 386void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
335void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 387void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
388
336void kvm_flush_remote_tlbs(struct kvm *kvm); 389void kvm_flush_remote_tlbs(struct kvm *kvm);
337void kvm_reload_remote_mmus(struct kvm *kvm); 390void kvm_reload_remote_mmus(struct kvm *kvm);
338 391
@@ -398,7 +451,19 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
398 451
399void kvm_free_physmem(struct kvm *kvm); 452void kvm_free_physmem(struct kvm *kvm);
400 453
401struct kvm *kvm_arch_create_vm(void); 454#ifndef __KVM_HAVE_ARCH_VM_ALLOC
455static inline struct kvm *kvm_arch_alloc_vm(void)
456{
457 return kzalloc(sizeof(struct kvm), GFP_KERNEL);
458}
459
460static inline void kvm_arch_free_vm(struct kvm *kvm)
461{
462 kfree(kvm);
463}
464#endif
465
466int kvm_arch_init_vm(struct kvm *kvm);
402void kvm_arch_destroy_vm(struct kvm *kvm); 467void kvm_arch_destroy_vm(struct kvm *kvm);
403void kvm_free_all_assigned_devices(struct kvm *kvm); 468void kvm_free_all_assigned_devices(struct kvm *kvm);
404void kvm_arch_sync_events(struct kvm *kvm); 469void kvm_arch_sync_events(struct kvm *kvm);
@@ -414,16 +479,8 @@ struct kvm_irq_ack_notifier {
414 void (*irq_acked)(struct kvm_irq_ack_notifier *kian); 479 void (*irq_acked)(struct kvm_irq_ack_notifier *kian);
415}; 480};
416 481
417#define KVM_ASSIGNED_MSIX_PENDING 0x1
418struct kvm_guest_msix_entry {
419 u32 vector;
420 u16 entry;
421 u16 flags;
422};
423
424struct kvm_assigned_dev_kernel { 482struct kvm_assigned_dev_kernel {
425 struct kvm_irq_ack_notifier ack_notifier; 483 struct kvm_irq_ack_notifier ack_notifier;
426 struct work_struct interrupt_work;
427 struct list_head list; 484 struct list_head list;
428 int assigned_dev_id; 485 int assigned_dev_id;
429 int host_segnr; 486 int host_segnr;
@@ -434,13 +491,14 @@ struct kvm_assigned_dev_kernel {
434 bool host_irq_disabled; 491 bool host_irq_disabled;
435 struct msix_entry *host_msix_entries; 492 struct msix_entry *host_msix_entries;
436 int guest_irq; 493 int guest_irq;
437 struct kvm_guest_msix_entry *guest_msix_entries; 494 struct msix_entry *guest_msix_entries;
438 unsigned long irq_requested_type; 495 unsigned long irq_requested_type;
439 int irq_source_id; 496 int irq_source_id;
440 int flags; 497 int flags;
441 struct pci_dev *dev; 498 struct pci_dev *dev;
442 struct kvm *kvm; 499 struct kvm *kvm;
443 spinlock_t assigned_dev_lock; 500 spinlock_t intx_lock;
501 char irq_name[32];
444}; 502};
445 503
446struct kvm_irq_mask_notifier { 504struct kvm_irq_mask_notifier {
@@ -462,6 +520,8 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
462 unsigned long *deliver_bitmask); 520 unsigned long *deliver_bitmask);
463#endif 521#endif
464int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); 522int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
523int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
524 int irq_source_id, int level);
465void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 525void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
466void kvm_register_irq_ack_notifier(struct kvm *kvm, 526void kvm_register_irq_ack_notifier(struct kvm *kvm,
467 struct kvm_irq_ack_notifier *kian); 527 struct kvm_irq_ack_notifier *kian);
@@ -603,17 +663,28 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
603void kvm_eventfd_init(struct kvm *kvm); 663void kvm_eventfd_init(struct kvm *kvm);
604int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); 664int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags);
605void kvm_irqfd_release(struct kvm *kvm); 665void kvm_irqfd_release(struct kvm *kvm);
666void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *);
606int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); 667int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
607 668
608#else 669#else
609 670
610static inline void kvm_eventfd_init(struct kvm *kvm) {} 671static inline void kvm_eventfd_init(struct kvm *kvm) {}
672
611static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) 673static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
612{ 674{
613 return -EINVAL; 675 return -EINVAL;
614} 676}
615 677
616static inline void kvm_irqfd_release(struct kvm *kvm) {} 678static inline void kvm_irqfd_release(struct kvm *kvm) {}
679
680#ifdef CONFIG_HAVE_KVM_IRQCHIP
681static inline void kvm_irq_routing_update(struct kvm *kvm,
682 struct kvm_irq_routing_table *irq_rt)
683{
684 rcu_assign_pointer(kvm->irq_routing, irq_rt);
685}
686#endif
687
617static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) 688static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
618{ 689{
619 return -ENOSYS; 690 return -ENOSYS;
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
index 7ac0d4eee430..fa7cc7244cbd 100644
--- a/include/linux/kvm_types.h
+++ b/include/linux/kvm_types.h
@@ -67,4 +67,11 @@ struct kvm_lapic_irq {
67 u32 dest_id; 67 u32 dest_id;
68}; 68};
69 69
70struct gfn_to_hva_cache {
71 u64 generation;
72 gpa_t gpa;
73 unsigned long hva;
74 struct kvm_memory_slot *memslot;
75};
76
70#endif /* __KVM_TYPES_H__ */ 77#endif /* __KVM_TYPES_H__ */
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h
index 38368d785f08..fd548d2a8775 100644
--- a/include/linux/leds-lp5521.h
+++ b/include/linux/leds-lp5521.h
@@ -42,6 +42,7 @@ struct lp5521_platform_data {
42 int (*setup_resources)(void); 42 int (*setup_resources)(void);
43 void (*release_resources)(void); 43 void (*release_resources)(void);
44 void (*enable)(bool state); 44 void (*enable)(bool state);
45 const char *label;
45}; 46};
46 47
47#endif /* __LINUX_LP5521_H */ 48#endif /* __LINUX_LP5521_H */
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h
index 796747637b80..2694289babd0 100644
--- a/include/linux/leds-lp5523.h
+++ b/include/linux/leds-lp5523.h
@@ -42,6 +42,7 @@ struct lp5523_platform_data {
42 int (*setup_resources)(void); 42 int (*setup_resources)(void);
43 void (*release_resources)(void); 43 void (*release_resources)(void);
44 void (*enable)(bool state); 44 void (*enable)(bool state);
45 const char *label;
45}; 46};
46 47
47#endif /* __LINUX_LP5523_H */ 48#endif /* __LINUX_LP5523_H */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index d63b6050b183..85cf2c28fac6 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -99,8 +99,6 @@
99#define AB8500_NR_IRQS 104 99#define AB8500_NR_IRQS 104
100#define AB8500_NUM_IRQ_REGS 13 100#define AB8500_NUM_IRQ_REGS 13
101 101
102#define AB8500_NUM_REGULATORS 15
103
104/** 102/**
105 * struct ab8500 - ab8500 internal structure 103 * struct ab8500 - ab8500 internal structure
106 * @dev: parent device 104 * @dev: parent device
@@ -145,7 +143,8 @@ struct regulator_init_data;
145struct ab8500_platform_data { 143struct ab8500_platform_data {
146 int irq_base; 144 int irq_base;
147 void (*init) (struct ab8500 *); 145 void (*init) (struct ab8500 *);
148 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; 146 int num_regulator;
147 struct regulator_init_data *regulator;
149}; 148};
150 149
151extern int __devinit ab8500_init(struct ab8500 *ab8500); 150extern int __devinit ab8500_init(struct ab8500 *ab8500);
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index cb93d80aa642..5582ab3d3e48 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -39,7 +39,7 @@ struct mfd_cell {
39 size_t data_size; 39 size_t data_size;
40 40
41 /* 41 /*
42 * This resources can be specified relatievly to the parent device. 42 * This resources can be specified relatively to the parent device.
43 * For accessing device you should use resources from device 43 * For accessing device you should use resources from device
44 */ 44 */
45 int num_resources; 45 int num_resources;
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index b4c741e352c2..7d0f3d6a0002 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -1,4 +1,5 @@
1/* 1/*
2 * Copyright 2010 Yong Shen <yong.shen@linaro.org>
2 * Copyright 2009-2010 Pengutronix 3 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 * 5 *
@@ -122,39 +123,39 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
122 unsigned int channel, unsigned int *sample); 123 unsigned int channel, unsigned int *sample);
123 124
124 125
125#define MC13783_SW_SW1A 0 126#define MC13783_REG_SW1A 0
126#define MC13783_SW_SW1B 1 127#define MC13783_REG_SW1B 1
127#define MC13783_SW_SW2A 2 128#define MC13783_REG_SW2A 2
128#define MC13783_SW_SW2B 3 129#define MC13783_REG_SW2B 3
129#define MC13783_SW_SW3 4 130#define MC13783_REG_SW3 4
130#define MC13783_SW_PLL 5 131#define MC13783_REG_PLL 5
131#define MC13783_REGU_VAUDIO 6 132#define MC13783_REG_VAUDIO 6
132#define MC13783_REGU_VIOHI 7 133#define MC13783_REG_VIOHI 7
133#define MC13783_REGU_VIOLO 8 134#define MC13783_REG_VIOLO 8
134#define MC13783_REGU_VDIG 9 135#define MC13783_REG_VDIG 9
135#define MC13783_REGU_VGEN 10 136#define MC13783_REG_VGEN 10
136#define MC13783_REGU_VRFDIG 11 137#define MC13783_REG_VRFDIG 11
137#define MC13783_REGU_VRFREF 12 138#define MC13783_REG_VRFREF 12
138#define MC13783_REGU_VRFCP 13 139#define MC13783_REG_VRFCP 13
139#define MC13783_REGU_VSIM 14 140#define MC13783_REG_VSIM 14
140#define MC13783_REGU_VESIM 15 141#define MC13783_REG_VESIM 15
141#define MC13783_REGU_VCAM 16 142#define MC13783_REG_VCAM 16
142#define MC13783_REGU_VRFBG 17 143#define MC13783_REG_VRFBG 17
143#define MC13783_REGU_VVIB 18 144#define MC13783_REG_VVIB 18
144#define MC13783_REGU_VRF1 19 145#define MC13783_REG_VRF1 19
145#define MC13783_REGU_VRF2 20 146#define MC13783_REG_VRF2 20
146#define MC13783_REGU_VMMC1 21 147#define MC13783_REG_VMMC1 21
147#define MC13783_REGU_VMMC2 22 148#define MC13783_REG_VMMC2 22
148#define MC13783_REGU_GPO1 23 149#define MC13783_REG_GPO1 23
149#define MC13783_REGU_GPO2 24 150#define MC13783_REG_GPO2 24
150#define MC13783_REGU_GPO3 25 151#define MC13783_REG_GPO3 25
151#define MC13783_REGU_GPO4 26 152#define MC13783_REG_GPO4 26
152#define MC13783_REGU_V1 27 153#define MC13783_REG_V1 27
153#define MC13783_REGU_V2 28 154#define MC13783_REG_V2 28
154#define MC13783_REGU_V3 29 155#define MC13783_REG_V3 29
155#define MC13783_REGU_V4 30 156#define MC13783_REG_V4 30
156#define MC13783_REGU_PWGT1SPI 31 157#define MC13783_REG_PWGT1SPI 31
157#define MC13783_REGU_PWGT2SPI 32 158#define MC13783_REG_PWGT2SPI 32
158 159
159#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE 160#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE
160#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE 161#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE
diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h
new file mode 100644
index 000000000000..a00f2bec178c
--- /dev/null
+++ b/include/linux/mfd/mc13892.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2010 Yong Shen <yong.shen@linaro.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#ifndef __LINUX_MFD_MC13892_H
10#define __LINUX_MFD_MC13892_H
11
12#include <linux/mfd/mc13xxx.h>
13
14#define MC13892_SW1 0
15#define MC13892_SW2 1
16#define MC13892_SW3 2
17#define MC13892_SW4 3
18#define MC13892_SWBST 4
19#define MC13892_VIOHI 5
20#define MC13892_VPLL 6
21#define MC13892_VDIG 7
22#define MC13892_VSD 8
23#define MC13892_VUSB2 9
24#define MC13892_VVIDEO 10
25#define MC13892_VAUDIO 11
26#define MC13892_VCAM 12
27#define MC13892_VGEN1 13
28#define MC13892_VGEN2 14
29#define MC13892_VGEN3 15
30#define MC13892_VUSB 16
31#define MC13892_GPO1 17
32#define MC13892_GPO2 18
33#define MC13892_GPO3 19
34#define MC13892_GPO4 20
35#define MC13892_PWGT1SPI 21
36#define MC13892_PWGT2SPI 22
37#define MC13892_VCOINCELL 23
38
39#endif
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index de79baee4925..3fd36845ca45 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -17,6 +17,11 @@
17 17
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19 19
20enum wm8994_type {
21 WM8994 = 0,
22 WM8958 = 1,
23};
24
20struct regulator_dev; 25struct regulator_dev;
21struct regulator_bulk_data; 26struct regulator_bulk_data;
22 27
@@ -48,6 +53,8 @@ struct wm8994 {
48 struct mutex io_lock; 53 struct mutex io_lock;
49 struct mutex irq_lock; 54 struct mutex irq_lock;
50 55
56 enum wm8994_type type;
57
51 struct device *dev; 58 struct device *dev;
52 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 59 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
53 int bytes, void *dest); 60 int bytes, void *dest);
@@ -68,6 +75,7 @@ struct wm8994 {
68 u16 gpio_regs[WM8994_NUM_GPIO_REGS]; 75 u16 gpio_regs[WM8994_NUM_GPIO_REGS];
69 76
70 struct regulator_dev *dbvdd; 77 struct regulator_dev *dbvdd;
78 int num_supplies;
71 struct regulator_bulk_data *supplies; 79 struct regulator_bulk_data *supplies;
72}; 80};
73 81
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index add8a1b8bcf0..9eab263658be 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -30,6 +30,8 @@ struct wm8994_ldo_pdata {
30 30
31#define WM8994_DRC_REGS 5 31#define WM8994_DRC_REGS 5
32#define WM8994_EQ_REGS 20 32#define WM8994_EQ_REGS 20
33#define WM8958_MBC_CUTOFF_REGS 20
34#define WM8958_MBC_COEFF_REGS 48
33 35
34/** 36/**
35 * DRC configurations are specified with a label and a set of register 37 * DRC configurations are specified with a label and a set of register
@@ -59,6 +61,18 @@ struct wm8994_retune_mobile_cfg {
59 u16 regs[WM8994_EQ_REGS]; 61 u16 regs[WM8994_EQ_REGS];
60}; 62};
61 63
64/**
65 * Multiband compressor configurations are specified with a label and
66 * two sets of values to write. Configurations are expected to be
67 * generated using the multiband compressor configuration panel in
68 * WISCE - see http://www.wolfsonmicro.com/wisce/
69 */
70struct wm8958_mbc_cfg {
71 const char *name;
72 u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS];
73 u16 coeff_regs[WM8958_MBC_COEFF_REGS];
74};
75
62struct wm8994_pdata { 76struct wm8994_pdata {
63 int gpio_base; 77 int gpio_base;
64 78
@@ -78,6 +92,9 @@ struct wm8994_pdata {
78 int num_retune_mobile_cfgs; 92 int num_retune_mobile_cfgs;
79 struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; 93 struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
80 94
95 int num_mbc_cfgs;
96 struct wm8958_mbc_cfg *mbc_cfgs;
97
81 /* LINEOUT can be differential or single ended */ 98 /* LINEOUT can be differential or single ended */
82 unsigned int lineout1_diff:1; 99 unsigned int lineout1_diff:1;
83 unsigned int lineout2_diff:1; 100 unsigned int lineout2_diff:1;
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index 967f62f54159..be072faec6f0 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -64,12 +64,16 @@
64#define WM8994_LDO_1 0x3B 64#define WM8994_LDO_1 0x3B
65#define WM8994_LDO_2 0x3C 65#define WM8994_LDO_2 0x3C
66#define WM8994_CHARGE_PUMP_1 0x4C 66#define WM8994_CHARGE_PUMP_1 0x4C
67#define WM8958_CHARGE_PUMP_2 0x4D
67#define WM8994_CLASS_W_1 0x51 68#define WM8994_CLASS_W_1 0x51
68#define WM8994_DC_SERVO_1 0x54 69#define WM8994_DC_SERVO_1 0x54
69#define WM8994_DC_SERVO_2 0x55 70#define WM8994_DC_SERVO_2 0x55
70#define WM8994_DC_SERVO_4 0x57 71#define WM8994_DC_SERVO_4 0x57
71#define WM8994_DC_SERVO_READBACK 0x58 72#define WM8994_DC_SERVO_READBACK 0x58
72#define WM8994_ANALOGUE_HP_1 0x60 73#define WM8994_ANALOGUE_HP_1 0x60
74#define WM8958_MIC_DETECT_1 0xD0
75#define WM8958_MIC_DETECT_2 0xD1
76#define WM8958_MIC_DETECT_3 0xD2
73#define WM8994_CHIP_REVISION 0x100 77#define WM8994_CHIP_REVISION 0x100
74#define WM8994_CONTROL_INTERFACE 0x101 78#define WM8994_CONTROL_INTERFACE 0x101
75#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 79#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110
@@ -109,6 +113,10 @@
109#define WM8994_AIF2DAC_LRCLK 0x315 113#define WM8994_AIF2DAC_LRCLK 0x315
110#define WM8994_AIF2DAC_DATA 0x316 114#define WM8994_AIF2DAC_DATA 0x316
111#define WM8994_AIF2ADC_DATA 0x317 115#define WM8994_AIF2ADC_DATA 0x317
116#define WM8958_AIF3_CONTROL_1 0x320
117#define WM8958_AIF3_CONTROL_2 0x321
118#define WM8958_AIF3DAC_DATA 0x322
119#define WM8958_AIF3ADC_DATA 0x323
112#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 120#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400
113#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 121#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401
114#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 122#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402
@@ -242,6 +250,83 @@
242#define WM8994_INTERRUPT_STATUS_2_MASK 0x739 250#define WM8994_INTERRUPT_STATUS_2_MASK 0x739
243#define WM8994_INTERRUPT_CONTROL 0x740 251#define WM8994_INTERRUPT_CONTROL 0x740
244#define WM8994_IRQ_DEBOUNCE 0x748 252#define WM8994_IRQ_DEBOUNCE 0x748
253#define WM8958_DSP2_PROGRAM 0x900
254#define WM8958_DSP2_CONFIG 0x901
255#define WM8958_DSP2_MAGICNUM 0xA00
256#define WM8958_DSP2_RELEASEYEAR 0xA01
257#define WM8958_DSP2_RELEASEMONTHDAY 0xA02
258#define WM8958_DSP2_RELEASETIME 0xA03
259#define WM8958_DSP2_VERMAJMIN 0xA04
260#define WM8958_DSP2_VERBUILD 0xA05
261#define WM8958_DSP2_EXECCONTROL 0xA0D
262#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200
263#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201
264#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202
265#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_2 0x2203
266#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_1 0x2204
267#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_2 0x2205
268#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_1 0x2206
269#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_2 0x2207
270#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_1 0x2208
271#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_2 0x2209
272#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_1 0x220A
273#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_2 0x220B
274#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_1 0x220C
275#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_2 0x220D
276#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_1 0x220E
277#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_2 0x220F
278#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_1 0x2210
279#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_2 0x2211
280#define WM8958_MBC_BAND_1_LOWER_CUTOFF_1 0x2212
281#define WM8958_MBC_BAND_1_LOWER_CUTOFF_2 0x2213
282#define WM8958_MBC_BAND_1_K_1 0x2400
283#define WM8958_MBC_BAND_1_K_2 0x2401
284#define WM8958_MBC_BAND_1_N1_1 0x2402
285#define WM8958_MBC_BAND_1_N1_2 0x2403
286#define WM8958_MBC_BAND_1_N2_1 0x2404
287#define WM8958_MBC_BAND_1_N2_2 0x2405
288#define WM8958_MBC_BAND_1_N3_1 0x2406
289#define WM8958_MBC_BAND_1_N3_2 0x2407
290#define WM8958_MBC_BAND_1_N4_1 0x2408
291#define WM8958_MBC_BAND_1_N4_2 0x2409
292#define WM8958_MBC_BAND_1_N5_1 0x240A
293#define WM8958_MBC_BAND_1_N5_2 0x240B
294#define WM8958_MBC_BAND_1_X1_1 0x240C
295#define WM8958_MBC_BAND_1_X1_2 0x240D
296#define WM8958_MBC_BAND_1_X2_1 0x240E
297#define WM8958_MBC_BAND_1_X2_2 0x240F
298#define WM8958_MBC_BAND_1_X3_1 0x2410
299#define WM8958_MBC_BAND_1_X3_2 0x2411
300#define WM8958_MBC_BAND_1_ATTACK_1 0x2412
301#define WM8958_MBC_BAND_1_ATTACK_2 0x2413
302#define WM8958_MBC_BAND_1_DECAY_1 0x2414
303#define WM8958_MBC_BAND_1_DECAY_2 0x2415
304#define WM8958_MBC_BAND_2_K_1 0x2416
305#define WM8958_MBC_BAND_2_K_2 0x2417
306#define WM8958_MBC_BAND_2_N1_1 0x2418
307#define WM8958_MBC_BAND_2_N1_2 0x2419
308#define WM8958_MBC_BAND_2_N2_1 0x241A
309#define WM8958_MBC_BAND_2_N2_2 0x241B
310#define WM8958_MBC_BAND_2_N3_1 0x241C
311#define WM8958_MBC_BAND_2_N3_2 0x241D
312#define WM8958_MBC_BAND_2_N4_1 0x241E
313#define WM8958_MBC_BAND_2_N4_2 0x241F
314#define WM8958_MBC_BAND_2_N5_1 0x2420
315#define WM8958_MBC_BAND_2_N5_2 0x2421
316#define WM8958_MBC_BAND_2_X1_1 0x2422
317#define WM8958_MBC_BAND_2_X1_2 0x2423
318#define WM8958_MBC_BAND_2_X2_1 0x2424
319#define WM8958_MBC_BAND_2_X2_2 0x2425
320#define WM8958_MBC_BAND_2_X3_1 0x2426
321#define WM8958_MBC_BAND_2_X3_2 0x2427
322#define WM8958_MBC_BAND_2_ATTACK_1 0x2428
323#define WM8958_MBC_BAND_2_ATTACK_2 0x2429
324#define WM8958_MBC_BAND_2_DECAY_1 0x242A
325#define WM8958_MBC_BAND_2_DECAY_2 0x242B
326#define WM8958_MBC_B2_PG2_1 0x242C
327#define WM8958_MBC_B2_PG2_2 0x242D
328#define WM8958_MBC_B1_PG2_1 0x242E
329#define WM8958_MBC_B1_PG2_2 0x242F
245#define WM8994_WRITE_SEQUENCER_0 0x3000 330#define WM8994_WRITE_SEQUENCER_0 0x3000
246#define WM8994_WRITE_SEQUENCER_1 0x3001 331#define WM8994_WRITE_SEQUENCER_1 0x3001
247#define WM8994_WRITE_SEQUENCER_2 0x3002 332#define WM8994_WRITE_SEQUENCER_2 0x3002
@@ -992,6 +1077,12 @@
992/* 1077/*
993 * R6 (0x06) - Power Management (6) 1078 * R6 (0x06) - Power Management (6)
994 */ 1079 */
1080#define WM8958_AIF3ADC_SRC_MASK 0x0600 /* AIF3ADC_SRC - [10:9] */
1081#define WM8958_AIF3ADC_SRC_SHIFT 9 /* AIF3ADC_SRC - [10:9] */
1082#define WM8958_AIF3ADC_SRC_WIDTH 2 /* AIF3ADC_SRC - [10:9] */
1083#define WM8958_AIF2DAC_SRC_MASK 0x0180 /* AIF2DAC_SRC - [8:7] */
1084#define WM8958_AIF2DAC_SRC_SHIFT 7 /* AIF2DAC_SRC - [8:7] */
1085#define WM8958_AIF2DAC_SRC_WIDTH 2 /* AIF2DAC_SRC - [8:7] */
995#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ 1086#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */
996#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ 1087#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */
997#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ 1088#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */
@@ -1836,6 +1927,14 @@
1836#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ 1927#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */
1837 1928
1838/* 1929/*
1930 * R77 (0x4D) - Charge Pump (2)
1931 */
1932#define WM8958_CP_DISCH 0x8000 /* CP_DISCH */
1933#define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */
1934#define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */
1935#define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */
1936
1937/*
1839 * R81 (0x51) - Class W (1) 1938 * R81 (0x51) - Class W (1)
1840 */ 1939 */
1841#define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ 1940#define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */
@@ -1952,6 +2051,46 @@
1952#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ 2051#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */
1953 2052
1954/* 2053/*
2054 * R208 (0xD0) - Mic Detect 1
2055 */
2056#define WM8958_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */
2057#define WM8958_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */
2058#define WM8958_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */
2059#define WM8958_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */
2060#define WM8958_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */
2061#define WM8958_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */
2062#define WM8958_MICD_DBTIME 0x0002 /* MICD_DBTIME */
2063#define WM8958_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */
2064#define WM8958_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */
2065#define WM8958_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */
2066#define WM8958_MICD_ENA 0x0001 /* MICD_ENA */
2067#define WM8958_MICD_ENA_MASK 0x0001 /* MICD_ENA */
2068#define WM8958_MICD_ENA_SHIFT 0 /* MICD_ENA */
2069#define WM8958_MICD_ENA_WIDTH 1 /* MICD_ENA */
2070
2071/*
2072 * R209 (0xD1) - Mic Detect 2
2073 */
2074#define WM8958_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */
2075#define WM8958_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */
2076#define WM8958_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */
2077
2078/*
2079 * R210 (0xD2) - Mic Detect 3
2080 */
2081#define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
2082#define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
2083#define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
2084#define WM8958_MICD_VALID 0x0002 /* MICD_VALID */
2085#define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */
2086#define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */
2087#define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */
2088#define WM8958_MICD_STS 0x0001 /* MICD_STS */
2089#define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */
2090#define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */
2091#define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */
2092
2093/*
1955 * R256 (0x100) - Chip Revision 2094 * R256 (0x100) - Chip Revision
1956 */ 2095 */
1957#define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ 2096#define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */
@@ -2069,6 +2208,14 @@
2069/* 2208/*
2070 * R520 (0x208) - Clocking (1) 2209 * R520 (0x208) - Clocking (1)
2071 */ 2210 */
2211#define WM8958_DSP2CLK_ENA 0x4000 /* DSP2CLK_ENA */
2212#define WM8958_DSP2CLK_ENA_MASK 0x4000 /* DSP2CLK_ENA */
2213#define WM8958_DSP2CLK_ENA_SHIFT 14 /* DSP2CLK_ENA */
2214#define WM8958_DSP2CLK_ENA_WIDTH 1 /* DSP2CLK_ENA */
2215#define WM8958_DSP2CLK_SRC 0x1000 /* DSP2CLK_SRC */
2216#define WM8958_DSP2CLK_SRC_MASK 0x1000 /* DSP2CLK_SRC */
2217#define WM8958_DSP2CLK_SRC_SHIFT 12 /* DSP2CLK_SRC */
2218#define WM8958_DSP2CLK_SRC_WIDTH 1 /* DSP2CLK_SRC */
2072#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ 2219#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */
2073#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ 2220#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */
2074#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ 2221#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */
@@ -2553,6 +2700,63 @@
2553#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ 2700#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */
2554 2701
2555/* 2702/*
2703 * R800 (0x320) - AIF3 Control (1)
2704 */
2705#define WM8958_AIF3_LRCLK_INV 0x0080 /* AIF3_LRCLK_INV */
2706#define WM8958_AIF3_LRCLK_INV_MASK 0x0080 /* AIF3_LRCLK_INV */
2707#define WM8958_AIF3_LRCLK_INV_SHIFT 7 /* AIF3_LRCLK_INV */
2708#define WM8958_AIF3_LRCLK_INV_WIDTH 1 /* AIF3_LRCLK_INV */
2709#define WM8958_AIF3_WL_MASK 0x0060 /* AIF3_WL - [6:5] */
2710#define WM8958_AIF3_WL_SHIFT 5 /* AIF3_WL - [6:5] */
2711#define WM8958_AIF3_WL_WIDTH 2 /* AIF3_WL - [6:5] */
2712#define WM8958_AIF3_FMT_MASK 0x0018 /* AIF3_FMT - [4:3] */
2713#define WM8958_AIF3_FMT_SHIFT 3 /* AIF3_FMT - [4:3] */
2714#define WM8958_AIF3_FMT_WIDTH 2 /* AIF3_FMT - [4:3] */
2715
2716/*
2717 * R801 (0x321) - AIF3 Control (2)
2718 */
2719#define WM8958_AIF3DAC_BOOST_MASK 0x0C00 /* AIF3DAC_BOOST - [11:10] */
2720#define WM8958_AIF3DAC_BOOST_SHIFT 10 /* AIF3DAC_BOOST - [11:10] */
2721#define WM8958_AIF3DAC_BOOST_WIDTH 2 /* AIF3DAC_BOOST - [11:10] */
2722#define WM8958_AIF3DAC_COMP 0x0010 /* AIF3DAC_COMP */
2723#define WM8958_AIF3DAC_COMP_MASK 0x0010 /* AIF3DAC_COMP */
2724#define WM8958_AIF3DAC_COMP_SHIFT 4 /* AIF3DAC_COMP */
2725#define WM8958_AIF3DAC_COMP_WIDTH 1 /* AIF3DAC_COMP */
2726#define WM8958_AIF3DAC_COMPMODE 0x0008 /* AIF3DAC_COMPMODE */
2727#define WM8958_AIF3DAC_COMPMODE_MASK 0x0008 /* AIF3DAC_COMPMODE */
2728#define WM8958_AIF3DAC_COMPMODE_SHIFT 3 /* AIF3DAC_COMPMODE */
2729#define WM8958_AIF3DAC_COMPMODE_WIDTH 1 /* AIF3DAC_COMPMODE */
2730#define WM8958_AIF3ADC_COMP 0x0004 /* AIF3ADC_COMP */
2731#define WM8958_AIF3ADC_COMP_MASK 0x0004 /* AIF3ADC_COMP */
2732#define WM8958_AIF3ADC_COMP_SHIFT 2 /* AIF3ADC_COMP */
2733#define WM8958_AIF3ADC_COMP_WIDTH 1 /* AIF3ADC_COMP */
2734#define WM8958_AIF3ADC_COMPMODE 0x0002 /* AIF3ADC_COMPMODE */
2735#define WM8958_AIF3ADC_COMPMODE_MASK 0x0002 /* AIF3ADC_COMPMODE */
2736#define WM8958_AIF3ADC_COMPMODE_SHIFT 1 /* AIF3ADC_COMPMODE */
2737#define WM8958_AIF3ADC_COMPMODE_WIDTH 1 /* AIF3ADC_COMPMODE */
2738#define WM8958_AIF3_LOOPBACK 0x0001 /* AIF3_LOOPBACK */
2739#define WM8958_AIF3_LOOPBACK_MASK 0x0001 /* AIF3_LOOPBACK */
2740#define WM8958_AIF3_LOOPBACK_SHIFT 0 /* AIF3_LOOPBACK */
2741#define WM8958_AIF3_LOOPBACK_WIDTH 1 /* AIF3_LOOPBACK */
2742
2743/*
2744 * R802 (0x322) - AIF3DAC Data
2745 */
2746#define WM8958_AIF3DAC_DAT_INV 0x0001 /* AIF3DAC_DAT_INV */
2747#define WM8958_AIF3DAC_DAT_INV_MASK 0x0001 /* AIF3DAC_DAT_INV */
2748#define WM8958_AIF3DAC_DAT_INV_SHIFT 0 /* AIF3DAC_DAT_INV */
2749#define WM8958_AIF3DAC_DAT_INV_WIDTH 1 /* AIF3DAC_DAT_INV */
2750
2751/*
2752 * R803 (0x323) - AIF3ADC Data
2753 */
2754#define WM8958_AIF3ADC_DAT_INV 0x0001 /* AIF3ADC_DAT_INV */
2755#define WM8958_AIF3ADC_DAT_INV_MASK 0x0001 /* AIF3ADC_DAT_INV */
2756#define WM8958_AIF3ADC_DAT_INV_SHIFT 0 /* AIF3ADC_DAT_INV */
2757#define WM8958_AIF3ADC_DAT_INV_WIDTH 1 /* AIF3ADC_DAT_INV */
2758
2759/*
2556 * R1024 (0x400) - AIF1 ADC1 Left Volume 2760 * R1024 (0x400) - AIF1 ADC1 Left Volume
2557 */ 2761 */
2558#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ 2762#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */
@@ -4289,4 +4493,102 @@
4289#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ 4493#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */
4290#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ 4494#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */
4291 4495
4496/*
4497 * R2304 (0x900) - DSP2_Program
4498 */
4499#define WM8958_DSP2_ENA 0x0001 /* DSP2_ENA */
4500#define WM8958_DSP2_ENA_MASK 0x0001 /* DSP2_ENA */
4501#define WM8958_DSP2_ENA_SHIFT 0 /* DSP2_ENA */
4502#define WM8958_DSP2_ENA_WIDTH 1 /* DSP2_ENA */
4503
4504/*
4505 * R2305 (0x901) - DSP2_Config
4506 */
4507#define WM8958_MBC_SEL_MASK 0x0030 /* MBC_SEL - [5:4] */
4508#define WM8958_MBC_SEL_SHIFT 4 /* MBC_SEL - [5:4] */
4509#define WM8958_MBC_SEL_WIDTH 2 /* MBC_SEL - [5:4] */
4510#define WM8958_MBC_ENA 0x0001 /* MBC_ENA */
4511#define WM8958_MBC_ENA_MASK 0x0001 /* MBC_ENA */
4512#define WM8958_MBC_ENA_SHIFT 0 /* MBC_ENA */
4513#define WM8958_MBC_ENA_WIDTH 1 /* MBC_ENA */
4514
4515/*
4516 * R2560 (0xA00) - DSP2_MagicNum
4517 */
4518#define WM8958_DSP2_MAGIC_NUM_MASK 0xFFFF /* DSP2_MAGIC_NUM - [15:0] */
4519#define WM8958_DSP2_MAGIC_NUM_SHIFT 0 /* DSP2_MAGIC_NUM - [15:0] */
4520#define WM8958_DSP2_MAGIC_NUM_WIDTH 16 /* DSP2_MAGIC_NUM - [15:0] */
4521
4522/*
4523 * R2561 (0xA01) - DSP2_ReleaseYear
4524 */
4525#define WM8958_DSP2_RELEASE_YEAR_MASK 0xFFFF /* DSP2_RELEASE_YEAR - [15:0] */
4526#define WM8958_DSP2_RELEASE_YEAR_SHIFT 0 /* DSP2_RELEASE_YEAR - [15:0] */
4527#define WM8958_DSP2_RELEASE_YEAR_WIDTH 16 /* DSP2_RELEASE_YEAR - [15:0] */
4528
4529/*
4530 * R2562 (0xA02) - DSP2_ReleaseMonthDay
4531 */
4532#define WM8958_DSP2_RELEASE_MONTH_MASK 0xFF00 /* DSP2_RELEASE_MONTH - [15:8] */
4533#define WM8958_DSP2_RELEASE_MONTH_SHIFT 8 /* DSP2_RELEASE_MONTH - [15:8] */
4534#define WM8958_DSP2_RELEASE_MONTH_WIDTH 8 /* DSP2_RELEASE_MONTH - [15:8] */
4535#define WM8958_DSP2_RELEASE_DAY_MASK 0x00FF /* DSP2_RELEASE_DAY - [7:0] */
4536#define WM8958_DSP2_RELEASE_DAY_SHIFT 0 /* DSP2_RELEASE_DAY - [7:0] */
4537#define WM8958_DSP2_RELEASE_DAY_WIDTH 8 /* DSP2_RELEASE_DAY - [7:0] */
4538
4539/*
4540 * R2563 (0xA03) - DSP2_ReleaseTime
4541 */
4542#define WM8958_DSP2_RELEASE_HOURS_MASK 0xFF00 /* DSP2_RELEASE_HOURS - [15:8] */
4543#define WM8958_DSP2_RELEASE_HOURS_SHIFT 8 /* DSP2_RELEASE_HOURS - [15:8] */
4544#define WM8958_DSP2_RELEASE_HOURS_WIDTH 8 /* DSP2_RELEASE_HOURS - [15:8] */
4545#define WM8958_DSP2_RELEASE_MINS_MASK 0x00FF /* DSP2_RELEASE_MINS - [7:0] */
4546#define WM8958_DSP2_RELEASE_MINS_SHIFT 0 /* DSP2_RELEASE_MINS - [7:0] */
4547#define WM8958_DSP2_RELEASE_MINS_WIDTH 8 /* DSP2_RELEASE_MINS - [7:0] */
4548
4549/*
4550 * R2564 (0xA04) - DSP2_VerMajMin
4551 */
4552#define WM8958_DSP2_MAJOR_VER_MASK 0xFF00 /* DSP2_MAJOR_VER - [15:8] */
4553#define WM8958_DSP2_MAJOR_VER_SHIFT 8 /* DSP2_MAJOR_VER - [15:8] */
4554#define WM8958_DSP2_MAJOR_VER_WIDTH 8 /* DSP2_MAJOR_VER - [15:8] */
4555#define WM8958_DSP2_MINOR_VER_MASK 0x00FF /* DSP2_MINOR_VER - [7:0] */
4556#define WM8958_DSP2_MINOR_VER_SHIFT 0 /* DSP2_MINOR_VER - [7:0] */
4557#define WM8958_DSP2_MINOR_VER_WIDTH 8 /* DSP2_MINOR_VER - [7:0] */
4558
4559/*
4560 * R2565 (0xA05) - DSP2_VerBuild
4561 */
4562#define WM8958_DSP2_BUILD_VER_MASK 0xFFFF /* DSP2_BUILD_VER - [15:0] */
4563#define WM8958_DSP2_BUILD_VER_SHIFT 0 /* DSP2_BUILD_VER - [15:0] */
4564#define WM8958_DSP2_BUILD_VER_WIDTH 16 /* DSP2_BUILD_VER - [15:0] */
4565
4566/*
4567 * R2573 (0xA0D) - DSP2_ExecControl
4568 */
4569#define WM8958_DSP2_STOPC 0x0020 /* DSP2_STOPC */
4570#define WM8958_DSP2_STOPC_MASK 0x0020 /* DSP2_STOPC */
4571#define WM8958_DSP2_STOPC_SHIFT 5 /* DSP2_STOPC */
4572#define WM8958_DSP2_STOPC_WIDTH 1 /* DSP2_STOPC */
4573#define WM8958_DSP2_STOPS 0x0010 /* DSP2_STOPS */
4574#define WM8958_DSP2_STOPS_MASK 0x0010 /* DSP2_STOPS */
4575#define WM8958_DSP2_STOPS_SHIFT 4 /* DSP2_STOPS */
4576#define WM8958_DSP2_STOPS_WIDTH 1 /* DSP2_STOPS */
4577#define WM8958_DSP2_STOPI 0x0008 /* DSP2_STOPI */
4578#define WM8958_DSP2_STOPI_MASK 0x0008 /* DSP2_STOPI */
4579#define WM8958_DSP2_STOPI_SHIFT 3 /* DSP2_STOPI */
4580#define WM8958_DSP2_STOPI_WIDTH 1 /* DSP2_STOPI */
4581#define WM8958_DSP2_STOP 0x0004 /* DSP2_STOP */
4582#define WM8958_DSP2_STOP_MASK 0x0004 /* DSP2_STOP */
4583#define WM8958_DSP2_STOP_SHIFT 2 /* DSP2_STOP */
4584#define WM8958_DSP2_STOP_WIDTH 1 /* DSP2_STOP */
4585#define WM8958_DSP2_RUNR 0x0002 /* DSP2_RUNR */
4586#define WM8958_DSP2_RUNR_MASK 0x0002 /* DSP2_RUNR */
4587#define WM8958_DSP2_RUNR_SHIFT 1 /* DSP2_RUNR */
4588#define WM8958_DSP2_RUNR_WIDTH 1 /* DSP2_RUNR */
4589#define WM8958_DSP2_RUN 0x0001 /* DSP2_RUN */
4590#define WM8958_DSP2_RUN_MASK 0x0001 /* DSP2_RUN */
4591#define WM8958_DSP2_RUN_SHIFT 0 /* DSP2_RUN */
4592#define WM8958_DSP2_RUN_WIDTH 1 /* DSP2_RUN */
4593
4292#endif 4594#endif
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 44fc5348fd5d..bf173502d744 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -104,6 +104,9 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
104 104
105#define SH_MMCIF_BBS 512 /* boot block size */ 105#define SH_MMCIF_BBS 512 /* boot block size */
106 106
107enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT,
108 MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE };
109
107static inline void sh_mmcif_boot_cmd_send(void __iomem *base, 110static inline void sh_mmcif_boot_cmd_send(void __iomem *base,
108 unsigned long cmd, unsigned long arg) 111 unsigned long cmd, unsigned long arg)
109{ 112{
@@ -166,6 +169,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base,
166 unsigned long k; 169 unsigned long k;
167 int ret = 0; 170 int ret = 0;
168 171
172 /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
173 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
174 CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
175 SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
176
177 /* CMD9 - Get CSD */
178 sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
179
180 /* CMD7 - Select the card */
181 sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
182
169 /* CMD16 - Set the block size */ 183 /* CMD16 - Set the block size */
170 sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); 184 sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS);
171 185
@@ -209,27 +223,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
209 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); 223 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
210} 224}
211 225
212static inline void sh_mmcif_boot_slurp(void __iomem *base,
213 unsigned char *buf,
214 unsigned long no_bytes)
215{
216 unsigned long tmp;
217
218 /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
219 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
220 CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
221 SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
222
223 /* CMD9 - Get CSD */
224 sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
225
226 /* CMD7 - Select the card */
227 sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
228
229 tmp = no_bytes / SH_MMCIF_BBS;
230 tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0;
231
232 sh_mmcif_boot_do_read(base, 512, tmp, buf);
233}
234
235#endif /* __SH_MMCIF_H__ */ 226#endif /* __SH_MMCIF_H__ */
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 1c27f201c856..e13eefef0653 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -143,104 +143,4 @@ struct ncp_nls_ioctl
143#define NCP_MAXPATHLEN 255 143#define NCP_MAXPATHLEN 255
144#define NCP_MAXNAMELEN 14 144#define NCP_MAXNAMELEN 14
145 145
146#ifdef __KERNEL__
147
148#include <linux/ncp_fs_i.h>
149#include <linux/ncp_fs_sb.h>
150
151/* define because it is easy to change PRINTK to {*}PRINTK */
152#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)
153
154#undef NCPFS_PARANOIA
155#ifdef NCPFS_PARANOIA
156#define PPRINTK(format, args...) PRINTK(format , ## args)
157#else
158#define PPRINTK(format, args...)
159#endif
160
161#ifndef DEBUG_NCP
162#define DEBUG_NCP 0
163#endif
164#if DEBUG_NCP > 0
165#define DPRINTK(format, args...) PRINTK(format , ## args)
166#else
167#define DPRINTK(format, args...)
168#endif
169#if DEBUG_NCP > 1
170#define DDPRINTK(format, args...) PRINTK(format , ## args)
171#else
172#define DDPRINTK(format, args...)
173#endif
174
175#define NCP_MAX_RPC_TIMEOUT (6*HZ)
176
177
178struct ncp_entry_info {
179 struct nw_info_struct i;
180 ino_t ino;
181 int opened;
182 int access;
183 unsigned int volume;
184 __u8 file_handle[6];
185};
186
187static inline struct ncp_server *NCP_SBP(const struct super_block *sb)
188{
189 return sb->s_fs_info;
190}
191
192#define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
193static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode)
194{
195 return container_of(inode, struct ncp_inode_info, vfs_inode);
196}
197
198/* linux/fs/ncpfs/inode.c */
199int ncp_notify_change(struct dentry *, struct iattr *);
200struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
201void ncp_update_inode(struct inode *, struct ncp_entry_info *);
202void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
203
204/* linux/fs/ncpfs/dir.c */
205extern const struct inode_operations ncp_dir_inode_operations;
206extern const struct file_operations ncp_dir_operations;
207extern const struct dentry_operations ncp_root_dentry_operations;
208int ncp_conn_logged_in(struct super_block *);
209int ncp_date_dos2unix(__le16 time, __le16 date);
210void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
211
212/* linux/fs/ncpfs/ioctl.c */
213long ncp_ioctl(struct file *, unsigned int, unsigned long);
214long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
215
216/* linux/fs/ncpfs/sock.c */
217int ncp_request2(struct ncp_server *server, int function,
218 void* reply, int max_reply_size);
219static inline int ncp_request(struct ncp_server *server, int function) {
220 return ncp_request2(server, function, server->packet, server->packet_size);
221}
222int ncp_connect(struct ncp_server *server);
223int ncp_disconnect(struct ncp_server *server);
224void ncp_lock_server(struct ncp_server *server);
225void ncp_unlock_server(struct ncp_server *server);
226
227/* linux/fs/ncpfs/symlink.c */
228#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
229extern const struct address_space_operations ncp_symlink_aops;
230int ncp_symlink(struct inode*, struct dentry*, const char*);
231#endif
232
233/* linux/fs/ncpfs/file.c */
234extern const struct inode_operations ncp_file_inode_operations;
235extern const struct file_operations ncp_file_operations;
236int ncp_make_open(struct inode *, int);
237
238/* linux/fs/ncpfs/mmap.c */
239int ncp_mmap(struct file *, struct vm_area_struct *);
240
241/* linux/fs/ncpfs/ncplib_kernel.c */
242int ncp_make_closed(struct inode *);
243
244#endif /* __KERNEL__ */
245
246#endif /* _LINUX_NCP_FS_H */ 146#endif /* _LINUX_NCP_FS_H */
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h
deleted file mode 100644
index 4b0bec477846..000000000000
--- a/include/linux/ncp_fs_i.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * ncp_fs_i.h
3 *
4 * Copyright (C) 1995 Volker Lendecke
5 *
6 */
7
8#ifndef _LINUX_NCP_FS_I
9#define _LINUX_NCP_FS_I
10
11/*
12 * This is the ncpfs part of the inode structure. This must contain
13 * all the information we need to work with an inode after creation.
14 */
15struct ncp_inode_info {
16 __le32 dirEntNum;
17 __le32 DosDirNum;
18 __u8 volNumber;
19 __le32 nwattr;
20 struct mutex open_mutex;
21 atomic_t opened;
22 int access;
23 int flags;
24#define NCPI_KLUDGE_SYMLINK 0x0001
25 __u8 file_handle[6];
26 struct inode vfs_inode;
27};
28
29#endif /* _LINUX_NCP_FS_I */
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
deleted file mode 100644
index d64b0e894336..000000000000
--- a/include/linux/ncp_fs_sb.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * ncp_fs_sb.h
3 *
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 *
6 */
7
8#ifndef _NCP_FS_SB
9#define _NCP_FS_SB
10
11#include <linux/types.h>
12#include <linux/ncp_mount.h>
13#include <linux/net.h>
14#include <linux/mutex.h>
15#include <linux/backing-dev.h>
16
17#ifdef __KERNEL__
18
19#include <linux/workqueue.h>
20
21#define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */
22
23struct sock;
24
25struct ncp_server {
26
27 struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of
28 interest for us later, so we store
29 it completely. */
30
31 __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2];
32
33 struct file *ncp_filp; /* File pointer to ncp socket */
34 struct socket *ncp_sock;/* ncp socket */
35 struct file *info_filp;
36 struct socket *info_sock;
37
38 u8 sequence;
39 u8 task;
40 u16 connection; /* Remote connection number */
41
42 u8 completion; /* Status message from server */
43 u8 conn_status; /* Bit 4 = 1 ==> Server going down, no
44 requests allowed anymore.
45 Bit 0 = 1 ==> Server is down. */
46
47 int buffer_size; /* Negotiated bufsize */
48
49 int reply_size; /* Size of last reply */
50
51 int packet_size;
52 unsigned char *packet; /* Here we prepare requests and
53 receive replies */
54 unsigned char *txbuf; /* Storage for current request */
55 unsigned char *rxbuf; /* Storage for reply to current request */
56
57 int lock; /* To prevent mismatch in protocols. */
58 struct mutex mutex;
59
60 int current_size; /* for packet preparation */
61 int has_subfunction;
62 int ncp_reply_size;
63
64 int root_setuped;
65 struct mutex root_setup_lock;
66
67 /* info for packet signing */
68 int sign_wanted; /* 1=Server needs signed packets */
69 int sign_active; /* 0=don't do signing, 1=do */
70 char sign_root[8]; /* generated from password and encr. key */
71 char sign_last[16];
72
73 /* Authentication info: NDS or BINDERY, username */
74 struct {
75 int auth_type;
76 size_t object_name_len;
77 void* object_name;
78 int object_type;
79 } auth;
80 /* Password info */
81 struct {
82 size_t len;
83 void* data;
84 } priv;
85 struct rw_semaphore auth_rwsem;
86
87 /* nls info: codepage for volume and charset for I/O */
88 struct nls_table *nls_vol;
89 struct nls_table *nls_io;
90
91 /* maximum age in jiffies */
92 atomic_t dentry_ttl;
93
94 /* miscellaneous */
95 unsigned int flags;
96
97 spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */
98
99 void (*data_ready)(struct sock* sk, int len);
100 void (*error_report)(struct sock* sk);
101 void (*write_space)(struct sock* sk); /* STREAM mode only */
102 struct {
103 struct work_struct tq; /* STREAM/DGRAM: data/error ready */
104 struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */
105 struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */
106
107 unsigned int state; /* STREAM only: receiver state */
108 struct {
109 __u32 magic __packed;
110 __u32 len __packed;
111 __u16 type __packed;
112 __u16 p1 __packed;
113 __u16 p2 __packed;
114 __u16 p3 __packed;
115 __u16 type2 __packed;
116 } buf; /* STREAM only: temporary buffer */
117 unsigned char* ptr; /* STREAM only: pointer to data */
118 size_t len; /* STREAM only: length of data to receive */
119 } rcv;
120 struct {
121 struct list_head requests; /* STREAM only: queued requests */
122 struct work_struct tq; /* STREAM only: transmitter ready */
123 struct ncp_request_reply* creq; /* STREAM only: currently transmitted entry */
124 } tx;
125 struct timer_list timeout_tm; /* DGRAM only: timeout timer */
126 struct work_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */
127 int timeout_last; /* DGRAM only: current timeout length */
128 int timeout_retries; /* DGRAM only: retries left */
129 struct {
130 size_t len;
131 __u8 data[128];
132 } unexpected_packet;
133 struct backing_dev_info bdi;
134};
135
136extern void ncp_tcp_rcv_proc(struct work_struct *work);
137extern void ncp_tcp_tx_proc(struct work_struct *work);
138extern void ncpdgram_rcv_proc(struct work_struct *work);
139extern void ncpdgram_timeout_proc(struct work_struct *work);
140extern void ncpdgram_timeout_call(unsigned long server);
141extern void ncp_tcp_data_ready(struct sock* sk, int len);
142extern void ncp_tcp_write_space(struct sock* sk);
143extern void ncp_tcp_error_report(struct sock* sk);
144
145#define NCP_FLAG_UTF8 1
146
147#define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag))
148#define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag))
149#define NCP_IS_FLAG(server, flag) ((server)->flags & (flag))
150
151static inline int ncp_conn_valid(struct ncp_server *server)
152{
153 return ((server->conn_status & 0x11) == 0);
154}
155
156static inline void ncp_invalidate_conn(struct ncp_server *server)
157{
158 server->conn_status |= 0x01;
159}
160
161#endif /* __KERNEL__ */
162
163#endif
164
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h
index a2b549eb1eca..dfcbea2d889f 100644
--- a/include/linux/ncp_mount.h
+++ b/include/linux/ncp_mount.h
@@ -68,26 +68,4 @@ struct ncp_mount_data_v4 {
68 68
69#define NCP_MOUNT_VERSION_V5 (5) /* Text only */ 69#define NCP_MOUNT_VERSION_V5 (5) /* Text only */
70 70
71#ifdef __KERNEL__
72
73struct ncp_mount_data_kernel {
74 unsigned long flags; /* NCP_MOUNT_* flags */
75 unsigned int int_flags; /* internal flags */
76#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001
77 __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */
78 struct pid *wdog_pid; /* Who cares for our watchdog packets? */
79 unsigned int ncp_fd; /* The socket to the ncp port */
80 unsigned int time_out; /* How long should I wait after
81 sending a NCP request? */
82 unsigned int retry_count; /* And how often should I retry? */
83 unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
84 __kernel_uid32_t uid;
85 __kernel_gid32_t gid;
86 __kernel_mode_t file_mode;
87 __kernel_mode_t dir_mode;
88 int info_fd;
89};
90
91#endif /* __KERNEL__ */
92
93#endif 71#endif
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h
new file mode 100644
index 000000000000..7ab8521f2347
--- /dev/null
+++ b/include/linux/nfc/pn544.h
@@ -0,0 +1,97 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28#define PN544_DRIVER_NAME "pn544"
29#define PN544_MAXWINDOW_SIZE 7
30#define PN544_WINDOW_SIZE 4
31#define PN544_RETRIES 10
32#define PN544_MAX_I2C_TRANSFER 0x0400
33#define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */
34
35/* ioctl */
36#define PN544_CHAR_BASE 'P'
37#define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype)
38#define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype)
39#define PN544_GET_FW_MODE PN544_IOW(1, unsigned int)
40#define PN544_SET_FW_MODE PN544_IOW(2, unsigned int)
41#define PN544_GET_DEBUG PN544_IOW(3, unsigned int)
42#define PN544_SET_DEBUG PN544_IOW(4, unsigned int)
43
44/* Timing restrictions (ms) */
45#define PN544_RESETVEN_TIME 30 /* 7 */
46#define PN544_PVDDVEN_TIME 0
47#define PN544_VBATVEN_TIME 0
48#define PN544_GPIO4VEN_TIME 0
49#define PN544_WAKEUP_ACK 5
50#define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1)
51#define PN544_INACTIVITY_TIME 1000
52#define PN544_INTERFRAME_DELAY 200 /* us */
53#define PN544_BAUDRATE_CHANGE 150 /* us */
54
55/* Debug bits */
56#define PN544_DEBUG_BUF 0x01
57#define PN544_DEBUG_READ 0x02
58#define PN544_DEBUG_WRITE 0x04
59#define PN544_DEBUG_IRQ 0x08
60#define PN544_DEBUG_CALLS 0x10
61#define PN544_DEBUG_MODE 0x20
62
63/* Normal (HCI) mode */
64#define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */
65#define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */
66#define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2)
67#define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2)
68
69struct pn544_llc_packet {
70 unsigned char length; /* of rest of packet */
71 unsigned char header;
72 unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */
73};
74
75/* Firmware upgrade mode */
76#define PN544_FW_HEADER_SIZE 3
77/* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */
78#define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE)
79
80struct pn544_fw_packet {
81 unsigned char command; /* status in answer */
82 unsigned char length[2]; /* big-endian order (msf) */
83 unsigned char data[PN544_MAX_FW_DATA];
84};
85
86#ifdef __KERNEL__
87/* board config */
88struct pn544_nfc_platform_data {
89 int (*request_resources) (struct i2c_client *client);
90 void (*free_resources) (void);
91 void (*enable) (int fw);
92 int (*test) (void);
93 void (*disable) (void);
94};
95#endif /* __KERNEL__ */
96
97#endif /* _PN544_H_ */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ab47732d81e0..ae0dc453e3e2 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2369,8 +2369,10 @@
2369#define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 2369#define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381
2370#define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 2370#define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382
2371#define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 2371#define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383
2372#define PCI_DEVICE_ID_JMICRON_JMB385_MS 0x2388
2372#define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 2373#define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391
2373#define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 2374#define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392
2375#define PCI_DEVICE_ID_JMICRON_JMB390_MS 0x2393
2374 2376
2375#define PCI_VENDOR_ID_KORENIX 0x1982 2377#define PCI_VENDOR_ID_KORENIX 0x1982
2376#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 2378#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 56e76af78102..1a2ccd6f3823 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -57,7 +57,7 @@ struct poll_table_entry {
57}; 57};
58 58
59/* 59/*
60 * Structures and helpers for sys_poll/sys_poll 60 * Structures and helpers for select/poll syscall
61 */ 61 */
62struct poll_wqueues { 62struct poll_wqueues {
63 poll_table pt; 63 poll_table pt;
diff --git a/include/linux/pps.h b/include/linux/pps.h
index 0194ab06177b..a9bb1d93451a 100644
--- a/include/linux/pps.h
+++ b/include/linux/pps.h
@@ -114,11 +114,18 @@ struct pps_fdata {
114 struct pps_ktime timeout; 114 struct pps_ktime timeout;
115}; 115};
116 116
117struct pps_bind_args {
118 int tsformat; /* format of time stamps */
119 int edge; /* selected event type */
120 int consumer; /* selected kernel consumer */
121};
122
117#include <linux/ioctl.h> 123#include <linux/ioctl.h>
118 124
119#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) 125#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *)
120#define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) 126#define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *)
121#define PPS_GETCAP _IOR('p', 0xa3, int *) 127#define PPS_GETCAP _IOR('p', 0xa3, int *)
122#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) 128#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *)
129#define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *)
123 130
124#endif /* _PPS_H_ */ 131#endif /* _PPS_H_ */
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index e0a193f830ef..94048547f29a 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -18,6 +18,9 @@
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20 20
21#ifndef LINUX_PPS_KERNEL_H
22#define LINUX_PPS_KERNEL_H
23
21#include <linux/pps.h> 24#include <linux/pps.h>
22 25
23#include <linux/cdev.h> 26#include <linux/cdev.h>
@@ -28,18 +31,28 @@
28 * Global defines 31 * Global defines
29 */ 32 */
30 33
34struct pps_device;
35
31/* The specific PPS source info */ 36/* The specific PPS source info */
32struct pps_source_info { 37struct pps_source_info {
33 char name[PPS_MAX_NAME_LEN]; /* simbolic name */ 38 char name[PPS_MAX_NAME_LEN]; /* simbolic name */
34 char path[PPS_MAX_NAME_LEN]; /* path of connected device */ 39 char path[PPS_MAX_NAME_LEN]; /* path of connected device */
35 int mode; /* PPS's allowed mode */ 40 int mode; /* PPS's allowed mode */
36 41
37 void (*echo)(int source, int event, void *data); /* PPS echo function */ 42 void (*echo)(struct pps_device *pps,
43 int event, void *data); /* PPS echo function */
38 44
39 struct module *owner; 45 struct module *owner;
40 struct device *dev; 46 struct device *dev;
41}; 47};
42 48
49struct pps_event_time {
50#ifdef CONFIG_NTP_PPS
51 struct timespec ts_raw;
52#endif /* CONFIG_NTP_PPS */
53 struct timespec ts_real;
54};
55
43/* The main struct */ 56/* The main struct */
44struct pps_device { 57struct pps_device {
45 struct pps_source_info info; /* PSS source info */ 58 struct pps_source_info info; /* PSS source info */
@@ -52,38 +65,56 @@ struct pps_device {
52 struct pps_ktime clear_tu; 65 struct pps_ktime clear_tu;
53 int current_mode; /* PPS mode at event time */ 66 int current_mode; /* PPS mode at event time */
54 67
55 int go; /* PPS event is arrived? */ 68 unsigned int last_ev; /* last PPS event id */
56 wait_queue_head_t queue; /* PPS event queue */ 69 wait_queue_head_t queue; /* PPS event queue */
57 70
58 unsigned int id; /* PPS source unique ID */ 71 unsigned int id; /* PPS source unique ID */
59 struct cdev cdev; 72 struct cdev cdev;
60 struct device *dev; 73 struct device *dev;
61 int devno;
62 struct fasync_struct *async_queue; /* fasync method */ 74 struct fasync_struct *async_queue; /* fasync method */
63 spinlock_t lock; 75 spinlock_t lock;
64
65 atomic_t usage; /* usage count */
66}; 76};
67 77
68/* 78/*
69 * Global variables 79 * Global variables
70 */ 80 */
71 81
72extern spinlock_t pps_idr_lock;
73extern struct idr pps_idr;
74extern struct timespec pps_irq_ts[];
75
76extern struct device_attribute pps_attrs[]; 82extern struct device_attribute pps_attrs[];
77 83
78/* 84/*
79 * Exported functions 85 * Exported functions
80 */ 86 */
81 87
82struct pps_device *pps_get_source(int source); 88extern struct pps_device *pps_register_source(
83extern void pps_put_source(struct pps_device *pps); 89 struct pps_source_info *info, int default_params);
84extern int pps_register_source(struct pps_source_info *info, 90extern void pps_unregister_source(struct pps_device *pps);
85 int default_params);
86extern void pps_unregister_source(int source);
87extern int pps_register_cdev(struct pps_device *pps); 91extern int pps_register_cdev(struct pps_device *pps);
88extern void pps_unregister_cdev(struct pps_device *pps); 92extern void pps_unregister_cdev(struct pps_device *pps);
89extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); 93extern void pps_event(struct pps_device *pps,
94 struct pps_event_time *ts, int event, void *data);
95
96static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
97 struct timespec ts)
98{
99 kt->sec = ts.tv_sec;
100 kt->nsec = ts.tv_nsec;
101}
102
103#ifdef CONFIG_NTP_PPS
104
105static inline void pps_get_ts(struct pps_event_time *ts)
106{
107 getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real);
108}
109
110#else /* CONFIG_NTP_PPS */
111
112static inline void pps_get_ts(struct pps_event_time *ts)
113{
114 getnstimeofday(&ts->ts_real);
115}
116
117#endif /* CONFIG_NTP_PPS */
118
119#endif /* LINUX_PPS_KERNEL_H */
120
diff --git a/include/linux/printk.h b/include/linux/printk.h
index b772ca5fbdf0..ee048e77e1ae 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -4,14 +4,14 @@
4extern const char linux_banner[]; 4extern const char linux_banner[];
5extern const char linux_proc_banner[]; 5extern const char linux_proc_banner[];
6 6
7#define KERN_EMERG "<0>" /* system is unusable */ 7#define KERN_EMERG "<0>" /* system is unusable */
8#define KERN_ALERT "<1>" /* action must be taken immediately */ 8#define KERN_ALERT "<1>" /* action must be taken immediately */
9#define KERN_CRIT "<2>" /* critical conditions */ 9#define KERN_CRIT "<2>" /* critical conditions */
10#define KERN_ERR "<3>" /* error conditions */ 10#define KERN_ERR "<3>" /* error conditions */
11#define KERN_WARNING "<4>" /* warning conditions */ 11#define KERN_WARNING "<4>" /* warning conditions */
12#define KERN_NOTICE "<5>" /* normal but significant condition */ 12#define KERN_NOTICE "<5>" /* normal but significant condition */
13#define KERN_INFO "<6>" /* informational */ 13#define KERN_INFO "<6>" /* informational */
14#define KERN_DEBUG "<7>" /* debug-level messages */ 14#define KERN_DEBUG "<7>" /* debug-level messages */
15 15
16/* Use the default kernel loglevel */ 16/* Use the default kernel loglevel */
17#define KERN_DEFAULT "<d>" 17#define KERN_DEFAULT "<d>"
@@ -20,7 +20,7 @@ extern const char linux_proc_banner[];
20 * line that had no enclosing \n). Only to be used by core/arch code 20 * line that had no enclosing \n). Only to be used by core/arch code
21 * during early bootup (a continued line is not SMP-safe otherwise). 21 * during early bootup (a continued line is not SMP-safe otherwise).
22 */ 22 */
23#define KERN_CONT "<c>" 23#define KERN_CONT "<c>"
24 24
25extern int console_printk[]; 25extern int console_printk[];
26 26
@@ -29,6 +29,17 @@ extern int console_printk[];
29#define minimum_console_loglevel (console_printk[2]) 29#define minimum_console_loglevel (console_printk[2])
30#define default_console_loglevel (console_printk[3]) 30#define default_console_loglevel (console_printk[3])
31 31
32static inline void console_silent(void)
33{
34 console_loglevel = 0;
35}
36
37static inline void console_verbose(void)
38{
39 if (console_loglevel)
40 console_loglevel = 15;
41}
42
32struct va_format { 43struct va_format {
33 const char *fmt; 44 const char *fmt;
34 va_list *va; 45 va_list *va;
@@ -65,11 +76,27 @@ struct va_format {
65 */ 76 */
66#define HW_ERR "[Hardware Error]: " 77#define HW_ERR "[Hardware Error]: "
67 78
79/*
80 * Dummy printk for disabled debugging statements to use whilst maintaining
81 * gcc's format and side-effect checking.
82 */
83static inline __attribute__ ((format (printf, 1, 2)))
84int no_printk(const char *fmt, ...)
85{
86 return 0;
87}
88
89extern asmlinkage __attribute__ ((format (printf, 1, 2)))
90void early_printk(const char *fmt, ...);
91
92extern int printk_needs_cpu(int cpu);
93extern void printk_tick(void);
94
68#ifdef CONFIG_PRINTK 95#ifdef CONFIG_PRINTK
69asmlinkage int vprintk(const char *fmt, va_list args) 96asmlinkage __attribute__ ((format (printf, 1, 0)))
70 __attribute__ ((format (printf, 1, 0))); 97int vprintk(const char *fmt, va_list args);
71asmlinkage int printk(const char * fmt, ...) 98asmlinkage __attribute__ ((format (printf, 1, 2))) __cold
72 __attribute__ ((format (printf, 1, 2))) __cold; 99int printk(const char *fmt, ...);
73 100
74/* 101/*
75 * Please don't use printk_ratelimit(), because it shares ratelimiting state 102 * Please don't use printk_ratelimit(), because it shares ratelimiting state
@@ -83,99 +110,56 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
83 110
84extern int printk_delay_msec; 111extern int printk_delay_msec;
85extern int dmesg_restrict; 112extern int dmesg_restrict;
86 113extern int kptr_restrict;
87/*
88 * Print a one-time message (analogous to WARN_ONCE() et al):
89 */
90#define printk_once(x...) ({ \
91 static bool __print_once; \
92 \
93 if (!__print_once) { \
94 __print_once = true; \
95 printk(x); \
96 } \
97})
98 114
99void log_buf_kexec_setup(void); 115void log_buf_kexec_setup(void);
100#else 116#else
101static inline int vprintk(const char *s, va_list args) 117static inline __attribute__ ((format (printf, 1, 0)))
102 __attribute__ ((format (printf, 1, 0))); 118int vprintk(const char *s, va_list args)
103static inline int vprintk(const char *s, va_list args) { return 0; }
104static inline int printk(const char *s, ...)
105 __attribute__ ((format (printf, 1, 2)));
106static inline int __cold printk(const char *s, ...) { return 0; }
107static inline int printk_ratelimit(void) { return 0; }
108static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
109 unsigned int interval_msec) \
110 { return false; }
111
112/* No effect, but we still get type checking even in the !PRINTK case: */
113#define printk_once(x...) printk(x)
114
115static inline void log_buf_kexec_setup(void)
116{ 119{
120 return 0;
117} 121}
118#endif 122static inline __attribute__ ((format (printf, 1, 2))) __cold
119 123int printk(const char *s, ...)
120/*
121 * Dummy printk for disabled debugging statements to use whilst maintaining
122 * gcc's format and side-effect checking.
123 */
124static inline __attribute__ ((format (printf, 1, 2)))
125int no_printk(const char *s, ...) { return 0; }
126
127extern int printk_needs_cpu(int cpu);
128extern void printk_tick(void);
129
130extern void asmlinkage __attribute__((format(printf, 1, 2)))
131 early_printk(const char *fmt, ...);
132
133static inline void console_silent(void)
134{ 124{
135 console_loglevel = 0; 125 return 0;
126}
127static inline int printk_ratelimit(void)
128{
129 return 0;
130}
131static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
132 unsigned int interval_msec)
133{
134 return false;
136} 135}
137 136
138static inline void console_verbose(void) 137static inline void log_buf_kexec_setup(void)
139{ 138{
140 if (console_loglevel)
141 console_loglevel = 15;
142} 139}
140#endif
143 141
144extern void dump_stack(void) __cold; 142extern void dump_stack(void) __cold;
145 143
146enum {
147 DUMP_PREFIX_NONE,
148 DUMP_PREFIX_ADDRESS,
149 DUMP_PREFIX_OFFSET
150};
151extern void hex_dump_to_buffer(const void *buf, size_t len,
152 int rowsize, int groupsize,
153 char *linebuf, size_t linebuflen, bool ascii);
154extern void print_hex_dump(const char *level, const char *prefix_str,
155 int prefix_type, int rowsize, int groupsize,
156 const void *buf, size_t len, bool ascii);
157extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
158 const void *buf, size_t len);
159
160#ifndef pr_fmt 144#ifndef pr_fmt
161#define pr_fmt(fmt) fmt 145#define pr_fmt(fmt) fmt
162#endif 146#endif
163 147
164#define pr_emerg(fmt, ...) \ 148#define pr_emerg(fmt, ...) \
165 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 149 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
166#define pr_alert(fmt, ...) \ 150#define pr_alert(fmt, ...) \
167 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 151 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
168#define pr_crit(fmt, ...) \ 152#define pr_crit(fmt, ...) \
169 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 153 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
170#define pr_err(fmt, ...) \ 154#define pr_err(fmt, ...) \
171 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 155 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
172#define pr_warning(fmt, ...) \ 156#define pr_warning(fmt, ...) \
173 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 157 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
174#define pr_warn pr_warning 158#define pr_warn pr_warning
175#define pr_notice(fmt, ...) \ 159#define pr_notice(fmt, ...) \
176 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 160 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
177#define pr_info(fmt, ...) \ 161#define pr_info(fmt, ...) \
178 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 162 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
179#define pr_cont(fmt, ...) \ 163#define pr_cont(fmt, ...) \
180 printk(KERN_CONT fmt, ##__VA_ARGS__) 164 printk(KERN_CONT fmt, ##__VA_ARGS__)
181 165
@@ -185,7 +169,7 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
185 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 169 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
186#else 170#else
187#define pr_devel(fmt, ...) \ 171#define pr_devel(fmt, ...) \
188 ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) 172 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
189#endif 173#endif
190 174
191/* If you are writing a driver, please use dev_dbg instead */ 175/* If you are writing a driver, please use dev_dbg instead */
@@ -198,7 +182,51 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
198 dynamic_pr_debug(fmt, ##__VA_ARGS__) 182 dynamic_pr_debug(fmt, ##__VA_ARGS__)
199#else 183#else
200#define pr_debug(fmt, ...) \ 184#define pr_debug(fmt, ...) \
201 ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) 185 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
186#endif
187
188/*
189 * Print a one-time message (analogous to WARN_ONCE() et al):
190 */
191
192#ifdef CONFIG_PRINTK
193#define printk_once(fmt, ...) \
194({ \
195 static bool __print_once; \
196 \
197 if (!__print_once) { \
198 __print_once = true; \
199 printk(fmt, ##__VA_ARGS__); \
200 } \
201})
202#else
203#define printk_once(fmt, ...) \
204 no_printk(fmt, ##__VA_ARGS__)
205#endif
206
207#define pr_emerg_once(fmt, ...) \
208 printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
209#define pr_alert_once(fmt, ...) \
210 printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
211#define pr_crit_once(fmt, ...) \
212 printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
213#define pr_err_once(fmt, ...) \
214 printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
215#define pr_warn_once(fmt, ...) \
216 printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
217#define pr_notice_once(fmt, ...) \
218 printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
219#define pr_info_once(fmt, ...) \
220 printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
221#define pr_cont_once(fmt, ...) \
222 printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
223/* If you are writing a driver, please use dev_dbg instead */
224#if defined(DEBUG)
225#define pr_debug_once(fmt, ...) \
226 printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
227#else
228#define pr_debug_once(fmt, ...) \
229 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
202#endif 230#endif
203 231
204/* 232/*
@@ -206,7 +234,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
206 * no local ratelimit_state used in the !PRINTK case 234 * no local ratelimit_state used in the !PRINTK case
207 */ 235 */
208#ifdef CONFIG_PRINTK 236#ifdef CONFIG_PRINTK
209#define printk_ratelimited(fmt, ...) ({ \ 237#define printk_ratelimited(fmt, ...) \
238({ \
210 static DEFINE_RATELIMIT_STATE(_rs, \ 239 static DEFINE_RATELIMIT_STATE(_rs, \
211 DEFAULT_RATELIMIT_INTERVAL, \ 240 DEFAULT_RATELIMIT_INTERVAL, \
212 DEFAULT_RATELIMIT_BURST); \ 241 DEFAULT_RATELIMIT_BURST); \
@@ -215,34 +244,59 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
215 printk(fmt, ##__VA_ARGS__); \ 244 printk(fmt, ##__VA_ARGS__); \
216}) 245})
217#else 246#else
218/* No effect, but we still get type checking even in the !PRINTK case: */ 247#define printk_ratelimited(fmt, ...) \
219#define printk_ratelimited printk 248 no_printk(fmt, ##__VA_ARGS__)
220#endif 249#endif
221 250
222#define pr_emerg_ratelimited(fmt, ...) \ 251#define pr_emerg_ratelimited(fmt, ...) \
223 printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 252 printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
224#define pr_alert_ratelimited(fmt, ...) \ 253#define pr_alert_ratelimited(fmt, ...) \
225 printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 254 printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
226#define pr_crit_ratelimited(fmt, ...) \ 255#define pr_crit_ratelimited(fmt, ...) \
227 printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 256 printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
228#define pr_err_ratelimited(fmt, ...) \ 257#define pr_err_ratelimited(fmt, ...) \
229 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 258 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
230#define pr_warning_ratelimited(fmt, ...) \ 259#define pr_warn_ratelimited(fmt, ...) \
231 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 260 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
232#define pr_warn_ratelimited pr_warning_ratelimited 261#define pr_notice_ratelimited(fmt, ...) \
233#define pr_notice_ratelimited(fmt, ...) \
234 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 262 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
235#define pr_info_ratelimited(fmt, ...) \ 263#define pr_info_ratelimited(fmt, ...) \
236 printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 264 printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
237/* no pr_cont_ratelimited, don't do that... */ 265/* no pr_cont_ratelimited, don't do that... */
238/* If you are writing a driver, please use dev_dbg instead */ 266/* If you are writing a driver, please use dev_dbg instead */
239#if defined(DEBUG) 267#if defined(DEBUG)
240#define pr_debug_ratelimited(fmt, ...) \ 268#define pr_debug_ratelimited(fmt, ...) \
241 printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 269 printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
242#else 270#else
243#define pr_debug_ratelimited(fmt, ...) \ 271#define pr_debug_ratelimited(fmt, ...) \
244 ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ 272 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
245 ##__VA_ARGS__); 0; }) 273#endif
274
275enum {
276 DUMP_PREFIX_NONE,
277 DUMP_PREFIX_ADDRESS,
278 DUMP_PREFIX_OFFSET
279};
280extern void hex_dump_to_buffer(const void *buf, size_t len,
281 int rowsize, int groupsize,
282 char *linebuf, size_t linebuflen, bool ascii);
283#ifdef CONFIG_PRINTK
284extern void print_hex_dump(const char *level, const char *prefix_str,
285 int prefix_type, int rowsize, int groupsize,
286 const void *buf, size_t len, bool ascii);
287extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
288 const void *buf, size_t len);
289#else
290static inline void print_hex_dump(const char *level, const char *prefix_str,
291 int prefix_type, int rowsize, int groupsize,
292 const void *buf, size_t len, bool ascii)
293{
294}
295static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
296 const void *buf, size_t len)
297{
298}
299
246#endif 300#endif
247 301
248#endif 302#endif
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index f509877c2ed4..6a210f1511fc 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -11,15 +11,17 @@
11#define __LINUX_MFD_AB8500_REGULATOR_H 11#define __LINUX_MFD_AB8500_REGULATOR_H
12 12
13/* AB8500 regulators */ 13/* AB8500 regulators */
14#define AB8500_LDO_AUX1 0 14enum ab8500_regulator_id {
15#define AB8500_LDO_AUX2 1 15 AB8500_LDO_AUX1,
16#define AB8500_LDO_AUX3 2 16 AB8500_LDO_AUX2,
17#define AB8500_LDO_INTCORE 3 17 AB8500_LDO_AUX3,
18#define AB8500_LDO_TVOUT 4 18 AB8500_LDO_INTCORE,
19#define AB8500_LDO_AUDIO 5 19 AB8500_LDO_TVOUT,
20#define AB8500_LDO_ANAMIC1 6 20 AB8500_LDO_AUDIO,
21#define AB8500_LDO_ANAMIC2 7 21 AB8500_LDO_ANAMIC1,
22#define AB8500_LDO_DMIC 8 22 AB8500_LDO_ANAMIC2,
23#define AB8500_LDO_ANA 9 23 AB8500_LDO_DMIC,
24 24 AB8500_LDO_ANA,
25 AB8500_NUM_REGULATORS,
26};
25#endif 27#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index ebd747265294..7954f6bd7edb 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -154,6 +154,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
154 int min_uV, int max_uV); 154 int min_uV, int max_uV);
155int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); 155int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
156int regulator_get_voltage(struct regulator *regulator); 156int regulator_get_voltage(struct regulator *regulator);
157int regulator_sync_voltage(struct regulator *regulator);
157int regulator_set_current_limit(struct regulator *regulator, 158int regulator_set_current_limit(struct regulator *regulator,
158 int min_uA, int max_uA); 159 int min_uA, int max_uA);
159int regulator_get_current_limit(struct regulator *regulator); 160int regulator_get_current_limit(struct regulator *regulator);
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 592cd7c642c2..b8ed16a33c47 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -42,7 +42,11 @@ enum regulator_status {
42 * 42 *
43 * @set_voltage: Set the voltage for the regulator within the range specified. 43 * @set_voltage: Set the voltage for the regulator within the range specified.
44 * The driver should select the voltage closest to min_uV. 44 * The driver should select the voltage closest to min_uV.
45 * @set_voltage_sel: Set the voltage for the regulator using the specified
46 * selector.
45 * @get_voltage: Return the currently configured voltage for the regulator. 47 * @get_voltage: Return the currently configured voltage for the regulator.
48 * @get_voltage_sel: Return the currently configured voltage selector for the
49 * regulator.
46 * @list_voltage: Return one of the supported voltages, in microvolts; zero 50 * @list_voltage: Return one of the supported voltages, in microvolts; zero
47 * if the selector indicates a voltage that is unusable on this system; 51 * if the selector indicates a voltage that is unusable on this system;
48 * or negative errno. Selectors range from zero to one less than 52 * or negative errno. Selectors range from zero to one less than
@@ -79,8 +83,11 @@ struct regulator_ops {
79 int (*list_voltage) (struct regulator_dev *, unsigned selector); 83 int (*list_voltage) (struct regulator_dev *, unsigned selector);
80 84
81 /* get/set regulator voltage */ 85 /* get/set regulator voltage */
82 int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); 86 int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV,
87 unsigned *selector);
88 int (*set_voltage_sel) (struct regulator_dev *, unsigned selector);
83 int (*get_voltage) (struct regulator_dev *); 89 int (*get_voltage) (struct regulator_dev *);
90 int (*get_voltage_sel) (struct regulator_dev *);
84 91
85 /* get/set regulator current */ 92 /* get/set regulator current */
86 int (*set_current_limit) (struct regulator_dev *, 93 int (*set_current_limit) (struct regulator_dev *,
@@ -168,9 +175,9 @@ struct regulator_desc {
168 */ 175 */
169struct regulator_dev { 176struct regulator_dev {
170 struct regulator_desc *desc; 177 struct regulator_desc *desc;
171 int use_count;
172 int open_count;
173 int exclusive; 178 int exclusive;
179 u32 use_count;
180 u32 open_count;
174 181
175 /* lists we belong to */ 182 /* lists we belong to */
176 struct list_head list; /* list of all regulators */ 183 struct list_head list; /* list of all regulators */
@@ -188,10 +195,14 @@ struct regulator_dev {
188 struct regulator_dev *supply; /* for tree */ 195 struct regulator_dev *supply; /* for tree */
189 196
190 void *reg_data; /* regulator_dev data */ 197 void *reg_data; /* regulator_dev data */
198
199#ifdef CONFIG_DEBUG_FS
200 struct dentry *debugfs;
201#endif
191}; 202};
192 203
193struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, 204struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
194 struct device *dev, struct regulator_init_data *init_data, 205 struct device *dev, const struct regulator_init_data *init_data,
195 void *driver_data); 206 void *driver_data);
196void regulator_unregister(struct regulator_dev *rdev); 207void regulator_unregister(struct regulator_dev *rdev);
197 208
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 0bed941f9b13..ff681ebba585 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -66,14 +66,62 @@
66 66
67#define RIO_PW_MSG_SIZE 64 67#define RIO_PW_MSG_SIZE 64
68 68
69/*
70 * A component tag value (stored in the component tag CSR) is used as device's
71 * unique identifier assigned during enumeration. Besides being used for
72 * identifying switches (which do not have device ID register), it also is used
73 * by error management notification and therefore has to be assigned
74 * to endpoints as well.
75 */
76#define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */
77#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */
78
69extern struct bus_type rio_bus_type; 79extern struct bus_type rio_bus_type;
70extern struct device rio_bus; 80extern struct device rio_bus;
71extern struct list_head rio_devices; /* list of all devices */ 81extern struct list_head rio_devices; /* list of all devices */
72 82
73struct rio_mport; 83struct rio_mport;
84struct rio_dev;
74union rio_pw_msg; 85union rio_pw_msg;
75 86
76/** 87/**
88 * struct rio_switch - RIO switch info
89 * @node: Node in global list of switches
90 * @switchid: Switch ID that is unique across a network
91 * @route_table: Copy of switch routing table
92 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
93 * @add_entry: Callback for switch-specific route add function
94 * @get_entry: Callback for switch-specific route get function
95 * @clr_table: Callback for switch-specific clear route table function
96 * @set_domain: Callback for switch-specific domain setting function
97 * @get_domain: Callback for switch-specific domain get function
98 * @em_init: Callback for switch-specific error management init function
99 * @em_handle: Callback for switch-specific error management handler function
100 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
101 * @nextdev: Array of per-port pointers to the next attached device
102 */
103struct rio_switch {
104 struct list_head node;
105 u16 switchid;
106 u8 *route_table;
107 u32 port_ok;
108 int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
109 u16 table, u16 route_destid, u8 route_port);
110 int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
111 u16 table, u16 route_destid, u8 *route_port);
112 int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
113 u16 table);
114 int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
115 u8 sw_domain);
116 int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
117 u8 *sw_domain);
118 int (*em_init) (struct rio_dev *dev);
119 int (*em_handle) (struct rio_dev *dev, u8 swport);
120 int (*sw_sysfs) (struct rio_dev *dev, int create);
121 struct rio_dev *nextdev[0];
122};
123
124/**
77 * struct rio_dev - RIO device info 125 * struct rio_dev - RIO device info
78 * @global_list: Node in list of all RIO devices 126 * @global_list: Node in list of all RIO devices
79 * @net_list: Node in list of RIO devices in a network 127 * @net_list: Node in list of RIO devices in a network
@@ -93,13 +141,14 @@ union rio_pw_msg;
93 * @phys_efptr: RIO device extended features pointer 141 * @phys_efptr: RIO device extended features pointer
94 * @em_efptr: RIO Error Management features pointer 142 * @em_efptr: RIO Error Management features pointer
95 * @dma_mask: Mask of bits of RIO address this device implements 143 * @dma_mask: Mask of bits of RIO address this device implements
96 * @rswitch: Pointer to &struct rio_switch if valid for this device
97 * @driver: Driver claiming this device 144 * @driver: Driver claiming this device
98 * @dev: Device model device 145 * @dev: Device model device
99 * @riores: RIO resources this device owns 146 * @riores: RIO resources this device owns
100 * @pwcback: port-write callback function for this device 147 * @pwcback: port-write callback function for this device
101 * @destid: Network destination ID 148 * @destid: Network destination ID (or associated destid for switch)
149 * @hopcount: Hopcount to this device
102 * @prev: Previous RIO device connected to the current one 150 * @prev: Previous RIO device connected to the current one
151 * @rswitch: struct rio_switch (if valid for this device)
103 */ 152 */
104struct rio_dev { 153struct rio_dev {
105 struct list_head global_list; /* node in list of all RIO devices */ 154 struct list_head global_list; /* node in list of all RIO devices */
@@ -120,18 +169,20 @@ struct rio_dev {
120 u32 phys_efptr; 169 u32 phys_efptr;
121 u32 em_efptr; 170 u32 em_efptr;
122 u64 dma_mask; 171 u64 dma_mask;
123 struct rio_switch *rswitch; /* RIO switch info */
124 struct rio_driver *driver; /* RIO driver claiming this device */ 172 struct rio_driver *driver; /* RIO driver claiming this device */
125 struct device dev; /* LDM device structure */ 173 struct device dev; /* LDM device structure */
126 struct resource riores[RIO_MAX_DEV_RESOURCES]; 174 struct resource riores[RIO_MAX_DEV_RESOURCES];
127 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); 175 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
128 u16 destid; 176 u16 destid;
177 u8 hopcount;
129 struct rio_dev *prev; 178 struct rio_dev *prev;
179 struct rio_switch rswitch[0]; /* RIO switch info */
130}; 180};
131 181
132#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) 182#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
133#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) 183#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
134#define to_rio_dev(n) container_of(n, struct rio_dev, dev) 184#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
185#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0])
135 186
136/** 187/**
137 * struct rio_msg - RIO message event 188 * struct rio_msg - RIO message event
@@ -224,49 +275,6 @@ struct rio_net {
224#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ 275#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
225#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ 276#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
226 277
227/**
228 * struct rio_switch - RIO switch info
229 * @node: Node in global list of switches
230 * @rdev: Associated RIO device structure
231 * @switchid: Switch ID that is unique across a network
232 * @hopcount: Hopcount to this switch
233 * @destid: Associated destid in the path
234 * @route_table: Copy of switch routing table
235 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
236 * @add_entry: Callback for switch-specific route add function
237 * @get_entry: Callback for switch-specific route get function
238 * @clr_table: Callback for switch-specific clear route table function
239 * @set_domain: Callback for switch-specific domain setting function
240 * @get_domain: Callback for switch-specific domain get function
241 * @em_init: Callback for switch-specific error management initialization function
242 * @em_handle: Callback for switch-specific error management handler function
243 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
244 * @nextdev: Array of per-port pointers to the next attached device
245 */
246struct rio_switch {
247 struct list_head node;
248 struct rio_dev *rdev;
249 u16 switchid;
250 u16 hopcount;
251 u16 destid;
252 u8 *route_table;
253 u32 port_ok;
254 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
255 u16 table, u16 route_destid, u8 route_port);
256 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
257 u16 table, u16 route_destid, u8 * route_port);
258 int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
259 u16 table);
260 int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
261 u8 sw_domain);
262 int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
263 u8 *sw_domain);
264 int (*em_init) (struct rio_dev *dev);
265 int (*em_handle) (struct rio_dev *dev, u8 swport);
266 int (*sw_sysfs) (struct rio_dev *dev, int create);
267 struct rio_dev *nextdev[0];
268};
269
270/* Low-level architecture-dependent routines */ 278/* Low-level architecture-dependent routines */
271 279
272/** 280/**
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index edc55da717b3..e09e565c4bce 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -150,16 +150,8 @@ static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset,
150static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, 150static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
151 u32 * data) 151 u32 * data)
152{ 152{
153 u8 hopcount = 0xff; 153 return rio_mport_read_config_32(rdev->net->hport, rdev->destid,
154 u16 destid = rdev->destid; 154 rdev->hopcount, offset, data);
155
156 if (rdev->rswitch) {
157 destid = rdev->rswitch->destid;
158 hopcount = rdev->rswitch->hopcount;
159 }
160
161 return rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
162 offset, data);
163}; 155};
164 156
165/** 157/**
@@ -174,16 +166,8 @@ static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
174static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, 166static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
175 u32 data) 167 u32 data)
176{ 168{
177 u8 hopcount = 0xff; 169 return rio_mport_write_config_32(rdev->net->hport, rdev->destid,
178 u16 destid = rdev->destid; 170 rdev->hopcount, offset, data);
179
180 if (rdev->rswitch) {
181 destid = rdev->rswitch->destid;
182 hopcount = rdev->rswitch->hopcount;
183 }
184
185 return rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
186 offset, data);
187}; 171};
188 172
189/** 173/**
@@ -198,16 +182,8 @@ static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
198static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, 182static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
199 u16 * data) 183 u16 * data)
200{ 184{
201 u8 hopcount = 0xff; 185 return rio_mport_read_config_16(rdev->net->hport, rdev->destid,
202 u16 destid = rdev->destid; 186 rdev->hopcount, offset, data);
203
204 if (rdev->rswitch) {
205 destid = rdev->rswitch->destid;
206 hopcount = rdev->rswitch->hopcount;
207 }
208
209 return rio_mport_read_config_16(rdev->net->hport, destid, hopcount,
210 offset, data);
211}; 187};
212 188
213/** 189/**
@@ -222,16 +198,8 @@ static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
222static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, 198static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
223 u16 data) 199 u16 data)
224{ 200{
225 u8 hopcount = 0xff; 201 return rio_mport_write_config_16(rdev->net->hport, rdev->destid,
226 u16 destid = rdev->destid; 202 rdev->hopcount, offset, data);
227
228 if (rdev->rswitch) {
229 destid = rdev->rswitch->destid;
230 hopcount = rdev->rswitch->hopcount;
231 }
232
233 return rio_mport_write_config_16(rdev->net->hport, destid, hopcount,
234 offset, data);
235}; 203};
236 204
237/** 205/**
@@ -245,16 +213,8 @@ static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
245 */ 213 */
246static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) 214static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
247{ 215{
248 u8 hopcount = 0xff; 216 return rio_mport_read_config_8(rdev->net->hport, rdev->destid,
249 u16 destid = rdev->destid; 217 rdev->hopcount, offset, data);
250
251 if (rdev->rswitch) {
252 destid = rdev->rswitch->destid;
253 hopcount = rdev->rswitch->hopcount;
254 }
255
256 return rio_mport_read_config_8(rdev->net->hport, destid, hopcount,
257 offset, data);
258}; 218};
259 219
260/** 220/**
@@ -268,16 +228,8 @@ static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
268 */ 228 */
269static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) 229static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data)
270{ 230{
271 u8 hopcount = 0xff; 231 return rio_mport_write_config_8(rdev->net->hport, rdev->destid,
272 u16 destid = rdev->destid; 232 rdev->hopcount, offset, data);
273
274 if (rdev->rswitch) {
275 destid = rdev->rswitch->destid;
276 hopcount = rdev->rswitch->hopcount;
277 }
278
279 return rio_mport_write_config_8(rdev->net->hport, destid, hopcount,
280 offset, data);
281}; 233};
282 234
283extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, 235extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid,
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index ee7b6ada188f..7410d3365e2a 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -36,5 +36,7 @@
36#define RIO_DID_IDTCPS10Q 0x035e 36#define RIO_DID_IDTCPS10Q 0x035e
37#define RIO_DID_IDTCPS1848 0x0374 37#define RIO_DID_IDTCPS1848 0x0374
38#define RIO_DID_IDTCPS1616 0x0379 38#define RIO_DID_IDTCPS1616 0x0379
39#define RIO_DID_IDTVPS1616 0x0377
40#define RIO_DID_IDTSPS1616 0x0378
39 41
40#endif /* LINUX_RIO_IDS_H */ 42#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h
index c490fbc43fe2..5f57f93b284f 100644
--- a/include/linux/romfs_fs.h
+++ b/include/linux/romfs_fs.h
@@ -1,6 +1,9 @@
1#ifndef __LINUX_ROMFS_FS_H 1#ifndef __LINUX_ROMFS_FS_H
2#define __LINUX_ROMFS_FS_H 2#define __LINUX_ROMFS_FS_H
3 3
4#include <linux/types.h>
5#include <linux/fs.h>
6
4/* The basic structures of the romfs filesystem */ 7/* The basic structures of the romfs filesystem */
5 8
6#define ROMBSIZE BLOCK_SIZE 9#define ROMBSIZE BLOCK_SIZE
diff --git a/include/linux/sched.h b/include/linux/sched.h
index abc527aa8550..96e23215e276 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -683,7 +683,7 @@ struct user_struct {
683 atomic_t fanotify_listeners; 683 atomic_t fanotify_listeners;
684#endif 684#endif
685#ifdef CONFIG_EPOLL 685#ifdef CONFIG_EPOLL
686 atomic_t epoll_watches; /* The number of file descriptors currently watched */ 686 atomic_long_t epoll_watches; /* The number of file descriptors currently watched */
687#endif 687#endif
688#ifdef CONFIG_POSIX_MQUEUE 688#ifdef CONFIG_POSIX_MQUEUE
689 /* protected by mq_lock */ 689 /* protected by mq_lock */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a23fa29d4eb0..758c5b0c6fd3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -212,6 +212,7 @@
212#include <linux/tty.h> 212#include <linux/tty.h>
213#include <linux/mutex.h> 213#include <linux/mutex.h>
214#include <linux/sysrq.h> 214#include <linux/sysrq.h>
215#include <linux/pps_kernel.h>
215 216
216struct uart_port; 217struct uart_port;
217struct serial_struct; 218struct serial_struct;
@@ -528,10 +529,10 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
528 struct uart_state *state = uport->state; 529 struct uart_state *state = uport->state;
529 struct tty_port *port = &state->port; 530 struct tty_port *port = &state->port;
530 struct tty_ldisc *ld = tty_ldisc_ref(port->tty); 531 struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
531 struct timespec ts; 532 struct pps_event_time ts;
532 533
533 if (ld && ld->ops->dcd_change) 534 if (ld && ld->ops->dcd_change)
534 getnstimeofday(&ts); 535 pps_get_ts(&ts);
535 536
536 uport->icount.dcd++; 537 uport->icount.dcd++;
537#ifdef CONFIG_HARD_PPS 538#ifdef CONFIG_HARD_PPS
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index baed2122c5a6..1630d9cae22a 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -8,6 +8,23 @@
8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
9 */ 9 */
10 10
11enum {
12 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
13 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
14 SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
15 SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
16 SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
17};
18
19#define SCSCR_TIE (1 << 7)
20#define SCSCR_RIE (1 << 6)
21#define SCSCR_TE (1 << 5)
22#define SCSCR_RE (1 << 4)
23#define SCSCR_REIE (1 << 3) /* not supported by all parts */
24#define SCSCR_TOIE (1 << 2) /* not supported by all parts */
25#define SCSCR_CKE1 (1 << 1)
26#define SCSCR_CKE0 (1 << 0)
27
11/* Offsets into the sci_port->irqs array */ 28/* Offsets into the sci_port->irqs array */
12enum { 29enum {
13 SCIx_ERI_IRQ, 30 SCIx_ERI_IRQ,
@@ -29,7 +46,12 @@ struct plat_sci_port {
29 unsigned int type; /* SCI / SCIF / IRDA */ 46 unsigned int type; /* SCI / SCIF / IRDA */
30 upf_t flags; /* UPF_* flags */ 47 upf_t flags; /* UPF_* flags */
31 char *clk; /* clock string */ 48 char *clk; /* clock string */
49
50 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
51 unsigned int scscr; /* SCSCR initialization */
52
32 struct device *dma_dev; 53 struct device *dma_dev;
54
33#ifdef CONFIG_SERIAL_SH_SCI_DMA 55#ifdef CONFIG_SERIAL_SH_SCI_DMA
34 unsigned int dma_slave_tx; 56 unsigned int dma_slave_tx;
35 unsigned int dma_slave_rx; 57 unsigned int dma_slave_rx;
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 5f65f14c4f44..edbb1d07ddf4 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -191,7 +191,8 @@ struct ucred {
191#define AF_PHONET 35 /* Phonet sockets */ 191#define AF_PHONET 35 /* Phonet sockets */
192#define AF_IEEE802154 36 /* IEEE802154 sockets */ 192#define AF_IEEE802154 36 /* IEEE802154 sockets */
193#define AF_CAIF 37 /* CAIF sockets */ 193#define AF_CAIF 37 /* CAIF sockets */
194#define AF_MAX 38 /* For now.. */ 194#define AF_ALG 38 /* Algorithm sockets */
195#define AF_MAX 39 /* For now.. */
195 196
196/* Protocol families, same as address families. */ 197/* Protocol families, same as address families. */
197#define PF_UNSPEC AF_UNSPEC 198#define PF_UNSPEC AF_UNSPEC
@@ -232,6 +233,7 @@ struct ucred {
232#define PF_PHONET AF_PHONET 233#define PF_PHONET AF_PHONET
233#define PF_IEEE802154 AF_IEEE802154 234#define PF_IEEE802154 AF_IEEE802154
234#define PF_CAIF AF_CAIF 235#define PF_CAIF AF_CAIF
236#define PF_ALG AF_ALG
235#define PF_MAX AF_MAX 237#define PF_MAX AF_MAX
236 238
237/* Maximum queue length specifiable by listen. */ 239/* Maximum queue length specifiable by listen. */
@@ -305,6 +307,7 @@ struct ucred {
305#define SOL_RDS 276 307#define SOL_RDS 276
306#define SOL_IUCV 277 308#define SOL_IUCV 277
307#define SOL_CAIF 278 309#define SOL_CAIF 278
310#define SOL_ALG 279
308 311
309/* IPX options */ 312/* IPX options */
310#define IPX_TYPE 1 313#define IPX_TYPE 1
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 144b34be5c32..c1f499835b2a 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -122,7 +122,7 @@ struct platform_suspend_ops {
122 * suspend_set_ops - set platform dependent suspend operations 122 * suspend_set_ops - set platform dependent suspend operations
123 * @ops: The new suspend operations to set. 123 * @ops: The new suspend operations to set.
124 */ 124 */
125extern void suspend_set_ops(struct platform_suspend_ops *ops); 125extern void suspend_set_ops(const struct platform_suspend_ops *ops);
126extern int suspend_valid_only_mem(suspend_state_t state); 126extern int suspend_valid_only_mem(suspend_state_t state);
127 127
128/** 128/**
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state);
147#else /* !CONFIG_SUSPEND */ 147#else /* !CONFIG_SUSPEND */
148#define suspend_valid_only_mem NULL 148#define suspend_valid_only_mem NULL
149 149
150static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} 150static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
151static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } 151static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
152#endif /* !CONFIG_SUSPEND */ 152#endif /* !CONFIG_SUSPEND */
153 153
@@ -245,7 +245,7 @@ extern void swsusp_set_page_free(struct page *);
245extern void swsusp_unset_page_free(struct page *); 245extern void swsusp_unset_page_free(struct page *);
246extern unsigned long get_safe_page(gfp_t gfp_mask); 246extern unsigned long get_safe_page(gfp_t gfp_mask);
247 247
248extern void hibernation_set_ops(struct platform_hibernation_ops *ops); 248extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
249extern int hibernate(void); 249extern int hibernate(void);
250extern bool system_entering_hibernation(void); 250extern bool system_entering_hibernation(void);
251#else /* CONFIG_HIBERNATION */ 251#else /* CONFIG_HIBERNATION */
@@ -253,7 +253,7 @@ static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
253static inline void swsusp_set_page_free(struct page *p) {} 253static inline void swsusp_set_page_free(struct page *p) {}
254static inline void swsusp_unset_page_free(struct page *p) {} 254static inline void swsusp_unset_page_free(struct page *p) {}
255 255
256static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} 256static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {}
257static inline int hibernate(void) { return -ENOSYS; } 257static inline int hibernate(void) { return -ENOSYS; }
258static inline bool system_entering_hibernation(void) { return false; } 258static inline bool system_entering_hibernation(void) { return false; }
259#endif /* CONFIG_HIBERNATION */ 259#endif /* CONFIG_HIBERNATION */
diff --git a/include/linux/time.h b/include/linux/time.h
index 9f15ac7ab92a..1e6d3b59238d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -158,6 +158,8 @@ extern unsigned int alarm_setitimer(unsigned int seconds);
158extern int do_getitimer(int which, struct itimerval *value); 158extern int do_getitimer(int which, struct itimerval *value);
159extern void getnstimeofday(struct timespec *tv); 159extern void getnstimeofday(struct timespec *tv);
160extern void getrawmonotonic(struct timespec *ts); 160extern void getrawmonotonic(struct timespec *ts);
161extern void getnstime_raw_and_real(struct timespec *ts_raw,
162 struct timespec *ts_real);
161extern void getboottime(struct timespec *ts); 163extern void getboottime(struct timespec *ts);
162extern void monotonic_to_bootbased(struct timespec *ts); 164extern void monotonic_to_bootbased(struct timespec *ts);
163 165
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 32d852f8cbe4..d23999f9499d 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -268,6 +268,7 @@ extern u64 tick_length;
268extern void second_overflow(void); 268extern void second_overflow(void);
269extern void update_ntp_one_tick(void); 269extern void update_ntp_one_tick(void);
270extern int do_adjtimex(struct timex *); 270extern int do_adjtimex(struct timex *);
271extern void hardpps(const struct timespec *, const struct timespec *);
271 272
272int read_current_timer(unsigned long *timer_val); 273int read_current_timer(unsigned long *timer_val);
273 274
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h
index 6a7c4edf0e13..772dedbc3a22 100644
--- a/include/linux/toshiba.h
+++ b/include/linux/toshiba.h
@@ -33,6 +33,8 @@ typedef struct {
33 unsigned int edi __attribute__ ((packed)); 33 unsigned int edi __attribute__ ((packed));
34} SMMRegisters; 34} SMMRegisters;
35 35
36#ifdef __KERNEL__
36int tosh_smm(SMMRegisters *regs); 37int tosh_smm(SMMRegisters *regs);
38#endif /* __KERNEL__ */
37 39
38#endif 40#endif
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 526d66f066a3..ff7dc08696a8 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -101,14 +101,15 @@
101 * any pending driver I/O is completed. 101 * any pending driver I/O is completed.
102 * 102 *
103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status, 103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status,
104 * struct timespec *ts) 104 * struct pps_event_time *ts)
105 * 105 *
106 * Tells the discipline that the DCD pin has changed its status and 106 * Tells the discipline that the DCD pin has changed its status and
107 * the relative timestamp. Pointer ts can be NULL. 107 * the relative timestamp. Pointer ts cannot be NULL.
108 */ 108 */
109 109
110#include <linux/fs.h> 110#include <linux/fs.h>
111#include <linux/wait.h> 111#include <linux/wait.h>
112#include <linux/pps_kernel.h>
112 113
113struct tty_ldisc_ops { 114struct tty_ldisc_ops {
114 int magic; 115 int magic;
@@ -143,7 +144,7 @@ struct tty_ldisc_ops {
143 char *fp, int count); 144 char *fp, int count);
144 void (*write_wakeup)(struct tty_struct *); 145 void (*write_wakeup)(struct tty_struct *);
145 void (*dcd_change)(struct tty_struct *, unsigned int, 146 void (*dcd_change)(struct tty_struct *, unsigned int,
146 struct timespec *); 147 struct pps_event_time *);
147 148
148 struct module *owner; 149 struct module *owner;
149 150
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
index fa261a0da280..8da8c4e87da3 100644
--- a/include/linux/u64_stats_sync.h
+++ b/include/linux/u64_stats_sync.h
@@ -67,21 +67,21 @@ struct u64_stats_sync {
67#endif 67#endif
68}; 68};
69 69
70static void inline u64_stats_update_begin(struct u64_stats_sync *syncp) 70static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
71{ 71{
72#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 72#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
73 write_seqcount_begin(&syncp->seq); 73 write_seqcount_begin(&syncp->seq);
74#endif 74#endif
75} 75}
76 76
77static void inline u64_stats_update_end(struct u64_stats_sync *syncp) 77static inline void u64_stats_update_end(struct u64_stats_sync *syncp)
78{ 78{
79#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 79#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
80 write_seqcount_end(&syncp->seq); 80 write_seqcount_end(&syncp->seq);
81#endif 81#endif
82} 82}
83 83
84static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp) 84static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp)
85{ 85{
86#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 86#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
87 return read_seqcount_begin(&syncp->seq); 87 return read_seqcount_begin(&syncp->seq);
@@ -93,7 +93,7 @@ static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *sy
93#endif 93#endif
94} 94}
95 95
96static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, 96static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
97 unsigned int start) 97 unsigned int start)
98{ 98{
99#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 99#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
@@ -112,7 +112,7 @@ static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
112 * - UP 32bit must disable BH. 112 * - UP 32bit must disable BH.
113 * - 64bit have no problem atomically reading u64 values, irq safe. 113 * - 64bit have no problem atomically reading u64 values, irq safe.
114 */ 114 */
115static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) 115static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp)
116{ 116{
117#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 117#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
118 return read_seqcount_begin(&syncp->seq); 118 return read_seqcount_begin(&syncp->seq);
@@ -124,7 +124,7 @@ static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync
124#endif 124#endif
125} 125}
126 126
127static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, 127static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp,
128 unsigned int start) 128 unsigned int start)
129{ 129{
130#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 130#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h
index c9a6abd972a1..c0d817de4df2 100644
--- a/include/linux/unaligned/packed_struct.h
+++ b/include/linux/unaligned/packed_struct.h
@@ -3,9 +3,9 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5 5
6struct __una_u16 { u16 x; } __attribute__((packed)); 6struct __una_u16 { u16 x; } __packed;
7struct __una_u32 { u32 x; } __attribute__((packed)); 7struct __una_u32 { u32 x; } __packed;
8struct __una_u64 { u64 x; } __attribute__((packed)); 8struct __una_u64 { u64 x; } __packed;
9 9
10static inline u16 __get_unaligned_cpu16(const void *p) 10static inline u16 __get_unaligned_cpu16(const void *p)
11{ 11{
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index 8178156711f9..faf467944baf 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -6,7 +6,7 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/err.h> 7#include <linux/err.h>
8 8
9#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) 9#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7)
10#define UIDHASH_SZ (1 << UIDHASH_BITS) 10#define UIDHASH_SZ (1 << UIDHASH_BITS)
11 11
12struct user_namespace { 12struct user_namespace {
diff --git a/include/linux/xz.h b/include/linux/xz.h
new file mode 100644
index 000000000000..64cffa6ddfce
--- /dev/null
+++ b/include/linux/xz.h
@@ -0,0 +1,264 @@
1/*
2 * XZ decompressor
3 *
4 * Authors: Lasse Collin <lasse.collin@tukaani.org>
5 * Igor Pavlov <http://7-zip.org/>
6 *
7 * This file has been put into the public domain.
8 * You can do whatever you want with this file.
9 */
10
11#ifndef XZ_H
12#define XZ_H
13
14#ifdef __KERNEL__
15# include <linux/stddef.h>
16# include <linux/types.h>
17#else
18# include <stddef.h>
19# include <stdint.h>
20#endif
21
22/* In Linux, this is used to make extern functions static when needed. */
23#ifndef XZ_EXTERN
24# define XZ_EXTERN extern
25#endif
26
27/**
28 * enum xz_mode - Operation mode
29 *
30 * @XZ_SINGLE: Single-call mode. This uses less RAM than
31 * than multi-call modes, because the LZMA2
32 * dictionary doesn't need to be allocated as
33 * part of the decoder state. All required data
34 * structures are allocated at initialization,
35 * so xz_dec_run() cannot return XZ_MEM_ERROR.
36 * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2
37 * dictionary buffer. All data structures are
38 * allocated at initialization, so xz_dec_run()
39 * cannot return XZ_MEM_ERROR.
40 * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is
41 * allocated once the required size has been
42 * parsed from the stream headers. If the
43 * allocation fails, xz_dec_run() will return
44 * XZ_MEM_ERROR.
45 *
46 * It is possible to enable support only for a subset of the above
47 * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC,
48 * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled
49 * with support for all operation modes, but the preboot code may
50 * be built with fewer features to minimize code size.
51 */
52enum xz_mode {
53 XZ_SINGLE,
54 XZ_PREALLOC,
55 XZ_DYNALLOC
56};
57
58/**
59 * enum xz_ret - Return codes
60 * @XZ_OK: Everything is OK so far. More input or more
61 * output space is required to continue. This
62 * return code is possible only in multi-call mode
63 * (XZ_PREALLOC or XZ_DYNALLOC).
64 * @XZ_STREAM_END: Operation finished successfully.
65 * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding
66 * is still possible in multi-call mode by simply
67 * calling xz_dec_run() again.
68 * Note that this return value is used only if
69 * XZ_DEC_ANY_CHECK was defined at build time,
70 * which is not used in the kernel. Unsupported
71 * check types return XZ_OPTIONS_ERROR if
72 * XZ_DEC_ANY_CHECK was not defined at build time.
73 * @XZ_MEM_ERROR: Allocating memory failed. This return code is
74 * possible only if the decoder was initialized
75 * with XZ_DYNALLOC. The amount of memory that was
76 * tried to be allocated was no more than the
77 * dict_max argument given to xz_dec_init().
78 * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than
79 * allowed by the dict_max argument given to
80 * xz_dec_init(). This return value is possible
81 * only in multi-call mode (XZ_PREALLOC or
82 * XZ_DYNALLOC); the single-call mode (XZ_SINGLE)
83 * ignores the dict_max argument.
84 * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic
85 * bytes).
86 * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested
87 * compression options. In the decoder this means
88 * that the header CRC32 matches, but the header
89 * itself specifies something that we don't support.
90 * @XZ_DATA_ERROR: Compressed data is corrupt.
91 * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly
92 * different between multi-call and single-call
93 * mode; more information below.
94 *
95 * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls
96 * to XZ code cannot consume any input and cannot produce any new output.
97 * This happens when there is no new input available, or the output buffer
98 * is full while at least one output byte is still pending. Assuming your
99 * code is not buggy, you can get this error only when decoding a compressed
100 * stream that is truncated or otherwise corrupt.
101 *
102 * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer
103 * is too small or the compressed input is corrupt in a way that makes the
104 * decoder produce more output than the caller expected. When it is
105 * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR
106 * is used instead of XZ_BUF_ERROR.
107 */
108enum xz_ret {
109 XZ_OK,
110 XZ_STREAM_END,
111 XZ_UNSUPPORTED_CHECK,
112 XZ_MEM_ERROR,
113 XZ_MEMLIMIT_ERROR,
114 XZ_FORMAT_ERROR,
115 XZ_OPTIONS_ERROR,
116 XZ_DATA_ERROR,
117 XZ_BUF_ERROR
118};
119
120/**
121 * struct xz_buf - Passing input and output buffers to XZ code
122 * @in: Beginning of the input buffer. This may be NULL if and only
123 * if in_pos is equal to in_size.
124 * @in_pos: Current position in the input buffer. This must not exceed
125 * in_size.
126 * @in_size: Size of the input buffer
127 * @out: Beginning of the output buffer. This may be NULL if and only
128 * if out_pos is equal to out_size.
129 * @out_pos: Current position in the output buffer. This must not exceed
130 * out_size.
131 * @out_size: Size of the output buffer
132 *
133 * Only the contents of the output buffer from out[out_pos] onward, and
134 * the variables in_pos and out_pos are modified by the XZ code.
135 */
136struct xz_buf {
137 const uint8_t *in;
138 size_t in_pos;
139 size_t in_size;
140
141 uint8_t *out;
142 size_t out_pos;
143 size_t out_size;
144};
145
146/**
147 * struct xz_dec - Opaque type to hold the XZ decoder state
148 */
149struct xz_dec;
150
151/**
152 * xz_dec_init() - Allocate and initialize a XZ decoder state
153 * @mode: Operation mode
154 * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for
155 * multi-call decoding. This is ignored in single-call mode
156 * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes
157 * or 2^n + 2^(n-1) bytes (the latter sizes are less common
158 * in practice), so other values for dict_max don't make sense.
159 * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB,
160 * 512 KiB, and 1 MiB are probably the only reasonable values,
161 * except for kernel and initramfs images where a bigger
162 * dictionary can be fine and useful.
163 *
164 * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at
165 * once. The caller must provide enough output space or the decoding will
166 * fail. The output space is used as the dictionary buffer, which is why
167 * there is no need to allocate the dictionary as part of the decoder's
168 * internal state.
169 *
170 * Because the output buffer is used as the workspace, streams encoded using
171 * a big dictionary are not a problem in single-call mode. It is enough that
172 * the output buffer is big enough to hold the actual uncompressed data; it
173 * can be smaller than the dictionary size stored in the stream headers.
174 *
175 * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes
176 * of memory is preallocated for the LZMA2 dictionary. This way there is no
177 * risk that xz_dec_run() could run out of memory, since xz_dec_run() will
178 * never allocate any memory. Instead, if the preallocated dictionary is too
179 * small for decoding the given input stream, xz_dec_run() will return
180 * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be
181 * decoded to avoid allocating excessive amount of memory for the dictionary.
182 *
183 * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC):
184 * dict_max specifies the maximum allowed dictionary size that xz_dec_run()
185 * may allocate once it has parsed the dictionary size from the stream
186 * headers. This way excessive allocations can be avoided while still
187 * limiting the maximum memory usage to a sane value to prevent running the
188 * system out of memory when decompressing streams from untrusted sources.
189 *
190 * On success, xz_dec_init() returns a pointer to struct xz_dec, which is
191 * ready to be used with xz_dec_run(). If memory allocation fails,
192 * xz_dec_init() returns NULL.
193 */
194XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max);
195
196/**
197 * xz_dec_run() - Run the XZ decoder
198 * @s: Decoder state allocated using xz_dec_init()
199 * @b: Input and output buffers
200 *
201 * The possible return values depend on build options and operation mode.
202 * See enum xz_ret for details.
203 *
204 * Note that if an error occurs in single-call mode (return value is not
205 * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the
206 * contents of the output buffer from b->out[b->out_pos] onward are
207 * undefined. This is true even after XZ_BUF_ERROR, because with some filter
208 * chains, there may be a second pass over the output buffer, and this pass
209 * cannot be properly done if the output buffer is truncated. Thus, you
210 * cannot give the single-call decoder a too small buffer and then expect to
211 * get that amount valid data from the beginning of the stream. You must use
212 * the multi-call decoder if you don't want to uncompress the whole stream.
213 */
214XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
215
216/**
217 * xz_dec_reset() - Reset an already allocated decoder state
218 * @s: Decoder state allocated using xz_dec_init()
219 *
220 * This function can be used to reset the multi-call decoder state without
221 * freeing and reallocating memory with xz_dec_end() and xz_dec_init().
222 *
223 * In single-call mode, xz_dec_reset() is always called in the beginning of
224 * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in
225 * multi-call mode.
226 */
227XZ_EXTERN void xz_dec_reset(struct xz_dec *s);
228
229/**
230 * xz_dec_end() - Free the memory allocated for the decoder state
231 * @s: Decoder state allocated using xz_dec_init(). If s is NULL,
232 * this function does nothing.
233 */
234XZ_EXTERN void xz_dec_end(struct xz_dec *s);
235
236/*
237 * Standalone build (userspace build or in-kernel build for boot time use)
238 * needs a CRC32 implementation. For normal in-kernel use, kernel's own
239 * CRC32 module is used instead, and users of this module don't need to
240 * care about the functions below.
241 */
242#ifndef XZ_INTERNAL_CRC32
243# ifdef __KERNEL__
244# define XZ_INTERNAL_CRC32 0
245# else
246# define XZ_INTERNAL_CRC32 1
247# endif
248#endif
249
250#if XZ_INTERNAL_CRC32
251/*
252 * This must be called before any other xz_* function to initialize
253 * the CRC32 lookup table.
254 */
255XZ_EXTERN void xz_crc32_init(void);
256
257/*
258 * Update CRC32 value using the polynomial from IEEE-802.3. To start a new
259 * calculation, the third argument must be zero. To continue the calculation,
260 * the previously returned value is passed as the third argument.
261 */
262XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc);
263#endif
264#endif
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h
index c59cc029c74a..b586495bcd53 100644
--- a/include/media/davinci/vpss.h
+++ b/include/media/davinci/vpss.h
@@ -44,7 +44,7 @@ struct vpss_pg_frame_size {
44 short pplen; 44 short pplen;
45}; 45};
46 46
47/* Used for enable/diable VPSS Clock */ 47/* Used for enable/disable VPSS Clock */
48enum vpss_clock_sel { 48enum vpss_clock_sel {
49 /* DM355/DM365 */ 49 /* DM355/DM365 */
50 VPSS_CCDC_CLOCK, 50 VPSS_CCDC_CLOCK,
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 2b2769c5ca9f..2a128c8c2718 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -99,8 +99,8 @@ typedef __s32 sctp_assoc_t;
99#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ 99#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
100/* Options 104-106 are deprecated and removed. Do not use this space */ 100/* Options 104-106 are deprecated and removed. Do not use this space */
101#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ 101#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
102#define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ 102#define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
103#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ 103#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
104#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ 104#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
105#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ 105#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
106 106
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h
index 8e9b222251c2..8a143ca79878 100644
--- a/include/scsi/fc/fc_fcp.h
+++ b/include/scsi/fc/fc_fcp.h
@@ -46,7 +46,7 @@
46 */ 46 */
47struct fcp_cmnd { 47struct fcp_cmnd {
48 __u8 fc_lun[8]; /* logical unit number */ 48 __u8 fc_lun[8]; /* logical unit number */
49 __u8 fc_cmdref; /* commmand reference number */ 49 __u8 fc_cmdref; /* command reference number */
50 __u8 fc_pri_ta; /* priority and task attribute */ 50 __u8 fc_pri_ta; /* priority and task attribute */
51 __u8 fc_tm_flags; /* task management flags */ 51 __u8 fc_tm_flags; /* task management flags */
52 __u8 fc_flags; /* additional len & flags */ 52 __u8 fc_flags; /* additional len & flags */
@@ -58,7 +58,7 @@ struct fcp_cmnd {
58 58
59struct fcp_cmnd32 { 59struct fcp_cmnd32 {
60 __u8 fc_lun[8]; /* logical unit number */ 60 __u8 fc_lun[8]; /* logical unit number */
61 __u8 fc_cmdref; /* commmand reference number */ 61 __u8 fc_cmdref; /* command reference number */
62 __u8 fc_pri_ta; /* priority and task attribute */ 62 __u8 fc_pri_ta; /* priority and task attribute */
63 __u8 fc_tm_flags; /* task management flags */ 63 __u8 fc_tm_flags; /* task management flags */
64 __u8 fc_flags; /* additional len & flags */ 64 __u8 fc_flags; /* additional len & flags */
diff --git a/include/sound/alc5623.h b/include/sound/alc5623.h
new file mode 100644
index 000000000000..422c97d43df3
--- /dev/null
+++ b/include/sound/alc5623.h
@@ -0,0 +1,15 @@
1#ifndef _INCLUDE_SOUND_ALC5623_H
2#define _INCLUDE_SOUND_ALC5623_H
3struct alc5623_platform_data {
4 /* configure : */
5 /* Lineout/Speaker Amps Vmid ratio control */
6 /* enable/disable adc/dac high pass filters */
7 unsigned int add_ctrl;
8 /* configure : */
9 /* output to enable when jack is low */
10 /* output to enable when jack is high */
11 /* jack detect (gpio/nc/jack detect [12] */
12 unsigned int jack_det_ctrl;
13};
14#endif
15
diff --git a/include/sound/asound.h b/include/sound/asound.h
index a1803ecea34d..5d6074faa279 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t;
259#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ 259#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
260#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 260#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
261#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 261#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
262#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
262#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ 263#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
263 264
264typedef int __bitwise snd_pcm_state_t; 265typedef int __bitwise snd_pcm_state_t;
@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t;
334#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME 335#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
335 336
336#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 337#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
338#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
339#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
337 340
338struct snd_interval { 341struct snd_interval {
339 unsigned int min, max; 342 unsigned int min, max;
diff --git a/include/sound/control.h b/include/sound/control.h
index 112374dc0c58..7715e6f00d38 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -160,12 +160,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id
160} 160}
161 161
162/* 162/*
163 * Frequently used control callbacks 163 * Frequently used control callbacks/helpers
164 */ 164 */
165int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, 165int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
166 struct snd_ctl_elem_info *uinfo); 166 struct snd_ctl_elem_info *uinfo);
167int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, 167int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
168 struct snd_ctl_elem_info *uinfo); 168 struct snd_ctl_elem_info *uinfo);
169int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels,
170 unsigned int items, const char *const names[]);
169 171
170/* 172/*
171 * virtual master control 173 * virtual master control
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index d98a78dff2db..0909a3843479 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -28,6 +28,7 @@ enum HDSP_IO_Type {
28 Multiface, 28 Multiface,
29 H9652, 29 H9652,
30 H9632, 30 H9632,
31 RPM,
31 Undefined, 32 Undefined,
32}; 33};
33 34
diff --git a/include/sound/minors.h b/include/sound/minors.h
index a81798ab73ed..8f764204a856 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -31,8 +31,8 @@
31/* these minors can still be used for autoloading devices (/dev/aload*) */ 31/* these minors can still be used for autoloading devices (/dev/aload*) */
32#define SNDRV_MINOR_CONTROL 0 /* 0 */ 32#define SNDRV_MINOR_CONTROL 0 /* 0 */
33#define SNDRV_MINOR_GLOBAL 1 /* 1 */ 33#define SNDRV_MINOR_GLOBAL 1 /* 1 */
34#define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) 34#define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */
35#define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) 35#define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */
36 36
37#ifndef CONFIG_SND_DYNAMIC_MINORS 37#ifndef CONFIG_SND_DYNAMIC_MINORS
38 /* 2 - 3 (reserved) */ 38 /* 2 - 3 (reserved) */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index dfd9b76b1853..e731f8d71934 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -297,6 +297,7 @@ struct snd_pcm_runtime {
297 unsigned int info; 297 unsigned int info;
298 unsigned int rate_num; 298 unsigned int rate_num;
299 unsigned int rate_den; 299 unsigned int rate_den;
300 unsigned int no_period_wakeup: 1;
300 301
301 /* -- SW params -- */ 302 /* -- SW params -- */
302 int tstamp_mode; /* mmap timestamp is updated */ 303 int tstamp_mode; /* mmap timestamp is updated */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index e7b680248006..1bafe95dcf41 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -16,8 +16,6 @@
16 16
17#include <linux/list.h> 17#include <linux/list.h>
18 18
19#include <sound/soc.h>
20
21struct snd_pcm_substream; 19struct snd_pcm_substream;
22 20
23/* 21/*
@@ -205,7 +203,7 @@ struct snd_soc_dai_driver {
205 int (*resume)(struct snd_soc_dai *dai); 203 int (*resume)(struct snd_soc_dai *dai);
206 204
207 /* ops */ 205 /* ops */
208 struct snd_soc_dai_ops *ops; 206 const struct snd_soc_dai_ops *ops;
209 207
210 /* DAI capabilities */ 208 /* DAI capabilities */
211 struct snd_soc_pcm_stream capture; 209 struct snd_soc_pcm_stream capture;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 8fd3b41b763f..8031769ac485 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -16,7 +16,6 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <sound/control.h> 18#include <sound/control.h>
19#include <sound/soc.h>
20 19
21/* widget has no PM register bit */ 20/* widget has no PM register bit */
22#define SND_SOC_NOPM -1 21#define SND_SOC_NOPM -1
@@ -72,6 +71,10 @@
72 wcontrols, wncontrols) \ 71 wcontrols, wncontrols) \
73{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 72{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
74 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 73 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
74#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
77 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
75#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 78#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
76 wcontrols, wncontrols)\ 79 wcontrols, wncontrols)\
77{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -90,6 +93,9 @@
90#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 93#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
91{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 94{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
92 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} 95 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
96#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
97{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
98 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
93#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 99#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
94{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ 100{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \
95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 101 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
@@ -116,6 +122,11 @@
116{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 122{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
117 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 123 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
118 .event = wevent, .event_flags = wflags} 124 .event = wevent, .event_flags = wflags}
125#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
126 wncontrols, wevent, wflags) \
127{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
128 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
129 .event = wevent, .event_flags = wflags}
119#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 130#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
120 wncontrols, wevent, wflags) \ 131 wncontrols, wevent, wflags) \
121{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 132{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -140,6 +151,11 @@
140{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 151{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
141 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 152 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
142 .event = wevent, .event_flags = wflags} 153 .event = wevent, .event_flags = wflags}
154#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
155 wevent, wflags) \
156{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags}
143 159
144/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 160/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
145#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 161#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
@@ -219,13 +235,6 @@
219 .info = snd_soc_info_volsw, \ 235 .info = snd_soc_info_volsw, \
220 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 236 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
221 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 237 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
222#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
223 power) \
224{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
225 .info = snd_soc_info_volsw, \
226 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
227 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
228 ((max) << 16) | ((invert) << 24) }
229#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 238#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
230{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 239{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
231 .info = snd_soc_info_volsw, \ 240 .info = snd_soc_info_volsw, \
@@ -233,15 +242,6 @@
233 .tlv.p = (tlv_array), \ 242 .tlv.p = (tlv_array), \
234 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 243 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
235 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 244 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
236#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
237 power, tlv_array) \
238{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
239 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
240 .tlv.p = (tlv_array), \
241 .info = snd_soc_info_volsw, \
242 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
243 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
244 ((max) << 16) | ((invert) << 24) }
245#define SOC_DAPM_ENUM(xname, xenum) \ 245#define SOC_DAPM_ENUM(xname, xenum) \
246{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 246{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
247 .info = snd_soc_info_enum_double, \ 247 .info = snd_soc_info_enum_double, \
@@ -297,6 +297,7 @@ enum snd_soc_dapm_type;
297struct snd_soc_dapm_path; 297struct snd_soc_dapm_path;
298struct snd_soc_dapm_pin; 298struct snd_soc_dapm_pin;
299struct snd_soc_dapm_route; 299struct snd_soc_dapm_route;
300struct snd_soc_dapm_context;
300 301
301int dapm_reg_event(struct snd_soc_dapm_widget *w, 302int dapm_reg_event(struct snd_soc_dapm_widget *w,
302 struct snd_kcontrol *kcontrol, int event); 303 struct snd_kcontrol *kcontrol, int event);
@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
324 struct snd_ctl_elem_value *uncontrol); 325 struct snd_ctl_elem_value *uncontrol);
325int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 326int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
326 struct snd_ctl_elem_value *uncontrol); 327 struct snd_ctl_elem_value *uncontrol);
327int snd_soc_dapm_new_control(struct snd_soc_codec *codec, 328int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
328 const struct snd_soc_dapm_widget *widget); 329 const struct snd_soc_dapm_widget *widget);
329int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, 330int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
330 const struct snd_soc_dapm_widget *widget, 331 const struct snd_soc_dapm_widget *widget,
331 int num); 332 int num);
332 333
333/* dapm path setup */ 334/* dapm path setup */
334int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); 335int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
335void snd_soc_dapm_free(struct snd_soc_codec *codec); 336void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
336int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, 337int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
337 const struct snd_soc_dapm_route *route, int num); 338 const struct snd_soc_dapm_route *route, int num);
338 339
339/* dapm events */ 340/* dapm events */
@@ -343,27 +344,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);
343 344
344/* dapm sys fs - used by the core */ 345/* dapm sys fs - used by the core */
345int snd_soc_dapm_sys_add(struct device *dev); 346int snd_soc_dapm_sys_add(struct device *dev);
346void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); 347void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm);
347 348
348/* dapm audio pin control and status */ 349/* dapm audio pin control and status */
349int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); 350int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm,
350int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); 351 const char *pin);
351int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); 352int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
352int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); 353 const char *pin);
353int snd_soc_dapm_sync(struct snd_soc_codec *codec); 354int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin);
354int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, 355int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
356 const char *pin);
357int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
358int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
355 const char *pin); 359 const char *pin);
356int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); 360int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
361 const char *pin);
357 362
358/* dapm widget types */ 363/* dapm widget types */
359enum snd_soc_dapm_type { 364enum snd_soc_dapm_type {
360 snd_soc_dapm_input = 0, /* input pin */ 365 snd_soc_dapm_input = 0, /* input pin */
361 snd_soc_dapm_output, /* output pin */ 366 snd_soc_dapm_output, /* output pin */
362 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 367 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
368 snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
363 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ 369 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
364 snd_soc_dapm_mixer, /* mixes several analog signals together */ 370 snd_soc_dapm_mixer, /* mixes several analog signals together */
365 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 371 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
366 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 372 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
373 snd_soc_dapm_out_drv, /* output driver */
367 snd_soc_dapm_adc, /* analog to digital converter */ 374 snd_soc_dapm_adc, /* analog to digital converter */
368 snd_soc_dapm_dac, /* digital to analog converter */ 375 snd_soc_dapm_dac, /* digital to analog converter */
369 snd_soc_dapm_micbias, /* microphone bias (power) */ 376 snd_soc_dapm_micbias, /* microphone bias (power) */
@@ -425,6 +432,7 @@ struct snd_soc_dapm_widget {
425 char *sname; /* stream name */ 432 char *sname; /* stream name */
426 struct snd_soc_codec *codec; 433 struct snd_soc_codec *codec;
427 struct list_head list; 434 struct list_head list;
435 struct snd_soc_dapm_context *dapm;
428 436
429 /* dapm control */ 437 /* dapm control */
430 short reg; /* negative reg = no direct dapm */ 438 short reg; /* negative reg = no direct dapm */
@@ -461,4 +469,35 @@ struct snd_soc_dapm_widget {
461 struct list_head power_list; 469 struct list_head power_list;
462}; 470};
463 471
472struct snd_soc_dapm_update {
473 struct snd_soc_dapm_widget *widget;
474 struct snd_kcontrol *kcontrol;
475 int reg;
476 int mask;
477 int val;
478};
479
480/* DAPM context */
481struct snd_soc_dapm_context {
482 int n_widgets; /* number of widgets in this context */
483 enum snd_soc_bias_level bias_level;
484 enum snd_soc_bias_level suspend_bias_level;
485 struct delayed_work delayed_work;
486 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
487
488 struct snd_soc_dapm_update *update;
489
490 struct device *dev; /* from parent - for debug */
491 struct snd_soc_codec *codec; /* parent codec */
492 struct snd_soc_card *card; /* parent card */
493
494 /* used during DAPM updates */
495 int dev_power;
496 struct list_head list;
497
498#ifdef CONFIG_DEBUG_FS
499 struct dentry *debugfs_dapm;
500#endif
501};
502
464#endif 503#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5c3bce83f28a..74921f20a1d8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -222,10 +222,8 @@ enum snd_soc_bias_level {
222 222
223struct snd_jack; 223struct snd_jack;
224struct snd_soc_card; 224struct snd_soc_card;
225struct snd_soc_device;
226struct snd_soc_pcm_stream; 225struct snd_soc_pcm_stream;
227struct snd_soc_ops; 226struct snd_soc_ops;
228struct snd_soc_dai_mode;
229struct snd_soc_pcm_runtime; 227struct snd_soc_pcm_runtime;
230struct snd_soc_dai; 228struct snd_soc_dai;
231struct snd_soc_dai_driver; 229struct snd_soc_dai_driver;
@@ -235,9 +233,10 @@ struct snd_soc_platform_driver;
235struct snd_soc_codec; 233struct snd_soc_codec;
236struct snd_soc_codec_driver; 234struct snd_soc_codec_driver;
237struct soc_enum; 235struct soc_enum;
238struct snd_soc_ac97_ops;
239struct snd_soc_jack; 236struct snd_soc_jack;
240struct snd_soc_jack_pin; 237struct snd_soc_jack_pin;
238struct snd_soc_cache_ops;
239#include <sound/soc-dapm.h>
241 240
242#ifdef CONFIG_GPIOLIB 241#ifdef CONFIG_GPIOLIB
243struct snd_soc_jack_gpio; 242struct snd_soc_jack_gpio;
@@ -253,17 +252,30 @@ enum snd_soc_control_type {
253 SND_SOC_SPI, 252 SND_SOC_SPI,
254}; 253};
255 254
255enum snd_soc_compress_type {
256 SND_SOC_FLAT_COMPRESSION = 1,
257 SND_SOC_LZO_COMPRESSION,
258 SND_SOC_RBTREE_COMPRESSION
259};
260
256int snd_soc_register_platform(struct device *dev, 261int snd_soc_register_platform(struct device *dev,
257 struct snd_soc_platform_driver *platform_drv); 262 struct snd_soc_platform_driver *platform_drv);
258void snd_soc_unregister_platform(struct device *dev); 263void snd_soc_unregister_platform(struct device *dev);
259int snd_soc_register_codec(struct device *dev, 264int snd_soc_register_codec(struct device *dev,
260 struct snd_soc_codec_driver *codec_drv, 265 const struct snd_soc_codec_driver *codec_drv,
261 struct snd_soc_dai_driver *dai_drv, int num_dai); 266 struct snd_soc_dai_driver *dai_drv, int num_dai);
262void snd_soc_unregister_codec(struct device *dev); 267void snd_soc_unregister_codec(struct device *dev);
263int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 268int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
264int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 269int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
265 int addr_bits, int data_bits, 270 int addr_bits, int data_bits,
266 enum snd_soc_control_type control); 271 enum snd_soc_control_type control);
272int snd_soc_cache_sync(struct snd_soc_codec *codec);
273int snd_soc_cache_init(struct snd_soc_codec *codec);
274int snd_soc_cache_exit(struct snd_soc_codec *codec);
275int snd_soc_cache_write(struct snd_soc_codec *codec,
276 unsigned int reg, unsigned int value);
277int snd_soc_cache_read(struct snd_soc_codec *codec,
278 unsigned int reg, unsigned int *value);
267 279
268/* Utility functions to get clock rates from various things */ 280/* Utility functions to get clock rates from various things */
269int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 281int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -420,23 +432,37 @@ struct snd_soc_ops {
420 int (*trigger)(struct snd_pcm_substream *, int); 432 int (*trigger)(struct snd_pcm_substream *, int);
421}; 433};
422 434
435/* SoC cache ops */
436struct snd_soc_cache_ops {
437 const char *name;
438 enum snd_soc_compress_type id;
439 int (*init)(struct snd_soc_codec *codec);
440 int (*exit)(struct snd_soc_codec *codec);
441 int (*read)(struct snd_soc_codec *codec, unsigned int reg,
442 unsigned int *value);
443 int (*write)(struct snd_soc_codec *codec, unsigned int reg,
444 unsigned int value);
445 int (*sync)(struct snd_soc_codec *codec);
446};
447
423/* SoC Audio Codec device */ 448/* SoC Audio Codec device */
424struct snd_soc_codec { 449struct snd_soc_codec {
425 const char *name; 450 const char *name;
451 const char *name_prefix;
426 int id; 452 int id;
427 struct device *dev; 453 struct device *dev;
428 struct snd_soc_codec_driver *driver; 454 const struct snd_soc_codec_driver *driver;
429 455
430 struct mutex mutex; 456 struct mutex mutex;
431 struct snd_soc_card *card; 457 struct snd_soc_card *card;
432 struct list_head list; 458 struct list_head list;
433 struct list_head card_list; 459 struct list_head card_list;
434 int num_dai; 460 int num_dai;
461 enum snd_soc_compress_type compress_type;
435 462
436 /* runtime */ 463 /* runtime */
437 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 464 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
438 unsigned int active; 465 unsigned int active;
439 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
440 unsigned int cache_only:1; /* Suppress writes to hardware */ 466 unsigned int cache_only:1; /* Suppress writes to hardware */
441 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ 467 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
442 unsigned int suspended:1; /* Codec is in suspend PM state */ 468 unsigned int suspended:1; /* Codec is in suspend PM state */
@@ -444,25 +470,25 @@ struct snd_soc_codec {
444 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 470 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
445 unsigned int ac97_created:1; /* Codec has been created by SoC */ 471 unsigned int ac97_created:1; /* Codec has been created by SoC */
446 unsigned int sysfs_registered:1; /* codec has been sysfs registered */ 472 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
473 unsigned int cache_init:1; /* codec cache has been initialized */
447 474
448 /* codec IO */ 475 /* codec IO */
449 void *control_data; /* codec control (i2c/3wire) data */ 476 void *control_data; /* codec control (i2c/3wire) data */
450 hw_write_t hw_write; 477 hw_write_t hw_write;
451 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 478 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
479 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
480 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
452 void *reg_cache; 481 void *reg_cache;
482 const void *reg_def_copy;
483 const struct snd_soc_cache_ops *cache_ops;
484 struct mutex cache_rw_mutex;
453 485
454 /* dapm */ 486 /* dapm */
455 u32 pop_time; 487 struct snd_soc_dapm_context dapm;
456 struct list_head dapm_widgets;
457 struct list_head dapm_paths;
458 enum snd_soc_bias_level bias_level;
459 enum snd_soc_bias_level suspend_bias_level;
460 struct delayed_work delayed_work;
461 488
462#ifdef CONFIG_DEBUG_FS 489#ifdef CONFIG_DEBUG_FS
463 struct dentry *debugfs_codec_root; 490 struct dentry *debugfs_codec_root;
464 struct dentry *debugfs_reg; 491 struct dentry *debugfs_reg;
465 struct dentry *debugfs_pop_time;
466 struct dentry *debugfs_dapm; 492 struct dentry *debugfs_dapm;
467#endif 493#endif
468}; 494};
@@ -488,6 +514,7 @@ struct snd_soc_codec_driver {
488 short reg_cache_step; 514 short reg_cache_step;
489 short reg_word_size; 515 short reg_word_size;
490 const void *reg_cache_default; 516 const void *reg_cache_default;
517 enum snd_soc_compress_type compress_type;
491 518
492 /* codec bias level */ 519 /* codec bias level */
493 int (*set_bias_level)(struct snd_soc_codec *, 520 int (*set_bias_level)(struct snd_soc_codec *,
@@ -554,6 +581,30 @@ struct snd_soc_dai_link {
554 struct snd_soc_ops *ops; 581 struct snd_soc_ops *ops;
555}; 582};
556 583
584struct snd_soc_codec_conf {
585 const char *dev_name;
586
587 /*
588 * optional map of kcontrol, widget and path name prefixes that are
589 * associated per device
590 */
591 const char *name_prefix;
592
593 /*
594 * set this to the desired compression type if you want to
595 * override the one supplied in codec->driver->compress_type
596 */
597 enum snd_soc_compress_type compress_type;
598};
599
600struct snd_soc_aux_dev {
601 const char *name; /* Codec name */
602 const char *codec_name; /* for multi-codec */
603
604 /* codec/machine specific init - e.g. add machine controls */
605 int (*init)(struct snd_soc_dapm_context *dapm);
606};
607
557/* SoC card */ 608/* SoC card */
558struct snd_soc_card { 609struct snd_soc_card {
559 const char *name; 610 const char *name;
@@ -579,6 +630,8 @@ struct snd_soc_card {
579 /* callbacks */ 630 /* callbacks */
580 int (*set_bias_level)(struct snd_soc_card *, 631 int (*set_bias_level)(struct snd_soc_card *,
581 enum snd_soc_bias_level level); 632 enum snd_soc_bias_level level);
633 int (*set_bias_level_post)(struct snd_soc_card *,
634 enum snd_soc_bias_level level);
582 635
583 long pmdown_time; 636 long pmdown_time;
584 637
@@ -588,12 +641,35 @@ struct snd_soc_card {
588 struct snd_soc_pcm_runtime *rtd; 641 struct snd_soc_pcm_runtime *rtd;
589 int num_rtd; 642 int num_rtd;
590 643
644 /* optional codec specific configuration */
645 struct snd_soc_codec_conf *codec_conf;
646 int num_configs;
647
648 /*
649 * optional auxiliary devices such as amplifiers or codecs with DAI
650 * link unused
651 */
652 struct snd_soc_aux_dev *aux_dev;
653 int num_aux_devs;
654 struct snd_soc_pcm_runtime *rtd_aux;
655 int num_aux_rtd;
656
591 struct work_struct deferred_resume_work; 657 struct work_struct deferred_resume_work;
592 658
593 /* lists of probed devices belonging to this card */ 659 /* lists of probed devices belonging to this card */
594 struct list_head codec_dev_list; 660 struct list_head codec_dev_list;
595 struct list_head platform_dev_list; 661 struct list_head platform_dev_list;
596 struct list_head dai_dev_list; 662 struct list_head dai_dev_list;
663
664 struct list_head widgets;
665 struct list_head paths;
666 struct list_head dapm_list;
667
668#ifdef CONFIG_DEBUG_FS
669 struct dentry *debugfs_card_root;
670 struct dentry *debugfs_pop_time;
671#endif
672 u32 pop_time;
597}; 673};
598 674
599/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 675/* SoC machine DAI configuration, glues a codec and cpu DAI together */
@@ -639,17 +715,9 @@ struct soc_enum {
639}; 715};
640 716
641/* codec IO */ 717/* codec IO */
642static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 718unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
643 unsigned int reg) 719unsigned int snd_soc_write(struct snd_soc_codec *codec,
644{ 720 unsigned int reg, unsigned int val);
645 return codec->driver->read(codec, reg);
646}
647
648static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
649 unsigned int reg, unsigned int val)
650{
651 return codec->driver->write(codec, reg, val);
652}
653 721
654/* device driver data */ 722/* device driver data */
655 723
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
new file mode 100644
index 000000000000..186e84db4b54
--- /dev/null
+++ b/include/trace/events/asoc.h
@@ -0,0 +1,235 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM asoc
3
4#if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_ASOC_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10struct snd_soc_jack;
11struct snd_soc_codec;
12struct snd_soc_card;
13struct snd_soc_dapm_widget;
14
15/*
16 * Log register events
17 */
18DECLARE_EVENT_CLASS(snd_soc_reg,
19
20 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
21 unsigned int val),
22
23 TP_ARGS(codec, reg, val),
24
25 TP_STRUCT__entry(
26 __string( name, codec->name )
27 __field( int, id )
28 __field( unsigned int, reg )
29 __field( unsigned int, val )
30 ),
31
32 TP_fast_assign(
33 __assign_str(name, codec->name);
34 __entry->id = codec->id;
35 __entry->reg = reg;
36 __entry->val = val;
37 ),
38
39 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name),
40 (int)__entry->id, (unsigned int)__entry->reg,
41 (unsigned int)__entry->val)
42);
43
44DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write,
45
46 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
47 unsigned int val),
48
49 TP_ARGS(codec, reg, val)
50
51);
52
53DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,
54
55 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
56 unsigned int val),
57
58 TP_ARGS(codec, reg, val)
59
60);
61
62DECLARE_EVENT_CLASS(snd_soc_card,
63
64 TP_PROTO(struct snd_soc_card *card, int val),
65
66 TP_ARGS(card, val),
67
68 TP_STRUCT__entry(
69 __string( name, card->name )
70 __field( int, val )
71 ),
72
73 TP_fast_assign(
74 __assign_str(name, card->name);
75 __entry->val = val;
76 ),
77
78 TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
79);
80
81DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
82
83 TP_PROTO(struct snd_soc_card *card, int val),
84
85 TP_ARGS(card, val)
86
87);
88
89DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
90
91 TP_PROTO(struct snd_soc_card *card, int val),
92
93 TP_ARGS(card, val)
94
95);
96
97DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
98
99 TP_PROTO(struct snd_soc_card *card),
100
101 TP_ARGS(card),
102
103 TP_STRUCT__entry(
104 __string( name, card->name )
105 ),
106
107 TP_fast_assign(
108 __assign_str(name, card->name);
109 ),
110
111 TP_printk("card=%s", __get_str(name))
112);
113
114DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
115
116 TP_PROTO(struct snd_soc_card *card),
117
118 TP_ARGS(card)
119
120);
121
122DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
123
124 TP_PROTO(struct snd_soc_card *card),
125
126 TP_ARGS(card)
127
128);
129
130DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
131
132 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
133
134 TP_ARGS(w, val),
135
136 TP_STRUCT__entry(
137 __string( name, w->name )
138 __field( int, val )
139 ),
140
141 TP_fast_assign(
142 __assign_str(name, w->name);
143 __entry->val = val;
144 ),
145
146 TP_printk("widget=%s val=%d", __get_str(name),
147 (int)__entry->val)
148);
149
150DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
151
152 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
153
154 TP_ARGS(w, val)
155
156);
157
158DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
159
160 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
161
162 TP_ARGS(w, val)
163
164);
165
166DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
167
168 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
169
170 TP_ARGS(w, val)
171
172);
173
174TRACE_EVENT(snd_soc_jack_irq,
175
176 TP_PROTO(const char *name),
177
178 TP_ARGS(name),
179
180 TP_STRUCT__entry(
181 __string( name, name )
182 ),
183
184 TP_fast_assign(
185 __assign_str(name, name);
186 ),
187
188 TP_printk("%s", __get_str(name))
189);
190
191TRACE_EVENT(snd_soc_jack_report,
192
193 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
194
195 TP_ARGS(jack, mask, val),
196
197 TP_STRUCT__entry(
198 __string( name, jack->jack->name )
199 __field( int, mask )
200 __field( int, val )
201 ),
202
203 TP_fast_assign(
204 __assign_str(name, jack->jack->name);
205 __entry->mask = mask;
206 __entry->val = val;
207 ),
208
209 TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
210 (int)__entry->mask)
211);
212
213TRACE_EVENT(snd_soc_jack_notify,
214
215 TP_PROTO(struct snd_soc_jack *jack, int val),
216
217 TP_ARGS(jack, val),
218
219 TP_STRUCT__entry(
220 __string( name, jack->jack->name )
221 __field( int, val )
222 ),
223
224 TP_fast_assign(
225 __assign_str(name, jack->jack->name);
226 __entry->val = val;
227 ),
228
229 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
230);
231
232#endif /* _TRACE_ASOC_H */
233
234/* This part must be outside protection */
235#include <trace/define_trace.h>
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index 6dd3a51ab1cb..46e3cd8e197a 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -6,6 +6,36 @@
6#undef TRACE_SYSTEM 6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM kvm 7#define TRACE_SYSTEM kvm
8 8
9#define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x }
10
11#define kvm_trace_exit_reason \
12 ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \
13 ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \
14 ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
15 ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
16 ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI)
17
18TRACE_EVENT(kvm_userspace_exit,
19 TP_PROTO(__u32 reason, int errno),
20 TP_ARGS(reason, errno),
21
22 TP_STRUCT__entry(
23 __field( __u32, reason )
24 __field( int, errno )
25 ),
26
27 TP_fast_assign(
28 __entry->reason = reason;
29 __entry->errno = errno;
30 ),
31
32 TP_printk("reason %s (%d)",
33 __entry->errno < 0 ?
34 (__entry->errno == -EINTR ? "restart" : "error") :
35 __print_symbolic(__entry->reason, kvm_trace_exit_reason),
36 __entry->errno < 0 ? -__entry->errno : __entry->reason)
37);
38
9#if defined(__KVM_HAVE_IOAPIC) 39#if defined(__KVM_HAVE_IOAPIC)
10TRACE_EVENT(kvm_set_irq, 40TRACE_EVENT(kvm_set_irq,
11 TP_PROTO(unsigned int gsi, int level, int irq_source_id), 41 TP_PROTO(unsigned int gsi, int level, int irq_source_id),
@@ -185,6 +215,97 @@ TRACE_EVENT(kvm_age_page,
185 __entry->referenced ? "YOUNG" : "OLD") 215 __entry->referenced ? "YOUNG" : "OLD")
186); 216);
187 217
218#ifdef CONFIG_KVM_ASYNC_PF
219DECLARE_EVENT_CLASS(kvm_async_get_page_class,
220
221 TP_PROTO(u64 gva, u64 gfn),
222
223 TP_ARGS(gva, gfn),
224
225 TP_STRUCT__entry(
226 __field(__u64, gva)
227 __field(u64, gfn)
228 ),
229
230 TP_fast_assign(
231 __entry->gva = gva;
232 __entry->gfn = gfn;
233 ),
234
235 TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn)
236);
237
238DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page,
239
240 TP_PROTO(u64 gva, u64 gfn),
241
242 TP_ARGS(gva, gfn)
243);
244
245DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault,
246
247 TP_PROTO(u64 gva, u64 gfn),
248
249 TP_ARGS(gva, gfn)
250);
251
252DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready,
253
254 TP_PROTO(u64 token, u64 gva),
255
256 TP_ARGS(token, gva),
257
258 TP_STRUCT__entry(
259 __field(__u64, token)
260 __field(__u64, gva)
261 ),
262
263 TP_fast_assign(
264 __entry->token = token;
265 __entry->gva = gva;
266 ),
267
268 TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva)
269
270);
271
272DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present,
273
274 TP_PROTO(u64 token, u64 gva),
275
276 TP_ARGS(token, gva)
277);
278
279DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready,
280
281 TP_PROTO(u64 token, u64 gva),
282
283 TP_ARGS(token, gva)
284);
285
286TRACE_EVENT(
287 kvm_async_pf_completed,
288 TP_PROTO(unsigned long address, struct page *page, u64 gva),
289 TP_ARGS(address, page, gva),
290
291 TP_STRUCT__entry(
292 __field(unsigned long, address)
293 __field(pfn_t, pfn)
294 __field(u64, gva)
295 ),
296
297 TP_fast_assign(
298 __entry->address = address;
299 __entry->pfn = page ? page_to_pfn(page) : 0;
300 __entry->gva = gva;
301 ),
302
303 TP_printk("gva %#llx address %#lx pfn %#llx", __entry->gva,
304 __entry->address, __entry->pfn)
305);
306
307#endif
308
188#endif /* _TRACE_KVM_MAIN_H */ 309#endif /* _TRACE_KVM_MAIN_H */
189 310
190/* This part must be outside protection */ 311/* This part must be outside protection */
diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h
new file mode 100644
index 000000000000..37502a7404b7
--- /dev/null
+++ b/include/trace/events/regulator.h
@@ -0,0 +1,141 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM regulator
3
4#if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_REGULATOR_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10/*
11 * Events which just log themselves and the regulator name for enable/disable
12 * type tracking.
13 */
14DECLARE_EVENT_CLASS(regulator_basic,
15
16 TP_PROTO(const char *name),
17
18 TP_ARGS(name),
19
20 TP_STRUCT__entry(
21 __string( name, name )
22 ),
23
24 TP_fast_assign(
25 __assign_str(name, name);
26 ),
27
28 TP_printk("name=%s", __get_str(name))
29
30);
31
32DEFINE_EVENT(regulator_basic, regulator_enable,
33
34 TP_PROTO(const char *name),
35
36 TP_ARGS(name)
37
38);
39
40DEFINE_EVENT(regulator_basic, regulator_enable_delay,
41
42 TP_PROTO(const char *name),
43
44 TP_ARGS(name)
45
46);
47
48DEFINE_EVENT(regulator_basic, regulator_enable_complete,
49
50 TP_PROTO(const char *name),
51
52 TP_ARGS(name)
53
54);
55
56DEFINE_EVENT(regulator_basic, regulator_disable,
57
58 TP_PROTO(const char *name),
59
60 TP_ARGS(name)
61
62);
63
64DEFINE_EVENT(regulator_basic, regulator_disable_complete,
65
66 TP_PROTO(const char *name),
67
68 TP_ARGS(name)
69
70);
71
72/*
73 * Events that take a range of numerical values, mostly for voltages
74 * and so on.
75 */
76DECLARE_EVENT_CLASS(regulator_range,
77
78 TP_PROTO(const char *name, int min, int max),
79
80 TP_ARGS(name, min, max),
81
82 TP_STRUCT__entry(
83 __string( name, name )
84 __field( int, min )
85 __field( int, max )
86 ),
87
88 TP_fast_assign(
89 __assign_str(name, name);
90 __entry->min = min;
91 __entry->max = max;
92 ),
93
94 TP_printk("name=%s (%d-%d)", __get_str(name),
95 (int)__entry->min, (int)__entry->max)
96);
97
98DEFINE_EVENT(regulator_range, regulator_set_voltage,
99
100 TP_PROTO(const char *name, int min, int max),
101
102 TP_ARGS(name, min, max)
103
104);
105
106
107/*
108 * Events that take a single value, mostly for readback and refcounts.
109 */
110DECLARE_EVENT_CLASS(regulator_value,
111
112 TP_PROTO(const char *name, unsigned int val),
113
114 TP_ARGS(name, val),
115
116 TP_STRUCT__entry(
117 __string( name, name )
118 __field( unsigned int, val )
119 ),
120
121 TP_fast_assign(
122 __assign_str(name, name);
123 __entry->val = val;
124 ),
125
126 TP_printk("name=%s, val=%u", __get_str(name),
127 (int)__entry->val)
128);
129
130DEFINE_EVENT(regulator_value, regulator_set_voltage_complete,
131
132 TP_PROTO(const char *name, unsigned int value),
133
134 TP_ARGS(name, value)
135
136);
137
138#endif /* _TRACE_POWER_H */
139
140/* This part must be outside protection */
141#include <trace/define_trace.h>