aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/errno.h2
-rw-r--r--include/asm-generic/user.h4
-rw-r--r--include/linux/amba/bus.h8
-rw-r--r--include/linux/amba/mmci.h17
-rw-r--r--include/linux/cpufreq.h11
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/firewire.h7
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/hid-roccat.h29
-rw-r--r--include/linux/hid.h5
-rw-r--r--include/linux/hidraw.h3
-rw-r--r--include/linux/hwspinlock.h292
-rw-r--r--include/linux/i2c-tegra.h25
-rw-r--r--include/linux/i2c/max6639.h14
-rw-r--r--include/linux/i2c/pmbus.h45
-rw-r--r--include/linux/i2c/twl.h2
-rw-r--r--include/linux/kvm_host.h31
-rw-r--r--include/linux/mfd/ti_ssp.h93
-rw-r--r--include/linux/mfd/wm8994/pdata.h12
-rw-r--r--include/linux/mfd/wm8994/registers.h2
-rw-r--r--include/linux/mm.h24
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/msm_mdp.h1
-rw-r--r--include/linux/mtd/onenand_regs.h1
-rw-r--r--include/linux/mtd/ubi.h22
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_fs_sb.h4
-rw-r--r--include/linux/nfs_idmap.h9
-rw-r--r--include/linux/nfs_iostat.h2
-rw-r--r--include/linux/nfs_page.h6
-rw-r--r--include/linux/nfs_xdr.h16
-rw-r--r--include/linux/oprofile.h7
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/perf_event.h2
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/xprt.h3
-rw-r--r--include/scsi/fc/fc_ns.h11
-rw-r--r--include/scsi/fc_encode.h26
-rw-r--r--include/scsi/libfc.h74
-rw-r--r--include/scsi/libfcoe.h105
-rw-r--r--include/scsi/libiscsi.h8
-rw-r--r--include/scsi/scsi.h5
-rw-r--r--include/scsi/scsi_device.h1
-rw-r--r--include/scsi/scsi_transport_iscsi.h6
-rw-r--r--include/sound/ac97_codec.h5
-rw-r--r--include/sound/control.h2
-rw-r--r--include/sound/cs4271.h24
-rw-r--r--include/sound/hdspm.h179
-rw-r--r--include/sound/mixer_oss.h3
-rw-r--r--include/sound/pcm.h91
-rw-r--r--include/sound/sh_fsi.h76
-rw-r--r--include/sound/soc-dapm.h16
-rw-r--r--include/sound/soc.h147
-rw-r--r--include/sound/tlv320aic32x4.h31
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wm8903.h20
-rw-r--r--include/sound/wm9081.h9
-rw-r--r--include/trace/events/asoc.h25
-rw-r--r--include/trace/events/scsi.h28
-rw-r--r--include/xen/balloon.h25
-rw-r--r--include/xen/events.h24
-rw-r--r--include/xen/gntalloc.h82
-rw-r--r--include/xen/gntdev.h31
-rw-r--r--include/xen/interface/sched.h34
-rw-r--r--include/xen/xenbus.h2
66 files changed, 1549 insertions, 256 deletions
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h
index 28cc03bf19e6..a1331ce50445 100644
--- a/include/asm-generic/errno.h
+++ b/include/asm-generic/errno.h
@@ -108,4 +108,6 @@
108 108
109#define ERFKILL 132 /* Operation not possible due to RF-kill */ 109#define ERFKILL 132 /* Operation not possible due to RF-kill */
110 110
111#define EHWPOISON 133 /* Memory page has hardware error */
112
111#endif 113#endif
diff --git a/include/asm-generic/user.h b/include/asm-generic/user.h
index 8b9c3c960aeb..35638c34700f 100644
--- a/include/asm-generic/user.h
+++ b/include/asm-generic/user.h
@@ -1,8 +1,8 @@
1#ifndef __ASM_GENERIC_USER_H 1#ifndef __ASM_GENERIC_USER_H
2#define __ASM_GENERIC_USER_H 2#define __ASM_GENERIC_USER_H
3/* 3/*
4 * This file may define a 'struct user' structure. However, it it only 4 * This file may define a 'struct user' structure. However, it is only
5 * used for a.out file, which are not supported on new architectures. 5 * used for a.out files, which are not supported on new architectures.
6 */ 6 */
7 7
8#endif /* __ASM_GENERIC_USER_H */ 8#endif /* __ASM_GENERIC_USER_H */
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 9e7f259346e1..fcbbe71a3cc1 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -43,12 +43,12 @@ struct amba_id {
43 43
44struct amba_driver { 44struct amba_driver {
45 struct device_driver drv; 45 struct device_driver drv;
46 int (*probe)(struct amba_device *, struct amba_id *); 46 int (*probe)(struct amba_device *, const struct amba_id *);
47 int (*remove)(struct amba_device *); 47 int (*remove)(struct amba_device *);
48 void (*shutdown)(struct amba_device *); 48 void (*shutdown)(struct amba_device *);
49 int (*suspend)(struct amba_device *, pm_message_t); 49 int (*suspend)(struct amba_device *, pm_message_t);
50 int (*resume)(struct amba_device *); 50 int (*resume)(struct amba_device *);
51 struct amba_id *id_table; 51 const struct amba_id *id_table;
52}; 52};
53 53
54enum amba_vendor { 54enum amba_vendor {
@@ -56,6 +56,10 @@ enum amba_vendor {
56 AMBA_VENDOR_ST = 0x80, 56 AMBA_VENDOR_ST = 0x80,
57}; 57};
58 58
59extern struct bus_type amba_bustype;
60
61#define to_amba_device(d) container_of(d, struct amba_device, dev)
62
59#define amba_get_drvdata(d) dev_get_drvdata(&d->dev) 63#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
60#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) 64#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
61 65
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index f4ee9acc9721..f60227088b7b 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -6,6 +6,9 @@
6 6
7#include <linux/mmc/host.h> 7#include <linux/mmc/host.h>
8 8
9/* Just some dummy forwarding */
10struct dma_chan;
11
9/** 12/**
10 * struct mmci_platform_data - platform configuration for the MMCI 13 * struct mmci_platform_data - platform configuration for the MMCI
11 * (also known as PL180) block. 14 * (also known as PL180) block.
@@ -27,6 +30,17 @@
27 * @cd_invert: true if the gpio_cd pin value is active low 30 * @cd_invert: true if the gpio_cd pin value is active low
28 * @capabilities: the capabilities of the block as implemented in 31 * @capabilities: the capabilities of the block as implemented in
29 * this platform, signify anything MMC_CAP_* from mmc/host.h 32 * this platform, signify anything MMC_CAP_* from mmc/host.h
33 * @dma_filter: function used to select an apropriate RX and TX
34 * DMA channel to be used for DMA, if and only if you're deploying the
35 * generic DMA engine
36 * @dma_rx_param: parameter passed to the DMA allocation
37 * filter in order to select an apropriate RX channel. If
38 * there is a bidirectional RX+TX channel, then just specify
39 * this and leave dma_tx_param set to NULL
40 * @dma_tx_param: parameter passed to the DMA allocation
41 * filter in order to select an apropriate TX channel. If this
42 * is NULL the driver will attempt to use the RX channel as a
43 * bidirectional channel
30 */ 44 */
31struct mmci_platform_data { 45struct mmci_platform_data {
32 unsigned int f_max; 46 unsigned int f_max;
@@ -38,6 +52,9 @@ struct mmci_platform_data {
38 int gpio_cd; 52 int gpio_cd;
39 bool cd_invert; 53 bool cd_invert;
40 unsigned long capabilities; 54 unsigned long capabilities;
55 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
56 void *dma_rx_param;
57 void *dma_tx_param;
41}; 58};
42 59
43#endif 60#endif
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c3e9de8321c6..9343dd3de858 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -230,7 +230,7 @@ struct cpufreq_driver {
230 int (*bios_limit) (int cpu, unsigned int *limit); 230 int (*bios_limit) (int cpu, unsigned int *limit);
231 231
232 int (*exit) (struct cpufreq_policy *policy); 232 int (*exit) (struct cpufreq_policy *policy);
233 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 233 int (*suspend) (struct cpufreq_policy *policy);
234 int (*resume) (struct cpufreq_policy *policy); 234 int (*resume) (struct cpufreq_policy *policy);
235 struct freq_attr **attr; 235 struct freq_attr **attr;
236}; 236};
@@ -281,19 +281,10 @@ __ATTR(_name, 0444, show_##_name, NULL)
281static struct freq_attr _name = \ 281static struct freq_attr _name = \
282__ATTR(_name, _perm, show_##_name, NULL) 282__ATTR(_name, _perm, show_##_name, NULL)
283 283
284#define cpufreq_freq_attr_ro_old(_name) \
285static struct freq_attr _name##_old = \
286__ATTR(_name, 0444, show_##_name##_old, NULL)
287
288#define cpufreq_freq_attr_rw(_name) \ 284#define cpufreq_freq_attr_rw(_name) \
289static struct freq_attr _name = \ 285static struct freq_attr _name = \
290__ATTR(_name, 0644, show_##_name, store_##_name) 286__ATTR(_name, 0644, show_##_name, store_##_name)
291 287
292#define cpufreq_freq_attr_rw_old(_name) \
293static struct freq_attr _name##_old = \
294__ATTR(_name, 0644, show_##_name##_old, store_##_name##_old)
295
296
297struct global_attr { 288struct global_attr {
298 struct attribute attr; 289 struct attribute attr;
299 ssize_t (*show)(struct kobject *kobj, 290 ssize_t (*show)(struct kobject *kobj,
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index f958c19e3ca5..1a87760d6532 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -168,7 +168,7 @@ struct dentry_operations {
168 void (*d_iput)(struct dentry *, struct inode *); 168 void (*d_iput)(struct dentry *, struct inode *);
169 char *(*d_dname)(struct dentry *, char *, int); 169 char *(*d_dname)(struct dentry *, char *, int);
170 struct vfsmount *(*d_automount)(struct path *); 170 struct vfsmount *(*d_automount)(struct path *);
171 int (*d_manage)(struct dentry *, bool, bool); 171 int (*d_manage)(struct dentry *, bool);
172} ____cacheline_aligned; 172} ____cacheline_aligned;
173 173
174/* 174/*
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 9a3f5f9383f6..fc023d67676f 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -42,6 +42,10 @@
42#define CSR_BROADCAST_CHANNEL 0x234 42#define CSR_BROADCAST_CHANNEL 0x234
43#define CSR_CONFIG_ROM 0x400 43#define CSR_CONFIG_ROM 0x400
44#define CSR_CONFIG_ROM_END 0x800 44#define CSR_CONFIG_ROM_END 0x800
45#define CSR_OMPR 0x900
46#define CSR_OPCR(i) (0x904 + (i) * 4)
47#define CSR_IMPR 0x980
48#define CSR_IPCR(i) (0x984 + (i) * 4)
45#define CSR_FCP_COMMAND 0xB00 49#define CSR_FCP_COMMAND 0xB00
46#define CSR_FCP_RESPONSE 0xD00 50#define CSR_FCP_RESPONSE 0xD00
47#define CSR_FCP_END 0xF00 51#define CSR_FCP_END 0xF00
@@ -441,5 +445,8 @@ int fw_iso_context_start(struct fw_iso_context *ctx,
441 int cycle, int sync, int tags); 445 int cycle, int sync, int tags);
442int fw_iso_context_stop(struct fw_iso_context *ctx); 446int fw_iso_context_stop(struct fw_iso_context *ctx);
443void fw_iso_context_destroy(struct fw_iso_context *ctx); 447void fw_iso_context_destroy(struct fw_iso_context *ctx);
448void fw_iso_resource_manage(struct fw_card *card, int generation,
449 u64 channels_mask, int *channel, int *bandwidth,
450 bool allocate, __be32 buffer[2]);
444 451
445#endif /* _LINUX_FIREWIRE_H */ 452#endif /* _LINUX_FIREWIRE_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 92f7e04aea11..7061a8587ee3 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1839,7 +1839,6 @@ extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1839 const struct super_operations *ops, 1839 const struct super_operations *ops,
1840 const struct dentry_operations *dops, 1840 const struct dentry_operations *dops,
1841 unsigned long); 1841 unsigned long);
1842extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1843 1842
1844static inline void sb_mark_dirty(struct super_block *sb) 1843static inline void sb_mark_dirty(struct super_block *sb)
1845{ 1844{
diff --git a/include/linux/hid-roccat.h b/include/linux/hid-roccat.h
new file mode 100644
index 000000000000..24e1ca01f9a0
--- /dev/null
+++ b/include/linux/hid-roccat.h
@@ -0,0 +1,29 @@
1#ifndef __HID_ROCCAT_H
2#define __HID_ROCCAT_H
3
4/*
5 * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 */
14
15#include <linux/hid.h>
16#include <linux/types.h>
17
18#define ROCCATIOCGREPSIZE _IOR('H', 0xf1, int)
19
20#ifdef __KERNEL__
21
22int roccat_connect(struct class *klass, struct hid_device *hid,
23 int report_size);
24void roccat_disconnect(int minor);
25int roccat_report_event(int minor, u8 const *data);
26
27#endif
28
29#endif
diff --git a/include/linux/hid.h b/include/linux/hid.h
index d91c25e253c8..bb29bb1dbd2f 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -504,6 +504,9 @@ struct hid_device { /* device report descriptor */
504 struct hid_usage *, __s32); 504 struct hid_usage *, __s32);
505 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 505 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
506 506
507 /* handler for raw input (Get_Report) data, used by hidraw */
508 int (*hid_get_raw_report) (struct hid_device *, unsigned char, __u8 *, size_t, unsigned char);
509
507 /* handler for raw output data, used by hidraw */ 510 /* handler for raw output data, used by hidraw */
508 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); 511 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char);
509 512
@@ -638,7 +641,7 @@ struct hid_driver {
638 struct hid_input *hidinput, struct hid_field *field, 641 struct hid_input *hidinput, struct hid_field *field,
639 struct hid_usage *usage, unsigned long **bit, int *max); 642 struct hid_usage *usage, unsigned long **bit, int *max);
640 void (*feature_mapping)(struct hid_device *hdev, 643 void (*feature_mapping)(struct hid_device *hdev,
641 struct hid_input *hidinput, struct hid_field *field, 644 struct hid_field *field,
642 struct hid_usage *usage); 645 struct hid_usage *usage);
643#ifdef CONFIG_PM 646#ifdef CONFIG_PM
644 int (*suspend)(struct hid_device *hdev, pm_message_t message); 647 int (*suspend)(struct hid_device *hdev, pm_message_t message);
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index dd8d69269176..4b88e697c4e9 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -35,6 +35,9 @@ struct hidraw_devinfo {
35#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) 35#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
36#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) 36#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
37#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) 37#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
38/* The first byte of SFEATURE and GFEATURE is the report number */
39#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
40#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
38 41
39#define HIDRAW_FIRST_MINOR 0 42#define HIDRAW_FIRST_MINOR 0
40#define HIDRAW_MAX_DEVICES 64 43#define HIDRAW_MAX_DEVICES 64
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
new file mode 100644
index 000000000000..8390efc457eb
--- /dev/null
+++ b/include/linux/hwspinlock.h
@@ -0,0 +1,292 @@
1/*
2 * Hardware spinlock public header
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#ifndef __LINUX_HWSPINLOCK_H
19#define __LINUX_HWSPINLOCK_H
20
21#include <linux/err.h>
22#include <linux/sched.h>
23
24/* hwspinlock mode argument */
25#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
26#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
27
28struct hwspinlock;
29
30#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
31
32int hwspin_lock_register(struct hwspinlock *lock);
33struct hwspinlock *hwspin_lock_unregister(unsigned int id);
34struct hwspinlock *hwspin_lock_request(void);
35struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
36int hwspin_lock_free(struct hwspinlock *hwlock);
37int hwspin_lock_get_id(struct hwspinlock *hwlock);
38int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
39 unsigned long *);
40int __hwspin_trylock(struct hwspinlock *, int, unsigned long *);
41void __hwspin_unlock(struct hwspinlock *, int, unsigned long *);
42
43#else /* !CONFIG_HWSPINLOCK */
44
45/*
46 * We don't want these functions to fail if CONFIG_HWSPINLOCK is not
47 * enabled. We prefer to silently succeed in this case, and let the
48 * code path get compiled away. This way, if CONFIG_HWSPINLOCK is not
49 * required on a given setup, users will still work.
50 *
51 * The only exception is hwspin_lock_register/hwspin_lock_unregister, with which
52 * we _do_ want users to fail (no point in registering hwspinlock instances if
53 * the framework is not available).
54 *
55 * Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
56 * users. Others, which care, can still check this with IS_ERR.
57 */
58static inline struct hwspinlock *hwspin_lock_request(void)
59{
60 return ERR_PTR(-ENODEV);
61}
62
63static inline struct hwspinlock *hwspin_lock_request_specific(unsigned int id)
64{
65 return ERR_PTR(-ENODEV);
66}
67
68static inline int hwspin_lock_free(struct hwspinlock *hwlock)
69{
70 return 0;
71}
72
73static inline
74int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to,
75 int mode, unsigned long *flags)
76{
77 return 0;
78}
79
80static inline
81int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
82{
83 return 0;
84}
85
86static inline
87void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
88{
89 return 0;
90}
91
92static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
93{
94 return 0;
95}
96
97static inline int hwspin_lock_register(struct hwspinlock *hwlock)
98{
99 return -ENODEV;
100}
101
102static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id)
103{
104 return NULL;
105}
106
107#endif /* !CONFIG_HWSPINLOCK */
108
109/**
110 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
111 * @hwlock: an hwspinlock which we want to trylock
112 * @flags: a pointer to where the caller's interrupt state will be saved at
113 *
114 * This function attempts to lock the underlying hwspinlock, and will
115 * immediately fail if the hwspinlock is already locked.
116 *
117 * Upon a successful return from this function, preemption and local
118 * interrupts are disabled (previous interrupts state is saved at @flags),
119 * so the caller must not sleep, and is advised to release the hwspinlock
120 * as soon as possible.
121 *
122 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
123 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
124 */
125static inline
126int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags)
127{
128 return __hwspin_trylock(hwlock, HWLOCK_IRQSTATE, flags);
129}
130
131/**
132 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
133 * @hwlock: an hwspinlock which we want to trylock
134 *
135 * This function attempts to lock the underlying hwspinlock, and will
136 * immediately fail if the hwspinlock is already locked.
137 *
138 * Upon a successful return from this function, preemption and local
139 * interrupts are disabled, so the caller must not sleep, and is advised
140 * to release the hwspinlock as soon as possible.
141 *
142 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
143 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
144 */
145static inline int hwspin_trylock_irq(struct hwspinlock *hwlock)
146{
147 return __hwspin_trylock(hwlock, HWLOCK_IRQ, NULL);
148}
149
150/**
151 * hwspin_trylock() - attempt to lock a specific hwspinlock
152 * @hwlock: an hwspinlock which we want to trylock
153 *
154 * This function attempts to lock an hwspinlock, and will immediately fail
155 * if the hwspinlock is already taken.
156 *
157 * Upon a successful return from this function, preemption is disabled,
158 * so the caller must not sleep, and is advised to release the hwspinlock
159 * as soon as possible. This is required in order to minimize remote cores
160 * polling on the hardware interconnect.
161 *
162 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
163 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
164 */
165static inline int hwspin_trylock(struct hwspinlock *hwlock)
166{
167 return __hwspin_trylock(hwlock, 0, NULL);
168}
169
170/**
171 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
172 * @hwlock: the hwspinlock to be locked
173 * @to: timeout value in msecs
174 * @flags: a pointer to where the caller's interrupt state will be saved at
175 *
176 * This function locks the underlying @hwlock. If the @hwlock
177 * is already taken, the function will busy loop waiting for it to
178 * be released, but give up when @timeout msecs have elapsed.
179 *
180 * Upon a successful return from this function, preemption and local interrupts
181 * are disabled (plus previous interrupt state is saved), so the caller must
182 * not sleep, and is advised to release the hwspinlock as soon as possible.
183 *
184 * Returns 0 when the @hwlock was successfully taken, and an appropriate
185 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
186 * busy after @timeout msecs). The function will never sleep.
187 */
188static inline int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock,
189 unsigned int to, unsigned long *flags)
190{
191 return __hwspin_lock_timeout(hwlock, to, HWLOCK_IRQSTATE, flags);
192}
193
194/**
195 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
196 * @hwlock: the hwspinlock to be locked
197 * @to: timeout value in msecs
198 *
199 * This function locks the underlying @hwlock. If the @hwlock
200 * is already taken, the function will busy loop waiting for it to
201 * be released, but give up when @timeout msecs have elapsed.
202 *
203 * Upon a successful return from this function, preemption and local interrupts
204 * are disabled so the caller must not sleep, and is advised to release the
205 * hwspinlock as soon as possible.
206 *
207 * Returns 0 when the @hwlock was successfully taken, and an appropriate
208 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
209 * busy after @timeout msecs). The function will never sleep.
210 */
211static inline
212int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int to)
213{
214 return __hwspin_lock_timeout(hwlock, to, HWLOCK_IRQ, NULL);
215}
216
217/**
218 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
219 * @hwlock: the hwspinlock to be locked
220 * @to: timeout value in msecs
221 *
222 * This function locks the underlying @hwlock. If the @hwlock
223 * is already taken, the function will busy loop waiting for it to
224 * be released, but give up when @timeout msecs have elapsed.
225 *
226 * Upon a successful return from this function, preemption is disabled
227 * so the caller must not sleep, and is advised to release the hwspinlock
228 * as soon as possible.
229 * This is required in order to minimize remote cores polling on the
230 * hardware interconnect.
231 *
232 * Returns 0 when the @hwlock was successfully taken, and an appropriate
233 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
234 * busy after @timeout msecs). The function will never sleep.
235 */
236static inline
237int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to)
238{
239 return __hwspin_lock_timeout(hwlock, to, 0, NULL);
240}
241
242/**
243 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
244 * @hwlock: a previously-acquired hwspinlock which we want to unlock
245 * @flags: previous caller's interrupt state to restore
246 *
247 * This function will unlock a specific hwspinlock, enable preemption and
248 * restore the previous state of the local interrupts. It should be used
249 * to undo, e.g., hwspin_trylock_irqsave().
250 *
251 * @hwlock must be already locked before calling this function: it is a bug
252 * to call unlock on a @hwlock that is already unlocked.
253 */
254static inline void hwspin_unlock_irqrestore(struct hwspinlock *hwlock,
255 unsigned long *flags)
256{
257 __hwspin_unlock(hwlock, HWLOCK_IRQSTATE, flags);
258}
259
260/**
261 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
262 * @hwlock: a previously-acquired hwspinlock which we want to unlock
263 *
264 * This function will unlock a specific hwspinlock, enable preemption and
265 * enable local interrupts. Should be used to undo hwspin_lock_irq().
266 *
267 * @hwlock must be already locked (e.g. by hwspin_trylock_irq()) before
268 * calling this function: it is a bug to call unlock on a @hwlock that is
269 * already unlocked.
270 */
271static inline void hwspin_unlock_irq(struct hwspinlock *hwlock)
272{
273 __hwspin_unlock(hwlock, HWLOCK_IRQ, NULL);
274}
275
276/**
277 * hwspin_unlock() - unlock hwspinlock
278 * @hwlock: a previously-acquired hwspinlock which we want to unlock
279 *
280 * This function will unlock a specific hwspinlock and enable preemption
281 * back.
282 *
283 * @hwlock must be already locked (e.g. by hwspin_trylock()) before calling
284 * this function: it is a bug to call unlock on a @hwlock that is already
285 * unlocked.
286 */
287static inline void hwspin_unlock(struct hwspinlock *hwlock)
288{
289 __hwspin_unlock(hwlock, 0, NULL);
290}
291
292#endif /* __LINUX_HWSPINLOCK_H */
diff --git a/include/linux/i2c-tegra.h b/include/linux/i2c-tegra.h
new file mode 100644
index 000000000000..9c85da49857a
--- /dev/null
+++ b/include/linux/i2c-tegra.h
@@ -0,0 +1,25 @@
1/*
2 * drivers/i2c/busses/i2c-tegra.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Author: Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef _LINUX_I2C_TEGRA_H
19#define _LINUX_I2C_TEGRA_H
20
21struct tegra_i2c_platform_data {
22 unsigned long bus_clk_rate;
23};
24
25#endif /* _LINUX_I2C_TEGRA_H */
diff --git a/include/linux/i2c/max6639.h b/include/linux/i2c/max6639.h
new file mode 100644
index 000000000000..6011c42034da
--- /dev/null
+++ b/include/linux/i2c/max6639.h
@@ -0,0 +1,14 @@
1#ifndef _LINUX_MAX6639_H
2#define _LINUX_MAX6639_H
3
4#include <linux/types.h>
5
6/* platform data for the MAX6639 temperature sensor and fan control */
7
8struct max6639_platform_data {
9 bool pwm_polarity; /* Polarity low (0) or high (1, default) */
10 int ppr; /* Pulses per rotation 1..4 (default == 2) */
11 int rpm_range; /* 2000, 4000 (default), 8000 or 16000 */
12};
13
14#endif /* _LINUX_MAX6639_H */
diff --git a/include/linux/i2c/pmbus.h b/include/linux/i2c/pmbus.h
new file mode 100644
index 000000000000..69280db02c41
--- /dev/null
+++ b/include/linux/i2c/pmbus.h
@@ -0,0 +1,45 @@
1/*
2 * Hardware monitoring driver for PMBus devices
3 *
4 * Copyright (c) 2010, 2011 Ericsson AB.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _PMBUS_H_
22#define _PMBUS_H_
23
24/* flags */
25
26/*
27 * PMBUS_SKIP_STATUS_CHECK
28 *
29 * During register detection, skip checking the status register for
30 * communication or command errors.
31 *
32 * Some PMBus chips respond with valid data when trying to read an unsupported
33 * register. For such chips, checking the status register is mandatory when
34 * trying to determine if a chip register exists or not.
35 * Other PMBus chips don't support the STATUS_CML register, or report
36 * communication errors for no explicable reason. For such chips, checking
37 * the status register must be disabled.
38 */
39#define PMBUS_SKIP_STATUS_CHECK (1 << 0)
40
41struct pmbus_platform_data {
42 u32 flags; /* Device specific flags */
43};
44
45#endif /* _PMBUS_H_ */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index a4bd05b7bd22..58afd9d2c438 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -639,7 +639,6 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
639extern int twl4030_remove_script(u8 flags); 639extern int twl4030_remove_script(u8 flags);
640 640
641struct twl4030_codec_audio_data { 641struct twl4030_codec_audio_data {
642 unsigned int audio_mclk; /* not used, will be removed */
643 unsigned int digimic_delay; /* in ms */ 642 unsigned int digimic_delay; /* in ms */
644 unsigned int ramp_delay_value; 643 unsigned int ramp_delay_value;
645 unsigned int offset_cncl_path; 644 unsigned int offset_cncl_path;
@@ -650,7 +649,6 @@ struct twl4030_codec_audio_data {
650}; 649};
651 650
652struct twl4030_codec_vibra_data { 651struct twl4030_codec_vibra_data {
653 unsigned int audio_mclk;
654 unsigned int coexist; 652 unsigned int coexist;
655}; 653};
656 654
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b5021db21858..ab428552af8e 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -43,6 +43,7 @@
43#define KVM_REQ_DEACTIVATE_FPU 10 43#define KVM_REQ_DEACTIVATE_FPU 10
44#define KVM_REQ_EVENT 11 44#define KVM_REQ_EVENT 11
45#define KVM_REQ_APF_HALT 12 45#define KVM_REQ_APF_HALT 12
46#define KVM_REQ_NMI 13
46 47
47#define KVM_USERSPACE_IRQ_SOURCE_ID 0 48#define KVM_USERSPACE_IRQ_SOURCE_ID 0
48 49
@@ -98,23 +99,31 @@ int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
98int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); 99int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu);
99#endif 100#endif
100 101
102enum {
103 OUTSIDE_GUEST_MODE,
104 IN_GUEST_MODE,
105 EXITING_GUEST_MODE
106};
107
101struct kvm_vcpu { 108struct kvm_vcpu {
102 struct kvm *kvm; 109 struct kvm *kvm;
103#ifdef CONFIG_PREEMPT_NOTIFIERS 110#ifdef CONFIG_PREEMPT_NOTIFIERS
104 struct preempt_notifier preempt_notifier; 111 struct preempt_notifier preempt_notifier;
105#endif 112#endif
113 int cpu;
106 int vcpu_id; 114 int vcpu_id;
107 struct mutex mutex; 115 int srcu_idx;
108 int cpu; 116 int mode;
109 atomic_t guest_mode;
110 struct kvm_run *run;
111 unsigned long requests; 117 unsigned long requests;
112 unsigned long guest_debug; 118 unsigned long guest_debug;
113 int srcu_idx; 119
120 struct mutex mutex;
121 struct kvm_run *run;
114 122
115 int fpu_active; 123 int fpu_active;
116 int guest_fpu_loaded, guest_xcr0_loaded; 124 int guest_fpu_loaded, guest_xcr0_loaded;
117 wait_queue_head_t wq; 125 wait_queue_head_t wq;
126 struct pid *pid;
118 int sigset_active; 127 int sigset_active;
119 sigset_t sigset; 128 sigset_t sigset;
120 struct kvm_vcpu_stat stat; 129 struct kvm_vcpu_stat stat;
@@ -140,6 +149,11 @@ struct kvm_vcpu {
140 struct kvm_vcpu_arch arch; 149 struct kvm_vcpu_arch arch;
141}; 150};
142 151
152static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
153{
154 return cmpxchg(&vcpu->mode, IN_GUEST_MODE, EXITING_GUEST_MODE);
155}
156
143/* 157/*
144 * Some of the bitops functions do not support too long bitmaps. 158 * Some of the bitops functions do not support too long bitmaps.
145 * This number must be determined not to exceed such limits. 159 * This number must be determined not to exceed such limits.
@@ -212,7 +226,6 @@ struct kvm_memslots {
212 226
213struct kvm { 227struct kvm {
214 spinlock_t mmu_lock; 228 spinlock_t mmu_lock;
215 raw_spinlock_t requests_lock;
216 struct mutex slots_lock; 229 struct mutex slots_lock;
217 struct mm_struct *mm; /* userspace tied to this vm */ 230 struct mm_struct *mm; /* userspace tied to this vm */
218 struct kvm_memslots *memslots; 231 struct kvm_memslots *memslots;
@@ -223,6 +236,7 @@ struct kvm {
223#endif 236#endif
224 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; 237 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
225 atomic_t online_vcpus; 238 atomic_t online_vcpus;
239 int last_boosted_vcpu;
226 struct list_head vm_list; 240 struct list_head vm_list;
227 struct mutex lock; 241 struct mutex lock;
228 struct kvm_io_bus *buses[KVM_NR_BUSES]; 242 struct kvm_io_bus *buses[KVM_NR_BUSES];
@@ -719,11 +733,6 @@ static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu)
719 set_bit(req, &vcpu->requests); 733 set_bit(req, &vcpu->requests);
720} 734}
721 735
722static inline bool kvm_make_check_request(int req, struct kvm_vcpu *vcpu)
723{
724 return test_and_set_bit(req, &vcpu->requests);
725}
726
727static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) 736static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
728{ 737{
729 if (test_bit(req, &vcpu->requests)) { 738 if (test_bit(req, &vcpu->requests)) {
diff --git a/include/linux/mfd/ti_ssp.h b/include/linux/mfd/ti_ssp.h
new file mode 100644
index 000000000000..dbb4b43bd20e
--- /dev/null
+++ b/include/linux/mfd/ti_ssp.h
@@ -0,0 +1,93 @@
1/*
2 * Sequencer Serial Port (SSP) driver for Texas Instruments' SoCs
3 *
4 * Copyright (C) 2010 Texas Instruments Inc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __TI_SSP_H__
22#define __TI_SSP_H__
23
24struct ti_ssp_dev_data {
25 const char *dev_name;
26 void *pdata;
27 size_t pdata_size;
28};
29
30struct ti_ssp_data {
31 unsigned long out_clock;
32 struct ti_ssp_dev_data dev_data[2];
33};
34
35struct ti_ssp_spi_data {
36 unsigned long iosel;
37 int num_cs;
38 void (*select)(int cs);
39};
40
41/*
42 * Sequencer port IO pin configuration bits. These do not correlate 1-1 with
43 * the hardware. The iosel field in the port data combines iosel1 and iosel2,
44 * and is therefore not a direct map to register space. It is best to use the
45 * macros below to construct iosel values.
46 *
47 * least significant 16 bits --> iosel1
48 * most significant 16 bits --> iosel2
49 */
50
51#define SSP_IN 0x0000
52#define SSP_DATA 0x0001
53#define SSP_CLOCK 0x0002
54#define SSP_CHIPSEL 0x0003
55#define SSP_OUT 0x0004
56#define SSP_PIN_SEL(pin, v) ((v) << ((pin) * 3))
57#define SSP_PIN_MASK(pin) SSP_PIN_SEL(pin, 0x7)
58#define SSP_INPUT_SEL(pin) ((pin) << 16)
59
60/* Sequencer port config bits */
61#define SSP_EARLY_DIN BIT(8)
62#define SSP_DELAY_DOUT BIT(9)
63
64/* Sequence map definitions */
65#define SSP_CLK_HIGH BIT(0)
66#define SSP_CLK_LOW 0
67#define SSP_DATA_HIGH BIT(1)
68#define SSP_DATA_LOW 0
69#define SSP_CS_HIGH BIT(2)
70#define SSP_CS_LOW 0
71#define SSP_OUT_MODE BIT(3)
72#define SSP_IN_MODE 0
73#define SSP_DATA_REG BIT(4)
74#define SSP_ADDR_REG 0
75
76#define SSP_OPCODE_DIRECT ((0x0) << 5)
77#define SSP_OPCODE_TOGGLE ((0x1) << 5)
78#define SSP_OPCODE_SHIFT ((0x2) << 5)
79#define SSP_OPCODE_BRANCH0 ((0x4) << 5)
80#define SSP_OPCODE_BRANCH1 ((0x5) << 5)
81#define SSP_OPCODE_BRANCH ((0x6) << 5)
82#define SSP_OPCODE_STOP ((0x7) << 5)
83#define SSP_BRANCH(addr) ((addr) << 8)
84#define SSP_COUNT(cycles) ((cycles) << 8)
85
86int ti_ssp_raw_read(struct device *dev);
87int ti_ssp_raw_write(struct device *dev, u32 val);
88int ti_ssp_load(struct device *dev, int offs, u32* prog, int len);
89int ti_ssp_run(struct device *dev, u32 pc, u32 input, u32 *output);
90int ti_ssp_set_mode(struct device *dev, int mode);
91int ti_ssp_set_iosel(struct device *dev, u32 iosel);
92
93#endif /* __TI_SSP_H__ */
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 9eab263658be..466b1c777aff 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -103,13 +103,21 @@ struct wm8994_pdata {
103 unsigned int lineout1fb:1; 103 unsigned int lineout1fb:1;
104 unsigned int lineout2fb:1; 104 unsigned int lineout2fb:1;
105 105
106 /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ 106 /* IRQ for microphone detection if brought out directly as a
107 * signal.
108 */
109 int micdet_irq;
110
111 /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
107 unsigned int micbias1_lvl:1; 112 unsigned int micbias1_lvl:1;
108 unsigned int micbias2_lvl:1; 113 unsigned int micbias2_lvl:1;
109 114
110 /* Jack detect threashold levels, see datasheet for values */ 115 /* WM8994 jack detect threashold levels, see datasheet for values */
111 unsigned int jd_scthr:2; 116 unsigned int jd_scthr:2;
112 unsigned int jd_thr:2; 117 unsigned int jd_thr:2;
118
119 /* WM8958 microphone bias configuration */
120 int micbias[2];
113}; 121};
114 122
115#endif 123#endif
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index be072faec6f0..f3ee84284670 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -63,6 +63,8 @@
63#define WM8994_MICBIAS 0x3A 63#define WM8994_MICBIAS 0x3A
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 WM8958_MICBIAS1 0x3D
67#define WM8958_MICBIAS2 0x3E
66#define WM8994_CHARGE_PUMP_1 0x4C 68#define WM8994_CHARGE_PUMP_1 0x4C
67#define WM8958_CHARGE_PUMP_2 0x4D 69#define WM8958_CHARGE_PUMP_2 0x4D
68#define WM8994_CLASS_W_1 0x51 70#define WM8994_CLASS_W_1 0x51
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 679300c050f5..581703d86fbd 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -402,16 +402,23 @@ static inline void init_page_count(struct page *page)
402/* 402/*
403 * PageBuddy() indicate that the page is free and in the buddy system 403 * PageBuddy() indicate that the page is free and in the buddy system
404 * (see mm/page_alloc.c). 404 * (see mm/page_alloc.c).
405 *
406 * PAGE_BUDDY_MAPCOUNT_VALUE must be <= -2 but better not too close to
407 * -2 so that an underflow of the page_mapcount() won't be mistaken
408 * for a genuine PAGE_BUDDY_MAPCOUNT_VALUE. -128 can be created very
409 * efficiently by most CPU architectures.
405 */ 410 */
411#define PAGE_BUDDY_MAPCOUNT_VALUE (-128)
412
406static inline int PageBuddy(struct page *page) 413static inline int PageBuddy(struct page *page)
407{ 414{
408 return atomic_read(&page->_mapcount) == -2; 415 return atomic_read(&page->_mapcount) == PAGE_BUDDY_MAPCOUNT_VALUE;
409} 416}
410 417
411static inline void __SetPageBuddy(struct page *page) 418static inline void __SetPageBuddy(struct page *page)
412{ 419{
413 VM_BUG_ON(atomic_read(&page->_mapcount) != -1); 420 VM_BUG_ON(atomic_read(&page->_mapcount) != -1);
414 atomic_set(&page->_mapcount, -2); 421 atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE);
415} 422}
416 423
417static inline void __ClearPageBuddy(struct page *page) 424static inline void __ClearPageBuddy(struct page *page)
@@ -965,6 +972,10 @@ static inline int handle_mm_fault(struct mm_struct *mm,
965extern int make_pages_present(unsigned long addr, unsigned long end); 972extern int make_pages_present(unsigned long addr, unsigned long end);
966extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 973extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
967 974
975int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
976 unsigned long start, int len, unsigned int foll_flags,
977 struct page **pages, struct vm_area_struct **vmas,
978 int *nonblocking);
968int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 979int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
969 unsigned long start, int nr_pages, int write, int force, 980 unsigned long start, int nr_pages, int write, int force,
970 struct page **pages, struct vm_area_struct **vmas); 981 struct page **pages, struct vm_area_struct **vmas);
@@ -1528,6 +1539,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
1528#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ 1539#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */
1529#define FOLL_MLOCK 0x40 /* mark page as mlocked */ 1540#define FOLL_MLOCK 0x40 /* mark page as mlocked */
1530#define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ 1541#define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */
1542#define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
1531 1543
1532typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, 1544typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
1533 void *data); 1545 void *data);
@@ -1620,14 +1632,6 @@ extern int sysctl_memory_failure_recovery;
1620extern void shake_page(struct page *p, int access); 1632extern void shake_page(struct page *p, int access);
1621extern atomic_long_t mce_bad_pages; 1633extern atomic_long_t mce_bad_pages;
1622extern int soft_offline_page(struct page *page, int flags); 1634extern int soft_offline_page(struct page *page, int flags);
1623#ifdef CONFIG_MEMORY_FAILURE
1624int is_hwpoison_address(unsigned long addr);
1625#else
1626static inline int is_hwpoison_address(unsigned long addr)
1627{
1628 return 0;
1629}
1630#endif
1631 1635
1632extern void dump_page(struct page *page); 1636extern void dump_page(struct page *page);
1633 1637
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 02ecb0189b1d..e56f835274c9 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -472,7 +472,7 @@ static inline int zone_is_oom_locked(const struct zone *zone)
472#ifdef CONFIG_NUMA 472#ifdef CONFIG_NUMA
473 473
474/* 474/*
475 * The NUMA zonelists are doubled becausse we need zonelists that restrict the 475 * The NUMA zonelists are doubled because we need zonelists that restrict the
476 * allocations to a single node for GFP_THISNODE. 476 * allocations to a single node for GFP_THISNODE.
477 * 477 *
478 * [0] : Zonelist with fallback 478 * [0] : Zonelist with fallback
diff --git a/include/linux/msm_mdp.h b/include/linux/msm_mdp.h
index d11fe0f2f956..fe722c1fb61d 100644
--- a/include/linux/msm_mdp.h
+++ b/include/linux/msm_mdp.h
@@ -32,6 +32,7 @@ enum {
32 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */ 32 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */
33 MDP_RGBA_8888, /* ARGB 888 */ 33 MDP_RGBA_8888, /* ARGB 888 */
34 MDP_BGRA_8888, /* ABGR 888 */ 34 MDP_BGRA_8888, /* ABGR 888 */
35 MDP_RGBX_8888, /* RGBX 888 */
35 MDP_IMGTYPE_LIMIT /* Non valid image type after this enum */ 36 MDP_IMGTYPE_LIMIT /* Non valid image type after this enum */
36}; 37};
37 38
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index cd6f3b431195..d60130f88eed 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -168,6 +168,7 @@
168#define ONENAND_SYS_CFG1_INT (1 << 6) 168#define ONENAND_SYS_CFG1_INT (1 << 6)
169#define ONENAND_SYS_CFG1_IOBE (1 << 5) 169#define ONENAND_SYS_CFG1_IOBE (1 << 5)
170#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) 170#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
171#define ONENAND_SYS_CFG1_VHF (1 << 3)
171#define ONENAND_SYS_CFG1_HF (1 << 2) 172#define ONENAND_SYS_CFG1_HF (1 << 2)
172#define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1) 173#define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1)
173 174
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index b31bd9e9bca3..84854edf4436 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -116,18 +116,40 @@ struct ubi_volume_info {
116 * struct ubi_device_info - UBI device description data structure. 116 * struct ubi_device_info - UBI device description data structure.
117 * @ubi_num: ubi device number 117 * @ubi_num: ubi device number
118 * @leb_size: logical eraseblock size on this UBI device 118 * @leb_size: logical eraseblock size on this UBI device
119 * @leb_start: starting offset of logical eraseblocks within physical
120 * eraseblocks
119 * @min_io_size: minimal I/O unit size 121 * @min_io_size: minimal I/O unit size
122 * @max_write_size: maximum amount of bytes the underlying flash can write at a
123 * time (MTD write buffer size)
120 * @ro_mode: if this device is in read-only mode 124 * @ro_mode: if this device is in read-only mode
121 * @cdev: UBI character device major and minor numbers 125 * @cdev: UBI character device major and minor numbers
122 * 126 *
123 * Note, @leb_size is the logical eraseblock size offered by the UBI device. 127 * Note, @leb_size is the logical eraseblock size offered by the UBI device.
124 * Volumes of this UBI device may have smaller logical eraseblock size if their 128 * Volumes of this UBI device may have smaller logical eraseblock size if their
125 * alignment is not equivalent to %1. 129 * alignment is not equivalent to %1.
130 *
131 * The @max_write_size field describes flash write maximum write unit. For
132 * example, NOR flash allows for changing individual bytes, so @min_io_size is
133 * %1. However, it does not mean than NOR flash has to write data byte-by-byte.
134 * Instead, CFI NOR flashes have a write-buffer of, e.g., 64 bytes, and when
135 * writing large chunks of data, they write 64-bytes at a time. Obviously, this
136 * improves write throughput.
137 *
138 * Also, the MTD device may have N interleaved (striped) flash chips
139 * underneath, in which case @min_io_size can be physical min. I/O size of
140 * single flash chip, while @max_write_size can be N * @min_io_size.
141 *
142 * The @max_write_size field is always greater or equivalent to @min_io_size.
143 * E.g., some NOR flashes may have (@min_io_size = 1, @max_write_size = 64). In
144 * contrast, NAND flashes usually have @min_io_size = @max_write_size = NAND
145 * page size.
126 */ 146 */
127struct ubi_device_info { 147struct ubi_device_info {
128 int ubi_num; 148 int ubi_num;
129 int leb_size; 149 int leb_size;
150 int leb_start;
130 int min_io_size; 151 int min_io_size;
152 int max_write_size;
131 int ro_mode; 153 int ro_mode;
132 dev_t cdev; 154 dev_t cdev;
133}; 155};
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 9c8603872c36..eba45ea10298 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -85,7 +85,7 @@ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry
85extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 85extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
86 86
87extern int follow_down_one(struct path *); 87extern int follow_down_one(struct path *);
88extern int follow_down(struct path *, bool); 88extern int follow_down(struct path *);
89extern int follow_up(struct path *); 89extern int follow_up(struct path *);
90 90
91extern struct dentry *lock_rename(struct dentry *, struct dentry *); 91extern struct dentry *lock_rename(struct dentry *, struct dentry *);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 6023efa9f5d9..f88522b10a38 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -501,7 +501,7 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
501extern int nfs_writepages(struct address_space *, struct writeback_control *); 501extern int nfs_writepages(struct address_space *, struct writeback_control *);
502extern int nfs_flush_incompatible(struct file *file, struct page *page); 502extern int nfs_flush_incompatible(struct file *file, struct page *page);
503extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 503extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
504extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); 504extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
505 505
506/* 506/*
507 * Try to write back everything synchronously (but check the 507 * Try to write back everything synchronously (but check the
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 3e112de12d8d..216cea5db0aa 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -30,6 +30,8 @@ struct nfs_client {
30#define NFS_CS_CALLBACK 1 /* - callback started */ 30#define NFS_CS_CALLBACK 1 /* - callback started */
31#define NFS_CS_IDMAP 2 /* - idmap started */ 31#define NFS_CS_IDMAP 2 /* - idmap started */
32#define NFS_CS_RENEWD 3 /* - renewd started */ 32#define NFS_CS_RENEWD 3 /* - renewd started */
33#define NFS_CS_STOP_RENEW 4 /* no more state to renew */
34#define NFS_CS_CHECK_LEASE_TIME 5 /* need to check lease time */
33 struct sockaddr_storage cl_addr; /* server identifier */ 35 struct sockaddr_storage cl_addr; /* server identifier */
34 size_t cl_addrlen; 36 size_t cl_addrlen;
35 char * cl_hostname; /* hostname of server */ 37 char * cl_hostname; /* hostname of server */
@@ -75,7 +77,6 @@ struct nfs_client {
75 u32 cl_exchange_flags; 77 u32 cl_exchange_flags;
76 struct nfs4_session *cl_session; /* sharred session */ 78 struct nfs4_session *cl_session; /* sharred session */
77 struct list_head cl_layouts; 79 struct list_head cl_layouts;
78 struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */
79#endif /* CONFIG_NFS_V4 */ 80#endif /* CONFIG_NFS_V4 */
80 81
81#ifdef CONFIG_NFS_FSCACHE 82#ifdef CONFIG_NFS_FSCACHE
@@ -176,6 +177,7 @@ struct nfs_server {
176#define NFS_CAP_CTIME (1U << 12) 177#define NFS_CAP_CTIME (1U << 12)
177#define NFS_CAP_MTIME (1U << 13) 178#define NFS_CAP_MTIME (1U << 13)
178#define NFS_CAP_POSIX_LOCK (1U << 14) 179#define NFS_CAP_POSIX_LOCK (1U << 14)
180#define NFS_CAP_UIDGID_NOMAP (1U << 15)
179 181
180 182
181/* maximum number of slots to use */ 183/* maximum number of slots to use */
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index e8352dc5afb5..ae7d6a380dae 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -65,6 +65,7 @@ struct idmap_msg {
65 65
66/* Forward declaration to make this header independent of others */ 66/* Forward declaration to make this header independent of others */
67struct nfs_client; 67struct nfs_client;
68struct nfs_server;
68 69
69#ifdef CONFIG_NFS_USE_NEW_IDMAPPER 70#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
70 71
@@ -96,10 +97,10 @@ void nfs_idmap_delete(struct nfs_client *);
96 97
97#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */ 98#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
98 99
99int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *); 100int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *);
100int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *); 101int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *);
101int nfs_map_uid_to_name(struct nfs_client *, __u32, char *, size_t); 102int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t);
102int nfs_map_gid_to_group(struct nfs_client *, __u32, char *, size_t); 103int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t);
103 104
104extern unsigned int nfs_idmap_cache_timeout; 105extern unsigned int nfs_idmap_cache_timeout;
105#endif /* __KERNEL__ */ 106#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_iostat.h b/include/linux/nfs_iostat.h
index 68b10f5f8907..8866bb3502ee 100644
--- a/include/linux/nfs_iostat.h
+++ b/include/linux/nfs_iostat.h
@@ -113,6 +113,8 @@ enum nfs_stat_eventcounters {
113 NFSIOS_SHORTREAD, 113 NFSIOS_SHORTREAD,
114 NFSIOS_SHORTWRITE, 114 NFSIOS_SHORTWRITE,
115 NFSIOS_DELAY, 115 NFSIOS_DELAY,
116 NFSIOS_PNFS_READ,
117 NFSIOS_PNFS_WRITE,
116 __NFSIOS_COUNTSMAX, 118 __NFSIOS_COUNTSMAX,
117}; 119};
118 120
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index d55cee73f634..90907ada6d52 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -59,9 +59,11 @@ struct nfs_pageio_descriptor {
59 unsigned int pg_base; 59 unsigned int pg_base;
60 60
61 struct inode *pg_inode; 61 struct inode *pg_inode;
62 int (*pg_doio)(struct inode *, struct list_head *, unsigned int, size_t, int); 62 int (*pg_doio)(struct nfs_pageio_descriptor *);
63 int pg_ioflags; 63 int pg_ioflags;
64 int pg_error; 64 int pg_error;
65 struct pnfs_layout_segment *pg_lseg;
66 int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
65}; 67};
66 68
67#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 69#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -79,7 +81,7 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
79 pgoff_t idx_start, unsigned int npages, int tag); 81 pgoff_t idx_start, unsigned int npages, int tag);
80extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 82extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
81 struct inode *inode, 83 struct inode *inode,
82 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), 84 int (*doio)(struct nfs_pageio_descriptor *desc),
83 size_t bsize, 85 size_t bsize,
84 int how); 86 int how);
85extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 87extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b0068579bec2..2c2c67d2eb42 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1016,9 +1016,12 @@ struct nfs_read_data {
1016 unsigned int npages; /* Max length of pagevec */ 1016 unsigned int npages; /* Max length of pagevec */
1017 struct nfs_readargs args; 1017 struct nfs_readargs args;
1018 struct nfs_readres res; 1018 struct nfs_readres res;
1019#ifdef CONFIG_NFS_V4
1020 unsigned long timestamp; /* For lease renewal */ 1019 unsigned long timestamp; /* For lease renewal */
1021#endif 1020 struct pnfs_layout_segment *lseg;
1021 struct nfs_client *ds_clp; /* pNFS data server */
1022 const struct rpc_call_ops *mds_ops;
1023 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1024 __u64 mds_offset;
1022 struct page *page_array[NFS_PAGEVEC_SIZE]; 1025 struct page *page_array[NFS_PAGEVEC_SIZE];
1023}; 1026};
1024 1027
@@ -1035,13 +1038,20 @@ struct nfs_write_data {
1035 unsigned int npages; /* Max length of pagevec */ 1038 unsigned int npages; /* Max length of pagevec */
1036 struct nfs_writeargs args; /* argument struct */ 1039 struct nfs_writeargs args; /* argument struct */
1037 struct nfs_writeres res; /* result struct */ 1040 struct nfs_writeres res; /* result struct */
1041 struct pnfs_layout_segment *lseg;
1042 struct nfs_client *ds_clp; /* pNFS data server */
1043 const struct rpc_call_ops *mds_ops;
1044 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1038#ifdef CONFIG_NFS_V4 1045#ifdef CONFIG_NFS_V4
1039 unsigned long timestamp; /* For lease renewal */ 1046 unsigned long timestamp; /* For lease renewal */
1040#endif 1047#endif
1048 __u64 mds_offset; /* Filelayout dense stripe */
1041 struct page *page_array[NFS_PAGEVEC_SIZE]; 1049 struct page *page_array[NFS_PAGEVEC_SIZE];
1042}; 1050};
1043 1051
1044struct nfs_access_entry; 1052struct nfs_access_entry;
1053struct nfs_client;
1054struct rpc_timeout;
1045 1055
1046/* 1056/*
1047 * RPC procedure vector for NFSv2/NFSv3 demuxing 1057 * RPC procedure vector for NFSv2/NFSv3 demuxing
@@ -1106,6 +1116,8 @@ struct nfs_rpc_ops {
1106 struct nfs_open_context *ctx, 1116 struct nfs_open_context *ctx,
1107 int open_flags, 1117 int open_flags,
1108 struct iattr *iattr); 1118 struct iattr *iattr);
1119 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1120 const char *, rpc_authflavor_t, int);
1109}; 1121};
1110 1122
1111/* 1123/*
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 1ca64113efe8..7f5cfd3b37dd 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -106,6 +106,13 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event);
106void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, 106void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
107 unsigned long event, int is_kernel); 107 unsigned long event, int is_kernel);
108 108
109/**
110 * Add an hardware sample.
111 */
112void oprofile_add_ext_hw_sample(unsigned long pc, struct pt_regs * const regs,
113 unsigned long event, int is_kernel,
114 struct task_struct *task);
115
109/* Use this instead when the PC value is not from the regs. Doesn't 116/* Use this instead when the PC value is not from the regs. Doesn't
110 * backtrace. */ 117 * backtrace. */
111void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); 118void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 580de67f318b..511e5ee809ef 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -517,7 +517,7 @@
517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302
518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
520#define PCI_DEVICE_ID_AMD_15H_NB_MISC 0x1603 520#define PCI_DEVICE_ID_AMD_15H_NB_F3 0x1603
521#define PCI_DEVICE_ID_AMD_15H_NB_LINK 0x1604 521#define PCI_DEVICE_ID_AMD_15H_NB_LINK 0x1604
522#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 522#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
523#define PCI_DEVICE_ID_AMD_LANCE 0x2000 523#define PCI_DEVICE_ID_AMD_LANCE 0x2000
@@ -2079,6 +2079,8 @@
2079#define PCI_DEVICE_ID_TIGON3_5723 0x165b 2079#define PCI_DEVICE_ID_TIGON3_5723 0x165b
2080#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 2080#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
2081#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 2081#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
2082#define PCI_DEVICE_ID_NX2_57712 0x1662
2083#define PCI_DEVICE_ID_NX2_57712E 0x1663
2082#define PCI_DEVICE_ID_TIGON3_5714 0x1668 2084#define PCI_DEVICE_ID_TIGON3_5714 0x1668
2083#define PCI_DEVICE_ID_TIGON3_5714S 0x1669 2085#define PCI_DEVICE_ID_TIGON3_5714S 0x1669
2084#define PCI_DEVICE_ID_TIGON3_5780 0x166a 2086#define PCI_DEVICE_ID_TIGON3_5780 0x166a
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 614615b8d42b..f495c0147240 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -878,8 +878,8 @@ enum perf_event_context_type {
878 * Used as a container for task events and CPU events as well: 878 * Used as a container for task events and CPU events as well:
879 */ 879 */
880struct perf_event_context { 880struct perf_event_context {
881 enum perf_event_context_type type;
882 struct pmu *pmu; 881 struct pmu *pmu;
882 enum perf_event_context_type type;
883 /* 883 /*
884 * Protect the states of the events in the list, 884 * Protect the states of the events in the list,
885 * nr_active, and the list: 885 * nr_active, and the list:
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index ef9476a36ff7..db7bcaf7c5bd 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -129,6 +129,7 @@ struct rpc_create_args {
129struct rpc_clnt *rpc_create(struct rpc_create_args *args); 129struct rpc_clnt *rpc_create(struct rpc_create_args *args);
130struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 130struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
131 struct rpc_program *, u32); 131 struct rpc_program *, u32);
132void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt);
132struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 133struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
133void rpc_shutdown_client(struct rpc_clnt *); 134void rpc_shutdown_client(struct rpc_clnt *);
134void rpc_release_client(struct rpc_clnt *); 135void rpc_release_client(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index bef0f535f746..a0f998c07c65 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -12,7 +12,6 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kref.h>
16#include <linux/ktime.h> 15#include <linux/ktime.h>
17#include <linux/sunrpc/sched.h> 16#include <linux/sunrpc/sched.h>
18#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
@@ -146,7 +145,7 @@ enum xprt_transports {
146}; 145};
147 146
148struct rpc_xprt { 147struct rpc_xprt {
149 struct kref kref; /* Reference count */ 148 atomic_t count; /* Reference count */
150 struct rpc_xprt_ops * ops; /* transport methods */ 149 struct rpc_xprt_ops * ops; /* transport methods */
151 150
152 const struct rpc_timeout *timeout; /* timeout parms */ 151 const struct rpc_timeout *timeout; /* timeout parms */
diff --git a/include/scsi/fc/fc_ns.h b/include/scsi/fc/fc_ns.h
index 185015dd1166..f7751d53f1d3 100644
--- a/include/scsi/fc/fc_ns.h
+++ b/include/scsi/fc/fc_ns.h
@@ -41,6 +41,7 @@ enum fc_ns_req {
41 FC_NS_GI_A = 0x0101, /* get identifiers - scope */ 41 FC_NS_GI_A = 0x0101, /* get identifiers - scope */
42 FC_NS_GPN_ID = 0x0112, /* get port name by ID */ 42 FC_NS_GPN_ID = 0x0112, /* get port name by ID */
43 FC_NS_GNN_ID = 0x0113, /* get node name by ID */ 43 FC_NS_GNN_ID = 0x0113, /* get node name by ID */
44 FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */
44 FC_NS_GID_PN = 0x0121, /* get ID for port name */ 45 FC_NS_GID_PN = 0x0121, /* get ID for port name */
45 FC_NS_GID_NN = 0x0131, /* get IDs for node name */ 46 FC_NS_GID_NN = 0x0131, /* get IDs for node name */
46 FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ 47 FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */
@@ -144,7 +145,7 @@ struct fc_ns_gid_pn {
144}; 145};
145 146
146/* 147/*
147 * GID_PN response 148 * GID_PN response or GSPN_ID request
148 */ 149 */
149struct fc_gid_pn_resp { 150struct fc_gid_pn_resp {
150 __u8 fp_resvd; 151 __u8 fp_resvd;
@@ -152,6 +153,14 @@ struct fc_gid_pn_resp {
152}; 153};
153 154
154/* 155/*
156 * GSPN_ID response
157 */
158struct fc_gspn_resp {
159 __u8 fp_name_len;
160 char fp_name[];
161};
162
163/*
155 * RFT_ID request - register FC-4 types for ID. 164 * RFT_ID request - register FC-4 types for ID.
156 */ 165 */
157struct fc_ns_rft_id { 166struct fc_ns_rft_id {
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index 6d293c846a46..be418d8448a5 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -46,16 +46,11 @@ struct fc_ct_req {
46 } payload; 46 } payload;
47}; 47};
48 48
49/** 49static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh,
50 * fill FC header fields in specified fc_frame 50 enum fc_rctl r_ctl,
51 */ 51 u32 did, u32 sid, enum fc_fh_type type,
52static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, 52 u32 f_ctl, u32 parm_offset)
53 u32 did, u32 sid, enum fc_fh_type type,
54 u32 f_ctl, u32 parm_offset)
55{ 53{
56 struct fc_frame_header *fh;
57
58 fh = fc_frame_header_get(fp);
59 WARN_ON(r_ctl == 0); 54 WARN_ON(r_ctl == 0);
60 fh->fh_r_ctl = r_ctl; 55 fh->fh_r_ctl = r_ctl;
61 hton24(fh->fh_d_id, did); 56 hton24(fh->fh_d_id, did);
@@ -68,6 +63,19 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
68} 63}
69 64
70/** 65/**
66 * fill FC header fields in specified fc_frame
67 */
68static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
69 u32 did, u32 sid, enum fc_fh_type type,
70 u32 f_ctl, u32 parm_offset)
71{
72 struct fc_frame_header *fh;
73
74 fh = fc_frame_header_get(fp);
75 __fc_fill_fc_hdr(fh, r_ctl, did, sid, type, f_ctl, parm_offset);
76}
77
78/**
71 * fc_adisc_fill() - Fill in adisc request frame 79 * fc_adisc_fill() - Fill in adisc request frame
72 * @lport: local port. 80 * @lport: local port.
73 * @fp: fc frame where payload will be placed. 81 * @fp: fc frame where payload will be placed.
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index f53c8e31d5fb..24193c1b0da0 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -35,6 +35,8 @@
35 35
36#include <scsi/fc_frame.h> 36#include <scsi/fc_frame.h>
37 37
38#define FC_FC4_PROV_SIZE (FC_TYPE_FCP + 1) /* size of tables */
39
38/* 40/*
39 * libfc error codes 41 * libfc error codes
40 */ 42 */
@@ -156,6 +158,7 @@ struct fc_rport_libfc_priv {
156 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) 158 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0)
157 #define FC_RP_FLAGS_RETRY (1 << 1) 159 #define FC_RP_FLAGS_RETRY (1 << 1)
158 #define FC_RP_STARTED (1 << 2) 160 #define FC_RP_STARTED (1 << 2)
161 #define FC_RP_FLAGS_CONF_REQ (1 << 3)
159 unsigned int e_d_tov; 162 unsigned int e_d_tov;
160 unsigned int r_a_tov; 163 unsigned int r_a_tov;
161}; 164};
@@ -179,6 +182,7 @@ struct fc_rport_libfc_priv {
179 * @rp_mutex: The mutex that protects the remote port 182 * @rp_mutex: The mutex that protects the remote port
180 * @retry_work: Handle for retries 183 * @retry_work: Handle for retries
181 * @event_callback: Callback when READY, FAILED or LOGO states complete 184 * @event_callback: Callback when READY, FAILED or LOGO states complete
185 * @prli_count: Count of open PRLI sessions in providers
182 * @rcu: Structure used for freeing in an RCU-safe manner 186 * @rcu: Structure used for freeing in an RCU-safe manner
183 */ 187 */
184struct fc_rport_priv { 188struct fc_rport_priv {
@@ -202,7 +206,13 @@ struct fc_rport_priv {
202 struct list_head peers; 206 struct list_head peers;
203 struct work_struct event_work; 207 struct work_struct event_work;
204 u32 supported_classes; 208 u32 supported_classes;
209 u16 prli_count;
205 struct rcu_head rcu; 210 struct rcu_head rcu;
211 u16 sp_features;
212 u8 spp_type;
213 void (*lld_event_callback)(struct fc_lport *,
214 struct fc_rport_priv *,
215 enum fc_rport_event);
206}; 216};
207 217
208/** 218/**
@@ -551,6 +561,16 @@ struct libfc_function_template {
551 struct fc_seq *(*seq_start_next)(struct fc_seq *); 561 struct fc_seq *(*seq_start_next)(struct fc_seq *);
552 562
553 /* 563 /*
564 * Set a response handler for the exchange of the sequence.
565 *
566 * STATUS: OPTIONAL
567 */
568 void (*seq_set_resp)(struct fc_seq *sp,
569 void (*resp)(struct fc_seq *, struct fc_frame *,
570 void *),
571 void *arg);
572
573 /*
554 * Assign a sequence for an incoming request frame. 574 * Assign a sequence for an incoming request frame.
555 * 575 *
556 * STATUS: OPTIONAL 576 * STATUS: OPTIONAL
@@ -558,6 +578,13 @@ struct libfc_function_template {
558 struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *); 578 struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *);
559 579
560 /* 580 /*
581 * Release the reference on the sequence returned by seq_assign().
582 *
583 * STATUS: OPTIONAL
584 */
585 void (*seq_release)(struct fc_seq *);
586
587 /*
561 * Reset an exchange manager, completing all sequences and exchanges. 588 * Reset an exchange manager, completing all sequences and exchanges.
562 * If s_id is non-zero, reset only exchanges originating from that FID. 589 * If s_id is non-zero, reset only exchanges originating from that FID.
563 * If d_id is non-zero, reset only exchanges sending to that FID. 590 * If d_id is non-zero, reset only exchanges sending to that FID.
@@ -656,6 +683,15 @@ struct libfc_function_template {
656 void (*rport_destroy)(struct kref *); 683 void (*rport_destroy)(struct kref *);
657 684
658 /* 685 /*
686 * Callback routine after the remote port is logged in
687 *
688 * STATUS: OPTIONAL
689 */
690 void (*rport_event_callback)(struct fc_lport *,
691 struct fc_rport_priv *,
692 enum fc_rport_event);
693
694 /*
659 * Send a fcp cmd from fsp pkt. 695 * Send a fcp cmd from fsp pkt.
660 * Called with the SCSI host lock unlocked and irqs disabled. 696 * Called with the SCSI host lock unlocked and irqs disabled.
661 * 697 *
@@ -749,6 +785,15 @@ struct fc_disc {
749 enum fc_disc_event); 785 enum fc_disc_event);
750}; 786};
751 787
788/*
789 * Local port notifier and events.
790 */
791extern struct blocking_notifier_head fc_lport_notifier_head;
792enum fc_lport_event {
793 FC_LPORT_EV_ADD,
794 FC_LPORT_EV_DEL,
795};
796
752/** 797/**
753 * struct fc_lport - Local port 798 * struct fc_lport - Local port
754 * @host: The SCSI host associated with a local port 799 * @host: The SCSI host associated with a local port
@@ -789,8 +834,10 @@ struct fc_disc {
789 * @lso_max: The maximum large offload send size 834 * @lso_max: The maximum large offload send size
790 * @fcts: FC-4 type mask 835 * @fcts: FC-4 type mask
791 * @lp_mutex: Mutex to protect the local port 836 * @lp_mutex: Mutex to protect the local port
792 * @list: Handle for list of local ports 837 * @list: Linkage on list of vport peers
793 * @retry_work: Handle to local port for delayed retry context 838 * @retry_work: Handle to local port for delayed retry context
839 * @prov: Pointers available for use by passive FC-4 providers
840 * @lport_list: Linkage on module-wide list of local ports
794 */ 841 */
795struct fc_lport { 842struct fc_lport {
796 /* Associations */ 843 /* Associations */
@@ -846,8 +893,32 @@ struct fc_lport {
846 struct mutex lp_mutex; 893 struct mutex lp_mutex;
847 struct list_head list; 894 struct list_head list;
848 struct delayed_work retry_work; 895 struct delayed_work retry_work;
896 void *prov[FC_FC4_PROV_SIZE];
897 struct list_head lport_list;
849}; 898};
850 899
900/**
901 * struct fc4_prov - FC-4 provider registration
902 * @prli: Handler for incoming PRLI
903 * @prlo: Handler for session reset
904 * @recv: Handler for incoming request
905 * @module: Pointer to module. May be NULL.
906 */
907struct fc4_prov {
908 int (*prli)(struct fc_rport_priv *, u32 spp_len,
909 const struct fc_els_spp *spp_in,
910 struct fc_els_spp *spp_out);
911 void (*prlo)(struct fc_rport_priv *);
912 void (*recv)(struct fc_lport *, struct fc_frame *);
913 struct module *module;
914};
915
916/*
917 * Register FC-4 provider with libfc.
918 */
919int fc_fc4_register_provider(enum fc_fh_type type, struct fc4_prov *);
920void fc_fc4_deregister_provider(enum fc_fh_type type, struct fc4_prov *);
921
851/* 922/*
852 * FC_LPORT HELPER FUNCTIONS 923 * FC_LPORT HELPER FUNCTIONS
853 *****************************/ 924 *****************************/
@@ -978,6 +1049,7 @@ struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize);
978struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); 1049struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id);
979int fc_lport_bsg_request(struct fc_bsg_job *); 1050int fc_lport_bsg_request(struct fc_bsg_job *);
980void fc_lport_set_local_id(struct fc_lport *, u32 port_id); 1051void fc_lport_set_local_id(struct fc_lport *, u32 port_id);
1052void fc_lport_iterate(void (*func)(struct fc_lport *, void *), void *);
981 1053
982/* 1054/*
983 * REMOTE PORT LAYER 1055 * REMOTE PORT LAYER
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index feb6a94c90ea..8c1638b8c28e 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -33,6 +33,12 @@
33#define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ 33#define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */
34 34
35/* 35/*
36 * Max MTU for FCoE: 14 (FCoE header) + 24 (FC header) + 2112 (max FC payload)
37 * + 4 (FC CRC) + 4 (FCoE trailer) = 2158 bytes
38 */
39#define FCOE_MTU 2158
40
41/*
36 * FIP tunable parameters. 42 * FIP tunable parameters.
37 */ 43 */
38#define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */ 44#define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */
@@ -221,6 +227,8 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *,
221u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); 227u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int);
222int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, 228int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *,
223 const struct libfc_function_template *, int init_fcp); 229 const struct libfc_function_template *, int init_fcp);
230u32 fcoe_fc_crc(struct fc_frame *fp);
231int fcoe_start_io(struct sk_buff *skb);
224 232
225/** 233/**
226 * is_fip_mode() - returns true if FIP mode selected. 234 * is_fip_mode() - returns true if FIP mode selected.
@@ -231,5 +239,102 @@ static inline bool is_fip_mode(struct fcoe_ctlr *fip)
231 return fip->state == FIP_ST_ENABLED; 239 return fip->state == FIP_ST_ENABLED;
232} 240}
233 241
242/* helper for FCoE SW HBA drivers, can include subven and subdev if needed. The
243 * modpost would use pci_device_id table to auto-generate formatted module alias
244 * into the corresponding .mod.c file, but there may or may not be a pci device
245 * id table for FCoE drivers so we use the following helper for build the fcoe
246 * driver module alias.
247 */
248#define MODULE_ALIAS_FCOE_PCI(ven, dev) \
249 MODULE_ALIAS("fcoe-pci:" \
250 "v" __stringify(ven) \
251 "d" __stringify(dev) "sv*sd*bc*sc*i*")
252
253/* the name of the default FCoE transport driver fcoe.ko */
254#define FCOE_TRANSPORT_DEFAULT "fcoe"
255
256/* struct fcoe_transport - The FCoE transport interface
257 * @name: a vendor specific name for their FCoE transport driver
258 * @attached: whether this transport is already attached
259 * @list: list linkage to all attached transports
260 * @match: handler to allow the transport driver to match up a given netdev
261 * @create: handler to sysfs entry of create for FCoE instances
262 * @destroy: handler to sysfs entry of destroy for FCoE instances
263 * @enable: handler to sysfs entry of enable for FCoE instances
264 * @disable: handler to sysfs entry of disable for FCoE instances
265 */
266struct fcoe_transport {
267 char name[IFNAMSIZ];
268 bool attached;
269 struct list_head list;
270 bool (*match) (struct net_device *device);
271 int (*create) (struct net_device *device, enum fip_state fip_mode);
272 int (*destroy) (struct net_device *device);
273 int (*enable) (struct net_device *device);
274 int (*disable) (struct net_device *device);
275};
276
277/**
278 * struct fcoe_percpu_s - The context for FCoE receive thread(s)
279 * @thread: The thread context
280 * @fcoe_rx_list: The queue of pending packets to process
281 * @page: The memory page for calculating frame trailer CRCs
282 * @crc_eof_offset: The offset into the CRC page pointing to available
283 * memory for a new trailer
284 */
285struct fcoe_percpu_s {
286 struct task_struct *thread;
287 struct sk_buff_head fcoe_rx_list;
288 struct page *crc_eof_page;
289 int crc_eof_offset;
290};
291
292/**
293 * struct fcoe_port - The FCoE private structure
294 * @priv: The associated fcoe interface. The structure is
295 * defined by the low level driver
296 * @lport: The associated local port
297 * @fcoe_pending_queue: The pending Rx queue of skbs
298 * @fcoe_pending_queue_active: Indicates if the pending queue is active
299 * @max_queue_depth: Max queue depth of pending queue
300 * @min_queue_depth: Min queue depth of pending queue
301 * @timer: The queue timer
302 * @destroy_work: Handle for work context
303 * (to prevent RTNL deadlocks)
304 * @data_srt_addr: Source address for data
305 *
306 * An instance of this structure is to be allocated along with the
307 * Scsi_Host and libfc fc_lport structures.
308 */
309struct fcoe_port {
310 void *priv;
311 struct fc_lport *lport;
312 struct sk_buff_head fcoe_pending_queue;
313 u8 fcoe_pending_queue_active;
314 u32 max_queue_depth;
315 u32 min_queue_depth;
316 struct timer_list timer;
317 struct work_struct destroy_work;
318 u8 data_src_addr[ETH_ALEN];
319};
320void fcoe_clean_pending_queue(struct fc_lport *);
321void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb);
322void fcoe_queue_timer(ulong lport);
323int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen,
324 struct fcoe_percpu_s *fps);
325
326/**
327 * struct netdev_list
328 * A mapping from netdevice to fcoe_transport
329 */
330struct fcoe_netdev_mapping {
331 struct list_head list;
332 struct net_device *netdev;
333 struct fcoe_transport *ft;
334};
335
336/* fcoe transports registration and deregistration */
337int fcoe_transport_attach(struct fcoe_transport *ft);
338int fcoe_transport_detach(struct fcoe_transport *ft);
234 339
235#endif /* _LIBFCOE_H */ 340#endif /* _LIBFCOE_H */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 748382b32b52..0f4367751b71 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -212,9 +212,6 @@ struct iscsi_conn {
212 /* values userspace uses to id a conn */ 212 /* values userspace uses to id a conn */
213 int persistent_port; 213 int persistent_port;
214 char *persistent_address; 214 char *persistent_address;
215 /* remote portal currently connected to */
216 int portal_port;
217 char portal_address[ISCSI_ADDRESS_BUF_LEN];
218 215
219 /* MIB-statistics */ 216 /* MIB-statistics */
220 uint64_t txdata_octets; 217 uint64_t txdata_octets;
@@ -319,9 +316,6 @@ struct iscsi_host {
319 /* hw address or netdev iscsi connection is bound to */ 316 /* hw address or netdev iscsi connection is bound to */
320 char *hwaddress; 317 char *hwaddress;
321 char *netdev; 318 char *netdev;
322 /* local address */
323 int local_port;
324 char local_address[ISCSI_ADDRESS_BUF_LEN];
325 319
326 wait_queue_head_t session_removal_wq; 320 wait_queue_head_t session_removal_wq;
327 /* protects sessions and state */ 321 /* protects sessions and state */
@@ -394,6 +388,8 @@ extern void iscsi_session_failure(struct iscsi_session *session,
394 enum iscsi_err err); 388 enum iscsi_err err);
395extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, 389extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
396 enum iscsi_param param, char *buf); 390 enum iscsi_param param, char *buf);
391extern int iscsi_conn_get_addr_param(struct sockaddr_storage *addr,
392 enum iscsi_param param, char *buf);
397extern void iscsi_suspend_tx(struct iscsi_conn *conn); 393extern void iscsi_suspend_tx(struct iscsi_conn *conn);
398extern void iscsi_suspend_queue(struct iscsi_conn *conn); 394extern void iscsi_suspend_queue(struct iscsi_conn *conn);
399extern void iscsi_conn_queue_work(struct iscsi_conn *conn); 395extern void iscsi_conn_queue_work(struct iscsi_conn *conn);
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index b76d4006e36d..3668903e397b 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -435,6 +435,10 @@ static inline int scsi_is_wlun(unsigned int lun)
435 * recover the link. Transport class will 435 * recover the link. Transport class will
436 * retry or fail IO */ 436 * retry or fail IO */
437#define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */ 437#define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */
438#define DID_TARGET_FAILURE 0x10 /* Permanent target failure, do not retry on
439 * other paths */
440#define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other
441 * paths might yield different results */
438#define DRIVER_OK 0x00 /* Driver status */ 442#define DRIVER_OK 0x00 /* Driver status */
439 443
440/* 444/*
@@ -464,6 +468,7 @@ static inline int scsi_is_wlun(unsigned int lun)
464#define TIMEOUT_ERROR 0x2007 468#define TIMEOUT_ERROR 0x2007
465#define SCSI_RETURN_NOT_HANDLED 0x2008 469#define SCSI_RETURN_NOT_HANDLED 0x2008
466#define FAST_IO_FAIL 0x2009 470#define FAST_IO_FAIL 0x2009
471#define TARGET_ERROR 0x200A
467 472
468/* 473/*
469 * Midlevel queue return values. 474 * Midlevel queue return values.
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 85867dcde335..f171c65dc5a8 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -184,6 +184,7 @@ typedef void (*activate_complete)(void *, int);
184struct scsi_device_handler { 184struct scsi_device_handler {
185 /* Used by the infrastructure */ 185 /* Used by the infrastructure */
186 struct list_head list; /* list of scsi_device_handlers */ 186 struct list_head list; /* list of scsi_device_handlers */
187 int idx;
187 188
188 /* Filled by the hardware handler */ 189 /* Filled by the hardware handler */
189 struct module *module; 190 struct module *module;
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 7fff94b3b2a8..bf8f52965675 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -101,6 +101,8 @@ struct iscsi_transport {
101 void (*destroy_conn) (struct iscsi_cls_conn *conn); 101 void (*destroy_conn) (struct iscsi_cls_conn *conn);
102 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, 102 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param,
103 char *buf, int buflen); 103 char *buf, int buflen);
104 int (*get_ep_param) (struct iscsi_endpoint *ep, enum iscsi_param param,
105 char *buf);
104 int (*get_conn_param) (struct iscsi_cls_conn *conn, 106 int (*get_conn_param) (struct iscsi_cls_conn *conn,
105 enum iscsi_param param, char *buf); 107 enum iscsi_param param, char *buf);
106 int (*get_session_param) (struct iscsi_cls_session *session, 108 int (*get_session_param) (struct iscsi_cls_session *session,
@@ -160,8 +162,9 @@ struct iscsi_cls_conn {
160 void *dd_data; /* LLD private data */ 162 void *dd_data; /* LLD private data */
161 struct iscsi_transport *transport; 163 struct iscsi_transport *transport;
162 uint32_t cid; /* connection id */ 164 uint32_t cid; /* connection id */
165 struct mutex ep_mutex;
166 struct iscsi_endpoint *ep;
163 167
164 int active; /* must be accessed with the connlock */
165 struct device dev; /* sysfs transport/container device */ 168 struct device dev; /* sysfs transport/container device */
166}; 169};
167 170
@@ -222,6 +225,7 @@ struct iscsi_endpoint {
222 void *dd_data; /* LLD private data */ 225 void *dd_data; /* LLD private data */
223 struct device dev; 226 struct device dev;
224 uint64_t id; 227 uint64_t id;
228 struct iscsi_cls_conn *conn;
225}; 229};
226 230
227/* 231/*
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index b602f475cdbb..f1dcefe4532b 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -96,6 +96,10 @@
96#define AC97_FUNC_INFO 0x68 /* Function Information */ 96#define AC97_FUNC_INFO 0x68 /* Function Information */
97#define AC97_SENSE_INFO 0x6a /* Sense Details */ 97#define AC97_SENSE_INFO 0x6a /* Sense Details */
98 98
99/* volume controls */
100#define AC97_MUTE_MASK_MONO 0x8000
101#define AC97_MUTE_MASK_STEREO 0x8080
102
99/* slot allocation */ 103/* slot allocation */
100#define AC97_SLOT_TAG 0 104#define AC97_SLOT_TAG 0
101#define AC97_SLOT_CMD_ADDR 1 105#define AC97_SLOT_CMD_ADDR 1
@@ -138,6 +142,7 @@
138#define AC97_BC_18BIT_ADC 0x0100 /* 18-bit ADC resolution */ 142#define AC97_BC_18BIT_ADC 0x0100 /* 18-bit ADC resolution */
139#define AC97_BC_20BIT_ADC 0x0200 /* 20-bit ADC resolution */ 143#define AC97_BC_20BIT_ADC 0x0200 /* 20-bit ADC resolution */
140#define AC97_BC_ADC_MASK 0x0300 144#define AC97_BC_ADC_MASK 0x0300
145#define AC97_BC_3D_TECH_ID_MASK 0x7c00 /* Per-vendor ID of 3D enhancement */
141 146
142/* general purpose */ 147/* general purpose */
143#define AC97_GP_DRSS_MASK 0x0c00 /* double rate slot select */ 148#define AC97_GP_DRSS_MASK 0x0c00 /* double rate slot select */
diff --git a/include/sound/control.h b/include/sound/control.h
index 7715e6f00d38..e67db2869360 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -115,6 +115,8 @@ int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); 115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol);
116int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); 116int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id);
117int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); 117int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id);
118int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
119 int active);
118struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); 120struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid);
119struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id); 121struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id);
120 122
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
new file mode 100644
index 000000000000..50a059e7d116
--- /dev/null
+++ b/include/sound/cs4271.h
@@ -0,0 +1,24 @@
1/*
2 * Definitions for CS4271 ASoC codec driver
3 *
4 * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __CS4271_H
18#define __CS4271_H
19
20struct cs4271_platform_data {
21 int gpio_nreset; /* GPIO driving Reset pin, if any */
22};
23
24#endif /* __CS4271_H */
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index 81990b2bcc98..1774ff5ff632 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -3,8 +3,8 @@
3/* 3/*
4 * Copyright (C) 2003 Winfried Ritsch (IEM) 4 * Copyright (C) 2003 Winfried Ritsch (IEM)
5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) 5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
6 * 6 *
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
@@ -23,50 +23,41 @@
23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ 23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
24#define HDSPM_MAX_CHANNELS 64 24#define HDSPM_MAX_CHANNELS 64
25 25
26/* -------------------- IOCTL Peak/RMS Meters -------------------- */ 26enum hdspm_io_type {
27 27 MADI,
28/* peam rms level structure like we get from hardware 28 MADIface,
29 29 AIO,
30 maybe in future we can memory map it so I just copy it 30 AES32,
31 to user on ioctl call now an dont change anything 31 RayDAT
32 rms are made out of low and high values 32};
33 where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
34 (i asume so from the code)
35*/
36
37struct hdspm_peak_rms {
38
39 unsigned int level_offset[1024];
40 33
41 unsigned int input_peak[64]; 34enum hdspm_speed {
42 unsigned int playback_peak[64]; 35 ss,
43 unsigned int output_peak[64]; 36 ds,
44 unsigned int xxx_peak[64]; /* not used */ 37 qs
38};
45 39
46 unsigned int reserved[256]; /* not used */ 40/* -------------------- IOCTL Peak/RMS Meters -------------------- */
47 41
48 unsigned int input_rms_l[64]; 42struct hdspm_peak_rms {
49 unsigned int playback_rms_l[64]; 43 uint32_t input_peaks[64];
50 unsigned int output_rms_l[64]; 44 uint32_t playback_peaks[64];
51 unsigned int xxx_rms_l[64]; /* not used */ 45 uint32_t output_peaks[64];
52 46
53 unsigned int input_rms_h[64]; 47 uint64_t input_rms[64];
54 unsigned int playback_rms_h[64]; 48 uint64_t playback_rms[64];
55 unsigned int output_rms_h[64]; 49 uint64_t output_rms[64];
56 unsigned int xxx_rms_h[64]; /* not used */
57};
58 50
59struct hdspm_peak_rms_ioctl { 51 uint8_t speed; /* enum {ss, ds, qs} */
60 struct hdspm_peak_rms *peak; 52 int status2;
61}; 53};
62 54
63/* use indirect access due to the limit of ioctl bit size */
64#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ 55#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
65 _IOR('H', 0x40, struct hdspm_peak_rms_ioctl) 56 _IOR('H', 0x42, struct hdspm_peak_rms)
66 57
67/* ------------ CONFIG block IOCTL ---------------------- */ 58/* ------------ CONFIG block IOCTL ---------------------- */
68 59
69struct hdspm_config_info { 60struct hdspm_config {
70 unsigned char pref_sync_ref; 61 unsigned char pref_sync_ref;
71 unsigned char wordclock_sync_check; 62 unsigned char wordclock_sync_check;
72 unsigned char madi_sync_check; 63 unsigned char madi_sync_check;
@@ -80,18 +71,121 @@ struct hdspm_config_info {
80 unsigned int analog_out; 71 unsigned int analog_out;
81}; 72};
82 73
83#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \ 74#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
84 _IOR('H', 0x41, struct hdspm_config_info) 75 _IOR('H', 0x41, struct hdspm_config)
76
77/**
78 * If there's a TCO (TimeCode Option) board installed,
79 * there are further options and status data available.
80 * The hdspm_ltc structure contains the current SMPTE
81 * timecode and some status information and can be
82 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
83 * hdspm_status struct.
84 **/
85
86enum hdspm_ltc_format {
87 format_invalid,
88 fps_24,
89 fps_25,
90 fps_2997,
91 fps_30
92};
93
94enum hdspm_ltc_frame {
95 frame_invalid,
96 drop_frame,
97 full_frame
98};
99
100enum hdspm_ltc_input_format {
101 ntsc,
102 pal,
103 no_video
104};
105
106struct hdspm_ltc {
107 unsigned int ltc;
85 108
109 enum hdspm_ltc_format format;
110 enum hdspm_ltc_frame frame;
111 enum hdspm_ltc_input_format input_format;
112};
113
114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)
115
116/**
117 * The status data reflects the device's current state
118 * as determined by the card's configuration and
119 * connection status.
120 **/
121
122enum hdspm_sync {
123 hdspm_sync_no_lock = 0,
124 hdspm_sync_lock = 1,
125 hdspm_sync_sync = 2
126};
86 127
87/* get Soundcard Version */ 128enum hdspm_madi_input {
129 hdspm_input_optical = 0,
130 hdspm_input_coax = 1
131};
132
133enum hdspm_madi_channel_format {
134 hdspm_format_ch_64 = 0,
135 hdspm_format_ch_56 = 1
136};
137
138enum hdspm_madi_frame_format {
139 hdspm_frame_48 = 0,
140 hdspm_frame_96 = 1
141};
142
143enum hdspm_syncsource {
144 syncsource_wc = 0,
145 syncsource_madi = 1,
146 syncsource_tco = 2,
147 syncsource_sync = 3,
148 syncsource_none = 4
149};
150
151struct hdspm_status {
152 uint8_t card_type; /* enum hdspm_io_type */
153 enum hdspm_syncsource autosync_source;
154
155 uint64_t card_clock;
156 uint32_t master_period;
157
158 union {
159 struct {
160 uint8_t sync_wc; /* enum hdspm_sync */
161 uint8_t sync_madi; /* enum hdspm_sync */
162 uint8_t sync_tco; /* enum hdspm_sync */
163 uint8_t sync_in; /* enum hdspm_sync */
164 uint8_t madi_input; /* enum hdspm_madi_input */
165 uint8_t channel_format; /* enum hdspm_madi_channel_format */
166 uint8_t frame_format; /* enum hdspm_madi_frame_format */
167 } madi;
168 } card_specific;
169};
170
171#define SNDRV_HDSPM_IOCTL_GET_STATUS \
172 _IOR('H', 0x47, struct hdspm_status)
173
174/**
175 * Get information about the card and its add-ons.
176 **/
177
178#define HDSPM_ADDON_TCO 1
88 179
89struct hdspm_version { 180struct hdspm_version {
181 uint8_t card_type; /* enum hdspm_io_type */
182 char cardname[20];
183 unsigned int serial;
90 unsigned short firmware_rev; 184 unsigned short firmware_rev;
185 int addons;
91}; 186};
92 187
93#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version) 188#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
94
95 189
96/* ------------- get Matrix Mixer IOCTL --------------- */ 190/* ------------- get Matrix Mixer IOCTL --------------- */
97 191
@@ -103,7 +197,7 @@ struct hdspm_version {
103/* equivalent to hardware definition, maybe for future feature of mmap of 197/* equivalent to hardware definition, maybe for future feature of mmap of
104 * them 198 * them
105 */ 199 */
106/* each of 64 outputs has 64 infader and 64 outfader: 200/* each of 64 outputs has 64 infader and 64 outfader:
107 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ 201 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
108 202
109#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS 203#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
@@ -131,4 +225,5 @@ typedef struct hdspm_version hdspm_version_t;
131typedef struct hdspm_channelfader snd_hdspm_channelfader_t; 225typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
132typedef struct hdspm_mixer hdspm_mixer_t; 226typedef struct hdspm_mixer hdspm_mixer_t;
133 227
134#endif /* __SOUND_HDSPM_H */ 228
229#endif
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h
index 51fbcb4a277a..13cb0b430a1b 100644
--- a/include/sound/mixer_oss.h
+++ b/include/sound/mixer_oss.h
@@ -73,6 +73,9 @@ struct snd_mixer_oss_file {
73 struct snd_mixer_oss *mixer; 73 struct snd_mixer_oss *mixer;
74}; 74};
75 75
76int snd_mixer_oss_ioctl_card(struct snd_card *card,
77 unsigned int cmd, unsigned long arg);
78
76#endif /* CONFIG_SND_MIXER_OSS */ 79#endif /* CONFIG_SND_MIXER_OSS */
77 80
78#endif /* __SOUND_MIXER_OSS_H */ 81#endif /* __SOUND_MIXER_OSS_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index e731f8d71934..430a9cc045e2 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -136,48 +136,49 @@ struct snd_pcm_ops {
136 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000) 136 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
137#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\ 137#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
138 SNDRV_PCM_RATE_192000) 138 SNDRV_PCM_RATE_192000)
139#define SNDRV_PCM_FMTBIT_S8 (1ULL << SNDRV_PCM_FORMAT_S8) 139#define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
140#define SNDRV_PCM_FMTBIT_U8 (1ULL << SNDRV_PCM_FORMAT_U8) 140#define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8)
141#define SNDRV_PCM_FMTBIT_S16_LE (1ULL << SNDRV_PCM_FORMAT_S16_LE) 141#define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8)
142#define SNDRV_PCM_FMTBIT_S16_BE (1ULL << SNDRV_PCM_FORMAT_S16_BE) 142#define SNDRV_PCM_FMTBIT_S16_LE _SNDRV_PCM_FMTBIT(S16_LE)
143#define SNDRV_PCM_FMTBIT_U16_LE (1ULL << SNDRV_PCM_FORMAT_U16_LE) 143#define SNDRV_PCM_FMTBIT_S16_BE _SNDRV_PCM_FMTBIT(S16_BE)
144#define SNDRV_PCM_FMTBIT_U16_BE (1ULL << SNDRV_PCM_FORMAT_U16_BE) 144#define SNDRV_PCM_FMTBIT_U16_LE _SNDRV_PCM_FMTBIT(U16_LE)
145#define SNDRV_PCM_FMTBIT_S24_LE (1ULL << SNDRV_PCM_FORMAT_S24_LE) 145#define SNDRV_PCM_FMTBIT_U16_BE _SNDRV_PCM_FMTBIT(U16_BE)
146#define SNDRV_PCM_FMTBIT_S24_BE (1ULL << SNDRV_PCM_FORMAT_S24_BE) 146#define SNDRV_PCM_FMTBIT_S24_LE _SNDRV_PCM_FMTBIT(S24_LE)
147#define SNDRV_PCM_FMTBIT_U24_LE (1ULL << SNDRV_PCM_FORMAT_U24_LE) 147#define SNDRV_PCM_FMTBIT_S24_BE _SNDRV_PCM_FMTBIT(S24_BE)
148#define SNDRV_PCM_FMTBIT_U24_BE (1ULL << SNDRV_PCM_FORMAT_U24_BE) 148#define SNDRV_PCM_FMTBIT_U24_LE _SNDRV_PCM_FMTBIT(U24_LE)
149#define SNDRV_PCM_FMTBIT_S32_LE (1ULL << SNDRV_PCM_FORMAT_S32_LE) 149#define SNDRV_PCM_FMTBIT_U24_BE _SNDRV_PCM_FMTBIT(U24_BE)
150#define SNDRV_PCM_FMTBIT_S32_BE (1ULL << SNDRV_PCM_FORMAT_S32_BE) 150#define SNDRV_PCM_FMTBIT_S32_LE _SNDRV_PCM_FMTBIT(S32_LE)
151#define SNDRV_PCM_FMTBIT_U32_LE (1ULL << SNDRV_PCM_FORMAT_U32_LE) 151#define SNDRV_PCM_FMTBIT_S32_BE _SNDRV_PCM_FMTBIT(S32_BE)
152#define SNDRV_PCM_FMTBIT_U32_BE (1ULL << SNDRV_PCM_FORMAT_U32_BE) 152#define SNDRV_PCM_FMTBIT_U32_LE _SNDRV_PCM_FMTBIT(U32_LE)
153#define SNDRV_PCM_FMTBIT_FLOAT_LE (1ULL << SNDRV_PCM_FORMAT_FLOAT_LE) 153#define SNDRV_PCM_FMTBIT_U32_BE _SNDRV_PCM_FMTBIT(U32_BE)
154#define SNDRV_PCM_FMTBIT_FLOAT_BE (1ULL << SNDRV_PCM_FORMAT_FLOAT_BE) 154#define SNDRV_PCM_FMTBIT_FLOAT_LE _SNDRV_PCM_FMTBIT(FLOAT_LE)
155#define SNDRV_PCM_FMTBIT_FLOAT64_LE (1ULL << SNDRV_PCM_FORMAT_FLOAT64_LE) 155#define SNDRV_PCM_FMTBIT_FLOAT_BE _SNDRV_PCM_FMTBIT(FLOAT_BE)
156#define SNDRV_PCM_FMTBIT_FLOAT64_BE (1ULL << SNDRV_PCM_FORMAT_FLOAT64_BE) 156#define SNDRV_PCM_FMTBIT_FLOAT64_LE _SNDRV_PCM_FMTBIT(FLOAT64_LE)
157#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE (1ULL << SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE) 157#define SNDRV_PCM_FMTBIT_FLOAT64_BE _SNDRV_PCM_FMTBIT(FLOAT64_BE)
158#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE (1ULL << SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE) 158#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_LE)
159#define SNDRV_PCM_FMTBIT_MU_LAW (1ULL << SNDRV_PCM_FORMAT_MU_LAW) 159#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_BE)
160#define SNDRV_PCM_FMTBIT_A_LAW (1ULL << SNDRV_PCM_FORMAT_A_LAW) 160#define SNDRV_PCM_FMTBIT_MU_LAW _SNDRV_PCM_FMTBIT(MU_LAW)
161#define SNDRV_PCM_FMTBIT_IMA_ADPCM (1ULL << SNDRV_PCM_FORMAT_IMA_ADPCM) 161#define SNDRV_PCM_FMTBIT_A_LAW _SNDRV_PCM_FMTBIT(A_LAW)
162#define SNDRV_PCM_FMTBIT_MPEG (1ULL << SNDRV_PCM_FORMAT_MPEG) 162#define SNDRV_PCM_FMTBIT_IMA_ADPCM _SNDRV_PCM_FMTBIT(IMA_ADPCM)
163#define SNDRV_PCM_FMTBIT_GSM (1ULL << SNDRV_PCM_FORMAT_GSM) 163#define SNDRV_PCM_FMTBIT_MPEG _SNDRV_PCM_FMTBIT(MPEG)
164#define SNDRV_PCM_FMTBIT_SPECIAL (1ULL << SNDRV_PCM_FORMAT_SPECIAL) 164#define SNDRV_PCM_FMTBIT_GSM _SNDRV_PCM_FMTBIT(GSM)
165#define SNDRV_PCM_FMTBIT_S24_3LE (1ULL << SNDRV_PCM_FORMAT_S24_3LE) 165#define SNDRV_PCM_FMTBIT_SPECIAL _SNDRV_PCM_FMTBIT(SPECIAL)
166#define SNDRV_PCM_FMTBIT_U24_3LE (1ULL << SNDRV_PCM_FORMAT_U24_3LE) 166#define SNDRV_PCM_FMTBIT_S24_3LE _SNDRV_PCM_FMTBIT(S24_3LE)
167#define SNDRV_PCM_FMTBIT_S24_3BE (1ULL << SNDRV_PCM_FORMAT_S24_3BE) 167#define SNDRV_PCM_FMTBIT_U24_3LE _SNDRV_PCM_FMTBIT(U24_3LE)
168#define SNDRV_PCM_FMTBIT_U24_3BE (1ULL << SNDRV_PCM_FORMAT_U24_3BE) 168#define SNDRV_PCM_FMTBIT_S24_3BE _SNDRV_PCM_FMTBIT(S24_3BE)
169#define SNDRV_PCM_FMTBIT_S20_3LE (1ULL << SNDRV_PCM_FORMAT_S20_3LE) 169#define SNDRV_PCM_FMTBIT_U24_3BE _SNDRV_PCM_FMTBIT(U24_3BE)
170#define SNDRV_PCM_FMTBIT_U20_3LE (1ULL << SNDRV_PCM_FORMAT_U20_3LE) 170#define SNDRV_PCM_FMTBIT_S20_3LE _SNDRV_PCM_FMTBIT(S20_3LE)
171#define SNDRV_PCM_FMTBIT_S20_3BE (1ULL << SNDRV_PCM_FORMAT_S20_3BE) 171#define SNDRV_PCM_FMTBIT_U20_3LE _SNDRV_PCM_FMTBIT(U20_3LE)
172#define SNDRV_PCM_FMTBIT_U20_3BE (1ULL << SNDRV_PCM_FORMAT_U20_3BE) 172#define SNDRV_PCM_FMTBIT_S20_3BE _SNDRV_PCM_FMTBIT(S20_3BE)
173#define SNDRV_PCM_FMTBIT_S18_3LE (1ULL << SNDRV_PCM_FORMAT_S18_3LE) 173#define SNDRV_PCM_FMTBIT_U20_3BE _SNDRV_PCM_FMTBIT(U20_3BE)
174#define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) 174#define SNDRV_PCM_FMTBIT_S18_3LE _SNDRV_PCM_FMTBIT(S18_3LE)
175#define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 175#define SNDRV_PCM_FMTBIT_U18_3LE _SNDRV_PCM_FMTBIT(U18_3LE)
176#define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 176#define SNDRV_PCM_FMTBIT_S18_3BE _SNDRV_PCM_FMTBIT(S18_3BE)
177#define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) 177#define SNDRV_PCM_FMTBIT_U18_3BE _SNDRV_PCM_FMTBIT(U18_3BE)
178#define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) 178#define SNDRV_PCM_FMTBIT_G723_24 _SNDRV_PCM_FMTBIT(G723_24)
179#define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) 179#define SNDRV_PCM_FMTBIT_G723_24_1B _SNDRV_PCM_FMTBIT(G723_24_1B)
180#define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) 180#define SNDRV_PCM_FMTBIT_G723_40 _SNDRV_PCM_FMTBIT(G723_40)
181#define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B)
181 182
182#ifdef SNDRV_LITTLE_ENDIAN 183#ifdef SNDRV_LITTLE_ENDIAN
183#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE 184#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE
@@ -490,7 +491,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,
490int snd_pcm_status(struct snd_pcm_substream *substream, 491int snd_pcm_status(struct snd_pcm_substream *substream,
491 struct snd_pcm_status *status); 492 struct snd_pcm_status *status);
492int snd_pcm_start(struct snd_pcm_substream *substream); 493int snd_pcm_start(struct snd_pcm_substream *substream);
493int snd_pcm_stop(struct snd_pcm_substream *substream, int status); 494int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
494int snd_pcm_drain_done(struct snd_pcm_substream *substream); 495int snd_pcm_drain_done(struct snd_pcm_substream *substream);
495#ifdef CONFIG_PM 496#ifdef CONFIG_PM
496int snd_pcm_suspend(struct snd_pcm_substream *substream); 497int snd_pcm_suspend(struct snd_pcm_substream *substream);
@@ -748,8 +749,8 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
748 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 749 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
749} 750}
750 751
751#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) 752#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)))
752#define params_format(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT)) 753#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT)))
753#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) 754#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
754#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min 755#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min
755#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min 756#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index d79894192ae3..9a155f9d0a12 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -15,67 +15,29 @@
15#define FSI_PORT_A 0 15#define FSI_PORT_A 0
16#define FSI_PORT_B 1 16#define FSI_PORT_B 1
17 17
18/* flags format
19
20 * 0xABCDEEFF
21 *
22 * A: channel size for TDM (input)
23 * B: channel size for TDM (ooutput)
24 * C: inversion
25 * D: mode
26 * E: input format
27 * F: output format
28 */
29
30#include <linux/clk.h> 18#include <linux/clk.h>
31#include <sound/soc.h> 19#include <sound/soc.h>
32 20
33/* TDM channel */ 21/*
34#define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) 22 * flags format
35#define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) 23 *
36 24 * 0x000000BA
37#define SH_FSI_CH_IMASK 0xF0000000 25 *
38#define SH_FSI_CH_OMASK 0x0F000000 26 * A: inversion
39#define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) 27 * B: format mode
40#define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) 28 */
41
42/* clock inversion */
43#define SH_FSI_INVERSION_MASK 0x00F00000
44#define SH_FSI_LRM_INV (1 << 20)
45#define SH_FSI_BRM_INV (1 << 21)
46#define SH_FSI_LRS_INV (1 << 22)
47#define SH_FSI_BRS_INV (1 << 23)
48
49/* mode */
50#define SH_FSI_MODE_MASK 0x000F0000
51#define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */
52#define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */
53
54/* DI format */
55#define SH_FSI_FMT_MASK 0x000000FF
56#define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8)
57#define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0)
58#define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK)
59#define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK)
60
61#define SH_FSI_FMT_MONO 0
62#define SH_FSI_FMT_MONO_DELAY 1
63#define SH_FSI_FMT_PCM 2
64#define SH_FSI_FMT_I2S 3
65#define SH_FSI_FMT_TDM 4
66#define SH_FSI_FMT_TDM_DELAY 5
67#define SH_FSI_FMT_SPDIF 6
68
69
70#define SH_FSI_IFMT_TDM_CH(x) \
71 (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x))
72#define SH_FSI_IFMT_TDM_DELAY_CH(x) \
73 (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x))
74 29
75#define SH_FSI_OFMT_TDM_CH(x) \ 30/* A: clock inversion */
76 (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) 31#define SH_FSI_INVERSION_MASK 0x0000000F
77#define SH_FSI_OFMT_TDM_DELAY_CH(x) \ 32#define SH_FSI_LRM_INV (1 << 0)
78 (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) 33#define SH_FSI_BRM_INV (1 << 1)
34#define SH_FSI_LRS_INV (1 << 2)
35#define SH_FSI_BRS_INV (1 << 3)
36
37/* B: format mode */
38#define SH_FSI_FMT_MASK 0x000000F0
39#define SH_FSI_FMT_DAI (0 << 4)
40#define SH_FSI_FMT_SPDIF (1 << 4)
79 41
80 42
81/* 43/*
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 8031769ac485..979ed84e07d6 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -157,6 +157,18 @@
157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags} 158 .event = wevent, .event_flags = wflags}
159 159
160/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
169 .shift = wshift, .invert = winvert, .event = wevent, \
170 .event_flags = wflags, .subseq = wsubseq}
171
160/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
161#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
162 wevent, wflags) \ 174 wevent, wflags) \
@@ -450,6 +462,7 @@ struct snd_soc_dapm_widget {
450 unsigned char ext:1; /* has external widgets */ 462 unsigned char ext:1; /* has external widgets */
451 unsigned char force:1; /* force state */ 463 unsigned char force:1; /* force state */
452 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 464 unsigned char ignore_suspend:1; /* kept enabled over suspend */
465 int subseq; /* sort within widget type */
453 466
454 int (*power_check)(struct snd_soc_dapm_widget *w); 467 int (*power_check)(struct snd_soc_dapm_widget *w);
455 468
@@ -487,6 +500,9 @@ struct snd_soc_dapm_context {
487 500
488 struct snd_soc_dapm_update *update; 501 struct snd_soc_dapm_update *update;
489 502
503 void (*seq_notifier)(struct snd_soc_dapm_context *,
504 enum snd_soc_dapm_type, int);
505
490 struct device *dev; /* from parent - for debug */ 506 struct device *dev; /* from parent - for debug */
491 struct snd_soc_codec *codec; /* parent codec */ 507 struct snd_soc_codec *codec; /* parent codec */
492 struct snd_soc_card *card; /* parent card */ 508 struct snd_soc_card *card; /* parent card */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 74921f20a1d8..bfa4836ea107 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -234,6 +234,7 @@ struct snd_soc_codec;
234struct snd_soc_codec_driver; 234struct snd_soc_codec_driver;
235struct soc_enum; 235struct soc_enum;
236struct snd_soc_jack; 236struct snd_soc_jack;
237struct snd_soc_jack_zone;
237struct snd_soc_jack_pin; 238struct snd_soc_jack_pin;
238struct snd_soc_cache_ops; 239struct snd_soc_cache_ops;
239#include <sound/soc-dapm.h> 240#include <sound/soc-dapm.h>
@@ -258,6 +259,16 @@ enum snd_soc_compress_type {
258 SND_SOC_RBTREE_COMPRESSION 259 SND_SOC_RBTREE_COMPRESSION
259}; 260};
260 261
262int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
263 unsigned int freq, int dir);
264int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
265 unsigned int freq_in, unsigned int freq_out);
266
267int snd_soc_register_card(struct snd_soc_card *card);
268int snd_soc_unregister_card(struct snd_soc_card *card);
269int snd_soc_suspend(struct device *dev);
270int snd_soc_resume(struct device *dev);
271int snd_soc_poweroff(struct device *dev);
261int snd_soc_register_platform(struct device *dev, 272int snd_soc_register_platform(struct device *dev,
262 struct snd_soc_platform_driver *platform_drv); 273 struct snd_soc_platform_driver *platform_drv);
263void snd_soc_unregister_platform(struct device *dev); 274void snd_soc_unregister_platform(struct device *dev);
@@ -265,7 +276,8 @@ int snd_soc_register_codec(struct device *dev,
265 const struct snd_soc_codec_driver *codec_drv, 276 const struct snd_soc_codec_driver *codec_drv,
266 struct snd_soc_dai_driver *dai_drv, int num_dai); 277 struct snd_soc_dai_driver *dai_drv, int num_dai);
267void snd_soc_unregister_codec(struct device *dev); 278void snd_soc_unregister_codec(struct device *dev);
268int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 279int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
280 unsigned int reg);
269int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 281int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
270 int addr_bits, int data_bits, 282 int addr_bits, int data_bits,
271 enum snd_soc_control_type control); 283 enum snd_soc_control_type control);
@@ -276,6 +288,10 @@ int snd_soc_cache_write(struct snd_soc_codec *codec,
276 unsigned int reg, unsigned int value); 288 unsigned int reg, unsigned int value);
277int snd_soc_cache_read(struct snd_soc_codec *codec, 289int snd_soc_cache_read(struct snd_soc_codec *codec,
278 unsigned int reg, unsigned int *value); 290 unsigned int reg, unsigned int *value);
291int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
292 unsigned int reg);
293int snd_soc_default_readable_register(struct snd_soc_codec *codec,
294 unsigned int reg);
279 295
280/* Utility functions to get clock rates from various things */ 296/* Utility functions to get clock rates from various things */
281int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 297int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -297,6 +313,9 @@ void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
297 struct notifier_block *nb); 313 struct notifier_block *nb);
298void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, 314void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
299 struct notifier_block *nb); 315 struct notifier_block *nb);
316int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
317 struct snd_soc_jack_zone *zones);
318int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
300#ifdef CONFIG_GPIOLIB 319#ifdef CONFIG_GPIOLIB
301int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, 320int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
302 struct snd_soc_jack_gpio *gpios); 321 struct snd_soc_jack_gpio *gpios);
@@ -321,7 +340,8 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
321 *Controls 340 *Controls
322 */ 341 */
323struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 342struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
324 void *data, char *long_name); 343 void *data, char *long_name,
344 const char *prefix);
325int snd_soc_add_controls(struct snd_soc_codec *codec, 345int snd_soc_add_controls(struct snd_soc_codec *codec,
326 const struct snd_kcontrol_new *controls, int num_controls); 346 const struct snd_kcontrol_new *controls, int num_controls);
327int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 347int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
@@ -367,6 +387,22 @@ int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
367 struct snd_ctl_elem_value *ucontrol); 387 struct snd_ctl_elem_value *ucontrol);
368 388
369/** 389/**
390 * struct snd_soc_reg_access - Describes whether a given register is
391 * readable, writable or volatile.
392 *
393 * @reg: the register number
394 * @read: whether this register is readable
395 * @write: whether this register is writable
396 * @vol: whether this register is volatile
397 */
398struct snd_soc_reg_access {
399 u16 reg;
400 u16 read;
401 u16 write;
402 u16 vol;
403};
404
405/**
370 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 406 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
371 * 407 *
372 * @pin: name of the pin to update 408 * @pin: name of the pin to update
@@ -381,6 +417,24 @@ struct snd_soc_jack_pin {
381}; 417};
382 418
383/** 419/**
420 * struct snd_soc_jack_zone - Describes voltage zones of jack detection
421 *
422 * @min_mv: start voltage in mv
423 * @max_mv: end voltage in mv
424 * @jack_type: type of jack that is expected for this voltage
425 * @debounce_time: debounce_time for jack, codec driver should wait for this
426 * duration before reading the adc for voltages
427 * @:list: list container
428 */
429struct snd_soc_jack_zone {
430 unsigned int min_mv;
431 unsigned int max_mv;
432 unsigned int jack_type;
433 unsigned int debounce_time;
434 struct list_head list;
435};
436
437/**
384 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection 438 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
385 * 439 *
386 * @gpio: gpio number 440 * @gpio: gpio number
@@ -388,6 +442,10 @@ struct snd_soc_jack_pin {
388 * @report: value to report when jack detected 442 * @report: value to report when jack detected
389 * @invert: report presence in low state 443 * @invert: report presence in low state
390 * @debouce_time: debouce time in ms 444 * @debouce_time: debouce time in ms
445 * @wake: enable as wake source
446 * @jack_status_check: callback function which overrides the detection
447 * to provide more complex checks (eg, reading an
448 * ADC).
391 */ 449 */
392#ifdef CONFIG_GPIOLIB 450#ifdef CONFIG_GPIOLIB
393struct snd_soc_jack_gpio { 451struct snd_soc_jack_gpio {
@@ -396,6 +454,8 @@ struct snd_soc_jack_gpio {
396 int report; 454 int report;
397 int invert; 455 int invert;
398 int debounce_time; 456 int debounce_time;
457 bool wake;
458
399 struct snd_soc_jack *jack; 459 struct snd_soc_jack *jack;
400 struct delayed_work work; 460 struct delayed_work work;
401 461
@@ -409,6 +469,7 @@ struct snd_soc_jack {
409 struct list_head pins; 469 struct list_head pins;
410 int status; 470 int status;
411 struct blocking_notifier_head notifier; 471 struct blocking_notifier_head notifier;
472 struct list_head jack_zones;
412}; 473};
413 474
414/* SoC PCM stream information */ 475/* SoC PCM stream information */
@@ -459,18 +520,22 @@ struct snd_soc_codec {
459 struct list_head card_list; 520 struct list_head card_list;
460 int num_dai; 521 int num_dai;
461 enum snd_soc_compress_type compress_type; 522 enum snd_soc_compress_type compress_type;
523 size_t reg_size; /* reg_cache_size * reg_word_size */
524 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
525 int (*readable_register)(struct snd_soc_codec *, unsigned int);
462 526
463 /* runtime */ 527 /* runtime */
464 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 528 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
465 unsigned int active; 529 unsigned int active;
466 unsigned int cache_only:1; /* Suppress writes to hardware */ 530 unsigned int cache_bypass:1; /* Suppress access to the cache */
467 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
468 unsigned int suspended:1; /* Codec is in suspend PM state */ 531 unsigned int suspended:1; /* Codec is in suspend PM state */
469 unsigned int probed:1; /* Codec has been probed */ 532 unsigned int probed:1; /* Codec has been probed */
470 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 533 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
471 unsigned int ac97_created:1; /* Codec has been created by SoC */ 534 unsigned int ac97_created:1; /* Codec has been created by SoC */
472 unsigned int sysfs_registered:1; /* codec has been sysfs registered */ 535 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
473 unsigned int cache_init:1; /* codec cache has been initialized */ 536 unsigned int cache_init:1; /* codec cache has been initialized */
537 u32 cache_only; /* Suppress writes to hardware */
538 u32 cache_sync; /* Cache needs to be synced to hardware */
474 539
475 /* codec IO */ 540 /* codec IO */
476 void *control_data; /* codec control (i2c/3wire) data */ 541 void *control_data; /* codec control (i2c/3wire) data */
@@ -503,22 +568,39 @@ struct snd_soc_codec_driver {
503 pm_message_t state); 568 pm_message_t state);
504 int (*resume)(struct snd_soc_codec *); 569 int (*resume)(struct snd_soc_codec *);
505 570
571 /* Default DAPM setup, added after probe() is run */
572 const struct snd_soc_dapm_widget *dapm_widgets;
573 int num_dapm_widgets;
574 const struct snd_soc_dapm_route *dapm_routes;
575 int num_dapm_routes;
576
577 /* codec wide operations */
578 int (*set_sysclk)(struct snd_soc_codec *codec,
579 int clk_id, unsigned int freq, int dir);
580 int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
581 unsigned int freq_in, unsigned int freq_out);
582
506 /* codec IO */ 583 /* codec IO */
507 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 584 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
508 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 585 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
509 int (*display_register)(struct snd_soc_codec *, char *, 586 int (*display_register)(struct snd_soc_codec *, char *,
510 size_t, unsigned int); 587 size_t, unsigned int);
511 int (*volatile_register)(unsigned int); 588 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
512 int (*readable_register)(unsigned int); 589 int (*readable_register)(struct snd_soc_codec *, unsigned int);
513 short reg_cache_size; 590 short reg_cache_size;
514 short reg_cache_step; 591 short reg_cache_step;
515 short reg_word_size; 592 short reg_word_size;
516 const void *reg_cache_default; 593 const void *reg_cache_default;
594 short reg_access_size;
595 const struct snd_soc_reg_access *reg_access_default;
517 enum snd_soc_compress_type compress_type; 596 enum snd_soc_compress_type compress_type;
518 597
519 /* codec bias level */ 598 /* codec bias level */
520 int (*set_bias_level)(struct snd_soc_codec *, 599 int (*set_bias_level)(struct snd_soc_codec *,
521 enum snd_soc_bias_level level); 600 enum snd_soc_bias_level level);
601
602 void (*seq_notifier)(struct snd_soc_dapm_context *,
603 enum snd_soc_dapm_type, int);
522}; 604};
523 605
524/* SoC platform interface */ 606/* SoC platform interface */
@@ -617,15 +699,16 @@ struct snd_soc_card {
617 699
618 bool instantiated; 700 bool instantiated;
619 701
620 int (*probe)(struct platform_device *pdev); 702 int (*probe)(struct snd_soc_card *card);
621 int (*remove)(struct platform_device *pdev); 703 int (*late_probe)(struct snd_soc_card *card);
704 int (*remove)(struct snd_soc_card *card);
622 705
623 /* the pre and post PM functions are used to do any PM work before and 706 /* the pre and post PM functions are used to do any PM work before and
624 * after the codec and DAI's do any PM work. */ 707 * after the codec and DAI's do any PM work. */
625 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); 708 int (*suspend_pre)(struct snd_soc_card *card);
626 int (*suspend_post)(struct platform_device *pdev, pm_message_t state); 709 int (*suspend_post)(struct snd_soc_card *card);
627 int (*resume_pre)(struct platform_device *pdev); 710 int (*resume_pre)(struct snd_soc_card *card);
628 int (*resume_post)(struct platform_device *pdev); 711 int (*resume_post)(struct snd_soc_card *card);
629 712
630 /* callbacks */ 713 /* callbacks */
631 int (*set_bias_level)(struct snd_soc_card *, 714 int (*set_bias_level)(struct snd_soc_card *,
@@ -654,6 +737,14 @@ struct snd_soc_card {
654 struct snd_soc_pcm_runtime *rtd_aux; 737 struct snd_soc_pcm_runtime *rtd_aux;
655 int num_aux_rtd; 738 int num_aux_rtd;
656 739
740 /*
741 * Card-specific routes and widgets.
742 */
743 struct snd_soc_dapm_widget *dapm_widgets;
744 int num_dapm_widgets;
745 struct snd_soc_dapm_route *dapm_routes;
746 int num_dapm_routes;
747
657 struct work_struct deferred_resume_work; 748 struct work_struct deferred_resume_work;
658 749
659 /* lists of probed devices belonging to this card */ 750 /* lists of probed devices belonging to this card */
@@ -665,11 +756,16 @@ struct snd_soc_card {
665 struct list_head paths; 756 struct list_head paths;
666 struct list_head dapm_list; 757 struct list_head dapm_list;
667 758
759 /* Generic DAPM context for the card */
760 struct snd_soc_dapm_context dapm;
761
668#ifdef CONFIG_DEBUG_FS 762#ifdef CONFIG_DEBUG_FS
669 struct dentry *debugfs_card_root; 763 struct dentry *debugfs_card_root;
670 struct dentry *debugfs_pop_time; 764 struct dentry *debugfs_pop_time;
671#endif 765#endif
672 u32 pop_time; 766 u32 pop_time;
767
768 void *drvdata;
673}; 769};
674 770
675/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 771/* SoC machine DAI configuration, glues a codec and cpu DAI together */
@@ -721,6 +817,17 @@ unsigned int snd_soc_write(struct snd_soc_codec *codec,
721 817
722/* device driver data */ 818/* device driver data */
723 819
820static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
821 void *data)
822{
823 card->drvdata = data;
824}
825
826static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
827{
828 return card->drvdata;
829}
830
724static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, 831static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
725 void *data) 832 void *data)
726{ 833{
@@ -754,6 +861,22 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
754 return dev_get_drvdata(&rtd->dev); 861 return dev_get_drvdata(&rtd->dev);
755} 862}
756 863
864static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
865{
866 INIT_LIST_HEAD(&card->dai_dev_list);
867 INIT_LIST_HEAD(&card->codec_dev_list);
868 INIT_LIST_HEAD(&card->platform_dev_list);
869 INIT_LIST_HEAD(&card->widgets);
870 INIT_LIST_HEAD(&card->paths);
871 INIT_LIST_HEAD(&card->dapm_list);
872}
873
757#include <sound/soc-dai.h> 874#include <sound/soc-dai.h>
758 875
876#ifdef CONFIG_DEBUG_FS
877extern struct dentry *snd_soc_debugfs_root;
878#endif
879
880extern const struct dev_pm_ops snd_soc_pm_ops;
881
759#endif 882#endif
diff --git a/include/sound/tlv320aic32x4.h b/include/sound/tlv320aic32x4.h
new file mode 100644
index 000000000000..c009f70b4029
--- /dev/null
+++ b/include/sound/tlv320aic32x4.h
@@ -0,0 +1,31 @@
1/*
2 * tlv320aic32x4.h -- TLV320AIC32X4 Soc Audio driver platform data
3 *
4 * Copyright 2011 Vista Silicon S.L.
5 *
6 * Author: Javier Martin <javier.martin@vista-silicon.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _AIC32X4_PDATA_H
14#define _AIC32X4_PDATA_H
15
16#define AIC32X4_PWR_MICBIAS_2075_LDOIN 0x00000001
17#define AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE 0x00000002
18#define AIC32X4_PWR_AIC32X4_LDO_ENABLE 0x00000004
19#define AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36 0x00000008
20#define AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED 0x00000010
21
22#define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K 0x00000001
23#define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K 0x00000002
24
25struct aic32x4_pdata {
26 u32 power_cfg;
27 u32 micpga_routing;
28 bool swapdacs;
29};
30
31#endif
diff --git a/include/sound/version.h b/include/sound/version.h
index bf69a5b7e65f..8fc5321e1ecc 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h */ 1/* include/version.h */
2#define CONFIG_SND_VERSION "1.0.23" 2#define CONFIG_SND_VERSION "1.0.24"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h
index 1eeebd534f7e..cf7ccb76a8de 100644
--- a/include/sound/wm8903.h
+++ b/include/sound/wm8903.h
@@ -33,6 +33,21 @@
33#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ 33#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */
34 34
35/* 35/*
36 * WM8903_GPn_FN values
37 *
38 * See datasheets for list of valid values per pin
39 */
40#define WM8903_GPn_FN_GPIO_OUTPUT 0
41#define WM8903_GPn_FN_BCLK 1
42#define WM8903_GPn_FN_IRQ_OUTPT 2
43#define WM8903_GPn_FN_GPIO_INPUT 3
44#define WM8903_GPn_FN_MICBIAS_CURRENT_DETECT 4
45#define WM8903_GPn_FN_MICBIAS_SHORT_DETECT 5
46#define WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT 6
47#define WM8903_GPn_FN_FLL_LOCK_OUTPUT 8
48#define WM8903_GPn_FN_FLL_CLOCK_OUTPUT 9
49
50/*
36 * R116 (0x74) - GPIO Control 1 51 * R116 (0x74) - GPIO Control 1
37 */ 52 */
38#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ 53#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */
@@ -227,6 +242,8 @@
227#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ 242#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */
228#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ 243#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */
229 244
245#define WM8903_NUM_GPIO 5
246
230struct wm8903_platform_data { 247struct wm8903_platform_data {
231 bool irq_active_low; /* Set if IRQ active low, default high */ 248 bool irq_active_low; /* Set if IRQ active low, default high */
232 249
@@ -239,7 +256,8 @@ struct wm8903_platform_data {
239 256
240 int micdet_delay; /* Delay after microphone detection (ms) */ 257 int micdet_delay; /* Delay after microphone detection (ms) */
241 258
242 u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ 259 int gpio_base;
260 u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */
243}; 261};
244 262
245#endif 263#endif
diff --git a/include/sound/wm9081.h b/include/sound/wm9081.h
index e173ddbf6bd4..f34b0b1716d8 100644
--- a/include/sound/wm9081.h
+++ b/include/sound/wm9081.h
@@ -17,9 +17,12 @@ struct wm9081_retune_mobile_setting {
17 u16 config[20]; 17 u16 config[20];
18}; 18};
19 19
20struct wm9081_retune_mobile_config { 20struct wm9081_pdata {
21 struct wm9081_retune_mobile_setting *configs; 21 bool irq_high; /* IRQ is active high */
22 int num_configs; 22 bool irq_cmos; /* IRQ is in CMOS mode */
23
24 struct wm9081_retune_mobile_setting *retune_configs;
25 int num_retune_configs;
23}; 26};
24 27
25#endif 28#endif
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
index 186e84db4b54..ae973d2e27a1 100644
--- a/include/trace/events/asoc.h
+++ b/include/trace/events/asoc.h
@@ -229,6 +229,31 @@ TRACE_EVENT(snd_soc_jack_notify,
229 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) 229 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
230); 230);
231 231
232TRACE_EVENT(snd_soc_cache_sync,
233
234 TP_PROTO(struct snd_soc_codec *codec, const char *type,
235 const char *status),
236
237 TP_ARGS(codec, type, status),
238
239 TP_STRUCT__entry(
240 __string( name, codec->name )
241 __string( status, status )
242 __string( type, type )
243 __field( int, id )
244 ),
245
246 TP_fast_assign(
247 __assign_str(name, codec->name);
248 __assign_str(status, status);
249 __assign_str(type, type);
250 __entry->id = codec->id;
251 ),
252
253 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
254 (int)__entry->id, __get_str(type), __get_str(status))
255);
256
232#endif /* _TRACE_ASOC_H */ 257#endif /* _TRACE_ASOC_H */
233 258
234/* This part must be outside protection */ 259/* This part must be outside protection */
diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
index 25fbefdf2f2e..db6c93510f74 100644
--- a/include/trace/events/scsi.h
+++ b/include/trace/events/scsi.h
@@ -184,6 +184,17 @@
184 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ 184 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \
185 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) 185 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED))
186 186
187#define scsi_prot_op_name(result) { result, #result }
188#define show_prot_op_name(val) \
189 __print_symbolic(val, \
190 scsi_prot_op_name(SCSI_PROT_NORMAL), \
191 scsi_prot_op_name(SCSI_PROT_READ_INSERT), \
192 scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \
193 scsi_prot_op_name(SCSI_PROT_READ_STRIP), \
194 scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \
195 scsi_prot_op_name(SCSI_PROT_READ_PASS), \
196 scsi_prot_op_name(SCSI_PROT_WRITE_PASS))
197
187const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); 198const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int);
188#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) 199#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len)
189 200
@@ -202,6 +213,7 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
202 __field( unsigned int, cmd_len ) 213 __field( unsigned int, cmd_len )
203 __field( unsigned int, data_sglen ) 214 __field( unsigned int, data_sglen )
204 __field( unsigned int, prot_sglen ) 215 __field( unsigned int, prot_sglen )
216 __field( unsigned char, prot_op )
205 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 217 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
206 ), 218 ),
207 219
@@ -214,13 +226,15 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
214 __entry->cmd_len = cmd->cmd_len; 226 __entry->cmd_len = cmd->cmd_len;
215 __entry->data_sglen = scsi_sg_count(cmd); 227 __entry->data_sglen = scsi_sg_count(cmd);
216 __entry->prot_sglen = scsi_prot_sg_count(cmd); 228 __entry->prot_sglen = scsi_prot_sg_count(cmd);
229 __entry->prot_op = scsi_get_prot_op(cmd);
217 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 230 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
218 ), 231 ),
219 232
220 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ 233 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
221 " cmnd=(%s %s raw=%s)", 234 " prot_op=%s cmnd=(%s %s raw=%s)",
222 __entry->host_no, __entry->channel, __entry->id, 235 __entry->host_no, __entry->channel, __entry->id,
223 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 236 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
237 show_prot_op_name(__entry->prot_op),
224 show_opcode_name(__entry->opcode), 238 show_opcode_name(__entry->opcode),
225 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 239 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
226 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) 240 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len))
@@ -242,6 +256,7 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
242 __field( unsigned int, cmd_len ) 256 __field( unsigned int, cmd_len )
243 __field( unsigned int, data_sglen ) 257 __field( unsigned int, data_sglen )
244 __field( unsigned int, prot_sglen ) 258 __field( unsigned int, prot_sglen )
259 __field( unsigned char, prot_op )
245 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 260 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
246 ), 261 ),
247 262
@@ -255,13 +270,15 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
255 __entry->cmd_len = cmd->cmd_len; 270 __entry->cmd_len = cmd->cmd_len;
256 __entry->data_sglen = scsi_sg_count(cmd); 271 __entry->data_sglen = scsi_sg_count(cmd);
257 __entry->prot_sglen = scsi_prot_sg_count(cmd); 272 __entry->prot_sglen = scsi_prot_sg_count(cmd);
273 __entry->prot_op = scsi_get_prot_op(cmd);
258 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 274 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
259 ), 275 ),
260 276
261 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ 277 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
262 " cmnd=(%s %s raw=%s) rtn=%d", 278 " prot_op=%s cmnd=(%s %s raw=%s) rtn=%d",
263 __entry->host_no, __entry->channel, __entry->id, 279 __entry->host_no, __entry->channel, __entry->id,
264 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 280 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
281 show_prot_op_name(__entry->prot_op),
265 show_opcode_name(__entry->opcode), 282 show_opcode_name(__entry->opcode),
266 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 283 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
267 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), 284 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
@@ -284,6 +301,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
284 __field( unsigned int, cmd_len ) 301 __field( unsigned int, cmd_len )
285 __field( unsigned int, data_sglen ) 302 __field( unsigned int, data_sglen )
286 __field( unsigned int, prot_sglen ) 303 __field( unsigned int, prot_sglen )
304 __field( unsigned char, prot_op )
287 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 305 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
288 ), 306 ),
289 307
@@ -297,14 +315,16 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
297 __entry->cmd_len = cmd->cmd_len; 315 __entry->cmd_len = cmd->cmd_len;
298 __entry->data_sglen = scsi_sg_count(cmd); 316 __entry->data_sglen = scsi_sg_count(cmd);
299 __entry->prot_sglen = scsi_prot_sg_count(cmd); 317 __entry->prot_sglen = scsi_prot_sg_count(cmd);
318 __entry->prot_op = scsi_get_prot_op(cmd);
300 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 319 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
301 ), 320 ),
302 321
303 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ 322 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \
304 "prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \ 323 "prot_sgl=%u prot_op=%s cmnd=(%s %s raw=%s) result=(driver=" \
305 "message=%s status=%s)", 324 "%s host=%s message=%s status=%s)",
306 __entry->host_no, __entry->channel, __entry->id, 325 __entry->host_no, __entry->channel, __entry->id,
307 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 326 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
327 show_prot_op_name(__entry->prot_op),
308 show_opcode_name(__entry->opcode), 328 show_opcode_name(__entry->opcode),
309 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 329 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
310 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), 330 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
new file mode 100644
index 000000000000..a2b22f01a51d
--- /dev/null
+++ b/include/xen/balloon.h
@@ -0,0 +1,25 @@
1/******************************************************************************
2 * Xen balloon functionality
3 */
4
5#define RETRY_UNLIMITED 0
6
7struct balloon_stats {
8 /* We aim for 'current allocation' == 'target allocation'. */
9 unsigned long current_pages;
10 unsigned long target_pages;
11 /* Number of pages in high- and low-memory balloons. */
12 unsigned long balloon_low;
13 unsigned long balloon_high;
14 unsigned long schedule_delay;
15 unsigned long max_schedule_delay;
16 unsigned long retry_count;
17 unsigned long max_retry_count;
18};
19
20extern struct balloon_stats balloon_stats;
21
22void balloon_set_new_target(unsigned long target);
23
24int alloc_xenballooned_pages(int nr_pages, struct page** pages);
25void free_xenballooned_pages(int nr_pages, struct page** pages);
diff --git a/include/xen/events.h b/include/xen/events.h
index d3b9010ee96a..f1b87ad48ac7 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -47,9 +47,9 @@ static inline void notify_remote_via_evtchn(int port)
47 (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); 47 (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
48} 48}
49 49
50extern void notify_remote_via_irq(int irq); 50void notify_remote_via_irq(int irq);
51 51
52extern void xen_irq_resume(void); 52void xen_irq_resume(void);
53 53
54/* Clear an irq's pending state, in preparation for polling on it */ 54/* Clear an irq's pending state, in preparation for polling on it */
55void xen_clear_irq_pending(int irq); 55void xen_clear_irq_pending(int irq);
@@ -68,20 +68,22 @@ void xen_poll_irq_timeout(int irq, u64 timeout);
68unsigned irq_from_evtchn(unsigned int evtchn); 68unsigned irq_from_evtchn(unsigned int evtchn);
69 69
70/* Xen HVM evtchn vector callback */ 70/* Xen HVM evtchn vector callback */
71extern void xen_hvm_callback_vector(void); 71void xen_hvm_callback_vector(void);
72extern int xen_have_vector_callback; 72extern int xen_have_vector_callback;
73int xen_set_callback_via(uint64_t via); 73int xen_set_callback_via(uint64_t via);
74void xen_evtchn_do_upcall(struct pt_regs *regs); 74void xen_evtchn_do_upcall(struct pt_regs *regs);
75void xen_hvm_evtchn_do_upcall(void); 75void xen_hvm_evtchn_do_upcall(void);
76 76
77/* Allocate an irq for a physical interrupt, given a gsi. "Legacy" 77/* Allocate a pirq for a physical interrupt, given a gsi. */
78 * GSIs are identity mapped; others are dynamically allocated as 78int xen_allocate_pirq_gsi(unsigned gsi);
79 * usual. */ 79/* Bind a pirq for a physical interrupt to an irq. */
80int xen_allocate_pirq(unsigned gsi, int shareable, char *name); 80int xen_bind_pirq_gsi_to_irq(unsigned gsi,
81int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name); 81 unsigned pirq, int shareable, char *name);
82 82
83#ifdef CONFIG_PCI_MSI 83#ifdef CONFIG_PCI_MSI
84/* Allocate a pirq for a MSI style physical interrupt. */
84int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); 85int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc);
86/* Bind an PSI pirq to an irq. */
85int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, 87int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
86 int pirq, int vector, const char *name); 88 int pirq, int vector, const char *name);
87#endif 89#endif
@@ -89,12 +91,6 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
89/* De-allocates the above mentioned physical interrupt. */ 91/* De-allocates the above mentioned physical interrupt. */
90int xen_destroy_irq(int irq); 92int xen_destroy_irq(int irq);
91 93
92/* Return vector allocated to pirq */
93int xen_vector_from_irq(unsigned pirq);
94
95/* Return gsi allocated to pirq */
96int xen_gsi_from_irq(unsigned pirq);
97
98/* Return irq from pirq */ 94/* Return irq from pirq */
99int xen_irq_from_pirq(unsigned pirq); 95int xen_irq_from_pirq(unsigned pirq);
100 96
diff --git a/include/xen/gntalloc.h b/include/xen/gntalloc.h
new file mode 100644
index 000000000000..76bd58065f4f
--- /dev/null
+++ b/include/xen/gntalloc.h
@@ -0,0 +1,82 @@
1/******************************************************************************
2 * gntalloc.h
3 *
4 * Interface to /dev/xen/gntalloc.
5 *
6 * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
7 *
8 * This file is in the public domain.
9 */
10
11#ifndef __LINUX_PUBLIC_GNTALLOC_H__
12#define __LINUX_PUBLIC_GNTALLOC_H__
13
14/*
15 * Allocates a new page and creates a new grant reference.
16 */
17#define IOCTL_GNTALLOC_ALLOC_GREF \
18_IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref))
19struct ioctl_gntalloc_alloc_gref {
20 /* IN parameters */
21 /* The ID of the domain to be given access to the grants. */
22 uint16_t domid;
23 /* Flags for this mapping */
24 uint16_t flags;
25 /* Number of pages to map */
26 uint32_t count;
27 /* OUT parameters */
28 /* The offset to be used on a subsequent call to mmap(). */
29 uint64_t index;
30 /* The grant references of the newly created grant, one per page */
31 /* Variable size, depending on count */
32 uint32_t gref_ids[1];
33};
34
35#define GNTALLOC_FLAG_WRITABLE 1
36
37/*
38 * Deallocates the grant reference, allowing the associated page to be freed if
39 * no other domains are using it.
40 */
41#define IOCTL_GNTALLOC_DEALLOC_GREF \
42_IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref))
43struct ioctl_gntalloc_dealloc_gref {
44 /* IN parameters */
45 /* The offset returned in the map operation */
46 uint64_t index;
47 /* Number of references to unmap */
48 uint32_t count;
49};
50
51/*
52 * Sets up an unmap notification within the page, so that the other side can do
53 * cleanup if this side crashes. Required to implement cross-domain robust
54 * mutexes or close notification on communication channels.
55 *
56 * Each mapped page only supports one notification; multiple calls referring to
57 * the same page overwrite the previous notification. You must clear the
58 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
59 * to occur.
60 */
61#define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \
62_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify))
63struct ioctl_gntalloc_unmap_notify {
64 /* IN parameters */
65 /* Offset in the file descriptor for a byte within the page (same as
66 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
67 * be cleared. Otherwise, it can be any byte in the page whose
68 * notification we are adjusting.
69 */
70 uint64_t index;
71 /* Action(s) to take on unmap */
72 uint32_t action;
73 /* Event channel to notify */
74 uint32_t event_channel_port;
75};
76
77/* Clear (set to zero) the byte specified by index */
78#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
79/* Send an interrupt on the indicated event channel */
80#define UNMAP_NOTIFY_SEND_EVENT 0x2
81
82#endif /* __LINUX_PUBLIC_GNTALLOC_H__ */
diff --git a/include/xen/gntdev.h b/include/xen/gntdev.h
index eb23f4188f5a..5304bd3c84c5 100644
--- a/include/xen/gntdev.h
+++ b/include/xen/gntdev.h
@@ -116,4 +116,35 @@ struct ioctl_gntdev_set_max_grants {
116 uint32_t count; 116 uint32_t count;
117}; 117};
118 118
119/*
120 * Sets up an unmap notification within the page, so that the other side can do
121 * cleanup if this side crashes. Required to implement cross-domain robust
122 * mutexes or close notification on communication channels.
123 *
124 * Each mapped page only supports one notification; multiple calls referring to
125 * the same page overwrite the previous notification. You must clear the
126 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
127 * to occur.
128 */
129#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \
130_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
131struct ioctl_gntdev_unmap_notify {
132 /* IN parameters */
133 /* Offset in the file descriptor for a byte within the page (same as
134 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
135 * be cleared. Otherwise, it can be any byte in the page whose
136 * notification we are adjusting.
137 */
138 uint64_t index;
139 /* Action(s) to take on unmap */
140 uint32_t action;
141 /* Event channel to notify */
142 uint32_t event_channel_port;
143};
144
145/* Clear (set to zero) the byte specified by index */
146#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
147/* Send an interrupt on the indicated event channel */
148#define UNMAP_NOTIFY_SEND_EVENT 0x2
149
119#endif /* __LINUX_PUBLIC_GNTDEV_H__ */ 150#endif /* __LINUX_PUBLIC_GNTDEV_H__ */
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
index 5fec575a800a..dd55dac340de 100644
--- a/include/xen/interface/sched.h
+++ b/include/xen/interface/sched.h
@@ -65,6 +65,39 @@ struct sched_poll {
65DEFINE_GUEST_HANDLE_STRUCT(sched_poll); 65DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
66 66
67/* 67/*
68 * Declare a shutdown for another domain. The main use of this function is
69 * in interpreting shutdown requests and reasons for fully-virtualized
70 * domains. A para-virtualized domain may use SCHEDOP_shutdown directly.
71 * @arg == pointer to sched_remote_shutdown structure.
72 */
73#define SCHEDOP_remote_shutdown 4
74struct sched_remote_shutdown {
75 domid_t domain_id; /* Remote domain ID */
76 unsigned int reason; /* SHUTDOWN_xxx reason */
77};
78
79/*
80 * Latch a shutdown code, so that when the domain later shuts down it
81 * reports this code to the control tools.
82 * @arg == as for SCHEDOP_shutdown.
83 */
84#define SCHEDOP_shutdown_code 5
85
86/*
87 * Setup, poke and destroy a domain watchdog timer.
88 * @arg == pointer to sched_watchdog structure.
89 * With id == 0, setup a domain watchdog timer to cause domain shutdown
90 * after timeout, returns watchdog id.
91 * With id != 0 and timeout == 0, destroy domain watchdog timer.
92 * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
93 */
94#define SCHEDOP_watchdog 6
95struct sched_watchdog {
96 uint32_t id; /* watchdog ID */
97 uint32_t timeout; /* timeout */
98};
99
100/*
68 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control 101 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
69 * software to determine the appropriate action. For the most part, Xen does 102 * software to determine the appropriate action. For the most part, Xen does
70 * not care about the shutdown code. 103 * not care about the shutdown code.
@@ -73,5 +106,6 @@ DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
73#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ 106#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
74#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ 107#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
75#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ 108#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
109#define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */
76 110
77#endif /* __XEN_PUBLIC_SCHED_H__ */ 111#endif /* __XEN_PUBLIC_SCHED_H__ */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 7a1d15ff19b7..5467369e0889 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -92,7 +92,7 @@ struct xenbus_driver {
92 void (*otherend_changed)(struct xenbus_device *dev, 92 void (*otherend_changed)(struct xenbus_device *dev,
93 enum xenbus_state backend_state); 93 enum xenbus_state backend_state);
94 int (*remove)(struct xenbus_device *dev); 94 int (*remove)(struct xenbus_device *dev);
95 int (*suspend)(struct xenbus_device *dev, pm_message_t state); 95 int (*suspend)(struct xenbus_device *dev);
96 int (*resume)(struct xenbus_device *dev); 96 int (*resume)(struct xenbus_device *dev);
97 int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *); 97 int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *);
98 struct device_driver driver; 98 struct device_driver driver;