aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/audit_change_attr.h4
-rw-r--r--include/asm-generic/vmlinux.lds.h3
-rw-r--r--include/linux/Kbuild5
-rw-r--r--include/linux/audit.h9
-rw-r--r--include/linux/blkdev.h8
-rw-r--r--include/linux/dccp.h4
-rw-r--r--include/linux/fs.h31
-rw-r--r--include/linux/i2c/twl.h77
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/jbd2.h2
-rw-r--r--include/linux/kgdb.h13
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/mfd/88pm860x.h2
-rw-r--r--include/linux/mfd/ab8500.h28
-rw-r--r--include/linux/mfd/abx500.h4
-rw-r--r--include/linux/mfd/core.h3
-rw-r--r--include/linux/mfd/max8998-private.h129
-rw-r--r--include/linux/mfd/max8998.h23
-rw-r--r--include/linux/mfd/mc13783.h239
-rw-r--r--include/linux/mfd/mc13xxx.h154
-rw-r--r--include/linux/mfd/pcf50633/core.h7
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h2
-rw-r--r--include/linux/mfd/stmpe.h6
-rw-r--r--include/linux/mfd/tmio.h6
-rw-r--r--include/linux/mfd/tps6586x.h31
-rw-r--r--include/linux/mfd/wm831x/core.h12
-rw-r--r--include/linux/mmc/card.h6
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/host.h48
-rw-r--r--include/linux/mmc/mmc.h10
-rw-r--r--include/linux/mmc/sdhci-pltfm.h (renamed from include/linux/sdhci-pltfm.h)2
-rw-r--r--include/linux/mmc/sdhci.h144
-rw-r--r--include/linux/mmc/sh_mmcif.h1
-rw-r--r--include/linux/mmu_notifier.h2
-rw-r--r--include/linux/mtd/bbm.h4
-rw-r--r--include/linux/mtd/cfi.h1
-rw-r--r--include/linux/mtd/fsmc.h181
-rw-r--r--include/linux/mtd/inftl.h14
-rw-r--r--include/linux/mtd/mtd.h15
-rw-r--r--include/linux/mtd/nand.h426
-rw-r--r--include/linux/mtd/partitions.h7
-rw-r--r--include/linux/mtd/super.h5
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h28
-rw-r--r--include/linux/pci_regs.h6
-rw-r--r--include/linux/percpu_counter.h10
-rw-r--r--include/linux/ramfs.h4
-rw-r--r--include/linux/regulator/lp3972.h48
-rw-r--r--include/linux/regulator/machine.h5
-rw-r--r--include/linux/regulator/max8952.h135
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/sh_intc.h3
-rw-r--r--include/linux/smb.h118
-rw-r--r--include/linux/smb_fs.h153
-rw-r--r--include/linux/smb_fs_i.h37
-rw-r--r--include/linux/smb_fs_sb.h100
-rw-r--r--include/linux/smb_mount.h65
-rw-r--r--include/linux/smbno.h363
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/ti_wilink_st.h400
-rw-r--r--include/linux/tty.h10
-rw-r--r--include/linux/via-core.h4
-rw-r--r--include/linux/videodev2.h12
-rw-r--r--include/linux/videotext.h125
-rw-r--r--include/linux/writeback.h4
-rw-r--r--include/media/ir-core.h41
-rw-r--r--include/media/ir-kbd-i2c.h10
-rw-r--r--include/media/lirc_dev.h6
-rw-r--r--include/media/omap1_camera.h35
-rw-r--r--include/media/rc-map.h19
-rw-r--r--include/media/s3c_fimc.h60
-rw-r--r--include/media/sh_vou.h1
-rw-r--r--include/media/soc_camera.h9
-rw-r--r--include/media/sr030pc30.h21
-rw-r--r--include/media/v4l2-chip-ident.h8
-rw-r--r--include/media/v4l2-common.h10
-rw-r--r--include/media/v4l2-dev.h8
-rw-r--r--include/media/v4l2-device.h57
-rw-r--r--include/media/v4l2-i2c-drv.h80
-rw-r--r--include/media/v4l2-mediabus.h8
-rw-r--r--include/media/v4l2-subdev.h24
-rw-r--r--include/media/videobuf-core.h19
-rw-r--r--include/media/videobuf-dma-contig.h3
-rw-r--r--include/media/videobuf-dma-sg.h3
-rw-r--r--include/media/videobuf-vmalloc.h3
-rw-r--r--include/media/wm8775.h3
-rw-r--r--include/mtd/mtd-abi.h16
-rw-r--r--include/mtd/mtd-user.h2
-rw-r--r--include/net/9p/9p.h54
-rw-r--r--include/net/9p/client.h4
-rw-r--r--include/net/ip_fib.h2
-rw-r--r--include/trace/events/ext4.h379
-rw-r--r--include/trace/events/jbd2.h78
-rw-r--r--include/video/sh_mobile_lcdc.h5
-rw-r--r--include/xen/events.h26
-rw-r--r--include/xen/interface/features.h3
-rw-r--r--include/xen/interface/io/pciif.h112
-rw-r--r--include/xen/interface/io/xenbus.h8
-rw-r--r--include/xen/interface/physdev.h67
99 files changed, 2798 insertions, 1697 deletions
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h
index 50764550a60c..bcbab3e4a3be 100644
--- a/include/asm-generic/audit_change_attr.h
+++ b/include/asm-generic/audit_change_attr.h
@@ -20,3 +20,7 @@ __NR_chown32,
20__NR_fchown32, 20__NR_fchown32,
21__NR_lchown32, 21__NR_lchown32,
22#endif 22#endif
23__NR_link,
24#ifdef __NR_linkat
25__NR_linkat,
26#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 2c0fc10956ba..bd69d79208de 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -640,7 +640,8 @@
640 . = ALIGN(4); \ 640 . = ALIGN(4); \
641 VMLINUX_SYMBOL(__initramfs_start) = .; \ 641 VMLINUX_SYMBOL(__initramfs_start) = .; \
642 *(.init.ramfs) \ 642 *(.init.ramfs) \
643 VMLINUX_SYMBOL(__initramfs_end) = .; 643 . = ALIGN(8); \
644 *(.init.ramfs.info)
644#else 645#else
645#define INIT_RAM_FS 646#define INIT_RAM_FS
646#endif 647#endif
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 831c4634162c..90e3ed3a3144 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -326,10 +326,6 @@ header-y += serio.h
326header-y += shm.h 326header-y += shm.h
327header-y += signal.h 327header-y += signal.h
328header-y += signalfd.h 328header-y += signalfd.h
329header-y += smb.h
330header-y += smb_fs.h
331header-y += smb_mount.h
332header-y += smbno.h
333header-y += snmp.h 329header-y += snmp.h
334header-y += socket.h 330header-y += socket.h
335header-y += sockios.h 331header-y += sockios.h
@@ -372,7 +368,6 @@ header-y += veth.h
372header-y += vhost.h 368header-y += vhost.h
373header-y += videodev.h 369header-y += videodev.h
374header-y += videodev2.h 370header-y += videodev2.h
375header-y += videotext.h
376header-y += virtio_9p.h 371header-y += virtio_9p.h
377header-y += virtio_balloon.h 372header-y += virtio_balloon.h
378header-y += virtio_blk.h 373header-y += virtio_blk.h
diff --git a/include/linux/audit.h b/include/linux/audit.h
index e24afabc548f..8b5c0620abf9 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -102,6 +102,7 @@
102#define AUDIT_EOE 1320 /* End of multi-record event */ 102#define AUDIT_EOE 1320 /* End of multi-record event */
103#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ 103#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
104#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ 104#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
105#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
105 106
106#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 107#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
107#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 108#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -478,6 +479,7 @@ extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
478 const struct cred *new, 479 const struct cred *new,
479 const struct cred *old); 480 const struct cred *old);
480extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); 481extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old);
482extern void __audit_mmap_fd(int fd, int flags);
481 483
482static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 484static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
483{ 485{
@@ -531,6 +533,12 @@ static inline void audit_log_capset(pid_t pid, const struct cred *new,
531 __audit_log_capset(pid, new, old); 533 __audit_log_capset(pid, new, old);
532} 534}
533 535
536static inline void audit_mmap_fd(int fd, int flags)
537{
538 if (unlikely(!audit_dummy_context()))
539 __audit_mmap_fd(fd, flags);
540}
541
534extern int audit_n_rules; 542extern int audit_n_rules;
535extern int audit_signals; 543extern int audit_signals;
536#else 544#else
@@ -564,6 +572,7 @@ extern int audit_signals;
564#define audit_mq_getsetattr(d,s) ((void)0) 572#define audit_mq_getsetattr(d,s) ((void)0)
565#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) 573#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; })
566#define audit_log_capset(pid, ncr, ocr) ((void)0) 574#define audit_log_capset(pid, ncr, ocr) ((void)0)
575#define audit_mmap_fd(fd, flags) ((void)0)
567#define audit_ptrace(t) ((void)0) 576#define audit_ptrace(t) ((void)0)
568#define audit_n_rules 0 577#define audit_n_rules 0
569#define audit_signals 0 578#define audit_signals 0
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 646b462d04df..5027a599077d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -891,6 +891,14 @@ static inline int sb_issue_discard(struct super_block *sb, sector_t block,
891 nr_blocks << (sb->s_blocksize_bits - 9), 891 nr_blocks << (sb->s_blocksize_bits - 9),
892 gfp_mask, flags); 892 gfp_mask, flags);
893} 893}
894static inline int sb_issue_zeroout(struct super_block *sb, sector_t block,
895 sector_t nr_blocks, gfp_t gfp_mask)
896{
897 return blkdev_issue_zeroout(sb->s_bdev,
898 block << (sb->s_blocksize_bits - 9),
899 nr_blocks << (sb->s_blocksize_bits - 9),
900 gfp_mask);
901}
894 902
895extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 903extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
896 904
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 7187bd8a75f6..749f01ccd26e 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -462,7 +462,8 @@ struct dccp_ackvec;
462 * @dccps_hc_rx_insert_options - receiver wants to add options when acking 462 * @dccps_hc_rx_insert_options - receiver wants to add options when acking
463 * @dccps_hc_tx_insert_options - sender wants to add options when sending 463 * @dccps_hc_tx_insert_options - sender wants to add options when sending
464 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) 464 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3)
465 * @dccps_xmit_timer - timer for when CCID is not ready to send 465 * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
466 * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
466 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) 467 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
467 */ 468 */
468struct dccp_sock { 469struct dccp_sock {
@@ -502,6 +503,7 @@ struct dccp_sock {
502 __u8 dccps_hc_rx_insert_options:1; 503 __u8 dccps_hc_rx_insert_options:1;
503 __u8 dccps_hc_tx_insert_options:1; 504 __u8 dccps_hc_tx_insert_options:1;
504 __u8 dccps_server_timewait:1; 505 __u8 dccps_server_timewait:1;
506 struct tasklet_struct dccps_xmitlet;
505 struct timer_list dccps_xmit_timer; 507 struct timer_list dccps_xmit_timer;
506}; 508};
507 509
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b2a6009cba10..7b7b507ffa1c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
9#include <linux/limits.h> 9#include <linux/limits.h>
10#include <linux/ioctl.h> 10#include <linux/ioctl.h>
11#include <linux/blk_types.h> 11#include <linux/blk_types.h>
12#include <linux/types.h>
12 13
13/* 14/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -32,6 +33,12 @@
32#define SEEK_END 2 /* seek relative to end of file */ 33#define SEEK_END 2 /* seek relative to end of file */
33#define SEEK_MAX SEEK_END 34#define SEEK_MAX SEEK_END
34 35
36struct fstrim_range {
37 uint64_t start;
38 uint64_t len;
39 uint64_t minlen;
40};
41
35/* And dynamically-tunable limits and defaults: */ 42/* And dynamically-tunable limits and defaults: */
36struct files_stat_struct { 43struct files_stat_struct {
37 unsigned long nr_files; /* read only */ 44 unsigned long nr_files; /* read only */
@@ -317,6 +324,7 @@ struct inodes_stat_t {
317#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 324#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
318#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ 325#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
319#define FITHAW _IOWR('X', 120, int) /* Thaw */ 326#define FITHAW _IOWR('X', 120, int) /* Thaw */
327#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
320 328
321#define FS_IOC_GETFLAGS _IOR('f', 1, long) 329#define FS_IOC_GETFLAGS _IOR('f', 1, long)
322#define FS_IOC_SETFLAGS _IOW('f', 2, long) 330#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -1604,6 +1612,7 @@ struct super_operations {
1604 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1612 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1605#endif 1613#endif
1606 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1614 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1615 int (*trim_fs) (struct super_block *, struct fstrim_range *);
1607}; 1616};
1608 1617
1609/* 1618/*
@@ -1763,6 +1772,8 @@ struct file_system_type {
1763 int fs_flags; 1772 int fs_flags;
1764 int (*get_sb) (struct file_system_type *, int, 1773 int (*get_sb) (struct file_system_type *, int,
1765 const char *, void *, struct vfsmount *); 1774 const char *, void *, struct vfsmount *);
1775 struct dentry *(*mount) (struct file_system_type *, int,
1776 const char *, void *);
1766 void (*kill_sb) (struct super_block *); 1777 void (*kill_sb) (struct super_block *);
1767 struct module *owner; 1778 struct module *owner;
1768 struct file_system_type * next; 1779 struct file_system_type * next;
@@ -1778,17 +1789,25 @@ struct file_system_type {
1778 struct lock_class_key i_alloc_sem_key; 1789 struct lock_class_key i_alloc_sem_key;
1779}; 1790};
1780 1791
1781extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, 1792extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
1782 int (*fill_super)(struct super_block *, void *, int), 1793 void *data, int (*fill_super)(struct super_block *, void *, int));
1783 struct vfsmount *mnt); 1794extern struct dentry *mount_bdev(struct file_system_type *fs_type,
1795 int flags, const char *dev_name, void *data,
1796 int (*fill_super)(struct super_block *, void *, int));
1784extern int get_sb_bdev(struct file_system_type *fs_type, 1797extern int get_sb_bdev(struct file_system_type *fs_type,
1785 int flags, const char *dev_name, void *data, 1798 int flags, const char *dev_name, void *data,
1786 int (*fill_super)(struct super_block *, void *, int), 1799 int (*fill_super)(struct super_block *, void *, int),
1787 struct vfsmount *mnt); 1800 struct vfsmount *mnt);
1801extern struct dentry *mount_single(struct file_system_type *fs_type,
1802 int flags, void *data,
1803 int (*fill_super)(struct super_block *, void *, int));
1788extern int get_sb_single(struct file_system_type *fs_type, 1804extern int get_sb_single(struct file_system_type *fs_type,
1789 int flags, void *data, 1805 int flags, void *data,
1790 int (*fill_super)(struct super_block *, void *, int), 1806 int (*fill_super)(struct super_block *, void *, int),
1791 struct vfsmount *mnt); 1807 struct vfsmount *mnt);
1808extern struct dentry *mount_nodev(struct file_system_type *fs_type,
1809 int flags, void *data,
1810 int (*fill_super)(struct super_block *, void *, int));
1792extern int get_sb_nodev(struct file_system_type *fs_type, 1811extern int get_sb_nodev(struct file_system_type *fs_type,
1793 int flags, void *data, 1812 int flags, void *data,
1794 int (*fill_super)(struct super_block *, void *, int), 1813 int (*fill_super)(struct super_block *, void *, int),
@@ -1804,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type,
1804 int (*test)(struct super_block *,void *), 1823 int (*test)(struct super_block *,void *),
1805 int (*set)(struct super_block *,void *), 1824 int (*set)(struct super_block *,void *),
1806 void *data); 1825 void *data);
1807extern int get_sb_pseudo(struct file_system_type *, char *, 1826extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1808 const struct super_operations *ops, unsigned long, 1827 const struct super_operations *ops, unsigned long);
1809 struct vfsmount *mnt);
1810extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1828extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1811 1829
1812static inline void sb_mark_dirty(struct super_block *sb) 1830static inline void sb_mark_dirty(struct super_block *sb)
@@ -1849,6 +1867,7 @@ extern int current_umask(void);
1849/* /sys/fs */ 1867/* /sys/fs */
1850extern struct kobject *fs_kobj; 1868extern struct kobject *fs_kobj;
1851 1869
1870#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
1852extern int rw_verify_area(int, struct file *, loff_t *, size_t); 1871extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1853 1872
1854#define FLOCK_VERIFY_READ 1 1873#define FLOCK_VERIFY_READ 1
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 4793d8a7f480..c760991b354a 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -141,6 +141,16 @@
141#define TWL6030_CHARGER_CTRL_INT_MASK 0x10 141#define TWL6030_CHARGER_CTRL_INT_MASK 0x10
142#define TWL6030_CHARGER_FAULT_INT_MASK 0x60 142#define TWL6030_CHARGER_FAULT_INT_MASK 0x60
143 143
144#define TWL6030_MMCCTRL 0xEE
145#define VMMC_AUTO_OFF (0x1 << 3)
146#define SW_FC (0x1 << 2)
147#define STS_MMC 0x1
148
149#define TWL6030_CFG_INPUT_PUPD3 0xF2
150#define MMC_PU (0x1 << 3)
151#define MMC_PD (0x1 << 2)
152
153
144 154
145#define TWL4030_CLASS_ID 0x4030 155#define TWL4030_CLASS_ID 0x4030
146#define TWL6030_CLASS_ID 0x6030 156#define TWL6030_CLASS_ID 0x6030
@@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
173int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 183int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
174int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 184int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
175 185
186/* Card detect Configuration for MMC1 Controller on OMAP4 */
187#ifdef CONFIG_TWL4030_CORE
188int twl6030_mmc_card_detect_config(void);
189#else
190static inline int twl6030_mmc_card_detect_config(void)
191{
192 pr_debug("twl6030_mmc_card_detect_config not supported\n");
193 return 0;
194}
195#endif
196
197/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */
198#ifdef CONFIG_TWL4030_CORE
199int twl6030_mmc_card_detect(struct device *dev, int slot);
200#else
201static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
202{
203 pr_debug("Call back twl6030_mmc_card_detect not supported\n");
204 return -EIO;
205}
206#endif
176/*----------------------------------------------------------------------*/ 207/*----------------------------------------------------------------------*/
177 208
178/* 209/*
@@ -357,6 +388,52 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
357 388
358/*----------------------------------------------------------------------*/ 389/*----------------------------------------------------------------------*/
359 390
391/*
392 * PM Master module register offsets (use TWL4030_MODULE_PM_MASTER)
393 */
394
395#define TWL4030_PM_MASTER_CFG_P1_TRANSITION 0x00
396#define TWL4030_PM_MASTER_CFG_P2_TRANSITION 0x01
397#define TWL4030_PM_MASTER_CFG_P3_TRANSITION 0x02
398#define TWL4030_PM_MASTER_CFG_P123_TRANSITION 0x03
399#define TWL4030_PM_MASTER_STS_BOOT 0x04
400#define TWL4030_PM_MASTER_CFG_BOOT 0x05
401#define TWL4030_PM_MASTER_SHUNDAN 0x06
402#define TWL4030_PM_MASTER_BOOT_BCI 0x07
403#define TWL4030_PM_MASTER_CFG_PWRANA1 0x08
404#define TWL4030_PM_MASTER_CFG_PWRANA2 0x09
405#define TWL4030_PM_MASTER_BACKUP_MISC_STS 0x0b
406#define TWL4030_PM_MASTER_BACKUP_MISC_CFG 0x0c
407#define TWL4030_PM_MASTER_BACKUP_MISC_TST 0x0d
408#define TWL4030_PM_MASTER_PROTECT_KEY 0x0e
409#define TWL4030_PM_MASTER_STS_HW_CONDITIONS 0x0f
410#define TWL4030_PM_MASTER_P1_SW_EVENTS 0x10
411#define TWL4030_PM_MASTER_P2_SW_EVENTS 0x11
412#define TWL4030_PM_MASTER_P3_SW_EVENTS 0x12
413#define TWL4030_PM_MASTER_STS_P123_STATE 0x13
414#define TWL4030_PM_MASTER_PB_CFG 0x14
415#define TWL4030_PM_MASTER_PB_WORD_MSB 0x15
416#define TWL4030_PM_MASTER_PB_WORD_LSB 0x16
417#define TWL4030_PM_MASTER_SEQ_ADD_W2P 0x1c
418#define TWL4030_PM_MASTER_SEQ_ADD_P2A 0x1d
419#define TWL4030_PM_MASTER_SEQ_ADD_A2W 0x1e
420#define TWL4030_PM_MASTER_SEQ_ADD_A2S 0x1f
421#define TWL4030_PM_MASTER_SEQ_ADD_S2A12 0x20
422#define TWL4030_PM_MASTER_SEQ_ADD_S2A3 0x21
423#define TWL4030_PM_MASTER_SEQ_ADD_WARM 0x22
424#define TWL4030_PM_MASTER_MEMORY_ADDRESS 0x23
425#define TWL4030_PM_MASTER_MEMORY_DATA 0x24
426
427#define TWL4030_PM_MASTER_KEY_CFG1 0xc0
428#define TWL4030_PM_MASTER_KEY_CFG2 0x0c
429
430#define TWL4030_PM_MASTER_KEY_TST1 0xe0
431#define TWL4030_PM_MASTER_KEY_TST2 0x0e
432
433#define TWL4030_PM_MASTER_GLOBAL_TST 0xb6
434
435/*----------------------------------------------------------------------*/
436
360/* Power bus message definitions */ 437/* Power bus message definitions */
361 438
362/* The TWL4030/5030 splits its power-management resources (the various 439/* The TWL4030/5030 splits its power-management resources (the various
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index b22790268b64..d377ea815d45 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -112,6 +112,7 @@ struct resource_list {
112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
113extern struct resource ioport_resource; 113extern struct resource ioport_resource;
114extern struct resource iomem_resource; 114extern struct resource iomem_resource;
115extern int resource_alloc_from_bottom;
115 116
116extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); 117extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
117extern int request_resource(struct resource *root, struct resource *new); 118extern int request_resource(struct resource *root, struct resource *new);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0b52924a0cb6..2ae86aa21fce 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -395,7 +395,7 @@ struct jbd2_inode {
395 struct inode *i_vfs_inode; 395 struct inode *i_vfs_inode;
396 396
397 /* Flags of inode [j_list_lock] */ 397 /* Flags of inode [j_list_lock] */
398 unsigned int i_flags; 398 unsigned long i_flags;
399}; 399};
400 400
401struct jbd2_revoke_table_s; 401struct jbd2_revoke_table_s;
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index cc96f0f23e04..092e4250a458 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -35,16 +35,6 @@ struct pt_regs;
35 */ 35 */
36extern int kgdb_skipexception(int exception, struct pt_regs *regs); 36extern int kgdb_skipexception(int exception, struct pt_regs *regs);
37 37
38/**
39 * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook
40 * @regs: Current &struct pt_regs.
41 *
42 * This function will be called if the particular architecture must
43 * disable hardware debugging while it is processing gdb packets or
44 * handling exception.
45 */
46extern void kgdb_disable_hw_debug(struct pt_regs *regs);
47
48struct tasklet_struct; 38struct tasklet_struct;
49struct task_struct; 39struct task_struct;
50struct uart_port; 40struct uart_port;
@@ -243,6 +233,8 @@ extern void kgdb_arch_late(void);
243 * breakpoint. 233 * breakpoint.
244 * @remove_hw_breakpoint: Allow an architecture to specify how to remove a 234 * @remove_hw_breakpoint: Allow an architecture to specify how to remove a
245 * hardware breakpoint. 235 * hardware breakpoint.
236 * @disable_hw_break: Allow an architecture to specify how to disable
237 * hardware breakpoints for a single cpu.
246 * @remove_all_hw_break: Allow an architecture to specify how to remove all 238 * @remove_all_hw_break: Allow an architecture to specify how to remove all
247 * hardware breakpoints. 239 * hardware breakpoints.
248 * @correct_hw_break: Allow an architecture to specify how to correct the 240 * @correct_hw_break: Allow an architecture to specify how to correct the
@@ -256,6 +248,7 @@ struct kgdb_arch {
256 int (*remove_breakpoint)(unsigned long, char *); 248 int (*remove_breakpoint)(unsigned long, char *);
257 int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); 249 int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
258 int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); 250 int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
251 void (*disable_hw_break)(struct pt_regs *regs);
259 void (*remove_all_hw_break)(void); 252 void (*remove_all_hw_break)(void);
260 void (*correct_hw_break)(void); 253 void (*correct_hw_break)(void);
261}; 254};
diff --git a/include/linux/magic.h b/include/linux/magic.h
index eb9800f05782..ff690d05f129 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -57,5 +57,6 @@
57 57
58#define DEVPTS_SUPER_MAGIC 0x1cd1 58#define DEVPTS_SUPER_MAGIC 0x1cd1
59#define SOCKFS_MAGIC 0x534F434B 59#define SOCKFS_MAGIC 0x534F434B
60#define V9FS_MAGIC 0x01021997
60 61
61#endif /* __LINUX_MAGIC_H__ */ 62#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index bfd23bef7363..4db1fbd8969e 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -138,7 +138,7 @@ enum {
138 PM8607_ID_RG_MAX, 138 PM8607_ID_RG_MAX,
139}; 139};
140 140
141#define PM8607_VERSION (0x40) /* 8607 chip ID */ 141/* 8607 chip ID is 0x40 or 0x50 */
142#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ 142#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */
143 143
144/* Interrupt Registers */ 144/* Interrupt Registers */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index f5cec4500f38..d63b6050b183 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -10,6 +10,29 @@
10#include <linux/device.h> 10#include <linux/device.h>
11 11
12/* 12/*
13 * AB8500 bank addresses
14 */
15#define AB8500_SYS_CTRL1_BLOCK 0x1
16#define AB8500_SYS_CTRL2_BLOCK 0x2
17#define AB8500_REGU_CTRL1 0x3
18#define AB8500_REGU_CTRL2 0x4
19#define AB8500_USB 0x5
20#define AB8500_TVOUT 0x6
21#define AB8500_DBI 0x7
22#define AB8500_ECI_AV_ACC 0x8
23#define AB8500_RESERVED 0x9
24#define AB8500_GPADC 0xA
25#define AB8500_CHARGER 0xB
26#define AB8500_GAS_GAUGE 0xC
27#define AB8500_AUDIO 0xD
28#define AB8500_INTERRUPT 0xE
29#define AB8500_RTC 0xF
30#define AB8500_MISC 0x10
31#define AB8500_DEBUG 0x12
32#define AB8500_PROD_TEST 0x13
33#define AB8500_OTP_EMUL 0x15
34
35/*
13 * Interrupts 36 * Interrupts
14 */ 37 */
15 38
@@ -99,6 +122,7 @@ struct ab8500 {
99 int revision; 122 int revision;
100 int irq_base; 123 int irq_base;
101 int irq; 124 int irq;
125 u8 chip_id;
102 126
103 int (*write) (struct ab8500 *a8500, u16 addr, u8 data); 127 int (*write) (struct ab8500 *a8500, u16 addr, u8 data);
104 int (*read) (struct ab8500 *a8500, u16 addr); 128 int (*read) (struct ab8500 *a8500, u16 addr);
@@ -124,10 +148,6 @@ struct ab8500_platform_data {
124 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; 148 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS];
125}; 149};
126 150
127extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
128extern int ab8500_read(struct ab8500 *a8500, u16 addr);
129extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data);
130
131extern int __devinit ab8500_init(struct ab8500 *ab8500); 151extern int __devinit ab8500_init(struct ab8500 *ab8500);
132extern int __devexit ab8500_exit(struct ab8500 *ab8500); 152extern int __devexit ab8500_exit(struct ab8500 *ab8500);
133 153
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 390726fcbcb1..67bd6f7ecf32 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -6,8 +6,7 @@
6 * 6 *
7 * ABX500 core access functions. 7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500 and possibly comming. It is not used for 9 * ab3100, ab3550, ab5500, and ab8500.
10 * ab4500 and ab8500 since they are another family of chip.
11 * 10 *
12 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 11 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
13 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -230,4 +229,5 @@ struct abx500_ops {
230}; 229};
231 230
232int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); 231int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
232void abx500_remove_ops(struct device *dev);
233#endif 233#endif
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 11d740b8831d..cb93d80aa642 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -44,6 +44,9 @@ struct mfd_cell {
44 */ 44 */
45 int num_resources; 45 int num_resources;
46 const struct resource *resources; 46 const struct resource *resources;
47
48 /* don't check for resource conflicts */
49 bool ignore_resource_conflicts;
47}; 50};
48 51
49extern int mfd_add_devices(struct device *parent, int id, 52extern int mfd_add_devices(struct device *parent, int id,
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 6dc75b3e2d33..7363dea6bbcd 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -23,6 +23,8 @@
23#ifndef __LINUX_MFD_MAX8998_PRIV_H 23#ifndef __LINUX_MFD_MAX8998_PRIV_H
24#define __LINUX_MFD_MAX8998_PRIV_H 24#define __LINUX_MFD_MAX8998_PRIV_H
25 25
26#define MAX8998_NUM_IRQ_REGS 4
27
26/* MAX 8998 registers */ 28/* MAX 8998 registers */
27enum { 29enum {
28 MAX8998_REG_IRQ1, 30 MAX8998_REG_IRQ1,
@@ -46,12 +48,12 @@ enum {
46 MAX8998_REG_ONOFF2, 48 MAX8998_REG_ONOFF2,
47 MAX8998_REG_ONOFF3, 49 MAX8998_REG_ONOFF3,
48 MAX8998_REG_ONOFF4, 50 MAX8998_REG_ONOFF4,
49 MAX8998_REG_BUCK1_DVSARM1, 51 MAX8998_REG_BUCK1_VOLTAGE1,
50 MAX8998_REG_BUCK1_DVSARM2, 52 MAX8998_REG_BUCK1_VOLTAGE2,
51 MAX8998_REG_BUCK1_DVSARM3, 53 MAX8998_REG_BUCK1_VOLTAGE3,
52 MAX8998_REG_BUCK1_DVSARM4, 54 MAX8998_REG_BUCK1_VOLTAGE4,
53 MAX8998_REG_BUCK2_DVSINT1, 55 MAX8998_REG_BUCK2_VOLTAGE1,
54 MAX8998_REG_BUCK2_DVSINT2, 56 MAX8998_REG_BUCK2_VOLTAGE2,
55 MAX8998_REG_BUCK3, 57 MAX8998_REG_BUCK3,
56 MAX8998_REG_BUCK4, 58 MAX8998_REG_BUCK4,
57 MAX8998_REG_LDO2_LDO3, 59 MAX8998_REG_LDO2_LDO3,
@@ -72,41 +74,102 @@ enum {
72 MAX8998_REG_LBCNFG2, 74 MAX8998_REG_LBCNFG2,
73}; 75};
74 76
77/* IRQ definitions */
78enum {
79 MAX8998_IRQ_DCINF,
80 MAX8998_IRQ_DCINR,
81 MAX8998_IRQ_JIGF,
82 MAX8998_IRQ_JIGR,
83 MAX8998_IRQ_PWRONF,
84 MAX8998_IRQ_PWRONR,
85
86 MAX8998_IRQ_WTSREVNT,
87 MAX8998_IRQ_SMPLEVNT,
88 MAX8998_IRQ_ALARM1,
89 MAX8998_IRQ_ALARM0,
90
91 MAX8998_IRQ_ONKEY1S,
92 MAX8998_IRQ_TOPOFFR,
93 MAX8998_IRQ_DCINOVPR,
94 MAX8998_IRQ_CHGRSTF,
95 MAX8998_IRQ_DONER,
96 MAX8998_IRQ_CHGFAULT,
97
98 MAX8998_IRQ_LOBAT1,
99 MAX8998_IRQ_LOBAT2,
100
101 MAX8998_IRQ_NR,
102};
103
104/* MAX8998 various variants */
105enum {
106 TYPE_MAX8998 = 0, /* Default */
107 TYPE_LP3974, /* National version of MAX8998 */
108 TYPE_LP3979, /* Added AVS */
109};
110
111#define MAX8998_IRQ_DCINF_MASK (1 << 2)
112#define MAX8998_IRQ_DCINR_MASK (1 << 3)
113#define MAX8998_IRQ_JIGF_MASK (1 << 4)
114#define MAX8998_IRQ_JIGR_MASK (1 << 5)
115#define MAX8998_IRQ_PWRONF_MASK (1 << 6)
116#define MAX8998_IRQ_PWRONR_MASK (1 << 7)
117
118#define MAX8998_IRQ_WTSREVNT_MASK (1 << 0)
119#define MAX8998_IRQ_SMPLEVNT_MASK (1 << 1)
120#define MAX8998_IRQ_ALARM1_MASK (1 << 2)
121#define MAX8998_IRQ_ALARM0_MASK (1 << 3)
122
123#define MAX8998_IRQ_ONKEY1S_MASK (1 << 0)
124#define MAX8998_IRQ_TOPOFFR_MASK (1 << 2)
125#define MAX8998_IRQ_DCINOVPR_MASK (1 << 3)
126#define MAX8998_IRQ_CHGRSTF_MASK (1 << 4)
127#define MAX8998_IRQ_DONER_MASK (1 << 5)
128#define MAX8998_IRQ_CHGFAULT_MASK (1 << 7)
129
130#define MAX8998_IRQ_LOBAT1_MASK (1 << 0)
131#define MAX8998_IRQ_LOBAT2_MASK (1 << 1)
132
133#define MAX8998_ENRAMP (1 << 4)
134
75/** 135/**
76 * struct max8998_dev - max8998 master device for sub-drivers 136 * struct max8998_dev - max8998 master device for sub-drivers
77 * @dev: master device of the chip (can be used to access platform data) 137 * @dev: master device of the chip (can be used to access platform data)
78 * @i2c_client: i2c client private data 138 * @i2c: i2c client private data for regulator
79 * @dev_read(): chip register read function 139 * @rtc: i2c client private data for rtc
80 * @dev_write(): chip register write function
81 * @dev_update(): chip register update function
82 * @iolock: mutex for serializing io access 140 * @iolock: mutex for serializing io access
141 * @irqlock: mutex for buslock
142 * @irq_base: base IRQ number for max8998, required for IRQs
143 * @irq: generic IRQ number for max8998
144 * @ono: power onoff IRQ number for max8998
145 * @irq_masks_cur: currently active value
146 * @irq_masks_cache: cached hardware value
147 * @type: indicate which max8998 "variant" is used
83 */ 148 */
84
85struct max8998_dev { 149struct max8998_dev {
86 struct device *dev; 150 struct device *dev;
87 struct i2c_client *i2c_client; 151 struct i2c_client *i2c;
88 int (*dev_read)(struct max8998_dev *max8998, u8 reg, u8 *dest); 152 struct i2c_client *rtc;
89 int (*dev_write)(struct max8998_dev *max8998, u8 reg, u8 val);
90 int (*dev_update)(struct max8998_dev *max8998, u8 reg, u8 val, u8 mask);
91 struct mutex iolock; 153 struct mutex iolock;
154 struct mutex irqlock;
155
156 int irq_base;
157 int irq;
158 int ono;
159 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
160 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
161 int type;
92}; 162};
93 163
94static inline int max8998_read_reg(struct max8998_dev *max8998, u8 reg, 164int max8998_irq_init(struct max8998_dev *max8998);
95 u8 *value) 165void max8998_irq_exit(struct max8998_dev *max8998);
96{ 166
97 return max8998->dev_read(max8998, reg, value); 167extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
98} 168extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count,
99 169 u8 *buf);
100static inline int max8998_write_reg(struct max8998_dev *max8998, u8 reg, 170extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
101 u8 value) 171extern int max8998_bulk_write(struct i2c_client *i2c, u8 reg, int count,
102{ 172 u8 *buf);
103 return max8998->dev_write(max8998, reg, value); 173extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
104}
105
106static inline int max8998_update_reg(struct max8998_dev *max8998, u8 reg,
107 u8 value, u8 mask)
108{
109 return max8998->dev_update(max8998, reg, value, mask);
110}
111 174
112#endif /* __LINUX_MFD_MAX8998_PRIV_H */ 175#endif /* __LINUX_MFD_MAX8998_PRIV_H */
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 1d3601a2d853..f8c9f884aff2 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -66,13 +66,28 @@ struct max8998_regulator_data {
66 66
67/** 67/**
68 * struct max8998_board - packages regulator init data 68 * struct max8998_board - packages regulator init data
69 * @num_regulators: number of regultors used
70 * @regulators: array of defined regulators 69 * @regulators: array of defined regulators
70 * @num_regulators: number of regultors used
71 * @irq_base: base IRQ number for max8998, required for IRQs
72 * @ono: power onoff IRQ number for max8998
73 * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1
74 * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2
75 * @buck2_max_voltage: BUCK2 maximum alowed voltage
76 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
77 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
78 * @buck2_set3: BUCK2 gpio pin to set output voltage
71 */ 79 */
72
73struct max8998_platform_data { 80struct max8998_platform_data {
74 int num_regulators;
75 struct max8998_regulator_data *regulators; 81 struct max8998_regulator_data *regulators;
82 int num_regulators;
83 int irq_base;
84 int ono;
85 int buck1_max_voltage1;
86 int buck1_max_voltage2;
87 int buck2_max_voltage;
88 int buck1_set1;
89 int buck1_set2;
90 int buck2_set3;
76}; 91};
77 92
78#endif /* __LINUX_MFD_MAX8998_H */ 93#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 0fa44fb8dd26..b4c741e352c2 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2009 Pengutronix 2 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it under 5 * This program is free software; you can redistribute it and/or modify it under
@@ -9,48 +9,83 @@
9#ifndef __LINUX_MFD_MC13783_H 9#ifndef __LINUX_MFD_MC13783_H
10#define __LINUX_MFD_MC13783_H 10#define __LINUX_MFD_MC13783_H
11 11
12#include <linux/interrupt.h> 12#include <linux/mfd/mc13xxx.h>
13 13
14struct mc13783; 14struct mc13783;
15 15
16void mc13783_lock(struct mc13783 *mc13783); 16struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783);
17void mc13783_unlock(struct mc13783 *mc13783);
18 17
19int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); 18static inline void mc13783_lock(struct mc13783 *mc13783)
20int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); 19{
21int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, 20 mc13xxx_lock(mc13783_to_mc13xxx(mc13783));
22 u32 mask, u32 val); 21}
22
23static inline void mc13783_unlock(struct mc13783 *mc13783)
24{
25 mc13xxx_unlock(mc13783_to_mc13xxx(mc13783));
26}
27
28static inline int mc13783_reg_read(struct mc13783 *mc13783,
29 unsigned int offset, u32 *val)
30{
31 return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val);
32}
33
34static inline int mc13783_reg_write(struct mc13783 *mc13783,
35 unsigned int offset, u32 val)
36{
37 return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val);
38}
39
40static inline int mc13783_reg_rmw(struct mc13783 *mc13783,
41 unsigned int offset, u32 mask, u32 val)
42{
43 return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val);
44}
23 45
24int mc13783_get_flags(struct mc13783 *mc13783); 46static inline int mc13783_get_flags(struct mc13783 *mc13783)
47{
48 return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783));
49}
25 50
26int mc13783_irq_request(struct mc13783 *mc13783, int irq, 51static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev); 52 irq_handler_t handler, const char *name, void *dev)
28int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, 53{
29 irq_handler_t handler, const char *name, void *dev); 54 return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq,
30int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); 55 handler, name, dev);
56}
31 57
32int mc13783_irq_mask(struct mc13783 *mc13783, int irq); 58static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
33int mc13783_irq_unmask(struct mc13783 *mc13783, int irq); 59 irq_handler_t handler, const char *name, void *dev)
34int mc13783_irq_status(struct mc13783 *mc13783, int irq, 60{
35 int *enabled, int *pending); 61 return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq,
36int mc13783_irq_ack(struct mc13783 *mc13783, int irq); 62 handler, name, dev);
63}
37 64
38static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated; 65static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev)
39static inline int mc13783_mask(struct mc13783 *mc13783, int irq)
40{ 66{
41 return mc13783_irq_mask(mc13783, irq); 67 return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev);
42} 68}
43 69
44static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated; 70static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
45static inline int mc13783_unmask(struct mc13783 *mc13783, int irq)
46{ 71{
47 return mc13783_irq_unmask(mc13783, irq); 72 return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq);
48} 73}
49 74
50static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated; 75static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
51static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
52{ 76{
53 return mc13783_irq_ack(mc13783, irq); 77 return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq);
78}
79static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq,
80 int *enabled, int *pending)
81{
82 return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783),
83 irq, enabled, pending);
84}
85
86static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
87{
88 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
54} 89}
55 90
56#define MC13783_ADC0 43 91#define MC13783_ADC0 43
@@ -66,96 +101,18 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
66 MC13783_ADC0_TSMOD1 | \ 101 MC13783_ADC0_TSMOD1 | \
67 MC13783_ADC0_TSMOD2) 102 MC13783_ADC0_TSMOD2)
68 103
69struct mc13783_led_platform_data { 104#define mc13783_regulator_init_data mc13xxx_regulator_init_data
70#define MC13783_LED_MD 0 105#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
71#define MC13783_LED_AD 1 106#define mc13783_led_platform_data mc13xxx_led_platform_data
72#define MC13783_LED_KP 2 107#define mc13783_leds_platform_data mc13xxx_leds_platform_data
73#define MC13783_LED_R1 3 108
74#define MC13783_LED_G1 4 109#define mc13783_platform_data mc13xxx_platform_data
75#define MC13783_LED_B1 5 110#define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN
76#define MC13783_LED_R2 6 111#define MC13783_USE_CODEC MC13XXX_USE_CODEC
77#define MC13783_LED_G2 7 112#define MC13783_USE_ADC MC13XXX_USE_ADC
78#define MC13783_LED_B2 8 113#define MC13783_USE_RTC MC13XXX_USE_RTC
79#define MC13783_LED_R3 9 114#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
80#define MC13783_LED_G3 10 115#define MC13783_USE_LED MC13XXX_USE_LED
81#define MC13783_LED_B3 11
82#define MC13783_LED_MAX MC13783_LED_B3
83 int id;
84 const char *name;
85 const char *default_trigger;
86
87/* Three or two bits current selection depending on the led */
88 char max_current;
89};
90
91struct mc13783_leds_platform_data {
92 int num_leds;
93 struct mc13783_led_platform_data *led;
94
95#define MC13783_LED_TRIODE_MD (1 << 0)
96#define MC13783_LED_TRIODE_AD (1 << 1)
97#define MC13783_LED_TRIODE_KP (1 << 2)
98#define MC13783_LED_BOOST_EN (1 << 3)
99#define MC13783_LED_TC1HALF (1 << 4)
100#define MC13783_LED_SLEWLIMTC (1 << 5)
101#define MC13783_LED_SLEWLIMBL (1 << 6)
102#define MC13783_LED_TRIODE_TC1 (1 << 7)
103#define MC13783_LED_TRIODE_TC2 (1 << 8)
104#define MC13783_LED_TRIODE_TC3 (1 << 9)
105 int flags;
106
107#define MC13783_LED_AB_DISABLED 0
108#define MC13783_LED_AB_MD1 1
109#define MC13783_LED_AB_MD12 2
110#define MC13783_LED_AB_MD123 3
111#define MC13783_LED_AB_MD1234 4
112#define MC13783_LED_AB_MD1234_AD1 5
113#define MC13783_LED_AB_MD1234_AD12 6
114#define MC13783_LED_AB_MD1_AD 7
115 char abmode;
116
117#define MC13783_LED_ABREF_200MV 0
118#define MC13783_LED_ABREF_400MV 1
119#define MC13783_LED_ABREF_600MV 2
120#define MC13783_LED_ABREF_800MV 3
121 char abref;
122
123#define MC13783_LED_PERIOD_10MS 0
124#define MC13783_LED_PERIOD_100MS 1
125#define MC13783_LED_PERIOD_500MS 2
126#define MC13783_LED_PERIOD_2S 3
127 char bl_period;
128 char tc1_period;
129 char tc2_period;
130 char tc3_period;
131};
132
133/* to be cleaned up */
134struct regulator_init_data;
135
136struct mc13783_regulator_init_data {
137 int id;
138 struct regulator_init_data *init_data;
139};
140
141struct mc13783_regulator_platform_data {
142 int num_regulators;
143 struct mc13783_regulator_init_data *regulators;
144};
145
146struct mc13783_platform_data {
147 int num_regulators;
148 struct mc13783_regulator_init_data *regulators;
149 struct mc13783_leds_platform_data *leds;
150
151#define MC13783_USE_TOUCHSCREEN (1 << 0)
152#define MC13783_USE_CODEC (1 << 1)
153#define MC13783_USE_ADC (1 << 2)
154#define MC13783_USE_RTC (1 << 3)
155#define MC13783_USE_REGULATOR (1 << 4)
156#define MC13783_USE_LED (1 << 5)
157 unsigned int flags;
158};
159 116
160#define MC13783_ADC_MODE_TS 1 117#define MC13783_ADC_MODE_TS 1
161#define MC13783_ADC_MODE_SINGLE_CHAN 2 118#define MC13783_ADC_MODE_SINGLE_CHAN 2
@@ -199,46 +156,46 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
199#define MC13783_REGU_PWGT1SPI 31 156#define MC13783_REGU_PWGT1SPI 31
200#define MC13783_REGU_PWGT2SPI 32 157#define MC13783_REGU_PWGT2SPI 32
201 158
202#define MC13783_IRQ_ADCDONE 0 159#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE
203#define MC13783_IRQ_ADCBISDONE 1 160#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE
204#define MC13783_IRQ_TS 2 161#define MC13783_IRQ_TS MC13XXX_IRQ_TS
205#define MC13783_IRQ_WHIGH 3 162#define MC13783_IRQ_WHIGH 3
206#define MC13783_IRQ_WLOW 4 163#define MC13783_IRQ_WLOW 4
207#define MC13783_IRQ_CHGDET 6 164#define MC13783_IRQ_CHGDET MC13XXX_IRQ_CHGDET
208#define MC13783_IRQ_CHGOV 7 165#define MC13783_IRQ_CHGOV 7
209#define MC13783_IRQ_CHGREV 8 166#define MC13783_IRQ_CHGREV MC13XXX_IRQ_CHGREV
210#define MC13783_IRQ_CHGSHORT 9 167#define MC13783_IRQ_CHGSHORT MC13XXX_IRQ_CHGSHORT
211#define MC13783_IRQ_CCCV 10 168#define MC13783_IRQ_CCCV MC13XXX_IRQ_CCCV
212#define MC13783_IRQ_CHGCURR 11 169#define MC13783_IRQ_CHGCURR MC13XXX_IRQ_CHGCURR
213#define MC13783_IRQ_BPON 12 170#define MC13783_IRQ_BPON MC13XXX_IRQ_BPON
214#define MC13783_IRQ_LOBATL 13 171#define MC13783_IRQ_LOBATL MC13XXX_IRQ_LOBATL
215#define MC13783_IRQ_LOBATH 14 172#define MC13783_IRQ_LOBATH MC13XXX_IRQ_LOBATH
216#define MC13783_IRQ_UDP 15 173#define MC13783_IRQ_UDP 15
217#define MC13783_IRQ_USB 16 174#define MC13783_IRQ_USB 16
218#define MC13783_IRQ_ID 19 175#define MC13783_IRQ_ID 19
219#define MC13783_IRQ_SE1 21 176#define MC13783_IRQ_SE1 21
220#define MC13783_IRQ_CKDET 22 177#define MC13783_IRQ_CKDET 22
221#define MC13783_IRQ_UDM 23 178#define MC13783_IRQ_UDM 23
222#define MC13783_IRQ_1HZ 24 179#define MC13783_IRQ_1HZ MC13XXX_IRQ_1HZ
223#define MC13783_IRQ_TODA 25 180#define MC13783_IRQ_TODA MC13XXX_IRQ_TODA
224#define MC13783_IRQ_ONOFD1 27 181#define MC13783_IRQ_ONOFD1 27
225#define MC13783_IRQ_ONOFD2 28 182#define MC13783_IRQ_ONOFD2 28
226#define MC13783_IRQ_ONOFD3 29 183#define MC13783_IRQ_ONOFD3 29
227#define MC13783_IRQ_SYSRST 30 184#define MC13783_IRQ_SYSRST MC13XXX_IRQ_SYSRST
228#define MC13783_IRQ_RTCRST 31 185#define MC13783_IRQ_RTCRST MC13XXX_IRQ_RTCRST
229#define MC13783_IRQ_PC 32 186#define MC13783_IRQ_PC MC13XXX_IRQ_PC
230#define MC13783_IRQ_WARM 33 187#define MC13783_IRQ_WARM MC13XXX_IRQ_WARM
231#define MC13783_IRQ_MEMHLD 34 188#define MC13783_IRQ_MEMHLD MC13XXX_IRQ_MEMHLD
232#define MC13783_IRQ_PWRRDY 35 189#define MC13783_IRQ_PWRRDY 35
233#define MC13783_IRQ_THWARNL 36 190#define MC13783_IRQ_THWARNL MC13XXX_IRQ_THWARNL
234#define MC13783_IRQ_THWARNH 37 191#define MC13783_IRQ_THWARNH MC13XXX_IRQ_THWARNH
235#define MC13783_IRQ_CLK 38 192#define MC13783_IRQ_CLK MC13XXX_IRQ_CLK
236#define MC13783_IRQ_SEMAF 39 193#define MC13783_IRQ_SEMAF 39
237#define MC13783_IRQ_MC2B 41 194#define MC13783_IRQ_MC2B 41
238#define MC13783_IRQ_HSDET 42 195#define MC13783_IRQ_HSDET 42
239#define MC13783_IRQ_HSL 43 196#define MC13783_IRQ_HSL 43
240#define MC13783_IRQ_ALSPTH 44 197#define MC13783_IRQ_ALSPTH 44
241#define MC13783_IRQ_AHSSHORT 45 198#define MC13783_IRQ_AHSSHORT 45
242#define MC13783_NUM_IRQ 46 199#define MC13783_NUM_IRQ MC13XXX_NUM_IRQ
243 200
244#endif /* __LINUX_MFD_MC13783_H */ 201#endif /* ifndef __LINUX_MFD_MC13783_H */
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
new file mode 100644
index 000000000000..a1d391b40e68
--- /dev/null
+++ b/include/linux/mfd/mc13xxx.h
@@ -0,0 +1,154 @@
1/*
2 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#ifndef __LINUX_MFD_MC13XXX_H
10#define __LINUX_MFD_MC13XXX_H
11
12#include <linux/interrupt.h>
13
14struct mc13xxx;
15
16void mc13xxx_lock(struct mc13xxx *mc13xxx);
17void mc13xxx_unlock(struct mc13xxx *mc13xxx);
18
19int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val);
20int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
22 u32 mask, u32 val);
23
24int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
25
26int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
27 irq_handler_t handler, const char *name, void *dev);
28int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
29 irq_handler_t handler, const char *name, void *dev);
30int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev);
31
32int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
33int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);
34int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq,
35 int *enabled, int *pending);
36int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
37
38int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
39
40#define MC13XXX_IRQ_ADCDONE 0
41#define MC13XXX_IRQ_ADCBISDONE 1
42#define MC13XXX_IRQ_TS 2
43#define MC13XXX_IRQ_CHGDET 6
44#define MC13XXX_IRQ_CHGREV 8
45#define MC13XXX_IRQ_CHGSHORT 9
46#define MC13XXX_IRQ_CCCV 10
47#define MC13XXX_IRQ_CHGCURR 11
48#define MC13XXX_IRQ_BPON 12
49#define MC13XXX_IRQ_LOBATL 13
50#define MC13XXX_IRQ_LOBATH 14
51#define MC13XXX_IRQ_1HZ 24
52#define MC13XXX_IRQ_TODA 25
53#define MC13XXX_IRQ_SYSRST 30
54#define MC13XXX_IRQ_RTCRST 31
55#define MC13XXX_IRQ_PC 32
56#define MC13XXX_IRQ_WARM 33
57#define MC13XXX_IRQ_MEMHLD 34
58#define MC13XXX_IRQ_THWARNL 36
59#define MC13XXX_IRQ_THWARNH 37
60#define MC13XXX_IRQ_CLK 38
61
62#define MC13XXX_NUM_IRQ 46
63
64struct regulator_init_data;
65
66struct mc13xxx_regulator_init_data {
67 int id;
68 struct regulator_init_data *init_data;
69};
70
71struct mc13xxx_regulator_platform_data {
72 int num_regulators;
73 struct mc13xxx_regulator_init_data *regulators;
74};
75
76struct mc13xxx_led_platform_data {
77#define MC13783_LED_MD 0
78#define MC13783_LED_AD 1
79#define MC13783_LED_KP 2
80#define MC13783_LED_R1 3
81#define MC13783_LED_G1 4
82#define MC13783_LED_B1 5
83#define MC13783_LED_R2 6
84#define MC13783_LED_G2 7
85#define MC13783_LED_B2 8
86#define MC13783_LED_R3 9
87#define MC13783_LED_G3 10
88#define MC13783_LED_B3 11
89#define MC13783_LED_MAX MC13783_LED_B3
90 int id;
91 const char *name;
92 const char *default_trigger;
93
94/* Three or two bits current selection depending on the led */
95 char max_current;
96};
97
98struct mc13xxx_leds_platform_data {
99 int num_leds;
100 struct mc13xxx_led_platform_data *led;
101
102#define MC13783_LED_TRIODE_MD (1 << 0)
103#define MC13783_LED_TRIODE_AD (1 << 1)
104#define MC13783_LED_TRIODE_KP (1 << 2)
105#define MC13783_LED_BOOST_EN (1 << 3)
106#define MC13783_LED_TC1HALF (1 << 4)
107#define MC13783_LED_SLEWLIMTC (1 << 5)
108#define MC13783_LED_SLEWLIMBL (1 << 6)
109#define MC13783_LED_TRIODE_TC1 (1 << 7)
110#define MC13783_LED_TRIODE_TC2 (1 << 8)
111#define MC13783_LED_TRIODE_TC3 (1 << 9)
112 int flags;
113
114#define MC13783_LED_AB_DISABLED 0
115#define MC13783_LED_AB_MD1 1
116#define MC13783_LED_AB_MD12 2
117#define MC13783_LED_AB_MD123 3
118#define MC13783_LED_AB_MD1234 4
119#define MC13783_LED_AB_MD1234_AD1 5
120#define MC13783_LED_AB_MD1234_AD12 6
121#define MC13783_LED_AB_MD1_AD 7
122 char abmode;
123
124#define MC13783_LED_ABREF_200MV 0
125#define MC13783_LED_ABREF_400MV 1
126#define MC13783_LED_ABREF_600MV 2
127#define MC13783_LED_ABREF_800MV 3
128 char abref;
129
130#define MC13783_LED_PERIOD_10MS 0
131#define MC13783_LED_PERIOD_100MS 1
132#define MC13783_LED_PERIOD_500MS 2
133#define MC13783_LED_PERIOD_2S 3
134 char bl_period;
135 char tc1_period;
136 char tc2_period;
137 char tc3_period;
138};
139
140struct mc13xxx_platform_data {
141#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
142#define MC13XXX_USE_CODEC (1 << 1)
143#define MC13XXX_USE_ADC (1 << 2)
144#define MC13XXX_USE_RTC (1 << 3)
145#define MC13XXX_USE_REGULATOR (1 << 4)
146#define MC13XXX_USE_LED (1 << 5)
147 unsigned int flags;
148
149 int num_regulators;
150 struct mc13xxx_regulator_init_data *regulators;
151 struct mc13xxx_leds_platform_data *leds;
152};
153
154#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index ad411a78870c..50d4a047118d 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -227,4 +227,11 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
227 return dev_get_drvdata(dev); 227 return dev_get_drvdata(dev);
228} 228}
229 229
230int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
231void pcf50633_irq_free(struct pcf50633 *pcf);
232#ifdef CONFIG_PM
233int pcf50633_irq_suspend(struct pcf50633 *pcf);
234int pcf50633_irq_resume(struct pcf50633 *pcf);
235#endif
236
230#endif 237#endif
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index 49067802a6d7..c981b959760f 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -7,8 +7,10 @@ struct sh_mobile_sdhi_info {
7 int dma_slave_tx; 7 int dma_slave_tx;
8 int dma_slave_rx; 8 int dma_slave_rx;
9 unsigned long tmio_flags; 9 unsigned long tmio_flags;
10 unsigned long tmio_caps;
10 u32 tmio_ocr_mask; /* available MMC voltages */ 11 u32 tmio_ocr_mask; /* available MMC voltages */
11 void (*set_pwr)(struct platform_device *pdev, int state); 12 void (*set_pwr)(struct platform_device *pdev, int state);
13 int (*get_cd)(struct platform_device *pdev);
12}; 14};
13 15
14#endif /* __SH_MOBILE_SDHI_H__ */ 16#endif /* __SH_MOBILE_SDHI_H__ */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index 39ca7588659b..e762c270d8d4 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -112,13 +112,19 @@ struct stmpe_keypad_platform_data {
112 bool no_autorepeat; 112 bool no_autorepeat;
113}; 113};
114 114
115#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)
116
115/** 117/**
116 * struct stmpe_gpio_platform_data - STMPE GPIO platform data 118 * struct stmpe_gpio_platform_data - STMPE GPIO platform data
117 * @gpio_base: first gpio number assigned. A maximum of 119 * @gpio_base: first gpio number assigned. A maximum of
118 * %STMPE_NR_GPIOS GPIOs will be allocated. 120 * %STMPE_NR_GPIOS GPIOs will be allocated.
121 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
122 * requestable due to different usage (e.g. touch, keypad)
123 * STMPE_GPIO_NOREQ_* macros can be used here.
119 */ 124 */
120struct stmpe_gpio_platform_data { 125struct stmpe_gpio_platform_data {
121 int gpio_base; 126 int gpio_base;
127 unsigned norequest_mask;
122 void (*setup)(struct stmpe *stmpe, unsigned gpio_base); 128 void (*setup)(struct stmpe *stmpe, unsigned gpio_base);
123 void (*remove)(struct stmpe *stmpe, unsigned gpio_base); 129 void (*remove)(struct stmpe *stmpe, unsigned gpio_base);
124}; 130};
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f07425bc3dcd..085f041197dc 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -52,6 +52,11 @@
52 52
53/* tmio MMC platform flags */ 53/* tmio MMC platform flags */
54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) 54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
55/*
56 * Some controllers can support a 2-byte block size when the bus width
57 * is configured in 4-bit mode.
58 */
59#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
55 60
56int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 61int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
57int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 62int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -74,6 +79,7 @@ struct tmio_mmc_data {
74 struct tmio_mmc_dma *dma; 79 struct tmio_mmc_dma *dma;
75 void (*set_pwr)(struct platform_device *host, int state); 80 void (*set_pwr)(struct platform_device *host, int state);
76 void (*set_clk_div)(struct platform_device *host, int state); 81 void (*set_clk_div)(struct platform_device *host, int state);
82 int (*get_cd)(struct platform_device *host);
77}; 83};
78 84
79/* 85/*
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 772b3ae640af..b6bab1b04e25 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -18,6 +18,36 @@ enum {
18 TPS6586X_ID_LDO_RTC, 18 TPS6586X_ID_LDO_RTC,
19}; 19};
20 20
21enum {
22 TPS6586X_INT_PLDO_0,
23 TPS6586X_INT_PLDO_1,
24 TPS6586X_INT_PLDO_2,
25 TPS6586X_INT_PLDO_3,
26 TPS6586X_INT_PLDO_4,
27 TPS6586X_INT_PLDO_5,
28 TPS6586X_INT_PLDO_6,
29 TPS6586X_INT_PLDO_7,
30 TPS6586X_INT_COMP_DET,
31 TPS6586X_INT_ADC,
32 TPS6586X_INT_PLDO_8,
33 TPS6586X_INT_PLDO_9,
34 TPS6586X_INT_PSM_0,
35 TPS6586X_INT_PSM_1,
36 TPS6586X_INT_PSM_2,
37 TPS6586X_INT_PSM_3,
38 TPS6586X_INT_RTC_ALM1,
39 TPS6586X_INT_ACUSB_OVP,
40 TPS6586X_INT_USB_DET,
41 TPS6586X_INT_AC_DET,
42 TPS6586X_INT_BAT_DET,
43 TPS6586X_INT_CHG_STAT,
44 TPS6586X_INT_CHG_TEMP,
45 TPS6586X_INT_PP,
46 TPS6586X_INT_RESUME,
47 TPS6586X_INT_LOW_SYS,
48 TPS6586X_INT_RTC_ALM2,
49};
50
21struct tps6586x_subdev_info { 51struct tps6586x_subdev_info {
22 int id; 52 int id;
23 const char *name; 53 const char *name;
@@ -29,6 +59,7 @@ struct tps6586x_platform_data {
29 struct tps6586x_subdev_info *subdevs; 59 struct tps6586x_subdev_info *subdevs;
30 60
31 int gpio_base; 61 int gpio_base;
62 int irq_base;
32}; 63};
33 64
34/* 65/*
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index eb5bd4e0e03c..a1239c48b41a 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -238,6 +238,15 @@ struct regulator_dev;
238 238
239#define WM831X_NUM_IRQ_REGS 5 239#define WM831X_NUM_IRQ_REGS 5
240 240
241enum wm831x_parent {
242 WM8310 = 0x8310,
243 WM8311 = 0x8311,
244 WM8312 = 0x8312,
245 WM8320 = 0x8320,
246 WM8321 = 0x8321,
247 WM8325 = 0x8325,
248};
249
241struct wm831x { 250struct wm831x {
242 struct mutex io_lock; 251 struct mutex io_lock;
243 252
@@ -285,6 +294,9 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
285int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, 294int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
286 int count, u16 *buf); 295 int count, u16 *buf);
287 296
297int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq);
298void wm831x_device_exit(struct wm831x *wm831x);
299int wm831x_device_suspend(struct wm831x *wm831x);
288int wm831x_irq_init(struct wm831x *wm831x, int irq); 300int wm831x_irq_init(struct wm831x *wm831x, int irq);
289void wm831x_irq_exit(struct wm831x *wm831x); 301void wm831x_irq_exit(struct wm831x *wm831x);
290 302
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 6b7525099e56..8ce082781ccb 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -48,6 +48,7 @@ struct mmc_ext_csd {
48 unsigned int sa_timeout; /* Units: 100ns */ 48 unsigned int sa_timeout; /* Units: 100ns */
49 unsigned int hs_max_dtr; 49 unsigned int hs_max_dtr;
50 unsigned int sectors; 50 unsigned int sectors;
51 unsigned int card_type;
51 unsigned int hc_erase_size; /* In sectors */ 52 unsigned int hc_erase_size; /* In sectors */
52 unsigned int hc_erase_timeout; /* In milliseconds */ 53 unsigned int hc_erase_timeout; /* In milliseconds */
53 unsigned int sec_trim_mult; /* Secure trim multiplier */ 54 unsigned int sec_trim_mult; /* Secure trim multiplier */
@@ -113,6 +114,7 @@ struct mmc_card {
113#define MMC_STATE_READONLY (1<<1) /* card is read-only */ 114#define MMC_STATE_READONLY (1<<1) /* card is read-only */
114#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ 115#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */
115#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ 116#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
117#define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */
116 unsigned int quirks; /* card quirks */ 118 unsigned int quirks; /* card quirks */
117#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 119#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
118#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ 120#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
@@ -154,11 +156,13 @@ struct mmc_card {
154#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 156#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
155#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) 157#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
156#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) 158#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
159#define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR)
157 160
158#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 161#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
159#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 162#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
160#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) 163#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
161#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) 164#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
165#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
162 166
163static inline int mmc_card_lenient_fn0(const struct mmc_card *c) 167static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
164{ 168{
@@ -173,6 +177,8 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
173#define mmc_card_name(c) ((c)->cid.prod_name) 177#define mmc_card_name(c) ((c)->cid.prod_name)
174#define mmc_card_id(c) (dev_name(&(c)->dev)) 178#define mmc_card_id(c) (dev_name(&(c)->dev))
175 179
180#define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev)
181
176#define mmc_list_to_card(l) container_of(l, struct mmc_card, node) 182#define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
177#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) 183#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
178#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d) 184#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 7429033acb66..64e013f1cfb8 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -153,6 +153,8 @@ extern int mmc_can_secure_erase_trim(struct mmc_card *card);
153extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 153extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
154 unsigned int nr); 154 unsigned int nr);
155 155
156extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
157
156extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); 158extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
157extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); 159extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
158 160
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1575b52c3bfa..6d87f68ce4b6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -50,6 +50,12 @@ struct mmc_ios {
50#define MMC_TIMING_LEGACY 0 50#define MMC_TIMING_LEGACY 0
51#define MMC_TIMING_MMC_HS 1 51#define MMC_TIMING_MMC_HS 1
52#define MMC_TIMING_SD_HS 2 52#define MMC_TIMING_SD_HS 2
53
54 unsigned char ddr; /* dual data rate used */
55
56#define MMC_SDR_MODE 0
57#define MMC_1_2V_DDR_MODE 1
58#define MMC_1_8V_DDR_MODE 2
53}; 59};
54 60
55struct mmc_host_ops { 61struct mmc_host_ops {
@@ -123,6 +129,7 @@ struct mmc_host {
123 const struct mmc_host_ops *ops; 129 const struct mmc_host_ops *ops;
124 unsigned int f_min; 130 unsigned int f_min;
125 unsigned int f_max; 131 unsigned int f_max;
132 unsigned int f_init;
126 u32 ocr_avail; 133 u32 ocr_avail;
127 struct notifier_block pm_notify; 134 struct notifier_block pm_notify;
128 135
@@ -157,13 +164,16 @@ struct mmc_host {
157#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ 164#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
158#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ 165#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
159#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ 166#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */
167#define MMC_CAP_1_8V_DDR (1 << 11) /* can support */
168 /* DDR mode at 1.8V */
169#define MMC_CAP_1_2V_DDR (1 << 12) /* can support */
170 /* DDR mode at 1.2V */
160 171
161 mmc_pm_flag_t pm_caps; /* supported pm features */ 172 mmc_pm_flag_t pm_caps; /* supported pm features */
162 173
163 /* host specific block data */ 174 /* host specific block data */
164 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 175 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
165 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 176 unsigned short max_segs; /* see blk_queue_max_segments */
166 unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */
167 unsigned short unused; 177 unsigned short unused;
168 unsigned int max_req_size; /* maximum number of bytes in one req */ 178 unsigned int max_req_size; /* maximum number of bytes in one req */
169 unsigned int max_blk_size; /* maximum size of one mmc block */ 179 unsigned int max_blk_size; /* maximum size of one mmc block */
@@ -212,6 +222,10 @@ struct mmc_host {
212 struct led_trigger *led; /* activity led */ 222 struct led_trigger *led; /* activity led */
213#endif 223#endif
214 224
225#ifdef CONFIG_REGULATOR
226 bool regulator_enabled; /* regulator state */
227#endif
228
215 struct dentry *debugfs_root; 229 struct dentry *debugfs_root;
216 230
217 unsigned long private[0] ____cacheline_aligned; 231 unsigned long private[0] ____cacheline_aligned;
@@ -236,8 +250,8 @@ static inline void *mmc_priv(struct mmc_host *host)
236extern int mmc_suspend_host(struct mmc_host *); 250extern int mmc_suspend_host(struct mmc_host *);
237extern int mmc_resume_host(struct mmc_host *); 251extern int mmc_resume_host(struct mmc_host *);
238 252
239extern void mmc_power_save_host(struct mmc_host *host); 253extern int mmc_power_save_host(struct mmc_host *host);
240extern void mmc_power_restore_host(struct mmc_host *host); 254extern int mmc_power_restore_host(struct mmc_host *host);
241 255
242extern void mmc_detect_change(struct mmc_host *, unsigned long delay); 256extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
243extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 257extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
@@ -250,8 +264,24 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host)
250 264
251struct regulator; 265struct regulator;
252 266
267#ifdef CONFIG_REGULATOR
253int mmc_regulator_get_ocrmask(struct regulator *supply); 268int mmc_regulator_get_ocrmask(struct regulator *supply);
254int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); 269int mmc_regulator_set_ocr(struct mmc_host *mmc,
270 struct regulator *supply,
271 unsigned short vdd_bit);
272#else
273static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
274{
275 return 0;
276}
277
278static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
279 struct regulator *supply,
280 unsigned short vdd_bit)
281{
282 return 0;
283}
284#endif
255 285
256int mmc_card_awake(struct mmc_host *host); 286int mmc_card_awake(struct mmc_host *host);
257int mmc_card_sleep(struct mmc_host *host); 287int mmc_card_sleep(struct mmc_host *host);
@@ -268,5 +298,13 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
268 host->disable_delay = disable_delay; 298 host->disable_delay = disable_delay;
269} 299}
270 300
301/* Module parameter */
302extern int mmc_assume_removable;
303
304static inline int mmc_card_is_removable(struct mmc_host *host)
305{
306 return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable;
307}
308
271#endif 309#endif
272 310
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index dd11ae51fb68..956fbd877692 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -277,11 +277,19 @@ struct _mmc_csd {
277 277
278#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ 278#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
279#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ 279#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
280#define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */ 280#define EXT_CSD_CARD_TYPE_MASK 0xF /* Mask out reserved bits */
281#define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */
282 /* DDR mode @1.8V or 3V I/O */
283#define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */
284 /* DDR mode @1.2V I/O */
285#define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \
286 | EXT_CSD_CARD_TYPE_DDR_1_2V)
281 287
282#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ 288#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
283#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ 289#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
284#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ 290#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
291#define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */
292#define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */
285 293
286#define EXT_CSD_SEC_ER_EN BIT(0) 294#define EXT_CSD_SEC_ER_EN BIT(0)
287#define EXT_CSD_SEC_BD_BLK_EN BIT(2) 295#define EXT_CSD_SEC_BD_BLK_EN BIT(2)
diff --git a/include/linux/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h
index 0239bd70241e..548d59d404cb 100644
--- a/include/linux/sdhci-pltfm.h
+++ b/include/linux/mmc/sdhci-pltfm.h
@@ -28,7 +28,7 @@ struct sdhci_host;
28struct sdhci_pltfm_data { 28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops; 29 struct sdhci_ops *ops;
30 unsigned int quirks; 30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host); 31 int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
32 void (*exit)(struct sdhci_host *host); 32 void (*exit)(struct sdhci_host *host);
33}; 33};
34 34
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
new file mode 100644
index 000000000000..1fdc673f2396
--- /dev/null
+++ b/include/linux/mmc/sdhci.h
@@ -0,0 +1,144 @@
1/*
2 * linux/include/linux/mmc/sdhci.h - Secure Digital Host Controller Interface
3 *
4 * Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
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 (at
9 * your option) any later version.
10 */
11#ifndef __SDHCI_H
12#define __SDHCI_H
13
14#include <linux/scatterlist.h>
15#include <linux/compiler.h>
16#include <linux/types.h>
17#include <linux/io.h>
18#include <linux/mmc/host.h>
19
20struct sdhci_host {
21 /* Data set by hardware interface driver */
22 const char *hw_name; /* Hardware bus name */
23
24 unsigned int quirks; /* Deviations from spec. */
25
26/* Controller doesn't honor resets unless we touch the clock register */
27#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0)
28/* Controller has bad caps bits, but really supports DMA */
29#define SDHCI_QUIRK_FORCE_DMA (1<<1)
30/* Controller doesn't like to be reset when there is no card inserted. */
31#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2)
32/* Controller doesn't like clearing the power reg before a change */
33#define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3)
34/* Controller has flaky internal state so reset it on each ios change */
35#define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS (1<<4)
36/* Controller has an unusable DMA engine */
37#define SDHCI_QUIRK_BROKEN_DMA (1<<5)
38/* Controller has an unusable ADMA engine */
39#define SDHCI_QUIRK_BROKEN_ADMA (1<<6)
40/* Controller can only DMA from 32-bit aligned addresses */
41#define SDHCI_QUIRK_32BIT_DMA_ADDR (1<<7)
42/* Controller can only DMA chunk sizes that are a multiple of 32 bits */
43#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<8)
44/* Controller can only ADMA chunks that are a multiple of 32 bits */
45#define SDHCI_QUIRK_32BIT_ADMA_SIZE (1<<9)
46/* Controller needs to be reset after each request to stay stable */
47#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<10)
48/* Controller needs voltage and power writes to happen separately */
49#define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<11)
50/* Controller provides an incorrect timeout value for transfers */
51#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12)
52/* Controller has an issue with buffer bits for small transfers */
53#define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13)
54/* Controller does not provide transfer-complete interrupt when not busy */
55#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
56/* Controller has unreliable card detection */
57#define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15)
58/* Controller reports inverted write-protect state */
59#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
60/* Controller has nonstandard clock management */
61#define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17)
62/* Controller does not like fast PIO transfers */
63#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
64/* Controller losing signal/interrupt enable states after reset */
65#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
66/* Controller has to be forced to use block size of 2048 bytes */
67#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
68/* Controller cannot do multi-block transfers */
69#define SDHCI_QUIRK_NO_MULTIBLOCK (1<<21)
70/* Controller can only handle 1-bit data transfers */
71#define SDHCI_QUIRK_FORCE_1_BIT_DATA (1<<22)
72/* Controller needs 10ms delay between applying power and clock */
73#define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23)
74/* Controller uses SDCLK instead of TMCLK for data timeouts */
75#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24)
76/* Controller reports wrong base clock capability */
77#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
78/* Controller cannot support End Attribute in NOP ADMA descriptor */
79#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
80/* Controller is missing device caps. Use caps provided by host */
81#define SDHCI_QUIRK_MISSING_CAPS (1<<27)
82/* Controller uses Auto CMD12 command to stop the transfer */
83#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
84/* Controller doesn't have HISPD bit field in HI-SPEED SD card */
85#define SDHCI_QUIRK_NO_HISPD_BIT (1<<29)
86
87 int irq; /* Device IRQ */
88 void __iomem *ioaddr; /* Mapped address */
89
90 const struct sdhci_ops *ops; /* Low level hw interface */
91
92 struct regulator *vmmc; /* Power regulator */
93
94 /* Internal data */
95 struct mmc_host *mmc; /* MMC structure */
96 u64 dma_mask; /* custom DMA mask */
97
98#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
99 struct led_classdev led; /* LED control */
100 char led_name[32];
101#endif
102
103 spinlock_t lock; /* Mutex */
104
105 int flags; /* Host attributes */
106#define SDHCI_USE_SDMA (1<<0) /* Host is SDMA capable */
107#define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */
108#define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */
109#define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */
110
111 unsigned int version; /* SDHCI spec. version */
112
113 unsigned int max_clk; /* Max possible freq (MHz) */
114 unsigned int timeout_clk; /* Timeout freq (KHz) */
115
116 unsigned int clock; /* Current clock (MHz) */
117 u8 pwr; /* Current voltage */
118
119 struct mmc_request *mrq; /* Current request */
120 struct mmc_command *cmd; /* Current command */
121 struct mmc_data *data; /* Current data request */
122 unsigned int data_early:1; /* Data finished before cmd */
123
124 struct sg_mapping_iter sg_miter; /* SG state for PIO */
125 unsigned int blocks; /* remaining PIO blocks */
126
127 int sg_count; /* Mapped sg entries */
128
129 u8 *adma_desc; /* ADMA descriptor table */
130 u8 *align_buffer; /* Bounce buffer */
131
132 dma_addr_t adma_addr; /* Mapped ADMA descr. table */
133 dma_addr_t align_addr; /* Mapped bounce buffer */
134
135 struct tasklet_struct card_tasklet; /* Tasklet structures */
136 struct tasklet_struct finish_tasklet;
137
138 struct timer_list timer; /* Timer for timeouts */
139
140 unsigned int caps; /* Alternative capabilities */
141
142 unsigned long private[0] ____cacheline_aligned;
143};
144#endif /* __SDHCI_H */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index d4a2ebbdab4b..d19e2114fd86 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -34,6 +34,7 @@
34struct sh_mmcif_plat_data { 34struct sh_mmcif_plat_data {
35 void (*set_pwr)(struct platform_device *pdev, int state); 35 void (*set_pwr)(struct platform_device *pdev, int state);
36 void (*down_pwr)(struct platform_device *pdev); 36 void (*down_pwr)(struct platform_device *pdev);
37 int (*get_cd)(struct platform_device *pdef);
37 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 38 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
38 unsigned long caps; 39 unsigned long caps;
39 u32 ocr; 40 u32 ocr;
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 4e02ee2b071e..43dcfbdc39de 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -227,7 +227,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
227 227
228/* 228/*
229 * These two macros will sometime replace ptep_clear_flush. 229 * These two macros will sometime replace ptep_clear_flush.
230 * ptep_clear_flush is impleemnted as macro itself, so this also is 230 * ptep_clear_flush is implemented as macro itself, so this also is
231 * implemented as a macro until ptep_clear_flush will converted to an 231 * implemented as a macro until ptep_clear_flush will converted to an
232 * inline function, to diminish the risk of compilation failure. The 232 * inline function, to diminish the risk of compilation failure. The
233 * invalidate_page method over time can be moved outside the PT lock 233 * invalidate_page method over time can be moved outside the PT lock
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 7fa20beb2ab9..57cc0e63714f 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -84,7 +84,7 @@ struct nand_bbt_descr {
84#define NAND_BBT_PERCHIP 0x00000080 84#define NAND_BBT_PERCHIP 0x00000080
85/* bbt has a version counter at offset veroffs */ 85/* bbt has a version counter at offset veroffs */
86#define NAND_BBT_VERSION 0x00000100 86#define NAND_BBT_VERSION 0x00000100
87/* Create a bbt if none axists */ 87/* Create a bbt if none exists */
88#define NAND_BBT_CREATE 0x00000200 88#define NAND_BBT_CREATE 0x00000200
89/* Search good / bad pattern through all pages of a block */ 89/* Search good / bad pattern through all pages of a block */
90#define NAND_BBT_SCANALLPAGES 0x00000400 90#define NAND_BBT_SCANALLPAGES 0x00000400
@@ -102,6 +102,8 @@ struct nand_bbt_descr {
102#define NAND_BBT_SCANBYTE1AND6 0x00100000 102#define NAND_BBT_SCANBYTE1AND6 0x00100000
103/* The nand_bbt_descr was created dynamicaly and must be freed */ 103/* The nand_bbt_descr was created dynamicaly and must be freed */
104#define NAND_BBT_DYNAMICSTRUCT 0x00200000 104#define NAND_BBT_DYNAMICSTRUCT 0x00200000
105/* The bad block table does not OOB for marker */
106#define NAND_BBT_NO_OOB 0x00400000
105 107
106/* The maximum number of blocks to scan for a bbt */ 108/* The maximum number of blocks to scan for a bbt */
107#define NAND_BBT_SCAN_MAXBLOCKS 4 109#define NAND_BBT_SCAN_MAXBLOCKS 4
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index d2118b0eac9a..4dd0c2cd7659 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -289,6 +289,7 @@ struct cfi_private {
289 must be of the same type. */ 289 must be of the same type. */
290 int mfr, id; 290 int mfr, id;
291 int numchips; 291 int numchips;
292 map_word sector_erase_cmd;
292 unsigned long chipshift; /* Because they're of the same type */ 293 unsigned long chipshift; /* Because they're of the same type */
293 const char *im_name; /* inter_module name for cmdset_setup */ 294 const char *im_name; /* inter_module name for cmdset_setup */
294 struct flchip chips[0]; /* per-chip data structure for each chip */ 295 struct flchip chips[0]; /* per-chip data structure for each chip */
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
new file mode 100644
index 000000000000..5d2556700ec2
--- /dev/null
+++ b/include/linux/mtd/fsmc.h
@@ -0,0 +1,181 @@
1/*
2 * incude/mtd/fsmc.h
3 *
4 * ST Microelectronics
5 * Flexible Static Memory Controller (FSMC)
6 * platform data interface and header file
7 *
8 * Copyright © 2010 ST Microelectronics
9 * Vipin Kumar <vipin.kumar@st.com>
10 *
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
14 */
15
16#ifndef __MTD_FSMC_H
17#define __MTD_FSMC_H
18
19#include <linux/platform_device.h>
20#include <linux/mtd/physmap.h>
21#include <linux/types.h>
22#include <linux/mtd/partitions.h>
23#include <asm/param.h>
24
25#define FSMC_NAND_BW8 1
26#define FSMC_NAND_BW16 2
27
28/*
29 * The placement of the Command Latch Enable (CLE) and
30 * Address Latch Enable (ALE) is twised around in the
31 * SPEAR310 implementation.
32 */
33#if defined(CONFIG_MACH_SPEAR310)
34#define PLAT_NAND_CLE (1 << 17)
35#define PLAT_NAND_ALE (1 << 16)
36#else
37#define PLAT_NAND_CLE (1 << 16)
38#define PLAT_NAND_ALE (1 << 17)
39#endif
40
41#define FSMC_MAX_NOR_BANKS 4
42#define FSMC_MAX_NAND_BANKS 4
43
44#define FSMC_FLASH_WIDTH8 1
45#define FSMC_FLASH_WIDTH16 2
46
47struct fsmc_nor_bank_regs {
48 uint32_t ctrl;
49 uint32_t ctrl_tim;
50};
51
52/* ctrl register definitions */
53#define BANK_ENABLE (1 << 0)
54#define MUXED (1 << 1)
55#define NOR_DEV (2 << 2)
56#define WIDTH_8 (0 << 4)
57#define WIDTH_16 (1 << 4)
58#define RSTPWRDWN (1 << 6)
59#define WPROT (1 << 7)
60#define WRT_ENABLE (1 << 12)
61#define WAIT_ENB (1 << 13)
62
63/* ctrl_tim register definitions */
64
65struct fsms_nand_bank_regs {
66 uint32_t pc;
67 uint32_t sts;
68 uint32_t comm;
69 uint32_t attrib;
70 uint32_t ioata;
71 uint32_t ecc1;
72 uint32_t ecc2;
73 uint32_t ecc3;
74};
75
76#define FSMC_NOR_REG_SIZE 0x40
77
78struct fsmc_regs {
79 struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS];
80 uint8_t reserved_1[0x40 - 0x20];
81 struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS];
82 uint8_t reserved_2[0xfe0 - 0xc0];
83 uint32_t peripid0; /* 0xfe0 */
84 uint32_t peripid1; /* 0xfe4 */
85 uint32_t peripid2; /* 0xfe8 */
86 uint32_t peripid3; /* 0xfec */
87 uint32_t pcellid0; /* 0xff0 */
88 uint32_t pcellid1; /* 0xff4 */
89 uint32_t pcellid2; /* 0xff8 */
90 uint32_t pcellid3; /* 0xffc */
91};
92
93#define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ)
94
95/* pc register definitions */
96#define FSMC_RESET (1 << 0)
97#define FSMC_WAITON (1 << 1)
98#define FSMC_ENABLE (1 << 2)
99#define FSMC_DEVTYPE_NAND (1 << 3)
100#define FSMC_DEVWID_8 (0 << 4)
101#define FSMC_DEVWID_16 (1 << 4)
102#define FSMC_ECCEN (1 << 6)
103#define FSMC_ECCPLEN_512 (0 << 7)
104#define FSMC_ECCPLEN_256 (1 << 7)
105#define FSMC_TCLR_1 (1 << 9)
106#define FSMC_TAR_1 (1 << 13)
107
108/* sts register definitions */
109#define FSMC_CODE_RDY (1 << 15)
110
111/* comm register definitions */
112#define FSMC_TSET_0 (0 << 0)
113#define FSMC_TWAIT_6 (6 << 8)
114#define FSMC_THOLD_4 (4 << 16)
115#define FSMC_THIZ_1 (1 << 24)
116
117/* peripid2 register definitions */
118#define FSMC_REVISION_MSK (0xf)
119#define FSMC_REVISION_SHFT (0x4)
120
121#define FSMC_VER1 1
122#define FSMC_VER2 2
123#define FSMC_VER3 3
124#define FSMC_VER4 4
125#define FSMC_VER5 5
126#define FSMC_VER6 6
127#define FSMC_VER7 7
128#define FSMC_VER8 8
129
130static inline uint32_t get_fsmc_version(struct fsmc_regs *regs)
131{
132 return (readl(&regs->peripid2) >> FSMC_REVISION_SHFT) &
133 FSMC_REVISION_MSK;
134}
135
136/*
137 * There are 13 bytes of ecc for every 512 byte block in FSMC version 8
138 * and it has to be read consecutively and immediately after the 512
139 * byte data block for hardware to generate the error bit offsets
140 * Managing the ecc bytes in the following way is easier. This way is
141 * similar to oobfree structure maintained already in u-boot nand driver
142 */
143#define MAX_ECCPLACE_ENTRIES 32
144
145struct fsmc_nand_eccplace {
146 uint8_t offset;
147 uint8_t length;
148};
149
150struct fsmc_eccplace {
151 struct fsmc_nand_eccplace eccplace[MAX_ECCPLACE_ENTRIES];
152};
153
154/**
155 * fsmc_nand_platform_data - platform specific NAND controller config
156 * @partitions: partition table for the platform, use a default fallback
157 * if this is NULL
158 * @nr_partitions: the number of partitions in the previous entry
159 * @options: different options for the driver
160 * @width: bus width
161 * @bank: default bank
162 * @select_bank: callback to select a certain bank, this is
163 * platform-specific. If the controller only supports one bank
164 * this may be set to NULL
165 */
166struct fsmc_nand_platform_data {
167 struct mtd_partition *partitions;
168 unsigned int nr_partitions;
169 unsigned int options;
170 unsigned int width;
171 unsigned int bank;
172 void (*select_bank)(uint32_t bank, uint32_t busw);
173};
174
175extern int __init fsmc_nor_init(struct platform_device *pdev,
176 unsigned long base, uint32_t bank, uint32_t width);
177extern void __init fsmc_init_board_info(struct platform_device *pdev,
178 struct mtd_partition *partitions, unsigned int nr_partitions,
179 unsigned int width);
180
181#endif /* __MTD_FSMC_H */
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index 64ee53ce95a9..02cd5f9b79b8 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -37,14 +37,14 @@ struct INFTLrecord {
37 __u16 firstEUN; 37 __u16 firstEUN;
38 __u16 lastEUN; 38 __u16 lastEUN;
39 __u16 numfreeEUNs; 39 __u16 numfreeEUNs;
40 __u16 LastFreeEUN; /* To speed up finding a free EUN */ 40 __u16 LastFreeEUN; /* To speed up finding a free EUN */
41 int head,sect,cyl; 41 int head,sect,cyl;
42 __u16 *PUtable; /* Physical Unit Table */ 42 __u16 *PUtable; /* Physical Unit Table */
43 __u16 *VUtable; /* Virtual Unit Table */ 43 __u16 *VUtable; /* Virtual Unit Table */
44 unsigned int nb_blocks; /* number of physical blocks */ 44 unsigned int nb_blocks; /* number of physical blocks */
45 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 45 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
46 struct erase_info instr; 46 struct erase_info instr;
47 struct nand_ecclayout oobinfo; 47 struct nand_ecclayout oobinfo;
48}; 48};
49 49
50int INFTL_mount(struct INFTLrecord *s); 50int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8485e42a9b09..fe8d77ebec13 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -110,6 +110,21 @@ struct mtd_oob_ops {
110 uint8_t *oobbuf; 110 uint8_t *oobbuf;
111}; 111};
112 112
113#define MTD_MAX_OOBFREE_ENTRIES_LARGE 32
114#define MTD_MAX_ECCPOS_ENTRIES_LARGE 448
115/*
116 * Internal ECC layout control structure. For historical reasons, there is a
117 * similar, smaller struct nand_ecclayout_user (in mtd-abi.h) that is retained
118 * for export to user-space via the ECCGETLAYOUT ioctl.
119 * nand_ecclayout should be expandable in the future simply by the above macros.
120 */
121struct nand_ecclayout {
122 __u32 eccbytes;
123 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES_LARGE];
124 __u32 oobavail;
125 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
126};
127
113struct mtd_info { 128struct mtd_info {
114 u_char type; 129 u_char type;
115 uint32_t flags; 130 uint32_t flags;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 102e12c58cb3..63e17d01fde9 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -27,15 +27,17 @@
27struct mtd_info; 27struct mtd_info;
28struct nand_flash_dev; 28struct nand_flash_dev;
29/* Scan and identify a NAND device */ 29/* Scan and identify a NAND device */
30extern int nand_scan (struct mtd_info *mtd, int max_chips); 30extern int nand_scan(struct mtd_info *mtd, int max_chips);
31/* Separate phases of nand_scan(), allowing board driver to intervene 31/*
32 * and override command or ECC setup according to flash type */ 32 * Separate phases of nand_scan(), allowing board driver to intervene
33 * and override command or ECC setup according to flash type.
34 */
33extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, 35extern int nand_scan_ident(struct mtd_info *mtd, int max_chips,
34 struct nand_flash_dev *table); 36 struct nand_flash_dev *table);
35extern int nand_scan_tail(struct mtd_info *mtd); 37extern int nand_scan_tail(struct mtd_info *mtd);
36 38
37/* Free resources held by the NAND device */ 39/* Free resources held by the NAND device */
38extern void nand_release (struct mtd_info *mtd); 40extern void nand_release(struct mtd_info *mtd);
39 41
40/* Internal helper for board drivers which need to override command function */ 42/* Internal helper for board drivers which need to override command function */
41extern void nand_wait_ready(struct mtd_info *mtd); 43extern void nand_wait_ready(struct mtd_info *mtd);
@@ -49,12 +51,13 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
49/* The maximum number of NAND chips in an array */ 51/* The maximum number of NAND chips in an array */
50#define NAND_MAX_CHIPS 8 52#define NAND_MAX_CHIPS 8
51 53
52/* This constant declares the max. oobsize / page, which 54/*
55 * This constant declares the max. oobsize / page, which
53 * is supported now. If you add a chip with bigger oobsize/page 56 * is supported now. If you add a chip with bigger oobsize/page
54 * adjust this accordingly. 57 * adjust this accordingly.
55 */ 58 */
56#define NAND_MAX_OOBSIZE 256 59#define NAND_MAX_OOBSIZE 576
57#define NAND_MAX_PAGESIZE 4096 60#define NAND_MAX_PAGESIZE 8192
58 61
59/* 62/*
60 * Constants for hardware specific CLE/ALE/NCE function 63 * Constants for hardware specific CLE/ALE/NCE function
@@ -88,6 +91,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
88#define NAND_CMD_RNDIN 0x85 91#define NAND_CMD_RNDIN 0x85
89#define NAND_CMD_READID 0x90 92#define NAND_CMD_READID 0x90
90#define NAND_CMD_ERASE2 0xd0 93#define NAND_CMD_ERASE2 0xd0
94#define NAND_CMD_PARAM 0xec
91#define NAND_CMD_RESET 0xff 95#define NAND_CMD_RESET 0xff
92 96
93#define NAND_CMD_LOCK 0x2a 97#define NAND_CMD_LOCK 0x2a
@@ -152,9 +156,10 @@ typedef enum {
152#define NAND_GET_DEVICE 0x80 156#define NAND_GET_DEVICE 0x80
153 157
154 158
155/* Option constants for bizarre disfunctionality and real 159/*
156* features 160 * Option constants for bizarre disfunctionality and real
157*/ 161 * features.
162 */
158/* Chip can not auto increment pages */ 163/* Chip can not auto increment pages */
159#define NAND_NO_AUTOINCR 0x00000001 164#define NAND_NO_AUTOINCR 0x00000001
160/* Buswitdh is 16 bit */ 165/* Buswitdh is 16 bit */
@@ -165,19 +170,27 @@ typedef enum {
165#define NAND_CACHEPRG 0x00000008 170#define NAND_CACHEPRG 0x00000008
166/* Chip has copy back function */ 171/* Chip has copy back function */
167#define NAND_COPYBACK 0x00000010 172#define NAND_COPYBACK 0x00000010
168/* AND Chip which has 4 banks and a confusing page / block 173/*
169 * assignment. See Renesas datasheet for further information */ 174 * AND Chip which has 4 banks and a confusing page / block
175 * assignment. See Renesas datasheet for further information.
176 */
170#define NAND_IS_AND 0x00000020 177#define NAND_IS_AND 0x00000020
171/* Chip has a array of 4 pages which can be read without 178/*
172 * additional ready /busy waits */ 179 * Chip has a array of 4 pages which can be read without
180 * additional ready /busy waits.
181 */
173#define NAND_4PAGE_ARRAY 0x00000040 182#define NAND_4PAGE_ARRAY 0x00000040
174/* Chip requires that BBT is periodically rewritten to prevent 183/*
184 * Chip requires that BBT is periodically rewritten to prevent
175 * bits from adjacent blocks from 'leaking' in altering data. 185 * bits from adjacent blocks from 'leaking' in altering data.
176 * This happens with the Renesas AG-AND chips, possibly others. */ 186 * This happens with the Renesas AG-AND chips, possibly others.
187 */
177#define BBT_AUTO_REFRESH 0x00000080 188#define BBT_AUTO_REFRESH 0x00000080
178/* Chip does not require ready check on read. True 189/*
190 * Chip does not require ready check on read. True
179 * for all large page devices, as they do not support 191 * for all large page devices, as they do not support
180 * autoincrement.*/ 192 * autoincrement.
193 */
181#define NAND_NO_READRDY 0x00000100 194#define NAND_NO_READRDY 0x00000100
182/* Chip does not allow subpage writes */ 195/* Chip does not allow subpage writes */
183#define NAND_NO_SUBPAGE_WRITE 0x00000200 196#define NAND_NO_SUBPAGE_WRITE 0x00000200
@@ -205,16 +218,27 @@ typedef enum {
205#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 218#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
206 219
207/* Non chip related options */ 220/* Non chip related options */
208/* Use a flash based bad block table. This option is passed to the 221/*
209 * default bad block table function. */ 222 * Use a flash based bad block table. OOB identifier is saved in OOB area.
223 * This option is passed to the default bad block table function.
224 */
210#define NAND_USE_FLASH_BBT 0x00010000 225#define NAND_USE_FLASH_BBT 0x00010000
211/* This option skips the bbt scan during initialization. */ 226/* This option skips the bbt scan during initialization. */
212#define NAND_SKIP_BBTSCAN 0x00020000 227#define NAND_SKIP_BBTSCAN 0x00020000
213/* This option is defined if the board driver allocates its own buffers 228/*
214 (e.g. because it needs them DMA-coherent */ 229 * This option is defined if the board driver allocates its own buffers
230 * (e.g. because it needs them DMA-coherent).
231 */
215#define NAND_OWN_BUFFERS 0x00040000 232#define NAND_OWN_BUFFERS 0x00040000
216/* Chip may not exist, so silence any errors in scan */ 233/* Chip may not exist, so silence any errors in scan */
217#define NAND_SCAN_SILENT_NODEV 0x00080000 234#define NAND_SCAN_SILENT_NODEV 0x00080000
235/*
236 * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
237 * the OOB area.
238 */
239#define NAND_USE_FLASH_BBT_NO_OOB 0x00100000
240/* Create an empty BBT with no vendor information if the BBT is available */
241#define NAND_CREATE_EMPTY_BBT 0x00200000
218 242
219/* Options set by nand scan */ 243/* Options set by nand scan */
220/* Nand scan has allocated controller struct */ 244/* Nand scan has allocated controller struct */
@@ -227,15 +251,80 @@ typedef enum {
227/* Keep gcc happy */ 251/* Keep gcc happy */
228struct nand_chip; 252struct nand_chip;
229 253
254struct nand_onfi_params {
255 /* rev info and features block */
256 /* 'O' 'N' 'F' 'I' */
257 u8 sig[4];
258 __le16 revision;
259 __le16 features;
260 __le16 opt_cmd;
261 u8 reserved[22];
262
263 /* manufacturer information block */
264 char manufacturer[12];
265 char model[20];
266 u8 jedec_id;
267 __le16 date_code;
268 u8 reserved2[13];
269
270 /* memory organization block */
271 __le32 byte_per_page;
272 __le16 spare_bytes_per_page;
273 __le32 data_bytes_per_ppage;
274 __le16 spare_bytes_per_ppage;
275 __le32 pages_per_block;
276 __le32 blocks_per_lun;
277 u8 lun_count;
278 u8 addr_cycles;
279 u8 bits_per_cell;
280 __le16 bb_per_lun;
281 __le16 block_endurance;
282 u8 guaranteed_good_blocks;
283 __le16 guaranteed_block_endurance;
284 u8 programs_per_page;
285 u8 ppage_attr;
286 u8 ecc_bits;
287 u8 interleaved_bits;
288 u8 interleaved_ops;
289 u8 reserved3[13];
290
291 /* electrical parameter block */
292 u8 io_pin_capacitance_max;
293 __le16 async_timing_mode;
294 __le16 program_cache_timing_mode;
295 __le16 t_prog;
296 __le16 t_bers;
297 __le16 t_r;
298 __le16 t_ccs;
299 __le16 src_sync_timing_mode;
300 __le16 src_ssync_features;
301 __le16 clk_pin_capacitance_typ;
302 __le16 io_pin_capacitance_typ;
303 __le16 input_pin_capacitance_typ;
304 u8 input_pin_capacitance_max;
305 u8 driver_strenght_support;
306 __le16 t_int_r;
307 __le16 t_ald;
308 u8 reserved4[7];
309
310 /* vendor */
311 u8 reserved5[90];
312
313 __le16 crc;
314} __attribute__((packed));
315
316#define ONFI_CRC_BASE 0x4F4E
317
230/** 318/**
231 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 319 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
232 * @lock: protection lock 320 * @lock: protection lock
233 * @active: the mtd device which holds the controller currently 321 * @active: the mtd device which holds the controller currently
234 * @wq: wait queue to sleep on if a NAND operation is in progress 322 * @wq: wait queue to sleep on if a NAND operation is in
235 * used instead of the per chip wait queue when a hw controller is available 323 * progress used instead of the per chip wait queue
324 * when a hw controller is available.
236 */ 325 */
237struct nand_hw_control { 326struct nand_hw_control {
238 spinlock_t lock; 327 spinlock_t lock;
239 struct nand_chip *active; 328 struct nand_chip *active;
240 wait_queue_head_t wq; 329 wait_queue_head_t wq;
241}; 330};
@@ -256,51 +345,42 @@ struct nand_hw_control {
256 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 345 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
257 * @read_page_raw: function to read a raw page without ECC 346 * @read_page_raw: function to read a raw page without ECC
258 * @write_page_raw: function to write a raw page without ECC 347 * @write_page_raw: function to write a raw page without ECC
259 * @read_page: function to read a page according to the ecc generator requirements 348 * @read_page: function to read a page according to the ecc generator
349 * requirements.
260 * @read_subpage: function to read parts of the page covered by ECC. 350 * @read_subpage: function to read parts of the page covered by ECC.
261 * @write_page: function to write a page according to the ecc generator requirements 351 * @write_page: function to write a page according to the ecc generator
352 * requirements.
262 * @read_oob: function to read chip OOB data 353 * @read_oob: function to read chip OOB data
263 * @write_oob: function to write chip OOB data 354 * @write_oob: function to write chip OOB data
264 */ 355 */
265struct nand_ecc_ctrl { 356struct nand_ecc_ctrl {
266 nand_ecc_modes_t mode; 357 nand_ecc_modes_t mode;
267 int steps; 358 int steps;
268 int size; 359 int size;
269 int bytes; 360 int bytes;
270 int total; 361 int total;
271 int prepad; 362 int prepad;
272 int postpad; 363 int postpad;
273 struct nand_ecclayout *layout; 364 struct nand_ecclayout *layout;
274 void (*hwctl)(struct mtd_info *mtd, int mode); 365 void (*hwctl)(struct mtd_info *mtd, int mode);
275 int (*calculate)(struct mtd_info *mtd, 366 int (*calculate)(struct mtd_info *mtd, const uint8_t *dat,
276 const uint8_t *dat, 367 uint8_t *ecc_code);
277 uint8_t *ecc_code); 368 int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
278 int (*correct)(struct mtd_info *mtd, uint8_t *dat, 369 uint8_t *calc_ecc);
279 uint8_t *read_ecc, 370 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
280 uint8_t *calc_ecc); 371 uint8_t *buf, int page);
281 int (*read_page_raw)(struct mtd_info *mtd, 372 void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
282 struct nand_chip *chip, 373 const uint8_t *buf);
283 uint8_t *buf, int page); 374 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
284 void (*write_page_raw)(struct mtd_info *mtd, 375 uint8_t *buf, int page);
285 struct nand_chip *chip, 376 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
286 const uint8_t *buf); 377 uint32_t offs, uint32_t len, uint8_t *buf);
287 int (*read_page)(struct mtd_info *mtd, 378 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
288 struct nand_chip *chip, 379 const uint8_t *buf);
289 uint8_t *buf, int page); 380 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page,
290 int (*read_subpage)(struct mtd_info *mtd, 381 int sndcmd);
291 struct nand_chip *chip, 382 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
292 uint32_t offs, uint32_t len, 383 int page);
293 uint8_t *buf);
294 void (*write_page)(struct mtd_info *mtd,
295 struct nand_chip *chip,
296 const uint8_t *buf);
297 int (*read_oob)(struct mtd_info *mtd,
298 struct nand_chip *chip,
299 int page,
300 int sndcmd);
301 int (*write_oob)(struct mtd_info *mtd,
302 struct nand_chip *chip,
303 int page);
304}; 384};
305 385
306/** 386/**
@@ -320,102 +400,132 @@ struct nand_buffers {
320 400
321/** 401/**
322 * struct nand_chip - NAND Private Flash Chip Data 402 * struct nand_chip - NAND Private Flash Chip Data
323 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 403 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
324 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 404 * flash device
405 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
406 * flash device.
325 * @read_byte: [REPLACEABLE] read one byte from the chip 407 * @read_byte: [REPLACEABLE] read one byte from the chip
326 * @read_word: [REPLACEABLE] read one word from the chip 408 * @read_word: [REPLACEABLE] read one word from the chip
327 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 409 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
328 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 410 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
329 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 411 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip
412 * data.
330 * @select_chip: [REPLACEABLE] select chip nr 413 * @select_chip: [REPLACEABLE] select chip nr
331 * @block_bad: [REPLACEABLE] check, if the block is bad 414 * @block_bad: [REPLACEABLE] check, if the block is bad
332 * @block_markbad: [REPLACEABLE] mark the block bad 415 * @block_markbad: [REPLACEABLE] mark the block bad
333 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling 416 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
334 * ALE/CLE/nCE. Also used to write command and address 417 * ALE/CLE/nCE. Also used to write command and address
335 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 418 * @init_size: [BOARDSPECIFIC] hardwarespecific funtion for setting
336 * If set to NULL no access to ready/busy is available and the ready/busy information 419 * mtd->oobsize, mtd->writesize and so on.
337 * is read from the chip status register 420 * @id_data contains the 8 bytes values of NAND_CMD_READID.
338 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 421 * Return with the bus width.
339 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 422 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing
423 * device ready/busy line. If set to NULL no access to
424 * ready/busy is available and the ready/busy information
425 * is read from the chip status register.
426 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing
427 * commands to the chip.
428 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
429 * ready.
340 * @ecc: [BOARDSPECIFIC] ecc control ctructure 430 * @ecc: [BOARDSPECIFIC] ecc control ctructure
341 * @buffers: buffer structure for read/write 431 * @buffers: buffer structure for read/write
342 * @hwcontrol: platform-specific hardware control structure 432 * @hwcontrol: platform-specific hardware control structure
343 * @ops: oob operation operands 433 * @ops: oob operation operands
344 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 434 * @erase_cmd: [INTERN] erase command write function, selectable due
435 * to AND support.
345 * @scan_bbt: [REPLACEABLE] function to scan bad block table 436 * @scan_bbt: [REPLACEABLE] function to scan bad block table
346 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 437 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering
438 * data from array to read regs (tR).
347 * @state: [INTERN] the current state of the NAND device 439 * @state: [INTERN] the current state of the NAND device
348 * @oob_poi: poison value buffer 440 * @oob_poi: poison value buffer
349 * @page_shift: [INTERN] number of address bits in a page (column address bits) 441 * @page_shift: [INTERN] number of address bits in a page (column
442 * address bits).
350 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 443 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
351 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 444 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
352 * @chip_shift: [INTERN] number of address bits in one chip 445 * @chip_shift: [INTERN] number of address bits in one chip
353 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 446 * @options: [BOARDSPECIFIC] various chip options. They can partly
354 * special functionality. See the defines for further explanation 447 * be set to inform nand_scan about special functionality.
355 * @badblockpos: [INTERN] position of the bad block marker in the oob area 448 * See the defines for further explanation.
449 * @badblockpos: [INTERN] position of the bad block marker in the oob
450 * area.
356 * @cellinfo: [INTERN] MLC/multichip data from chip ident 451 * @cellinfo: [INTERN] MLC/multichip data from chip ident
357 * @numchips: [INTERN] number of physical chips 452 * @numchips: [INTERN] number of physical chips
358 * @chipsize: [INTERN] the size of one chip for multichip arrays 453 * @chipsize: [INTERN] the size of one chip for multichip arrays
359 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 454 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
360 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 455 * @pagebuf: [INTERN] holds the pagenumber which is currently in
456 * data_buf.
361 * @subpagesize: [INTERN] holds the subpagesize 457 * @subpagesize: [INTERN] holds the subpagesize
458 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded),
459 * non 0 if ONFI supported.
460 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
461 * supported, 0 otherwise.
362 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 462 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
363 * @bbt: [INTERN] bad block table pointer 463 * @bbt: [INTERN] bad block table pointer
364 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 464 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
465 * lookup.
365 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 466 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
366 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 467 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial
367 * @controller: [REPLACEABLE] a pointer to a hardware controller structure 468 * bad block scan.
368 * which is shared among multiple independend devices 469 * @controller: [REPLACEABLE] a pointer to a hardware controller
470 * structure which is shared among multiple independend
471 * devices.
369 * @priv: [OPTIONAL] pointer to private chip date 472 * @priv: [OPTIONAL] pointer to private chip date
370 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 473 * @errstat: [OPTIONAL] hardware specific function to perform
371 * (determine if errors are correctable) 474 * additional error status checks (determine if errors are
475 * correctable).
372 * @write_page: [REPLACEABLE] High-level page write function 476 * @write_page: [REPLACEABLE] High-level page write function
373 */ 477 */
374 478
375struct nand_chip { 479struct nand_chip {
376 void __iomem *IO_ADDR_R; 480 void __iomem *IO_ADDR_R;
377 void __iomem *IO_ADDR_W; 481 void __iomem *IO_ADDR_W;
378 482
379 uint8_t (*read_byte)(struct mtd_info *mtd); 483 uint8_t (*read_byte)(struct mtd_info *mtd);
380 u16 (*read_word)(struct mtd_info *mtd); 484 u16 (*read_word)(struct mtd_info *mtd);
381 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 485 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
382 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 486 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
383 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 487 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
384 void (*select_chip)(struct mtd_info *mtd, int chip); 488 void (*select_chip)(struct mtd_info *mtd, int chip);
385 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 489 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
386 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 490 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
387 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, 491 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
388 unsigned int ctrl); 492 int (*init_size)(struct mtd_info *mtd, struct nand_chip *this,
389 int (*dev_ready)(struct mtd_info *mtd); 493 u8 *id_data);
390 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 494 int (*dev_ready)(struct mtd_info *mtd);
391 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); 495 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column,
392 void (*erase_cmd)(struct mtd_info *mtd, int page); 496 int page_addr);
393 int (*scan_bbt)(struct mtd_info *mtd); 497 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
394 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); 498 void (*erase_cmd)(struct mtd_info *mtd, int page);
395 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 499 int (*scan_bbt)(struct mtd_info *mtd);
396 const uint8_t *buf, int page, int cached, int raw); 500 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state,
397 501 int status, int page);
398 int chip_delay; 502 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
399 unsigned int options; 503 const uint8_t *buf, int page, int cached, int raw);
400 504
401 int page_shift; 505 int chip_delay;
402 int phys_erase_shift; 506 unsigned int options;
403 int bbt_erase_shift; 507
404 int chip_shift; 508 int page_shift;
405 int numchips; 509 int phys_erase_shift;
406 uint64_t chipsize; 510 int bbt_erase_shift;
407 int pagemask; 511 int chip_shift;
408 int pagebuf; 512 int numchips;
409 int subpagesize; 513 uint64_t chipsize;
410 uint8_t cellinfo; 514 int pagemask;
411 int badblockpos; 515 int pagebuf;
412 int badblockbits; 516 int subpagesize;
413 517 uint8_t cellinfo;
414 flstate_t state; 518 int badblockpos;
415 519 int badblockbits;
416 uint8_t *oob_poi; 520
417 struct nand_hw_control *controller; 521 int onfi_version;
418 struct nand_ecclayout *ecclayout; 522 struct nand_onfi_params onfi_params;
523
524 flstate_t state;
525
526 uint8_t *oob_poi;
527 struct nand_hw_control *controller;
528 struct nand_ecclayout *ecclayout;
419 529
420 struct nand_ecc_ctrl ecc; 530 struct nand_ecc_ctrl ecc;
421 struct nand_buffers *buffers; 531 struct nand_buffers *buffers;
@@ -423,13 +533,13 @@ struct nand_chip {
423 533
424 struct mtd_oob_ops ops; 534 struct mtd_oob_ops ops;
425 535
426 uint8_t *bbt; 536 uint8_t *bbt;
427 struct nand_bbt_descr *bbt_td; 537 struct nand_bbt_descr *bbt_td;
428 struct nand_bbt_descr *bbt_md; 538 struct nand_bbt_descr *bbt_md;
429 539
430 struct nand_bbt_descr *badblock_pattern; 540 struct nand_bbt_descr *badblock_pattern;
431 541
432 void *priv; 542 void *priv;
433}; 543};
434 544
435/* 545/*
@@ -473,7 +583,7 @@ struct nand_flash_dev {
473*/ 583*/
474struct nand_manufacturers { 584struct nand_manufacturers {
475 int id; 585 int id;
476 char * name; 586 char *name;
477}; 587};
478 588
479extern struct nand_flash_dev nand_flash_ids[]; 589extern struct nand_flash_dev nand_flash_ids[];
@@ -486,7 +596,7 @@ extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
486extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, 596extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
487 int allowbbt); 597 int allowbbt);
488extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, 598extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
489 size_t * retlen, uint8_t * buf); 599 size_t *retlen, uint8_t *buf);
490 600
491/** 601/**
492 * struct platform_nand_chip - chip level device structure 602 * struct platform_nand_chip - chip level device structure
@@ -502,17 +612,16 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
502 * @priv: hardware controller specific settings 612 * @priv: hardware controller specific settings
503 */ 613 */
504struct platform_nand_chip { 614struct platform_nand_chip {
505 int nr_chips; 615 int nr_chips;
506 int chip_offset; 616 int chip_offset;
507 int nr_partitions; 617 int nr_partitions;
508 struct mtd_partition *partitions; 618 struct mtd_partition *partitions;
509 struct nand_ecclayout *ecclayout; 619 struct nand_ecclayout *ecclayout;
510 int chip_delay; 620 int chip_delay;
511 unsigned int options; 621 unsigned int options;
512 const char **part_probe_types; 622 const char **part_probe_types;
513 void (*set_parts)(uint64_t size, 623 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip);
514 struct platform_nand_chip *chip); 624 void *priv;
515 void *priv;
516}; 625};
517 626
518/* Keep gcc happy */ 627/* Keep gcc happy */
@@ -534,18 +643,15 @@ struct platform_device;
534 * All fields are optional and depend on the hardware driver requirements 643 * All fields are optional and depend on the hardware driver requirements
535 */ 644 */
536struct platform_nand_ctrl { 645struct platform_nand_ctrl {
537 int (*probe)(struct platform_device *pdev); 646 int (*probe)(struct platform_device *pdev);
538 void (*remove)(struct platform_device *pdev); 647 void (*remove)(struct platform_device *pdev);
539 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 648 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
540 int (*dev_ready)(struct mtd_info *mtd); 649 int (*dev_ready)(struct mtd_info *mtd);
541 void (*select_chip)(struct mtd_info *mtd, int chip); 650 void (*select_chip)(struct mtd_info *mtd, int chip);
542 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, 651 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
543 unsigned int ctrl); 652 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
544 void (*write_buf)(struct mtd_info *mtd, 653 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
545 const uint8_t *buf, int len); 654 void *priv;
546 void (*read_buf)(struct mtd_info *mtd,
547 uint8_t *buf, int len);
548 void *priv;
549}; 655};
550 656
551/** 657/**
@@ -554,8 +660,8 @@ struct platform_nand_ctrl {
554 * @ctrl: controller level device structure 660 * @ctrl: controller level device structure
555 */ 661 */
556struct platform_nand_data { 662struct platform_nand_data {
557 struct platform_nand_chip chip; 663 struct platform_nand_chip chip;
558 struct platform_nand_ctrl ctrl; 664 struct platform_nand_ctrl ctrl;
559}; 665};
560 666
561/* Some helpers to access the data structures */ 667/* Some helpers to access the data structures */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 274b6196091d..2b54316591d2 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -39,7 +39,7 @@ struct mtd_partition {
39 uint64_t size; /* partition size */ 39 uint64_t size; /* partition size */
40 uint64_t offset; /* offset within the master MTD space */ 40 uint64_t offset; /* offset within the master MTD space */
41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */
42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ 42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */
43}; 43};
44 44
45#define MTDPART_OFS_NXTBLK (-2) 45#define MTDPART_OFS_NXTBLK (-2)
@@ -89,4 +89,9 @@ static inline int mtd_has_cmdlinepart(void) { return 1; }
89static inline int mtd_has_cmdlinepart(void) { return 0; } 89static inline int mtd_has_cmdlinepart(void) { return 0; }
90#endif 90#endif
91 91
92int mtd_is_master(struct mtd_info *mtd);
93int mtd_add_partition(struct mtd_info *master, char *name,
94 long long offset, long long length);
95int mtd_del_partition(struct mtd_info *master, int partno);
96
92#endif 97#endif
diff --git a/include/linux/mtd/super.h b/include/linux/mtd/super.h
index 4016dd6fe336..f456230f9330 100644
--- a/include/linux/mtd/super.h
+++ b/include/linux/mtd/super.h
@@ -18,10 +18,9 @@
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/mount.h> 19#include <linux/mount.h>
20 20
21extern int get_sb_mtd(struct file_system_type *fs_type, int flags, 21extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
22 const char *dev_name, void *data, 22 const char *dev_name, void *data,
23 int (*fill_super)(struct super_block *, void *, int), 23 int (*fill_super)(struct super_block *, void *, int));
24 struct vfsmount *mnt);
25extern void kill_mtd_super(struct super_block *sb); 24extern void kill_mtd_super(struct super_block *sb);
26 25
27 26
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c8d95e369ff4..7454408c41b6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -541,7 +541,7 @@ struct pci_error_handlers {
541struct module; 541struct module;
542struct pci_driver { 542struct pci_driver {
543 struct list_head node; 543 struct list_head node;
544 char *name; 544 const char *name;
545 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ 545 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
546 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ 546 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
547 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ 547 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
@@ -819,6 +819,9 @@ pci_power_t pci_target_state(struct pci_dev *dev);
819int pci_prepare_to_sleep(struct pci_dev *dev); 819int pci_prepare_to_sleep(struct pci_dev *dev);
820int pci_back_from_sleep(struct pci_dev *dev); 820int pci_back_from_sleep(struct pci_dev *dev);
821bool pci_dev_run_wake(struct pci_dev *dev); 821bool pci_dev_run_wake(struct pci_dev *dev);
822bool pci_check_pme_status(struct pci_dev *dev);
823void pci_wakeup_event(struct pci_dev *dev);
824void pci_pme_wakeup_bus(struct pci_bus *bus);
822 825
823static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 826static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
824 bool enable) 827 bool enable)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b4c3d1b50037..87e2c2e7aed3 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -767,6 +767,8 @@
767#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 767#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
768#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 768#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
769 769
770#define PCI_VENDOR_ID_STMICRO 0x104A
771
770#define PCI_VENDOR_ID_BUSLOGIC 0x104B 772#define PCI_VENDOR_ID_BUSLOGIC 0x104B
771#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 773#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
772#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 774#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
@@ -1251,6 +1253,8 @@
1251#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 1253#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
1252#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C 1254#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
1253#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1255#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1256#define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V0 0x0360
1257#define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V4 0x0364
1254#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1258#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1255#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 1259#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
1256#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB 1260#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB
@@ -2430,6 +2434,13 @@
2430#define PCI_DEVICE_ID_INTEL_82375 0x0482 2434#define PCI_DEVICE_ID_INTEL_82375 0x0482
2431#define PCI_DEVICE_ID_INTEL_82424 0x0483 2435#define PCI_DEVICE_ID_INTEL_82424 0x0483
2432#define PCI_DEVICE_ID_INTEL_82378 0x0484 2436#define PCI_DEVICE_ID_INTEL_82378 0x0484
2437#define PCI_DEVICE_ID_INTEL_MRST_SD0 0x0807
2438#define PCI_DEVICE_ID_INTEL_MRST_SD1 0x0808
2439#define PCI_DEVICE_ID_INTEL_MFD_SD 0x0820
2440#define PCI_DEVICE_ID_INTEL_MFD_SDIO1 0x0821
2441#define PCI_DEVICE_ID_INTEL_MFD_SDIO2 0x0822
2442#define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823
2443#define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824
2433#define PCI_DEVICE_ID_INTEL_I960 0x0960 2444#define PCI_DEVICE_ID_INTEL_I960 0x0960
2434#define PCI_DEVICE_ID_INTEL_I960RM 0x0962 2445#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
2435#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 2446#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062
@@ -2451,9 +2462,10 @@
2451#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2462#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2452#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2463#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2453#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2464#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2454#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 2465#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
2455#define PCI_DEVICE_ID_INTEL_CPT_LPC_MIN 0x1c41 2466#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41
2456#define PCI_DEVICE_ID_INTEL_CPT_LPC_MAX 0x1c5f 2467#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f
2468#define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40
2457#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2469#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2458#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2470#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2459#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2471#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
@@ -2662,9 +2674,9 @@
2662#define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a 2674#define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a
2663#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 2675#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30
2664#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2676#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
2665#define PCI_DEVICE_ID_INTEL_PCH_LPC_MIN 0x3b00 2677#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00
2666#define PCI_DEVICE_ID_INTEL_PCH_LPC_MAX 0x3b1f 2678#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f
2667#define PCI_DEVICE_ID_INTEL_PCH_SMBUS 0x3b30 2679#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30
2668#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2680#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2669#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2681#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2670#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2682#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
@@ -2673,8 +2685,8 @@
2673#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 2685#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035
2674#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 2686#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036
2675#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff 2687#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
2676#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 2688#define PCI_DEVICE_ID_INTEL_EP80579_0 0x5031
2677#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 2689#define PCI_DEVICE_ID_INTEL_EP80579_1 0x5032
2678#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2690#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2679#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2691#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2680#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2692#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 455b9ccdfca7..af83076c31a6 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -300,12 +300,14 @@
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
302 302
303/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ 303/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 304#define PCI_MSIX_FLAGS 2
305#define PCI_MSIX_FLAGS_QSIZE 0x7FF 305#define PCI_MSIX_FLAGS_QSIZE 0x7FF
306#define PCI_MSIX_FLAGS_ENABLE (1 << 15) 306#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
307#define PCI_MSIX_FLAGS_MASKALL (1 << 14) 307#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
308#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 308#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
309 311
310/* CompactPCI Hotswap Register */ 312/* CompactPCI Hotswap Register */
311 313
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 8a7d510ffa9c..46f6ba56fa91 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -78,6 +78,11 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
78 return 1; 78 return 1;
79} 79}
80 80
81static inline int percpu_counter_initialized(struct percpu_counter *fbc)
82{
83 return (fbc->counters != NULL);
84}
85
81#else 86#else
82 87
83struct percpu_counter { 88struct percpu_counter {
@@ -143,6 +148,11 @@ static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
143 return percpu_counter_read(fbc); 148 return percpu_counter_read(fbc);
144} 149}
145 150
151static inline int percpu_counter_initialized(struct percpu_counter *fbc)
152{
153 return 1;
154}
155
146#endif /* CONFIG_SMP */ 156#endif /* CONFIG_SMP */
147 157
148static inline void percpu_counter_inc(struct percpu_counter *fbc) 158static inline void percpu_counter_inc(struct percpu_counter *fbc)
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index e7320b5e82fb..3a8f0c9b2933 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -3,8 +3,8 @@
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, 4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
5 int mode, dev_t dev); 5 int mode, dev_t dev);
6extern int ramfs_get_sb(struct file_system_type *fs_type, 6extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
7 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 7 int flags, const char *dev_name, void *data);
8 8
9#ifndef CONFIG_MMU 9#ifndef CONFIG_MMU
10extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); 10extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
diff --git a/include/linux/regulator/lp3972.h b/include/linux/regulator/lp3972.h
new file mode 100644
index 000000000000..9bb7389b7a1e
--- /dev/null
+++ b/include/linux/regulator/lp3972.h
@@ -0,0 +1,48 @@
1/*
2 * National Semiconductors LP3972 PMIC chip client interface
3 *
4 * Based on lp3971.h
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 __LINUX_REGULATOR_LP3972_H
22#define __LINUX_REGULATOR_LP3972_H
23
24#include <linux/regulator/machine.h>
25
26#define LP3972_LDO1 0
27#define LP3972_LDO2 1
28#define LP3972_LDO3 2
29#define LP3972_LDO4 3
30#define LP3972_LDO5 4
31
32#define LP3972_DCDC1 5
33#define LP3972_DCDC2 6
34#define LP3972_DCDC3 7
35
36#define LP3972_NUM_REGULATORS 8
37
38struct lp3972_regulator_subdev {
39 int id;
40 struct regulator_init_data *initdata;
41};
42
43struct lp3972_platform_data {
44 int num_regulators;
45 struct lp3972_regulator_subdev *regulators;
46};
47
48#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index e2980287245e..761c745b9c24 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -189,10 +189,15 @@ int regulator_suspend_prepare(suspend_state_t state);
189 189
190#ifdef CONFIG_REGULATOR 190#ifdef CONFIG_REGULATOR
191void regulator_has_full_constraints(void); 191void regulator_has_full_constraints(void);
192void regulator_use_dummy_regulator(void);
192#else 193#else
193static inline void regulator_has_full_constraints(void) 194static inline void regulator_has_full_constraints(void)
194{ 195{
195} 196}
197
198static inline void regulator_use_dummy_regulator(void)
199{
200}
196#endif 201#endif
197 202
198#endif 203#endif
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
new file mode 100644
index 000000000000..45e42855ad05
--- /dev/null
+++ b/include/linux/regulator/max8952.h
@@ -0,0 +1,135 @@
1/*
2 * max8952.h - Voltage regulation for the Maxim 8952
3 *
4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef REGULATOR_MAX8952
23#define REGULATOR_MAX8952
24
25#include <linux/regulator/machine.h>
26
27enum {
28 MAX8952_DVS_MODE0,
29 MAX8952_DVS_MODE1,
30 MAX8952_DVS_MODE2,
31 MAX8952_DVS_MODE3,
32};
33
34enum {
35 MAX8952_DVS_770mV = 0,
36 MAX8952_DVS_780mV,
37 MAX8952_DVS_790mV,
38 MAX8952_DVS_800mV,
39 MAX8952_DVS_810mV,
40 MAX8952_DVS_820mV,
41 MAX8952_DVS_830mV,
42 MAX8952_DVS_840mV,
43 MAX8952_DVS_850mV,
44 MAX8952_DVS_860mV,
45 MAX8952_DVS_870mV,
46 MAX8952_DVS_880mV,
47 MAX8952_DVS_890mV,
48 MAX8952_DVS_900mV,
49 MAX8952_DVS_910mV,
50 MAX8952_DVS_920mV,
51 MAX8952_DVS_930mV,
52 MAX8952_DVS_940mV,
53 MAX8952_DVS_950mV,
54 MAX8952_DVS_960mV,
55 MAX8952_DVS_970mV,
56 MAX8952_DVS_980mV,
57 MAX8952_DVS_990mV,
58 MAX8952_DVS_1000mV,
59 MAX8952_DVS_1010mV,
60 MAX8952_DVS_1020mV,
61 MAX8952_DVS_1030mV,
62 MAX8952_DVS_1040mV,
63 MAX8952_DVS_1050mV,
64 MAX8952_DVS_1060mV,
65 MAX8952_DVS_1070mV,
66 MAX8952_DVS_1080mV,
67 MAX8952_DVS_1090mV,
68 MAX8952_DVS_1100mV,
69 MAX8952_DVS_1110mV,
70 MAX8952_DVS_1120mV,
71 MAX8952_DVS_1130mV,
72 MAX8952_DVS_1140mV,
73 MAX8952_DVS_1150mV,
74 MAX8952_DVS_1160mV,
75 MAX8952_DVS_1170mV,
76 MAX8952_DVS_1180mV,
77 MAX8952_DVS_1190mV,
78 MAX8952_DVS_1200mV,
79 MAX8952_DVS_1210mV,
80 MAX8952_DVS_1220mV,
81 MAX8952_DVS_1230mV,
82 MAX8952_DVS_1240mV,
83 MAX8952_DVS_1250mV,
84 MAX8952_DVS_1260mV,
85 MAX8952_DVS_1270mV,
86 MAX8952_DVS_1280mV,
87 MAX8952_DVS_1290mV,
88 MAX8952_DVS_1300mV,
89 MAX8952_DVS_1310mV,
90 MAX8952_DVS_1320mV,
91 MAX8952_DVS_1330mV,
92 MAX8952_DVS_1340mV,
93 MAX8952_DVS_1350mV,
94 MAX8952_DVS_1360mV,
95 MAX8952_DVS_1370mV,
96 MAX8952_DVS_1380mV,
97 MAX8952_DVS_1390mV,
98 MAX8952_DVS_1400mV,
99};
100
101enum {
102 MAX8952_SYNC_FREQ_26MHZ, /* Default */
103 MAX8952_SYNC_FREQ_13MHZ,
104 MAX8952_SYNC_FREQ_19_2MHZ,
105};
106
107enum {
108 MAX8952_RAMP_32mV_us = 0, /* Default */
109 MAX8952_RAMP_16mV_us,
110 MAX8952_RAMP_8mV_us,
111 MAX8952_RAMP_4mV_us,
112 MAX8952_RAMP_2mV_us,
113 MAX8952_RAMP_1mV_us,
114 MAX8952_RAMP_0_5mV_us,
115 MAX8952_RAMP_0_25mV_us,
116};
117
118#define MAX8952_NUM_DVS_MODE 4
119
120struct max8952_platform_data {
121 int gpio_vid0;
122 int gpio_vid1;
123 int gpio_en;
124
125 u8 default_mode;
126 u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
127
128 u8 sync_freq;
129 u8 ramp_speed;
130
131 struct regulator_init_data reg_data;
132};
133
134
135#endif /* REGULATOR_MAX8952 */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index be7adb7588e5..f53cdf216cef 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1080,7 +1080,7 @@ struct sched_class {
1080 struct task_struct *task); 1080 struct task_struct *task);
1081 1081
1082#ifdef CONFIG_FAIR_GROUP_SCHED 1082#ifdef CONFIG_FAIR_GROUP_SCHED
1083 void (*moved_group) (struct task_struct *p, int on_rq); 1083 void (*task_move_group) (struct task_struct *p, int on_rq);
1084#endif 1084#endif
1085}; 1085};
1086 1086
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index b4f183a31f13..f656d1a43dc0 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -129,7 +129,4 @@ static inline int register_intc_userimask(unsigned long addr)
129} 129}
130#endif 130#endif
131 131
132int reserve_irq_vector(unsigned int irq);
133void reserve_irq_legacy(void);
134
135#endif /* __SH_INTC_H */ 132#endif /* __SH_INTC_H */
diff --git a/include/linux/smb.h b/include/linux/smb.h
deleted file mode 100644
index 82fefddc5987..000000000000
--- a/include/linux/smb.h
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * smb.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_H
10#define _LINUX_SMB_H
11
12#include <linux/types.h>
13#include <linux/magic.h>
14#ifdef __KERNEL__
15#include <linux/time.h>
16#endif
17
18enum smb_protocol {
19 SMB_PROTOCOL_NONE,
20 SMB_PROTOCOL_CORE,
21 SMB_PROTOCOL_COREPLUS,
22 SMB_PROTOCOL_LANMAN1,
23 SMB_PROTOCOL_LANMAN2,
24 SMB_PROTOCOL_NT1
25};
26
27enum smb_case_hndl {
28 SMB_CASE_DEFAULT,
29 SMB_CASE_LOWER,
30 SMB_CASE_UPPER
31};
32
33struct smb_dskattr {
34 __u16 total;
35 __u16 allocblocks;
36 __u16 blocksize;
37 __u16 free;
38};
39
40struct smb_conn_opt {
41
42 /* The socket */
43 unsigned int fd;
44
45 enum smb_protocol protocol;
46 enum smb_case_hndl case_handling;
47
48 /* Connection-Options */
49
50 __u32 max_xmit;
51 __u16 server_uid;
52 __u16 tid;
53
54 /* The following are LANMAN 1.0 options */
55 __u16 secmode;
56 __u16 maxmux;
57 __u16 maxvcs;
58 __u16 rawmode;
59 __u32 sesskey;
60
61 /* The following are NT LM 0.12 options */
62 __u32 maxraw;
63 __u32 capabilities;
64 __s16 serverzone;
65};
66
67#ifdef __KERNEL__
68
69#define SMB_NLS_MAXNAMELEN 20
70struct smb_nls_codepage {
71 char local_name[SMB_NLS_MAXNAMELEN];
72 char remote_name[SMB_NLS_MAXNAMELEN];
73};
74
75
76#define SMB_MAXNAMELEN 255
77#define SMB_MAXPATHLEN 1024
78
79/*
80 * Contains all relevant data on a SMB networked file.
81 */
82struct smb_fattr {
83 __u16 attr;
84
85 unsigned long f_ino;
86 umode_t f_mode;
87 nlink_t f_nlink;
88 uid_t f_uid;
89 gid_t f_gid;
90 dev_t f_rdev;
91 loff_t f_size;
92 struct timespec f_atime;
93 struct timespec f_mtime;
94 struct timespec f_ctime;
95 unsigned long f_blocks;
96 int f_unix;
97};
98
99enum smb_conn_state {
100 CONN_VALID, /* everything's fine */
101 CONN_INVALID, /* Something went wrong, but did not
102 try to reconnect yet. */
103 CONN_RETRIED, /* Tried a reconnection, but was refused */
104 CONN_RETRYING /* Currently trying to reconnect */
105};
106
107#define SMB_HEADER_LEN 37 /* includes everything up to, but not
108 * including smb_bcc */
109
110#define SMB_INITIAL_PACKET_SIZE 4000
111#define SMB_MAX_PACKET_SIZE 32768
112
113/* reserve this much space for trans2 parameters. Shouldn't have to be more
114 than 10 or so, but OS/2 seems happier like this. */
115#define SMB_TRANS2_MAX_PARAM 64
116
117#endif
118#endif
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
deleted file mode 100644
index 923cd8a247b1..000000000000
--- a/include/linux/smb_fs.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * smb_fs.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_H
10#define _LINUX_SMB_FS_H
11
12#include <linux/smb.h>
13
14/*
15 * ioctl commands
16 */
17#define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
18#define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt)
19
20/* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */
21#define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t)
22
23
24#ifdef __KERNEL__
25#include <linux/smb_fs_i.h>
26#include <linux/smb_fs_sb.h>
27
28#include <linux/fs.h>
29#include <linux/pagemap.h>
30#include <linux/vmalloc.h>
31#include <linux/smb_mount.h>
32#include <linux/jiffies.h>
33#include <asm/unaligned.h>
34
35static inline struct smb_sb_info *SMB_SB(struct super_block *sb)
36{
37 return sb->s_fs_info;
38}
39
40static inline struct smb_inode_info *SMB_I(struct inode *inode)
41{
42 return container_of(inode, struct smb_inode_info, vfs_inode);
43}
44
45/* macro names are short for word, double-word, long value (?) */
46#define WVAL(buf, pos) (get_unaligned_le16((u8 *)(buf) + (pos)))
47#define DVAL(buf, pos) (get_unaligned_le32((u8 *)(buf) + (pos)))
48#define LVAL(buf, pos) (get_unaligned_le64((u8 *)(buf) + (pos)))
49
50#define WSET(buf, pos, val) put_unaligned_le16((val), (u8 *)(buf) + (pos))
51#define DSET(buf, pos, val) put_unaligned_le32((val), (u8 *)(buf) + (pos))
52#define LSET(buf, pos, val) put_unaligned_le64((val), (u8 *)(buf) + (pos))
53
54/* where to find the base of the SMB packet proper */
55#define smb_base(buf) ((u8 *)(((u8 *)(buf))+4))
56
57/*
58 * Flags for the in-memory inode
59 */
60#define SMB_F_LOCALWRITE 0x02 /* file modified locally */
61
62
63/* NT1 protocol capability bits */
64#define SMB_CAP_RAW_MODE 0x00000001
65#define SMB_CAP_MPX_MODE 0x00000002
66#define SMB_CAP_UNICODE 0x00000004
67#define SMB_CAP_LARGE_FILES 0x00000008
68#define SMB_CAP_NT_SMBS 0x00000010
69#define SMB_CAP_RPC_REMOTE_APIS 0x00000020
70#define SMB_CAP_STATUS32 0x00000040
71#define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080
72#define SMB_CAP_LOCK_AND_READ 0x00000100
73#define SMB_CAP_NT_FIND 0x00000200
74#define SMB_CAP_DFS 0x00001000
75#define SMB_CAP_LARGE_READX 0x00004000
76#define SMB_CAP_LARGE_WRITEX 0x00008000
77#define SMB_CAP_UNIX 0x00800000 /* unofficial ... */
78
79
80/*
81 * This is the time we allow an inode, dentry or dir cache to live. It is bad
82 * for performance to have shorter ttl on an inode than on the cache. It can
83 * cause refresh on each inode for a dir listing ... one-by-one
84 */
85#define SMB_MAX_AGE(server) (((server)->mnt->ttl * HZ) / 1000)
86
87static inline void
88smb_age_dentry(struct smb_sb_info *server, struct dentry *dentry)
89{
90 dentry->d_time = jiffies - SMB_MAX_AGE(server);
91}
92
93struct smb_cache_head {
94 time_t mtime; /* unused */
95 unsigned long time; /* cache age */
96 unsigned long end; /* last valid fpos in cache */
97 int eof;
98};
99
100#define SMB_DIRCACHE_SIZE ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *)))
101union smb_dir_cache {
102 struct smb_cache_head head;
103 struct dentry *dentry[SMB_DIRCACHE_SIZE];
104};
105
106#define SMB_FIRSTCACHE_SIZE ((int)((SMB_DIRCACHE_SIZE * \
107 sizeof(struct dentry *) - sizeof(struct smb_cache_head)) / \
108 sizeof(struct dentry *)))
109
110#define SMB_DIRCACHE_START (SMB_DIRCACHE_SIZE - SMB_FIRSTCACHE_SIZE)
111
112struct smb_cache_control {
113 struct smb_cache_head head;
114 struct page *page;
115 union smb_dir_cache *cache;
116 unsigned long fpos, ofs;
117 int filled, valid, idx;
118};
119
120#define SMB_OPS_NUM_STATIC 5
121struct smb_ops {
122 int (*read)(struct inode *inode, loff_t offset, int count,
123 char *data);
124 int (*write)(struct inode *inode, loff_t offset, int count, const
125 char *data);
126 int (*readdir)(struct file *filp, void *dirent, filldir_t filldir,
127 struct smb_cache_control *ctl);
128
129 int (*getattr)(struct smb_sb_info *server, struct dentry *dir,
130 struct smb_fattr *fattr);
131 /* int (*setattr)(...); */ /* setattr is really icky! */
132
133 int (*truncate)(struct inode *inode, loff_t length);
134
135
136 /* --- --- --- end of "static" entries --- --- --- */
137
138 int (*convert)(unsigned char *output, int olen,
139 const unsigned char *input, int ilen,
140 struct nls_table *nls_from,
141 struct nls_table *nls_to);
142};
143
144static inline int
145smb_is_open(struct inode *i)
146{
147 return (SMB_I(i)->open == server_from_inode(i)->generation);
148}
149
150extern void smb_install_null_ops(struct smb_ops *);
151#endif /* __KERNEL__ */
152
153#endif /* _LINUX_SMB_FS_H */
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h
deleted file mode 100644
index 8ccf4eca2c3d..000000000000
--- a/include/linux/smb_fs_i.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * smb_fs_i.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_I
10#define _LINUX_SMB_FS_I
11
12#include <linux/types.h>
13#include <linux/fs.h>
14
15/*
16 * smb fs inode data (in memory only)
17 */
18struct smb_inode_info {
19
20 /*
21 * file handles are local to a connection. A file is open if
22 * (open == generation).
23 */
24 unsigned int open; /* open generation */
25 __u16 fileid; /* What id to handle a file with? */
26 __u16 attr; /* Attribute fields, DOS value */
27
28 __u16 access; /* Access mode */
29 __u16 flags;
30 unsigned long oldmtime; /* last time refreshed */
31 unsigned long closed; /* timestamp when closed */
32 unsigned openers; /* number of fileid users */
33
34 struct inode vfs_inode; /* must be at the end */
35};
36
37#endif
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
deleted file mode 100644
index bb947dd1fba9..000000000000
--- a/include/linux/smb_fs_sb.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * smb_fs_sb.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _SMB_FS_SB
10#define _SMB_FS_SB
11
12#include <linux/types.h>
13#include <linux/backing-dev.h>
14#include <linux/smb.h>
15
16/*
17 * Upper limit on the total number of active smb_request structs.
18 */
19#define MAX_REQUEST_HARD 256
20
21enum smb_receive_state {
22 SMB_RECV_START, /* No data read, looking for length + sig */
23 SMB_RECV_HEADER, /* Reading the header data */
24 SMB_RECV_HCOMPLETE, /* Done with the header */
25 SMB_RECV_PARAM, /* Reading parameter words */
26 SMB_RECV_DATA, /* Reading data bytes */
27 SMB_RECV_END, /* End of request */
28 SMB_RECV_DROP, /* Dropping this SMB */
29 SMB_RECV_REQUEST, /* Received a request and not a reply */
30};
31
32/* structure access macros */
33#define server_from_inode(inode) SMB_SB((inode)->i_sb)
34#define server_from_dentry(dentry) SMB_SB((dentry)->d_sb)
35#define SB_of(server) ((server)->super_block)
36
37struct smb_sb_info {
38 /* List of all smbfs superblocks */
39 struct list_head entry;
40
41 enum smb_conn_state state;
42 struct file * sock_file;
43 int conn_error;
44 enum smb_receive_state rstate;
45
46 atomic_t nr_requests;
47 struct list_head xmitq;
48 struct list_head recvq;
49 u16 mid;
50
51 struct smb_mount_data_kernel *mnt;
52
53 /* Connections are counted. Each time a new socket arrives,
54 * generation is incremented.
55 */
56 unsigned int generation;
57 struct pid *conn_pid;
58 struct smb_conn_opt opt;
59 wait_queue_head_t conn_wq;
60 int conn_complete;
61 struct semaphore sem;
62
63 unsigned char header[SMB_HEADER_LEN + 20*2 + 2];
64 u32 header_len;
65 u32 smb_len;
66 u32 smb_read;
67
68 /* We use our own data_ready callback, but need the original one */
69 void *data_ready;
70
71 /* nls pointers for codepage conversions */
72 struct nls_table *remote_nls;
73 struct nls_table *local_nls;
74
75 struct smb_ops *ops;
76
77 struct super_block *super_block;
78
79 struct backing_dev_info bdi;
80};
81
82static inline int
83smb_lock_server_interruptible(struct smb_sb_info *server)
84{
85 return down_interruptible(&(server->sem));
86}
87
88static inline void
89smb_lock_server(struct smb_sb_info *server)
90{
91 down(&(server->sem));
92}
93
94static inline void
95smb_unlock_server(struct smb_sb_info *server)
96{
97 up(&(server->sem));
98}
99
100#endif
diff --git a/include/linux/smb_mount.h b/include/linux/smb_mount.h
deleted file mode 100644
index d10f00cb5703..000000000000
--- a/include/linux/smb_mount.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * smb_mount.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_MOUNT_H
10#define _LINUX_SMB_MOUNT_H
11
12#include <linux/types.h>
13
14#define SMB_MOUNT_VERSION 6
15
16struct smb_mount_data {
17 int version;
18 __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
19 __kernel_uid_t uid;
20 __kernel_gid_t gid;
21 __kernel_mode_t file_mode;
22 __kernel_mode_t dir_mode;
23};
24
25
26#ifdef __KERNEL__
27
28/* "vers" in big-endian */
29#define SMB_MOUNT_ASCII 0x76657273
30
31#define SMB_MOUNT_OLDVERSION 6
32#undef SMB_MOUNT_VERSION
33#define SMB_MOUNT_VERSION 7
34
35/* flags */
36#define SMB_MOUNT_WIN95 0x0001 /* Win 95 server */
37#define SMB_MOUNT_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */
38#define SMB_MOUNT_DIRATTR 0x0004 /* Use find_first for getattr */
39#define SMB_MOUNT_CASE 0x0008 /* Be case sensitive */
40#define SMB_MOUNT_UNICODE 0x0010 /* Server talks unicode */
41#define SMB_MOUNT_UID 0x0020 /* Use user specified uid */
42#define SMB_MOUNT_GID 0x0040 /* Use user specified gid */
43#define SMB_MOUNT_FMODE 0x0080 /* Use user specified file mode */
44#define SMB_MOUNT_DMODE 0x0100 /* Use user specified dir mode */
45
46struct smb_mount_data_kernel {
47 int version;
48
49 uid_t mounted_uid; /* Who may umount() this filesystem? */
50 uid_t uid;
51 gid_t gid;
52 mode_t file_mode;
53 mode_t dir_mode;
54
55 u32 flags;
56
57 /* maximum age in jiffies (inode, dentry and dircache) */
58 int ttl;
59
60 struct smb_nls_codepage codepage;
61};
62
63#endif
64
65#endif
diff --git a/include/linux/smbno.h b/include/linux/smbno.h
deleted file mode 100644
index f99e02d9ffe2..000000000000
--- a/include/linux/smbno.h
+++ /dev/null
@@ -1,363 +0,0 @@
1#ifndef _SMBNO_H_
2#define _SMBNO_H_
3
4/* these define the attribute byte as seen by DOS */
5#define aRONLY (1L<<0)
6#define aHIDDEN (1L<<1)
7#define aSYSTEM (1L<<2)
8#define aVOLID (1L<<3)
9#define aDIR (1L<<4)
10#define aARCH (1L<<5)
11
12/* error classes */
13#define SUCCESS 0 /* The request was successful. */
14#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
15#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
16#define ERRHRD 0x03 /* Error is an hardware error. */
17#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
18
19/* SMB X/Open error codes for the ERRdos error class */
20
21#define ERRbadfunc 1 /* Invalid function (or system call) */
22#define ERRbadfile 2 /* File not found (pathname error) */
23#define ERRbadpath 3 /* Directory not found */
24#define ERRnofids 4 /* Too many open files */
25#define ERRnoaccess 5 /* Access denied */
26#define ERRbadfid 6 /* Invalid fid */
27#define ERRbadmcb 7 /* Memory control blocks destroyed */
28#define ERRnomem 8 /* Out of memory */
29#define ERRbadmem 9 /* Invalid memory block address */
30#define ERRbadenv 10 /* Invalid environment */
31#define ERRbadformat 11 /* Invalid format */
32#define ERRbadaccess 12 /* Invalid open mode */
33#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
34#define ERRres 14 /* reserved */
35#define ERRbaddrive 15 /* Invalid drive */
36#define ERRremcd 16 /* Attempt to delete current directory */
37#define ERRdiffdevice 17 /* rename/move across different filesystems */
38#define ERRnofiles 18 /* no more files found in file search */
39#define ERRbadshare 32 /* Share mode on file conflict with open mode */
40#define ERRlock 33 /* Lock request conflicts with existing lock */
41#define ERRfilexists 80 /* File in operation already exists */
42#define ERRbadpipe 230 /* Named pipe invalid */
43#define ERRpipebusy 231 /* All instances of pipe are busy */
44#define ERRpipeclosing 232 /* named pipe close in progress */
45#define ERRnotconnected 233 /* No process on other end of named pipe */
46#define ERRmoredata 234 /* More data to be returned */
47
48#define ERROR_INVALID_PARAMETER 87
49#define ERROR_DISK_FULL 112
50#define ERROR_INVALID_NAME 123
51#define ERROR_DIR_NOT_EMPTY 145
52#define ERROR_NOT_LOCKED 158
53#define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */
54#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
55#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
56
57/* Error codes for the ERRSRV class */
58
59#define ERRerror 1 /* Non specific error code */
60#define ERRbadpw 2 /* Bad password */
61#define ERRbadtype 3 /* reserved */
62#define ERRaccess 4 /* No permissions to do the requested operation */
63#define ERRinvnid 5 /* tid invalid */
64#define ERRinvnetname 6 /* Invalid servername */
65#define ERRinvdevice 7 /* Invalid device */
66#define ERRqfull 49 /* Print queue full */
67#define ERRqtoobig 50 /* Queued item too big */
68#define ERRinvpfid 52 /* Invalid print file in smb_fid */
69#define ERRsmbcmd 64 /* Unrecognised command */
70#define ERRsrverror 65 /* smb server internal error */
71#define ERRfilespecs 67 /* fid and pathname invalid combination */
72#define ERRbadlink 68 /* reserved */
73#define ERRbadpermits 69 /* Access specified for a file is not valid */
74#define ERRbadpid 70 /* reserved */
75#define ERRsetattrmode 71 /* attribute mode invalid */
76#define ERRpaused 81 /* Message server paused */
77#define ERRmsgoff 82 /* Not receiving messages */
78#define ERRnoroom 83 /* No room for message */
79#define ERRrmuns 87 /* too many remote usernames */
80#define ERRtimeout 88 /* operation timed out */
81#define ERRnoresource 89 /* No resources currently available for request. */
82#define ERRtoomanyuids 90 /* too many userids */
83#define ERRbaduid 91 /* bad userid */
84#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
85#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
86#define ERRcontMPX 252 /* resume MPX mode */
87#define ERRbadPW /* reserved */
88#define ERRnosupport 0xFFFF
89
90/* Error codes for the ERRHRD class */
91
92#define ERRnowrite 19 /* read only media */
93#define ERRbadunit 20 /* Unknown device */
94#define ERRnotready 21 /* Drive not ready */
95#define ERRbadcmd 22 /* Unknown command */
96#define ERRdata 23 /* Data (CRC) error */
97#define ERRbadreq 24 /* Bad request structure length */
98#define ERRseek 25
99#define ERRbadmedia 26
100#define ERRbadsector 27
101#define ERRnopaper 28
102#define ERRwrite 29 /* write fault */
103#define ERRread 30 /* read fault */
104#define ERRgeneral 31 /* General hardware failure */
105#define ERRwrongdisk 34
106#define ERRFCBunavail 35
107#define ERRsharebufexc 36 /* share buffer exceeded */
108#define ERRdiskfull 39
109
110/*
111 * Access modes when opening a file
112 */
113#define SMB_ACCMASK 0x0003
114#define SMB_O_RDONLY 0x0000
115#define SMB_O_WRONLY 0x0001
116#define SMB_O_RDWR 0x0002
117
118/* offsets into message for common items */
119#define smb_com 8
120#define smb_rcls 9
121#define smb_reh 10
122#define smb_err 11
123#define smb_flg 13
124#define smb_flg2 14
125#define smb_reb 13
126#define smb_tid 28
127#define smb_pid 30
128#define smb_uid 32
129#define smb_mid 34
130#define smb_wct 36
131#define smb_vwv 37
132#define smb_vwv0 37
133#define smb_vwv1 39
134#define smb_vwv2 41
135#define smb_vwv3 43
136#define smb_vwv4 45
137#define smb_vwv5 47
138#define smb_vwv6 49
139#define smb_vwv7 51
140#define smb_vwv8 53
141#define smb_vwv9 55
142#define smb_vwv10 57
143#define smb_vwv11 59
144#define smb_vwv12 61
145#define smb_vwv13 63
146#define smb_vwv14 65
147
148/* these are the trans2 sub fields for primary requests */
149#define smb_tpscnt smb_vwv0
150#define smb_tdscnt smb_vwv1
151#define smb_mprcnt smb_vwv2
152#define smb_mdrcnt smb_vwv3
153#define smb_msrcnt smb_vwv4
154#define smb_flags smb_vwv5
155#define smb_timeout smb_vwv6
156#define smb_pscnt smb_vwv9
157#define smb_psoff smb_vwv10
158#define smb_dscnt smb_vwv11
159#define smb_dsoff smb_vwv12
160#define smb_suwcnt smb_vwv13
161#define smb_setup smb_vwv14
162#define smb_setup0 smb_setup
163#define smb_setup1 (smb_setup+2)
164#define smb_setup2 (smb_setup+4)
165
166/* these are for the secondary requests */
167#define smb_spscnt smb_vwv2
168#define smb_spsoff smb_vwv3
169#define smb_spsdisp smb_vwv4
170#define smb_sdscnt smb_vwv5
171#define smb_sdsoff smb_vwv6
172#define smb_sdsdisp smb_vwv7
173#define smb_sfid smb_vwv8
174
175/* and these for responses */
176#define smb_tprcnt smb_vwv0
177#define smb_tdrcnt smb_vwv1
178#define smb_prcnt smb_vwv3
179#define smb_proff smb_vwv4
180#define smb_prdisp smb_vwv5
181#define smb_drcnt smb_vwv6
182#define smb_droff smb_vwv7
183#define smb_drdisp smb_vwv8
184
185/* the complete */
186#define SMBmkdir 0x00 /* create directory */
187#define SMBrmdir 0x01 /* delete directory */
188#define SMBopen 0x02 /* open file */
189#define SMBcreate 0x03 /* create file */
190#define SMBclose 0x04 /* close file */
191#define SMBflush 0x05 /* flush file */
192#define SMBunlink 0x06 /* delete file */
193#define SMBmv 0x07 /* rename file */
194#define SMBgetatr 0x08 /* get file attributes */
195#define SMBsetatr 0x09 /* set file attributes */
196#define SMBread 0x0A /* read from file */
197#define SMBwrite 0x0B /* write to file */
198#define SMBlock 0x0C /* lock byte range */
199#define SMBunlock 0x0D /* unlock byte range */
200#define SMBctemp 0x0E /* create temporary file */
201#define SMBmknew 0x0F /* make new file */
202#define SMBchkpth 0x10 /* check directory path */
203#define SMBexit 0x11 /* process exit */
204#define SMBlseek 0x12 /* seek */
205#define SMBtcon 0x70 /* tree connect */
206#define SMBtconX 0x75 /* tree connect and X*/
207#define SMBtdis 0x71 /* tree disconnect */
208#define SMBnegprot 0x72 /* negotiate protocol */
209#define SMBdskattr 0x80 /* get disk attributes */
210#define SMBsearch 0x81 /* search directory */
211#define SMBsplopen 0xC0 /* open print spool file */
212#define SMBsplwr 0xC1 /* write to print spool file */
213#define SMBsplclose 0xC2 /* close print spool file */
214#define SMBsplretq 0xC3 /* return print queue */
215#define SMBsends 0xD0 /* send single block message */
216#define SMBsendb 0xD1 /* send broadcast message */
217#define SMBfwdname 0xD2 /* forward user name */
218#define SMBcancelf 0xD3 /* cancel forward */
219#define SMBgetmac 0xD4 /* get machine name */
220#define SMBsendstrt 0xD5 /* send start of multi-block message */
221#define SMBsendend 0xD6 /* send end of multi-block message */
222#define SMBsendtxt 0xD7 /* send text of multi-block message */
223
224/* Core+ protocol */
225#define SMBlockread 0x13 /* Lock a range and read */
226#define SMBwriteunlock 0x14 /* Unlock a range then write */
227#define SMBreadbraw 0x1a /* read a block of data with no smb header */
228#define SMBwritebraw 0x1d /* write a block of data with no smb header */
229#define SMBwritec 0x20 /* secondary write request */
230#define SMBwriteclose 0x2c /* write a file then close it */
231
232/* dos extended protocol */
233#define SMBreadBraw 0x1A /* read block raw */
234#define SMBreadBmpx 0x1B /* read block multiplexed */
235#define SMBreadBs 0x1C /* read block (secondary response) */
236#define SMBwriteBraw 0x1D /* write block raw */
237#define SMBwriteBmpx 0x1E /* write block multiplexed */
238#define SMBwriteBs 0x1F /* write block (secondary request) */
239#define SMBwriteC 0x20 /* write complete response */
240#define SMBsetattrE 0x22 /* set file attributes expanded */
241#define SMBgetattrE 0x23 /* get file attributes expanded */
242#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
243#define SMBtrans 0x25 /* transaction - name, bytes in/out */
244#define SMBtranss 0x26 /* transaction (secondary request/response) */
245#define SMBioctl 0x27 /* IOCTL */
246#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
247#define SMBcopy 0x29 /* copy */
248#define SMBmove 0x2A /* move */
249#define SMBecho 0x2B /* echo */
250#define SMBopenX 0x2D /* open and X */
251#define SMBreadX 0x2E /* read and X */
252#define SMBwriteX 0x2F /* write and X */
253#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
254#define SMBtconX 0x75 /* tree connect and X */
255#define SMBffirst 0x82 /* find first */
256#define SMBfunique 0x83 /* find unique */
257#define SMBfclose 0x84 /* find close */
258#define SMBinvalid 0xFE /* invalid command */
259
260
261/* Extended 2.0 protocol */
262#define SMBtrans2 0x32 /* TRANS2 protocol set */
263#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
264#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
265#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
266#define SMBulogoffX 0x74 /* user logoff */
267
268/* these are the TRANS2 sub commands */
269#define TRANSACT2_OPEN 0
270#define TRANSACT2_FINDFIRST 1
271#define TRANSACT2_FINDNEXT 2
272#define TRANSACT2_QFSINFO 3
273#define TRANSACT2_SETFSINFO 4
274#define TRANSACT2_QPATHINFO 5
275#define TRANSACT2_SETPATHINFO 6
276#define TRANSACT2_QFILEINFO 7
277#define TRANSACT2_SETFILEINFO 8
278#define TRANSACT2_FSCTL 9
279#define TRANSACT2_IOCTL 10
280#define TRANSACT2_FINDNOTIFYFIRST 11
281#define TRANSACT2_FINDNOTIFYNEXT 12
282#define TRANSACT2_MKDIR 13
283
284/* Information Levels - Shared? */
285#define SMB_INFO_STANDARD 1
286#define SMB_INFO_QUERY_EA_SIZE 2
287#define SMB_INFO_QUERY_EAS_FROM_LIST 3
288#define SMB_INFO_QUERY_ALL_EAS 4
289#define SMB_INFO_IS_NAME_VALID 6
290
291/* Information Levels - TRANSACT2_FINDFIRST */
292#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
293#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
294#define SMB_FIND_FILE_NAMES_INFO 0x103
295#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
296
297/* Information Levels - TRANSACT2_QPATHINFO */
298#define SMB_QUERY_FILE_BASIC_INFO 0x101
299#define SMB_QUERY_FILE_STANDARD_INFO 0x102
300#define SMB_QUERY_FILE_EA_INFO 0x103
301#define SMB_QUERY_FILE_NAME_INFO 0x104
302#define SMB_QUERY_FILE_ALL_INFO 0x107
303#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
304#define SMB_QUERY_FILE_STREAM_INFO 0x109
305#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b
306
307/* Information Levels - TRANSACT2_SETFILEINFO */
308#define SMB_SET_FILE_BASIC_INFO 0x101
309#define SMB_SET_FILE_DISPOSITION_INFO 0x102
310#define SMB_SET_FILE_ALLOCATION_INFO 0x103
311#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
312
313/* smb_flg field flags */
314#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
315#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
316#define SMB_FLAGS_RESERVED 0x04
317#define SMB_FLAGS_CASELESS_PATHNAMES 0x08
318#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
319#define SMB_FLAGS_REQUEST_OPLOCK 0x20
320#define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
321#define SMB_FLAGS_REPLY 0x80
322
323/* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */
324#define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001
325#define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002
326#define SMB_FLAGS2_DFS_PATHNAMES 0x1000
327#define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
328#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
329#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
330
331
332/*
333 * UNIX stuff (from samba trans2.h)
334 */
335#define MIN_UNIX_INFO_LEVEL 0x200
336#define MAX_UNIX_INFO_LEVEL 0x2FF
337#define SMB_FIND_FILE_UNIX 0x202
338#define SMB_QUERY_FILE_UNIX_BASIC 0x200
339#define SMB_QUERY_FILE_UNIX_LINK 0x201
340#define SMB_QUERY_FILE_UNIX_HLINK 0x202
341#define SMB_SET_FILE_UNIX_BASIC 0x200
342#define SMB_SET_FILE_UNIX_LINK 0x201
343#define SMB_SET_FILE_UNIX_HLINK 0x203
344#define SMB_QUERY_CIFS_UNIX_INFO 0x200
345
346/* values which means "don't change it" */
347#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
348#define SMB_UID_NO_CHANGE 0xFFFFFFFF
349#define SMB_GID_NO_CHANGE 0xFFFFFFFF
350#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
351#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
352
353/* UNIX filetype mappings. */
354#define UNIX_TYPE_FILE 0
355#define UNIX_TYPE_DIR 1
356#define UNIX_TYPE_SYMLINK 2
357#define UNIX_TYPE_CHARDEV 3
358#define UNIX_TYPE_BLKDEV 4
359#define UNIX_TYPE_FIFO 5
360#define UNIX_TYPE_SOCKET 6
361#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
362
363#endif /* _SMBNO_H_ */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 5146b50202ce..86b652fabf6e 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
322 int offset, 322 int offset,
323 unsigned int len, __wsum *csump); 323 unsigned int len, __wsum *csump);
324 324
325extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 325extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
328 int offset, int len); 328 int offset, int len);
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
new file mode 100644
index 000000000000..4c7be2263011
--- /dev/null
+++ b/include/linux/ti_wilink_st.h
@@ -0,0 +1,400 @@
1/*
2 * Shared Transport Header file
3 * To be included by the protocol stack drivers for
4 * Texas Instruments BT,FM and GPS combo chip drivers
5 * and also serves the sub-modules of the shared transport driver.
6 *
7 * Copyright (C) 2009-2010 Texas Instruments
8 * Author: Pavan Savoy <pavan_savoy@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifndef TI_WILINK_ST_H
26#define TI_WILINK_ST_H
27
28/**
29 * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
30 * gpio states for their chip/core enable gpios
31 */
32enum kim_gpio_state {
33 KIM_GPIO_INACTIVE,
34 KIM_GPIO_ACTIVE,
35};
36
37/**
38 * enum proto-type - The protocol on WiLink chips which share a
39 * common physical interface like UART.
40 */
41enum proto_type {
42 ST_BT,
43 ST_FM,
44 ST_GPS,
45 ST_MAX,
46};
47
48/**
49 * struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST
50 * @type: type of the protocol being registered among the
51 * available proto_type(BT, FM, GPS the protocol which share TTY).
52 * @recv: the receiver callback pointing to a function in the
53 * protocol drivers called by the ST driver upon receiving
54 * relevant data.
55 * @match_packet: reserved for future use, to make ST more generic
56 * @reg_complete_cb: callback handler pointing to a function in protocol
57 * handler called by ST when the pending registrations are complete.
58 * The registrations are marked pending, in situations when fw
59 * download is in progress.
60 * @write: pointer to function in ST provided to protocol drivers from ST,
61 * to be made use when protocol drivers have data to send to TTY.
62 * @priv_data: privdate data holder for the protocol drivers, sent
63 * from the protocol drivers during registration, and sent back on
64 * reg_complete_cb and recv.
65 */
66struct st_proto_s {
67 enum proto_type type;
68 long (*recv) (void *, struct sk_buff *);
69 unsigned char (*match_packet) (const unsigned char *data);
70 void (*reg_complete_cb) (void *, char data);
71 long (*write) (struct sk_buff *skb);
72 void *priv_data;
73};
74
75extern long st_register(struct st_proto_s *);
76extern long st_unregister(enum proto_type);
77
78
79/*
80 * header information used by st_core.c
81 */
82
83/* states of protocol list */
84#define ST_NOTEMPTY 1
85#define ST_EMPTY 0
86
87/*
88 * possible st_states
89 */
90#define ST_INITIALIZING 1
91#define ST_REG_IN_PROGRESS 2
92#define ST_REG_PENDING 3
93#define ST_WAITING_FOR_RESP 4
94
95/**
96 * struct st_data_s - ST core internal structure
97 * @st_state: different states of ST like initializing, registration
98 * in progress, this is mainly used to return relevant err codes
99 * when protocol drivers are registering. It is also used to track
100 * the recv function, as in during fw download only HCI events
101 * can occur , where as during other times other events CH8, CH9
102 * can occur.
103 * @tty: tty provided by the TTY core for line disciplines.
104 * @tx_skb: If for some reason the tty's write returns lesser bytes written
105 * then to maintain the rest of data to be written on next instance.
106 * This needs to be protected, hence the lock inside wakeup func.
107 * @tx_state: if the data is being written onto the TTY and protocol driver
108 * wants to send more, queue up data and mark that there is
109 * more data to send.
110 * @list: the list of protocols registered, only MAX can exist, one protocol
111 * can register only once.
112 * @rx_state: states to be maintained inside st's tty receive
113 * @rx_count: count to be maintained inside st's tty receieve
114 * @rx_skb: the skb where all data for a protocol gets accumulated,
115 * since tty might not call receive when a complete event packet
116 * is received, the states, count and the skb needs to be maintained.
117 * @txq: the list of skbs which needs to be sent onto the TTY.
118 * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
119 * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
120 * from waitq can be moved onto the txq.
121 * Needs locking too.
122 * @lock: the lock to protect skbs, queues, and ST states.
123 * @protos_registered: count of the protocols registered, also when 0 the
124 * chip enable gpio can be toggled, and when it changes to 1 the fw
125 * needs to be downloaded to initialize chip side ST.
126 * @ll_state: the various PM states the chip can be, the states are notified
127 * to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
128 * @kim_data: reference to the parent encapsulating structure.
129 *
130 */
131struct st_data_s {
132 unsigned long st_state;
133 struct tty_struct *tty;
134 struct sk_buff *tx_skb;
135#define ST_TX_SENDING 1
136#define ST_TX_WAKEUP 2
137 unsigned long tx_state;
138 struct st_proto_s *list[ST_MAX];
139 unsigned long rx_state;
140 unsigned long rx_count;
141 struct sk_buff *rx_skb;
142 struct sk_buff_head txq, tx_waitq;
143 spinlock_t lock;
144 unsigned char protos_registered;
145 unsigned long ll_state;
146 void *kim_data;
147};
148
149/**
150 * st_int_write -
151 * point this to tty->driver->write or tty->ops->write
152 * depending upon the kernel version
153 */
154int st_int_write(struct st_data_s*, const unsigned char*, int);
155
156/**
157 * st_write -
158 * internal write function, passed onto protocol drivers
159 * via the write function ptr of protocol struct
160 */
161long st_write(struct sk_buff *);
162
163/* function to be called from ST-LL */
164void st_ll_send_frame(enum proto_type, struct sk_buff *);
165
166/* internal wake up function */
167void st_tx_wakeup(struct st_data_s *st_data);
168
169/* init, exit entry funcs called from KIM */
170int st_core_init(struct st_data_s **);
171void st_core_exit(struct st_data_s *);
172
173/* ask for reference from KIM */
174void st_kim_ref(struct st_data_s **, int);
175
176#define GPS_STUB_TEST
177#ifdef GPS_STUB_TEST
178int gps_chrdrv_stub_write(const unsigned char*, int);
179void gps_chrdrv_stub_init(void);
180#endif
181
182/*
183 * header information used by st_kim.c
184 */
185
186/* time in msec to wait for
187 * line discipline to be installed
188 */
189#define LDISC_TIME 500
190#define CMD_RESP_TIME 500
191#define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
192 | ((unsigned short)((unsigned char)(b))) << 8))
193
194#define GPIO_HIGH 1
195#define GPIO_LOW 0
196
197/* the Power-On-Reset logic, requires to attempt
198 * to download firmware onto chip more than once
199 * since the self-test for chip takes a while
200 */
201#define POR_RETRY_COUNT 5
202
203/**
204 * struct chip_version - save the chip version
205 */
206struct chip_version {
207 unsigned short full;
208 unsigned short chip;
209 unsigned short min_ver;
210 unsigned short maj_ver;
211};
212
213/**
214 * struct kim_data_s - the KIM internal data, embedded as the
215 * platform's drv data. One for each ST device in the system.
216 * @uim_pid: KIM needs to communicate with UIM to request to install
217 * the ldisc by opening UART when protocol drivers register.
218 * @kim_pdev: the platform device added in one of the board-XX.c file
219 * in arch/XX/ directory, 1 for each ST device.
220 * @kim_rcvd: completion handler to notify when data was received,
221 * mainly used during fw download, which involves multiple send/wait
222 * for each of the HCI-VS commands.
223 * @ldisc_installed: completion handler to notify that the UIM accepted
224 * the request to install ldisc, notify from tty_open which suggests
225 * the ldisc was properly installed.
226 * @resp_buffer: data buffer for the .bts fw file name.
227 * @fw_entry: firmware class struct to request/release the fw.
228 * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
229 * @rx_state: the rx state for kim's receive func during fw download.
230 * @rx_count: the rx count for the kim's receive func during fw download.
231 * @rx_skb: all of fw data might not come at once, and hence data storage for
232 * whole of the fw response, only HCI_EVENTs and hence diff from ST's
233 * response.
234 * @rfkill: rfkill data for each of the cores to be registered with rfkill.
235 * @rf_protos: proto types of the data registered with rfkill sub-system.
236 * @core_data: ST core's data, which mainly is the tty's disc_data
237 * @version: chip version available via a sysfs entry.
238 *
239 */
240struct kim_data_s {
241 long uim_pid;
242 struct platform_device *kim_pdev;
243 struct completion kim_rcvd, ldisc_installed;
244 char resp_buffer[30];
245 const struct firmware *fw_entry;
246 long gpios[ST_MAX];
247 unsigned long rx_state;
248 unsigned long rx_count;
249 struct sk_buff *rx_skb;
250 struct rfkill *rfkill[ST_MAX];
251 enum proto_type rf_protos[ST_MAX];
252 struct st_data_s *core_data;
253 struct chip_version version;
254};
255
256/**
257 * functions called when 1 of the protocol drivers gets
258 * registered, these need to communicate with UIM to request
259 * ldisc installed, read chip_version, download relevant fw
260 */
261long st_kim_start(void *);
262long st_kim_stop(void *);
263
264void st_kim_recv(void *, const unsigned char *, long count);
265void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state);
266void st_kim_complete(void *);
267void kim_st_list_protocols(struct st_data_s *, void *);
268
269/*
270 * BTS headers
271 */
272#define ACTION_SEND_COMMAND 1
273#define ACTION_WAIT_EVENT 2
274#define ACTION_SERIAL 3
275#define ACTION_DELAY 4
276#define ACTION_RUN_SCRIPT 5
277#define ACTION_REMARKS 6
278
279/**
280 * struct bts_header - the fw file is NOT binary which can
281 * be sent onto TTY as is. The .bts is more a script
282 * file which has different types of actions.
283 * Each such action needs to be parsed by the KIM and
284 * relevant procedure to be called.
285 */
286struct bts_header {
287 u32 magic;
288 u32 version;
289 u8 future[24];
290 u8 actions[0];
291} __attribute__ ((packed));
292
293/**
294 * struct bts_action - Each .bts action has its own type of
295 * data.
296 */
297struct bts_action {
298 u16 type;
299 u16 size;
300 u8 data[0];
301} __attribute__ ((packed));
302
303struct bts_action_send {
304 u8 data[0];
305} __attribute__ ((packed));
306
307struct bts_action_wait {
308 u32 msec;
309 u32 size;
310 u8 data[0];
311} __attribute__ ((packed));
312
313struct bts_action_delay {
314 u32 msec;
315} __attribute__ ((packed));
316
317struct bts_action_serial {
318 u32 baud;
319 u32 flow_control;
320} __attribute__ ((packed));
321
322/**
323 * struct hci_command - the HCI-VS for intrepreting
324 * the change baud rate of host-side UART, which
325 * needs to be ignored, since UIM would do that
326 * when it receives request from KIM for ldisc installation.
327 */
328struct hci_command {
329 u8 prefix;
330 u16 opcode;
331 u8 plen;
332 u32 speed;
333} __attribute__ ((packed));
334
335/*
336 * header information used by st_ll.c
337 */
338
339/* ST LL receiver states */
340#define ST_W4_PACKET_TYPE 0
341#define ST_BT_W4_EVENT_HDR 1
342#define ST_BT_W4_ACL_HDR 2
343#define ST_BT_W4_SCO_HDR 3
344#define ST_BT_W4_DATA 4
345#define ST_FM_W4_EVENT_HDR 5
346#define ST_GPS_W4_EVENT_HDR 6
347
348/* ST LL state machines */
349#define ST_LL_ASLEEP 0
350#define ST_LL_ASLEEP_TO_AWAKE 1
351#define ST_LL_AWAKE 2
352#define ST_LL_AWAKE_TO_ASLEEP 3
353#define ST_LL_INVALID 4
354
355/* different PM notifications coming from chip */
356#define LL_SLEEP_IND 0x30
357#define LL_SLEEP_ACK 0x31
358#define LL_WAKE_UP_IND 0x32
359#define LL_WAKE_UP_ACK 0x33
360
361/* initialize and de-init ST LL */
362long st_ll_init(struct st_data_s *);
363long st_ll_deinit(struct st_data_s *);
364
365/**
366 * enable/disable ST LL along with KIM start/stop
367 * called by ST Core
368 */
369void st_ll_enable(struct st_data_s *);
370void st_ll_disable(struct st_data_s *);
371
372/**
373 * various funcs used by ST core to set/get the various PM states
374 * of the chip.
375 */
376unsigned long st_ll_getstate(struct st_data_s *);
377unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char);
378void st_ll_wakeup(struct st_data_s *);
379
380/*
381 * header information used by st_core.c for FM and GPS
382 * packet parsing, the bluetooth headers are already available
383 * at net/bluetooth/
384 */
385
386struct fm_event_hdr {
387 u8 plen;
388} __attribute__ ((packed));
389
390#define FM_MAX_FRAME_SIZE 0xFF /* TODO: */
391#define FM_EVENT_HDR_SIZE 1 /* size of fm_event_hdr */
392#define ST_FM_CH8_PKT 0x8
393
394/* gps stuff */
395struct gps_event_hdr {
396 u8 opcode;
397 u16 plen;
398} __attribute__ ((packed));
399
400#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 86be0cdeb11b..2a754748dd5f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -50,6 +50,7 @@
50#define N_V253 19 /* Codec control over voice modem */ 50#define N_V253 19 /* Codec control over voice modem */
51#define N_CAIF 20 /* CAIF protocol for talking to modems */ 51#define N_CAIF 20 /* CAIF protocol for talking to modems */
52#define N_GSM0710 21 /* GSM 0710 Mux */ 52#define N_GSM0710 21 /* GSM 0710 Mux */
53#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
53 54
54/* 55/*
55 * This character is the same as _POSIX_VDISABLE: it cannot be used as 56 * This character is the same as _POSIX_VDISABLE: it cannot be used as
@@ -540,8 +541,8 @@ extern void tty_audit_exit(void);
540extern void tty_audit_fork(struct signal_struct *sig); 541extern void tty_audit_fork(struct signal_struct *sig);
541extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 542extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
542extern void tty_audit_push(struct tty_struct *tty); 543extern void tty_audit_push(struct tty_struct *tty);
543extern void tty_audit_push_task(struct task_struct *tsk, 544extern int tty_audit_push_task(struct task_struct *tsk,
544 uid_t loginuid, u32 sessionid); 545 uid_t loginuid, u32 sessionid);
545#else 546#else
546static inline void tty_audit_add_data(struct tty_struct *tty, 547static inline void tty_audit_add_data(struct tty_struct *tty,
547 unsigned char *data, size_t size) 548 unsigned char *data, size_t size)
@@ -559,9 +560,10 @@ static inline void tty_audit_fork(struct signal_struct *sig)
559static inline void tty_audit_push(struct tty_struct *tty) 560static inline void tty_audit_push(struct tty_struct *tty)
560{ 561{
561} 562}
562static inline void tty_audit_push_task(struct task_struct *tsk, 563static inline int tty_audit_push_task(struct task_struct *tsk,
563 uid_t loginuid, u32 sessionid) 564 uid_t loginuid, u32 sessionid)
564{ 565{
566 return 0;
565} 567}
566#endif 568#endif
567 569
diff --git a/include/linux/via-core.h b/include/linux/via-core.h
index 7ffb521e1a7a..38bffd8ccca5 100644
--- a/include/linux/via-core.h
+++ b/include/linux/via-core.h
@@ -81,7 +81,7 @@ struct viafb_dev {
81 unsigned long fbmem_start; 81 unsigned long fbmem_start;
82 long fbmem_len; 82 long fbmem_len;
83 void __iomem *fbmem; 83 void __iomem *fbmem;
84#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE) 84#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
85 long camera_fbmem_offset; 85 long camera_fbmem_offset;
86 long camera_fbmem_size; 86 long camera_fbmem_size;
87#endif 87#endif
@@ -138,6 +138,7 @@ void viafb_irq_disable(u32 mask);
138#define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ 138#define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */
139#define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ 139#define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */
140 140
141#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
141/* 142/*
142 * DMA management. 143 * DMA management.
143 */ 144 */
@@ -172,6 +173,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);
172 */ 173 */
173#define VGA_WIDTH 640 174#define VGA_WIDTH 640
174#define VGA_HEIGHT 480 175#define VGA_HEIGHT 480
176#endif /* CONFIG_VIDEO_VIA_CAMERA */
175 177
176/* 178/*
177 * Indexed port operations. Note that these are all multi-op 179 * Indexed port operations. Note that these are all multi-op
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6dcdbd..5f6f47044abf 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -363,6 +363,8 @@ struct v4l2_pix_format {
363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
364#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ 364#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
365#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ 365#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
366#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
367#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
366 368
367/* 369/*
368 * F O R M A T E N U M E R A T I O N 370 * F O R M A T E N U M E R A T I O N
@@ -1045,8 +1047,11 @@ enum v4l2_colorfx {
1045 1047
1046#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) 1048#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1047 1049
1050#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1051#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1052
1048/* last CID + 1 */ 1053/* last CID + 1 */
1049#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) 1054#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1050 1055
1051/* MPEG-class control IDs defined by V4L2 */ 1056/* MPEG-class control IDs defined by V4L2 */
1052#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1057#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1363,6 +1368,8 @@ struct v4l2_modulator {
1363#define V4L2_TUNER_CAP_SAP 0x0020 1368#define V4L2_TUNER_CAP_SAP 0x0020
1364#define V4L2_TUNER_CAP_LANG1 0x0040 1369#define V4L2_TUNER_CAP_LANG1 0x0040
1365#define V4L2_TUNER_CAP_RDS 0x0080 1370#define V4L2_TUNER_CAP_RDS 0x0080
1371#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1372#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1366 1373
1367/* Flags for the 'rxsubchans' field */ 1374/* Flags for the 'rxsubchans' field */
1368#define V4L2_TUNER_SUB_MONO 0x0001 1375#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1392,7 +1399,8 @@ struct v4l2_hw_freq_seek {
1392 enum v4l2_tuner_type type; 1399 enum v4l2_tuner_type type;
1393 __u32 seek_upward; 1400 __u32 seek_upward;
1394 __u32 wrap_around; 1401 __u32 wrap_around;
1395 __u32 reserved[8]; 1402 __u32 spacing;
1403 __u32 reserved[7];
1396}; 1404};
1397 1405
1398/* 1406/*
diff --git a/include/linux/videotext.h b/include/linux/videotext.h
deleted file mode 100644
index 3e68c8d1c7f7..000000000000
--- a/include/linux/videotext.h
+++ /dev/null
@@ -1,125 +0,0 @@
1#ifndef _VTX_H
2#define _VTX_H
3
4/*
5 * Teletext (=Videotext) hardware decoders using interface /dev/vtx
6 * Do not confuse with drivers using /dev/vbi which decode videotext by software
7 *
8 * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>,
9 * unused tuner IOCTLs cleaned up by
10 * Michael Geng <linux@MichaelGeng.de>
11 *
12 * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de>
13 * Read COPYING for more information
14 *
15 */
16
17
18/*
19 * Videotext ioctls
20 */
21#define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t)
22#define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t)
23#define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t)
24#define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t)
25#define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t)
26#define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t)
27#define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t)
28#define VTXIOCPUTPAGE _IO (0x81, 8)
29#define VTXIOCSETDISP _IO (0x81, 9)
30#define VTXIOCPUTSTAT _IO (0x81, 10)
31#define VTXIOCCLRCACHE _IO (0x81, 11)
32#define VTXIOCSETVIRT _IOW (0x81, 12, long)
33
34/* for compatibility, will go away some day */
35#define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */
36#define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */
37#define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */
38#define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */
39#define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */
40#define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */
41#define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */
42#define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */
43#define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */
44#define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */
45#define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */
46#define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */
47
48/*
49 * Definitions for VTXIOCGETINFO
50 */
51
52#define SAA5243 0
53#define SAA5246 1
54#define SAA5249 2
55#define SAA5248 3
56#define XSTV5346 4
57
58typedef struct {
59 int version_major, version_minor; /* version of driver; if version_major changes, driver */
60 /* is not backward compatible!!! CHECK THIS!!! */
61 int numpages; /* number of page-buffers of vtx-chipset */
62 int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or
63 * SAA5249) */
64}
65vtx_info_t;
66
67
68/*
69 * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP}
70 */
71
72#define MIN_UNIT (1<<0)
73#define MIN_TEN (1<<1)
74#define HR_UNIT (1<<2)
75#define HR_TEN (1<<3)
76#define PG_UNIT (1<<4)
77#define PG_TEN (1<<5)
78#define PG_HUND (1<<6)
79#define PGMASK_MAX (1<<7)
80#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT)
81#define PGMASK_HOUR (HR_TEN | HR_UNIT)
82#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT)
83
84typedef struct
85{
86 int page; /* number of requested page (hexadecimal) */
87 int hour; /* requested hour (hexadecimal) */
88 int minute; /* requested minute (hexadecimal) */
89 int pagemask; /* mask defining which values of the above are set */
90 int pgbuf; /* buffer where page will be stored */
91 int start; /* start of requested part of page */
92 int end; /* end of requested part of page */
93 void __user *buffer; /* pointer to beginning of destination buffer */
94}
95vtx_pagereq_t;
96
97
98/*
99 * Definitions for VTXIOC{GETSTAT,PUTSTAT}
100 */
101
102#define VTX_PAGESIZE (40 * 24)
103#define VTX_VIRTUALSIZE (40 * 49)
104
105typedef struct
106{
107 int pagenum; /* number of page (hexadecimal) */
108 int hour; /* hour (hexadecimal) */
109 int minute; /* minute (hexadecimal) */
110 int charset; /* national charset */
111 unsigned delete : 1; /* delete page (C4) */
112 unsigned headline : 1; /* insert headline (C5) */
113 unsigned subtitle : 1; /* insert subtitle (C6) */
114 unsigned supp_header : 1; /* suppress header (C7) */
115 unsigned update : 1; /* update page (C8) */
116 unsigned inter_seq : 1; /* interrupted sequence (C9) */
117 unsigned dis_disp : 1; /* disable/suppress display (C10) */
118 unsigned serial : 1; /* serial mode (C11) */
119 unsigned notfound : 1; /* /FOUND */
120 unsigned pblf : 1; /* PBLF */
121 unsigned hamming : 1; /* hamming-error occurred */
122}
123vtx_pageinfo_t;
124
125#endif /* _VTX_H */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index d5c7aaadda59..0ead399e08b5 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -58,7 +58,9 @@ struct writeback_control {
58struct bdi_writeback; 58struct bdi_writeback;
59int inode_wait(void *); 59int inode_wait(void *);
60void writeback_inodes_sb(struct super_block *); 60void writeback_inodes_sb(struct super_block *);
61void writeback_inodes_sb_nr(struct super_block *, unsigned long nr);
61int writeback_inodes_sb_if_idle(struct super_block *); 62int writeback_inodes_sb_if_idle(struct super_block *);
63int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr);
62void sync_inodes_sb(struct super_block *); 64void sync_inodes_sb(struct super_block *);
63void writeback_inodes_wb(struct bdi_writeback *wb, 65void writeback_inodes_wb(struct bdi_writeback *wb,
64 struct writeback_control *wbc); 66 struct writeback_control *wbc);
@@ -141,6 +143,8 @@ typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
141 143
142int generic_writepages(struct address_space *mapping, 144int generic_writepages(struct address_space *mapping,
143 struct writeback_control *wbc); 145 struct writeback_control *wbc);
146void tag_pages_for_writeback(struct address_space *mapping,
147 pgoff_t start, pgoff_t end);
144int write_cache_pages(struct address_space *mapping, 148int write_cache_pages(struct address_space *mapping,
145 struct writeback_control *wbc, writepage_t writepage, 149 struct writeback_control *wbc, writepage_t writepage,
146 void *data); 150 void *data);
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index eb7fddf8f607..6dc37fae6606 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -60,6 +60,7 @@ enum rc_driver_type {
60 * @s_idle: optional: enable/disable hardware idle mode, upon which, 60 * @s_idle: optional: enable/disable hardware idle mode, upon which,
61 device doesn't interrupt host until it sees IR pulses 61 device doesn't interrupt host until it sees IR pulses
62 * @s_learning_mode: enable wide band receiver used for learning 62 * @s_learning_mode: enable wide band receiver used for learning
63 * @s_carrier_report: enable carrier reports
63 */ 64 */
64struct ir_dev_props { 65struct ir_dev_props {
65 enum rc_driver_type driver_type; 66 enum rc_driver_type driver_type;
@@ -82,8 +83,9 @@ struct ir_dev_props {
82 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); 83 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle);
83 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); 84 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max);
84 int (*tx_ir)(void *priv, int *txbuf, u32 n); 85 int (*tx_ir)(void *priv, int *txbuf, u32 n);
85 void (*s_idle)(void *priv, int enable); 86 void (*s_idle)(void *priv, bool enable);
86 int (*s_learning_mode)(void *priv, int enable); 87 int (*s_learning_mode)(void *priv, int enable);
88 int (*s_carrier_report) (void *priv, int enable);
87}; 89};
88 90
89struct ir_input_dev { 91struct ir_input_dev {
@@ -157,27 +159,54 @@ void ir_input_unregister(struct input_dev *input_dev);
157 159
158void ir_repeat(struct input_dev *dev); 160void ir_repeat(struct input_dev *dev);
159void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); 161void ir_keydown(struct input_dev *dev, int scancode, u8 toggle);
162void ir_keyup(struct ir_input_dev *ir);
160u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); 163u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
161 164
162/* From ir-raw-event.c */ 165/* From ir-raw-event.c */
163 166
164struct ir_raw_event { 167struct ir_raw_event {
165 unsigned pulse:1; 168 union {
166 unsigned duration:31; 169 u32 duration;
170
171 struct {
172 u32 carrier;
173 u8 duty_cycle;
174 };
175 };
176
177 unsigned pulse:1;
178 unsigned reset:1;
179 unsigned timeout:1;
180 unsigned carrier_report:1;
167}; 181};
168 182
169#define IR_MAX_DURATION 0x7FFFFFFF /* a bit more than 2 seconds */ 183#define DEFINE_IR_RAW_EVENT(event) \
184 struct ir_raw_event event = { \
185 { .duration = 0 } , \
186 .pulse = 0, \
187 .reset = 0, \
188 .timeout = 0, \
189 .carrier_report = 0 }
190
191static inline void init_ir_raw_event(struct ir_raw_event *ev)
192{
193 memset(ev, 0, sizeof(*ev));
194}
195
196#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */
170 197
171void ir_raw_event_handle(struct input_dev *input_dev); 198void ir_raw_event_handle(struct input_dev *input_dev);
172int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); 199int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev);
173int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); 200int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type);
174int ir_raw_event_store_with_filter(struct input_dev *input_dev, 201int ir_raw_event_store_with_filter(struct input_dev *input_dev,
175 struct ir_raw_event *ev); 202 struct ir_raw_event *ev);
176void ir_raw_event_set_idle(struct input_dev *input_dev, int idle); 203void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle);
177 204
178static inline void ir_raw_event_reset(struct input_dev *input_dev) 205static inline void ir_raw_event_reset(struct input_dev *input_dev)
179{ 206{
180 struct ir_raw_event ev = { .pulse = false, .duration = 0 }; 207 DEFINE_IR_RAW_EVENT(ev);
208 ev.reset = true;
209
181 ir_raw_event_store(input_dev, &ev); 210 ir_raw_event_store(input_dev, &ev);
182 ir_raw_event_handle(input_dev); 211 ir_raw_event_handle(input_dev);
183} 212}
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 5e96d7a430be..557c676ab7dc 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -3,6 +3,8 @@
3 3
4#include <media/ir-common.h> 4#include <media/ir-common.h>
5 5
6#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7
6struct IR_i2c; 8struct IR_i2c;
7 9
8struct IR_i2c { 10struct IR_i2c {
@@ -15,6 +17,8 @@ struct IR_i2c {
15 /* Used to avoid fast repeating */ 17 /* Used to avoid fast repeating */
16 unsigned char old; 18 unsigned char old;
17 19
20 u32 polling_interval; /* in ms */
21
18 struct delayed_work work; 22 struct delayed_work work;
19 char name[32]; 23 char name[32];
20 char phys[32]; 24 char phys[32];
@@ -24,7 +28,6 @@ struct IR_i2c {
24enum ir_kbd_get_key_fn { 28enum ir_kbd_get_key_fn {
25 IR_KBD_GET_KEY_CUSTOM = 0, 29 IR_KBD_GET_KEY_CUSTOM = 0,
26 IR_KBD_GET_KEY_PIXELVIEW, 30 IR_KBD_GET_KEY_PIXELVIEW,
27 IR_KBD_GET_KEY_PV951,
28 IR_KBD_GET_KEY_HAUP, 31 IR_KBD_GET_KEY_HAUP,
29 IR_KBD_GET_KEY_KNC1, 32 IR_KBD_GET_KEY_KNC1,
30 IR_KBD_GET_KEY_FUSIONHDTV, 33 IR_KBD_GET_KEY_FUSIONHDTV,
@@ -35,8 +38,9 @@ enum ir_kbd_get_key_fn {
35/* Can be passed when instantiating an ir_video i2c device */ 38/* Can be passed when instantiating an ir_video i2c device */
36struct IR_i2c_init_data { 39struct IR_i2c_init_data {
37 char *ir_codes; 40 char *ir_codes;
38 const char *name; 41 const char *name;
39 u64 type; /* IR_TYPE_RC5, etc */ 42 u64 type; /* IR_TYPE_RC5, etc */
43 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
40 /* 44 /*
41 * Specify either a function pointer or a value indicating one of 45 * Specify either a function pointer or a value indicating one of
42 * ir_kbd_i2c's internal get_key functions 46 * ir_kbd_i2c's internal get_key functions
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index b1f60663cb39..54780a560d0e 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -125,10 +125,10 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
125struct lirc_driver { 125struct lirc_driver {
126 char name[40]; 126 char name[40];
127 int minor; 127 int minor;
128 unsigned long code_length; 128 __u32 code_length;
129 unsigned int buffer_size; /* in chunks holding one code each */ 129 unsigned int buffer_size; /* in chunks holding one code each */
130 int sample_rate; 130 int sample_rate;
131 unsigned long features; 131 __u32 features;
132 132
133 unsigned int chunk_size; 133 unsigned int chunk_size;
134 134
@@ -139,7 +139,7 @@ struct lirc_driver {
139 struct lirc_buffer *rbuf; 139 struct lirc_buffer *rbuf;
140 int (*set_use_inc) (void *data); 140 int (*set_use_inc) (void *data);
141 void (*set_use_dec) (void *data); 141 void (*set_use_dec) (void *data);
142 struct file_operations *fops; 142 const struct file_operations *fops;
143 struct device *dev; 143 struct device *dev;
144 struct module *owner; 144 struct module *owner;
145}; 145};
diff --git a/include/media/omap1_camera.h b/include/media/omap1_camera.h
new file mode 100644
index 000000000000..819767cf04d4
--- /dev/null
+++ b/include/media/omap1_camera.h
@@ -0,0 +1,35 @@
1/*
2 * Header for V4L2 SoC Camera driver for OMAP1 Camera Interface
3 *
4 * Copyright (C) 2010, Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MEDIA_OMAP1_CAMERA_H_
12#define __MEDIA_OMAP1_CAMERA_H_
13
14#include <linux/bitops.h>
15
16#define OMAP1_CAMERA_IOSIZE 0x1c
17
18enum omap1_cam_vb_mode {
19 OMAP1_CAM_DMA_CONTIG = 0,
20 OMAP1_CAM_DMA_SG,
21};
22
23#define OMAP1_CAMERA_MIN_BUF_COUNT(x) ((x) == OMAP1_CAM_DMA_CONTIG ? 3 : 2)
24
25struct omap1_cam_platform_data {
26 unsigned long camexclk_khz;
27 unsigned long lclk_khz_max;
28 unsigned long flags;
29};
30
31#define OMAP1_CAMERA_LCLK_RISING BIT(0)
32#define OMAP1_CAMERA_RST_LOW BIT(1)
33#define OMAP1_CAMERA_RST_HIGH BIT(2)
34
35#endif /* __MEDIA_OMAP1_CAMERA_H_ */
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 9b201ec8dc7f..e0f17edf38ed 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -17,12 +17,13 @@
17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ 17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */
19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
20#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 21#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
21#define IR_TYPE_OTHER (1u << 31) 22#define IR_TYPE_OTHER (1u << 31)
22 23
23#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ 24#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \
24 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ 25 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \
25 IR_TYPE_OTHER) 26 IR_TYPE_RC5_SZ | IR_TYPE_OTHER)
26 27
27struct ir_scancode { 28struct ir_scancode {
28 u32 scancode; 29 u32 scancode;
@@ -54,6 +55,8 @@ void rc_map_init(void);
54/* Names of the several keytables defined in-kernel */ 55/* Names of the several keytables defined in-kernel */
55 56
56#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" 57#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci"
58#define RC_MAP_ALINK_DTU_M "rc-alink-dtu-m"
59#define RC_MAP_ANYSEE "rc-anysee"
57#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" 60#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
58#define RC_MAP_ASUS_PC39 "rc-asus-pc39" 61#define RC_MAP_ASUS_PC39 "rc-asus-pc39"
59#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" 62#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600"
@@ -62,8 +65,10 @@ void rc_map_init(void);
62#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 65#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
63#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a" 66#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a"
64#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6" 67#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6"
68#define RC_MAP_AVERMEDIA_RM_KS "rc-avermedia-rm-ks"
65#define RC_MAP_AVERMEDIA "rc-avermedia" 69#define RC_MAP_AVERMEDIA "rc-avermedia"
66#define RC_MAP_AVERTV_303 "rc-avertv-303" 70#define RC_MAP_AVERTV_303 "rc-avertv-303"
71#define RC_MAP_AZUREWAVE_AD_TU700 "rc-azurewave-ad-tu700"
67#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" 72#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
68#define RC_MAP_BEHOLD "rc-behold" 73#define RC_MAP_BEHOLD "rc-behold"
69#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" 74#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
@@ -71,6 +76,8 @@ void rc_map_init(void);
71#define RC_MAP_CINERGY "rc-cinergy" 76#define RC_MAP_CINERGY "rc-cinergy"
72#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" 77#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec"
73#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" 78#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5"
79#define RC_MAP_DIGITALNOW_TINYTWIN "rc-digitalnow-tinytwin"
80#define RC_MAP_DIGITTRADE "rc-digittrade"
74#define RC_MAP_DM1105_NEC "rc-dm1105-nec" 81#define RC_MAP_DM1105_NEC "rc-dm1105-nec"
75#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" 82#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro"
76#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" 83#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t"
@@ -94,8 +101,12 @@ void rc_map_init(void);
94#define RC_MAP_KAIOMY "rc-kaiomy" 101#define RC_MAP_KAIOMY "rc-kaiomy"
95#define RC_MAP_KWORLD_315U "rc-kworld-315u" 102#define RC_MAP_KWORLD_315U "rc-kworld-315u"
96#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" 103#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"
104#define RC_MAP_LEADTEK_Y04G0051 "rc-leadtek-y04g0051"
97#define RC_MAP_LIRC "rc-lirc" 105#define RC_MAP_LIRC "rc-lirc"
106#define RC_MAP_LME2510 "rc-lme2510"
98#define RC_MAP_MANLI "rc-manli" 107#define RC_MAP_MANLI "rc-manli"
108#define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii"
109#define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii"
99#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" 110#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
100#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" 111#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere"
101#define RC_MAP_NEBULA "rc-nebula" 112#define RC_MAP_NEBULA "rc-nebula"
@@ -114,14 +125,18 @@ void rc_map_init(void);
114#define RC_MAP_PURPLETV "rc-purpletv" 125#define RC_MAP_PURPLETV "rc-purpletv"
115#define RC_MAP_PV951 "rc-pv951" 126#define RC_MAP_PV951 "rc-pv951"
116#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" 127#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new"
117#define RC_MAP_RC5_STREAMZAP "rc-rc5-streamzap"
118#define RC_MAP_RC5_TV "rc-rc5-tv" 128#define RC_MAP_RC5_TV "rc-rc5-tv"
119#define RC_MAP_RC6_MCE "rc-rc6-mce" 129#define RC_MAP_RC6_MCE "rc-rc6-mce"
120#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" 130#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
131#define RC_MAP_STREAMZAP "rc-streamzap"
121#define RC_MAP_TBS_NEC "rc-tbs-nec" 132#define RC_MAP_TBS_NEC "rc-tbs-nec"
122#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" 133#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs"
134#define RC_MAP_TERRATEC_SLIM "rc-terratec-slim"
123#define RC_MAP_TEVII_NEC "rc-tevii-nec" 135#define RC_MAP_TEVII_NEC "rc-tevii-nec"
136#define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand"
137#define RC_MAP_TREKSTOR "rc-trekstor"
124#define RC_MAP_TT_1500 "rc-tt-1500" 138#define RC_MAP_TT_1500 "rc-tt-1500"
139#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027"
125#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 140#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
126#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 141#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
127#define RC_MAP_WINFAST "rc-winfast" 142#define RC_MAP_WINFAST "rc-winfast"
diff --git a/include/media/s3c_fimc.h b/include/media/s3c_fimc.h
new file mode 100644
index 000000000000..ca1b6738e4a4
--- /dev/null
+++ b/include/media/s3c_fimc.h
@@ -0,0 +1,60 @@
1/*
2 * Samsung S5P SoC camera interface driver header
3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd
5 * Author: Sylwester Nawrocki, <s.nawrocki@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef S3C_FIMC_H_
13#define S3C_FIMC_H_
14
15enum cam_bus_type {
16 FIMC_ITU_601 = 1,
17 FIMC_ITU_656,
18 FIMC_MIPI_CSI2,
19 FIMC_LCD_WB, /* FIFO link from LCD mixer */
20};
21
22#define FIMC_CLK_INV_PCLK (1 << 0)
23#define FIMC_CLK_INV_VSYNC (1 << 1)
24#define FIMC_CLK_INV_HREF (1 << 2)
25#define FIMC_CLK_INV_HSYNC (1 << 3)
26
27struct i2c_board_info;
28
29/**
30 * struct s3c_fimc_isp_info - image sensor information required for host
31 * interace configuration.
32 *
33 * @board_info: pointer to I2C subdevice's board info
34 * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
35 * @i2c_bus_num: i2c control bus id the sensor is attached to
36 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
37 * @bus_width: camera data bus width in bits
38 * @flags: flags defining bus signals polarity inversion (High by default)
39 */
40struct s3c_fimc_isp_info {
41 struct i2c_board_info *board_info;
42 enum cam_bus_type bus_type;
43 u16 i2c_bus_num;
44 u16 mux_id;
45 u16 bus_width;
46 u16 flags;
47};
48
49
50#define FIMC_MAX_CAMIF_CLIENTS 2
51
52/**
53 * struct s3c_platform_fimc - camera host interface platform data
54 *
55 * @isp_info: properties of camera sensor required for host interface setup
56 */
57struct s3c_platform_fimc {
58 struct s3c_fimc_isp_info *isp_info[FIMC_MAX_CAMIF_CLIENTS];
59};
60#endif /* S3C_FIMC_H_ */
diff --git a/include/media/sh_vou.h b/include/media/sh_vou.h
index a3ef30242b00..ec3ba9a597a2 100644
--- a/include/media/sh_vou.h
+++ b/include/media/sh_vou.h
@@ -28,7 +28,6 @@ struct sh_vou_pdata {
28 int i2c_adap; 28 int i2c_adap;
29 struct i2c_board_info *board_info; 29 struct i2c_board_info *board_info;
30 unsigned long flags; 30 unsigned long flags;
31 char *module_name;
32}; 31};
33 32
34#endif 33#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 2ce957301f77..86e3631764ef 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -21,6 +21,8 @@
21 21
22extern struct bus_type soc_camera_bus_type; 22extern struct bus_type soc_camera_bus_type;
23 23
24struct file;
25
24struct soc_camera_device { 26struct soc_camera_device {
25 struct list_head list; 27 struct list_head list;
26 struct device dev; 28 struct device dev;
@@ -41,10 +43,7 @@ struct soc_camera_device {
41 /* soc_camera.c private count. Only accessed with .video_lock held */ 43 /* soc_camera.c private count. Only accessed with .video_lock held */
42 int use_count; 44 int use_count;
43 struct mutex video_lock; /* Protects device data */ 45 struct mutex video_lock; /* Protects device data */
44}; 46 struct file *streamer; /* stream owner */
45
46struct soc_camera_file {
47 struct soc_camera_device *icd;
48 struct videobuf_queue vb_vidq; 47 struct videobuf_queue vb_vidq;
49}; 48};
50 49
@@ -79,7 +78,7 @@ struct soc_camera_host_ops {
79 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); 78 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
80 void (*init_videobuf)(struct videobuf_queue *, 79 void (*init_videobuf)(struct videobuf_queue *,
81 struct soc_camera_device *); 80 struct soc_camera_device *);
82 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *); 81 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
83 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 82 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
84 int (*set_bus_param)(struct soc_camera_device *, __u32); 83 int (*set_bus_param)(struct soc_camera_device *, __u32);
85 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); 84 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
diff --git a/include/media/sr030pc30.h b/include/media/sr030pc30.h
new file mode 100644
index 000000000000..6f901a653ba2
--- /dev/null
+++ b/include/media/sr030pc30.h
@@ -0,0 +1,21 @@
1/*
2 * Driver header for SR030PC30 camera sensor
3 *
4 * Copyright (c) 2010 Samsung Electronics, Co. Ltd
5 * Contact: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef SR030PC30_H
14#define SR030PC30_H
15
16struct sr030pc30_platform_data {
17 unsigned long clk_rate; /* master clock frequency in Hz */
18 int (*set_power)(struct device *dev, int on);
19};
20
21#endif /* SR030PC30_H */
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 21b4428c12ab..51e89f2267b8 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -38,6 +38,9 @@ enum {
38 /* module tvaudio: reserved range 50-99 */ 38 /* module tvaudio: reserved range 50-99 */
39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */ 39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */
40 40
41 /* Sony IMX074 */
42 V4L2_IDENT_IMX074 = 74,
43
41 /* module saa7110: just ident 100 */ 44 /* module saa7110: just ident 100 */
42 V4L2_IDENT_SAA7110 = 100, 45 V4L2_IDENT_SAA7110 = 100,
43 46
@@ -70,6 +73,7 @@ enum {
70 V4L2_IDENT_OV9655 = 255, 73 V4L2_IDENT_OV9655 = 255,
71 V4L2_IDENT_SOI968 = 256, 74 V4L2_IDENT_SOI968 = 256,
72 V4L2_IDENT_OV9640 = 257, 75 V4L2_IDENT_OV9640 = 257,
76 V4L2_IDENT_OV6650 = 258,
73 77
74 /* module saa7146: reserved range 300-309 */ 78 /* module saa7146: reserved range 300-309 */
75 V4L2_IDENT_SAA7146 = 300, 79 V4L2_IDENT_SAA7146 = 300,
@@ -111,6 +115,10 @@ enum {
111 V4L2_IDENT_VPX3216B = 3216, 115 V4L2_IDENT_VPX3216B = 3216,
112 V4L2_IDENT_VPX3220A = 3220, 116 V4L2_IDENT_VPX3220A = 3220,
113 117
118 /* VX855 just ident 3409 */
119 /* Other via devs could use 3314, 3324, 3327, 3336, 3364, 3353 */
120 V4L2_IDENT_VIA_VX855 = 3409,
121
114 /* module tvp5150 */ 122 /* module tvp5150 */
115 V4L2_IDENT_TVP5150 = 5150, 123 V4L2_IDENT_TVP5150 = 5150,
116 124
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 98b32645e5a7..41dd480e45f1 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -232,4 +232,14 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
232 unsigned int hmax, unsigned int halign, 232 unsigned int hmax, unsigned int halign,
233 unsigned int salign); 233 unsigned int salign);
234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); 234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
235
236struct v4l2_discrete_probe {
237 const struct v4l2_frmsize_discrete *sizes;
238 int num_sizes;
239};
240
241const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
242 const struct v4l2_discrete_probe *probe,
243 s32 width, s32 height);
244
235#endif /* V4L2_COMMON_H_ */ 245#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 1efcacbed01a..15802a067a12 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -21,8 +21,7 @@
21#define VFL_TYPE_GRABBER 0 21#define VFL_TYPE_GRABBER 0
22#define VFL_TYPE_VBI 1 22#define VFL_TYPE_VBI 1
23#define VFL_TYPE_RADIO 2 23#define VFL_TYPE_RADIO 2
24#define VFL_TYPE_VTX 3 24#define VFL_TYPE_MAX 3
25#define VFL_TYPE_MAX 4
26 25
27struct v4l2_ioctl_callbacks; 26struct v4l2_ioctl_callbacks;
28struct video_device; 27struct video_device;
@@ -42,8 +41,6 @@ struct v4l2_file_operations {
42 unsigned int (*poll) (struct file *, struct poll_table_struct *); 41 unsigned int (*poll) (struct file *, struct poll_table_struct *);
43 long (*ioctl) (struct file *, unsigned int, unsigned long); 42 long (*ioctl) (struct file *, unsigned int, unsigned long);
44 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 43 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
45 unsigned long (*get_unmapped_area) (struct file *, unsigned long,
46 unsigned long, unsigned long, unsigned long);
47 int (*mmap) (struct file *, struct vm_area_struct *); 44 int (*mmap) (struct file *, struct vm_area_struct *);
48 int (*open) (struct file *); 45 int (*open) (struct file *);
49 int (*release) (struct file *); 46 int (*release) (struct file *);
@@ -97,6 +94,9 @@ struct video_device
97 94
98 /* ioctl callbacks */ 95 /* ioctl callbacks */
99 const struct v4l2_ioctl_ops *ioctl_ops; 96 const struct v4l2_ioctl_ops *ioctl_ops;
97
98 /* serialization lock */
99 struct mutex *lock;
100}; 100};
101 101
102/* dev to video-device */ 102/* dev to video-device */
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 8bcbd7a0271c..6648036b728d 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -101,46 +101,67 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
101/* Call the specified callback for all subdevs matching the condition. 101/* Call the specified callback for all subdevs matching the condition.
102 Ignore any errors. Note that you cannot add or delete a subdev 102 Ignore any errors. Note that you cannot add or delete a subdev
103 while walking the subdevs list. */ 103 while walking the subdevs list. */
104#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \ 104#define __v4l2_device_call_subdevs_p(v4l2_dev, sd, cond, o, f, args...) \
105 do { \ 105 do { \
106 struct v4l2_subdev *sd; \ 106 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
107 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
108 (sd)->ops->o->f((sd) , ##args); \
109 } while (0)
110
111#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \
112 do { \
113 struct v4l2_subdev *__sd; \
107 \ 114 \
108 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) \ 115 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, cond, o, \
109 if ((cond) && sd->ops->o && sd->ops->o->f) \ 116 f , ##args); \
110 sd->ops->o->f(sd , ##args); \
111 } while (0) 117 } while (0)
112 118
113/* Call the specified callback for all subdevs matching the condition. 119/* Call the specified callback for all subdevs matching the condition.
114 If the callback returns an error other than 0 or -ENOIOCTLCMD, then 120 If the callback returns an error other than 0 or -ENOIOCTLCMD, then
115 return with that error code. Note that you cannot add or delete a 121 return with that error code. Note that you cannot add or delete a
116 subdev while walking the subdevs list. */ 122 subdev while walking the subdevs list. */
117#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \ 123#define __v4l2_device_call_subdevs_until_err_p(v4l2_dev, sd, cond, o, f, args...) \
118({ \ 124({ \
119 struct v4l2_subdev *sd; \ 125 long __err = 0; \
120 long err = 0; \
121 \ 126 \
122 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) { \ 127 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
123 if ((cond) && sd->ops->o && sd->ops->o->f) \ 128 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
124 err = sd->ops->o->f(sd , ##args); \ 129 __err = (sd)->ops->o->f((sd) , ##args); \
125 if (err && err != -ENOIOCTLCMD) \ 130 if (__err && __err != -ENOIOCTLCMD) \
126 break; \ 131 break; \
127 } \ 132 } \
128 (err == -ENOIOCTLCMD) ? 0 : err; \ 133 (__err == -ENOIOCTLCMD) ? 0 : __err; \
134})
135
136#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \
137({ \
138 struct v4l2_subdev *__sd; \
139 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \
140 f, args...); \
129}) 141})
130 142
131/* Call the specified callback for all subdevs matching grp_id (if 0, then 143/* Call the specified callback for all subdevs matching grp_id (if 0, then
132 match them all). Ignore any errors. Note that you cannot add or delete 144 match them all). Ignore any errors. Note that you cannot add or delete
133 a subdev while walking the subdevs list. */ 145 a subdev while walking the subdevs list. */
134#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \ 146#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \
135 __v4l2_device_call_subdevs(v4l2_dev, \ 147 do { \
136 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 148 struct v4l2_subdev *__sd; \
149 \
150 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, \
151 !(grpid) || __sd->grp_id == (grpid), o, f , \
152 ##args); \
153 } while (0)
137 154
138/* Call the specified callback for all subdevs matching grp_id (if 0, then 155/* Call the specified callback for all subdevs matching grp_id (if 0, then
139 match them all). If the callback returns an error other than 0 or 156 match them all). If the callback returns an error other than 0 or
140 -ENOIOCTLCMD, then return with that error code. Note that you cannot 157 -ENOIOCTLCMD, then return with that error code. Note that you cannot
141 add or delete a subdev while walking the subdevs list. */ 158 add or delete a subdev while walking the subdevs list. */
142#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \ 159#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \
143 __v4l2_device_call_subdevs_until_err(v4l2_dev, \ 160({ \
144 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 161 struct v4l2_subdev *__sd; \
162 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, \
163 !(grpid) || __sd->grp_id == (grpid), o, f , \
164 ##args); \
165})
145 166
146#endif 167#endif
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
deleted file mode 100644
index 74bf741d1a9b..000000000000
--- a/include/media/v4l2-i2c-drv.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * v4l2-i2c-drv.h - contains I2C handling code that's identical for
3 * all V4L2 I2C drivers. Use this header if the
4 * I2C driver is only used by drivers converted
5 * to the bus-based I2C API.
6 *
7 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels.
26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd.
29 *
30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver.
33 *
34 * If the i2c driver will never be compiled for pre-2.6.26 kernels, then
35 * DO NOT USE this header! Just write it as a regular i2c driver.
36 */
37
38#ifndef __V4L2_I2C_DRV_H__
39#define __V4L2_I2C_DRV_H__
40
41#include <media/v4l2-common.h>
42
43struct v4l2_i2c_driver_data {
44 const char * const name;
45 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
46 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
47 int (*remove)(struct i2c_client *client);
48 int (*suspend)(struct i2c_client *client, pm_message_t state);
49 int (*resume)(struct i2c_client *client);
50 const struct i2c_device_id *id_table;
51};
52
53static struct v4l2_i2c_driver_data v4l2_i2c_data;
54static struct i2c_driver v4l2_i2c_driver;
55
56
57/* Bus-based I2C implementation for kernels >= 2.6.26 */
58
59static int __init v4l2_i2c_drv_init(void)
60{
61 v4l2_i2c_driver.driver.name = v4l2_i2c_data.name;
62 v4l2_i2c_driver.command = v4l2_i2c_data.command;
63 v4l2_i2c_driver.probe = v4l2_i2c_data.probe;
64 v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
65 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
66 v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
67 v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
68 return i2c_add_driver(&v4l2_i2c_driver);
69}
70
71
72static void __exit v4l2_i2c_drv_cleanup(void)
73{
74 i2c_del_driver(&v4l2_i2c_driver);
75}
76
77module_init(v4l2_i2c_drv_init);
78module_exit(v4l2_i2c_drv_cleanup);
79
80#endif /* __V4L2_I2C_DRV_H__ */
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index f0cf2e7def06..8e6559838ae3 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -28,10 +28,18 @@ enum v4l2_mbus_pixelcode {
28 V4L2_MBUS_FMT_YVYU8_2X8, 28 V4L2_MBUS_FMT_YVYU8_2X8,
29 V4L2_MBUS_FMT_UYVY8_2X8, 29 V4L2_MBUS_FMT_UYVY8_2X8,
30 V4L2_MBUS_FMT_VYUY8_2X8, 30 V4L2_MBUS_FMT_VYUY8_2X8,
31 V4L2_MBUS_FMT_YVYU10_2X10,
32 V4L2_MBUS_FMT_YUYV10_2X10,
33 V4L2_MBUS_FMT_YVYU10_1X20,
34 V4L2_MBUS_FMT_YUYV10_1X20,
35 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
36 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
31 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, 37 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
32 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, 38 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
33 V4L2_MBUS_FMT_RGB565_2X8_LE, 39 V4L2_MBUS_FMT_RGB565_2X8_LE,
34 V4L2_MBUS_FMT_RGB565_2X8_BE, 40 V4L2_MBUS_FMT_RGB565_2X8_BE,
41 V4L2_MBUS_FMT_BGR565_2X8_LE,
42 V4L2_MBUS_FMT_BGR565_2X8_BE,
35 V4L2_MBUS_FMT_SBGGR8_1X8, 43 V4L2_MBUS_FMT_SBGGR8_1X8,
36 V4L2_MBUS_FMT_SBGGR10_1X10, 44 V4L2_MBUS_FMT_SBGGR10_1X10,
37 V4L2_MBUS_FMT_GREY8_1X8, 45 V4L2_MBUS_FMT_GREY8_1X8,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 4a97d7341a94..b0316a7cf08d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -256,10 +256,6 @@ struct v4l2_subdev_video_ops {
256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); 256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
258 int (*s_stream)(struct v4l2_subdev *sd, int enable); 258 int (*s_stream)(struct v4l2_subdev *sd, int enable);
259 int (*enum_fmt)(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmtdesc);
260 int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
261 int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
262 int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
263 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 259 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
264 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 260 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
265 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 261 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
@@ -442,17 +438,28 @@ struct v4l2_subdev {
442 /* can be used to group similar subdevs, value is driver-specific */ 438 /* can be used to group similar subdevs, value is driver-specific */
443 u32 grp_id; 439 u32 grp_id;
444 /* pointer to private data */ 440 /* pointer to private data */
445 void *priv; 441 void *dev_priv;
442 void *host_priv;
446}; 443};
447 444
448static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 445static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
449{ 446{
450 sd->priv = p; 447 sd->dev_priv = p;
451} 448}
452 449
453static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) 450static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
454{ 451{
455 return sd->priv; 452 return sd->dev_priv;
453}
454
455static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
456{
457 sd->host_priv = p;
458}
459
460static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
461{
462 return sd->host_priv;
456} 463}
457 464
458static inline void v4l2_subdev_init(struct v4l2_subdev *sd, 465static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
@@ -466,7 +473,8 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
466 sd->flags = 0; 473 sd->flags = 0;
467 sd->name[0] = '\0'; 474 sd->name[0] = '\0';
468 sd->grp_id = 0; 475 sd->grp_id = 0;
469 sd->priv = NULL; 476 sd->dev_priv = NULL;
477 sd->host_priv = NULL;
470} 478}
471 479
472/* Call an ops of a v4l2_subdev, doing the right checks against 480/* Call an ops of a v4l2_subdev, doing the right checks against
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index f2c41cebf453..1d3835fc26be 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -139,6 +139,7 @@ struct videobuf_qtype_ops {
139 139
140struct videobuf_queue { 140struct videobuf_queue {
141 struct mutex vb_lock; 141 struct mutex vb_lock;
142 struct mutex *ext_lock;
142 spinlock_t *irqlock; 143 spinlock_t *irqlock;
143 struct device *dev; 144 struct device *dev;
144 145
@@ -167,7 +168,20 @@ struct videobuf_queue {
167 void *priv_data; 168 void *priv_data;
168}; 169};
169 170
170int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); 171static inline void videobuf_queue_lock(struct videobuf_queue *q)
172{
173 if (!q->ext_lock)
174 mutex_lock(&q->vb_lock);
175}
176
177static inline void videobuf_queue_unlock(struct videobuf_queue *q)
178{
179 if (!q->ext_lock)
180 mutex_unlock(&q->vb_lock);
181}
182
183int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
184 int non_blocking, int intr);
171int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, 185int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
172 struct v4l2_framebuffer *fbuf); 186 struct v4l2_framebuffer *fbuf);
173 187
@@ -185,7 +199,8 @@ void videobuf_queue_core_init(struct videobuf_queue *q,
185 enum v4l2_field field, 199 enum v4l2_field field,
186 unsigned int msize, 200 unsigned int msize,
187 void *priv, 201 void *priv,
188 struct videobuf_qtype_ops *int_ops); 202 struct videobuf_qtype_ops *int_ops,
203 struct mutex *ext_lock);
189int videobuf_queue_is_busy(struct videobuf_queue *q); 204int videobuf_queue_is_busy(struct videobuf_queue *q);
190void videobuf_queue_cancel(struct videobuf_queue *q); 205void videobuf_queue_cancel(struct videobuf_queue *q);
191 206
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h
index ebaa9bc1ee8d..f0ed82543d9f 100644
--- a/include/media/videobuf-dma-contig.h
+++ b/include/media/videobuf-dma-contig.h
@@ -23,7 +23,8 @@ void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
23 enum v4l2_buf_type type, 23 enum v4l2_buf_type type,
24 enum v4l2_field field, 24 enum v4l2_field field,
25 unsigned int msize, 25 unsigned int msize,
26 void *priv); 26 void *priv,
27 struct mutex *ext_lock);
27 28
28dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); 29dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
29void videobuf_dma_contig_free(struct videobuf_queue *q, 30void videobuf_dma_contig_free(struct videobuf_queue *q,
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index aa4ebb42a565..1c647e8148c4 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -103,7 +103,8 @@ void videobuf_queue_sg_init(struct videobuf_queue *q,
103 enum v4l2_buf_type type, 103 enum v4l2_buf_type type,
104 enum v4l2_field field, 104 enum v4l2_field field,
105 unsigned int msize, 105 unsigned int msize,
106 void *priv); 106 void *priv,
107 struct mutex *ext_lock);
107 108
108#endif /* _VIDEOBUF_DMA_SG_H */ 109#endif /* _VIDEOBUF_DMA_SG_H */
109 110
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index e19403c18dae..486a97efdb56 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -36,7 +36,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
36 enum v4l2_buf_type type, 36 enum v4l2_buf_type type,
37 enum v4l2_field field, 37 enum v4l2_field field,
38 unsigned int msize, 38 unsigned int msize,
39 void *priv); 39 void *priv,
40 struct mutex *ext_lock);
40 41
41void *videobuf_to_vmalloc(struct videobuf_buffer *buf); 42void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
42 43
diff --git a/include/media/wm8775.h b/include/media/wm8775.h
index 60739c5a23ae..a1c4d417dfa2 100644
--- a/include/media/wm8775.h
+++ b/include/media/wm8775.h
@@ -32,4 +32,7 @@
32#define WM8775_AIN3 4 32#define WM8775_AIN3 4
33#define WM8775_AIN4 8 33#define WM8775_AIN4 8
34 34
35/* subdev group ID */
36#define WM8775_GID (1 << 0)
37
35#endif 38#endif
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 4debb4514634..2f7d45bcbd24 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -52,6 +52,7 @@ struct mtd_oob_buf64 {
52#define MTD_NANDFLASH 4 52#define MTD_NANDFLASH 4
53#define MTD_DATAFLASH 6 53#define MTD_DATAFLASH 6
54#define MTD_UBIVOLUME 7 54#define MTD_UBIVOLUME 7
55#define MTD_MLCNANDFLASH 8
55 56
56#define MTD_WRITEABLE 0x400 /* Device is writeable */ 57#define MTD_WRITEABLE 0x400 /* Device is writeable */
57#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ 58#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
@@ -119,7 +120,7 @@ struct otp_info {
119#define OTPGETREGIONCOUNT _IOW('M', 14, int) 120#define OTPGETREGIONCOUNT _IOW('M', 14, int)
120#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 121#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
121#define OTPLOCK _IOR('M', 16, struct otp_info) 122#define OTPLOCK _IOR('M', 16, struct otp_info)
122#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) 123#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
123#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 124#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
124#define MTDFILEMODE _IO('M', 19) 125#define MTDFILEMODE _IO('M', 19)
125#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) 126#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
@@ -144,13 +145,18 @@ struct nand_oobfree {
144}; 145};
145 146
146#define MTD_MAX_OOBFREE_ENTRIES 8 147#define MTD_MAX_OOBFREE_ENTRIES 8
148#define MTD_MAX_ECCPOS_ENTRIES 64
147/* 149/*
148 * ECC layout control structure. Exported to userspace for 150 * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl
149 * diagnosis and to allow creation of raw images 151 * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a
152 * complete set of ECC information. The ioctl truncates the larger internal
153 * structure to retain binary compatibility with the static declaration of the
154 * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of
155 * the user struct, not the MAX size of the internal struct nand_ecclayout.
150 */ 156 */
151struct nand_ecclayout { 157struct nand_ecclayout_user {
152 __u32 eccbytes; 158 __u32 eccbytes;
153 __u32 eccpos[64]; 159 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
154 __u32 oobavail; 160 __u32 oobavail;
155 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; 161 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
156}; 162};
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h
index aa3c2f86a913..83327c808c86 100644
--- a/include/mtd/mtd-user.h
+++ b/include/mtd/mtd-user.h
@@ -29,6 +29,6 @@ typedef struct mtd_info_user mtd_info_t;
29typedef struct erase_info_user erase_info_t; 29typedef struct erase_info_user erase_info_t;
30typedef struct region_info_user region_info_t; 30typedef struct region_info_user region_info_t;
31typedef struct nand_oobinfo nand_oobinfo_t; 31typedef struct nand_oobinfo nand_oobinfo_t;
32typedef struct nand_ecclayout nand_ecclayout_t; 32typedef struct nand_ecclayout_user nand_ecclayout_t;
33 33
34#endif /* __MTD_USER_H__ */ 34#endif /* __MTD_USER_H__ */
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index a8de812ccbc8..071fd7a8d781 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -86,6 +86,8 @@ do { \
86 86
87/** 87/**
88 * enum p9_msg_t - 9P message types 88 * enum p9_msg_t - 9P message types
89 * @P9_TLERROR: not used
90 * @P9_RLERROR: response for any failed request for 9P2000.L
89 * @P9_TSTATFS: file system status request 91 * @P9_TSTATFS: file system status request
90 * @P9_RSTATFS: file system status response 92 * @P9_RSTATFS: file system status response
91 * @P9_TSYMLINK: make symlink request 93 * @P9_TSYMLINK: make symlink request
@@ -137,6 +139,8 @@ do { \
137 */ 139 */
138 140
139enum p9_msg_t { 141enum p9_msg_t {
142 P9_TLERROR = 6,
143 P9_RLERROR,
140 P9_TSTATFS = 8, 144 P9_TSTATFS = 8,
141 P9_RSTATFS, 145 P9_RSTATFS,
142 P9_TLOPEN = 12, 146 P9_TLOPEN = 12,
@@ -149,6 +153,8 @@ enum p9_msg_t {
149 P9_RMKNOD, 153 P9_RMKNOD,
150 P9_TRENAME = 20, 154 P9_TRENAME = 20,
151 P9_RRENAME, 155 P9_RRENAME,
156 P9_TREADLINK = 22,
157 P9_RREADLINK,
152 P9_TGETATTR = 24, 158 P9_TGETATTR = 24,
153 P9_RGETATTR, 159 P9_RGETATTR,
154 P9_TSETATTR = 26, 160 P9_TSETATTR = 26,
@@ -159,6 +165,12 @@ enum p9_msg_t {
159 P9_RXATTRCREATE, 165 P9_RXATTRCREATE,
160 P9_TREADDIR = 40, 166 P9_TREADDIR = 40,
161 P9_RREADDIR, 167 P9_RREADDIR,
168 P9_TFSYNC = 50,
169 P9_RFSYNC,
170 P9_TLOCK = 52,
171 P9_RLOCK,
172 P9_TGETLOCK = 54,
173 P9_RGETLOCK,
162 P9_TLINK = 70, 174 P9_TLINK = 70,
163 P9_RLINK, 175 P9_RLINK,
164 P9_TMKDIR = 72, 176 P9_TMKDIR = 72,
@@ -458,6 +470,48 @@ struct p9_iattr_dotl {
458 u64 mtime_nsec; 470 u64 mtime_nsec;
459}; 471};
460 472
473#define P9_LOCK_SUCCESS 0
474#define P9_LOCK_BLOCKED 1
475#define P9_LOCK_ERROR 2
476#define P9_LOCK_GRACE 3
477
478#define P9_LOCK_FLAGS_BLOCK 1
479#define P9_LOCK_FLAGS_RECLAIM 2
480
481/* struct p9_flock: POSIX lock structure
482 * @type - type of lock
483 * @flags - lock flags
484 * @start - starting offset of the lock
485 * @length - number of bytes
486 * @proc_id - process id which wants to take lock
487 * @client_id - client id
488 */
489
490struct p9_flock {
491 u8 type;
492 u32 flags;
493 u64 start;
494 u64 length;
495 u32 proc_id;
496 char *client_id;
497};
498
499/* struct p9_getlock: getlock structure
500 * @type - type of lock
501 * @start - starting offset of the lock
502 * @length - number of bytes
503 * @proc_id - process id which wants to take lock
504 * @client_id - client id
505 */
506
507struct p9_getlock {
508 u8 type;
509 u64 start;
510 u64 length;
511 u32 proc_id;
512 char *client_id;
513};
514
461/* Structures for Protocol Operations */ 515/* Structures for Protocol Operations */
462struct p9_tstatfs { 516struct p9_tstatfs {
463 u32 fid; 517 u32 fid;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 7f63d5ab7b44..83ba6a4d58a3 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -229,6 +229,7 @@ int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid,
229int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, 229int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
230 gid_t gid, struct p9_qid *qid); 230 gid_t gid, struct p9_qid *qid);
231int p9_client_clunk(struct p9_fid *fid); 231int p9_client_clunk(struct p9_fid *fid);
232int p9_client_fsync(struct p9_fid *fid, int datasync);
232int p9_client_remove(struct p9_fid *fid); 233int p9_client_remove(struct p9_fid *fid);
233int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, 234int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
234 u64 offset, u32 count); 235 u64 offset, u32 count);
@@ -248,6 +249,8 @@ int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode,
248 dev_t rdev, gid_t gid, struct p9_qid *); 249 dev_t rdev, gid_t gid, struct p9_qid *);
249int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, 250int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
250 gid_t gid, struct p9_qid *); 251 gid_t gid, struct p9_qid *);
252int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
253int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl);
251struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); 254struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
252void p9_client_cb(struct p9_client *c, struct p9_req_t *req); 255void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
253 256
@@ -259,5 +262,6 @@ int p9_is_proto_dotu(struct p9_client *clnt);
259int p9_is_proto_dotl(struct p9_client *clnt); 262int p9_is_proto_dotl(struct p9_client *clnt);
260struct p9_fid *p9_client_xattrwalk(struct p9_fid *, const char *, u64 *); 263struct p9_fid *p9_client_xattrwalk(struct p9_fid *, const char *, u64 *);
261int p9_client_xattrcreate(struct p9_fid *, const char *, u64, int); 264int p9_client_xattrcreate(struct p9_fid *, const char *, u64, int);
265int p9_client_readlink(struct p9_fid *fid, char **target);
262 266
263#endif /* NET_9P_CLIENT_H */ 267#endif /* NET_9P_CLIENT_H */
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index ba3666d31766..07bdb5e9e8ac 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -158,6 +158,8 @@ extern int fib_table_flush(struct fib_table *table);
158extern void fib_table_select_default(struct fib_table *table, 158extern void fib_table_select_default(struct fib_table *table,
159 const struct flowi *flp, 159 const struct flowi *flp,
160 struct fib_result *res); 160 struct fib_result *res);
161extern void fib_free_table(struct fib_table *tb);
162
161 163
162 164
163#ifndef CONFIG_IP_MULTIPLE_TABLES 165#ifndef CONFIG_IP_MULTIPLE_TABLES
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 6bcb00645de4..289010d3270b 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -21,7 +21,8 @@ TRACE_EVENT(ext4_free_inode,
21 TP_ARGS(inode), 21 TP_ARGS(inode),
22 22
23 TP_STRUCT__entry( 23 TP_STRUCT__entry(
24 __field( dev_t, dev ) 24 __field( int, dev_major )
25 __field( int, dev_minor )
25 __field( ino_t, ino ) 26 __field( ino_t, ino )
26 __field( umode_t, mode ) 27 __field( umode_t, mode )
27 __field( uid_t, uid ) 28 __field( uid_t, uid )
@@ -30,7 +31,8 @@ TRACE_EVENT(ext4_free_inode,
30 ), 31 ),
31 32
32 TP_fast_assign( 33 TP_fast_assign(
33 __entry->dev = inode->i_sb->s_dev; 34 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
35 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
34 __entry->ino = inode->i_ino; 36 __entry->ino = inode->i_ino;
35 __entry->mode = inode->i_mode; 37 __entry->mode = inode->i_mode;
36 __entry->uid = inode->i_uid; 38 __entry->uid = inode->i_uid;
@@ -38,9 +40,10 @@ TRACE_EVENT(ext4_free_inode,
38 __entry->blocks = inode->i_blocks; 40 __entry->blocks = inode->i_blocks;
39 ), 41 ),
40 42
41 TP_printk("dev %s ino %lu mode 0%o uid %u gid %u blocks %llu", 43 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
42 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 44 __entry->dev_major, __entry->dev_minor,
43 __entry->mode, __entry->uid, __entry->gid, 45 (unsigned long) __entry->ino, __entry->mode,
46 __entry->uid, __entry->gid,
44 (unsigned long long) __entry->blocks) 47 (unsigned long long) __entry->blocks)
45); 48);
46 49
@@ -50,20 +53,22 @@ TRACE_EVENT(ext4_request_inode,
50 TP_ARGS(dir, mode), 53 TP_ARGS(dir, mode),
51 54
52 TP_STRUCT__entry( 55 TP_STRUCT__entry(
53 __field( dev_t, dev ) 56 __field( int, dev_major )
57 __field( int, dev_minor )
54 __field( ino_t, dir ) 58 __field( ino_t, dir )
55 __field( umode_t, mode ) 59 __field( umode_t, mode )
56 ), 60 ),
57 61
58 TP_fast_assign( 62 TP_fast_assign(
59 __entry->dev = dir->i_sb->s_dev; 63 __entry->dev_major = MAJOR(dir->i_sb->s_dev);
64 __entry->dev_minor = MINOR(dir->i_sb->s_dev);
60 __entry->dir = dir->i_ino; 65 __entry->dir = dir->i_ino;
61 __entry->mode = mode; 66 __entry->mode = mode;
62 ), 67 ),
63 68
64 TP_printk("dev %s dir %lu mode 0%o", 69 TP_printk("dev %d,%d dir %lu mode 0%o",
65 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, 70 __entry->dev_major, __entry->dev_minor,
66 __entry->mode) 71 (unsigned long) __entry->dir, __entry->mode)
67); 72);
68 73
69TRACE_EVENT(ext4_allocate_inode, 74TRACE_EVENT(ext4_allocate_inode,
@@ -72,21 +77,24 @@ TRACE_EVENT(ext4_allocate_inode,
72 TP_ARGS(inode, dir, mode), 77 TP_ARGS(inode, dir, mode),
73 78
74 TP_STRUCT__entry( 79 TP_STRUCT__entry(
75 __field( dev_t, dev ) 80 __field( int, dev_major )
81 __field( int, dev_minor )
76 __field( ino_t, ino ) 82 __field( ino_t, ino )
77 __field( ino_t, dir ) 83 __field( ino_t, dir )
78 __field( umode_t, mode ) 84 __field( umode_t, mode )
79 ), 85 ),
80 86
81 TP_fast_assign( 87 TP_fast_assign(
82 __entry->dev = inode->i_sb->s_dev; 88 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
89 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
83 __entry->ino = inode->i_ino; 90 __entry->ino = inode->i_ino;
84 __entry->dir = dir->i_ino; 91 __entry->dir = dir->i_ino;
85 __entry->mode = mode; 92 __entry->mode = mode;
86 ), 93 ),
87 94
88 TP_printk("dev %s ino %lu dir %lu mode 0%o", 95 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
89 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 96 __entry->dev_major, __entry->dev_minor,
97 (unsigned long) __entry->ino,
90 (unsigned long) __entry->dir, __entry->mode) 98 (unsigned long) __entry->dir, __entry->mode)
91); 99);
92 100
@@ -98,7 +106,8 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
98 TP_ARGS(inode, pos, len, flags), 106 TP_ARGS(inode, pos, len, flags),
99 107
100 TP_STRUCT__entry( 108 TP_STRUCT__entry(
101 __field( dev_t, dev ) 109 __field( int, dev_major )
110 __field( int, dev_minor )
102 __field( ino_t, ino ) 111 __field( ino_t, ino )
103 __field( loff_t, pos ) 112 __field( loff_t, pos )
104 __field( unsigned int, len ) 113 __field( unsigned int, len )
@@ -106,15 +115,17 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
106 ), 115 ),
107 116
108 TP_fast_assign( 117 TP_fast_assign(
109 __entry->dev = inode->i_sb->s_dev; 118 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
119 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
110 __entry->ino = inode->i_ino; 120 __entry->ino = inode->i_ino;
111 __entry->pos = pos; 121 __entry->pos = pos;
112 __entry->len = len; 122 __entry->len = len;
113 __entry->flags = flags; 123 __entry->flags = flags;
114 ), 124 ),
115 125
116 TP_printk("dev %s ino %lu pos %llu len %u flags %u", 126 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
117 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 127 __entry->dev_major, __entry->dev_minor,
128 (unsigned long) __entry->ino,
118 __entry->pos, __entry->len, __entry->flags) 129 __entry->pos, __entry->len, __entry->flags)
119); 130);
120 131
@@ -141,7 +152,8 @@ DECLARE_EVENT_CLASS(ext4__write_end,
141 TP_ARGS(inode, pos, len, copied), 152 TP_ARGS(inode, pos, len, copied),
142 153
143 TP_STRUCT__entry( 154 TP_STRUCT__entry(
144 __field( dev_t, dev ) 155 __field( int, dev_major )
156 __field( int, dev_minor )
145 __field( ino_t, ino ) 157 __field( ino_t, ino )
146 __field( loff_t, pos ) 158 __field( loff_t, pos )
147 __field( unsigned int, len ) 159 __field( unsigned int, len )
@@ -149,16 +161,18 @@ DECLARE_EVENT_CLASS(ext4__write_end,
149 ), 161 ),
150 162
151 TP_fast_assign( 163 TP_fast_assign(
152 __entry->dev = inode->i_sb->s_dev; 164 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
165 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
153 __entry->ino = inode->i_ino; 166 __entry->ino = inode->i_ino;
154 __entry->pos = pos; 167 __entry->pos = pos;
155 __entry->len = len; 168 __entry->len = len;
156 __entry->copied = copied; 169 __entry->copied = copied;
157 ), 170 ),
158 171
159 TP_printk("dev %s ino %lu pos %llu len %u copied %u", 172 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
160 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 173 __entry->dev_major, __entry->dev_minor,
161 __entry->pos, __entry->len, __entry->copied) 174 (unsigned long) __entry->ino, __entry->pos,
175 __entry->len, __entry->copied)
162); 176);
163 177
164DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end, 178DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
@@ -199,21 +213,23 @@ TRACE_EVENT(ext4_writepage,
199 TP_ARGS(inode, page), 213 TP_ARGS(inode, page),
200 214
201 TP_STRUCT__entry( 215 TP_STRUCT__entry(
202 __field( dev_t, dev ) 216 __field( int, dev_major )
217 __field( int, dev_minor )
203 __field( ino_t, ino ) 218 __field( ino_t, ino )
204 __field( pgoff_t, index ) 219 __field( pgoff_t, index )
205 220
206 ), 221 ),
207 222
208 TP_fast_assign( 223 TP_fast_assign(
209 __entry->dev = inode->i_sb->s_dev; 224 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
225 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
210 __entry->ino = inode->i_ino; 226 __entry->ino = inode->i_ino;
211 __entry->index = page->index; 227 __entry->index = page->index;
212 ), 228 ),
213 229
214 TP_printk("dev %s ino %lu page_index %lu", 230 TP_printk("dev %d,%d ino %lu page_index %lu",
215 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 231 __entry->dev_major, __entry->dev_minor,
216 __entry->index) 232 (unsigned long) __entry->ino, __entry->index)
217); 233);
218 234
219TRACE_EVENT(ext4_da_writepages, 235TRACE_EVENT(ext4_da_writepages,
@@ -222,13 +238,13 @@ TRACE_EVENT(ext4_da_writepages,
222 TP_ARGS(inode, wbc), 238 TP_ARGS(inode, wbc),
223 239
224 TP_STRUCT__entry( 240 TP_STRUCT__entry(
225 __field( dev_t, dev ) 241 __field( int, dev_major )
242 __field( int, dev_minor )
226 __field( ino_t, ino ) 243 __field( ino_t, ino )
227 __field( long, nr_to_write ) 244 __field( long, nr_to_write )
228 __field( long, pages_skipped ) 245 __field( long, pages_skipped )
229 __field( loff_t, range_start ) 246 __field( loff_t, range_start )
230 __field( loff_t, range_end ) 247 __field( loff_t, range_end )
231 __field( char, nonblocking )
232 __field( char, for_kupdate ) 248 __field( char, for_kupdate )
233 __field( char, for_reclaim ) 249 __field( char, for_reclaim )
234 __field( char, range_cyclic ) 250 __field( char, range_cyclic )
@@ -236,7 +252,8 @@ TRACE_EVENT(ext4_da_writepages,
236 ), 252 ),
237 253
238 TP_fast_assign( 254 TP_fast_assign(
239 __entry->dev = inode->i_sb->s_dev; 255 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
256 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
240 __entry->ino = inode->i_ino; 257 __entry->ino = inode->i_ino;
241 __entry->nr_to_write = wbc->nr_to_write; 258 __entry->nr_to_write = wbc->nr_to_write;
242 __entry->pages_skipped = wbc->pages_skipped; 259 __entry->pages_skipped = wbc->pages_skipped;
@@ -248,11 +265,11 @@ TRACE_EVENT(ext4_da_writepages,
248 __entry->writeback_index = inode->i_mapping->writeback_index; 265 __entry->writeback_index = inode->i_mapping->writeback_index;
249 ), 266 ),
250 267
251 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld " 268 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
252 "range_start %llu range_end %llu " 269 "range_start %llu range_end %llu "
253 "for_kupdate %d for_reclaim %d " 270 "for_kupdate %d for_reclaim %d "
254 "range_cyclic %d writeback_index %lu", 271 "range_cyclic %d writeback_index %lu",
255 jbd2_dev_to_name(__entry->dev), 272 __entry->dev_major, __entry->dev_minor,
256 (unsigned long) __entry->ino, __entry->nr_to_write, 273 (unsigned long) __entry->ino, __entry->nr_to_write,
257 __entry->pages_skipped, __entry->range_start, 274 __entry->pages_skipped, __entry->range_start,
258 __entry->range_end, 275 __entry->range_end,
@@ -267,7 +284,8 @@ TRACE_EVENT(ext4_da_write_pages,
267 TP_ARGS(inode, mpd), 284 TP_ARGS(inode, mpd),
268 285
269 TP_STRUCT__entry( 286 TP_STRUCT__entry(
270 __field( dev_t, dev ) 287 __field( int, dev_major )
288 __field( int, dev_minor )
271 __field( ino_t, ino ) 289 __field( ino_t, ino )
272 __field( __u64, b_blocknr ) 290 __field( __u64, b_blocknr )
273 __field( __u32, b_size ) 291 __field( __u32, b_size )
@@ -278,7 +296,8 @@ TRACE_EVENT(ext4_da_write_pages,
278 ), 296 ),
279 297
280 TP_fast_assign( 298 TP_fast_assign(
281 __entry->dev = inode->i_sb->s_dev; 299 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
300 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
282 __entry->ino = inode->i_ino; 301 __entry->ino = inode->i_ino;
283 __entry->b_blocknr = mpd->b_blocknr; 302 __entry->b_blocknr = mpd->b_blocknr;
284 __entry->b_size = mpd->b_size; 303 __entry->b_size = mpd->b_size;
@@ -288,8 +307,9 @@ TRACE_EVENT(ext4_da_write_pages,
288 __entry->pages_written = mpd->pages_written; 307 __entry->pages_written = mpd->pages_written;
289 ), 308 ),
290 309
291 TP_printk("dev %s ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d", 310 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d",
292 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 311 __entry->dev_major, __entry->dev_minor,
312 (unsigned long) __entry->ino,
293 __entry->b_blocknr, __entry->b_size, 313 __entry->b_blocknr, __entry->b_size,
294 __entry->b_state, __entry->first_page, 314 __entry->b_state, __entry->first_page,
295 __entry->io_done, __entry->pages_written) 315 __entry->io_done, __entry->pages_written)
@@ -302,7 +322,8 @@ TRACE_EVENT(ext4_da_writepages_result,
302 TP_ARGS(inode, wbc, ret, pages_written), 322 TP_ARGS(inode, wbc, ret, pages_written),
303 323
304 TP_STRUCT__entry( 324 TP_STRUCT__entry(
305 __field( dev_t, dev ) 325 __field( int, dev_major )
326 __field( int, dev_minor )
306 __field( ino_t, ino ) 327 __field( ino_t, ino )
307 __field( int, ret ) 328 __field( int, ret )
308 __field( int, pages_written ) 329 __field( int, pages_written )
@@ -312,7 +333,8 @@ TRACE_EVENT(ext4_da_writepages_result,
312 ), 333 ),
313 334
314 TP_fast_assign( 335 TP_fast_assign(
315 __entry->dev = inode->i_sb->s_dev; 336 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
337 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
316 __entry->ino = inode->i_ino; 338 __entry->ino = inode->i_ino;
317 __entry->ret = ret; 339 __entry->ret = ret;
318 __entry->pages_written = pages_written; 340 __entry->pages_written = pages_written;
@@ -321,8 +343,8 @@ TRACE_EVENT(ext4_da_writepages_result,
321 __entry->writeback_index = inode->i_mapping->writeback_index; 343 __entry->writeback_index = inode->i_mapping->writeback_index;
322 ), 344 ),
323 345
324 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu", 346 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
325 jbd2_dev_to_name(__entry->dev), 347 __entry->dev_major, __entry->dev_minor,
326 (unsigned long) __entry->ino, __entry->ret, 348 (unsigned long) __entry->ino, __entry->ret,
327 __entry->pages_written, __entry->pages_skipped, 349 __entry->pages_written, __entry->pages_skipped,
328 __entry->more_io, 350 __entry->more_io,
@@ -336,20 +358,23 @@ TRACE_EVENT(ext4_discard_blocks,
336 TP_ARGS(sb, blk, count), 358 TP_ARGS(sb, blk, count),
337 359
338 TP_STRUCT__entry( 360 TP_STRUCT__entry(
339 __field( dev_t, dev ) 361 __field( int, dev_major )
362 __field( int, dev_minor )
340 __field( __u64, blk ) 363 __field( __u64, blk )
341 __field( __u64, count ) 364 __field( __u64, count )
342 365
343 ), 366 ),
344 367
345 TP_fast_assign( 368 TP_fast_assign(
346 __entry->dev = sb->s_dev; 369 __entry->dev_major = MAJOR(sb->s_dev);
370 __entry->dev_minor = MINOR(sb->s_dev);
347 __entry->blk = blk; 371 __entry->blk = blk;
348 __entry->count = count; 372 __entry->count = count;
349 ), 373 ),
350 374
351 TP_printk("dev %s blk %llu count %llu", 375 TP_printk("dev %d,%d blk %llu count %llu",
352 jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) 376 __entry->dev_major, __entry->dev_minor,
377 __entry->blk, __entry->count)
353); 378);
354 379
355DECLARE_EVENT_CLASS(ext4__mb_new_pa, 380DECLARE_EVENT_CLASS(ext4__mb_new_pa,
@@ -359,7 +384,8 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
359 TP_ARGS(ac, pa), 384 TP_ARGS(ac, pa),
360 385
361 TP_STRUCT__entry( 386 TP_STRUCT__entry(
362 __field( dev_t, dev ) 387 __field( int, dev_major )
388 __field( int, dev_minor )
363 __field( ino_t, ino ) 389 __field( ino_t, ino )
364 __field( __u64, pa_pstart ) 390 __field( __u64, pa_pstart )
365 __field( __u32, pa_len ) 391 __field( __u32, pa_len )
@@ -368,16 +394,18 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
368 ), 394 ),
369 395
370 TP_fast_assign( 396 TP_fast_assign(
371 __entry->dev = ac->ac_sb->s_dev; 397 __entry->dev_major = MAJOR(ac->ac_sb->s_dev);
398 __entry->dev_minor = MINOR(ac->ac_sb->s_dev);
372 __entry->ino = ac->ac_inode->i_ino; 399 __entry->ino = ac->ac_inode->i_ino;
373 __entry->pa_pstart = pa->pa_pstart; 400 __entry->pa_pstart = pa->pa_pstart;
374 __entry->pa_len = pa->pa_len; 401 __entry->pa_len = pa->pa_len;
375 __entry->pa_lstart = pa->pa_lstart; 402 __entry->pa_lstart = pa->pa_lstart;
376 ), 403 ),
377 404
378 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", 405 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
379 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 406 __entry->dev_major, __entry->dev_minor,
380 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) 407 (unsigned long) __entry->ino, __entry->pa_pstart,
408 __entry->pa_len, __entry->pa_lstart)
381); 409);
382 410
383DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa, 411DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
@@ -398,14 +426,15 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
398 426
399TRACE_EVENT(ext4_mb_release_inode_pa, 427TRACE_EVENT(ext4_mb_release_inode_pa,
400 TP_PROTO(struct super_block *sb, 428 TP_PROTO(struct super_block *sb,
401 struct ext4_allocation_context *ac, 429 struct inode *inode,
402 struct ext4_prealloc_space *pa, 430 struct ext4_prealloc_space *pa,
403 unsigned long long block, unsigned int count), 431 unsigned long long block, unsigned int count),
404 432
405 TP_ARGS(sb, ac, pa, block, count), 433 TP_ARGS(sb, inode, pa, block, count),
406 434
407 TP_STRUCT__entry( 435 TP_STRUCT__entry(
408 __field( dev_t, dev ) 436 __field( int, dev_major )
437 __field( int, dev_minor )
409 __field( ino_t, ino ) 438 __field( ino_t, ino )
410 __field( __u64, block ) 439 __field( __u64, block )
411 __field( __u32, count ) 440 __field( __u32, count )
@@ -413,43 +442,42 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
413 ), 442 ),
414 443
415 TP_fast_assign( 444 TP_fast_assign(
416 __entry->dev = sb->s_dev; 445 __entry->dev_major = MAJOR(sb->s_dev);
417 __entry->ino = (ac && ac->ac_inode) ? 446 __entry->dev_minor = MINOR(sb->s_dev);
418 ac->ac_inode->i_ino : 0; 447 __entry->ino = inode->i_ino;
419 __entry->block = block; 448 __entry->block = block;
420 __entry->count = count; 449 __entry->count = count;
421 ), 450 ),
422 451
423 TP_printk("dev %s ino %lu block %llu count %u", 452 TP_printk("dev %d,%d ino %lu block %llu count %u",
424 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 453 __entry->dev_major, __entry->dev_minor,
425 __entry->block, __entry->count) 454 (unsigned long) __entry->ino, __entry->block, __entry->count)
426); 455);
427 456
428TRACE_EVENT(ext4_mb_release_group_pa, 457TRACE_EVENT(ext4_mb_release_group_pa,
429 TP_PROTO(struct super_block *sb, 458 TP_PROTO(struct super_block *sb,
430 struct ext4_allocation_context *ac,
431 struct ext4_prealloc_space *pa), 459 struct ext4_prealloc_space *pa),
432 460
433 TP_ARGS(sb, ac, pa), 461 TP_ARGS(sb, pa),
434 462
435 TP_STRUCT__entry( 463 TP_STRUCT__entry(
436 __field( dev_t, dev ) 464 __field( int, dev_major )
437 __field( ino_t, ino ) 465 __field( int, dev_minor )
438 __field( __u64, pa_pstart ) 466 __field( __u64, pa_pstart )
439 __field( __u32, pa_len ) 467 __field( __u32, pa_len )
440 468
441 ), 469 ),
442 470
443 TP_fast_assign( 471 TP_fast_assign(
444 __entry->dev = sb->s_dev; 472 __entry->dev_major = MAJOR(sb->s_dev);
445 __entry->ino = (ac && ac->ac_inode) ? 473 __entry->dev_minor = MINOR(sb->s_dev);
446 ac->ac_inode->i_ino : 0;
447 __entry->pa_pstart = pa->pa_pstart; 474 __entry->pa_pstart = pa->pa_pstart;
448 __entry->pa_len = pa->pa_len; 475 __entry->pa_len = pa->pa_len;
449 ), 476 ),
450 477
451 TP_printk("dev %s pstart %llu len %u", 478 TP_printk("dev %d,%d pstart %llu len %u",
452 jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len) 479 __entry->dev_major, __entry->dev_minor,
480 __entry->pa_pstart, __entry->pa_len)
453); 481);
454 482
455TRACE_EVENT(ext4_discard_preallocations, 483TRACE_EVENT(ext4_discard_preallocations,
@@ -458,18 +486,21 @@ TRACE_EVENT(ext4_discard_preallocations,
458 TP_ARGS(inode), 486 TP_ARGS(inode),
459 487
460 TP_STRUCT__entry( 488 TP_STRUCT__entry(
461 __field( dev_t, dev ) 489 __field( int, dev_major )
490 __field( int, dev_minor )
462 __field( ino_t, ino ) 491 __field( ino_t, ino )
463 492
464 ), 493 ),
465 494
466 TP_fast_assign( 495 TP_fast_assign(
467 __entry->dev = inode->i_sb->s_dev; 496 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
497 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
468 __entry->ino = inode->i_ino; 498 __entry->ino = inode->i_ino;
469 ), 499 ),
470 500
471 TP_printk("dev %s ino %lu", 501 TP_printk("dev %d,%d ino %lu",
472 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 502 __entry->dev_major, __entry->dev_minor,
503 (unsigned long) __entry->ino)
473); 504);
474 505
475TRACE_EVENT(ext4_mb_discard_preallocations, 506TRACE_EVENT(ext4_mb_discard_preallocations,
@@ -478,18 +509,20 @@ TRACE_EVENT(ext4_mb_discard_preallocations,
478 TP_ARGS(sb, needed), 509 TP_ARGS(sb, needed),
479 510
480 TP_STRUCT__entry( 511 TP_STRUCT__entry(
481 __field( dev_t, dev ) 512 __field( int, dev_major )
513 __field( int, dev_minor )
482 __field( int, needed ) 514 __field( int, needed )
483 515
484 ), 516 ),
485 517
486 TP_fast_assign( 518 TP_fast_assign(
487 __entry->dev = sb->s_dev; 519 __entry->dev_major = MAJOR(sb->s_dev);
520 __entry->dev_minor = MINOR(sb->s_dev);
488 __entry->needed = needed; 521 __entry->needed = needed;
489 ), 522 ),
490 523
491 TP_printk("dev %s needed %d", 524 TP_printk("dev %d,%d needed %d",
492 jbd2_dev_to_name(__entry->dev), __entry->needed) 525 __entry->dev_major, __entry->dev_minor, __entry->needed)
493); 526);
494 527
495TRACE_EVENT(ext4_request_blocks, 528TRACE_EVENT(ext4_request_blocks,
@@ -498,7 +531,8 @@ TRACE_EVENT(ext4_request_blocks,
498 TP_ARGS(ar), 531 TP_ARGS(ar),
499 532
500 TP_STRUCT__entry( 533 TP_STRUCT__entry(
501 __field( dev_t, dev ) 534 __field( int, dev_major )
535 __field( int, dev_minor )
502 __field( ino_t, ino ) 536 __field( ino_t, ino )
503 __field( unsigned int, flags ) 537 __field( unsigned int, flags )
504 __field( unsigned int, len ) 538 __field( unsigned int, len )
@@ -511,7 +545,8 @@ TRACE_EVENT(ext4_request_blocks,
511 ), 545 ),
512 546
513 TP_fast_assign( 547 TP_fast_assign(
514 __entry->dev = ar->inode->i_sb->s_dev; 548 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
549 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
515 __entry->ino = ar->inode->i_ino; 550 __entry->ino = ar->inode->i_ino;
516 __entry->flags = ar->flags; 551 __entry->flags = ar->flags;
517 __entry->len = ar->len; 552 __entry->len = ar->len;
@@ -523,8 +558,9 @@ TRACE_EVENT(ext4_request_blocks,
523 __entry->pright = ar->pright; 558 __entry->pright = ar->pright;
524 ), 559 ),
525 560
526 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 561 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
527 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 562 __entry->dev_major, __entry->dev_minor,
563 (unsigned long) __entry->ino,
528 __entry->flags, __entry->len, 564 __entry->flags, __entry->len,
529 (unsigned long long) __entry->logical, 565 (unsigned long long) __entry->logical,
530 (unsigned long long) __entry->goal, 566 (unsigned long long) __entry->goal,
@@ -540,7 +576,8 @@ TRACE_EVENT(ext4_allocate_blocks,
540 TP_ARGS(ar, block), 576 TP_ARGS(ar, block),
541 577
542 TP_STRUCT__entry( 578 TP_STRUCT__entry(
543 __field( dev_t, dev ) 579 __field( int, dev_major )
580 __field( int, dev_minor )
544 __field( ino_t, ino ) 581 __field( ino_t, ino )
545 __field( __u64, block ) 582 __field( __u64, block )
546 __field( unsigned int, flags ) 583 __field( unsigned int, flags )
@@ -554,7 +591,8 @@ TRACE_EVENT(ext4_allocate_blocks,
554 ), 591 ),
555 592
556 TP_fast_assign( 593 TP_fast_assign(
557 __entry->dev = ar->inode->i_sb->s_dev; 594 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
595 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
558 __entry->ino = ar->inode->i_ino; 596 __entry->ino = ar->inode->i_ino;
559 __entry->block = block; 597 __entry->block = block;
560 __entry->flags = ar->flags; 598 __entry->flags = ar->flags;
@@ -567,9 +605,10 @@ TRACE_EVENT(ext4_allocate_blocks,
567 __entry->pright = ar->pright; 605 __entry->pright = ar->pright;
568 ), 606 ),
569 607
570 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 608 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
571 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 609 __entry->dev_major, __entry->dev_minor,
572 __entry->flags, __entry->len, __entry->block, 610 (unsigned long) __entry->ino, __entry->flags,
611 __entry->len, __entry->block,
573 (unsigned long long) __entry->logical, 612 (unsigned long long) __entry->logical,
574 (unsigned long long) __entry->goal, 613 (unsigned long long) __entry->goal,
575 (unsigned long long) __entry->lleft, 614 (unsigned long long) __entry->lleft,
@@ -585,7 +624,8 @@ TRACE_EVENT(ext4_free_blocks,
585 TP_ARGS(inode, block, count, flags), 624 TP_ARGS(inode, block, count, flags),
586 625
587 TP_STRUCT__entry( 626 TP_STRUCT__entry(
588 __field( dev_t, dev ) 627 __field( int, dev_major )
628 __field( int, dev_minor )
589 __field( ino_t, ino ) 629 __field( ino_t, ino )
590 __field( umode_t, mode ) 630 __field( umode_t, mode )
591 __field( __u64, block ) 631 __field( __u64, block )
@@ -594,7 +634,8 @@ TRACE_EVENT(ext4_free_blocks,
594 ), 634 ),
595 635
596 TP_fast_assign( 636 TP_fast_assign(
597 __entry->dev = inode->i_sb->s_dev; 637 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
638 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
598 __entry->ino = inode->i_ino; 639 __entry->ino = inode->i_ino;
599 __entry->mode = inode->i_mode; 640 __entry->mode = inode->i_mode;
600 __entry->block = block; 641 __entry->block = block;
@@ -602,8 +643,9 @@ TRACE_EVENT(ext4_free_blocks,
602 __entry->flags = flags; 643 __entry->flags = flags;
603 ), 644 ),
604 645
605 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d", 646 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
606 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 647 __entry->dev_major, __entry->dev_minor,
648 (unsigned long) __entry->ino,
607 __entry->mode, __entry->block, __entry->count, 649 __entry->mode, __entry->block, __entry->count,
608 __entry->flags) 650 __entry->flags)
609); 651);
@@ -614,7 +656,8 @@ TRACE_EVENT(ext4_sync_file,
614 TP_ARGS(file, datasync), 656 TP_ARGS(file, datasync),
615 657
616 TP_STRUCT__entry( 658 TP_STRUCT__entry(
617 __field( dev_t, dev ) 659 __field( int, dev_major )
660 __field( int, dev_minor )
618 __field( ino_t, ino ) 661 __field( ino_t, ino )
619 __field( ino_t, parent ) 662 __field( ino_t, parent )
620 __field( int, datasync ) 663 __field( int, datasync )
@@ -623,14 +666,16 @@ TRACE_EVENT(ext4_sync_file,
623 TP_fast_assign( 666 TP_fast_assign(
624 struct dentry *dentry = file->f_path.dentry; 667 struct dentry *dentry = file->f_path.dentry;
625 668
626 __entry->dev = dentry->d_inode->i_sb->s_dev; 669 __entry->dev_major = MAJOR(dentry->d_inode->i_sb->s_dev);
670 __entry->dev_minor = MINOR(dentry->d_inode->i_sb->s_dev);
627 __entry->ino = dentry->d_inode->i_ino; 671 __entry->ino = dentry->d_inode->i_ino;
628 __entry->datasync = datasync; 672 __entry->datasync = datasync;
629 __entry->parent = dentry->d_parent->d_inode->i_ino; 673 __entry->parent = dentry->d_parent->d_inode->i_ino;
630 ), 674 ),
631 675
632 TP_printk("dev %s ino %ld parent %ld datasync %d ", 676 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ",
633 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 677 __entry->dev_major, __entry->dev_minor,
678 (unsigned long) __entry->ino,
634 (unsigned long) __entry->parent, __entry->datasync) 679 (unsigned long) __entry->parent, __entry->datasync)
635); 680);
636 681
@@ -640,18 +685,20 @@ TRACE_EVENT(ext4_sync_fs,
640 TP_ARGS(sb, wait), 685 TP_ARGS(sb, wait),
641 686
642 TP_STRUCT__entry( 687 TP_STRUCT__entry(
643 __field( dev_t, dev ) 688 __field( int, dev_major )
689 __field( int, dev_minor )
644 __field( int, wait ) 690 __field( int, wait )
645 691
646 ), 692 ),
647 693
648 TP_fast_assign( 694 TP_fast_assign(
649 __entry->dev = sb->s_dev; 695 __entry->dev_major = MAJOR(sb->s_dev);
696 __entry->dev_minor = MINOR(sb->s_dev);
650 __entry->wait = wait; 697 __entry->wait = wait;
651 ), 698 ),
652 699
653 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev), 700 TP_printk("dev %d,%d wait %d", __entry->dev_major,
654 __entry->wait) 701 __entry->dev_minor, __entry->wait)
655); 702);
656 703
657TRACE_EVENT(ext4_alloc_da_blocks, 704TRACE_EVENT(ext4_alloc_da_blocks,
@@ -660,21 +707,24 @@ TRACE_EVENT(ext4_alloc_da_blocks,
660 TP_ARGS(inode), 707 TP_ARGS(inode),
661 708
662 TP_STRUCT__entry( 709 TP_STRUCT__entry(
663 __field( dev_t, dev ) 710 __field( int, dev_major )
711 __field( int, dev_minor )
664 __field( ino_t, ino ) 712 __field( ino_t, ino )
665 __field( unsigned int, data_blocks ) 713 __field( unsigned int, data_blocks )
666 __field( unsigned int, meta_blocks ) 714 __field( unsigned int, meta_blocks )
667 ), 715 ),
668 716
669 TP_fast_assign( 717 TP_fast_assign(
670 __entry->dev = inode->i_sb->s_dev; 718 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
719 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
671 __entry->ino = inode->i_ino; 720 __entry->ino = inode->i_ino;
672 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 721 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
673 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 722 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
674 ), 723 ),
675 724
676 TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u", 725 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
677 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 726 __entry->dev_major, __entry->dev_minor,
727 (unsigned long) __entry->ino,
678 __entry->data_blocks, __entry->meta_blocks) 728 __entry->data_blocks, __entry->meta_blocks)
679); 729);
680 730
@@ -684,7 +734,8 @@ TRACE_EVENT(ext4_mballoc_alloc,
684 TP_ARGS(ac), 734 TP_ARGS(ac),
685 735
686 TP_STRUCT__entry( 736 TP_STRUCT__entry(
687 __field( dev_t, dev ) 737 __field( int, dev_major )
738 __field( int, dev_minor )
688 __field( ino_t, ino ) 739 __field( ino_t, ino )
689 __field( __u16, found ) 740 __field( __u16, found )
690 __field( __u16, groups ) 741 __field( __u16, groups )
@@ -707,7 +758,8 @@ TRACE_EVENT(ext4_mballoc_alloc,
707 ), 758 ),
708 759
709 TP_fast_assign( 760 TP_fast_assign(
710 __entry->dev = ac->ac_inode->i_sb->s_dev; 761 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
762 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
711 __entry->ino = ac->ac_inode->i_ino; 763 __entry->ino = ac->ac_inode->i_ino;
712 __entry->found = ac->ac_found; 764 __entry->found = ac->ac_found;
713 __entry->flags = ac->ac_flags; 765 __entry->flags = ac->ac_flags;
@@ -729,10 +781,11 @@ TRACE_EVENT(ext4_mballoc_alloc,
729 __entry->result_len = ac->ac_f_ex.fe_len; 781 __entry->result_len = ac->ac_f_ex.fe_len;
730 ), 782 ),
731 783
732 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " 784 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
733 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " 785 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
734 "tail %u broken %u", 786 "tail %u broken %u",
735 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 787 __entry->dev_major, __entry->dev_minor,
788 (unsigned long) __entry->ino,
736 __entry->orig_group, __entry->orig_start, 789 __entry->orig_group, __entry->orig_start,
737 __entry->orig_len, __entry->orig_logical, 790 __entry->orig_len, __entry->orig_logical,
738 __entry->goal_group, __entry->goal_start, 791 __entry->goal_group, __entry->goal_start,
@@ -750,7 +803,8 @@ TRACE_EVENT(ext4_mballoc_prealloc,
750 TP_ARGS(ac), 803 TP_ARGS(ac),
751 804
752 TP_STRUCT__entry( 805 TP_STRUCT__entry(
753 __field( dev_t, dev ) 806 __field( int, dev_major )
807 __field( int, dev_minor )
754 __field( ino_t, ino ) 808 __field( ino_t, ino )
755 __field( __u32, orig_logical ) 809 __field( __u32, orig_logical )
756 __field( int, orig_start ) 810 __field( int, orig_start )
@@ -763,7 +817,8 @@ TRACE_EVENT(ext4_mballoc_prealloc,
763 ), 817 ),
764 818
765 TP_fast_assign( 819 TP_fast_assign(
766 __entry->dev = ac->ac_inode->i_sb->s_dev; 820 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
821 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
767 __entry->ino = ac->ac_inode->i_ino; 822 __entry->ino = ac->ac_inode->i_ino;
768 __entry->orig_logical = ac->ac_o_ex.fe_logical; 823 __entry->orig_logical = ac->ac_o_ex.fe_logical;
769 __entry->orig_start = ac->ac_o_ex.fe_start; 824 __entry->orig_start = ac->ac_o_ex.fe_start;
@@ -775,8 +830,9 @@ TRACE_EVENT(ext4_mballoc_prealloc,
775 __entry->result_len = ac->ac_b_ex.fe_len; 830 __entry->result_len = ac->ac_b_ex.fe_len;
776 ), 831 ),
777 832
778 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", 833 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
779 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 834 __entry->dev_major, __entry->dev_minor,
835 (unsigned long) __entry->ino,
780 __entry->orig_group, __entry->orig_start, 836 __entry->orig_group, __entry->orig_start,
781 __entry->orig_len, __entry->orig_logical, 837 __entry->orig_len, __entry->orig_logical,
782 __entry->result_group, __entry->result_start, 838 __entry->result_group, __entry->result_start,
@@ -784,46 +840,59 @@ TRACE_EVENT(ext4_mballoc_prealloc,
784); 840);
785 841
786DECLARE_EVENT_CLASS(ext4__mballoc, 842DECLARE_EVENT_CLASS(ext4__mballoc,
787 TP_PROTO(struct ext4_allocation_context *ac), 843 TP_PROTO(struct super_block *sb,
844 struct inode *inode,
845 ext4_group_t group,
846 ext4_grpblk_t start,
847 ext4_grpblk_t len),
788 848
789 TP_ARGS(ac), 849 TP_ARGS(sb, inode, group, start, len),
790 850
791 TP_STRUCT__entry( 851 TP_STRUCT__entry(
792 __field( dev_t, dev ) 852 __field( int, dev_major )
853 __field( int, dev_minor )
793 __field( ino_t, ino ) 854 __field( ino_t, ino )
794 __field( __u32, result_logical )
795 __field( int, result_start ) 855 __field( int, result_start )
796 __field( __u32, result_group ) 856 __field( __u32, result_group )
797 __field( int, result_len ) 857 __field( int, result_len )
798 ), 858 ),
799 859
800 TP_fast_assign( 860 TP_fast_assign(
801 __entry->dev = ac->ac_inode->i_sb->s_dev; 861 __entry->dev_major = MAJOR(sb->s_dev);
802 __entry->ino = ac->ac_inode->i_ino; 862 __entry->dev_minor = MINOR(sb->s_dev);
803 __entry->result_logical = ac->ac_b_ex.fe_logical; 863 __entry->ino = inode ? inode->i_ino : 0;
804 __entry->result_start = ac->ac_b_ex.fe_start; 864 __entry->result_start = start;
805 __entry->result_group = ac->ac_b_ex.fe_group; 865 __entry->result_group = group;
806 __entry->result_len = ac->ac_b_ex.fe_len; 866 __entry->result_len = len;
807 ), 867 ),
808 868
809 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", 869 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ",
810 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 870 __entry->dev_major, __entry->dev_minor,
871 (unsigned long) __entry->ino,
811 __entry->result_group, __entry->result_start, 872 __entry->result_group, __entry->result_start,
812 __entry->result_len, __entry->result_logical) 873 __entry->result_len)
813); 874);
814 875
815DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, 876DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
816 877
817 TP_PROTO(struct ext4_allocation_context *ac), 878 TP_PROTO(struct super_block *sb,
879 struct inode *inode,
880 ext4_group_t group,
881 ext4_grpblk_t start,
882 ext4_grpblk_t len),
818 883
819 TP_ARGS(ac) 884 TP_ARGS(sb, inode, group, start, len)
820); 885);
821 886
822DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, 887DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
823 888
824 TP_PROTO(struct ext4_allocation_context *ac), 889 TP_PROTO(struct super_block *sb,
890 struct inode *inode,
891 ext4_group_t group,
892 ext4_grpblk_t start,
893 ext4_grpblk_t len),
825 894
826 TP_ARGS(ac) 895 TP_ARGS(sb, inode, group, start, len)
827); 896);
828 897
829TRACE_EVENT(ext4_forget, 898TRACE_EVENT(ext4_forget,
@@ -832,7 +901,8 @@ TRACE_EVENT(ext4_forget,
832 TP_ARGS(inode, is_metadata, block), 901 TP_ARGS(inode, is_metadata, block),
833 902
834 TP_STRUCT__entry( 903 TP_STRUCT__entry(
835 __field( dev_t, dev ) 904 __field( int, dev_major )
905 __field( int, dev_minor )
836 __field( ino_t, ino ) 906 __field( ino_t, ino )
837 __field( umode_t, mode ) 907 __field( umode_t, mode )
838 __field( int, is_metadata ) 908 __field( int, is_metadata )
@@ -840,16 +910,18 @@ TRACE_EVENT(ext4_forget,
840 ), 910 ),
841 911
842 TP_fast_assign( 912 TP_fast_assign(
843 __entry->dev = inode->i_sb->s_dev; 913 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
914 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
844 __entry->ino = inode->i_ino; 915 __entry->ino = inode->i_ino;
845 __entry->mode = inode->i_mode; 916 __entry->mode = inode->i_mode;
846 __entry->is_metadata = is_metadata; 917 __entry->is_metadata = is_metadata;
847 __entry->block = block; 918 __entry->block = block;
848 ), 919 ),
849 920
850 TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu", 921 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
851 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 922 __entry->dev_major, __entry->dev_minor,
852 __entry->mode, __entry->is_metadata, __entry->block) 923 (unsigned long) __entry->ino, __entry->mode,
924 __entry->is_metadata, __entry->block)
853); 925);
854 926
855TRACE_EVENT(ext4_da_update_reserve_space, 927TRACE_EVENT(ext4_da_update_reserve_space,
@@ -858,7 +930,8 @@ TRACE_EVENT(ext4_da_update_reserve_space,
858 TP_ARGS(inode, used_blocks), 930 TP_ARGS(inode, used_blocks),
859 931
860 TP_STRUCT__entry( 932 TP_STRUCT__entry(
861 __field( dev_t, dev ) 933 __field( int, dev_major )
934 __field( int, dev_minor )
862 __field( ino_t, ino ) 935 __field( ino_t, ino )
863 __field( umode_t, mode ) 936 __field( umode_t, mode )
864 __field( __u64, i_blocks ) 937 __field( __u64, i_blocks )
@@ -869,7 +942,8 @@ TRACE_EVENT(ext4_da_update_reserve_space,
869 ), 942 ),
870 943
871 TP_fast_assign( 944 TP_fast_assign(
872 __entry->dev = inode->i_sb->s_dev; 945 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
946 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
873 __entry->ino = inode->i_ino; 947 __entry->ino = inode->i_ino;
874 __entry->mode = inode->i_mode; 948 __entry->mode = inode->i_mode;
875 __entry->i_blocks = inode->i_blocks; 949 __entry->i_blocks = inode->i_blocks;
@@ -879,9 +953,10 @@ TRACE_EVENT(ext4_da_update_reserve_space,
879 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 953 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
880 ), 954 ),
881 955
882 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 956 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
883 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 957 __entry->dev_major, __entry->dev_minor,
884 __entry->mode, (unsigned long long) __entry->i_blocks, 958 (unsigned long) __entry->ino, __entry->mode,
959 (unsigned long long) __entry->i_blocks,
885 __entry->used_blocks, __entry->reserved_data_blocks, 960 __entry->used_blocks, __entry->reserved_data_blocks,
886 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 961 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
887); 962);
@@ -892,7 +967,8 @@ TRACE_EVENT(ext4_da_reserve_space,
892 TP_ARGS(inode, md_needed), 967 TP_ARGS(inode, md_needed),
893 968
894 TP_STRUCT__entry( 969 TP_STRUCT__entry(
895 __field( dev_t, dev ) 970 __field( int, dev_major )
971 __field( int, dev_minor )
896 __field( ino_t, ino ) 972 __field( ino_t, ino )
897 __field( umode_t, mode ) 973 __field( umode_t, mode )
898 __field( __u64, i_blocks ) 974 __field( __u64, i_blocks )
@@ -902,7 +978,8 @@ TRACE_EVENT(ext4_da_reserve_space,
902 ), 978 ),
903 979
904 TP_fast_assign( 980 TP_fast_assign(
905 __entry->dev = inode->i_sb->s_dev; 981 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
982 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
906 __entry->ino = inode->i_ino; 983 __entry->ino = inode->i_ino;
907 __entry->mode = inode->i_mode; 984 __entry->mode = inode->i_mode;
908 __entry->i_blocks = inode->i_blocks; 985 __entry->i_blocks = inode->i_blocks;
@@ -911,8 +988,9 @@ TRACE_EVENT(ext4_da_reserve_space,
911 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 988 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
912 ), 989 ),
913 990
914 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d", 991 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d",
915 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 992 __entry->dev_major, __entry->dev_minor,
993 (unsigned long) __entry->ino,
916 __entry->mode, (unsigned long long) __entry->i_blocks, 994 __entry->mode, (unsigned long long) __entry->i_blocks,
917 __entry->md_needed, __entry->reserved_data_blocks, 995 __entry->md_needed, __entry->reserved_data_blocks,
918 __entry->reserved_meta_blocks) 996 __entry->reserved_meta_blocks)
@@ -924,7 +1002,8 @@ TRACE_EVENT(ext4_da_release_space,
924 TP_ARGS(inode, freed_blocks), 1002 TP_ARGS(inode, freed_blocks),
925 1003
926 TP_STRUCT__entry( 1004 TP_STRUCT__entry(
927 __field( dev_t, dev ) 1005 __field( int, dev_major )
1006 __field( int, dev_minor )
928 __field( ino_t, ino ) 1007 __field( ino_t, ino )
929 __field( umode_t, mode ) 1008 __field( umode_t, mode )
930 __field( __u64, i_blocks ) 1009 __field( __u64, i_blocks )
@@ -935,7 +1014,8 @@ TRACE_EVENT(ext4_da_release_space,
935 ), 1014 ),
936 1015
937 TP_fast_assign( 1016 TP_fast_assign(
938 __entry->dev = inode->i_sb->s_dev; 1017 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1018 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
939 __entry->ino = inode->i_ino; 1019 __entry->ino = inode->i_ino;
940 __entry->mode = inode->i_mode; 1020 __entry->mode = inode->i_mode;
941 __entry->i_blocks = inode->i_blocks; 1021 __entry->i_blocks = inode->i_blocks;
@@ -945,8 +1025,9 @@ TRACE_EVENT(ext4_da_release_space,
945 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1025 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
946 ), 1026 ),
947 1027
948 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1028 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
949 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1029 __entry->dev_major, __entry->dev_minor,
1030 (unsigned long) __entry->ino,
950 __entry->mode, (unsigned long long) __entry->i_blocks, 1031 __entry->mode, (unsigned long long) __entry->i_blocks,
951 __entry->freed_blocks, __entry->reserved_data_blocks, 1032 __entry->freed_blocks, __entry->reserved_data_blocks,
952 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1033 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
@@ -958,18 +1039,20 @@ DECLARE_EVENT_CLASS(ext4__bitmap_load,
958 TP_ARGS(sb, group), 1039 TP_ARGS(sb, group),
959 1040
960 TP_STRUCT__entry( 1041 TP_STRUCT__entry(
961 __field( dev_t, dev ) 1042 __field( int, dev_major )
1043 __field( int, dev_minor )
962 __field( __u32, group ) 1044 __field( __u32, group )
963 1045
964 ), 1046 ),
965 1047
966 TP_fast_assign( 1048 TP_fast_assign(
967 __entry->dev = sb->s_dev; 1049 __entry->dev_major = MAJOR(sb->s_dev);
1050 __entry->dev_minor = MINOR(sb->s_dev);
968 __entry->group = group; 1051 __entry->group = group;
969 ), 1052 ),
970 1053
971 TP_printk("dev %s group %u", 1054 TP_printk("dev %d,%d group %u",
972 jbd2_dev_to_name(__entry->dev), __entry->group) 1055 __entry->dev_major, __entry->dev_minor, __entry->group)
973); 1056);
974 1057
975DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, 1058DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index bf16545cc977..7447ea9305b5 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -17,17 +17,19 @@ TRACE_EVENT(jbd2_checkpoint,
17 TP_ARGS(journal, result), 17 TP_ARGS(journal, result),
18 18
19 TP_STRUCT__entry( 19 TP_STRUCT__entry(
20 __field( dev_t, dev ) 20 __field( int, dev_major )
21 __field( int, dev_minor )
21 __field( int, result ) 22 __field( int, result )
22 ), 23 ),
23 24
24 TP_fast_assign( 25 TP_fast_assign(
25 __entry->dev = journal->j_fs_dev->bd_dev; 26 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
27 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
26 __entry->result = result; 28 __entry->result = result;
27 ), 29 ),
28 30
29 TP_printk("dev %s result %d", 31 TP_printk("dev %d,%d result %d",
30 jbd2_dev_to_name(__entry->dev), __entry->result) 32 __entry->dev_major, __entry->dev_minor, __entry->result)
31); 33);
32 34
33DECLARE_EVENT_CLASS(jbd2_commit, 35DECLARE_EVENT_CLASS(jbd2_commit,
@@ -37,20 +39,22 @@ DECLARE_EVENT_CLASS(jbd2_commit,
37 TP_ARGS(journal, commit_transaction), 39 TP_ARGS(journal, commit_transaction),
38 40
39 TP_STRUCT__entry( 41 TP_STRUCT__entry(
40 __field( dev_t, dev ) 42 __field( int, dev_major )
43 __field( int, dev_minor )
41 __field( char, sync_commit ) 44 __field( char, sync_commit )
42 __field( int, transaction ) 45 __field( int, transaction )
43 ), 46 ),
44 47
45 TP_fast_assign( 48 TP_fast_assign(
46 __entry->dev = journal->j_fs_dev->bd_dev; 49 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
50 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
47 __entry->sync_commit = commit_transaction->t_synchronous_commit; 51 __entry->sync_commit = commit_transaction->t_synchronous_commit;
48 __entry->transaction = commit_transaction->t_tid; 52 __entry->transaction = commit_transaction->t_tid;
49 ), 53 ),
50 54
51 TP_printk("dev %s transaction %d sync %d", 55 TP_printk("dev %d,%d transaction %d sync %d",
52 jbd2_dev_to_name(__entry->dev), __entry->transaction, 56 __entry->dev_major, __entry->dev_minor,
53 __entry->sync_commit) 57 __entry->transaction, __entry->sync_commit)
54); 58);
55 59
56DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 60DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
@@ -87,22 +91,24 @@ TRACE_EVENT(jbd2_end_commit,
87 TP_ARGS(journal, commit_transaction), 91 TP_ARGS(journal, commit_transaction),
88 92
89 TP_STRUCT__entry( 93 TP_STRUCT__entry(
90 __field( dev_t, dev ) 94 __field( int, dev_major )
95 __field( int, dev_minor )
91 __field( char, sync_commit ) 96 __field( char, sync_commit )
92 __field( int, transaction ) 97 __field( int, transaction )
93 __field( int, head ) 98 __field( int, head )
94 ), 99 ),
95 100
96 TP_fast_assign( 101 TP_fast_assign(
97 __entry->dev = journal->j_fs_dev->bd_dev; 102 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
103 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
98 __entry->sync_commit = commit_transaction->t_synchronous_commit; 104 __entry->sync_commit = commit_transaction->t_synchronous_commit;
99 __entry->transaction = commit_transaction->t_tid; 105 __entry->transaction = commit_transaction->t_tid;
100 __entry->head = journal->j_tail_sequence; 106 __entry->head = journal->j_tail_sequence;
101 ), 107 ),
102 108
103 TP_printk("dev %s transaction %d sync %d head %d", 109 TP_printk("dev %d,%d transaction %d sync %d head %d",
104 jbd2_dev_to_name(__entry->dev), __entry->transaction, 110 __entry->dev_major, __entry->dev_minor,
105 __entry->sync_commit, __entry->head) 111 __entry->transaction, __entry->sync_commit, __entry->head)
106); 112);
107 113
108TRACE_EVENT(jbd2_submit_inode_data, 114TRACE_EVENT(jbd2_submit_inode_data,
@@ -111,17 +117,20 @@ TRACE_EVENT(jbd2_submit_inode_data,
111 TP_ARGS(inode), 117 TP_ARGS(inode),
112 118
113 TP_STRUCT__entry( 119 TP_STRUCT__entry(
114 __field( dev_t, dev ) 120 __field( int, dev_major )
121 __field( int, dev_minor )
115 __field( ino_t, ino ) 122 __field( ino_t, ino )
116 ), 123 ),
117 124
118 TP_fast_assign( 125 TP_fast_assign(
119 __entry->dev = inode->i_sb->s_dev; 126 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
127 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
120 __entry->ino = inode->i_ino; 128 __entry->ino = inode->i_ino;
121 ), 129 ),
122 130
123 TP_printk("dev %s ino %lu", 131 TP_printk("dev %d,%d ino %lu",
124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 132 __entry->dev_major, __entry->dev_minor,
133 (unsigned long) __entry->ino)
125); 134);
126 135
127TRACE_EVENT(jbd2_run_stats, 136TRACE_EVENT(jbd2_run_stats,
@@ -131,7 +140,8 @@ TRACE_EVENT(jbd2_run_stats,
131 TP_ARGS(dev, tid, stats), 140 TP_ARGS(dev, tid, stats),
132 141
133 TP_STRUCT__entry( 142 TP_STRUCT__entry(
134 __field( dev_t, dev ) 143 __field( int, dev_major )
144 __field( int, dev_minor )
135 __field( unsigned long, tid ) 145 __field( unsigned long, tid )
136 __field( unsigned long, wait ) 146 __field( unsigned long, wait )
137 __field( unsigned long, running ) 147 __field( unsigned long, running )
@@ -144,7 +154,8 @@ TRACE_EVENT(jbd2_run_stats,
144 ), 154 ),
145 155
146 TP_fast_assign( 156 TP_fast_assign(
147 __entry->dev = dev; 157 __entry->dev_major = MAJOR(dev);
158 __entry->dev_minor = MINOR(dev);
148 __entry->tid = tid; 159 __entry->tid = tid;
149 __entry->wait = stats->rs_wait; 160 __entry->wait = stats->rs_wait;
150 __entry->running = stats->rs_running; 161 __entry->running = stats->rs_running;
@@ -156,9 +167,9 @@ TRACE_EVENT(jbd2_run_stats,
156 __entry->blocks_logged = stats->rs_blocks_logged; 167 __entry->blocks_logged = stats->rs_blocks_logged;
157 ), 168 ),
158 169
159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " 170 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
160 "logging %u handle_count %u blocks %u blocks_logged %u", 171 "logging %u handle_count %u blocks %u blocks_logged %u",
161 jbd2_dev_to_name(__entry->dev), __entry->tid, 172 __entry->dev_major, __entry->dev_minor, __entry->tid,
162 jiffies_to_msecs(__entry->wait), 173 jiffies_to_msecs(__entry->wait),
163 jiffies_to_msecs(__entry->running), 174 jiffies_to_msecs(__entry->running),
164 jiffies_to_msecs(__entry->locked), 175 jiffies_to_msecs(__entry->locked),
@@ -175,7 +186,8 @@ TRACE_EVENT(jbd2_checkpoint_stats,
175 TP_ARGS(dev, tid, stats), 186 TP_ARGS(dev, tid, stats),
176 187
177 TP_STRUCT__entry( 188 TP_STRUCT__entry(
178 __field( dev_t, dev ) 189 __field( int, dev_major )
190 __field( int, dev_minor )
179 __field( unsigned long, tid ) 191 __field( unsigned long, tid )
180 __field( unsigned long, chp_time ) 192 __field( unsigned long, chp_time )
181 __field( __u32, forced_to_close ) 193 __field( __u32, forced_to_close )
@@ -184,7 +196,8 @@ TRACE_EVENT(jbd2_checkpoint_stats,
184 ), 196 ),
185 197
186 TP_fast_assign( 198 TP_fast_assign(
187 __entry->dev = dev; 199 __entry->dev_major = MAJOR(dev);
200 __entry->dev_minor = MINOR(dev);
188 __entry->tid = tid; 201 __entry->tid = tid;
189 __entry->chp_time = stats->cs_chp_time; 202 __entry->chp_time = stats->cs_chp_time;
190 __entry->forced_to_close= stats->cs_forced_to_close; 203 __entry->forced_to_close= stats->cs_forced_to_close;
@@ -192,9 +205,9 @@ TRACE_EVENT(jbd2_checkpoint_stats,
192 __entry->dropped = stats->cs_dropped; 205 __entry->dropped = stats->cs_dropped;
193 ), 206 ),
194 207
195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " 208 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
196 "written %u dropped %u", 209 "written %u dropped %u",
197 jbd2_dev_to_name(__entry->dev), __entry->tid, 210 __entry->dev_major, __entry->dev_minor, __entry->tid,
198 jiffies_to_msecs(__entry->chp_time), 211 jiffies_to_msecs(__entry->chp_time),
199 __entry->forced_to_close, __entry->written, __entry->dropped) 212 __entry->forced_to_close, __entry->written, __entry->dropped)
200); 213);
@@ -207,7 +220,8 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
207 TP_ARGS(journal, first_tid, block_nr, freed), 220 TP_ARGS(journal, first_tid, block_nr, freed),
208 221
209 TP_STRUCT__entry( 222 TP_STRUCT__entry(
210 __field( dev_t, dev ) 223 __field( int, dev_major )
224 __field( int, dev_minor )
211 __field( tid_t, tail_sequence ) 225 __field( tid_t, tail_sequence )
212 __field( tid_t, first_tid ) 226 __field( tid_t, first_tid )
213 __field(unsigned long, block_nr ) 227 __field(unsigned long, block_nr )
@@ -215,16 +229,18 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
215 ), 229 ),
216 230
217 TP_fast_assign( 231 TP_fast_assign(
218 __entry->dev = journal->j_fs_dev->bd_dev; 232 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
233 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
219 __entry->tail_sequence = journal->j_tail_sequence; 234 __entry->tail_sequence = journal->j_tail_sequence;
220 __entry->first_tid = first_tid; 235 __entry->first_tid = first_tid;
221 __entry->block_nr = block_nr; 236 __entry->block_nr = block_nr;
222 __entry->freed = freed; 237 __entry->freed = freed;
223 ), 238 ),
224 239
225 TP_printk("dev %s from %u to %u offset %lu freed %lu", 240 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence, 241 __entry->dev_major, __entry->dev_minor,
227 __entry->first_tid, __entry->block_nr, __entry->freed) 242 __entry->tail_sequence, __entry->first_tid,
243 __entry->block_nr, __entry->freed)
228); 244);
229 245
230#endif /* _TRACE_JBD2_H */ 246#endif /* _TRACE_JBD2_H */
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index 55d700e8566e..daabae5817c6 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -49,7 +49,9 @@ struct sh_mobile_lcdc_sys_bus_ops {
49 unsigned long (*read_data)(void *handle); 49 unsigned long (*read_data)(void *handle);
50}; 50};
51 51
52struct module;
52struct sh_mobile_lcdc_board_cfg { 53struct sh_mobile_lcdc_board_cfg {
54 struct module *owner;
53 void *board_data; 55 void *board_data;
54 int (*setup_sys)(void *board_data, void *sys_ops_handle, 56 int (*setup_sys)(void *board_data, void *sys_ops_handle,
55 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 57 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
@@ -70,7 +72,8 @@ struct sh_mobile_lcdc_chan_cfg {
70 int interface_type; /* selects RGBn or SYSn I/F, see above */ 72 int interface_type; /* selects RGBn or SYSn I/F, see above */
71 int clock_divider; 73 int clock_divider;
72 unsigned long flags; /* LCDC_FLAGS_... */ 74 unsigned long flags; /* LCDC_FLAGS_... */
73 struct fb_videomode lcd_cfg; 75 const struct fb_videomode *lcd_cfg;
76 int num_cfg;
74 struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; 77 struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
75 struct sh_mobile_lcdc_board_cfg board_cfg; 78 struct sh_mobile_lcdc_board_cfg board_cfg;
76 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 79 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
diff --git a/include/xen/events.h b/include/xen/events.h
index a15d93262e30..646dd17d3aa4 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -12,6 +12,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
12 irq_handler_t handler, 12 irq_handler_t handler,
13 unsigned long irqflags, const char *devname, 13 unsigned long irqflags, const char *devname,
14 void *dev_id); 14 void *dev_id);
15int bind_virq_to_irq(unsigned int virq, unsigned int cpu);
15int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, 16int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
16 irq_handler_t handler, 17 irq_handler_t handler,
17 unsigned long irqflags, const char *devname, 18 unsigned long irqflags, const char *devname,
@@ -53,6 +54,10 @@ bool xen_test_irq_pending(int irq);
53 irq will be disabled so it won't deliver an interrupt. */ 54 irq will be disabled so it won't deliver an interrupt. */
54void xen_poll_irq(int irq); 55void xen_poll_irq(int irq);
55 56
57/* Poll waiting for an irq to become pending with a timeout. In the usual case,
58 * the irq will be disabled so it won't deliver an interrupt. */
59void xen_poll_irq_timeout(int irq, u64 timeout);
60
56/* Determine the IRQ which is bound to an event channel */ 61/* Determine the IRQ which is bound to an event channel */
57unsigned irq_from_evtchn(unsigned int evtchn); 62unsigned irq_from_evtchn(unsigned int evtchn);
58 63
@@ -63,4 +68,25 @@ int xen_set_callback_via(uint64_t via);
63void xen_evtchn_do_upcall(struct pt_regs *regs); 68void xen_evtchn_do_upcall(struct pt_regs *regs);
64void xen_hvm_evtchn_do_upcall(void); 69void xen_hvm_evtchn_do_upcall(void);
65 70
71/* Allocate an irq for a physical interrupt, given a gsi. "Legacy"
72 * GSIs are identity mapped; others are dynamically allocated as
73 * usual. */
74int xen_allocate_pirq(unsigned gsi, int shareable, char *name);
75int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name);
76
77#ifdef CONFIG_PCI_MSI
78/* Allocate an irq and a pirq to be used with MSIs. */
79void xen_allocate_pirq_msi(char *name, int *irq, int *pirq);
80int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type);
81#endif
82
83/* De-allocates the above mentioned physical interrupt. */
84int xen_destroy_irq(int irq);
85
86/* Return vector allocated to pirq */
87int xen_vector_from_irq(unsigned pirq);
88
89/* Return gsi allocated to pirq */
90int xen_gsi_from_irq(unsigned pirq);
91
66#endif /* _XEN_EVENTS_H */ 92#endif /* _XEN_EVENTS_H */
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
index 70d2563ab166..b6ca39a069d8 100644
--- a/include/xen/interface/features.h
+++ b/include/xen/interface/features.h
@@ -47,6 +47,9 @@
47/* x86: pvclock algorithm is safe to use on HVM */ 47/* x86: pvclock algorithm is safe to use on HVM */
48#define XENFEAT_hvm_safe_pvclock 9 48#define XENFEAT_hvm_safe_pvclock 9
49 49
50/* x86: pirq can be used by HVM guests */
51#define XENFEAT_hvm_pirqs 10
52
50#define XENFEAT_NR_SUBMAPS 1 53#define XENFEAT_NR_SUBMAPS 1
51 54
52#endif /* __XEN_PUBLIC_FEATURES_H__ */ 55#endif /* __XEN_PUBLIC_FEATURES_H__ */
diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h
new file mode 100644
index 000000000000..d9922ae36eb5
--- /dev/null
+++ b/include/xen/interface/io/pciif.h
@@ -0,0 +1,112 @@
1/*
2 * PCI Backend/Frontend Common Data Structures & Macros
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 *
22 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
23 */
24#ifndef __XEN_PCI_COMMON_H__
25#define __XEN_PCI_COMMON_H__
26
27/* Be sure to bump this number if you change this file */
28#define XEN_PCI_MAGIC "7"
29
30/* xen_pci_sharedinfo flags */
31#define _XEN_PCIF_active (0)
32#define XEN_PCIF_active (1<<_XEN_PCIF_active)
33#define _XEN_PCIB_AERHANDLER (1)
34#define XEN_PCIB_AERHANDLER (1<<_XEN_PCIB_AERHANDLER)
35#define _XEN_PCIB_active (2)
36#define XEN_PCIB_active (1<<_XEN_PCIB_active)
37
38/* xen_pci_op commands */
39#define XEN_PCI_OP_conf_read (0)
40#define XEN_PCI_OP_conf_write (1)
41#define XEN_PCI_OP_enable_msi (2)
42#define XEN_PCI_OP_disable_msi (3)
43#define XEN_PCI_OP_enable_msix (4)
44#define XEN_PCI_OP_disable_msix (5)
45#define XEN_PCI_OP_aer_detected (6)
46#define XEN_PCI_OP_aer_resume (7)
47#define XEN_PCI_OP_aer_mmio (8)
48#define XEN_PCI_OP_aer_slotreset (9)
49
50/* xen_pci_op error numbers */
51#define XEN_PCI_ERR_success (0)
52#define XEN_PCI_ERR_dev_not_found (-1)
53#define XEN_PCI_ERR_invalid_offset (-2)
54#define XEN_PCI_ERR_access_denied (-3)
55#define XEN_PCI_ERR_not_implemented (-4)
56/* XEN_PCI_ERR_op_failed - backend failed to complete the operation */
57#define XEN_PCI_ERR_op_failed (-5)
58
59/*
60 * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry))
61 * Should not exceed 128
62 */
63#define SH_INFO_MAX_VEC 128
64
65struct xen_msix_entry {
66 uint16_t vector;
67 uint16_t entry;
68};
69struct xen_pci_op {
70 /* IN: what action to perform: XEN_PCI_OP_* */
71 uint32_t cmd;
72
73 /* OUT: will contain an error number (if any) from errno.h */
74 int32_t err;
75
76 /* IN: which device to touch */
77 uint32_t domain; /* PCI Domain/Segment */
78 uint32_t bus;
79 uint32_t devfn;
80
81 /* IN: which configuration registers to touch */
82 int32_t offset;
83 int32_t size;
84
85 /* IN/OUT: Contains the result after a READ or the value to WRITE */
86 uint32_t value;
87 /* IN: Contains extra infor for this operation */
88 uint32_t info;
89 /*IN: param for msi-x */
90 struct xen_msix_entry msix_entries[SH_INFO_MAX_VEC];
91};
92
93/*used for pcie aer handling*/
94struct xen_pcie_aer_op {
95 /* IN: what action to perform: XEN_PCI_OP_* */
96 uint32_t cmd;
97 /*IN/OUT: return aer_op result or carry error_detected state as input*/
98 int32_t err;
99
100 /* IN: which device to touch */
101 uint32_t domain; /* PCI Domain/Segment*/
102 uint32_t bus;
103 uint32_t devfn;
104};
105struct xen_pci_sharedinfo {
106 /* flags - XEN_PCIF_* */
107 uint32_t flags;
108 struct xen_pci_op op;
109 struct xen_pcie_aer_op aer_op;
110};
111
112#endif /* __XEN_PCI_COMMON_H__ */
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h
index 46508c7fa399..9fda532973a5 100644
--- a/include/xen/interface/io/xenbus.h
+++ b/include/xen/interface/io/xenbus.h
@@ -27,8 +27,14 @@ enum xenbus_state
27 XenbusStateClosing = 5, /* The device is being closed 27 XenbusStateClosing = 5, /* The device is being closed
28 due to an error or an unplug 28 due to an error or an unplug
29 event. */ 29 event. */
30 XenbusStateClosed = 6 30 XenbusStateClosed = 6,
31 31
32 /*
33 * Reconfiguring: The device is being reconfigured.
34 */
35 XenbusStateReconfiguring = 7,
36
37 XenbusStateReconfigured = 8
32}; 38};
33 39
34#endif /* _XEN_PUBLIC_IO_XENBUS_H */ 40#endif /* _XEN_PUBLIC_IO_XENBUS_H */
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index cd6939147cb6..2b2c66c3df00 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -106,6 +106,57 @@ struct physdev_irq {
106 uint32_t vector; 106 uint32_t vector;
107}; 107};
108 108
109#define MAP_PIRQ_TYPE_MSI 0x0
110#define MAP_PIRQ_TYPE_GSI 0x1
111#define MAP_PIRQ_TYPE_UNKNOWN 0x2
112
113#define PHYSDEVOP_map_pirq 13
114struct physdev_map_pirq {
115 domid_t domid;
116 /* IN */
117 int type;
118 /* IN */
119 int index;
120 /* IN or OUT */
121 int pirq;
122 /* IN */
123 int bus;
124 /* IN */
125 int devfn;
126 /* IN */
127 int entry_nr;
128 /* IN */
129 uint64_t table_base;
130};
131
132#define PHYSDEVOP_unmap_pirq 14
133struct physdev_unmap_pirq {
134 domid_t domid;
135 /* IN */
136 int pirq;
137};
138
139#define PHYSDEVOP_manage_pci_add 15
140#define PHYSDEVOP_manage_pci_remove 16
141struct physdev_manage_pci {
142 /* IN */
143 uint8_t bus;
144 uint8_t devfn;
145};
146
147#define PHYSDEVOP_manage_pci_add_ext 20
148struct physdev_manage_pci_ext {
149 /* IN */
150 uint8_t bus;
151 uint8_t devfn;
152 unsigned is_extfn;
153 unsigned is_virtfn;
154 struct {
155 uint8_t bus;
156 uint8_t devfn;
157 } physfn;
158};
159
109/* 160/*
110 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() 161 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
111 * hypercall since 0x00030202. 162 * hypercall since 0x00030202.
@@ -121,6 +172,22 @@ struct physdev_op {
121 } u; 172 } u;
122}; 173};
123 174
175#define PHYSDEVOP_setup_gsi 21
176struct physdev_setup_gsi {
177 int gsi;
178 /* IN */
179 uint8_t triggering;
180 /* IN */
181 uint8_t polarity;
182 /* IN */
183};
184
185#define PHYSDEVOP_get_nr_pirqs 22
186struct physdev_nr_pirqs {
187 /* OUT */
188 uint32_t nr_pirqs;
189};
190
124/* 191/*
125 * Notify that some PIRQ-bound event channels have been unmasked. 192 * Notify that some PIRQ-bound event channels have been unmasked.
126 * ** This command is obsolete since interface version 0x00030202 and is ** 193 * ** This command is obsolete since interface version 0x00030202 and is **