diff options
Diffstat (limited to 'include/linux')
212 files changed, 10804 insertions, 1821 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b68ec09399be..bf9aca548f14 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -107,6 +107,7 @@ header-y += keyctl.h | |||
107 | header-y += limits.h | 107 | header-y += limits.h |
108 | header-y += magic.h | 108 | header-y += magic.h |
109 | header-y += major.h | 109 | header-y += major.h |
110 | header-y += map_to_7segment.h | ||
110 | header-y += matroxfb.h | 111 | header-y += matroxfb.h |
111 | header-y += meye.h | 112 | header-y += meye.h |
112 | header-y += minix_fs.h | 113 | header-y += minix_fs.h |
@@ -126,6 +127,7 @@ header-y += pci_regs.h | |||
126 | header-y += pfkeyv2.h | 127 | header-y += pfkeyv2.h |
127 | header-y += pg.h | 128 | header-y += pg.h |
128 | header-y += phantom.h | 129 | header-y += phantom.h |
130 | header-y += phonet.h | ||
129 | header-y += pkt_cls.h | 131 | header-y += pkt_cls.h |
130 | header-y += pkt_sched.h | 132 | header-y += pkt_sched.h |
131 | header-y += posix_types.h | 133 | header-y += posix_types.h |
@@ -180,6 +182,7 @@ unifdef-y += audit.h | |||
180 | unifdef-y += auto_fs.h | 182 | unifdef-y += auto_fs.h |
181 | unifdef-y += auxvec.h | 183 | unifdef-y += auxvec.h |
182 | unifdef-y += binfmts.h | 184 | unifdef-y += binfmts.h |
185 | unifdef-y += blktrace_api.h | ||
183 | unifdef-y += capability.h | 186 | unifdef-y += capability.h |
184 | unifdef-y += capi.h | 187 | unifdef-y += capi.h |
185 | unifdef-y += cciss_ioctl.h | 188 | unifdef-y += cciss_ioctl.h |
@@ -232,6 +235,7 @@ unifdef-y += if_fddi.h | |||
232 | unifdef-y += if_frad.h | 235 | unifdef-y += if_frad.h |
233 | unifdef-y += if_ltalk.h | 236 | unifdef-y += if_ltalk.h |
234 | unifdef-y += if_link.h | 237 | unifdef-y += if_link.h |
238 | unifdef-y += if_phonet.h | ||
235 | unifdef-y += if_pppol2tp.h | 239 | unifdef-y += if_pppol2tp.h |
236 | unifdef-y += if_pppox.h | 240 | unifdef-y += if_pppox.h |
237 | unifdef-y += if_tr.h | 241 | unifdef-y += if_tr.h |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 09b276c35227..f6b8cf99b596 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -204,12 +204,21 @@ struct kioctx { | |||
204 | /* prototypes */ | 204 | /* prototypes */ |
205 | extern unsigned aio_max_size; | 205 | extern unsigned aio_max_size; |
206 | 206 | ||
207 | #ifdef CONFIG_AIO | ||
207 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); | 208 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); |
208 | extern int aio_put_req(struct kiocb *iocb); | 209 | extern int aio_put_req(struct kiocb *iocb); |
209 | extern void kick_iocb(struct kiocb *iocb); | 210 | extern void kick_iocb(struct kiocb *iocb); |
210 | extern int aio_complete(struct kiocb *iocb, long res, long res2); | 211 | extern int aio_complete(struct kiocb *iocb, long res, long res2); |
211 | struct mm_struct; | 212 | struct mm_struct; |
212 | extern void exit_aio(struct mm_struct *mm); | 213 | extern void exit_aio(struct mm_struct *mm); |
214 | #else | ||
215 | static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } | ||
216 | static inline int aio_put_req(struct kiocb *iocb) { return 0; } | ||
217 | static inline void kick_iocb(struct kiocb *iocb) { } | ||
218 | static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; } | ||
219 | struct mm_struct; | ||
220 | static inline void exit_aio(struct mm_struct *mm) { } | ||
221 | #endif /* CONFIG_AIO */ | ||
213 | 222 | ||
214 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) | 223 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) |
215 | 224 | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 1ce19c1ef0e9..a53318b8cbd0 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #define __LINUX_ATA_H__ | 30 | #define __LINUX_ATA_H__ |
31 | 31 | ||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <asm/byteorder.h> | ||
33 | 34 | ||
34 | /* defines only for the constants which don't work well as enums */ | 35 | /* defines only for the constants which don't work well as enums */ |
35 | #define ATA_DMA_BOUNDARY 0xffffUL | 36 | #define ATA_DMA_BOUNDARY 0xffffUL |
@@ -88,6 +89,7 @@ enum { | |||
88 | ATA_ID_DLF = 128, | 89 | ATA_ID_DLF = 128, |
89 | ATA_ID_CSFO = 129, | 90 | ATA_ID_CSFO = 129, |
90 | ATA_ID_CFA_POWER = 160, | 91 | ATA_ID_CFA_POWER = 160, |
92 | ATA_ID_ROT_SPEED = 217, | ||
91 | ATA_ID_PIO4 = (1 << 1), | 93 | ATA_ID_PIO4 = (1 << 1), |
92 | 94 | ||
93 | ATA_ID_SERNO_LEN = 20, | 95 | ATA_ID_SERNO_LEN = 20, |
@@ -557,6 +559,15 @@ static inline int ata_id_has_flush(const u16 *id) | |||
557 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); | 559 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); |
558 | } | 560 | } |
559 | 561 | ||
562 | static inline int ata_id_flush_enabled(const u16 *id) | ||
563 | { | ||
564 | if (ata_id_has_flush(id) == 0) | ||
565 | return 0; | ||
566 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
567 | return 0; | ||
568 | return id[ATA_ID_CFS_ENABLE_2] & (1 << 12); | ||
569 | } | ||
570 | |||
560 | static inline int ata_id_has_flush_ext(const u16 *id) | 571 | static inline int ata_id_has_flush_ext(const u16 *id) |
561 | { | 572 | { |
562 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) | 573 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
@@ -564,6 +575,19 @@ static inline int ata_id_has_flush_ext(const u16 *id) | |||
564 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); | 575 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); |
565 | } | 576 | } |
566 | 577 | ||
578 | static inline int ata_id_flush_ext_enabled(const u16 *id) | ||
579 | { | ||
580 | if (ata_id_has_flush_ext(id) == 0) | ||
581 | return 0; | ||
582 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
583 | return 0; | ||
584 | /* | ||
585 | * some Maxtor disks have bit 13 defined incorrectly | ||
586 | * so check bit 10 too | ||
587 | */ | ||
588 | return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; | ||
589 | } | ||
590 | |||
567 | static inline int ata_id_has_lba48(const u16 *id) | 591 | static inline int ata_id_has_lba48(const u16 *id) |
568 | { | 592 | { |
569 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) | 593 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
@@ -573,6 +597,15 @@ static inline int ata_id_has_lba48(const u16 *id) | |||
573 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); | 597 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); |
574 | } | 598 | } |
575 | 599 | ||
600 | static inline int ata_id_lba48_enabled(const u16 *id) | ||
601 | { | ||
602 | if (ata_id_has_lba48(id) == 0) | ||
603 | return 0; | ||
604 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
605 | return 0; | ||
606 | return id[ATA_ID_CFS_ENABLE_2] & (1 << 10); | ||
607 | } | ||
608 | |||
576 | static inline int ata_id_hpa_enabled(const u16 *id) | 609 | static inline int ata_id_hpa_enabled(const u16 *id) |
577 | { | 610 | { |
578 | /* Yes children, word 83 valid bits cover word 82 data */ | 611 | /* Yes children, word 83 valid bits cover word 82 data */ |
@@ -644,7 +677,15 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
644 | 677 | ||
645 | static inline int ata_id_is_sata(const u16 *id) | 678 | static inline int ata_id_is_sata(const u16 *id) |
646 | { | 679 | { |
647 | return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; | 680 | /* |
681 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
682 | * verifying that word 80 by casting it to a signed type -- | ||
683 | * this trick allows us to filter out the reserved values of | ||
684 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
685 | */ | ||
686 | if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020) | ||
687 | return 1; | ||
688 | return 0; | ||
648 | } | 689 | } |
649 | 690 | ||
650 | static inline int ata_id_has_tpm(const u16 *id) | 691 | static inline int ata_id_has_tpm(const u16 *id) |
@@ -667,6 +708,15 @@ static inline int ata_id_has_dword_io(const u16 *id) | |||
667 | return 0; | 708 | return 0; |
668 | } | 709 | } |
669 | 710 | ||
711 | static inline int ata_id_has_unload(const u16 *id) | ||
712 | { | ||
713 | if (ata_id_major_version(id) >= 7 && | ||
714 | (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 && | ||
715 | id[ATA_ID_CFSSE] & (1 << 13)) | ||
716 | return 1; | ||
717 | return 0; | ||
718 | } | ||
719 | |||
670 | static inline int ata_id_current_chs_valid(const u16 *id) | 720 | static inline int ata_id_current_chs_valid(const u16 *id) |
671 | { | 721 | { |
672 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 722 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -691,6 +741,11 @@ static inline int ata_id_is_cfa(const u16 *id) | |||
691 | return 0; | 741 | return 0; |
692 | } | 742 | } |
693 | 743 | ||
744 | static inline int ata_id_is_ssd(const u16 *id) | ||
745 | { | ||
746 | return id[ATA_ID_ROT_SPEED] == 0x01; | ||
747 | } | ||
748 | |||
694 | static inline int ata_drive_40wire(const u16 *dev_id) | 749 | static inline int ata_drive_40wire(const u16 *dev_id) |
695 | { | 750 | { |
696 | if (ata_id_is_sata(dev_id)) | 751 | if (ata_id_is_sata(dev_id)) |
@@ -727,6 +782,76 @@ static inline int atapi_id_dmadir(const u16 *dev_id) | |||
727 | return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000); | 782 | return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000); |
728 | } | 783 | } |
729 | 784 | ||
785 | /* | ||
786 | * ata_id_is_lba_capacity_ok() performs a sanity check on | ||
787 | * the claimed LBA capacity value for the device. | ||
788 | * | ||
789 | * Returns 1 if LBA capacity looks sensible, 0 otherwise. | ||
790 | * | ||
791 | * It is called only once for each device. | ||
792 | */ | ||
793 | static inline int ata_id_is_lba_capacity_ok(u16 *id) | ||
794 | { | ||
795 | unsigned long lba_sects, chs_sects, head, tail; | ||
796 | |||
797 | /* No non-LBA info .. so valid! */ | ||
798 | if (id[ATA_ID_CYLS] == 0) | ||
799 | return 1; | ||
800 | |||
801 | lba_sects = ata_id_u32(id, ATA_ID_LBA_CAPACITY); | ||
802 | |||
803 | /* | ||
804 | * The ATA spec tells large drives to return | ||
805 | * C/H/S = 16383/16/63 independent of their size. | ||
806 | * Some drives can be jumpered to use 15 heads instead of 16. | ||
807 | * Some drives can be jumpered to use 4092 cyls instead of 16383. | ||
808 | */ | ||
809 | if ((id[ATA_ID_CYLS] == 16383 || | ||
810 | (id[ATA_ID_CYLS] == 4092 && id[ATA_ID_CUR_CYLS] == 16383)) && | ||
811 | id[ATA_ID_SECTORS] == 63 && | ||
812 | (id[ATA_ID_HEADS] == 15 || id[ATA_ID_HEADS] == 16) && | ||
813 | (lba_sects >= 16383 * 63 * id[ATA_ID_HEADS])) | ||
814 | return 1; | ||
815 | |||
816 | chs_sects = id[ATA_ID_CYLS] * id[ATA_ID_HEADS] * id[ATA_ID_SECTORS]; | ||
817 | |||
818 | /* perform a rough sanity check on lba_sects: within 10% is OK */ | ||
819 | if (lba_sects - chs_sects < chs_sects/10) | ||
820 | return 1; | ||
821 | |||
822 | /* some drives have the word order reversed */ | ||
823 | head = (lba_sects >> 16) & 0xffff; | ||
824 | tail = lba_sects & 0xffff; | ||
825 | lba_sects = head | (tail << 16); | ||
826 | |||
827 | if (lba_sects - chs_sects < chs_sects/10) { | ||
828 | *(__le32 *)&id[ATA_ID_LBA_CAPACITY] = __cpu_to_le32(lba_sects); | ||
829 | return 1; /* LBA capacity is (now) good */ | ||
830 | } | ||
831 | |||
832 | return 0; /* LBA capacity value may be bad */ | ||
833 | } | ||
834 | |||
835 | static inline void ata_id_to_hd_driveid(u16 *id) | ||
836 | { | ||
837 | #ifdef __BIG_ENDIAN | ||
838 | /* accessed in struct hd_driveid as 8-bit values */ | ||
839 | id[ATA_ID_MAX_MULTSECT] = __cpu_to_le16(id[ATA_ID_MAX_MULTSECT]); | ||
840 | id[ATA_ID_CAPABILITY] = __cpu_to_le16(id[ATA_ID_CAPABILITY]); | ||
841 | id[ATA_ID_OLD_PIO_MODES] = __cpu_to_le16(id[ATA_ID_OLD_PIO_MODES]); | ||
842 | id[ATA_ID_OLD_DMA_MODES] = __cpu_to_le16(id[ATA_ID_OLD_DMA_MODES]); | ||
843 | id[ATA_ID_MULTSECT] = __cpu_to_le16(id[ATA_ID_MULTSECT]); | ||
844 | |||
845 | /* as 32-bit values */ | ||
846 | *(u32 *)&id[ATA_ID_LBA_CAPACITY] = ata_id_u32(id, ATA_ID_LBA_CAPACITY); | ||
847 | *(u32 *)&id[ATA_ID_SPG] = ata_id_u32(id, ATA_ID_SPG); | ||
848 | |||
849 | /* as 64-bit value */ | ||
850 | *(u64 *)&id[ATA_ID_LBA_CAPACITY_2] = | ||
851 | ata_id_u64(id, ATA_ID_LBA_CAPACITY_2); | ||
852 | #endif | ||
853 | } | ||
854 | |||
730 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | 855 | static inline int is_multi_taskfile(struct ata_taskfile *tf) |
731 | { | 856 | { |
732 | return (tf->command == ATA_CMD_READ_MULTI) || | 857 | return (tf->command == ATA_CMD_READ_MULTI) || |
@@ -745,7 +870,7 @@ static inline int ata_ok(u8 status) | |||
745 | static inline int lba_28_ok(u64 block, u32 n_block) | 870 | static inline int lba_28_ok(u64 block, u32 n_block) |
746 | { | 871 | { |
747 | /* check the ending block number */ | 872 | /* check the ending block number */ |
748 | return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); | 873 | return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); |
749 | } | 874 | } |
750 | 875 | ||
751 | static inline int lba_48_ok(u64 block, u32 n_block) | 876 | static inline int lba_48_ok(u64 block, u32 n_block) |
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h new file mode 100644 index 000000000000..f4d05ccd731f --- /dev/null +++ b/include/linux/auto_dev-ioctl.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Red Hat, Inc. All rights reserved. | ||
3 | * Copyright 2008 Ian Kent <raven@themaw.net> | ||
4 | * | ||
5 | * This file is part of the Linux kernel and is made available under | ||
6 | * the terms of the GNU General Public License, version 2, or at your | ||
7 | * option, any later version, incorporated herein by reference. | ||
8 | */ | ||
9 | |||
10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H | ||
11 | #define _LINUX_AUTO_DEV_IOCTL_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | #define AUTOFS_DEVICE_NAME "autofs" | ||
16 | |||
17 | #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1 | ||
18 | #define AUTOFS_DEV_IOCTL_VERSION_MINOR 0 | ||
19 | |||
20 | #define AUTOFS_DEVID_LEN 16 | ||
21 | |||
22 | #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl) | ||
23 | |||
24 | /* | ||
25 | * An ioctl interface for autofs mount point control. | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * All the ioctls use this structure. | ||
30 | * When sending a path size must account for the total length | ||
31 | * of the chunk of memory otherwise is is the size of the | ||
32 | * structure. | ||
33 | */ | ||
34 | |||
35 | struct autofs_dev_ioctl { | ||
36 | __u32 ver_major; | ||
37 | __u32 ver_minor; | ||
38 | __u32 size; /* total size of data passed in | ||
39 | * including this struct */ | ||
40 | __s32 ioctlfd; /* automount command fd */ | ||
41 | |||
42 | __u32 arg1; /* Command parameters */ | ||
43 | __u32 arg2; | ||
44 | |||
45 | char path[0]; | ||
46 | }; | ||
47 | |||
48 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) | ||
49 | { | ||
50 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | ||
51 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | ||
52 | in->size = sizeof(struct autofs_dev_ioctl); | ||
53 | in->ioctlfd = -1; | ||
54 | in->arg1 = 0; | ||
55 | in->arg2 = 0; | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * If you change this make sure you make the corresponding change | ||
61 | * to autofs-dev-ioctl.c:lookup_ioctl() | ||
62 | */ | ||
63 | enum { | ||
64 | /* Get various version info */ | ||
65 | AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71, | ||
66 | AUTOFS_DEV_IOCTL_PROTOVER_CMD, | ||
67 | AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, | ||
68 | |||
69 | /* Open mount ioctl fd */ | ||
70 | AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, | ||
71 | |||
72 | /* Close mount ioctl fd */ | ||
73 | AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, | ||
74 | |||
75 | /* Mount/expire status returns */ | ||
76 | AUTOFS_DEV_IOCTL_READY_CMD, | ||
77 | AUTOFS_DEV_IOCTL_FAIL_CMD, | ||
78 | |||
79 | /* Activate/deactivate autofs mount */ | ||
80 | AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, | ||
81 | AUTOFS_DEV_IOCTL_CATATONIC_CMD, | ||
82 | |||
83 | /* Expiry timeout */ | ||
84 | AUTOFS_DEV_IOCTL_TIMEOUT_CMD, | ||
85 | |||
86 | /* Get mount last requesting uid and gid */ | ||
87 | AUTOFS_DEV_IOCTL_REQUESTER_CMD, | ||
88 | |||
89 | /* Check for eligible expire candidates */ | ||
90 | AUTOFS_DEV_IOCTL_EXPIRE_CMD, | ||
91 | |||
92 | /* Request busy status */ | ||
93 | AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, | ||
94 | |||
95 | /* Check if path is a mountpoint */ | ||
96 | AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, | ||
97 | }; | ||
98 | |||
99 | #define AUTOFS_IOCTL 0x93 | ||
100 | |||
101 | #define AUTOFS_DEV_IOCTL_VERSION \ | ||
102 | _IOWR(AUTOFS_IOCTL, \ | ||
103 | AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl) | ||
104 | |||
105 | #define AUTOFS_DEV_IOCTL_PROTOVER \ | ||
106 | _IOWR(AUTOFS_IOCTL, \ | ||
107 | AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl) | ||
108 | |||
109 | #define AUTOFS_DEV_IOCTL_PROTOSUBVER \ | ||
110 | _IOWR(AUTOFS_IOCTL, \ | ||
111 | AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl) | ||
112 | |||
113 | #define AUTOFS_DEV_IOCTL_OPENMOUNT \ | ||
114 | _IOWR(AUTOFS_IOCTL, \ | ||
115 | AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl) | ||
116 | |||
117 | #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \ | ||
118 | _IOWR(AUTOFS_IOCTL, \ | ||
119 | AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl) | ||
120 | |||
121 | #define AUTOFS_DEV_IOCTL_READY \ | ||
122 | _IOWR(AUTOFS_IOCTL, \ | ||
123 | AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl) | ||
124 | |||
125 | #define AUTOFS_DEV_IOCTL_FAIL \ | ||
126 | _IOWR(AUTOFS_IOCTL, \ | ||
127 | AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl) | ||
128 | |||
129 | #define AUTOFS_DEV_IOCTL_SETPIPEFD \ | ||
130 | _IOWR(AUTOFS_IOCTL, \ | ||
131 | AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl) | ||
132 | |||
133 | #define AUTOFS_DEV_IOCTL_CATATONIC \ | ||
134 | _IOWR(AUTOFS_IOCTL, \ | ||
135 | AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl) | ||
136 | |||
137 | #define AUTOFS_DEV_IOCTL_TIMEOUT \ | ||
138 | _IOWR(AUTOFS_IOCTL, \ | ||
139 | AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl) | ||
140 | |||
141 | #define AUTOFS_DEV_IOCTL_REQUESTER \ | ||
142 | _IOWR(AUTOFS_IOCTL, \ | ||
143 | AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl) | ||
144 | |||
145 | #define AUTOFS_DEV_IOCTL_EXPIRE \ | ||
146 | _IOWR(AUTOFS_IOCTL, \ | ||
147 | AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl) | ||
148 | |||
149 | #define AUTOFS_DEV_IOCTL_ASKUMOUNT \ | ||
150 | _IOWR(AUTOFS_IOCTL, \ | ||
151 | AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl) | ||
152 | |||
153 | #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \ | ||
154 | _IOWR(AUTOFS_IOCTL, \ | ||
155 | AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl) | ||
156 | |||
157 | #endif /* _LINUX_AUTO_DEV_IOCTL_H */ | ||
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index b785c6f8644d..2253716d4b92 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -23,12 +23,17 @@ | |||
23 | #define AUTOFS_MIN_PROTO_VERSION 3 | 23 | #define AUTOFS_MIN_PROTO_VERSION 3 |
24 | #define AUTOFS_MAX_PROTO_VERSION 5 | 24 | #define AUTOFS_MAX_PROTO_VERSION 5 |
25 | 25 | ||
26 | #define AUTOFS_PROTO_SUBVERSION 0 | 26 | #define AUTOFS_PROTO_SUBVERSION 1 |
27 | 27 | ||
28 | /* Mask for expire behaviour */ | 28 | /* Mask for expire behaviour */ |
29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
30 | #define AUTOFS_EXP_LEAVES 2 | 30 | #define AUTOFS_EXP_LEAVES 2 |
31 | 31 | ||
32 | #define AUTOFS_TYPE_ANY 0x0000 | ||
33 | #define AUTOFS_TYPE_INDIRECT 0x0001 | ||
34 | #define AUTOFS_TYPE_DIRECT 0x0002 | ||
35 | #define AUTOFS_TYPE_OFFSET 0x0004 | ||
36 | |||
32 | /* Daemon notification packet types */ | 37 | /* Daemon notification packet types */ |
33 | enum autofs_notify { | 38 | enum autofs_notify { |
34 | NFY_NONE, | 39 | NFY_NONE, |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 826f62350805..7394b5b349ff 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -36,6 +36,10 @@ struct linux_binprm{ | |||
36 | unsigned long p; /* current top of mem */ | 36 | unsigned long p; /* current top of mem */ |
37 | unsigned int sh_bang:1, | 37 | unsigned int sh_bang:1, |
38 | misc_bang:1; | 38 | misc_bang:1; |
39 | #ifdef __alpha__ | ||
40 | unsigned int taso:1; | ||
41 | #endif | ||
42 | unsigned int recursion_depth; | ||
39 | struct file * file; | 43 | struct file * file; |
40 | int e_uid, e_gid; | 44 | int e_uid, e_gid; |
41 | kernel_cap_t cap_post_exec_permitted; | 45 | kernel_cap_t cap_post_exec_permitted; |
@@ -58,6 +62,7 @@ struct linux_binprm{ | |||
58 | #define BINPRM_FLAGS_EXECFD_BIT 1 | 62 | #define BINPRM_FLAGS_EXECFD_BIT 1 |
59 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) | 63 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) |
60 | 64 | ||
65 | #define BINPRM_MAX_RECURSION 4 | ||
61 | 66 | ||
62 | /* | 67 | /* |
63 | * This structure defines the functions that are used to load the binary formats that | 68 | * This structure defines the functions that are used to load the binary formats that |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 0933a14e6414..ff5b4cf9e2da 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -26,21 +26,8 @@ | |||
26 | 26 | ||
27 | #ifdef CONFIG_BLOCK | 27 | #ifdef CONFIG_BLOCK |
28 | 28 | ||
29 | /* Platforms may set this to teach the BIO layer about IOMMU hardware. */ | ||
30 | #include <asm/io.h> | 29 | #include <asm/io.h> |
31 | 30 | ||
32 | #if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY) | ||
33 | #define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1)) | ||
34 | #define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE) | ||
35 | #else | ||
36 | #define BIOVEC_VIRT_START_SIZE(x) 0 | ||
37 | #define BIOVEC_VIRT_OVERSIZE(x) 0 | ||
38 | #endif | ||
39 | |||
40 | #ifndef BIO_VMERGE_BOUNDARY | ||
41 | #define BIO_VMERGE_BOUNDARY 0 | ||
42 | #endif | ||
43 | |||
44 | #define BIO_DEBUG | 31 | #define BIO_DEBUG |
45 | 32 | ||
46 | #ifdef BIO_DEBUG | 33 | #ifdef BIO_DEBUG |
@@ -88,25 +75,14 @@ struct bio { | |||
88 | /* Number of segments in this BIO after | 75 | /* Number of segments in this BIO after |
89 | * physical address coalescing is performed. | 76 | * physical address coalescing is performed. |
90 | */ | 77 | */ |
91 | unsigned short bi_phys_segments; | 78 | unsigned int bi_phys_segments; |
92 | |||
93 | /* Number of segments after physical and DMA remapping | ||
94 | * hardware coalescing is performed. | ||
95 | */ | ||
96 | unsigned short bi_hw_segments; | ||
97 | 79 | ||
98 | unsigned int bi_size; /* residual I/O count */ | 80 | unsigned int bi_size; /* residual I/O count */ |
99 | 81 | ||
100 | /* | ||
101 | * To keep track of the max hw size, we account for the | ||
102 | * sizes of the first and last virtually mergeable segments | ||
103 | * in this bio | ||
104 | */ | ||
105 | unsigned int bi_hw_front_size; | ||
106 | unsigned int bi_hw_back_size; | ||
107 | |||
108 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ | 82 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ |
109 | 83 | ||
84 | unsigned int bi_comp_cpu; /* completion CPU */ | ||
85 | |||
110 | struct bio_vec *bi_io_vec; /* the actual vec list */ | 86 | struct bio_vec *bi_io_vec; /* the actual vec list */ |
111 | 87 | ||
112 | bio_end_io_t *bi_end_io; | 88 | bio_end_io_t *bi_end_io; |
@@ -126,11 +102,14 @@ struct bio { | |||
126 | #define BIO_UPTODATE 0 /* ok after I/O completion */ | 102 | #define BIO_UPTODATE 0 /* ok after I/O completion */ |
127 | #define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ | 103 | #define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ |
128 | #define BIO_EOF 2 /* out-out-bounds error */ | 104 | #define BIO_EOF 2 /* out-out-bounds error */ |
129 | #define BIO_SEG_VALID 3 /* nr_hw_seg valid */ | 105 | #define BIO_SEG_VALID 3 /* bi_phys_segments valid */ |
130 | #define BIO_CLONED 4 /* doesn't own data */ | 106 | #define BIO_CLONED 4 /* doesn't own data */ |
131 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ | 107 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ |
132 | #define BIO_USER_MAPPED 6 /* contains user pages */ | 108 | #define BIO_USER_MAPPED 6 /* contains user pages */ |
133 | #define BIO_EOPNOTSUPP 7 /* not supported */ | 109 | #define BIO_EOPNOTSUPP 7 /* not supported */ |
110 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ | ||
111 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ | ||
112 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ | ||
134 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 113 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
135 | 114 | ||
136 | /* | 115 | /* |
@@ -144,18 +123,31 @@ struct bio { | |||
144 | /* | 123 | /* |
145 | * bio bi_rw flags | 124 | * bio bi_rw flags |
146 | * | 125 | * |
147 | * bit 0 -- read (not set) or write (set) | 126 | * bit 0 -- data direction |
127 | * If not set, bio is a read from device. If set, it's a write to device. | ||
148 | * bit 1 -- rw-ahead when set | 128 | * bit 1 -- rw-ahead when set |
149 | * bit 2 -- barrier | 129 | * bit 2 -- barrier |
130 | * Insert a serialization point in the IO queue, forcing previously | ||
131 | * submitted IO to be completed before this oen is issued. | ||
150 | * bit 3 -- fail fast, don't want low level driver retries | 132 | * bit 3 -- fail fast, don't want low level driver retries |
151 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately | 133 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately |
134 | * Note that this does NOT indicate that the IO itself is sync, just | ||
135 | * that the block layer will not postpone issue of this IO by plugging. | ||
136 | * bit 5 -- metadata request | ||
137 | * Used for tracing to differentiate metadata and data IO. May also | ||
138 | * get some preferential treatment in the IO scheduler | ||
139 | * bit 6 -- discard sectors | ||
140 | * Informs the lower level device that this range of sectors is no longer | ||
141 | * used by the file system and may thus be freed by the device. Used | ||
142 | * for flash based storage. | ||
152 | */ | 143 | */ |
153 | #define BIO_RW 0 | 144 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ |
154 | #define BIO_RW_AHEAD 1 | 145 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ |
155 | #define BIO_RW_BARRIER 2 | 146 | #define BIO_RW_BARRIER 2 |
156 | #define BIO_RW_FAILFAST 3 | 147 | #define BIO_RW_FAILFAST 3 |
157 | #define BIO_RW_SYNC 4 | 148 | #define BIO_RW_SYNC 4 |
158 | #define BIO_RW_META 5 | 149 | #define BIO_RW_META 5 |
150 | #define BIO_RW_DISCARD 6 | ||
159 | 151 | ||
160 | /* | 152 | /* |
161 | * upper 16 bits of bi_rw define the io priority of this bio | 153 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -185,14 +177,15 @@ struct bio { | |||
185 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 177 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
186 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 178 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
187 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | 179 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) |
188 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size) | 180 | #define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) |
181 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | ||
189 | 182 | ||
190 | static inline unsigned int bio_cur_sectors(struct bio *bio) | 183 | static inline unsigned int bio_cur_sectors(struct bio *bio) |
191 | { | 184 | { |
192 | if (bio->bi_vcnt) | 185 | if (bio->bi_vcnt) |
193 | return bio_iovec(bio)->bv_len >> 9; | 186 | return bio_iovec(bio)->bv_len >> 9; |
194 | 187 | else /* dataless requests such as discard */ | |
195 | return 0; | 188 | return bio->bi_size >> 9; |
196 | } | 189 | } |
197 | 190 | ||
198 | static inline void *bio_data(struct bio *bio) | 191 | static inline void *bio_data(struct bio *bio) |
@@ -236,8 +229,6 @@ static inline void *bio_data(struct bio *bio) | |||
236 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) | 229 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) |
237 | #endif | 230 | #endif |
238 | 231 | ||
239 | #define BIOVEC_VIRT_MERGEABLE(vec1, vec2) \ | ||
240 | ((((bvec_to_phys((vec1)) + (vec1)->bv_len) | bvec_to_phys((vec2))) & (BIO_VMERGE_BOUNDARY - 1)) == 0) | ||
241 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ | 232 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ |
242 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) | 233 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) |
243 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ | 234 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ |
@@ -319,15 +310,14 @@ struct bio_pair { | |||
319 | atomic_t cnt; | 310 | atomic_t cnt; |
320 | int error; | 311 | int error; |
321 | }; | 312 | }; |
322 | extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, | 313 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); |
323 | int first_sectors); | ||
324 | extern mempool_t *bio_split_pool; | ||
325 | extern void bio_pair_release(struct bio_pair *dbio); | 314 | extern void bio_pair_release(struct bio_pair *dbio); |
326 | 315 | ||
327 | extern struct bio_set *bioset_create(int, int); | 316 | extern struct bio_set *bioset_create(int, int); |
328 | extern void bioset_free(struct bio_set *); | 317 | extern void bioset_free(struct bio_set *); |
329 | 318 | ||
330 | extern struct bio *bio_alloc(gfp_t, int); | 319 | extern struct bio *bio_alloc(gfp_t, int); |
320 | extern struct bio *bio_kmalloc(gfp_t, int); | ||
331 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); | 321 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
332 | extern void bio_put(struct bio *); | 322 | extern void bio_put(struct bio *); |
333 | extern void bio_free(struct bio *, struct bio_set *); | 323 | extern void bio_free(struct bio *, struct bio_set *); |
@@ -335,7 +325,6 @@ extern void bio_free(struct bio *, struct bio_set *); | |||
335 | extern void bio_endio(struct bio *, int); | 325 | extern void bio_endio(struct bio *, int); |
336 | struct request_queue; | 326 | struct request_queue; |
337 | extern int bio_phys_segments(struct request_queue *, struct bio *); | 327 | extern int bio_phys_segments(struct request_queue *, struct bio *); |
338 | extern int bio_hw_segments(struct request_queue *, struct bio *); | ||
339 | 328 | ||
340 | extern void __bio_clone(struct bio *, struct bio *); | 329 | extern void __bio_clone(struct bio *, struct bio *); |
341 | extern struct bio *bio_clone(struct bio *, gfp_t); | 330 | extern struct bio *bio_clone(struct bio *, gfp_t); |
@@ -346,12 +335,14 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); | |||
346 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, | 335 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, |
347 | unsigned int, unsigned int); | 336 | unsigned int, unsigned int); |
348 | extern int bio_get_nr_vecs(struct block_device *); | 337 | extern int bio_get_nr_vecs(struct block_device *); |
338 | extern sector_t bio_sector_offset(struct bio *, unsigned short, unsigned int); | ||
349 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, | 339 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, |
350 | unsigned long, unsigned int, int); | 340 | unsigned long, unsigned int, int, gfp_t); |
351 | struct sg_iovec; | 341 | struct sg_iovec; |
342 | struct rq_map_data; | ||
352 | extern struct bio *bio_map_user_iov(struct request_queue *, | 343 | extern struct bio *bio_map_user_iov(struct request_queue *, |
353 | struct block_device *, | 344 | struct block_device *, |
354 | struct sg_iovec *, int, int); | 345 | struct sg_iovec *, int, int, gfp_t); |
355 | extern void bio_unmap_user(struct bio *); | 346 | extern void bio_unmap_user(struct bio *); |
356 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | 347 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, |
357 | gfp_t); | 348 | gfp_t); |
@@ -359,15 +350,25 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int, | |||
359 | gfp_t, int); | 350 | gfp_t, int); |
360 | extern void bio_set_pages_dirty(struct bio *bio); | 351 | extern void bio_set_pages_dirty(struct bio *bio); |
361 | extern void bio_check_pages_dirty(struct bio *bio); | 352 | extern void bio_check_pages_dirty(struct bio *bio); |
362 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 353 | extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, |
363 | extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *, | 354 | unsigned long, unsigned int, int, gfp_t); |
364 | int, int); | 355 | extern struct bio *bio_copy_user_iov(struct request_queue *, |
356 | struct rq_map_data *, struct sg_iovec *, | ||
357 | int, int, gfp_t); | ||
365 | extern int bio_uncopy_user(struct bio *); | 358 | extern int bio_uncopy_user(struct bio *); |
366 | void zero_fill_bio(struct bio *bio); | 359 | void zero_fill_bio(struct bio *bio); |
367 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); | 360 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); |
368 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 361 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
369 | 362 | ||
370 | /* | 363 | /* |
364 | * Allow queuer to specify a completion CPU for this bio | ||
365 | */ | ||
366 | static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu) | ||
367 | { | ||
368 | bio->bi_comp_cpu = cpu; | ||
369 | } | ||
370 | |||
371 | /* | ||
371 | * bio_set is used to allow other portions of the IO system to | 372 | * bio_set is used to allow other portions of the IO system to |
372 | * allocate their own private memory pools for bio and iovec structures. | 373 | * allocate their own private memory pools for bio and iovec structures. |
373 | * These memory pools in turn all allocate from the bio_slab | 374 | * These memory pools in turn all allocate from the bio_slab |
@@ -445,6 +446,14 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | |||
445 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) | 446 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) |
446 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) | 447 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) |
447 | 448 | ||
449 | /* | ||
450 | * Check whether this bio carries any data or not. A NULL bio is allowed. | ||
451 | */ | ||
452 | static inline int bio_has_data(struct bio *bio) | ||
453 | { | ||
454 | return bio && bio->bi_io_vec != NULL; | ||
455 | } | ||
456 | |||
448 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 457 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
449 | 458 | ||
450 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) | 459 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) |
@@ -458,14 +467,7 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | |||
458 | #define bip_for_each_vec(bvl, bip, i) \ | 467 | #define bip_for_each_vec(bvl, bip, i) \ |
459 | __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) | 468 | __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) |
460 | 469 | ||
461 | static inline int bio_integrity(struct bio *bio) | 470 | #define bio_integrity(bio) (bio->bi_integrity != NULL) |
462 | { | ||
463 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | ||
464 | return bio->bi_integrity != NULL; | ||
465 | #else | ||
466 | return 0; | ||
467 | #endif | ||
468 | } | ||
469 | 471 | ||
470 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); | 472 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); |
471 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); | 473 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 44710d7e7bff..a92d9e4ea96e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -16,7 +16,9 @@ | |||
16 | #include <linux/bio.h> | 16 | #include <linux/bio.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/stringify.h> | 18 | #include <linux/stringify.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <linux/bsg.h> | 20 | #include <linux/bsg.h> |
21 | #include <linux/smp.h> | ||
20 | 22 | ||
21 | #include <asm/scatterlist.h> | 23 | #include <asm/scatterlist.h> |
22 | 24 | ||
@@ -54,7 +56,6 @@ enum rq_cmd_type_bits { | |||
54 | REQ_TYPE_PM_SUSPEND, /* suspend request */ | 56 | REQ_TYPE_PM_SUSPEND, /* suspend request */ |
55 | REQ_TYPE_PM_RESUME, /* resume request */ | 57 | REQ_TYPE_PM_RESUME, /* resume request */ |
56 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ | 58 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ |
57 | REQ_TYPE_FLUSH, /* flush request */ | ||
58 | REQ_TYPE_SPECIAL, /* driver defined type */ | 59 | REQ_TYPE_SPECIAL, /* driver defined type */ |
59 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ | 60 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ |
60 | /* | 61 | /* |
@@ -76,19 +77,18 @@ enum rq_cmd_type_bits { | |||
76 | * | 77 | * |
77 | */ | 78 | */ |
78 | enum { | 79 | enum { |
79 | /* | ||
80 | * just examples for now | ||
81 | */ | ||
82 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | 80 | REQ_LB_OP_EJECT = 0x40, /* eject request */ |
83 | REQ_LB_OP_FLUSH = 0x41, /* flush device */ | 81 | REQ_LB_OP_FLUSH = 0x41, /* flush request */ |
82 | REQ_LB_OP_DISCARD = 0x42, /* discard sectors */ | ||
84 | }; | 83 | }; |
85 | 84 | ||
86 | /* | 85 | /* |
87 | * request type modified bits. first three bits match BIO_RW* bits, important | 86 | * request type modified bits. first two bits match BIO_RW* bits, important |
88 | */ | 87 | */ |
89 | enum rq_flag_bits { | 88 | enum rq_flag_bits { |
90 | __REQ_RW, /* not set, read. set, write */ | 89 | __REQ_RW, /* not set, read. set, write */ |
91 | __REQ_FAILFAST, /* no low level driver retries */ | 90 | __REQ_FAILFAST, /* no low level driver retries */ |
91 | __REQ_DISCARD, /* request to discard sectors */ | ||
92 | __REQ_SORTED, /* elevator knows about this request */ | 92 | __REQ_SORTED, /* elevator knows about this request */ |
93 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 93 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
94 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | 94 | __REQ_HARDBARRIER, /* may not be passed by drive either */ |
@@ -111,6 +111,7 @@ enum rq_flag_bits { | |||
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define REQ_RW (1 << __REQ_RW) | 113 | #define REQ_RW (1 << __REQ_RW) |
114 | #define REQ_DISCARD (1 << __REQ_DISCARD) | ||
114 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | 115 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) |
115 | #define REQ_SORTED (1 << __REQ_SORTED) | 116 | #define REQ_SORTED (1 << __REQ_SORTED) |
116 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 117 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
@@ -140,12 +141,14 @@ enum rq_flag_bits { | |||
140 | */ | 141 | */ |
141 | struct request { | 142 | struct request { |
142 | struct list_head queuelist; | 143 | struct list_head queuelist; |
143 | struct list_head donelist; | 144 | struct call_single_data csd; |
145 | int cpu; | ||
144 | 146 | ||
145 | struct request_queue *q; | 147 | struct request_queue *q; |
146 | 148 | ||
147 | unsigned int cmd_flags; | 149 | unsigned int cmd_flags; |
148 | enum rq_cmd_type_bits cmd_type; | 150 | enum rq_cmd_type_bits cmd_type; |
151 | unsigned long atomic_flags; | ||
149 | 152 | ||
150 | /* Maintain bio traversal state for part by part I/O submission. | 153 | /* Maintain bio traversal state for part by part I/O submission. |
151 | * hard_* are block layer internals, no driver should touch them! | 154 | * hard_* are block layer internals, no driver should touch them! |
@@ -190,13 +193,6 @@ struct request { | |||
190 | */ | 193 | */ |
191 | unsigned short nr_phys_segments; | 194 | unsigned short nr_phys_segments; |
192 | 195 | ||
193 | /* Number of scatter-gather addr+len pairs after | ||
194 | * physical and DMA remapping hardware coalescing is performed. | ||
195 | * This is the number of scatter-gather entries the driver | ||
196 | * will actually have to deal with after DMA mapping is done. | ||
197 | */ | ||
198 | unsigned short nr_hw_segments; | ||
199 | |||
200 | unsigned short ioprio; | 196 | unsigned short ioprio; |
201 | 197 | ||
202 | void *special; | 198 | void *special; |
@@ -220,6 +216,8 @@ struct request { | |||
220 | void *data; | 216 | void *data; |
221 | void *sense; | 217 | void *sense; |
222 | 218 | ||
219 | unsigned long deadline; | ||
220 | struct list_head timeout_list; | ||
223 | unsigned int timeout; | 221 | unsigned int timeout; |
224 | int retries; | 222 | int retries; |
225 | 223 | ||
@@ -233,6 +231,11 @@ struct request { | |||
233 | struct request *next_rq; | 231 | struct request *next_rq; |
234 | }; | 232 | }; |
235 | 233 | ||
234 | static inline unsigned short req_get_ioprio(struct request *req) | ||
235 | { | ||
236 | return req->ioprio; | ||
237 | } | ||
238 | |||
236 | /* | 239 | /* |
237 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME | 240 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME |
238 | * requests. Some step values could eventually be made generic. | 241 | * requests. Some step values could eventually be made generic. |
@@ -252,6 +255,7 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
252 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 255 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
253 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 256 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
254 | typedef void (unplug_fn) (struct request_queue *); | 257 | typedef void (unplug_fn) (struct request_queue *); |
258 | typedef int (prepare_discard_fn) (struct request_queue *, struct request *); | ||
255 | 259 | ||
256 | struct bio_vec; | 260 | struct bio_vec; |
257 | struct bvec_merge_data { | 261 | struct bvec_merge_data { |
@@ -265,6 +269,15 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, | |||
265 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); | 269 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); |
266 | typedef void (softirq_done_fn)(struct request *); | 270 | typedef void (softirq_done_fn)(struct request *); |
267 | typedef int (dma_drain_needed_fn)(struct request *); | 271 | typedef int (dma_drain_needed_fn)(struct request *); |
272 | typedef int (lld_busy_fn) (struct request_queue *q); | ||
273 | |||
274 | enum blk_eh_timer_return { | ||
275 | BLK_EH_NOT_HANDLED, | ||
276 | BLK_EH_HANDLED, | ||
277 | BLK_EH_RESET_TIMER, | ||
278 | }; | ||
279 | |||
280 | typedef enum blk_eh_timer_return (rq_timed_out_fn)(struct request *); | ||
268 | 281 | ||
269 | enum blk_queue_state { | 282 | enum blk_queue_state { |
270 | Queue_down, | 283 | Queue_down, |
@@ -307,10 +320,13 @@ struct request_queue | |||
307 | make_request_fn *make_request_fn; | 320 | make_request_fn *make_request_fn; |
308 | prep_rq_fn *prep_rq_fn; | 321 | prep_rq_fn *prep_rq_fn; |
309 | unplug_fn *unplug_fn; | 322 | unplug_fn *unplug_fn; |
323 | prepare_discard_fn *prepare_discard_fn; | ||
310 | merge_bvec_fn *merge_bvec_fn; | 324 | merge_bvec_fn *merge_bvec_fn; |
311 | prepare_flush_fn *prepare_flush_fn; | 325 | prepare_flush_fn *prepare_flush_fn; |
312 | softirq_done_fn *softirq_done_fn; | 326 | softirq_done_fn *softirq_done_fn; |
327 | rq_timed_out_fn *rq_timed_out_fn; | ||
313 | dma_drain_needed_fn *dma_drain_needed; | 328 | dma_drain_needed_fn *dma_drain_needed; |
329 | lld_busy_fn *lld_busy_fn; | ||
314 | 330 | ||
315 | /* | 331 | /* |
316 | * Dispatch queue sorting | 332 | * Dispatch queue sorting |
@@ -385,6 +401,10 @@ struct request_queue | |||
385 | unsigned int nr_sorted; | 401 | unsigned int nr_sorted; |
386 | unsigned int in_flight; | 402 | unsigned int in_flight; |
387 | 403 | ||
404 | unsigned int rq_timeout; | ||
405 | struct timer_list timeout; | ||
406 | struct list_head timeout_list; | ||
407 | |||
388 | /* | 408 | /* |
389 | * sg stuff | 409 | * sg stuff |
390 | */ | 410 | */ |
@@ -421,6 +441,10 @@ struct request_queue | |||
421 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 441 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
422 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | 442 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ |
423 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ | 443 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ |
444 | #define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */ | ||
445 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | ||
446 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | ||
447 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | ||
424 | 448 | ||
425 | static inline int queue_is_locked(struct request_queue *q) | 449 | static inline int queue_is_locked(struct request_queue *q) |
426 | { | 450 | { |
@@ -526,7 +550,10 @@ enum { | |||
526 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 550 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
527 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 551 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
528 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 552 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
553 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | ||
529 | #define blk_queue_flushing(q) ((q)->ordseq) | 554 | #define blk_queue_flushing(q) ((q)->ordseq) |
555 | #define blk_queue_stackable(q) \ | ||
556 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | ||
530 | 557 | ||
531 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) | 558 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
532 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) | 559 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
@@ -536,16 +563,18 @@ enum { | |||
536 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | 563 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) |
537 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | 564 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) |
538 | 565 | ||
539 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) | 566 | #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) |
540 | 567 | ||
541 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) | 568 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) |
542 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) | 569 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) |
543 | #define blk_pm_request(rq) \ | 570 | #define blk_pm_request(rq) \ |
544 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) | 571 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
545 | 572 | ||
573 | #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) | ||
546 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | 574 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
547 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 575 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
548 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 576 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
577 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | ||
549 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 578 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
550 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | 579 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) |
551 | /* rq->queuelist of dequeued request must be list_empty() */ | 580 | /* rq->queuelist of dequeued request must be list_empty() */ |
@@ -592,7 +621,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw) | |||
592 | #define RQ_NOMERGE_FLAGS \ | 621 | #define RQ_NOMERGE_FLAGS \ |
593 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 622 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
594 | #define rq_mergeable(rq) \ | 623 | #define rq_mergeable(rq) \ |
595 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) | 624 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
625 | (blk_discard_rq(rq) || blk_fs_request((rq)))) | ||
596 | 626 | ||
597 | /* | 627 | /* |
598 | * q->prep_rq_fn return values | 628 | * q->prep_rq_fn return values |
@@ -637,6 +667,12 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio) | |||
637 | } | 667 | } |
638 | #endif /* CONFIG_MMU */ | 668 | #endif /* CONFIG_MMU */ |
639 | 669 | ||
670 | struct rq_map_data { | ||
671 | struct page **pages; | ||
672 | int page_order; | ||
673 | int nr_entries; | ||
674 | }; | ||
675 | |||
640 | struct req_iterator { | 676 | struct req_iterator { |
641 | int i; | 677 | int i; |
642 | struct bio *bio; | 678 | struct bio *bio; |
@@ -664,6 +700,10 @@ extern void __blk_put_request(struct request_queue *, struct request *); | |||
664 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | 700 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); |
665 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | 701 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
666 | extern void blk_requeue_request(struct request_queue *, struct request *); | 702 | extern void blk_requeue_request(struct request_queue *, struct request *); |
703 | extern int blk_rq_check_limits(struct request_queue *q, struct request *rq); | ||
704 | extern int blk_lld_busy(struct request_queue *q); | ||
705 | extern int blk_insert_cloned_request(struct request_queue *q, | ||
706 | struct request *rq); | ||
667 | extern void blk_plug_device(struct request_queue *); | 707 | extern void blk_plug_device(struct request_queue *); |
668 | extern void blk_plug_device_unlocked(struct request_queue *); | 708 | extern void blk_plug_device_unlocked(struct request_queue *); |
669 | extern int blk_remove_plug(struct request_queue *); | 709 | extern int blk_remove_plug(struct request_queue *); |
@@ -705,11 +745,14 @@ extern void __blk_stop_queue(struct request_queue *q); | |||
705 | extern void __blk_run_queue(struct request_queue *); | 745 | extern void __blk_run_queue(struct request_queue *); |
706 | extern void blk_run_queue(struct request_queue *); | 746 | extern void blk_run_queue(struct request_queue *); |
707 | extern void blk_start_queueing(struct request_queue *); | 747 | extern void blk_start_queueing(struct request_queue *); |
708 | extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long); | 748 | extern int blk_rq_map_user(struct request_queue *, struct request *, |
749 | struct rq_map_data *, void __user *, unsigned long, | ||
750 | gfp_t); | ||
709 | extern int blk_rq_unmap_user(struct bio *); | 751 | extern int blk_rq_unmap_user(struct bio *); |
710 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); | 752 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); |
711 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, | 753 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, |
712 | struct sg_iovec *, int, unsigned int); | 754 | struct rq_map_data *, struct sg_iovec *, int, |
755 | unsigned int, gfp_t); | ||
713 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, | 756 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, |
714 | struct request *, int); | 757 | struct request *, int); |
715 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 758 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
@@ -750,12 +793,15 @@ extern int __blk_end_request(struct request *rq, int error, | |||
750 | extern int blk_end_bidi_request(struct request *rq, int error, | 793 | extern int blk_end_bidi_request(struct request *rq, int error, |
751 | unsigned int nr_bytes, unsigned int bidi_bytes); | 794 | unsigned int nr_bytes, unsigned int bidi_bytes); |
752 | extern void end_request(struct request *, int); | 795 | extern void end_request(struct request *, int); |
753 | extern void end_queued_request(struct request *, int); | ||
754 | extern void end_dequeued_request(struct request *, int); | ||
755 | extern int blk_end_request_callback(struct request *rq, int error, | 796 | extern int blk_end_request_callback(struct request *rq, int error, |
756 | unsigned int nr_bytes, | 797 | unsigned int nr_bytes, |
757 | int (drv_callback)(struct request *)); | 798 | int (drv_callback)(struct request *)); |
758 | extern void blk_complete_request(struct request *); | 799 | extern void blk_complete_request(struct request *); |
800 | extern void __blk_complete_request(struct request *); | ||
801 | extern void blk_abort_request(struct request *); | ||
802 | extern void blk_abort_queue(struct request_queue *); | ||
803 | extern void blk_update_request(struct request *rq, int error, | ||
804 | unsigned int nr_bytes); | ||
759 | 805 | ||
760 | /* | 806 | /* |
761 | * blk_end_request() takes bytes instead of sectors as a complete size. | 807 | * blk_end_request() takes bytes instead of sectors as a complete size. |
@@ -790,12 +836,16 @@ extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int); | |||
790 | extern int blk_queue_dma_drain(struct request_queue *q, | 836 | extern int blk_queue_dma_drain(struct request_queue *q, |
791 | dma_drain_needed_fn *dma_drain_needed, | 837 | dma_drain_needed_fn *dma_drain_needed, |
792 | void *buf, unsigned int size); | 838 | void *buf, unsigned int size); |
839 | extern void blk_queue_lld_busy(struct request_queue *q, lld_busy_fn *fn); | ||
793 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); | 840 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); |
794 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); | 841 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); |
795 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); | 842 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); |
796 | extern void blk_queue_dma_alignment(struct request_queue *, int); | 843 | extern void blk_queue_dma_alignment(struct request_queue *, int); |
797 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); | 844 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); |
798 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 845 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
846 | extern void blk_queue_set_discard(struct request_queue *, prepare_discard_fn *); | ||
847 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | ||
848 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | ||
799 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 849 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
800 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 850 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
801 | extern int blk_do_ordered(struct request_queue *, struct request **); | 851 | extern int blk_do_ordered(struct request_queue *, struct request **); |
@@ -837,14 +887,22 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
837 | } | 887 | } |
838 | 888 | ||
839 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 889 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
890 | extern int blkdev_issue_discard(struct block_device *, | ||
891 | sector_t sector, sector_t nr_sects, gfp_t); | ||
892 | |||
893 | static inline int sb_issue_discard(struct super_block *sb, | ||
894 | sector_t block, sector_t nr_blocks) | ||
895 | { | ||
896 | block <<= (sb->s_blocksize_bits - 9); | ||
897 | nr_blocks <<= (sb->s_blocksize_bits - 9); | ||
898 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | ||
899 | } | ||
840 | 900 | ||
841 | /* | 901 | /* |
842 | * command filter functions | 902 | * command filter functions |
843 | */ | 903 | */ |
844 | extern int blk_verify_command(struct blk_cmd_filter *filter, | 904 | extern int blk_verify_command(struct blk_cmd_filter *filter, |
845 | unsigned char *cmd, int has_write_perm); | 905 | unsigned char *cmd, int has_write_perm); |
846 | extern int blk_register_filter(struct gendisk *disk); | ||
847 | extern void blk_unregister_filter(struct gendisk *disk); | ||
848 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | 906 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); |
849 | 907 | ||
850 | #define MAX_PHYS_SEGMENTS 128 | 908 | #define MAX_PHYS_SEGMENTS 128 |
@@ -876,6 +934,13 @@ static inline int queue_dma_alignment(struct request_queue *q) | |||
876 | return q ? q->dma_alignment : 511; | 934 | return q ? q->dma_alignment : 511; |
877 | } | 935 | } |
878 | 936 | ||
937 | static inline int blk_rq_aligned(struct request_queue *q, void *addr, | ||
938 | unsigned int len) | ||
939 | { | ||
940 | unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask; | ||
941 | return !((unsigned long)addr & alignment) && !(len & alignment); | ||
942 | } | ||
943 | |||
879 | /* assumes size > 256 */ | 944 | /* assumes size > 256 */ |
880 | static inline unsigned int blksize_bits(unsigned int size) | 945 | static inline unsigned int blksize_bits(unsigned int size) |
881 | { | 946 | { |
@@ -902,7 +967,7 @@ static inline void put_dev_sector(Sector p) | |||
902 | } | 967 | } |
903 | 968 | ||
904 | struct work_struct; | 969 | struct work_struct; |
905 | int kblockd_schedule_work(struct work_struct *work); | 970 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
906 | void kblockd_flush_work(struct work_struct *work); | 971 | void kblockd_flush_work(struct work_struct *work); |
907 | 972 | ||
908 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 973 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
@@ -947,49 +1012,19 @@ struct blk_integrity { | |||
947 | 1012 | ||
948 | extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); | 1013 | extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); |
949 | extern void blk_integrity_unregister(struct gendisk *); | 1014 | extern void blk_integrity_unregister(struct gendisk *); |
950 | extern int blk_integrity_compare(struct block_device *, struct block_device *); | 1015 | extern int blk_integrity_compare(struct gendisk *, struct gendisk *); |
951 | extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); | 1016 | extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); |
952 | extern int blk_rq_count_integrity_sg(struct request *); | 1017 | extern int blk_rq_count_integrity_sg(struct request *); |
953 | 1018 | ||
954 | static inline unsigned short blk_integrity_tuple_size(struct blk_integrity *bi) | 1019 | static inline |
955 | { | 1020 | struct blk_integrity *bdev_get_integrity(struct block_device *bdev) |
956 | if (bi) | ||
957 | return bi->tuple_size; | ||
958 | |||
959 | return 0; | ||
960 | } | ||
961 | |||
962 | static inline struct blk_integrity *bdev_get_integrity(struct block_device *bdev) | ||
963 | { | 1021 | { |
964 | return bdev->bd_disk->integrity; | 1022 | return bdev->bd_disk->integrity; |
965 | } | 1023 | } |
966 | 1024 | ||
967 | static inline unsigned int bdev_get_tag_size(struct block_device *bdev) | 1025 | static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) |
968 | { | 1026 | { |
969 | struct blk_integrity *bi = bdev_get_integrity(bdev); | 1027 | return disk->integrity; |
970 | |||
971 | if (bi) | ||
972 | return bi->tag_size; | ||
973 | |||
974 | return 0; | ||
975 | } | ||
976 | |||
977 | static inline int bdev_integrity_enabled(struct block_device *bdev, int rw) | ||
978 | { | ||
979 | struct blk_integrity *bi = bdev_get_integrity(bdev); | ||
980 | |||
981 | if (bi == NULL) | ||
982 | return 0; | ||
983 | |||
984 | if (rw == READ && bi->verify_fn != NULL && | ||
985 | (bi->flags & INTEGRITY_FLAG_READ)) | ||
986 | return 1; | ||
987 | |||
988 | if (rw == WRITE && bi->generate_fn != NULL && | ||
989 | (bi->flags & INTEGRITY_FLAG_WRITE)) | ||
990 | return 1; | ||
991 | |||
992 | return 0; | ||
993 | } | 1028 | } |
994 | 1029 | ||
995 | static inline int blk_integrity_rq(struct request *rq) | 1030 | static inline int blk_integrity_rq(struct request *rq) |
@@ -1006,7 +1041,7 @@ static inline int blk_integrity_rq(struct request *rq) | |||
1006 | #define blk_rq_count_integrity_sg(a) (0) | 1041 | #define blk_rq_count_integrity_sg(a) (0) |
1007 | #define blk_rq_map_integrity_sg(a, b) (0) | 1042 | #define blk_rq_map_integrity_sg(a, b) (0) |
1008 | #define bdev_get_integrity(a) (0) | 1043 | #define bdev_get_integrity(a) (0) |
1009 | #define bdev_get_tag_size(a) (0) | 1044 | #define blk_get_integrity(a) (0) |
1010 | #define blk_integrity_compare(a, b) (0) | 1045 | #define blk_integrity_compare(a, b) (0) |
1011 | #define blk_integrity_register(a, b) (0) | 1046 | #define blk_integrity_register(a, b) (0) |
1012 | #define blk_integrity_unregister(a) do { } while (0); | 1047 | #define blk_integrity_unregister(a) do { } while (0); |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index d084b8d227a5..3a31eb506164 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -1,8 +1,10 @@ | |||
1 | #ifndef BLKTRACE_H | 1 | #ifndef BLKTRACE_H |
2 | #define BLKTRACE_H | 2 | #define BLKTRACE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | #include <linux/blkdev.h> | 5 | #include <linux/blkdev.h> |
5 | #include <linux/relay.h> | 6 | #include <linux/relay.h> |
7 | #endif | ||
6 | 8 | ||
7 | /* | 9 | /* |
8 | * Trace categories | 10 | * Trace categories |
@@ -21,6 +23,7 @@ enum blktrace_cat { | |||
21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 23 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
23 | BLK_TC_META = 1 << 12, /* metadata */ | 25 | BLK_TC_META = 1 << 12, /* metadata */ |
26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | ||
24 | 27 | ||
25 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 28 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
26 | }; | 29 | }; |
@@ -47,6 +50,7 @@ enum blktrace_act { | |||
47 | __BLK_TA_SPLIT, /* bio was split */ | 50 | __BLK_TA_SPLIT, /* bio was split */ |
48 | __BLK_TA_BOUNCE, /* bio was bounced */ | 51 | __BLK_TA_BOUNCE, /* bio was bounced */ |
49 | __BLK_TA_REMAP, /* bio was remapped */ | 52 | __BLK_TA_REMAP, /* bio was remapped */ |
53 | __BLK_TA_ABORT, /* request aborted */ | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | /* | 56 | /* |
@@ -77,6 +81,7 @@ enum blktrace_notify { | |||
77 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | 81 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) |
78 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | 82 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
79 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | 83 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
84 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
80 | 85 | ||
81 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | 86 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
82 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | 87 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
@@ -89,17 +94,17 @@ enum blktrace_notify { | |||
89 | * The trace itself | 94 | * The trace itself |
90 | */ | 95 | */ |
91 | struct blk_io_trace { | 96 | struct blk_io_trace { |
92 | u32 magic; /* MAGIC << 8 | version */ | 97 | __u32 magic; /* MAGIC << 8 | version */ |
93 | u32 sequence; /* event number */ | 98 | __u32 sequence; /* event number */ |
94 | u64 time; /* in microseconds */ | 99 | __u64 time; /* in microseconds */ |
95 | u64 sector; /* disk offset */ | 100 | __u64 sector; /* disk offset */ |
96 | u32 bytes; /* transfer length */ | 101 | __u32 bytes; /* transfer length */ |
97 | u32 action; /* what happened */ | 102 | __u32 action; /* what happened */ |
98 | u32 pid; /* who did it */ | 103 | __u32 pid; /* who did it */ |
99 | u32 device; /* device number */ | 104 | __u32 device; /* device number */ |
100 | u32 cpu; /* on what cpu did it happen */ | 105 | __u32 cpu; /* on what cpu did it happen */ |
101 | u16 error; /* completion error */ | 106 | __u16 error; /* completion error */ |
102 | u16 pdu_len; /* length of data after this trace */ | 107 | __u16 pdu_len; /* length of data after this trace */ |
103 | }; | 108 | }; |
104 | 109 | ||
105 | /* | 110 | /* |
@@ -117,6 +122,23 @@ enum { | |||
117 | Blktrace_stopped, | 122 | Blktrace_stopped, |
118 | }; | 123 | }; |
119 | 124 | ||
125 | #define BLKTRACE_BDEV_SIZE 32 | ||
126 | |||
127 | /* | ||
128 | * User setup structure passed with BLKTRACESTART | ||
129 | */ | ||
130 | struct blk_user_trace_setup { | ||
131 | char name[BLKTRACE_BDEV_SIZE]; /* output */ | ||
132 | __u16 act_mask; /* input */ | ||
133 | __u32 buf_size; /* input */ | ||
134 | __u32 buf_nr; /* input */ | ||
135 | __u64 start_lba; | ||
136 | __u64 end_lba; | ||
137 | __u32 pid; | ||
138 | }; | ||
139 | |||
140 | #ifdef __KERNEL__ | ||
141 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
120 | struct blk_trace { | 142 | struct blk_trace { |
121 | int trace_state; | 143 | int trace_state; |
122 | struct rchan *rchan; | 144 | struct rchan *rchan; |
@@ -133,21 +155,6 @@ struct blk_trace { | |||
133 | atomic_t dropped; | 155 | atomic_t dropped; |
134 | }; | 156 | }; |
135 | 157 | ||
136 | /* | ||
137 | * User setup structure passed with BLKTRACESTART | ||
138 | */ | ||
139 | struct blk_user_trace_setup { | ||
140 | char name[BDEVNAME_SIZE]; /* output */ | ||
141 | u16 act_mask; /* input */ | ||
142 | u32 buf_size; /* input */ | ||
143 | u32 buf_nr; /* input */ | ||
144 | u64 start_lba; | ||
145 | u64 end_lba; | ||
146 | u32 pid; | ||
147 | }; | ||
148 | |||
149 | #ifdef __KERNEL__ | ||
150 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
151 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 158 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
152 | extern void blk_trace_shutdown(struct request_queue *); | 159 | extern void blk_trace_shutdown(struct request_queue *); |
153 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 160 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |
@@ -195,6 +202,9 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
195 | if (likely(!bt)) | 202 | if (likely(!bt)) |
196 | return; | 203 | return; |
197 | 204 | ||
205 | if (blk_discard_rq(rq)) | ||
206 | rw |= (1 << BIO_RW_DISCARD); | ||
207 | |||
198 | if (blk_pc_request(rq)) { | 208 | if (blk_pc_request(rq)) { |
199 | what |= BLK_TC_ACT(BLK_TC_PC); | 209 | what |= BLK_TC_ACT(BLK_TC_PC); |
200 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | 210 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c98dd7cb7076..30934e4bfaab 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -326,7 +326,8 @@ struct cgroup_subsys { | |||
326 | */ | 326 | */ |
327 | void (*mm_owner_changed)(struct cgroup_subsys *ss, | 327 | void (*mm_owner_changed)(struct cgroup_subsys *ss, |
328 | struct cgroup *old, | 328 | struct cgroup *old, |
329 | struct cgroup *new); | 329 | struct cgroup *new, |
330 | struct task_struct *p); | ||
330 | int subsys_id; | 331 | int subsys_id; |
331 | int active; | 332 | int active; |
332 | int disabled; | 333 | int disabled; |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 5ca8c6fddb56..778777316ea4 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -35,6 +35,8 @@ struct clk; | |||
35 | * clk_get may return different clock producers depending on @dev.) | 35 | * clk_get may return different clock producers depending on @dev.) |
36 | * | 36 | * |
37 | * Drivers must assume that the clock source is not enabled. | 37 | * Drivers must assume that the clock source is not enabled. |
38 | * | ||
39 | * clk_get should not be called from within interrupt context. | ||
38 | */ | 40 | */ |
39 | struct clk *clk_get(struct device *dev, const char *id); | 41 | struct clk *clk_get(struct device *dev, const char *id); |
40 | 42 | ||
@@ -76,6 +78,8 @@ unsigned long clk_get_rate(struct clk *clk); | |||
76 | * Note: drivers must ensure that all clk_enable calls made on this | 78 | * Note: drivers must ensure that all clk_enable calls made on this |
77 | * clock source are balanced by clk_disable calls prior to calling | 79 | * clock source are balanced by clk_disable calls prior to calling |
78 | * this function. | 80 | * this function. |
81 | * | ||
82 | * clk_put should not be called from within interrupt context. | ||
79 | */ | 83 | */ |
80 | void clk_put(struct clk *clk); | 84 | void clk_put(struct clk *clk); |
81 | 85 | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index c33b0dc28e4d..ed3a5d473e52 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -127,6 +127,8 @@ extern int clockevents_register_notifier(struct notifier_block *nb); | |||
127 | extern int clockevents_program_event(struct clock_event_device *dev, | 127 | extern int clockevents_program_event(struct clock_event_device *dev, |
128 | ktime_t expires, ktime_t now); | 128 | ktime_t expires, ktime_t now); |
129 | 129 | ||
130 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
131 | |||
130 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 132 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
131 | extern void clockevents_notify(unsigned long reason, void *arg); | 133 | extern void clockevents_notify(unsigned long reason, void *arg); |
132 | #else | 134 | #else |
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h new file mode 100644 index 000000000000..8c0f9505b48c --- /dev/null +++ b/include/linux/cnt32_to_63.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Extend a 32-bit counter to 63 bits | ||
3 | * | ||
4 | * Author: Nicolas Pitre | ||
5 | * Created: December 3, 2006 | ||
6 | * Copyright: MontaVista Software, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_CNT32_TO_63_H__ | ||
14 | #define __LINUX_CNT32_TO_63_H__ | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <asm/byteorder.h> | ||
19 | |||
20 | /* this is used only to give gcc a clue about good code generation */ | ||
21 | union cnt32_to_63 { | ||
22 | struct { | ||
23 | #if defined(__LITTLE_ENDIAN) | ||
24 | u32 lo, hi; | ||
25 | #elif defined(__BIG_ENDIAN) | ||
26 | u32 hi, lo; | ||
27 | #endif | ||
28 | }; | ||
29 | u64 val; | ||
30 | }; | ||
31 | |||
32 | |||
33 | /** | ||
34 | * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter | ||
35 | * @cnt_lo: The low part of the counter | ||
36 | * | ||
37 | * Many hardware clock counters are only 32 bits wide and therefore have | ||
38 | * a relatively short period making wrap-arounds rather frequent. This | ||
39 | * is a problem when implementing sched_clock() for example, where a 64-bit | ||
40 | * non-wrapping monotonic value is expected to be returned. | ||
41 | * | ||
42 | * To overcome that limitation, let's extend a 32-bit counter to 63 bits | ||
43 | * in a completely lock free fashion. Bits 0 to 31 of the clock are provided | ||
44 | * by the hardware while bits 32 to 62 are stored in memory. The top bit in | ||
45 | * memory is used to synchronize with the hardware clock half-period. When | ||
46 | * the top bit of both counters (hardware and in memory) differ then the | ||
47 | * memory is updated with a new value, incrementing it when the hardware | ||
48 | * counter wraps around. | ||
49 | * | ||
50 | * Because a word store in memory is atomic then the incremented value will | ||
51 | * always be in synch with the top bit indicating to any potential concurrent | ||
52 | * reader if the value in memory is up to date or not with regards to the | ||
53 | * needed increment. And any race in updating the value in memory is harmless | ||
54 | * as the same value would simply be stored more than once. | ||
55 | * | ||
56 | * The only restriction for the algorithm to work properly is that this | ||
57 | * code must be executed at least once per each half period of the 32-bit | ||
58 | * counter to properly update the state bit in memory. This is usually not a | ||
59 | * problem in practice, but if it is then a kernel timer could be scheduled | ||
60 | * to manage for this code to be executed often enough. | ||
61 | * | ||
62 | * Note that the top bit (bit 63) in the returned value should be considered | ||
63 | * as garbage. It is not cleared here because callers are likely to use a | ||
64 | * multiplier on the returned value which can get rid of the top bit | ||
65 | * implicitly by making the multiplier even, therefore saving on a runtime | ||
66 | * clear-bit instruction. Otherwise caller must remember to clear the top | ||
67 | * bit explicitly. | ||
68 | */ | ||
69 | #define cnt32_to_63(cnt_lo) \ | ||
70 | ({ \ | ||
71 | static volatile u32 __m_cnt_hi; \ | ||
72 | union cnt32_to_63 __x; \ | ||
73 | __x.hi = __m_cnt_hi; \ | ||
74 | __x.lo = (cnt_lo); \ | ||
75 | if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \ | ||
76 | __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \ | ||
77 | __x.val; \ | ||
78 | }) | ||
79 | |||
80 | #endif | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index cf8d11cad5ae..f061a1ea1b74 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -78,7 +78,6 @@ typedef struct { | |||
78 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 78 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
79 | } compat_sigset_t; | 79 | } compat_sigset_t; |
80 | 80 | ||
81 | extern int cp_compat_stat(struct kstat *, struct compat_stat __user *); | ||
82 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); | 81 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); |
83 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); | 82 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); |
84 | 83 | ||
@@ -235,6 +234,11 @@ extern int get_compat_itimerspec(struct itimerspec *dst, | |||
235 | extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, | 234 | extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, |
236 | const struct itimerspec *src); | 235 | const struct itimerspec *src); |
237 | 236 | ||
237 | asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, | ||
238 | struct timezone __user *tz); | ||
239 | asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | ||
240 | struct timezone __user *tz); | ||
241 | |||
238 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 242 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
239 | 243 | ||
240 | extern int compat_printk(const char *fmt, ...); | 244 | extern int compat_printk(const char *fmt, ...); |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index c8bd2daf95ec..8322141ee480 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -190,7 +190,9 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
190 | * ACCESS_ONCE() in different C statements. | 190 | * ACCESS_ONCE() in different C statements. |
191 | * | 191 | * |
192 | * This macro does absolutely -nothing- to prevent the CPU from reordering, | 192 | * This macro does absolutely -nothing- to prevent the CPU from reordering, |
193 | * merging, or refetching absolutely anything at any time. | 193 | * merging, or refetching absolutely anything at any time. Its main intended |
194 | * use is to mediate communication between process-level code and irq/NMI | ||
195 | * handlers, all running on the same CPU. | ||
194 | */ | 196 | */ |
195 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) | 197 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) |
196 | 198 | ||
diff --git a/include/linux/completion.h b/include/linux/completion.h index 02ef8835999c..4a6b604ef7e4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -10,6 +10,18 @@ | |||
10 | 10 | ||
11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
12 | 12 | ||
13 | /** | ||
14 | * struct completion - structure used to maintain state for a "completion" | ||
15 | * | ||
16 | * This is the opaque structure used to maintain the state for a "completion". | ||
17 | * Completions currently use a FIFO to queue threads that have to wait for | ||
18 | * the "completion" event. | ||
19 | * | ||
20 | * See also: complete(), wait_for_completion() (and friends _timeout, | ||
21 | * _interruptible, _interruptible_timeout, and _killable), init_completion(), | ||
22 | * and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and | ||
23 | * INIT_COMPLETION(). | ||
24 | */ | ||
13 | struct completion { | 25 | struct completion { |
14 | unsigned int done; | 26 | unsigned int done; |
15 | wait_queue_head_t wait; | 27 | wait_queue_head_t wait; |
@@ -21,6 +33,14 @@ struct completion { | |||
21 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ | 33 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ |
22 | ({ init_completion(&work); work; }) | 34 | ({ init_completion(&work); work; }) |
23 | 35 | ||
36 | /** | ||
37 | * DECLARE_COMPLETION: - declare and initialize a completion structure | ||
38 | * @work: identifier for the completion structure | ||
39 | * | ||
40 | * This macro declares and initializes a completion structure. Generally used | ||
41 | * for static declarations. You should use the _ONSTACK variant for automatic | ||
42 | * variables. | ||
43 | */ | ||
24 | #define DECLARE_COMPLETION(work) \ | 44 | #define DECLARE_COMPLETION(work) \ |
25 | struct completion work = COMPLETION_INITIALIZER(work) | 45 | struct completion work = COMPLETION_INITIALIZER(work) |
26 | 46 | ||
@@ -29,6 +49,13 @@ struct completion { | |||
29 | * completions - so we use the _ONSTACK() variant for those that | 49 | * completions - so we use the _ONSTACK() variant for those that |
30 | * are on the kernel stack: | 50 | * are on the kernel stack: |
31 | */ | 51 | */ |
52 | /** | ||
53 | * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure | ||
54 | * @work: identifier for the completion structure | ||
55 | * | ||
56 | * This macro declares and initializes a completion structure on the kernel | ||
57 | * stack. | ||
58 | */ | ||
32 | #ifdef CONFIG_LOCKDEP | 59 | #ifdef CONFIG_LOCKDEP |
33 | # define DECLARE_COMPLETION_ONSTACK(work) \ | 60 | # define DECLARE_COMPLETION_ONSTACK(work) \ |
34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) | 61 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) |
@@ -36,6 +63,13 @@ struct completion { | |||
36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | 63 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) |
37 | #endif | 64 | #endif |
38 | 65 | ||
66 | /** | ||
67 | * init_completion: - Initialize a dynamically allocated completion | ||
68 | * @x: completion structure that is to be initialized | ||
69 | * | ||
70 | * This inline function will initialize a dynamically created completion | ||
71 | * structure. | ||
72 | */ | ||
39 | static inline void init_completion(struct completion *x) | 73 | static inline void init_completion(struct completion *x) |
40 | { | 74 | { |
41 | x->done = 0; | 75 | x->done = 0; |
@@ -55,6 +89,13 @@ extern bool completion_done(struct completion *x); | |||
55 | extern void complete(struct completion *); | 89 | extern void complete(struct completion *); |
56 | extern void complete_all(struct completion *); | 90 | extern void complete_all(struct completion *); |
57 | 91 | ||
92 | /** | ||
93 | * INIT_COMPLETION: - reinitialize a completion structure | ||
94 | * @x: completion structure to be reinitialized | ||
95 | * | ||
96 | * This macro should be used to reinitialize a completion structure so it can | ||
97 | * be reused. This is especially important after complete_all() is used. | ||
98 | */ | ||
58 | #define INIT_COMPLETION(x) ((x).done = 0) | 99 | #define INIT_COMPLETION(x) ((x).done = 0) |
59 | 100 | ||
60 | 101 | ||
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index b03f80a078be..d71f7c0f931b 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -53,7 +53,6 @@ struct vc_data { | |||
53 | unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ | 53 | unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ |
54 | struct console_font vc_font; /* Current VC font set */ | 54 | struct console_font vc_font; /* Current VC font set */ |
55 | unsigned short vc_video_erase_char; /* Background erase character */ | 55 | unsigned short vc_video_erase_char; /* Background erase character */ |
56 | unsigned short vc_scrl_erase_char; /* Erase character for scroll */ | ||
57 | /* VT terminal data */ | 56 | /* VT terminal data */ |
58 | unsigned int vc_state; /* Escape sequence parser state */ | 57 | unsigned int vc_state; /* Escape sequence parser state */ |
59 | unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ | 58 | unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index d7faf8808497..c2747ac2ae43 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -69,6 +69,7 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | int cpu_up(unsigned int cpu); | 71 | int cpu_up(unsigned int cpu); |
72 | void notify_cpu_starting(unsigned int cpu); | ||
72 | extern void cpu_hotplug_init(void); | 73 | extern void cpu_hotplug_init(void); |
73 | extern void cpu_maps_update_begin(void); | 74 | extern void cpu_maps_update_begin(void); |
74 | extern void cpu_maps_update_done(void); | 75 | extern void cpu_maps_update_done(void); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 6fd5668aa572..1ee608fd7b77 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -187,7 +187,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
187 | unsigned int relation); | 187 | unsigned int relation); |
188 | 188 | ||
189 | 189 | ||
190 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy); | 190 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, |
191 | unsigned int cpu); | ||
191 | 192 | ||
192 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 193 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
193 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 194 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
@@ -226,7 +227,9 @@ struct cpufreq_driver { | |||
226 | unsigned int (*get) (unsigned int cpu); | 227 | unsigned int (*get) (unsigned int cpu); |
227 | 228 | ||
228 | /* optional */ | 229 | /* optional */ |
229 | unsigned int (*getavg) (unsigned int cpu); | 230 | unsigned int (*getavg) (struct cpufreq_policy *policy, |
231 | unsigned int cpu); | ||
232 | |||
230 | int (*exit) (struct cpufreq_policy *policy); | 233 | int (*exit) (struct cpufreq_policy *policy); |
231 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
232 | int (*resume) (struct cpufreq_policy *policy); | 235 | int (*resume) (struct cpufreq_policy *policy); |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index e8f450c499b0..2691926fb506 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -160,7 +160,7 @@ static inline int current_cpuset_is_being_rebound(void) | |||
160 | 160 | ||
161 | static inline void rebuild_sched_domains(void) | 161 | static inline void rebuild_sched_domains(void) |
162 | { | 162 | { |
163 | partition_sched_domains(0, NULL, NULL); | 163 | partition_sched_domains(1, NULL, NULL); |
164 | } | 164 | } |
165 | 165 | ||
166 | #endif /* !CONFIG_CPUSETS */ | 166 | #endif /* !CONFIG_CPUSETS */ |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index c43dc47fdf75..3d2317e4af2e 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 | 38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 | 39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 |
40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a | 40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c | ||
41 | 42 | ||
42 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e | 43 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |
43 | #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c | 44 | #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c |
@@ -61,6 +62,14 @@ | |||
61 | #define CRYPTO_ALG_GENIV 0x00000200 | 62 | #define CRYPTO_ALG_GENIV 0x00000200 |
62 | 63 | ||
63 | /* | 64 | /* |
65 | * Set if the algorithm has passed automated run-time testing. Note that | ||
66 | * if there is no run-time testing for a given algorithm it is considered | ||
67 | * to have passed. | ||
68 | */ | ||
69 | |||
70 | #define CRYPTO_ALG_TESTED 0x00000400 | ||
71 | |||
72 | /* | ||
64 | * Transform masks and values (for crt_flags). | 73 | * Transform masks and values (for crt_flags). |
65 | */ | 74 | */ |
66 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 | 75 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 |
@@ -105,6 +114,7 @@ struct crypto_aead; | |||
105 | struct crypto_blkcipher; | 114 | struct crypto_blkcipher; |
106 | struct crypto_hash; | 115 | struct crypto_hash; |
107 | struct crypto_ahash; | 116 | struct crypto_ahash; |
117 | struct crypto_rng; | ||
108 | struct crypto_tfm; | 118 | struct crypto_tfm; |
109 | struct crypto_type; | 119 | struct crypto_type; |
110 | struct aead_givcrypt_request; | 120 | struct aead_givcrypt_request; |
@@ -290,6 +300,15 @@ struct compress_alg { | |||
290 | unsigned int slen, u8 *dst, unsigned int *dlen); | 300 | unsigned int slen, u8 *dst, unsigned int *dlen); |
291 | }; | 301 | }; |
292 | 302 | ||
303 | struct rng_alg { | ||
304 | int (*rng_make_random)(struct crypto_rng *tfm, u8 *rdata, | ||
305 | unsigned int dlen); | ||
306 | int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen); | ||
307 | |||
308 | unsigned int seedsize; | ||
309 | }; | ||
310 | |||
311 | |||
293 | #define cra_ablkcipher cra_u.ablkcipher | 312 | #define cra_ablkcipher cra_u.ablkcipher |
294 | #define cra_aead cra_u.aead | 313 | #define cra_aead cra_u.aead |
295 | #define cra_blkcipher cra_u.blkcipher | 314 | #define cra_blkcipher cra_u.blkcipher |
@@ -298,6 +317,7 @@ struct compress_alg { | |||
298 | #define cra_hash cra_u.hash | 317 | #define cra_hash cra_u.hash |
299 | #define cra_ahash cra_u.ahash | 318 | #define cra_ahash cra_u.ahash |
300 | #define cra_compress cra_u.compress | 319 | #define cra_compress cra_u.compress |
320 | #define cra_rng cra_u.rng | ||
301 | 321 | ||
302 | struct crypto_alg { | 322 | struct crypto_alg { |
303 | struct list_head cra_list; | 323 | struct list_head cra_list; |
@@ -325,6 +345,7 @@ struct crypto_alg { | |||
325 | struct hash_alg hash; | 345 | struct hash_alg hash; |
326 | struct ahash_alg ahash; | 346 | struct ahash_alg ahash; |
327 | struct compress_alg compress; | 347 | struct compress_alg compress; |
348 | struct rng_alg rng; | ||
328 | } cra_u; | 349 | } cra_u; |
329 | 350 | ||
330 | int (*cra_init)(struct crypto_tfm *tfm); | 351 | int (*cra_init)(struct crypto_tfm *tfm); |
@@ -430,6 +451,12 @@ struct compress_tfm { | |||
430 | u8 *dst, unsigned int *dlen); | 451 | u8 *dst, unsigned int *dlen); |
431 | }; | 452 | }; |
432 | 453 | ||
454 | struct rng_tfm { | ||
455 | int (*rng_gen_random)(struct crypto_rng *tfm, u8 *rdata, | ||
456 | unsigned int dlen); | ||
457 | int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen); | ||
458 | }; | ||
459 | |||
433 | #define crt_ablkcipher crt_u.ablkcipher | 460 | #define crt_ablkcipher crt_u.ablkcipher |
434 | #define crt_aead crt_u.aead | 461 | #define crt_aead crt_u.aead |
435 | #define crt_blkcipher crt_u.blkcipher | 462 | #define crt_blkcipher crt_u.blkcipher |
@@ -437,6 +464,7 @@ struct compress_tfm { | |||
437 | #define crt_hash crt_u.hash | 464 | #define crt_hash crt_u.hash |
438 | #define crt_ahash crt_u.ahash | 465 | #define crt_ahash crt_u.ahash |
439 | #define crt_compress crt_u.compress | 466 | #define crt_compress crt_u.compress |
467 | #define crt_rng crt_u.rng | ||
440 | 468 | ||
441 | struct crypto_tfm { | 469 | struct crypto_tfm { |
442 | 470 | ||
@@ -450,6 +478,7 @@ struct crypto_tfm { | |||
450 | struct hash_tfm hash; | 478 | struct hash_tfm hash; |
451 | struct ahash_tfm ahash; | 479 | struct ahash_tfm ahash; |
452 | struct compress_tfm compress; | 480 | struct compress_tfm compress; |
481 | struct rng_tfm rng; | ||
453 | } crt_u; | 482 | } crt_u; |
454 | 483 | ||
455 | struct crypto_alg *__crt_alg; | 484 | struct crypto_alg *__crt_alg; |
@@ -481,6 +510,10 @@ struct crypto_hash { | |||
481 | struct crypto_tfm base; | 510 | struct crypto_tfm base; |
482 | }; | 511 | }; |
483 | 512 | ||
513 | struct crypto_rng { | ||
514 | struct crypto_tfm base; | ||
515 | }; | ||
516 | |||
484 | enum { | 517 | enum { |
485 | CRYPTOA_UNSPEC, | 518 | CRYPTOA_UNSPEC, |
486 | CRYPTOA_ALG, | 519 | CRYPTOA_ALG, |
@@ -515,6 +548,8 @@ struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); | |||
515 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); | 548 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); |
516 | void crypto_free_tfm(struct crypto_tfm *tfm); | 549 | void crypto_free_tfm(struct crypto_tfm *tfm); |
517 | 550 | ||
551 | int alg_test(const char *driver, const char *alg, u32 type, u32 mask); | ||
552 | |||
518 | /* | 553 | /* |
519 | * Transform helpers which query the underlying algorithm. | 554 | * Transform helpers which query the underlying algorithm. |
520 | */ | 555 | */ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index a90222e3297d..08d783592b73 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | struct dm_target; | 14 | struct dm_target; |
15 | struct dm_table; | 15 | struct dm_table; |
16 | struct dm_dev; | ||
17 | struct mapped_device; | 16 | struct mapped_device; |
18 | struct bio_vec; | 17 | struct bio_vec; |
19 | 18 | ||
@@ -84,6 +83,12 @@ void dm_error(const char *message); | |||
84 | */ | 83 | */ |
85 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | 84 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); |
86 | 85 | ||
86 | struct dm_dev { | ||
87 | struct block_device *bdev; | ||
88 | int mode; | ||
89 | char name[16]; | ||
90 | }; | ||
91 | |||
87 | /* | 92 | /* |
88 | * Constructors should call these functions to ensure destination devices | 93 | * Constructors should call these functions to ensure destination devices |
89 | * are opened/closed correctly. | 94 | * are opened/closed correctly. |
@@ -202,6 +207,7 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); | |||
202 | struct gendisk *dm_disk(struct mapped_device *md); | 207 | struct gendisk *dm_disk(struct mapped_device *md); |
203 | int dm_suspended(struct mapped_device *md); | 208 | int dm_suspended(struct mapped_device *md); |
204 | int dm_noflush_suspending(struct dm_target *ti); | 209 | int dm_noflush_suspending(struct dm_target *ti); |
210 | union map_info *dm_get_mapinfo(struct bio *bio); | ||
205 | 211 | ||
206 | /* | 212 | /* |
207 | * Geometry functions. | 213 | * Geometry functions. |
@@ -232,6 +238,11 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
232 | int dm_table_complete(struct dm_table *t); | 238 | int dm_table_complete(struct dm_table *t); |
233 | 239 | ||
234 | /* | 240 | /* |
241 | * Unplug all devices in a table. | ||
242 | */ | ||
243 | void dm_table_unplug_all(struct dm_table *t); | ||
244 | |||
245 | /* | ||
235 | * Table reference counting. | 246 | * Table reference counting. |
236 | */ | 247 | */ |
237 | struct dm_table *dm_get_table(struct mapped_device *md); | 248 | struct dm_table *dm_get_table(struct mapped_device *md); |
@@ -256,6 +267,11 @@ void dm_table_event(struct dm_table *t); | |||
256 | */ | 267 | */ |
257 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); | 268 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); |
258 | 269 | ||
270 | /* | ||
271 | * A wrapper around vmalloc. | ||
272 | */ | ||
273 | void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | ||
274 | |||
259 | /*----------------------------------------------------------------- | 275 | /*----------------------------------------------------------------- |
260 | * Macros. | 276 | * Macros. |
261 | *---------------------------------------------------------------*/ | 277 | *---------------------------------------------------------------*/ |
diff --git a/include/linux/device.h b/include/linux/device.h index 4d8372d135df..987f5912720a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -90,6 +90,9 @@ int __must_check bus_for_each_drv(struct bus_type *bus, | |||
90 | struct device_driver *start, void *data, | 90 | struct device_driver *start, void *data, |
91 | int (*fn)(struct device_driver *, void *)); | 91 | int (*fn)(struct device_driver *, void *)); |
92 | 92 | ||
93 | void bus_sort_breadthfirst(struct bus_type *bus, | ||
94 | int (*compare)(const struct device *a, | ||
95 | const struct device *b)); | ||
93 | /* | 96 | /* |
94 | * Bus notifiers: Get notified of addition/removal of devices | 97 | * Bus notifiers: Get notified of addition/removal of devices |
95 | * and binding/unbinding of drivers to devices. | 98 | * and binding/unbinding of drivers to devices. |
@@ -199,6 +202,11 @@ struct class { | |||
199 | struct class_private *p; | 202 | struct class_private *p; |
200 | }; | 203 | }; |
201 | 204 | ||
205 | struct class_dev_iter { | ||
206 | struct klist_iter ki; | ||
207 | const struct device_type *type; | ||
208 | }; | ||
209 | |||
202 | extern struct kobject *sysfs_dev_block_kobj; | 210 | extern struct kobject *sysfs_dev_block_kobj; |
203 | extern struct kobject *sysfs_dev_char_kobj; | 211 | extern struct kobject *sysfs_dev_char_kobj; |
204 | extern int __must_check __class_register(struct class *class, | 212 | extern int __must_check __class_register(struct class *class, |
@@ -213,6 +221,13 @@ extern void class_unregister(struct class *class); | |||
213 | __class_register(class, &__key); \ | 221 | __class_register(class, &__key); \ |
214 | }) | 222 | }) |
215 | 223 | ||
224 | extern void class_dev_iter_init(struct class_dev_iter *iter, | ||
225 | struct class *class, | ||
226 | struct device *start, | ||
227 | const struct device_type *type); | ||
228 | extern struct device *class_dev_iter_next(struct class_dev_iter *iter); | ||
229 | extern void class_dev_iter_exit(struct class_dev_iter *iter); | ||
230 | |||
216 | extern int class_for_each_device(struct class *class, struct device *start, | 231 | extern int class_for_each_device(struct class *class, struct device *start, |
217 | void *data, | 232 | void *data, |
218 | int (*fn)(struct device *dev, void *data)); | 233 | int (*fn)(struct device *dev, void *data)); |
@@ -396,7 +411,7 @@ struct device { | |||
396 | spinlock_t devres_lock; | 411 | spinlock_t devres_lock; |
397 | struct list_head devres_head; | 412 | struct list_head devres_head; |
398 | 413 | ||
399 | struct list_head node; | 414 | struct klist_node knode_class; |
400 | struct class *class; | 415 | struct class *class; |
401 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 416 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
402 | struct attribute_group **groups; /* optional groups */ | 417 | struct attribute_group **groups; /* optional groups */ |
@@ -490,7 +505,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
490 | dev_t devt, void *drvdata, | 505 | dev_t devt, void *drvdata, |
491 | const char *fmt, ...) | 506 | const char *fmt, ...) |
492 | __attribute__((format(printf, 5, 6))); | 507 | __attribute__((format(printf, 5, 6))); |
493 | #define device_create_drvdata device_create | ||
494 | extern void device_destroy(struct class *cls, dev_t devt); | 508 | extern void device_destroy(struct class *cls, dev_t devt); |
495 | 509 | ||
496 | /* | 510 | /* |
@@ -539,7 +553,11 @@ extern const char *dev_driver_string(const struct device *dev); | |||
539 | #define dev_info(dev, format, arg...) \ | 553 | #define dev_info(dev, format, arg...) \ |
540 | dev_printk(KERN_INFO , dev , format , ## arg) | 554 | dev_printk(KERN_INFO , dev , format , ## arg) |
541 | 555 | ||
542 | #ifdef DEBUG | 556 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) |
557 | #define dev_dbg(dev, format, ...) do { \ | ||
558 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
559 | } while (0) | ||
560 | #elif defined(DEBUG) | ||
543 | #define dev_dbg(dev, format, arg...) \ | 561 | #define dev_dbg(dev, format, arg...) \ |
544 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 562 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
545 | #else | 563 | #else |
@@ -555,6 +573,14 @@ extern const char *dev_driver_string(const struct device *dev); | |||
555 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 573 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
556 | #endif | 574 | #endif |
557 | 575 | ||
576 | /* | ||
577 | * dev_WARN() acts like dev_printk(), but with the key difference | ||
578 | * of using a WARN/WARN_ON to get the message out, including the | ||
579 | * file/line information and a backtrace. | ||
580 | */ | ||
581 | #define dev_WARN(dev, format, arg...) \ | ||
582 | WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); | ||
583 | |||
558 | /* Create alias, so I can be autoloaded. */ | 584 | /* Create alias, so I can be autoloaded. */ |
559 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 585 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
560 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) | 586 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index 154769cad3f3..5ce0e5fd712e 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h | |||
@@ -17,20 +17,31 @@ | |||
17 | 17 | ||
18 | #ifdef CONFIG_UNIX98_PTYS | 18 | #ifdef CONFIG_UNIX98_PTYS |
19 | 19 | ||
20 | int devpts_new_index(void); | 20 | int devpts_new_index(struct inode *ptmx_inode); |
21 | void devpts_kill_index(int idx); | 21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); |
22 | int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */ | 22 | /* mknod in devpts */ |
23 | struct tty_struct *devpts_get_tty(int number); /* get tty structure */ | 23 | int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); |
24 | void devpts_pty_kill(int number); /* unlink */ | 24 | /* get tty structure */ |
25 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); | ||
26 | /* unlink */ | ||
27 | void devpts_pty_kill(struct tty_struct *tty); | ||
25 | 28 | ||
26 | #else | 29 | #else |
27 | 30 | ||
28 | /* Dummy stubs in the no-pty case */ | 31 | /* Dummy stubs in the no-pty case */ |
29 | static inline int devpts_new_index(void) { return -EINVAL; } | 32 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } |
30 | static inline void devpts_kill_index(int idx) { } | 33 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } |
31 | static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; } | 34 | static inline int devpts_pty_new(struct inode *ptmx_inode, |
32 | static inline struct tty_struct *devpts_get_tty(int number) { return NULL; } | 35 | struct tty_struct *tty) |
33 | static inline void devpts_pty_kill(int number) { } | 36 | { |
37 | return -EINVAL; | ||
38 | } | ||
39 | static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, | ||
40 | int number) | ||
41 | { | ||
42 | return NULL; | ||
43 | } | ||
44 | static inline void devpts_pty_kill(struct tty_struct *tty) { } | ||
34 | 45 | ||
35 | #endif | 46 | #endif |
36 | 47 | ||
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index 203a025e30e5..b9cd38603fd8 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** | 3 | ** |
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. |
6 | ** | 6 | ** |
7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
@@ -65,9 +65,12 @@ struct dlm_lksb { | |||
65 | char * sb_lvbptr; | 65 | char * sb_lvbptr; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* dlm_new_lockspace() flags */ | ||
69 | |||
68 | #define DLM_LSFL_NODIR 0x00000001 | 70 | #define DLM_LSFL_NODIR 0x00000001 |
69 | #define DLM_LSFL_TIMEWARN 0x00000002 | 71 | #define DLM_LSFL_TIMEWARN 0x00000002 |
70 | #define DLM_LSFL_FS 0x00000004 | 72 | #define DLM_LSFL_FS 0x00000004 |
73 | #define DLM_LSFL_NEWEXCL 0x00000008 | ||
71 | 74 | ||
72 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
73 | 76 | ||
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h index c6034508fed9..3060783c4191 100644 --- a/include/linux/dlm_device.h +++ b/include/linux/dlm_device.h | |||
@@ -26,7 +26,7 @@ | |||
26 | /* Version of the device interface */ | 26 | /* Version of the device interface */ |
27 | #define DLM_DEVICE_VERSION_MAJOR 6 | 27 | #define DLM_DEVICE_VERSION_MAJOR 6 |
28 | #define DLM_DEVICE_VERSION_MINOR 0 | 28 | #define DLM_DEVICE_VERSION_MINOR 0 |
29 | #define DLM_DEVICE_VERSION_PATCH 0 | 29 | #define DLM_DEVICE_VERSION_PATCH 1 |
30 | 30 | ||
31 | /* struct passed to the lock write */ | 31 | /* struct passed to the lock write */ |
32 | struct dlm_lock_params { | 32 | struct dlm_lock_params { |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 952e0f857ac9..ba9114ec5d3a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -48,6 +48,11 @@ static inline int is_device_dma_capable(struct device *dev) | |||
48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | 48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | ||
52 | { | ||
53 | return addr + size <= mask; | ||
54 | } | ||
55 | |||
51 | #ifdef CONFIG_HAS_DMA | 56 | #ifdef CONFIG_HAS_DMA |
52 | #include <asm/dma-mapping.h> | 57 | #include <asm/dma-mapping.h> |
53 | #else | 58 | #else |
@@ -58,6 +63,13 @@ static inline int is_device_dma_capable(struct device *dev) | |||
58 | #define dma_sync_single dma_sync_single_for_cpu | 63 | #define dma_sync_single dma_sync_single_for_cpu |
59 | #define dma_sync_sg dma_sync_sg_for_cpu | 64 | #define dma_sync_sg dma_sync_sg_for_cpu |
60 | 65 | ||
66 | static inline u64 dma_get_mask(struct device *dev) | ||
67 | { | ||
68 | if (dev && dev->dma_mask && *dev->dma_mask) | ||
69 | return *dev->dma_mask; | ||
70 | return DMA_32BIT_MASK; | ||
71 | } | ||
72 | |||
61 | extern u64 dma_get_required_mask(struct device *dev); | 73 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 74 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 75 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h new file mode 100644 index 000000000000..bff5c65f81dc --- /dev/null +++ b/include/linux/dma_remapping.h | |||
@@ -0,0 +1,157 @@ | |||
1 | #ifndef _DMA_REMAPPING_H | ||
2 | #define _DMA_REMAPPING_H | ||
3 | |||
4 | /* | ||
5 | * We need a fixed PAGE_SIZE of 4K irrespective of | ||
6 | * arch PAGE_SIZE for IOMMU page tables. | ||
7 | */ | ||
8 | #define PAGE_SHIFT_4K (12) | ||
9 | #define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K) | ||
10 | #define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K) | ||
11 | #define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K) | ||
12 | |||
13 | #define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K) | ||
14 | #define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK) | ||
15 | #define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK) | ||
16 | |||
17 | |||
18 | /* | ||
19 | * 0: Present | ||
20 | * 1-11: Reserved | ||
21 | * 12-63: Context Ptr (12 - (haw-1)) | ||
22 | * 64-127: Reserved | ||
23 | */ | ||
24 | struct root_entry { | ||
25 | u64 val; | ||
26 | u64 rsvd1; | ||
27 | }; | ||
28 | #define ROOT_ENTRY_NR (PAGE_SIZE_4K/sizeof(struct root_entry)) | ||
29 | static inline bool root_present(struct root_entry *root) | ||
30 | { | ||
31 | return (root->val & 1); | ||
32 | } | ||
33 | static inline void set_root_present(struct root_entry *root) | ||
34 | { | ||
35 | root->val |= 1; | ||
36 | } | ||
37 | static inline void set_root_value(struct root_entry *root, unsigned long value) | ||
38 | { | ||
39 | root->val |= value & PAGE_MASK_4K; | ||
40 | } | ||
41 | |||
42 | struct context_entry; | ||
43 | static inline struct context_entry * | ||
44 | get_context_addr_from_root(struct root_entry *root) | ||
45 | { | ||
46 | return (struct context_entry *) | ||
47 | (root_present(root)?phys_to_virt( | ||
48 | root->val & PAGE_MASK_4K): | ||
49 | NULL); | ||
50 | } | ||
51 | |||
52 | /* | ||
53 | * low 64 bits: | ||
54 | * 0: present | ||
55 | * 1: fault processing disable | ||
56 | * 2-3: translation type | ||
57 | * 12-63: address space root | ||
58 | * high 64 bits: | ||
59 | * 0-2: address width | ||
60 | * 3-6: aval | ||
61 | * 8-23: domain id | ||
62 | */ | ||
63 | struct context_entry { | ||
64 | u64 lo; | ||
65 | u64 hi; | ||
66 | }; | ||
67 | #define context_present(c) ((c).lo & 1) | ||
68 | #define context_fault_disable(c) (((c).lo >> 1) & 1) | ||
69 | #define context_translation_type(c) (((c).lo >> 2) & 3) | ||
70 | #define context_address_root(c) ((c).lo & PAGE_MASK_4K) | ||
71 | #define context_address_width(c) ((c).hi & 7) | ||
72 | #define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1)) | ||
73 | |||
74 | #define context_set_present(c) do {(c).lo |= 1;} while (0) | ||
75 | #define context_set_fault_enable(c) \ | ||
76 | do {(c).lo &= (((u64)-1) << 2) | 1;} while (0) | ||
77 | #define context_set_translation_type(c, val) \ | ||
78 | do { \ | ||
79 | (c).lo &= (((u64)-1) << 4) | 3; \ | ||
80 | (c).lo |= ((val) & 3) << 2; \ | ||
81 | } while (0) | ||
82 | #define CONTEXT_TT_MULTI_LEVEL 0 | ||
83 | #define context_set_address_root(c, val) \ | ||
84 | do {(c).lo |= (val) & PAGE_MASK_4K;} while (0) | ||
85 | #define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0) | ||
86 | #define context_set_domain_id(c, val) \ | ||
87 | do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0) | ||
88 | #define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0) | ||
89 | |||
90 | /* | ||
91 | * 0: readable | ||
92 | * 1: writable | ||
93 | * 2-6: reserved | ||
94 | * 7: super page | ||
95 | * 8-11: available | ||
96 | * 12-63: Host physcial address | ||
97 | */ | ||
98 | struct dma_pte { | ||
99 | u64 val; | ||
100 | }; | ||
101 | #define dma_clear_pte(p) do {(p).val = 0;} while (0) | ||
102 | |||
103 | #define DMA_PTE_READ (1) | ||
104 | #define DMA_PTE_WRITE (2) | ||
105 | |||
106 | #define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0) | ||
107 | #define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0) | ||
108 | #define dma_set_pte_prot(p, prot) \ | ||
109 | do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0) | ||
110 | #define dma_pte_addr(p) ((p).val & PAGE_MASK_4K) | ||
111 | #define dma_set_pte_addr(p, addr) do {\ | ||
112 | (p).val |= ((addr) & PAGE_MASK_4K); } while (0) | ||
113 | #define dma_pte_present(p) (((p).val & 3) != 0) | ||
114 | |||
115 | struct intel_iommu; | ||
116 | |||
117 | struct dmar_domain { | ||
118 | int id; /* domain id */ | ||
119 | struct intel_iommu *iommu; /* back pointer to owning iommu */ | ||
120 | |||
121 | struct list_head devices; /* all devices' list */ | ||
122 | struct iova_domain iovad; /* iova's that belong to this domain */ | ||
123 | |||
124 | struct dma_pte *pgd; /* virtual address */ | ||
125 | spinlock_t mapping_lock; /* page table lock */ | ||
126 | int gaw; /* max guest address width */ | ||
127 | |||
128 | /* adjusted guest address width, 0 is level 2 30-bit */ | ||
129 | int agaw; | ||
130 | |||
131 | #define DOMAIN_FLAG_MULTIPLE_DEVICES 1 | ||
132 | int flags; | ||
133 | }; | ||
134 | |||
135 | /* PCI domain-device relationship */ | ||
136 | struct device_domain_info { | ||
137 | struct list_head link; /* link to domain siblings */ | ||
138 | struct list_head global; /* link to global list */ | ||
139 | u8 bus; /* PCI bus numer */ | ||
140 | u8 devfn; /* PCI devfn number */ | ||
141 | struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */ | ||
142 | struct dmar_domain *domain; /* pointer to domain */ | ||
143 | }; | ||
144 | |||
145 | extern int init_dmars(void); | ||
146 | extern void free_dmar_iommu(struct intel_iommu *iommu); | ||
147 | |||
148 | extern int dmar_disabled; | ||
149 | |||
150 | #ifndef CONFIG_DMAR_GFX_WA | ||
151 | static inline void iommu_prepare_gfx_mapping(void) | ||
152 | { | ||
153 | return; | ||
154 | } | ||
155 | #endif /* !CONFIG_DMAR_GFX_WA */ | ||
156 | |||
157 | #endif | ||
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 56c73b847551..c360c558e59e 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -25,9 +25,99 @@ | |||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/msi.h> | 26 | #include <linux/msi.h> |
27 | 27 | ||
28 | #ifdef CONFIG_DMAR | 28 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) |
29 | struct intel_iommu; | 29 | struct intel_iommu; |
30 | 30 | ||
31 | struct dmar_drhd_unit { | ||
32 | struct list_head list; /* list of drhd units */ | ||
33 | struct acpi_dmar_header *hdr; /* ACPI header */ | ||
34 | u64 reg_base_addr; /* register base address*/ | ||
35 | struct pci_dev **devices; /* target device array */ | ||
36 | int devices_cnt; /* target device count */ | ||
37 | u8 ignored:1; /* ignore drhd */ | ||
38 | u8 include_all:1; | ||
39 | struct intel_iommu *iommu; | ||
40 | }; | ||
41 | |||
42 | extern struct list_head dmar_drhd_units; | ||
43 | |||
44 | #define for_each_drhd_unit(drhd) \ | ||
45 | list_for_each_entry(drhd, &dmar_drhd_units, list) | ||
46 | |||
47 | extern int dmar_table_init(void); | ||
48 | extern int early_dmar_detect(void); | ||
49 | extern int dmar_dev_scope_init(void); | ||
50 | |||
51 | /* Intel IOMMU detection */ | ||
52 | extern void detect_intel_iommu(void); | ||
53 | |||
54 | |||
55 | extern int parse_ioapics_under_ir(void); | ||
56 | extern int alloc_iommu(struct dmar_drhd_unit *); | ||
57 | #else | ||
58 | static inline void detect_intel_iommu(void) | ||
59 | { | ||
60 | return; | ||
61 | } | ||
62 | |||
63 | static inline int dmar_table_init(void) | ||
64 | { | ||
65 | return -ENODEV; | ||
66 | } | ||
67 | #endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ | ||
68 | |||
69 | #ifdef CONFIG_INTR_REMAP | ||
70 | extern int intr_remapping_enabled; | ||
71 | extern int enable_intr_remapping(int); | ||
72 | |||
73 | struct irte { | ||
74 | union { | ||
75 | struct { | ||
76 | __u64 present : 1, | ||
77 | fpd : 1, | ||
78 | dst_mode : 1, | ||
79 | redir_hint : 1, | ||
80 | trigger_mode : 1, | ||
81 | dlvry_mode : 3, | ||
82 | avail : 4, | ||
83 | __reserved_1 : 4, | ||
84 | vector : 8, | ||
85 | __reserved_2 : 8, | ||
86 | dest_id : 32; | ||
87 | }; | ||
88 | __u64 low; | ||
89 | }; | ||
90 | |||
91 | union { | ||
92 | struct { | ||
93 | __u64 sid : 16, | ||
94 | sq : 2, | ||
95 | svt : 2, | ||
96 | __reserved_3 : 44; | ||
97 | }; | ||
98 | __u64 high; | ||
99 | }; | ||
100 | }; | ||
101 | extern int get_irte(int irq, struct irte *entry); | ||
102 | extern int modify_irte(int irq, struct irte *irte_modified); | ||
103 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); | ||
104 | extern int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, | ||
105 | u16 sub_handle); | ||
106 | extern int map_irq_to_irte_handle(int irq, u16 *sub_handle); | ||
107 | extern int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index); | ||
108 | extern int flush_irte(int irq); | ||
109 | extern int free_irte(int irq); | ||
110 | |||
111 | extern int irq_remapped(int irq); | ||
112 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | ||
113 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | ||
114 | #else | ||
115 | #define irq_remapped(irq) (0) | ||
116 | #define enable_intr_remapping(mode) (-1) | ||
117 | #define intr_remapping_enabled (0) | ||
118 | #endif | ||
119 | |||
120 | #ifdef CONFIG_DMAR | ||
31 | extern const char *dmar_get_fault_reason(u8 fault_reason); | 121 | extern const char *dmar_get_fault_reason(u8 fault_reason); |
32 | 122 | ||
33 | /* Can't use the common MSI interrupt functions | 123 | /* Can't use the common MSI interrupt functions |
@@ -40,47 +130,30 @@ extern void dmar_msi_write(int irq, struct msi_msg *msg); | |||
40 | extern int dmar_set_interrupt(struct intel_iommu *iommu); | 130 | extern int dmar_set_interrupt(struct intel_iommu *iommu); |
41 | extern int arch_setup_dmar_msi(unsigned int irq); | 131 | extern int arch_setup_dmar_msi(unsigned int irq); |
42 | 132 | ||
43 | /* Intel IOMMU detection and initialization functions */ | 133 | extern int iommu_detected, no_iommu; |
44 | extern void detect_intel_iommu(void); | ||
45 | extern int intel_iommu_init(void); | ||
46 | |||
47 | extern int dmar_table_init(void); | ||
48 | extern int early_dmar_detect(void); | ||
49 | |||
50 | extern struct list_head dmar_drhd_units; | ||
51 | extern struct list_head dmar_rmrr_units; | 134 | extern struct list_head dmar_rmrr_units; |
52 | |||
53 | struct dmar_drhd_unit { | ||
54 | struct list_head list; /* list of drhd units */ | ||
55 | u64 reg_base_addr; /* register base address*/ | ||
56 | struct pci_dev **devices; /* target device array */ | ||
57 | int devices_cnt; /* target device count */ | ||
58 | u8 ignored:1; /* ignore drhd */ | ||
59 | u8 include_all:1; | ||
60 | struct intel_iommu *iommu; | ||
61 | }; | ||
62 | |||
63 | struct dmar_rmrr_unit { | 135 | struct dmar_rmrr_unit { |
64 | struct list_head list; /* list of rmrr units */ | 136 | struct list_head list; /* list of rmrr units */ |
137 | struct acpi_dmar_header *hdr; /* ACPI header */ | ||
65 | u64 base_address; /* reserved base address*/ | 138 | u64 base_address; /* reserved base address*/ |
66 | u64 end_address; /* reserved end address */ | 139 | u64 end_address; /* reserved end address */ |
67 | struct pci_dev **devices; /* target devices */ | 140 | struct pci_dev **devices; /* target devices */ |
68 | int devices_cnt; /* target device count */ | 141 | int devices_cnt; /* target device count */ |
69 | }; | 142 | }; |
70 | 143 | ||
71 | #define for_each_drhd_unit(drhd) \ | ||
72 | list_for_each_entry(drhd, &dmar_drhd_units, list) | ||
73 | #define for_each_rmrr_units(rmrr) \ | 144 | #define for_each_rmrr_units(rmrr) \ |
74 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) | 145 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) |
146 | /* Intel DMAR initialization functions */ | ||
147 | extern int intel_iommu_init(void); | ||
148 | extern int dmar_disabled; | ||
75 | #else | 149 | #else |
76 | static inline void detect_intel_iommu(void) | ||
77 | { | ||
78 | return; | ||
79 | } | ||
80 | static inline int intel_iommu_init(void) | 150 | static inline int intel_iommu_init(void) |
81 | { | 151 | { |
152 | #ifdef CONFIG_INTR_REMAP | ||
153 | return dmar_dev_scope_init(); | ||
154 | #else | ||
82 | return -ENODEV; | 155 | return -ENODEV; |
156 | #endif | ||
83 | } | 157 | } |
84 | |||
85 | #endif /* !CONFIG_DMAR */ | 158 | #endif /* !CONFIG_DMAR */ |
86 | #endif /* __DMAR_H__ */ | 159 | #endif /* __DMAR_H__ */ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 2a063b64133f..e5084eb5943a 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -2,29 +2,9 @@ | |||
2 | #define __DMI_H__ | 2 | #define __DMI_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/mod_devicetable.h> | ||
5 | 6 | ||
6 | enum dmi_field { | 7 | /* enum dmi_field is in mod_devicetable.h */ |
7 | DMI_NONE, | ||
8 | DMI_BIOS_VENDOR, | ||
9 | DMI_BIOS_VERSION, | ||
10 | DMI_BIOS_DATE, | ||
11 | DMI_SYS_VENDOR, | ||
12 | DMI_PRODUCT_NAME, | ||
13 | DMI_PRODUCT_VERSION, | ||
14 | DMI_PRODUCT_SERIAL, | ||
15 | DMI_PRODUCT_UUID, | ||
16 | DMI_BOARD_VENDOR, | ||
17 | DMI_BOARD_NAME, | ||
18 | DMI_BOARD_VERSION, | ||
19 | DMI_BOARD_SERIAL, | ||
20 | DMI_BOARD_ASSET_TAG, | ||
21 | DMI_CHASSIS_VENDOR, | ||
22 | DMI_CHASSIS_TYPE, | ||
23 | DMI_CHASSIS_VERSION, | ||
24 | DMI_CHASSIS_SERIAL, | ||
25 | DMI_CHASSIS_ASSET_TAG, | ||
26 | DMI_STRING_MAX, | ||
27 | }; | ||
28 | 8 | ||
29 | enum dmi_device_type { | 9 | enum dmi_device_type { |
30 | DMI_DEV_TYPE_ANY = 0, | 10 | DMI_DEV_TYPE_ANY = 0, |
@@ -48,23 +28,6 @@ struct dmi_header { | |||
48 | u16 handle; | 28 | u16 handle; |
49 | }; | 29 | }; |
50 | 30 | ||
51 | /* | ||
52 | * DMI callbacks for problem boards | ||
53 | */ | ||
54 | struct dmi_strmatch { | ||
55 | u8 slot; | ||
56 | char *substr; | ||
57 | }; | ||
58 | |||
59 | struct dmi_system_id { | ||
60 | int (*callback)(const struct dmi_system_id *); | ||
61 | const char *ident; | ||
62 | struct dmi_strmatch matches[4]; | ||
63 | void *driver_data; | ||
64 | }; | ||
65 | |||
66 | #define DMI_MATCH(a, b) { a, b } | ||
67 | |||
68 | struct dmi_device { | 31 | struct dmi_device { |
69 | struct list_head list; | 32 | struct list_head list; |
70 | int type; | 33 | int type; |
diff --git a/include/linux/ds1286.h b/include/linux/ds1286.h index d8989860e4ce..45ea0aa0aeb9 100644 --- a/include/linux/ds1286.h +++ b/include/linux/ds1286.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #ifndef __LINUX_DS1286_H | 8 | #ifndef __LINUX_DS1286_H |
9 | #define __LINUX_DS1286_H | 9 | #define __LINUX_DS1286_H |
10 | 10 | ||
11 | #include <asm/ds1286.h> | ||
12 | |||
13 | /********************************************************************** | 11 | /********************************************************************** |
14 | * register summary | 12 | * register summary |
15 | **********************************************************************/ | 13 | **********************************************************************/ |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index c8cbd90ba375..6e4ace270276 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
@@ -62,6 +62,7 @@ typedef enum fe_caps { | |||
62 | FE_CAN_HIERARCHY_AUTO = 0x100000, | 62 | FE_CAN_HIERARCHY_AUTO = 0x100000, |
63 | FE_CAN_8VSB = 0x200000, | 63 | FE_CAN_8VSB = 0x200000, |
64 | FE_CAN_16VSB = 0x400000, | 64 | FE_CAN_16VSB = 0x400000, |
65 | FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this. | ||
65 | FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) | 66 | FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) |
66 | FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically | 67 | FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically |
67 | FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output | 68 | FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output |
@@ -147,7 +148,9 @@ typedef enum fe_code_rate { | |||
147 | FEC_6_7, | 148 | FEC_6_7, |
148 | FEC_7_8, | 149 | FEC_7_8, |
149 | FEC_8_9, | 150 | FEC_8_9, |
150 | FEC_AUTO | 151 | FEC_AUTO, |
152 | FEC_3_5, | ||
153 | FEC_9_10, | ||
151 | } fe_code_rate_t; | 154 | } fe_code_rate_t; |
152 | 155 | ||
153 | 156 | ||
@@ -160,7 +163,10 @@ typedef enum fe_modulation { | |||
160 | QAM_256, | 163 | QAM_256, |
161 | QAM_AUTO, | 164 | QAM_AUTO, |
162 | VSB_8, | 165 | VSB_8, |
163 | VSB_16 | 166 | VSB_16, |
167 | PSK_8, | ||
168 | APSK_16, | ||
169 | DQPSK, | ||
164 | } fe_modulation_t; | 170 | } fe_modulation_t; |
165 | 171 | ||
166 | typedef enum fe_transmit_mode { | 172 | typedef enum fe_transmit_mode { |
@@ -239,6 +245,106 @@ struct dvb_frontend_event { | |||
239 | struct dvb_frontend_parameters parameters; | 245 | struct dvb_frontend_parameters parameters; |
240 | }; | 246 | }; |
241 | 247 | ||
248 | /* S2API Commands */ | ||
249 | #define DTV_UNDEFINED 0 | ||
250 | #define DTV_TUNE 1 | ||
251 | #define DTV_CLEAR 2 | ||
252 | #define DTV_FREQUENCY 3 | ||
253 | #define DTV_MODULATION 4 | ||
254 | #define DTV_BANDWIDTH_HZ 5 | ||
255 | #define DTV_INVERSION 6 | ||
256 | #define DTV_DISEQC_MASTER 7 | ||
257 | #define DTV_SYMBOL_RATE 8 | ||
258 | #define DTV_INNER_FEC 9 | ||
259 | #define DTV_VOLTAGE 10 | ||
260 | #define DTV_TONE 11 | ||
261 | #define DTV_PILOT 12 | ||
262 | #define DTV_ROLLOFF 13 | ||
263 | #define DTV_DISEQC_SLAVE_REPLY 14 | ||
264 | |||
265 | /* Basic enumeration set for querying unlimited capabilities */ | ||
266 | #define DTV_FE_CAPABILITY_COUNT 15 | ||
267 | #define DTV_FE_CAPABILITY 16 | ||
268 | #define DTV_DELIVERY_SYSTEM 17 | ||
269 | |||
270 | #define DTV_API_VERSION 35 | ||
271 | #define DTV_API_VERSION 35 | ||
272 | #define DTV_CODE_RATE_HP 36 | ||
273 | #define DTV_CODE_RATE_LP 37 | ||
274 | #define DTV_GUARD_INTERVAL 38 | ||
275 | #define DTV_TRANSMISSION_MODE 39 | ||
276 | #define DTV_HIERARCHY 40 | ||
277 | |||
278 | #define DTV_MAX_COMMAND DTV_HIERARCHY | ||
279 | |||
280 | typedef enum fe_pilot { | ||
281 | PILOT_ON, | ||
282 | PILOT_OFF, | ||
283 | PILOT_AUTO, | ||
284 | } fe_pilot_t; | ||
285 | |||
286 | typedef enum fe_rolloff { | ||
287 | ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ | ||
288 | ROLLOFF_20, | ||
289 | ROLLOFF_25, | ||
290 | ROLLOFF_AUTO, | ||
291 | } fe_rolloff_t; | ||
292 | |||
293 | typedef enum fe_delivery_system { | ||
294 | SYS_UNDEFINED, | ||
295 | SYS_DVBC_ANNEX_AC, | ||
296 | SYS_DVBC_ANNEX_B, | ||
297 | SYS_DVBT, | ||
298 | SYS_DVBS, | ||
299 | SYS_DVBS2, | ||
300 | SYS_DVBH, | ||
301 | SYS_ISDBT, | ||
302 | SYS_ISDBS, | ||
303 | SYS_ISDBC, | ||
304 | SYS_ATSC, | ||
305 | SYS_ATSCMH, | ||
306 | SYS_DMBTH, | ||
307 | SYS_CMMB, | ||
308 | SYS_DAB, | ||
309 | } fe_delivery_system_t; | ||
310 | |||
311 | struct dtv_cmds_h { | ||
312 | char *name; /* A display name for debugging purposes */ | ||
313 | |||
314 | __u32 cmd; /* A unique ID */ | ||
315 | |||
316 | /* Flags */ | ||
317 | __u32 set:1; /* Either a set or get property */ | ||
318 | __u32 buffer:1; /* Does this property use the buffer? */ | ||
319 | __u32 reserved:30; /* Align */ | ||
320 | }; | ||
321 | |||
322 | struct dtv_property { | ||
323 | __u32 cmd; | ||
324 | __u32 reserved[3]; | ||
325 | union { | ||
326 | __u32 data; | ||
327 | struct { | ||
328 | __u8 data[32]; | ||
329 | __u32 len; | ||
330 | __u32 reserved1[3]; | ||
331 | void *reserved2; | ||
332 | } buffer; | ||
333 | } u; | ||
334 | int result; | ||
335 | } __attribute__ ((packed)); | ||
336 | |||
337 | /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */ | ||
338 | #define DTV_IOCTL_MAX_MSGS 64 | ||
339 | |||
340 | struct dtv_properties { | ||
341 | __u32 num; | ||
342 | struct dtv_property *props; | ||
343 | }; | ||
344 | |||
345 | #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) | ||
346 | #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) | ||
347 | |||
242 | 348 | ||
243 | /** | 349 | /** |
244 | * When set, this flag will disable any zigzagging or other "normal" tuning | 350 | * When set, this flag will disable any zigzagging or other "normal" tuning |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 126e0c26cb09..25b823b81734 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #ifndef _DVBVERSION_H_ | 23 | #ifndef _DVBVERSION_H_ |
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 3 | 26 | #define DVB_API_VERSION 5 |
27 | #define DVB_API_VERSION_MINOR 2 | 27 | #define DVB_API_VERSION_MINOR 0 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dynamic_printk.h b/include/linux/dynamic_printk.h new file mode 100644 index 000000000000..2d528d009074 --- /dev/null +++ b/include/linux/dynamic_printk.h | |||
@@ -0,0 +1,93 @@ | |||
1 | #ifndef _DYNAMIC_PRINTK_H | ||
2 | #define _DYNAMIC_PRINTK_H | ||
3 | |||
4 | #define DYNAMIC_DEBUG_HASH_BITS 6 | ||
5 | #define DEBUG_HASH_TABLE_SIZE (1 << DYNAMIC_DEBUG_HASH_BITS) | ||
6 | |||
7 | #define TYPE_BOOLEAN 1 | ||
8 | |||
9 | #define DYNAMIC_ENABLED_ALL 0 | ||
10 | #define DYNAMIC_ENABLED_NONE 1 | ||
11 | #define DYNAMIC_ENABLED_SOME 2 | ||
12 | |||
13 | extern int dynamic_enabled; | ||
14 | |||
15 | /* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which | ||
16 | * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They | ||
17 | * use independent hash functions, to reduce the chance of false positives. | ||
18 | */ | ||
19 | extern long long dynamic_printk_enabled; | ||
20 | extern long long dynamic_printk_enabled2; | ||
21 | |||
22 | struct mod_debug { | ||
23 | char *modname; | ||
24 | char *logical_modname; | ||
25 | char *flag_names; | ||
26 | int type; | ||
27 | int hash; | ||
28 | int hash2; | ||
29 | } __attribute__((aligned(8))); | ||
30 | |||
31 | int register_dynamic_debug_module(char *mod_name, int type, char *share_name, | ||
32 | char *flags, int hash, int hash2); | ||
33 | |||
34 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
35 | extern int unregister_dynamic_debug_module(char *mod_name); | ||
36 | extern int __dynamic_dbg_enabled_helper(char *modname, int type, | ||
37 | int value, int hash); | ||
38 | |||
39 | #define __dynamic_dbg_enabled(module, type, value, level, hash) ({ \ | ||
40 | int __ret = 0; \ | ||
41 | if (unlikely((dynamic_printk_enabled & (1LL << DEBUG_HASH)) && \ | ||
42 | (dynamic_printk_enabled2 & (1LL << DEBUG_HASH2)))) \ | ||
43 | __ret = __dynamic_dbg_enabled_helper(module, type, \ | ||
44 | value, hash);\ | ||
45 | __ret; }) | ||
46 | |||
47 | #define dynamic_pr_debug(fmt, ...) do { \ | ||
48 | static char mod_name[] \ | ||
49 | __attribute__((section("__verbose_strings"))) \ | ||
50 | = KBUILD_MODNAME; \ | ||
51 | static struct mod_debug descriptor \ | ||
52 | __used \ | ||
53 | __attribute__((section("__verbose"), aligned(8))) = \ | ||
54 | { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\ | ||
55 | if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \ | ||
56 | 0, 0, DEBUG_HASH)) \ | ||
57 | printk(KERN_DEBUG KBUILD_MODNAME ":" fmt, \ | ||
58 | ##__VA_ARGS__); \ | ||
59 | } while (0) | ||
60 | |||
61 | #define dynamic_dev_dbg(dev, format, ...) do { \ | ||
62 | static char mod_name[] \ | ||
63 | __attribute__((section("__verbose_strings"))) \ | ||
64 | = KBUILD_MODNAME; \ | ||
65 | static struct mod_debug descriptor \ | ||
66 | __used \ | ||
67 | __attribute__((section("__verbose"), aligned(8))) = \ | ||
68 | { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\ | ||
69 | if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \ | ||
70 | 0, 0, DEBUG_HASH)) \ | ||
71 | dev_printk(KERN_DEBUG, dev, \ | ||
72 | KBUILD_MODNAME ": " format, \ | ||
73 | ##__VA_ARGS__); \ | ||
74 | } while (0) | ||
75 | |||
76 | #else | ||
77 | |||
78 | static inline int unregister_dynamic_debug_module(const char *mod_name) | ||
79 | { | ||
80 | return 0; | ||
81 | } | ||
82 | static inline int __dynamic_dbg_enabled_helper(char *modname, int type, | ||
83 | int value, int hash) | ||
84 | { | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | #define __dynamic_dbg_enabled(module, type, value, level, hash) ({ 0; }) | ||
89 | #define dynamic_pr_debug(fmt, ...) do { } while (0) | ||
90 | #define dynamic_dev_dbg(dev, format, ...) do { } while (0) | ||
91 | #endif | ||
92 | |||
93 | #endif | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 639624b55fbe..92f6f634e3e6 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -112,6 +112,7 @@ extern struct request *elv_latter_request(struct request_queue *, struct request | |||
112 | extern int elv_register_queue(struct request_queue *q); | 112 | extern int elv_register_queue(struct request_queue *q); |
113 | extern void elv_unregister_queue(struct request_queue *q); | 113 | extern void elv_unregister_queue(struct request_queue *q); |
114 | extern int elv_may_queue(struct request_queue *, int); | 114 | extern int elv_may_queue(struct request_queue *, int); |
115 | extern void elv_abort_queue(struct request_queue *); | ||
115 | extern void elv_completed_request(struct request_queue *, struct request *); | 116 | extern void elv_completed_request(struct request_queue *, struct request *); |
116 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); | 117 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); |
117 | extern void elv_put_request(struct request_queue *, struct request *); | 118 | extern void elv_put_request(struct request_queue *, struct request *); |
@@ -173,15 +174,15 @@ enum { | |||
173 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | 174 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) |
174 | 175 | ||
175 | /* | 176 | /* |
176 | * Hack to reuse the donelist list_head as the fifo time holder while | 177 | * Hack to reuse the csd.list list_head as the fifo time holder while |
177 | * the request is in the io scheduler. Saves an unsigned long in rq. | 178 | * the request is in the io scheduler. Saves an unsigned long in rq. |
178 | */ | 179 | */ |
179 | #define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) | 180 | #define rq_fifo_time(rq) ((unsigned long) (rq)->csd.list.next) |
180 | #define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) | 181 | #define rq_set_fifo_time(rq,exp) ((rq)->csd.list.next = (void *) (exp)) |
181 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | 182 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) |
182 | #define rq_fifo_clear(rq) do { \ | 183 | #define rq_fifo_clear(rq) do { \ |
183 | list_del_init(&(rq)->queuelist); \ | 184 | list_del_init(&(rq)->queuelist); \ |
184 | INIT_LIST_HEAD(&(rq)->donelist); \ | 185 | INIT_LIST_HEAD(&(rq)->csd.list); \ |
185 | } while (0) | 186 | } while (0) |
186 | 187 | ||
187 | /* | 188 | /* |
diff --git a/include/linux/elf.h b/include/linux/elf.h index edc3dac3f02f..0b61ca41a044 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -360,6 +360,7 @@ typedef struct elf64_shdr { | |||
360 | #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ | 360 | #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ |
361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | ||
363 | 364 | ||
364 | 365 | ||
365 | /* Note header in a PT_NOTE section */ | 366 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 2efe7b863cff..78c775a83f7c 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #ifdef EXT2FS_DEBUG | 47 | #ifdef EXT2FS_DEBUG |
48 | # define ext2_debug(f, a...) { \ | 48 | # define ext2_debug(f, a...) { \ |
49 | printk ("EXT2-fs DEBUG (%s, %d): %s:", \ | 49 | printk ("EXT2-fs DEBUG (%s, %d): %s:", \ |
50 | __FILE__, __LINE__, __FUNCTION__); \ | 50 | __FILE__, __LINE__, __func__); \ |
51 | printk (f, ## a); \ | 51 | printk (f, ## a); \ |
52 | } | 52 | } |
53 | #else | 53 | #else |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 80171ee89a22..159d9b476cd7 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -43,7 +43,7 @@ | |||
43 | #define ext3_debug(f, a...) \ | 43 | #define ext3_debug(f, a...) \ |
44 | do { \ | 44 | do { \ |
45 | printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \ | 45 | printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \ |
46 | __FILE__, __LINE__, __FUNCTION__); \ | 46 | __FILE__, __LINE__, __func__); \ |
47 | printk (KERN_DEBUG f, ## a); \ | 47 | printk (KERN_DEBUG f, ## a); \ |
48 | } while (0) | 48 | } while (0) |
49 | #else | 49 | #else |
@@ -837,6 +837,8 @@ extern void ext3_truncate (struct inode *); | |||
837 | extern void ext3_set_inode_flags(struct inode *); | 837 | extern void ext3_set_inode_flags(struct inode *); |
838 | extern void ext3_get_inode_flags(struct ext3_inode_info *); | 838 | extern void ext3_get_inode_flags(struct ext3_inode_info *); |
839 | extern void ext3_set_aops(struct inode *inode); | 839 | extern void ext3_set_aops(struct inode *inode); |
840 | extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | ||
841 | u64 start, u64 len); | ||
840 | 842 | ||
841 | /* ioctl.c */ | 843 | /* ioctl.c */ |
842 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, | 844 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, |
@@ -869,7 +871,7 @@ extern void ext3_update_dynamic_rev (struct super_block *sb); | |||
869 | #define ext3_std_error(sb, errno) \ | 871 | #define ext3_std_error(sb, errno) \ |
870 | do { \ | 872 | do { \ |
871 | if ((errno)) \ | 873 | if ((errno)) \ |
872 | __ext3_std_error((sb), __FUNCTION__, (errno)); \ | 874 | __ext3_std_error((sb), __func__, (errno)); \ |
873 | } while (0) | 875 | } while (0) |
874 | 876 | ||
875 | /* | 877 | /* |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 8c43b13a02fe..cf82d519be40 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -137,17 +137,17 @@ int __ext3_journal_dirty_metadata(const char *where, | |||
137 | handle_t *handle, struct buffer_head *bh); | 137 | handle_t *handle, struct buffer_head *bh); |
138 | 138 | ||
139 | #define ext3_journal_get_undo_access(handle, bh) \ | 139 | #define ext3_journal_get_undo_access(handle, bh) \ |
140 | __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh)) | 140 | __ext3_journal_get_undo_access(__func__, (handle), (bh)) |
141 | #define ext3_journal_get_write_access(handle, bh) \ | 141 | #define ext3_journal_get_write_access(handle, bh) \ |
142 | __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh)) | 142 | __ext3_journal_get_write_access(__func__, (handle), (bh)) |
143 | #define ext3_journal_revoke(handle, blocknr, bh) \ | 143 | #define ext3_journal_revoke(handle, blocknr, bh) \ |
144 | __ext3_journal_revoke(__FUNCTION__, (handle), (blocknr), (bh)) | 144 | __ext3_journal_revoke(__func__, (handle), (blocknr), (bh)) |
145 | #define ext3_journal_get_create_access(handle, bh) \ | 145 | #define ext3_journal_get_create_access(handle, bh) \ |
146 | __ext3_journal_get_create_access(__FUNCTION__, (handle), (bh)) | 146 | __ext3_journal_get_create_access(__func__, (handle), (bh)) |
147 | #define ext3_journal_dirty_metadata(handle, bh) \ | 147 | #define ext3_journal_dirty_metadata(handle, bh) \ |
148 | __ext3_journal_dirty_metadata(__FUNCTION__, (handle), (bh)) | 148 | __ext3_journal_dirty_metadata(__func__, (handle), (bh)) |
149 | #define ext3_journal_forget(handle, bh) \ | 149 | #define ext3_journal_forget(handle, bh) \ |
150 | __ext3_journal_forget(__FUNCTION__, (handle), (bh)) | 150 | __ext3_journal_forget(__func__, (handle), (bh)) |
151 | 151 | ||
152 | int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); | 152 | int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); |
153 | 153 | ||
@@ -160,7 +160,7 @@ static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | #define ext3_journal_stop(handle) \ | 162 | #define ext3_journal_stop(handle) \ |
163 | __ext3_journal_stop(__FUNCTION__, (handle)) | 163 | __ext3_journal_stop(__func__, (handle)) |
164 | 164 | ||
165 | static inline handle_t *ext3_journal_current_handle(void) | 165 | static inline handle_t *ext3_journal_current_handle(void) |
166 | { | 166 | { |
diff --git a/include/linux/fd.h b/include/linux/fd.h index b6bd41d2b460..f5d194af07a8 100644 --- a/include/linux/fd.h +++ b/include/linux/fd.h | |||
@@ -15,10 +15,16 @@ struct floppy_struct { | |||
15 | sect, /* sectors per track */ | 15 | sect, /* sectors per track */ |
16 | head, /* nr of heads */ | 16 | head, /* nr of heads */ |
17 | track, /* nr of tracks */ | 17 | track, /* nr of tracks */ |
18 | stretch; /* !=0 means double track steps */ | 18 | stretch; /* bit 0 !=0 means double track steps */ |
19 | /* bit 1 != 0 means swap sides */ | ||
20 | /* bits 2..9 give the first sector */ | ||
21 | /* number (the LSB is flipped) */ | ||
19 | #define FD_STRETCH 1 | 22 | #define FD_STRETCH 1 |
20 | #define FD_SWAPSIDES 2 | 23 | #define FD_SWAPSIDES 2 |
21 | #define FD_ZEROBASED 4 | 24 | #define FD_ZEROBASED 4 |
25 | #define FD_SECTBASEMASK 0x3FC | ||
26 | #define FD_MKSECTBASE(s) (((s) ^ 1) << 2) | ||
27 | #define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1) | ||
22 | 28 | ||
23 | unsigned char gap, /* gap1 size */ | 29 | unsigned char gap, /* gap1 size */ |
24 | 30 | ||
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h new file mode 100644 index 000000000000..671decbd2aeb --- /dev/null +++ b/include/linux/fiemap.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * FS_IOC_FIEMAP ioctl infrastructure. | ||
3 | * | ||
4 | * Some portions copyright (C) 2007 Cluster File Systems, Inc | ||
5 | * | ||
6 | * Authors: Mark Fasheh <mfasheh@suse.com> | ||
7 | * Kalpak Shah <kalpak.shah@sun.com> | ||
8 | * Andreas Dilger <adilger@sun.com> | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_FIEMAP_H | ||
12 | #define _LINUX_FIEMAP_H | ||
13 | |||
14 | struct fiemap_extent { | ||
15 | __u64 fe_logical; /* logical offset in bytes for the start of | ||
16 | * the extent from the beginning of the file */ | ||
17 | __u64 fe_physical; /* physical offset in bytes for the start | ||
18 | * of the extent from the beginning of the disk */ | ||
19 | __u64 fe_length; /* length in bytes for this extent */ | ||
20 | __u64 fe_reserved64[2]; | ||
21 | __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */ | ||
22 | __u32 fe_reserved[3]; | ||
23 | }; | ||
24 | |||
25 | struct fiemap { | ||
26 | __u64 fm_start; /* logical offset (inclusive) at | ||
27 | * which to start mapping (in) */ | ||
28 | __u64 fm_length; /* logical length of mapping which | ||
29 | * userspace wants (in) */ | ||
30 | __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */ | ||
31 | __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ | ||
32 | __u32 fm_extent_count; /* size of fm_extents array (in) */ | ||
33 | __u32 fm_reserved; | ||
34 | struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ | ||
35 | }; | ||
36 | |||
37 | #define FIEMAP_MAX_OFFSET (~0ULL) | ||
38 | |||
39 | #define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */ | ||
40 | #define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */ | ||
41 | |||
42 | #define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR) | ||
43 | |||
44 | #define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */ | ||
45 | #define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */ | ||
46 | #define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending. | ||
47 | * Sets EXTENT_UNKNOWN. */ | ||
48 | #define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read | ||
49 | * while fs is unmounted */ | ||
50 | #define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs. | ||
51 | * Sets EXTENT_NO_BYPASS. */ | ||
52 | #define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be | ||
53 | * block aligned. */ | ||
54 | #define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata. | ||
55 | * Sets EXTENT_NOT_ALIGNED.*/ | ||
56 | #define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block. | ||
57 | * Sets EXTENT_NOT_ALIGNED.*/ | ||
58 | #define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but | ||
59 | * no data (i.e. zero). */ | ||
60 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively | ||
61 | * support extents. Result | ||
62 | * merged for efficiency. */ | ||
63 | |||
64 | #endif /* _LINUX_FIEMAP_H */ | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 0f0e271f97fa..4d078e99c017 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -154,8 +154,13 @@ struct fw_cdev_event_iso_interrupt { | |||
154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST | 154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST |
155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT | 155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT |
156 | * | 156 | * |
157 | * Convenience union for userspace use. Events could be read(2) into a char | 157 | * Convenience union for userspace use. Events could be read(2) into an |
158 | * buffer and then cast to this union for further processing. | 158 | * appropriately aligned char buffer and then cast to this union for further |
159 | * processing. Note that for a request, response or iso_interrupt event, | ||
160 | * the data[] or header[] may make the size of the full event larger than | ||
161 | * sizeof(union fw_cdev_event). Also note that if you attempt to read(2) | ||
162 | * an event into a buffer that is not large enough for it, the data that does | ||
163 | * not fit will be discarded so that the next read(2) will return a new event. | ||
159 | */ | 164 | */ |
160 | union fw_cdev_event { | 165 | union fw_cdev_event { |
161 | struct fw_cdev_event_common common; | 166 | struct fw_cdev_event_common common; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 580b513668fe..a6a625be13fc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -86,7 +86,9 @@ extern int dir_notify_enable; | |||
86 | #define READ_META (READ | (1 << BIO_RW_META)) | 86 | #define READ_META (READ | (1 << BIO_RW_META)) |
87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) | 88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) |
89 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 89 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) |
90 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | ||
91 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | ||
90 | 92 | ||
91 | #define SEL_IN 1 | 93 | #define SEL_IN 1 |
92 | #define SEL_OUT 2 | 94 | #define SEL_OUT 2 |
@@ -222,6 +224,7 @@ extern int dir_notify_enable; | |||
222 | #define BLKTRACESTART _IO(0x12,116) | 224 | #define BLKTRACESTART _IO(0x12,116) |
223 | #define BLKTRACESTOP _IO(0x12,117) | 225 | #define BLKTRACESTOP _IO(0x12,117) |
224 | #define BLKTRACETEARDOWN _IO(0x12,118) | 226 | #define BLKTRACETEARDOWN _IO(0x12,118) |
227 | #define BLKDISCARD _IO(0x12,119) | ||
225 | 228 | ||
226 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 229 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
227 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 230 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
@@ -231,6 +234,7 @@ extern int dir_notify_enable; | |||
231 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 234 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
232 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | 235 | #define FS_IOC_GETVERSION _IOR('v', 1, long) |
233 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | 236 | #define FS_IOC_SETVERSION _IOW('v', 2, long) |
237 | #define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) | ||
234 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | 238 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) |
235 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | 239 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) |
236 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | 240 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) |
@@ -291,6 +295,7 @@ extern int dir_notify_enable; | |||
291 | #include <linux/mutex.h> | 295 | #include <linux/mutex.h> |
292 | #include <linux/capability.h> | 296 | #include <linux/capability.h> |
293 | #include <linux/semaphore.h> | 297 | #include <linux/semaphore.h> |
298 | #include <linux/fiemap.h> | ||
294 | 299 | ||
295 | #include <asm/atomic.h> | 300 | #include <asm/atomic.h> |
296 | #include <asm/byteorder.h> | 301 | #include <asm/byteorder.h> |
@@ -942,6 +947,14 @@ struct lock_manager_operations { | |||
942 | int (*fl_change)(struct file_lock **, int); | 947 | int (*fl_change)(struct file_lock **, int); |
943 | }; | 948 | }; |
944 | 949 | ||
950 | struct lock_manager { | ||
951 | struct list_head list; | ||
952 | }; | ||
953 | |||
954 | void locks_start_grace(struct lock_manager *); | ||
955 | void locks_end_grace(struct lock_manager *); | ||
956 | int locks_in_grace(void); | ||
957 | |||
945 | /* that will die - we need it for nfs_lock_info */ | 958 | /* that will die - we need it for nfs_lock_info */ |
946 | #include <linux/nfs_fs_i.h> | 959 | #include <linux/nfs_fs_i.h> |
947 | 960 | ||
@@ -983,6 +996,13 @@ struct file_lock { | |||
983 | 996 | ||
984 | #include <linux/fcntl.h> | 997 | #include <linux/fcntl.h> |
985 | 998 | ||
999 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | ||
1000 | |||
1001 | /* fs/sync.c */ | ||
1002 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1003 | loff_t endbyte, unsigned int flags); | ||
1004 | |||
1005 | #ifdef CONFIG_FILE_LOCKING | ||
986 | extern int fcntl_getlk(struct file *, struct flock __user *); | 1006 | extern int fcntl_getlk(struct file *, struct flock __user *); |
987 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | 1007 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, |
988 | struct flock __user *); | 1008 | struct flock __user *); |
@@ -993,14 +1013,9 @@ extern int fcntl_setlk64(unsigned int, struct file *, unsigned int, | |||
993 | struct flock64 __user *); | 1013 | struct flock64 __user *); |
994 | #endif | 1014 | #endif |
995 | 1015 | ||
996 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | ||
997 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | 1016 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); |
998 | extern int fcntl_getlease(struct file *filp); | 1017 | extern int fcntl_getlease(struct file *filp); |
999 | 1018 | ||
1000 | /* fs/sync.c */ | ||
1001 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1002 | loff_t endbyte, unsigned int flags); | ||
1003 | |||
1004 | /* fs/locks.c */ | 1019 | /* fs/locks.c */ |
1005 | extern void locks_init_lock(struct file_lock *); | 1020 | extern void locks_init_lock(struct file_lock *); |
1006 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 1021 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
@@ -1023,6 +1038,37 @@ extern int lease_modify(struct file_lock **, int); | |||
1023 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 1038 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
1024 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 1039 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
1025 | extern struct seq_operations locks_seq_operations; | 1040 | extern struct seq_operations locks_seq_operations; |
1041 | #else /* !CONFIG_FILE_LOCKING */ | ||
1042 | #define fcntl_getlk(a, b) ({ -EINVAL; }) | ||
1043 | #define fcntl_setlk(a, b, c, d) ({ -EACCES; }) | ||
1044 | #if BITS_PER_LONG == 32 | ||
1045 | #define fcntl_getlk64(a, b) ({ -EINVAL; }) | ||
1046 | #define fcntl_setlk64(a, b, c, d) ({ -EACCES; }) | ||
1047 | #endif | ||
1048 | #define fcntl_setlease(a, b, c) ({ 0; }) | ||
1049 | #define fcntl_getlease(a) ({ 0; }) | ||
1050 | #define locks_init_lock(a) ({ }) | ||
1051 | #define __locks_copy_lock(a, b) ({ }) | ||
1052 | #define locks_copy_lock(a, b) ({ }) | ||
1053 | #define locks_remove_posix(a, b) ({ }) | ||
1054 | #define locks_remove_flock(a) ({ }) | ||
1055 | #define posix_test_lock(a, b) ({ 0; }) | ||
1056 | #define posix_lock_file(a, b, c) ({ -ENOLCK; }) | ||
1057 | #define posix_lock_file_wait(a, b) ({ -ENOLCK; }) | ||
1058 | #define posix_unblock_lock(a, b) (-ENOENT) | ||
1059 | #define vfs_test_lock(a, b) ({ 0; }) | ||
1060 | #define vfs_lock_file(a, b, c, d) (-ENOLCK) | ||
1061 | #define vfs_cancel_lock(a, b) ({ 0; }) | ||
1062 | #define flock_lock_file_wait(a, b) ({ -ENOLCK; }) | ||
1063 | #define __break_lease(a, b) ({ 0; }) | ||
1064 | #define lease_get_mtime(a, b) ({ }) | ||
1065 | #define generic_setlease(a, b, c) ({ -EINVAL; }) | ||
1066 | #define vfs_setlease(a, b, c) ({ -EINVAL; }) | ||
1067 | #define lease_modify(a, b) ({ -EINVAL; }) | ||
1068 | #define lock_may_read(a, b, c) ({ 1; }) | ||
1069 | #define lock_may_write(a, b, c) ({ 1; }) | ||
1070 | #endif /* !CONFIG_FILE_LOCKING */ | ||
1071 | |||
1026 | 1072 | ||
1027 | struct fasync_struct { | 1073 | struct fasync_struct { |
1028 | int magic; | 1074 | int magic; |
@@ -1179,6 +1225,20 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1179 | extern int file_permission(struct file *, int); | 1225 | extern int file_permission(struct file *, int); |
1180 | 1226 | ||
1181 | /* | 1227 | /* |
1228 | * VFS FS_IOC_FIEMAP helper definitions. | ||
1229 | */ | ||
1230 | struct fiemap_extent_info { | ||
1231 | unsigned int fi_flags; /* Flags as passed from user */ | ||
1232 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | ||
1233 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | ||
1234 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | ||
1235 | * array */ | ||
1236 | }; | ||
1237 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | ||
1238 | u64 phys, u64 len, u32 flags); | ||
1239 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
1240 | |||
1241 | /* | ||
1182 | * File types | 1242 | * File types |
1183 | * | 1243 | * |
1184 | * NOTE! These match bits 12..15 of stat.st_mode | 1244 | * NOTE! These match bits 12..15 of stat.st_mode |
@@ -1287,6 +1347,8 @@ struct inode_operations { | |||
1287 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1347 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1288 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | 1348 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, |
1289 | loff_t len); | 1349 | loff_t len); |
1350 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | ||
1351 | u64 len); | ||
1290 | }; | 1352 | }; |
1291 | 1353 | ||
1292 | struct seq_file; | 1354 | struct seq_file; |
@@ -1554,9 +1616,12 @@ extern int vfs_statfs(struct dentry *, struct kstatfs *); | |||
1554 | /* /sys/fs */ | 1616 | /* /sys/fs */ |
1555 | extern struct kobject *fs_kobj; | 1617 | extern struct kobject *fs_kobj; |
1556 | 1618 | ||
1619 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1620 | |||
1557 | #define FLOCK_VERIFY_READ 1 | 1621 | #define FLOCK_VERIFY_READ 1 |
1558 | #define FLOCK_VERIFY_WRITE 2 | 1622 | #define FLOCK_VERIFY_WRITE 2 |
1559 | 1623 | ||
1624 | #ifdef CONFIG_FILE_LOCKING | ||
1560 | extern int locks_mandatory_locked(struct inode *); | 1625 | extern int locks_mandatory_locked(struct inode *); |
1561 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); | 1626 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); |
1562 | 1627 | ||
@@ -1587,8 +1652,6 @@ static inline int locks_verify_locked(struct inode *inode) | |||
1587 | return 0; | 1652 | return 0; |
1588 | } | 1653 | } |
1589 | 1654 | ||
1590 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1591 | |||
1592 | static inline int locks_verify_truncate(struct inode *inode, | 1655 | static inline int locks_verify_truncate(struct inode *inode, |
1593 | struct file *filp, | 1656 | struct file *filp, |
1594 | loff_t size) | 1657 | loff_t size) |
@@ -1609,6 +1672,15 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1609 | return __break_lease(inode, mode); | 1672 | return __break_lease(inode, mode); |
1610 | return 0; | 1673 | return 0; |
1611 | } | 1674 | } |
1675 | #else /* !CONFIG_FILE_LOCKING */ | ||
1676 | #define locks_mandatory_locked(a) ({ 0; }) | ||
1677 | #define locks_mandatory_area(a, b, c, d, e) ({ 0; }) | ||
1678 | #define __mandatory_lock(a) ({ 0; }) | ||
1679 | #define mandatory_lock(a) ({ 0; }) | ||
1680 | #define locks_verify_locked(a) ({ 0; }) | ||
1681 | #define locks_verify_truncate(a, b, c) ({ 0; }) | ||
1682 | #define break_lease(a, b) ({ 0; }) | ||
1683 | #endif /* CONFIG_FILE_LOCKING */ | ||
1612 | 1684 | ||
1613 | /* fs/open.c */ | 1685 | /* fs/open.c */ |
1614 | 1686 | ||
@@ -1682,6 +1754,7 @@ extern void chrdev_show(struct seq_file *,off_t); | |||
1682 | 1754 | ||
1683 | /* fs/block_dev.c */ | 1755 | /* fs/block_dev.c */ |
1684 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1756 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1757 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | ||
1685 | 1758 | ||
1686 | #ifdef CONFIG_BLOCK | 1759 | #ifdef CONFIG_BLOCK |
1687 | #define BLKDEV_MAJOR_HASH_SIZE 255 | 1760 | #define BLKDEV_MAJOR_HASH_SIZE 255 |
@@ -1718,6 +1791,9 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1718 | */ | 1791 | */ |
1719 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1792 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1720 | 1793 | ||
1794 | extern void check_disk_size_change(struct gendisk *disk, | ||
1795 | struct block_device *bdev); | ||
1796 | extern int revalidate_disk(struct gendisk *); | ||
1721 | extern int check_disk_change(struct block_device *); | 1797 | extern int check_disk_change(struct block_device *); |
1722 | extern int __invalidate_device(struct block_device *); | 1798 | extern int __invalidate_device(struct block_device *); |
1723 | extern int invalidate_partition(struct gendisk *, int); | 1799 | extern int invalidate_partition(struct gendisk *, int); |
@@ -1980,6 +2056,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
1980 | 2056 | ||
1981 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2057 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
1982 | unsigned long arg); | 2058 | unsigned long arg); |
2059 | extern int generic_block_fiemap(struct inode *inode, | ||
2060 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2061 | u64 len, get_block_t *get_block); | ||
1983 | 2062 | ||
1984 | extern void get_filesystem(struct file_system_type *fs); | 2063 | extern void get_filesystem(struct file_system_type *fs); |
1985 | extern void put_filesystem(struct file_system_type *fs); | 2064 | extern void put_filesystem(struct file_system_type *fs); |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index f64e29c0ef3f..0cd825f7363a 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -146,10 +146,11 @@ static inline void gameport_unpin_driver(struct gameport *gameport) | |||
146 | mutex_unlock(&gameport->drv_mutex); | 146 | mutex_unlock(&gameport->drv_mutex); |
147 | } | 147 | } |
148 | 148 | ||
149 | void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); | 149 | int __gameport_register_driver(struct gameport_driver *drv, |
150 | static inline void gameport_register_driver(struct gameport_driver *drv) | 150 | struct module *owner, const char *mod_name); |
151 | static inline int __must_check gameport_register_driver(struct gameport_driver *drv) | ||
151 | { | 152 | { |
152 | __gameport_register_driver(drv, THIS_MODULE); | 153 | return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); |
153 | } | 154 | } |
154 | 155 | ||
155 | void gameport_unregister_driver(struct gameport_driver *drv); | 156 | void gameport_unregister_driver(struct gameport_driver *drv); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index be4f5e5bfe06..206cdf96c3a7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -11,12 +11,15 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/kdev_t.h> | 13 | #include <linux/kdev_t.h> |
14 | #include <linux/rcupdate.h> | ||
14 | 15 | ||
15 | #ifdef CONFIG_BLOCK | 16 | #ifdef CONFIG_BLOCK |
16 | 17 | ||
17 | #define kobj_to_dev(k) container_of(k, struct device, kobj) | 18 | #define kobj_to_dev(k) container_of((k), struct device, kobj) |
18 | #define dev_to_disk(device) container_of(device, struct gendisk, dev) | 19 | #define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev) |
19 | #define dev_to_part(device) container_of(device, struct hd_struct, dev) | 20 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) |
21 | #define disk_to_dev(disk) (&(disk)->part0.__dev) | ||
22 | #define part_to_dev(part) (&((part)->__dev)) | ||
20 | 23 | ||
21 | extern struct device_type part_type; | 24 | extern struct device_type part_type; |
22 | extern struct kobject *block_depr; | 25 | extern struct kobject *block_depr; |
@@ -55,6 +58,9 @@ enum { | |||
55 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ | 58 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ |
56 | }; | 59 | }; |
57 | 60 | ||
61 | #define DISK_MAX_PARTS 256 | ||
62 | #define DISK_NAME_LEN 32 | ||
63 | |||
58 | #include <linux/major.h> | 64 | #include <linux/major.h> |
59 | #include <linux/device.h> | 65 | #include <linux/device.h> |
60 | #include <linux/smp.h> | 66 | #include <linux/smp.h> |
@@ -87,7 +93,7 @@ struct disk_stats { | |||
87 | struct hd_struct { | 93 | struct hd_struct { |
88 | sector_t start_sect; | 94 | sector_t start_sect; |
89 | sector_t nr_sects; | 95 | sector_t nr_sects; |
90 | struct device dev; | 96 | struct device __dev; |
91 | struct kobject *holder_dir; | 97 | struct kobject *holder_dir; |
92 | int policy, partno; | 98 | int policy, partno; |
93 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 99 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
@@ -100,6 +106,7 @@ struct hd_struct { | |||
100 | #else | 106 | #else |
101 | struct disk_stats dkstats; | 107 | struct disk_stats dkstats; |
102 | #endif | 108 | #endif |
109 | struct rcu_head rcu_head; | ||
103 | }; | 110 | }; |
104 | 111 | ||
105 | #define GENHD_FL_REMOVABLE 1 | 112 | #define GENHD_FL_REMOVABLE 1 |
@@ -108,100 +115,148 @@ struct hd_struct { | |||
108 | #define GENHD_FL_CD 8 | 115 | #define GENHD_FL_CD 8 |
109 | #define GENHD_FL_UP 16 | 116 | #define GENHD_FL_UP 16 |
110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 117 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
111 | #define GENHD_FL_FAIL 64 | 118 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
119 | |||
120 | #define BLK_SCSI_MAX_CMDS (256) | ||
121 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
122 | |||
123 | struct blk_scsi_cmd_filter { | ||
124 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
125 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
126 | struct kobject kobj; | ||
127 | }; | ||
128 | |||
129 | struct disk_part_tbl { | ||
130 | struct rcu_head rcu_head; | ||
131 | int len; | ||
132 | struct hd_struct *part[]; | ||
133 | }; | ||
112 | 134 | ||
113 | struct gendisk { | 135 | struct gendisk { |
136 | /* major, first_minor and minors are input parameters only, | ||
137 | * don't use directly. Use disk_devt() and disk_max_parts(). | ||
138 | */ | ||
114 | int major; /* major number of driver */ | 139 | int major; /* major number of driver */ |
115 | int first_minor; | 140 | int first_minor; |
116 | int minors; /* maximum number of minors, =1 for | 141 | int minors; /* maximum number of minors, =1 for |
117 | * disks that can't be partitioned. */ | 142 | * disks that can't be partitioned. */ |
118 | char disk_name[32]; /* name of major driver */ | 143 | |
119 | struct hd_struct **part; /* [indexed by minor] */ | 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
145 | |||
146 | /* Array of pointers to partitions indexed by partno. | ||
147 | * Protected with matching bdev lock but stat and other | ||
148 | * non-critical accesses use RCU. Always access through | ||
149 | * helpers. | ||
150 | */ | ||
151 | struct disk_part_tbl *part_tbl; | ||
152 | struct hd_struct part0; | ||
153 | |||
120 | struct block_device_operations *fops; | 154 | struct block_device_operations *fops; |
121 | struct request_queue *queue; | 155 | struct request_queue *queue; |
122 | void *private_data; | 156 | void *private_data; |
123 | sector_t capacity; | ||
124 | 157 | ||
125 | int flags; | 158 | int flags; |
126 | struct device *driverfs_dev; // FIXME: remove | 159 | struct device *driverfs_dev; // FIXME: remove |
127 | struct device dev; | ||
128 | struct kobject *holder_dir; | ||
129 | struct kobject *slave_dir; | 160 | struct kobject *slave_dir; |
130 | 161 | ||
131 | struct timer_rand_state *random; | 162 | struct timer_rand_state *random; |
132 | int policy; | ||
133 | 163 | ||
134 | atomic_t sync_io; /* RAID */ | 164 | atomic_t sync_io; /* RAID */ |
135 | unsigned long stamp; | ||
136 | int in_flight; | ||
137 | #ifdef CONFIG_SMP | ||
138 | struct disk_stats *dkstats; | ||
139 | #else | ||
140 | struct disk_stats dkstats; | ||
141 | #endif | ||
142 | struct work_struct async_notify; | 165 | struct work_struct async_notify; |
143 | #ifdef CONFIG_BLK_DEV_INTEGRITY | 166 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
144 | struct blk_integrity *integrity; | 167 | struct blk_integrity *integrity; |
145 | #endif | 168 | #endif |
169 | int node_id; | ||
146 | }; | 170 | }; |
147 | 171 | ||
148 | /* | 172 | static inline struct gendisk *part_to_disk(struct hd_struct *part) |
149 | * Macros to operate on percpu disk statistics: | ||
150 | * | ||
151 | * The __ variants should only be called in critical sections. The full | ||
152 | * variants disable/enable preemption. | ||
153 | */ | ||
154 | static inline struct hd_struct *get_part(struct gendisk *gendiskp, | ||
155 | sector_t sector) | ||
156 | { | 173 | { |
157 | struct hd_struct *part; | 174 | if (likely(part)) { |
158 | int i; | 175 | if (part->partno) |
159 | for (i = 0; i < gendiskp->minors - 1; i++) { | 176 | return dev_to_disk(part_to_dev(part)->parent); |
160 | part = gendiskp->part[i]; | 177 | else |
161 | if (part && part->start_sect <= sector | 178 | return dev_to_disk(part_to_dev(part)); |
162 | && sector < part->start_sect + part->nr_sects) | ||
163 | return part; | ||
164 | } | 179 | } |
165 | return NULL; | 180 | return NULL; |
166 | } | 181 | } |
167 | 182 | ||
168 | #ifdef CONFIG_SMP | 183 | static inline int disk_max_parts(struct gendisk *disk) |
169 | #define __disk_stat_add(gendiskp, field, addnd) \ | 184 | { |
170 | (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) | 185 | if (disk->flags & GENHD_FL_EXT_DEVT) |
186 | return DISK_MAX_PARTS; | ||
187 | return disk->minors; | ||
188 | } | ||
171 | 189 | ||
172 | #define disk_stat_read(gendiskp, field) \ | 190 | static inline bool disk_partitionable(struct gendisk *disk) |
173 | ({ \ | 191 | { |
174 | typeof(gendiskp->dkstats->field) res = 0; \ | 192 | return disk_max_parts(disk) > 1; |
175 | int i; \ | 193 | } |
176 | for_each_possible_cpu(i) \ | ||
177 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ | ||
178 | res; \ | ||
179 | }) | ||
180 | 194 | ||
181 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 195 | static inline dev_t disk_devt(struct gendisk *disk) |
182 | int i; | 196 | { |
197 | return disk_to_dev(disk)->devt; | ||
198 | } | ||
183 | 199 | ||
184 | for_each_possible_cpu(i) | 200 | static inline dev_t part_devt(struct hd_struct *part) |
185 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 201 | { |
186 | sizeof(struct disk_stats)); | 202 | return part_to_dev(part)->devt; |
187 | } | 203 | } |
188 | 204 | ||
189 | #define __part_stat_add(part, field, addnd) \ | 205 | extern struct hd_struct *disk_get_part(struct gendisk *disk, int partno); |
190 | (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd) | ||
191 | 206 | ||
192 | #define __all_stat_add(gendiskp, part, field, addnd, sector) \ | 207 | static inline void disk_put_part(struct hd_struct *part) |
193 | ({ \ | 208 | { |
194 | if (part) \ | 209 | if (likely(part)) |
195 | __part_stat_add(part, field, addnd); \ | 210 | put_device(part_to_dev(part)); |
196 | __disk_stat_add(gendiskp, field, addnd); \ | 211 | } |
197 | }) | 212 | |
213 | /* | ||
214 | * Smarter partition iterator without context limits. | ||
215 | */ | ||
216 | #define DISK_PITER_REVERSE (1 << 0) /* iterate in the reverse direction */ | ||
217 | #define DISK_PITER_INCL_EMPTY (1 << 1) /* include 0-sized parts */ | ||
218 | #define DISK_PITER_INCL_PART0 (1 << 2) /* include partition 0 */ | ||
219 | |||
220 | struct disk_part_iter { | ||
221 | struct gendisk *disk; | ||
222 | struct hd_struct *part; | ||
223 | int idx; | ||
224 | unsigned int flags; | ||
225 | }; | ||
226 | |||
227 | extern void disk_part_iter_init(struct disk_part_iter *piter, | ||
228 | struct gendisk *disk, unsigned int flags); | ||
229 | extern struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter); | ||
230 | extern void disk_part_iter_exit(struct disk_part_iter *piter); | ||
231 | |||
232 | extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, | ||
233 | sector_t sector); | ||
234 | |||
235 | /* | ||
236 | * Macros to operate on percpu disk statistics: | ||
237 | * | ||
238 | * {disk|part|all}_stat_{add|sub|inc|dec}() modify the stat counters | ||
239 | * and should be called between disk_stat_lock() and | ||
240 | * disk_stat_unlock(). | ||
241 | * | ||
242 | * part_stat_read() can be called at any time. | ||
243 | * | ||
244 | * part_stat_{add|set_all}() and {init|free}_part_stats are for | ||
245 | * internal use only. | ||
246 | */ | ||
247 | #ifdef CONFIG_SMP | ||
248 | #define part_stat_lock() ({ rcu_read_lock(); get_cpu(); }) | ||
249 | #define part_stat_unlock() do { put_cpu(); rcu_read_unlock(); } while (0) | ||
250 | |||
251 | #define __part_stat_add(cpu, part, field, addnd) \ | ||
252 | (per_cpu_ptr((part)->dkstats, (cpu))->field += (addnd)) | ||
198 | 253 | ||
199 | #define part_stat_read(part, field) \ | 254 | #define part_stat_read(part, field) \ |
200 | ({ \ | 255 | ({ \ |
201 | typeof(part->dkstats->field) res = 0; \ | 256 | typeof((part)->dkstats->field) res = 0; \ |
202 | int i; \ | 257 | int i; \ |
203 | for_each_possible_cpu(i) \ | 258 | for_each_possible_cpu(i) \ |
204 | res += per_cpu_ptr(part->dkstats, i)->field; \ | 259 | res += per_cpu_ptr((part)->dkstats, i)->field; \ |
205 | res; \ | 260 | res; \ |
206 | }) | 261 | }) |
207 | 262 | ||
@@ -213,171 +268,107 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) | |||
213 | memset(per_cpu_ptr(part->dkstats, i), value, | 268 | memset(per_cpu_ptr(part->dkstats, i), value, |
214 | sizeof(struct disk_stats)); | 269 | sizeof(struct disk_stats)); |
215 | } | 270 | } |
216 | |||
217 | #else /* !CONFIG_SMP */ | ||
218 | #define __disk_stat_add(gendiskp, field, addnd) \ | ||
219 | (gendiskp->dkstats.field += addnd) | ||
220 | #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) | ||
221 | 271 | ||
222 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) | 272 | static inline int init_part_stats(struct hd_struct *part) |
223 | { | 273 | { |
224 | memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); | 274 | part->dkstats = alloc_percpu(struct disk_stats); |
275 | if (!part->dkstats) | ||
276 | return 0; | ||
277 | return 1; | ||
225 | } | 278 | } |
226 | 279 | ||
227 | #define __part_stat_add(part, field, addnd) \ | 280 | static inline void free_part_stats(struct hd_struct *part) |
228 | (part->dkstats.field += addnd) | ||
229 | |||
230 | #define __all_stat_add(gendiskp, part, field, addnd, sector) \ | ||
231 | ({ \ | ||
232 | if (part) \ | ||
233 | part->dkstats.field += addnd; \ | ||
234 | __disk_stat_add(gendiskp, field, addnd); \ | ||
235 | }) | ||
236 | |||
237 | #define part_stat_read(part, field) (part->dkstats.field) | ||
238 | |||
239 | static inline void part_stat_set_all(struct hd_struct *part, int value) | ||
240 | { | 281 | { |
241 | memset(&part->dkstats, value, sizeof(struct disk_stats)); | 282 | free_percpu(part->dkstats); |
242 | } | 283 | } |
243 | 284 | ||
244 | #endif /* CONFIG_SMP */ | 285 | #else /* !CONFIG_SMP */ |
286 | #define part_stat_lock() ({ rcu_read_lock(); 0; }) | ||
287 | #define part_stat_unlock() rcu_read_unlock() | ||
245 | 288 | ||
246 | #define disk_stat_add(gendiskp, field, addnd) \ | 289 | #define __part_stat_add(cpu, part, field, addnd) \ |
247 | do { \ | 290 | ((part)->dkstats.field += addnd) |
248 | preempt_disable(); \ | 291 | |
249 | __disk_stat_add(gendiskp, field, addnd); \ | 292 | #define part_stat_read(part, field) ((part)->dkstats.field) |
250 | preempt_enable(); \ | ||
251 | } while (0) | ||
252 | |||
253 | #define __disk_stat_dec(gendiskp, field) __disk_stat_add(gendiskp, field, -1) | ||
254 | #define disk_stat_dec(gendiskp, field) disk_stat_add(gendiskp, field, -1) | ||
255 | |||
256 | #define __disk_stat_inc(gendiskp, field) __disk_stat_add(gendiskp, field, 1) | ||
257 | #define disk_stat_inc(gendiskp, field) disk_stat_add(gendiskp, field, 1) | ||
258 | |||
259 | #define __disk_stat_sub(gendiskp, field, subnd) \ | ||
260 | __disk_stat_add(gendiskp, field, -subnd) | ||
261 | #define disk_stat_sub(gendiskp, field, subnd) \ | ||
262 | disk_stat_add(gendiskp, field, -subnd) | ||
263 | |||
264 | #define part_stat_add(gendiskp, field, addnd) \ | ||
265 | do { \ | ||
266 | preempt_disable(); \ | ||
267 | __part_stat_add(gendiskp, field, addnd);\ | ||
268 | preempt_enable(); \ | ||
269 | } while (0) | ||
270 | |||
271 | #define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1) | ||
272 | #define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1) | ||
273 | |||
274 | #define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1) | ||
275 | #define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1) | ||
276 | |||
277 | #define __part_stat_sub(gendiskp, field, subnd) \ | ||
278 | __part_stat_add(gendiskp, field, -subnd) | ||
279 | #define part_stat_sub(gendiskp, field, subnd) \ | ||
280 | part_stat_add(gendiskp, field, -subnd) | ||
281 | |||
282 | #define all_stat_add(gendiskp, part, field, addnd, sector) \ | ||
283 | do { \ | ||
284 | preempt_disable(); \ | ||
285 | __all_stat_add(gendiskp, part, field, addnd, sector); \ | ||
286 | preempt_enable(); \ | ||
287 | } while (0) | ||
288 | |||
289 | #define __all_stat_dec(gendiskp, field, sector) \ | ||
290 | __all_stat_add(gendiskp, field, -1, sector) | ||
291 | #define all_stat_dec(gendiskp, field, sector) \ | ||
292 | all_stat_add(gendiskp, field, -1, sector) | ||
293 | |||
294 | #define __all_stat_inc(gendiskp, part, field, sector) \ | ||
295 | __all_stat_add(gendiskp, part, field, 1, sector) | ||
296 | #define all_stat_inc(gendiskp, part, field, sector) \ | ||
297 | all_stat_add(gendiskp, part, field, 1, sector) | ||
298 | |||
299 | #define __all_stat_sub(gendiskp, part, field, subnd, sector) \ | ||
300 | __all_stat_add(gendiskp, part, field, -subnd, sector) | ||
301 | #define all_stat_sub(gendiskp, part, field, subnd, sector) \ | ||
302 | all_stat_add(gendiskp, part, field, -subnd, sector) | ||
303 | |||
304 | /* Inlines to alloc and free disk stats in struct gendisk */ | ||
305 | #ifdef CONFIG_SMP | ||
306 | static inline int init_disk_stats(struct gendisk *disk) | ||
307 | { | ||
308 | disk->dkstats = alloc_percpu(struct disk_stats); | ||
309 | if (!disk->dkstats) | ||
310 | return 0; | ||
311 | return 1; | ||
312 | } | ||
313 | 293 | ||
314 | static inline void free_disk_stats(struct gendisk *disk) | 294 | static inline void part_stat_set_all(struct hd_struct *part, int value) |
315 | { | 295 | { |
316 | free_percpu(disk->dkstats); | 296 | memset(&part->dkstats, value, sizeof(struct disk_stats)); |
317 | } | 297 | } |
318 | 298 | ||
319 | static inline int init_part_stats(struct hd_struct *part) | 299 | static inline int init_part_stats(struct hd_struct *part) |
320 | { | 300 | { |
321 | part->dkstats = alloc_percpu(struct disk_stats); | ||
322 | if (!part->dkstats) | ||
323 | return 0; | ||
324 | return 1; | 301 | return 1; |
325 | } | 302 | } |
326 | 303 | ||
327 | static inline void free_part_stats(struct hd_struct *part) | 304 | static inline void free_part_stats(struct hd_struct *part) |
328 | { | 305 | { |
329 | free_percpu(part->dkstats); | ||
330 | } | ||
331 | |||
332 | #else /* CONFIG_SMP */ | ||
333 | static inline int init_disk_stats(struct gendisk *disk) | ||
334 | { | ||
335 | return 1; | ||
336 | } | 306 | } |
337 | 307 | ||
338 | static inline void free_disk_stats(struct gendisk *disk) | 308 | #endif /* CONFIG_SMP */ |
339 | { | ||
340 | } | ||
341 | 309 | ||
342 | static inline int init_part_stats(struct hd_struct *part) | 310 | #define part_stat_add(cpu, part, field, addnd) do { \ |
311 | __part_stat_add((cpu), (part), field, addnd); \ | ||
312 | if ((part)->partno) \ | ||
313 | __part_stat_add((cpu), &part_to_disk((part))->part0, \ | ||
314 | field, addnd); \ | ||
315 | } while (0) | ||
316 | |||
317 | #define part_stat_dec(cpu, gendiskp, field) \ | ||
318 | part_stat_add(cpu, gendiskp, field, -1) | ||
319 | #define part_stat_inc(cpu, gendiskp, field) \ | ||
320 | part_stat_add(cpu, gendiskp, field, 1) | ||
321 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ | ||
322 | part_stat_add(cpu, gendiskp, field, -subnd) | ||
323 | |||
324 | static inline void part_inc_in_flight(struct hd_struct *part) | ||
343 | { | 325 | { |
344 | return 1; | 326 | part->in_flight++; |
327 | if (part->partno) | ||
328 | part_to_disk(part)->part0.in_flight++; | ||
345 | } | 329 | } |
346 | 330 | ||
347 | static inline void free_part_stats(struct hd_struct *part) | 331 | static inline void part_dec_in_flight(struct hd_struct *part) |
348 | { | 332 | { |
333 | part->in_flight--; | ||
334 | if (part->partno) | ||
335 | part_to_disk(part)->part0.in_flight--; | ||
349 | } | 336 | } |
350 | #endif /* CONFIG_SMP */ | ||
351 | 337 | ||
352 | /* drivers/block/ll_rw_blk.c */ | 338 | /* drivers/block/ll_rw_blk.c */ |
353 | extern void disk_round_stats(struct gendisk *disk); | 339 | extern void part_round_stats(int cpu, struct hd_struct *part); |
354 | extern void part_round_stats(struct hd_struct *part); | ||
355 | 340 | ||
356 | /* drivers/block/genhd.c */ | 341 | /* drivers/block/genhd.c */ |
357 | extern int get_blkdev_list(char *, int); | 342 | extern int get_blkdev_list(char *, int); |
358 | extern void add_disk(struct gendisk *disk); | 343 | extern void add_disk(struct gendisk *disk); |
359 | extern void del_gendisk(struct gendisk *gp); | 344 | extern void del_gendisk(struct gendisk *gp); |
360 | extern void unlink_gendisk(struct gendisk *gp); | 345 | extern void unlink_gendisk(struct gendisk *gp); |
361 | extern struct gendisk *get_gendisk(dev_t dev, int *part); | 346 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); |
347 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); | ||
362 | 348 | ||
363 | extern void set_device_ro(struct block_device *bdev, int flag); | 349 | extern void set_device_ro(struct block_device *bdev, int flag); |
364 | extern void set_disk_ro(struct gendisk *disk, int flag); | 350 | extern void set_disk_ro(struct gendisk *disk, int flag); |
365 | 351 | ||
352 | static inline int get_disk_ro(struct gendisk *disk) | ||
353 | { | ||
354 | return disk->part0.policy; | ||
355 | } | ||
356 | |||
366 | /* drivers/char/random.c */ | 357 | /* drivers/char/random.c */ |
367 | extern void add_disk_randomness(struct gendisk *disk); | 358 | extern void add_disk_randomness(struct gendisk *disk); |
368 | extern void rand_initialize_disk(struct gendisk *disk); | 359 | extern void rand_initialize_disk(struct gendisk *disk); |
369 | 360 | ||
370 | static inline sector_t get_start_sect(struct block_device *bdev) | 361 | static inline sector_t get_start_sect(struct block_device *bdev) |
371 | { | 362 | { |
372 | return bdev->bd_contains == bdev ? 0 : bdev->bd_part->start_sect; | 363 | return bdev->bd_part->start_sect; |
373 | } | 364 | } |
374 | static inline sector_t get_capacity(struct gendisk *disk) | 365 | static inline sector_t get_capacity(struct gendisk *disk) |
375 | { | 366 | { |
376 | return disk->capacity; | 367 | return disk->part0.nr_sects; |
377 | } | 368 | } |
378 | static inline void set_capacity(struct gendisk *disk, sector_t size) | 369 | static inline void set_capacity(struct gendisk *disk, sector_t size) |
379 | { | 370 | { |
380 | disk->capacity = size; | 371 | disk->part0.nr_sects = size; |
381 | } | 372 | } |
382 | 373 | ||
383 | #ifdef CONFIG_SOLARIS_X86_PARTITION | 374 | #ifdef CONFIG_SOLARIS_X86_PARTITION |
@@ -527,9 +518,12 @@ struct unixware_disklabel { | |||
527 | #define ADDPART_FLAG_RAID 1 | 518 | #define ADDPART_FLAG_RAID 1 |
528 | #define ADDPART_FLAG_WHOLEDISK 2 | 519 | #define ADDPART_FLAG_WHOLEDISK 2 |
529 | 520 | ||
530 | extern dev_t blk_lookup_devt(const char *name, int part); | 521 | extern int blk_alloc_devt(struct hd_struct *part, dev_t *devt); |
531 | extern char *disk_name (struct gendisk *hd, int part, char *buf); | 522 | extern void blk_free_devt(dev_t devt); |
523 | extern dev_t blk_lookup_devt(const char *name, int partno); | ||
524 | extern char *disk_name (struct gendisk *hd, int partno, char *buf); | ||
532 | 525 | ||
526 | extern int disk_expand_part_tbl(struct gendisk *disk, int target); | ||
533 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); | 527 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
534 | extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); | 528 | extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); |
535 | extern void delete_partition(struct gendisk *, int); | 529 | extern void delete_partition(struct gendisk *, int); |
@@ -546,16 +540,23 @@ extern void blk_register_region(dev_t devt, unsigned long range, | |||
546 | void *data); | 540 | void *data); |
547 | extern void blk_unregister_region(dev_t devt, unsigned long range); | 541 | extern void blk_unregister_region(dev_t devt, unsigned long range); |
548 | 542 | ||
549 | static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | 543 | extern ssize_t part_size_show(struct device *dev, |
550 | { | 544 | struct device_attribute *attr, char *buf); |
551 | return bdget(MKDEV(disk->major, disk->first_minor) + index); | 545 | extern ssize_t part_stat_show(struct device *dev, |
552 | } | 546 | struct device_attribute *attr, char *buf); |
547 | #ifdef CONFIG_FAIL_MAKE_REQUEST | ||
548 | extern ssize_t part_fail_show(struct device *dev, | ||
549 | struct device_attribute *attr, char *buf); | ||
550 | extern ssize_t part_fail_store(struct device *dev, | ||
551 | struct device_attribute *attr, | ||
552 | const char *buf, size_t count); | ||
553 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ | ||
553 | 554 | ||
554 | #else /* CONFIG_BLOCK */ | 555 | #else /* CONFIG_BLOCK */ |
555 | 556 | ||
556 | static inline void printk_all_partitions(void) { } | 557 | static inline void printk_all_partitions(void) { } |
557 | 558 | ||
558 | static inline dev_t blk_lookup_devt(const char *name, int part) | 559 | static inline dev_t blk_lookup_devt(const char *name, int partno) |
559 | { | 560 | { |
560 | dev_t devt = MKDEV(0, 0); | 561 | dev_t devt = MKDEV(0, 0); |
561 | return devt; | 562 | return devt; |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index c3c19f926e6f..14d0df0b5749 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -118,7 +118,11 @@ struct gfs2_sb { | |||
118 | 118 | ||
119 | char sb_lockproto[GFS2_LOCKNAME_LEN]; | 119 | char sb_lockproto[GFS2_LOCKNAME_LEN]; |
120 | char sb_locktable[GFS2_LOCKNAME_LEN]; | 120 | char sb_locktable[GFS2_LOCKNAME_LEN]; |
121 | /* In gfs1, quota and license dinodes followed */ | 121 | |
122 | struct gfs2_inum __pad3; /* Was quota inode in gfs1 */ | ||
123 | struct gfs2_inum __pad4; /* Was licence inode in gfs1 */ | ||
124 | #define GFS2_HAS_UUID 1 | ||
125 | __u8 sb_uuid[16]; /* The UUID, maybe 0 for backwards compat */ | ||
122 | }; | 126 | }; |
123 | 127 | ||
124 | /* | 128 | /* |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 730a20b83576..e10c49a5b96e 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #else | 9 | #else |
10 | 10 | ||
11 | #include <linux/kernel.h> | ||
11 | #include <linux/types.h> | 12 | #include <linux/types.h> |
12 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
13 | 14 | ||
@@ -32,6 +33,8 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
32 | 33 | ||
33 | static inline void gpio_free(unsigned gpio) | 34 | static inline void gpio_free(unsigned gpio) |
34 | { | 35 | { |
36 | might_sleep(); | ||
37 | |||
35 | /* GPIO can never have been requested */ | 38 | /* GPIO can never have been requested */ |
36 | WARN_ON(1); | 39 | WARN_ON(1); |
37 | } | 40 | } |
diff --git a/include/linux/hid.h b/include/linux/hid.h index ac4e678a04ed..f13bca2dd53b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <linux/types.h> | 67 | #include <linux/types.h> |
68 | #include <linux/slab.h> | 68 | #include <linux/slab.h> |
69 | #include <linux/list.h> | 69 | #include <linux/list.h> |
70 | #include <linux/mod_devicetable.h> /* hid_device_id */ | ||
70 | #include <linux/timer.h> | 71 | #include <linux/timer.h> |
71 | #include <linux/workqueue.h> | 72 | #include <linux/workqueue.h> |
72 | #include <linux/input.h> | 73 | #include <linux/input.h> |
@@ -246,6 +247,19 @@ struct hid_item { | |||
246 | #define HID_FEATURE_REPORT 2 | 247 | #define HID_FEATURE_REPORT 2 |
247 | 248 | ||
248 | /* | 249 | /* |
250 | * HID connect requests | ||
251 | */ | ||
252 | |||
253 | #define HID_CONNECT_HIDINPUT 0x01 | ||
254 | #define HID_CONNECT_HIDINPUT_FORCE 0x02 | ||
255 | #define HID_CONNECT_HIDRAW 0x04 | ||
256 | #define HID_CONNECT_HIDDEV 0x08 | ||
257 | #define HID_CONNECT_HIDDEV_FORCE 0x10 | ||
258 | #define HID_CONNECT_FF 0x20 | ||
259 | #define HID_CONNECT_DEFAULT (HID_CONNECT_HIDINPUT|HID_CONNECT_HIDRAW| \ | ||
260 | HID_CONNECT_HIDDEV|HID_CONNECT_FF) | ||
261 | |||
262 | /* | ||
249 | * HID device quirks. | 263 | * HID device quirks. |
250 | */ | 264 | */ |
251 | 265 | ||
@@ -256,48 +270,11 @@ struct hid_item { | |||
256 | 270 | ||
257 | #define HID_QUIRK_INVERT 0x00000001 | 271 | #define HID_QUIRK_INVERT 0x00000001 |
258 | #define HID_QUIRK_NOTOUCH 0x00000002 | 272 | #define HID_QUIRK_NOTOUCH 0x00000002 |
259 | #define HID_QUIRK_IGNORE 0x00000004 | ||
260 | #define HID_QUIRK_NOGET 0x00000008 | 273 | #define HID_QUIRK_NOGET 0x00000008 |
261 | #define HID_QUIRK_HIDDEV 0x00000010 | ||
262 | #define HID_QUIRK_BADPAD 0x00000020 | 274 | #define HID_QUIRK_BADPAD 0x00000020 |
263 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 275 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
264 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080 | ||
265 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | ||
266 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | ||
267 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | ||
268 | #define HID_QUIRK_APPLE_HAS_FN 0x00000800 | ||
269 | #define HID_QUIRK_APPLE_FN_ON 0x00001000 | ||
270 | #define HID_QUIRK_INVERT_HWHEEL 0x00002000 | ||
271 | #define HID_QUIRK_APPLE_ISO_KEYBOARD 0x00004000 | ||
272 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 | ||
273 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 276 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
274 | #define HID_QUIRK_IGNORE_MOUSE 0x00020000 | ||
275 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000 | ||
276 | #define HID_QUIRK_DUPLICATE_USAGES 0x00080000 | ||
277 | #define HID_QUIRK_RESET_LEDS 0x00100000 | ||
278 | #define HID_QUIRK_HIDINPUT 0x00200000 | ||
279 | #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 | ||
280 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 | ||
281 | #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 | ||
282 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 | ||
283 | #define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000 | ||
284 | #define HID_QUIRK_MICROSOFT_KEYS 0x08000000 | ||
285 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 277 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
286 | #define HID_QUIRK_APPLE_NUMLOCK_EMULATION 0x20000000 | ||
287 | |||
288 | /* | ||
289 | * Separate quirks for runtime report descriptor fixup | ||
290 | */ | ||
291 | |||
292 | #define HID_QUIRK_RDESC_CYMOTION 0x00000001 | ||
293 | #define HID_QUIRK_RDESC_LOGITECH 0x00000002 | ||
294 | #define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 | ||
295 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 | ||
296 | #define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 | ||
297 | #define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020 | ||
298 | #define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040 | ||
299 | #define HID_QUIRK_RDESC_MICROSOFT_RECV_1028 0x00000080 | ||
300 | #define HID_QUIRK_RDESC_SUNPLUS_WDESKTOP 0x00000100 | ||
301 | 278 | ||
302 | /* | 279 | /* |
303 | * This is the global environment of the parser. This information is | 280 | * This is the global environment of the parser. This information is |
@@ -411,12 +388,21 @@ struct hid_report_enum { | |||
411 | struct hid_control_fifo { | 388 | struct hid_control_fifo { |
412 | unsigned char dir; | 389 | unsigned char dir; |
413 | struct hid_report *report; | 390 | struct hid_report *report; |
391 | char *raw_report; | ||
392 | }; | ||
393 | |||
394 | struct hid_output_fifo { | ||
395 | struct hid_report *report; | ||
396 | char *raw_report; | ||
414 | }; | 397 | }; |
415 | 398 | ||
416 | #define HID_CLAIMED_INPUT 1 | 399 | #define HID_CLAIMED_INPUT 1 |
417 | #define HID_CLAIMED_HIDDEV 2 | 400 | #define HID_CLAIMED_HIDDEV 2 |
418 | #define HID_CLAIMED_HIDRAW 4 | 401 | #define HID_CLAIMED_HIDRAW 4 |
419 | 402 | ||
403 | #define HID_STAT_ADDED 1 | ||
404 | #define HID_STAT_PARSED 2 | ||
405 | |||
420 | #define HID_CTRL_RUNNING 1 | 406 | #define HID_CTRL_RUNNING 1 |
421 | #define HID_OUT_RUNNING 2 | 407 | #define HID_OUT_RUNNING 2 |
422 | #define HID_IN_RUNNING 3 | 408 | #define HID_IN_RUNNING 3 |
@@ -431,22 +417,28 @@ struct hid_input { | |||
431 | struct input_dev *input; | 417 | struct input_dev *input; |
432 | }; | 418 | }; |
433 | 419 | ||
420 | struct hid_driver; | ||
421 | struct hid_ll_driver; | ||
422 | |||
434 | struct hid_device { /* device report descriptor */ | 423 | struct hid_device { /* device report descriptor */ |
435 | __u8 *rdesc; | 424 | __u8 *rdesc; |
436 | unsigned rsize; | 425 | unsigned rsize; |
437 | struct hid_collection *collection; /* List of HID collections */ | 426 | struct hid_collection *collection; /* List of HID collections */ |
438 | unsigned collection_size; /* Number of allocated hid_collections */ | 427 | unsigned collection_size; /* Number of allocated hid_collections */ |
439 | unsigned maxcollection; /* Number of parsed collections */ | 428 | unsigned maxcollection; /* Number of parsed collections */ |
440 | unsigned maxapplication; /* Number of applications */ | 429 | unsigned maxapplication; /* Number of applications */ |
441 | unsigned short bus; /* BUS ID */ | 430 | __u16 bus; /* BUS ID */ |
442 | unsigned short vendor; /* Vendor ID */ | 431 | __u32 vendor; /* Vendor ID */ |
443 | unsigned short product; /* Product ID */ | 432 | __u32 product; /* Product ID */ |
444 | unsigned version; /* HID version */ | 433 | __u32 version; /* HID version */ |
445 | unsigned country; /* HID country */ | 434 | unsigned country; /* HID country */ |
446 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | 435 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; |
447 | 436 | ||
448 | struct device *dev; /* device */ | 437 | struct device dev; /* device */ |
438 | struct hid_driver *driver; | ||
439 | struct hid_ll_driver *ll_driver; | ||
449 | 440 | ||
441 | unsigned int status; /* see STAT flags above */ | ||
450 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | 442 | unsigned claimed; /* Claimed by hidinput, hiddev? */ |
451 | unsigned quirks; /* Various quirks the device can pull on us */ | 443 | unsigned quirks; /* Various quirks the device can pull on us */ |
452 | 444 | ||
@@ -462,26 +454,29 @@ struct hid_device { /* device report descriptor */ | |||
462 | 454 | ||
463 | void *driver_data; | 455 | void *driver_data; |
464 | 456 | ||
465 | __s32 delayed_value; /* For A4 Tech mice hwheel quirk */ | 457 | /* temporary hid_ff handling (until moved to the drivers) */ |
466 | 458 | int (*ff_init)(struct hid_device *); | |
467 | /* device-specific function pointers */ | ||
468 | int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); | ||
469 | int (*hid_open) (struct hid_device *); | ||
470 | void (*hid_close) (struct hid_device *); | ||
471 | 459 | ||
472 | /* hiddev event handler */ | 460 | /* hiddev event handler */ |
461 | int (*hiddev_connect)(struct hid_device *, unsigned int); | ||
473 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, | 462 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, |
474 | struct hid_usage *, __s32); | 463 | struct hid_usage *, __s32); |
475 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 464 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
476 | 465 | ||
477 | /* handler for raw output data, used by hidraw */ | 466 | /* handler for raw output data, used by hidraw */ |
478 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 467 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); |
479 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | ||
480 | unsigned long apple_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; | ||
481 | unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)]; | ||
482 | #endif | ||
483 | }; | 468 | }; |
484 | 469 | ||
470 | static inline void *hid_get_drvdata(struct hid_device *hdev) | ||
471 | { | ||
472 | return dev_get_drvdata(&hdev->dev); | ||
473 | } | ||
474 | |||
475 | static inline void hid_set_drvdata(struct hid_device *hdev, void *data) | ||
476 | { | ||
477 | dev_set_drvdata(&hdev->dev, data); | ||
478 | } | ||
479 | |||
485 | #define HID_GLOBAL_STACK_SIZE 4 | 480 | #define HID_GLOBAL_STACK_SIZE 4 |
486 | #define HID_COLLECTION_STACK_SIZE 4 | 481 | #define HID_COLLECTION_STACK_SIZE 4 |
487 | 482 | ||
@@ -510,6 +505,107 @@ struct hid_descriptor { | |||
510 | struct hid_class_descriptor desc[1]; | 505 | struct hid_class_descriptor desc[1]; |
511 | } __attribute__ ((packed)); | 506 | } __attribute__ ((packed)); |
512 | 507 | ||
508 | #define HID_DEVICE(b, ven, prod) \ | ||
509 | .bus = (b), \ | ||
510 | .vendor = (ven), .product = (prod) | ||
511 | |||
512 | #define HID_USB_DEVICE(ven, prod) HID_DEVICE(BUS_USB, ven, prod) | ||
513 | #define HID_BLUETOOTH_DEVICE(ven, prod) HID_DEVICE(BUS_BLUETOOTH, ven, prod) | ||
514 | |||
515 | #define HID_REPORT_ID(rep) \ | ||
516 | .report_type = (rep) | ||
517 | #define HID_USAGE_ID(uhid, utype, ucode) \ | ||
518 | .usage_hid = (uhid), .usage_type = (utype), .usage_code = (ucode) | ||
519 | /* we don't want to catch types and codes equal to 0 */ | ||
520 | #define HID_TERMINATOR (HID_ANY_ID - 1) | ||
521 | |||
522 | struct hid_report_id { | ||
523 | __u32 report_type; | ||
524 | }; | ||
525 | struct hid_usage_id { | ||
526 | __u32 usage_hid; | ||
527 | __u32 usage_type; | ||
528 | __u32 usage_code; | ||
529 | }; | ||
530 | |||
531 | /** | ||
532 | * struct hid_driver | ||
533 | * @name: driver name (e.g. "Footech_bar-wheel") | ||
534 | * @id_table: which devices is this driver for (must be non-NULL for probe | ||
535 | * to be called) | ||
536 | * @probe: new device inserted | ||
537 | * @remove: device removed (NULL if not a hot-plug capable driver) | ||
538 | * @report_table: on which reports to call raw_event (NULL means all) | ||
539 | * @raw_event: if report in report_table, this hook is called (NULL means nop) | ||
540 | * @usage_table: on which events to call event (NULL means all) | ||
541 | * @event: if usage in usage_table, this hook is called (NULL means nop) | ||
542 | * @report_fixup: called before report descriptor parsing (NULL means nop) | ||
543 | * @input_mapping: invoked on input registering before mapping an usage | ||
544 | * @input_mapped: invoked on input registering after mapping an usage | ||
545 | * | ||
546 | * raw_event and event should return 0 on no action performed, 1 when no | ||
547 | * further processing should be done and negative on error | ||
548 | * | ||
549 | * input_mapping shall return a negative value to completely ignore this usage | ||
550 | * (e.g. doubled or invalid usage), zero to continue with parsing of this | ||
551 | * usage by generic code (no special handling needed) or positive to skip | ||
552 | * generic parsing (needed special handling which was done in the hook already) | ||
553 | * input_mapped shall return negative to inform the layer that this usage | ||
554 | * should not be considered for further processing or zero to notify that | ||
555 | * no processing was performed and should be done in a generic manner | ||
556 | * Both these functions may be NULL which means the same behavior as returning | ||
557 | * zero from them. | ||
558 | */ | ||
559 | struct hid_driver { | ||
560 | char *name; | ||
561 | const struct hid_device_id *id_table; | ||
562 | |||
563 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); | ||
564 | void (*remove)(struct hid_device *dev); | ||
565 | |||
566 | const struct hid_report_id *report_table; | ||
567 | int (*raw_event)(struct hid_device *hdev, struct hid_report *report, | ||
568 | u8 *data, int size); | ||
569 | const struct hid_usage_id *usage_table; | ||
570 | int (*event)(struct hid_device *hdev, struct hid_field *field, | ||
571 | struct hid_usage *usage, __s32 value); | ||
572 | |||
573 | void (*report_fixup)(struct hid_device *hdev, __u8 *buf, | ||
574 | unsigned int size); | ||
575 | |||
576 | int (*input_mapping)(struct hid_device *hdev, | ||
577 | struct hid_input *hidinput, struct hid_field *field, | ||
578 | struct hid_usage *usage, unsigned long **bit, int *max); | ||
579 | int (*input_mapped)(struct hid_device *hdev, | ||
580 | struct hid_input *hidinput, struct hid_field *field, | ||
581 | struct hid_usage *usage, unsigned long **bit, int *max); | ||
582 | /* private: */ | ||
583 | struct device_driver driver; | ||
584 | }; | ||
585 | |||
586 | /** | ||
587 | * hid_ll_driver - low level driver callbacks | ||
588 | * @start: called on probe to start the device | ||
589 | * @stop: called on remove | ||
590 | * @open: called by input layer on open | ||
591 | * @close: called by input layer on close | ||
592 | * @hidinput_input_event: event input event (e.g. ff or leds) | ||
593 | * @parse: this method is called only once to parse the device data, | ||
594 | * shouldn't allocate anything to not leak memory | ||
595 | */ | ||
596 | struct hid_ll_driver { | ||
597 | int (*start)(struct hid_device *hdev); | ||
598 | void (*stop)(struct hid_device *hdev); | ||
599 | |||
600 | int (*open)(struct hid_device *hdev); | ||
601 | void (*close)(struct hid_device *hdev); | ||
602 | |||
603 | int (*hidinput_input_event) (struct input_dev *idev, unsigned int type, | ||
604 | unsigned int code, int value); | ||
605 | |||
606 | int (*parse)(struct hid_device *hdev); | ||
607 | }; | ||
608 | |||
513 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | 609 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ |
514 | /* We ignore a few input applications that are not widely used */ | 610 | /* We ignore a few input applications that are not widely used */ |
515 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) | 611 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) |
@@ -520,43 +616,157 @@ struct hid_descriptor { | |||
520 | extern int hid_debug; | 616 | extern int hid_debug; |
521 | #endif | 617 | #endif |
522 | 618 | ||
619 | extern int hid_add_device(struct hid_device *); | ||
620 | extern void hid_destroy_device(struct hid_device *); | ||
621 | |||
622 | extern int __must_check __hid_register_driver(struct hid_driver *, | ||
623 | struct module *, const char *mod_name); | ||
624 | static inline int __must_check hid_register_driver(struct hid_driver *driver) | ||
625 | { | ||
626 | return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); | ||
627 | } | ||
628 | extern void hid_unregister_driver(struct hid_driver *); | ||
629 | |||
523 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 630 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |
524 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | 631 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); |
525 | extern int hidinput_connect(struct hid_device *); | 632 | extern int hidinput_connect(struct hid_device *hid, unsigned int force); |
526 | extern void hidinput_disconnect(struct hid_device *); | 633 | extern void hidinput_disconnect(struct hid_device *); |
527 | 634 | ||
528 | int hid_set_field(struct hid_field *, unsigned, __s32); | 635 | int hid_set_field(struct hid_field *, unsigned, __s32); |
529 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); | 636 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); |
530 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | 637 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); |
531 | int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *); | ||
532 | int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | ||
533 | int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32); | ||
534 | void hid_output_report(struct hid_report *report, __u8 *data); | 638 | void hid_output_report(struct hid_report *report, __u8 *data); |
535 | void hid_free_device(struct hid_device *device); | 639 | struct hid_device *hid_allocate_device(void); |
536 | struct hid_device *hid_parse_report(__u8 *start, unsigned size); | 640 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
641 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | ||
642 | |||
643 | /** | ||
644 | * hid_map_usage - map usage input bits | ||
645 | * | ||
646 | * @hidinput: hidinput which we are interested in | ||
647 | * @usage: usage to fill in | ||
648 | * @bit: pointer to input->{}bit (out parameter) | ||
649 | * @max: maximal valid usage->code to consider later (out parameter) | ||
650 | * @type: input event type (EV_KEY, EV_REL, ...) | ||
651 | * @c: code which corresponds to this usage and type | ||
652 | */ | ||
653 | static inline void hid_map_usage(struct hid_input *hidinput, | ||
654 | struct hid_usage *usage, unsigned long **bit, int *max, | ||
655 | __u8 type, __u16 c) | ||
656 | { | ||
657 | struct input_dev *input = hidinput->input; | ||
658 | |||
659 | usage->type = type; | ||
660 | usage->code = c; | ||
661 | |||
662 | switch (type) { | ||
663 | case EV_ABS: | ||
664 | *bit = input->absbit; | ||
665 | *max = ABS_MAX; | ||
666 | break; | ||
667 | case EV_REL: | ||
668 | *bit = input->relbit; | ||
669 | *max = REL_MAX; | ||
670 | break; | ||
671 | case EV_KEY: | ||
672 | *bit = input->keybit; | ||
673 | *max = KEY_MAX; | ||
674 | break; | ||
675 | case EV_LED: | ||
676 | *bit = input->ledbit; | ||
677 | *max = LED_MAX; | ||
678 | break; | ||
679 | } | ||
680 | } | ||
681 | |||
682 | /** | ||
683 | * hid_map_usage_clear - map usage input bits and clear the input bit | ||
684 | * | ||
685 | * The same as hid_map_usage, except the @c bit is also cleared in supported | ||
686 | * bits (@bit). | ||
687 | */ | ||
688 | static inline void hid_map_usage_clear(struct hid_input *hidinput, | ||
689 | struct hid_usage *usage, unsigned long **bit, int *max, | ||
690 | __u8 type, __u16 c) | ||
691 | { | ||
692 | hid_map_usage(hidinput, usage, bit, max, type, c); | ||
693 | clear_bit(c, *bit); | ||
694 | } | ||
695 | |||
696 | /** | ||
697 | * hid_parse - parse HW reports | ||
698 | * | ||
699 | * @hdev: hid device | ||
700 | * | ||
701 | * Call this from probe after you set up the device (if needed). Your | ||
702 | * report_fixup will be called (if non-NULL) after reading raw report from | ||
703 | * device before passing it to hid layer for real parsing. | ||
704 | */ | ||
705 | static inline int __must_check hid_parse(struct hid_device *hdev) | ||
706 | { | ||
707 | int ret; | ||
708 | |||
709 | if (hdev->status & HID_STAT_PARSED) | ||
710 | return 0; | ||
711 | |||
712 | ret = hdev->ll_driver->parse(hdev); | ||
713 | if (!ret) | ||
714 | hdev->status |= HID_STAT_PARSED; | ||
715 | |||
716 | return ret; | ||
717 | } | ||
718 | |||
719 | /** | ||
720 | * hid_hw_start - start underlaying HW | ||
721 | * | ||
722 | * @hdev: hid device | ||
723 | * @connect_mask: which outputs to connect, see HID_CONNECT_* | ||
724 | * | ||
725 | * Call this in probe function *after* hid_parse. This will setup HW buffers | ||
726 | * and start the device (if not deffered to device open). hid_hw_stop must be | ||
727 | * called if this was successfull. | ||
728 | */ | ||
729 | static inline int __must_check hid_hw_start(struct hid_device *hdev, | ||
730 | unsigned int connect_mask) | ||
731 | { | ||
732 | int ret = hdev->ll_driver->start(hdev); | ||
733 | if (ret || !connect_mask) | ||
734 | return ret; | ||
735 | ret = hid_connect(hdev, connect_mask); | ||
736 | if (ret) | ||
737 | hdev->ll_driver->stop(hdev); | ||
738 | return ret; | ||
739 | } | ||
740 | |||
741 | /** | ||
742 | * hid_hw_stop - stop underlaying HW | ||
743 | * | ||
744 | * @hdev: hid device | ||
745 | * | ||
746 | * This is usually called from remove function or from probe when something | ||
747 | * failed and hid_hw_start was called already. | ||
748 | */ | ||
749 | static inline void hid_hw_stop(struct hid_device *hdev) | ||
750 | { | ||
751 | hdev->ll_driver->stop(hdev); | ||
752 | } | ||
753 | |||
754 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | ||
755 | int interrupt); | ||
756 | |||
757 | extern int hid_generic_init(void); | ||
758 | extern void hid_generic_exit(void); | ||
537 | 759 | ||
538 | /* HID quirks API */ | 760 | /* HID quirks API */ |
539 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | 761 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); |
540 | int usbhid_quirks_init(char **quirks_param); | 762 | int usbhid_quirks_init(char **quirks_param); |
541 | void usbhid_quirks_exit(void); | 763 | void usbhid_quirks_exit(void); |
542 | void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **); | 764 | void usbhid_set_leds(struct hid_device *hid); |
543 | |||
544 | #ifdef CONFIG_HID_FF | ||
545 | int hid_ff_init(struct hid_device *hid); | ||
546 | 765 | ||
547 | int hid_lgff_init(struct hid_device *hid); | ||
548 | int hid_lg2ff_init(struct hid_device *hid); | ||
549 | int hid_plff_init(struct hid_device *hid); | ||
550 | int hid_tmff_init(struct hid_device *hid); | ||
551 | int hid_zpff_init(struct hid_device *hid); | ||
552 | #ifdef CONFIG_HID_PID | 766 | #ifdef CONFIG_HID_PID |
553 | int hid_pidff_init(struct hid_device *hid); | 767 | int hid_pidff_init(struct hid_device *hid); |
554 | #else | 768 | #else |
555 | static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } | 769 | #define hid_pidff_init NULL |
556 | #endif | ||
557 | |||
558 | #else | ||
559 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } | ||
560 | #endif | 770 | #endif |
561 | 771 | ||
562 | #ifdef CONFIG_HID_DEBUG | 772 | #ifdef CONFIG_HID_DEBUG |
@@ -572,10 +782,23 @@ dbg_hid(const char *fmt, ...) | |||
572 | return 0; | 782 | return 0; |
573 | } | 783 | } |
574 | #define dbg_hid_line dbg_hid | 784 | #define dbg_hid_line dbg_hid |
575 | #endif | 785 | #endif /* HID_DEBUG */ |
576 | 786 | ||
577 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 787 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
578 | __FILE__ , ## arg) | 788 | __FILE__ , ## arg) |
579 | #endif | 789 | #endif /* HID_FF */ |
790 | |||
791 | #ifdef CONFIG_HID_COMPAT | ||
792 | #define HID_COMPAT_LOAD_DRIVER(name) \ | ||
793 | void hid_compat_##name(void) { } \ | ||
794 | EXPORT_SYMBOL(hid_compat_##name) | ||
795 | #else | ||
796 | #define HID_COMPAT_LOAD_DRIVER(name) | ||
797 | #endif /* HID_COMPAT */ | ||
798 | #define HID_COMPAT_CALL_DRIVER(name) do { \ | ||
799 | extern void hid_compat_##name(void); \ | ||
800 | hid_compat_##name(); \ | ||
801 | } while (0) | ||
802 | |||
580 | #endif | 803 | #endif |
581 | 804 | ||
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h index a416b904ba90..c760ae0eb6a1 100644 --- a/include/linux/hiddev.h +++ b/include/linux/hiddev.h | |||
@@ -182,26 +182,28 @@ struct hiddev_usage_ref_multi { | |||
182 | /* To traverse the input report descriptor info for a HID device, perform the | 182 | /* To traverse the input report descriptor info for a HID device, perform the |
183 | * following: | 183 | * following: |
184 | * | 184 | * |
185 | * rinfo.report_type = HID_REPORT_TYPE_INPUT; | 185 | * rinfo.report_type = HID_REPORT_TYPE_INPUT; |
186 | * rinfo.report_id = HID_REPORT_ID_FIRST; | 186 | * rinfo.report_id = HID_REPORT_ID_FIRST; |
187 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | 187 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); |
188 | * | 188 | * |
189 | * while (ret >= 0) { | 189 | * while (ret >= 0) { |
190 | * for (i = 0; i < rinfo.num_fields; i++) { | 190 | * for (i = 0; i < rinfo.num_fields; i++) { |
191 | * finfo.report_type = rinfo.report_type; | 191 | * finfo.report_type = rinfo.report_type; |
192 | * finfo.report_id = rinfo.report_id; | 192 | * finfo.report_id = rinfo.report_id; |
193 | * finfo.field_index = i; | 193 | * finfo.field_index = i; |
194 | * ioctl(fd, HIDIOCGFIELDINFO, &finfo); | 194 | * ioctl(fd, HIDIOCGFIELDINFO, &finfo); |
195 | * for (j = 0; j < finfo.maxusage; j++) { | 195 | * for (j = 0; j < finfo.maxusage; j++) { |
196 | * uref.field_index = i; | 196 | * uref.report_type = rinfo.report_type; |
197 | * uref.usage_index = j; | 197 | * uref.report_id = rinfo.report_id; |
198 | * ioctl(fd, HIDIOCGUCODE, &uref); | 198 | * uref.field_index = i; |
199 | * ioctl(fd, HIDIOCGUSAGE, &uref); | 199 | * uref.usage_index = j; |
200 | * } | 200 | * ioctl(fd, HIDIOCGUCODE, &uref); |
201 | * } | 201 | * ioctl(fd, HIDIOCGUSAGE, &uref); |
202 | * rinfo.report_id |= HID_REPORT_ID_NEXT; | 202 | * } |
203 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | 203 | * } |
204 | * } | 204 | * rinfo.report_id |= HID_REPORT_ID_NEXT; |
205 | * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); | ||
206 | * } | ||
205 | */ | 207 | */ |
206 | 208 | ||
207 | 209 | ||
@@ -217,7 +219,7 @@ struct hid_field; | |||
217 | struct hid_report; | 219 | struct hid_report; |
218 | 220 | ||
219 | #ifdef CONFIG_USB_HIDDEV | 221 | #ifdef CONFIG_USB_HIDDEV |
220 | int hiddev_connect(struct hid_device *); | 222 | int hiddev_connect(struct hid_device *hid, unsigned int force); |
221 | void hiddev_disconnect(struct hid_device *); | 223 | void hiddev_disconnect(struct hid_device *); |
222 | void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, | 224 | void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, |
223 | struct hid_usage *usage, __s32 value); | 225 | struct hid_usage *usage, __s32 value); |
@@ -225,7 +227,9 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report); | |||
225 | int __init hiddev_init(void); | 227 | int __init hiddev_init(void); |
226 | void hiddev_exit(void); | 228 | void hiddev_exit(void); |
227 | #else | 229 | #else |
228 | static inline int hiddev_connect(struct hid_device *hid) { return -1; } | 230 | static inline int hiddev_connect(struct hid_device *hid, |
231 | unsigned int force) | ||
232 | { return -1; } | ||
229 | static inline void hiddev_disconnect(struct hid_device *hid) { } | 233 | static inline void hiddev_disconnect(struct hid_device *hid) { } |
230 | static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, | 234 | static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, |
231 | struct hid_usage *usage, __s32 value) { } | 235 | struct hid_usage *usage, __s32 value) { } |
diff --git a/include/linux/hpet.h b/include/linux/hpet.h index 2dc29ce6c8e4..79f63a27bcef 100644 --- a/include/linux/hpet.h +++ b/include/linux/hpet.h | |||
@@ -37,6 +37,7 @@ struct hpet { | |||
37 | #define hpet_compare _u1._hpet_compare | 37 | #define hpet_compare _u1._hpet_compare |
38 | 38 | ||
39 | #define HPET_MAX_TIMERS (32) | 39 | #define HPET_MAX_TIMERS (32) |
40 | #define HPET_MAX_IRQ (32) | ||
40 | 41 | ||
41 | /* | 42 | /* |
42 | * HPET general capabilities register | 43 | * HPET general capabilities register |
@@ -64,7 +65,7 @@ struct hpet { | |||
64 | */ | 65 | */ |
65 | 66 | ||
66 | #define Tn_INT_ROUTE_CAP_MASK (0xffffffff00000000ULL) | 67 | #define Tn_INT_ROUTE_CAP_MASK (0xffffffff00000000ULL) |
67 | #define Tn_INI_ROUTE_CAP_SHIFT (32UL) | 68 | #define Tn_INT_ROUTE_CAP_SHIFT (32UL) |
68 | #define Tn_FSB_INT_DELCAP_MASK (0x8000UL) | 69 | #define Tn_FSB_INT_DELCAP_MASK (0x8000UL) |
69 | #define Tn_FSB_INT_DELCAP_SHIFT (15) | 70 | #define Tn_FSB_INT_DELCAP_SHIFT (15) |
70 | #define Tn_FSB_EN_CNF_MASK (0x4000UL) | 71 | #define Tn_FSB_EN_CNF_MASK (0x4000UL) |
@@ -91,23 +92,14 @@ struct hpet { | |||
91 | * exported interfaces | 92 | * exported interfaces |
92 | */ | 93 | */ |
93 | 94 | ||
94 | struct hpet_task { | ||
95 | void (*ht_func) (void *); | ||
96 | void *ht_data; | ||
97 | void *ht_opaque; | ||
98 | }; | ||
99 | |||
100 | struct hpet_data { | 95 | struct hpet_data { |
101 | unsigned long hd_phys_address; | 96 | unsigned long hd_phys_address; |
102 | void __iomem *hd_address; | 97 | void __iomem *hd_address; |
103 | unsigned short hd_nirqs; | 98 | unsigned short hd_nirqs; |
104 | unsigned short hd_flags; | ||
105 | unsigned int hd_state; /* timer allocated */ | 99 | unsigned int hd_state; /* timer allocated */ |
106 | unsigned int hd_irq[HPET_MAX_TIMERS]; | 100 | unsigned int hd_irq[HPET_MAX_TIMERS]; |
107 | }; | 101 | }; |
108 | 102 | ||
109 | #define HPET_DATA_PLATFORM 0x0001 /* platform call to hpet_alloc */ | ||
110 | |||
111 | static inline void hpet_reserve_timer(struct hpet_data *hd, int timer) | 103 | static inline void hpet_reserve_timer(struct hpet_data *hd, int timer) |
112 | { | 104 | { |
113 | hd->hd_state |= (1 << timer); | 105 | hd->hd_state |= (1 << timer); |
@@ -125,7 +117,7 @@ struct hpet_info { | |||
125 | unsigned short hi_timer; | 117 | unsigned short hi_timer; |
126 | }; | 118 | }; |
127 | 119 | ||
128 | #define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ | 120 | #define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */ |
129 | 121 | ||
130 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ | 122 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ |
131 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ | 123 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 1e6f731381d9..cb25c1cc2352 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -49,14 +49,22 @@ enum hrtimer_restart { | |||
49 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context | 49 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context |
50 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and | 50 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and |
51 | * does not restart the timer | 51 | * does not restart the timer |
52 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context | 52 | * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context |
53 | * Special mode for tick emultation | 53 | * Special mode for tick emulation and |
54 | * scheduler timer. Such timers are per | ||
55 | * cpu and not allowed to be migrated on | ||
56 | * cpu unplug. | ||
57 | * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context | ||
58 | * with timer->base lock unlocked | ||
59 | * used for timers which call wakeup to | ||
60 | * avoid lock order problems with rq->lock | ||
54 | */ | 61 | */ |
55 | enum hrtimer_cb_mode { | 62 | enum hrtimer_cb_mode { |
56 | HRTIMER_CB_SOFTIRQ, | 63 | HRTIMER_CB_SOFTIRQ, |
57 | HRTIMER_CB_IRQSAFE, | 64 | HRTIMER_CB_IRQSAFE, |
58 | HRTIMER_CB_IRQSAFE_NO_RESTART, | 65 | HRTIMER_CB_IRQSAFE_NO_RESTART, |
59 | HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, | 66 | HRTIMER_CB_IRQSAFE_PERCPU, |
67 | HRTIMER_CB_IRQSAFE_UNLOCKED, | ||
60 | }; | 68 | }; |
61 | 69 | ||
62 | /* | 70 | /* |
@@ -69,9 +77,10 @@ enum hrtimer_cb_mode { | |||
69 | * 0x02 callback function running | 77 | * 0x02 callback function running |
70 | * 0x04 callback pending (high resolution mode) | 78 | * 0x04 callback pending (high resolution mode) |
71 | * | 79 | * |
72 | * Special case: | 80 | * Special cases: |
73 | * 0x03 callback function running and enqueued | 81 | * 0x03 callback function running and enqueued |
74 | * (was requeued on another CPU) | 82 | * (was requeued on another CPU) |
83 | * 0x09 timer was migrated on CPU hotunplug | ||
75 | * The "callback function running and enqueued" status is only possible on | 84 | * The "callback function running and enqueued" status is only possible on |
76 | * SMP. It happens for example when a posix timer expired and the callback | 85 | * SMP. It happens for example when a posix timer expired and the callback |
77 | * queued a signal. Between dropping the lock which protects the posix timer | 86 | * queued a signal. Between dropping the lock which protects the posix timer |
@@ -89,6 +98,7 @@ enum hrtimer_cb_mode { | |||
89 | #define HRTIMER_STATE_ENQUEUED 0x01 | 98 | #define HRTIMER_STATE_ENQUEUED 0x01 |
90 | #define HRTIMER_STATE_CALLBACK 0x02 | 99 | #define HRTIMER_STATE_CALLBACK 0x02 |
91 | #define HRTIMER_STATE_PENDING 0x04 | 100 | #define HRTIMER_STATE_PENDING 0x04 |
101 | #define HRTIMER_STATE_MIGRATE 0x08 | ||
92 | 102 | ||
93 | /** | 103 | /** |
94 | * struct hrtimer - the basic hrtimer structure | 104 | * struct hrtimer - the basic hrtimer structure |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index bf34c5f4c051..493435bcdbe5 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -41,7 +41,6 @@ | |||
41 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ | 41 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ |
42 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ | 42 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ |
43 | #define I2C_DRIVERID_PCF8583 25 /* real time clock */ | 43 | #define I2C_DRIVERID_PCF8583 25 /* real time clock */ |
44 | #define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */ | ||
45 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | 44 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ |
46 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ | 45 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ |
47 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | 46 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 75ae6d8aba4f..4c4e57d1f19d 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -570,7 +570,6 @@ struct i2o_controller { | |||
570 | #endif | 570 | #endif |
571 | spinlock_t lock; /* lock for controller | 571 | spinlock_t lock; /* lock for controller |
572 | configuration */ | 572 | configuration */ |
573 | |||
574 | void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ | 573 | void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ |
575 | }; | 574 | }; |
576 | 575 | ||
@@ -691,289 +690,22 @@ static inline u32 i2o_dma_high(dma_addr_t dma_addr) | |||
691 | }; | 690 | }; |
692 | #endif | 691 | #endif |
693 | 692 | ||
694 | /** | 693 | extern u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size); |
695 | * i2o_sg_tablesize - Calculate the maximum number of elements in a SGL | 694 | extern dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, |
696 | * @c: I2O controller for which the calculation should be done | ||
697 | * @body_size: maximum body size used for message in 32-bit words. | ||
698 | * | ||
699 | * Return the maximum number of SG elements in a SG list. | ||
700 | */ | ||
701 | static inline u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size) | ||
702 | { | ||
703 | i2o_status_block *sb = c->status_block.virt; | ||
704 | u16 sg_count = | ||
705 | (sb->inbound_frame_size - sizeof(struct i2o_message) / 4) - | ||
706 | body_size; | ||
707 | |||
708 | if (c->pae_support) { | ||
709 | /* | ||
710 | * for 64-bit a SG attribute element must be added and each | ||
711 | * SG element needs 12 bytes instead of 8. | ||
712 | */ | ||
713 | sg_count -= 2; | ||
714 | sg_count /= 3; | ||
715 | } else | ||
716 | sg_count /= 2; | ||
717 | |||
718 | if (c->short_req && (sg_count > 8)) | ||
719 | sg_count = 8; | ||
720 | |||
721 | return sg_count; | ||
722 | }; | ||
723 | |||
724 | /** | ||
725 | * i2o_dma_map_single - Map pointer to controller and fill in I2O message. | ||
726 | * @c: I2O controller | ||
727 | * @ptr: pointer to the data which should be mapped | ||
728 | * @size: size of data in bytes | ||
729 | * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE | ||
730 | * @sg_ptr: pointer to the SG list inside the I2O message | ||
731 | * | ||
732 | * This function does all necessary DMA handling and also writes the I2O | ||
733 | * SGL elements into the I2O message. For details on DMA handling see also | ||
734 | * dma_map_single(). The pointer sg_ptr will only be set to the end of the | ||
735 | * SG list if the allocation was successful. | ||
736 | * | ||
737 | * Returns DMA address which must be checked for failures using | ||
738 | * dma_mapping_error(). | ||
739 | */ | ||
740 | static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, | ||
741 | size_t size, | 695 | size_t size, |
742 | enum dma_data_direction direction, | 696 | enum dma_data_direction direction, |
743 | u32 ** sg_ptr) | 697 | u32 ** sg_ptr); |
744 | { | 698 | extern int i2o_dma_map_sg(struct i2o_controller *c, |
745 | u32 sg_flags; | ||
746 | u32 *mptr = *sg_ptr; | ||
747 | dma_addr_t dma_addr; | ||
748 | |||
749 | switch (direction) { | ||
750 | case DMA_TO_DEVICE: | ||
751 | sg_flags = 0xd4000000; | ||
752 | break; | ||
753 | case DMA_FROM_DEVICE: | ||
754 | sg_flags = 0xd0000000; | ||
755 | break; | ||
756 | default: | ||
757 | return 0; | ||
758 | } | ||
759 | |||
760 | dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction); | ||
761 | if (!dma_mapping_error(&c->pdev->dev, dma_addr)) { | ||
762 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
763 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { | ||
764 | *mptr++ = cpu_to_le32(0x7C020002); | ||
765 | *mptr++ = cpu_to_le32(PAGE_SIZE); | ||
766 | } | ||
767 | #endif | ||
768 | |||
769 | *mptr++ = cpu_to_le32(sg_flags | size); | ||
770 | *mptr++ = cpu_to_le32(i2o_dma_low(dma_addr)); | ||
771 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
772 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) | ||
773 | *mptr++ = cpu_to_le32(i2o_dma_high(dma_addr)); | ||
774 | #endif | ||
775 | *sg_ptr = mptr; | ||
776 | } | ||
777 | return dma_addr; | ||
778 | }; | ||
779 | |||
780 | /** | ||
781 | * i2o_dma_map_sg - Map a SG List to controller and fill in I2O message. | ||
782 | * @c: I2O controller | ||
783 | * @sg: SG list to be mapped | ||
784 | * @sg_count: number of elements in the SG list | ||
785 | * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE | ||
786 | * @sg_ptr: pointer to the SG list inside the I2O message | ||
787 | * | ||
788 | * This function does all necessary DMA handling and also writes the I2O | ||
789 | * SGL elements into the I2O message. For details on DMA handling see also | ||
790 | * dma_map_sg(). The pointer sg_ptr will only be set to the end of the SG | ||
791 | * list if the allocation was successful. | ||
792 | * | ||
793 | * Returns 0 on failure or 1 on success. | ||
794 | */ | ||
795 | static inline int i2o_dma_map_sg(struct i2o_controller *c, | ||
796 | struct scatterlist *sg, int sg_count, | 699 | struct scatterlist *sg, int sg_count, |
797 | enum dma_data_direction direction, | 700 | enum dma_data_direction direction, |
798 | u32 ** sg_ptr) | 701 | u32 ** sg_ptr); |
799 | { | 702 | extern int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, size_t len); |
800 | u32 sg_flags; | 703 | extern void i2o_dma_free(struct device *dev, struct i2o_dma *addr); |
801 | u32 *mptr = *sg_ptr; | 704 | extern int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, |
802 | 705 | size_t len); | |
803 | switch (direction) { | 706 | extern int i2o_pool_alloc(struct i2o_pool *pool, const char *name, |
804 | case DMA_TO_DEVICE: | 707 | size_t size, int min_nr); |
805 | sg_flags = 0x14000000; | 708 | extern void i2o_pool_free(struct i2o_pool *pool); |
806 | break; | ||
807 | case DMA_FROM_DEVICE: | ||
808 | sg_flags = 0x10000000; | ||
809 | break; | ||
810 | default: | ||
811 | return 0; | ||
812 | } | ||
813 | |||
814 | sg_count = dma_map_sg(&c->pdev->dev, sg, sg_count, direction); | ||
815 | if (!sg_count) | ||
816 | return 0; | ||
817 | |||
818 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
819 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { | ||
820 | *mptr++ = cpu_to_le32(0x7C020002); | ||
821 | *mptr++ = cpu_to_le32(PAGE_SIZE); | ||
822 | } | ||
823 | #endif | ||
824 | |||
825 | while (sg_count-- > 0) { | ||
826 | if (!sg_count) | ||
827 | sg_flags |= 0xC0000000; | ||
828 | *mptr++ = cpu_to_le32(sg_flags | sg_dma_len(sg)); | ||
829 | *mptr++ = cpu_to_le32(i2o_dma_low(sg_dma_address(sg))); | ||
830 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | ||
831 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) | ||
832 | *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg))); | ||
833 | #endif | ||
834 | sg = sg_next(sg); | ||
835 | } | ||
836 | *sg_ptr = mptr; | ||
837 | |||
838 | return 1; | ||
839 | }; | ||
840 | |||
841 | /** | ||
842 | * i2o_dma_alloc - Allocate DMA memory | ||
843 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
844 | * @addr: i2o_dma struct which should get the DMA buffer | ||
845 | * @len: length of the new DMA memory | ||
846 | * @gfp_mask: GFP mask | ||
847 | * | ||
848 | * Allocate a coherent DMA memory and write the pointers into addr. | ||
849 | * | ||
850 | * Returns 0 on success or -ENOMEM on failure. | ||
851 | */ | ||
852 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, | ||
853 | size_t len, gfp_t gfp_mask) | ||
854 | { | ||
855 | struct pci_dev *pdev = to_pci_dev(dev); | ||
856 | int dma_64 = 0; | ||
857 | |||
858 | if ((sizeof(dma_addr_t) > 4) && (pdev->dma_mask == DMA_64BIT_MASK)) { | ||
859 | dma_64 = 1; | ||
860 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) | ||
861 | return -ENOMEM; | ||
862 | } | ||
863 | |||
864 | addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask); | ||
865 | |||
866 | if ((sizeof(dma_addr_t) > 4) && dma_64) | ||
867 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK)) | ||
868 | printk(KERN_WARNING "i2o: unable to set 64-bit DMA"); | ||
869 | |||
870 | if (!addr->virt) | ||
871 | return -ENOMEM; | ||
872 | |||
873 | memset(addr->virt, 0, len); | ||
874 | addr->len = len; | ||
875 | |||
876 | return 0; | ||
877 | }; | ||
878 | |||
879 | /** | ||
880 | * i2o_dma_free - Free DMA memory | ||
881 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
882 | * @addr: i2o_dma struct which contains the DMA buffer | ||
883 | * | ||
884 | * Free a coherent DMA memory and set virtual address of addr to NULL. | ||
885 | */ | ||
886 | static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr) | ||
887 | { | ||
888 | if (addr->virt) { | ||
889 | if (addr->phys) | ||
890 | dma_free_coherent(dev, addr->len, addr->virt, | ||
891 | addr->phys); | ||
892 | else | ||
893 | kfree(addr->virt); | ||
894 | addr->virt = NULL; | ||
895 | } | ||
896 | }; | ||
897 | |||
898 | /** | ||
899 | * i2o_dma_realloc - Realloc DMA memory | ||
900 | * @dev: struct device pointer to the PCI device of the I2O controller | ||
901 | * @addr: pointer to a i2o_dma struct DMA buffer | ||
902 | * @len: new length of memory | ||
903 | * @gfp_mask: GFP mask | ||
904 | * | ||
905 | * If there was something allocated in the addr, free it first. If len > 0 | ||
906 | * than try to allocate it and write the addresses back to the addr | ||
907 | * structure. If len == 0 set the virtual address to NULL. | ||
908 | * | ||
909 | * Returns the 0 on success or negative error code on failure. | ||
910 | */ | ||
911 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, | ||
912 | size_t len, gfp_t gfp_mask) | ||
913 | { | ||
914 | i2o_dma_free(dev, addr); | ||
915 | |||
916 | if (len) | ||
917 | return i2o_dma_alloc(dev, addr, len, gfp_mask); | ||
918 | |||
919 | return 0; | ||
920 | }; | ||
921 | |||
922 | /* | ||
923 | * i2o_pool_alloc - Allocate an slab cache and mempool | ||
924 | * @mempool: pointer to struct i2o_pool to write data into. | ||
925 | * @name: name which is used to identify cache | ||
926 | * @size: size of each object | ||
927 | * @min_nr: minimum number of objects | ||
928 | * | ||
929 | * First allocates a slab cache with name and size. Then allocates a | ||
930 | * mempool which uses the slab cache for allocation and freeing. | ||
931 | * | ||
932 | * Returns 0 on success or negative error code on failure. | ||
933 | */ | ||
934 | static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name, | ||
935 | size_t size, int min_nr) | ||
936 | { | ||
937 | pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL); | ||
938 | if (!pool->name) | ||
939 | goto exit; | ||
940 | strcpy(pool->name, name); | ||
941 | |||
942 | pool->slab = | ||
943 | kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL); | ||
944 | if (!pool->slab) | ||
945 | goto free_name; | ||
946 | |||
947 | pool->mempool = mempool_create_slab_pool(min_nr, pool->slab); | ||
948 | if (!pool->mempool) | ||
949 | goto free_slab; | ||
950 | |||
951 | return 0; | ||
952 | |||
953 | free_slab: | ||
954 | kmem_cache_destroy(pool->slab); | ||
955 | |||
956 | free_name: | ||
957 | kfree(pool->name); | ||
958 | |||
959 | exit: | ||
960 | return -ENOMEM; | ||
961 | }; | ||
962 | |||
963 | /* | ||
964 | * i2o_pool_free - Free slab cache and mempool again | ||
965 | * @mempool: pointer to struct i2o_pool which should be freed | ||
966 | * | ||
967 | * Note that you have to return all objects to the mempool again before | ||
968 | * calling i2o_pool_free(). | ||
969 | */ | ||
970 | static inline void i2o_pool_free(struct i2o_pool *pool) | ||
971 | { | ||
972 | mempool_destroy(pool->mempool); | ||
973 | kmem_cache_destroy(pool->slab); | ||
974 | kfree(pool->name); | ||
975 | }; | ||
976 | |||
977 | /* I2O driver (OSM) functions */ | 709 | /* I2O driver (OSM) functions */ |
978 | extern int i2o_driver_register(struct i2o_driver *); | 710 | extern int i2o_driver_register(struct i2o_driver *); |
979 | extern void i2o_driver_unregister(struct i2o_driver *); | 711 | extern void i2o_driver_unregister(struct i2o_driver *); |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 03067443198a..a93a8dd33118 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -40,16 +40,18 @@ struct icmp6hdr { | |||
40 | struct icmpv6_nd_ra { | 40 | struct icmpv6_nd_ra { |
41 | __u8 hop_limit; | 41 | __u8 hop_limit; |
42 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 42 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
43 | __u8 reserved:4, | 43 | __u8 reserved:3, |
44 | router_pref:2, | 44 | router_pref:2, |
45 | home_agent:1, | ||
45 | other:1, | 46 | other:1, |
46 | managed:1; | 47 | managed:1; |
47 | 48 | ||
48 | #elif defined(__BIG_ENDIAN_BITFIELD) | 49 | #elif defined(__BIG_ENDIAN_BITFIELD) |
49 | __u8 managed:1, | 50 | __u8 managed:1, |
50 | other:1, | 51 | other:1, |
52 | home_agent:1, | ||
51 | router_pref:2, | 53 | router_pref:2, |
52 | reserved:4; | 54 | reserved:3; |
53 | #else | 55 | #else |
54 | #error "Please fix <asm/byteorder.h>" | 56 | #error "Please fix <asm/byteorder.h>" |
55 | #endif | 57 | #endif |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1524829f73f2..c47e371554c1 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/ioport.h> | 10 | #include <linux/ioport.h> |
11 | #include <linux/hdreg.h> | 11 | #include <linux/ata.h> |
12 | #include <linux/blkdev.h> | 12 | #include <linux/blkdev.h> |
13 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/completion.h> | 19 | #include <linux/completion.h> |
20 | #include <linux/pm.h> | ||
20 | #ifdef CONFIG_BLK_DEV_IDEACPI | 21 | #ifdef CONFIG_BLK_DEV_IDEACPI |
21 | #include <acpi/acpi.h> | 22 | #include <acpi/acpi.h> |
22 | #endif | 23 | #endif |
@@ -47,12 +48,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
47 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ | 48 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ |
48 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ | 49 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ |
49 | 50 | ||
50 | /* | ||
51 | * state flags | ||
52 | */ | ||
53 | |||
54 | #define DMA_PIO_RETRY 1 /* retrying in PIO */ | ||
55 | |||
56 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) | 51 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) |
57 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) | 52 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) |
58 | 53 | ||
@@ -87,12 +82,13 @@ struct ide_io_ports { | |||
87 | }; | 82 | }; |
88 | 83 | ||
89 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) | 84 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) |
90 | #define BAD_R_STAT (BUSY_STAT | ERR_STAT) | ||
91 | #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) | ||
92 | #define BAD_STAT (BAD_R_STAT | DRQ_STAT) | ||
93 | #define DRIVE_READY (READY_STAT | SEEK_STAT) | ||
94 | 85 | ||
95 | #define BAD_CRC (ABRT_ERR | ICRC_ERR) | 86 | #define BAD_R_STAT (ATA_BUSY | ATA_ERR) |
87 | #define BAD_W_STAT (BAD_R_STAT | ATA_DF) | ||
88 | #define BAD_STAT (BAD_R_STAT | ATA_DRQ) | ||
89 | #define DRIVE_READY (ATA_DRDY | ATA_DSC) | ||
90 | |||
91 | #define BAD_CRC (ATA_ABORTED | ATA_ICRC) | ||
96 | 92 | ||
97 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ | 93 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ |
98 | 94 | ||
@@ -125,24 +121,43 @@ struct ide_io_ports { | |||
125 | #define PARTN_BITS 6 /* number of minor dev bits for partitions */ | 121 | #define PARTN_BITS 6 /* number of minor dev bits for partitions */ |
126 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ | 122 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ |
127 | #define SECTOR_SIZE 512 | 123 | #define SECTOR_SIZE 512 |
128 | #define SECTOR_WORDS (SECTOR_SIZE / 4) /* number of 32bit words per sector */ | 124 | |
129 | #define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) | 125 | #define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) |
130 | 126 | ||
131 | /* | 127 | /* |
132 | * Timeouts for various operations: | 128 | * Timeouts for various operations: |
133 | */ | 129 | */ |
134 | #define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ | 130 | enum { |
135 | #define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ | 131 | /* spec allows up to 20ms */ |
136 | #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ | 132 | WAIT_DRQ = HZ / 10, /* 100ms */ |
137 | #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ | 133 | /* some laptops are very slow */ |
138 | #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ | 134 | WAIT_READY = 5 * HZ, /* 5s */ |
139 | #define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ | 135 | /* should be less than 3ms (?), if all ATAPI CD is closed at boot */ |
136 | WAIT_PIDENTIFY = 10 * HZ, /* 10s */ | ||
137 | /* worst case when spinning up */ | ||
138 | WAIT_WORSTCASE = 30 * HZ, /* 30s */ | ||
139 | /* maximum wait for an IRQ to happen */ | ||
140 | WAIT_CMD = 10 * HZ, /* 10s */ | ||
141 | /* Some drives require a longer IRQ timeout. */ | ||
142 | WAIT_FLOPPY_CMD = 50 * HZ, /* 50s */ | ||
143 | /* | ||
144 | * Some drives (for example, Seagate STT3401A Travan) require a very | ||
145 | * long timeout, because they don't return an interrupt or clear their | ||
146 | * BSY bit until after the command completes (even retension commands). | ||
147 | */ | ||
148 | WAIT_TAPE_CMD = 900 * HZ, /* 900s */ | ||
149 | /* minimum sleep time */ | ||
150 | WAIT_MIN_SLEEP = HZ / 50, /* 20ms */ | ||
151 | }; | ||
140 | 152 | ||
141 | /* | 153 | /* |
142 | * Op codes for special requests to be handled by ide_special_rq(). | 154 | * Op codes for special requests to be handled by ide_special_rq(). |
143 | * Values should be in the range of 0x20 to 0x3f. | 155 | * Values should be in the range of 0x20 to 0x3f. |
144 | */ | 156 | */ |
145 | #define REQ_DRIVE_RESET 0x20 | 157 | #define REQ_DRIVE_RESET 0x20 |
158 | #define REQ_DEVSET_EXEC 0x21 | ||
159 | #define REQ_PARK_HEADS 0x22 | ||
160 | #define REQ_UNPARK_HEADS 0x23 | ||
146 | 161 | ||
147 | /* | 162 | /* |
148 | * Check for an interrupt and acknowledge the interrupt status | 163 | * Check for an interrupt and acknowledge the interrupt status |
@@ -249,8 +264,6 @@ static inline int __ide_default_irq(unsigned long base) | |||
249 | * set_geometry : respecify drive geometry | 264 | * set_geometry : respecify drive geometry |
250 | * recalibrate : seek to cyl 0 | 265 | * recalibrate : seek to cyl 0 |
251 | * set_multmode : set multmode count | 266 | * set_multmode : set multmode count |
252 | * set_tune : tune interface for drive | ||
253 | * serviced : service command | ||
254 | * reserved : unused | 267 | * reserved : unused |
255 | */ | 268 | */ |
256 | typedef union { | 269 | typedef union { |
@@ -259,43 +272,11 @@ typedef union { | |||
259 | unsigned set_geometry : 1; | 272 | unsigned set_geometry : 1; |
260 | unsigned recalibrate : 1; | 273 | unsigned recalibrate : 1; |
261 | unsigned set_multmode : 1; | 274 | unsigned set_multmode : 1; |
262 | unsigned set_tune : 1; | 275 | unsigned reserved : 5; |
263 | unsigned serviced : 1; | ||
264 | unsigned reserved : 3; | ||
265 | } b; | 276 | } b; |
266 | } special_t; | 277 | } special_t; |
267 | 278 | ||
268 | /* | 279 | /* |
269 | * ATA-IDE Select Register, aka Device-Head | ||
270 | * | ||
271 | * head : always zeros here | ||
272 | * unit : drive select number: 0/1 | ||
273 | * bit5 : always 1 | ||
274 | * lba : using LBA instead of CHS | ||
275 | * bit7 : always 1 | ||
276 | */ | ||
277 | typedef union { | ||
278 | unsigned all : 8; | ||
279 | struct { | ||
280 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
281 | unsigned head : 4; | ||
282 | unsigned unit : 1; | ||
283 | unsigned bit5 : 1; | ||
284 | unsigned lba : 1; | ||
285 | unsigned bit7 : 1; | ||
286 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
287 | unsigned bit7 : 1; | ||
288 | unsigned lba : 1; | ||
289 | unsigned bit5 : 1; | ||
290 | unsigned unit : 1; | ||
291 | unsigned head : 4; | ||
292 | #else | ||
293 | #error "Please fix <asm/byteorder.h>" | ||
294 | #endif | ||
295 | } b; | ||
296 | } select_t, ata_select_t; | ||
297 | |||
298 | /* | ||
299 | * Status returned from various ide_ functions | 280 | * Status returned from various ide_ functions |
300 | */ | 281 | */ |
301 | typedef enum { | 282 | typedef enum { |
@@ -303,8 +284,177 @@ typedef enum { | |||
303 | ide_started, /* a drive operation was started, handler was set */ | 284 | ide_started, /* a drive operation was started, handler was set */ |
304 | } ide_startstop_t; | 285 | } ide_startstop_t; |
305 | 286 | ||
287 | enum { | ||
288 | IDE_TFLAG_LBA48 = (1 << 0), | ||
289 | IDE_TFLAG_FLAGGED = (1 << 2), | ||
290 | IDE_TFLAG_OUT_DATA = (1 << 3), | ||
291 | IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4), | ||
292 | IDE_TFLAG_OUT_HOB_NSECT = (1 << 5), | ||
293 | IDE_TFLAG_OUT_HOB_LBAL = (1 << 6), | ||
294 | IDE_TFLAG_OUT_HOB_LBAM = (1 << 7), | ||
295 | IDE_TFLAG_OUT_HOB_LBAH = (1 << 8), | ||
296 | IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE | | ||
297 | IDE_TFLAG_OUT_HOB_NSECT | | ||
298 | IDE_TFLAG_OUT_HOB_LBAL | | ||
299 | IDE_TFLAG_OUT_HOB_LBAM | | ||
300 | IDE_TFLAG_OUT_HOB_LBAH, | ||
301 | IDE_TFLAG_OUT_FEATURE = (1 << 9), | ||
302 | IDE_TFLAG_OUT_NSECT = (1 << 10), | ||
303 | IDE_TFLAG_OUT_LBAL = (1 << 11), | ||
304 | IDE_TFLAG_OUT_LBAM = (1 << 12), | ||
305 | IDE_TFLAG_OUT_LBAH = (1 << 13), | ||
306 | IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE | | ||
307 | IDE_TFLAG_OUT_NSECT | | ||
308 | IDE_TFLAG_OUT_LBAL | | ||
309 | IDE_TFLAG_OUT_LBAM | | ||
310 | IDE_TFLAG_OUT_LBAH, | ||
311 | IDE_TFLAG_OUT_DEVICE = (1 << 14), | ||
312 | IDE_TFLAG_WRITE = (1 << 15), | ||
313 | IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16), | ||
314 | IDE_TFLAG_IN_DATA = (1 << 17), | ||
315 | IDE_TFLAG_CUSTOM_HANDLER = (1 << 18), | ||
316 | IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19), | ||
317 | IDE_TFLAG_IN_HOB_FEATURE = (1 << 20), | ||
318 | IDE_TFLAG_IN_HOB_NSECT = (1 << 21), | ||
319 | IDE_TFLAG_IN_HOB_LBAL = (1 << 22), | ||
320 | IDE_TFLAG_IN_HOB_LBAM = (1 << 23), | ||
321 | IDE_TFLAG_IN_HOB_LBAH = (1 << 24), | ||
322 | IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL | | ||
323 | IDE_TFLAG_IN_HOB_LBAM | | ||
324 | IDE_TFLAG_IN_HOB_LBAH, | ||
325 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | ||
326 | IDE_TFLAG_IN_HOB_NSECT | | ||
327 | IDE_TFLAG_IN_HOB_LBA, | ||
328 | IDE_TFLAG_IN_FEATURE = (1 << 1), | ||
329 | IDE_TFLAG_IN_NSECT = (1 << 25), | ||
330 | IDE_TFLAG_IN_LBAL = (1 << 26), | ||
331 | IDE_TFLAG_IN_LBAM = (1 << 27), | ||
332 | IDE_TFLAG_IN_LBAH = (1 << 28), | ||
333 | IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL | | ||
334 | IDE_TFLAG_IN_LBAM | | ||
335 | IDE_TFLAG_IN_LBAH, | ||
336 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | | ||
337 | IDE_TFLAG_IN_LBA, | ||
338 | IDE_TFLAG_IN_DEVICE = (1 << 29), | ||
339 | IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB | | ||
340 | IDE_TFLAG_IN_HOB, | ||
341 | IDE_TFLAG_TF = IDE_TFLAG_OUT_TF | | ||
342 | IDE_TFLAG_IN_TF, | ||
343 | IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE | | ||
344 | IDE_TFLAG_IN_DEVICE, | ||
345 | /* force 16-bit I/O operations */ | ||
346 | IDE_TFLAG_IO_16BIT = (1 << 30), | ||
347 | /* ide_task_t was allocated using kmalloc() */ | ||
348 | IDE_TFLAG_DYN = (1 << 31), | ||
349 | }; | ||
350 | |||
351 | struct ide_taskfile { | ||
352 | u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ | ||
353 | |||
354 | u8 hob_feature; /* 1-5: additional data to support LBA48 */ | ||
355 | u8 hob_nsect; | ||
356 | u8 hob_lbal; | ||
357 | u8 hob_lbam; | ||
358 | u8 hob_lbah; | ||
359 | |||
360 | u8 data; /* 6: low data byte (for TASKFILE IOCTL) */ | ||
361 | |||
362 | union { /* Â 7: */ | ||
363 | u8 error; /* read: error */ | ||
364 | u8 feature; /* write: feature */ | ||
365 | }; | ||
366 | |||
367 | u8 nsect; /* 8: number of sectors */ | ||
368 | u8 lbal; /* 9: LBA low */ | ||
369 | u8 lbam; /* 10: LBA mid */ | ||
370 | u8 lbah; /* 11: LBA high */ | ||
371 | |||
372 | u8 device; /* 12: device select */ | ||
373 | |||
374 | union { /* 13: */ | ||
375 | u8 status; /*  read: status  */ | ||
376 | u8 command; /* write: command */ | ||
377 | }; | ||
378 | }; | ||
379 | |||
380 | typedef struct ide_task_s { | ||
381 | union { | ||
382 | struct ide_taskfile tf; | ||
383 | u8 tf_array[14]; | ||
384 | }; | ||
385 | u32 tf_flags; | ||
386 | int data_phase; | ||
387 | struct request *rq; /* copy of request */ | ||
388 | void *special; /* valid_t generally */ | ||
389 | } ide_task_t; | ||
390 | |||
391 | /* ATAPI packet command flags */ | ||
392 | enum { | ||
393 | /* set when an error is considered normal - no retry (ide-tape) */ | ||
394 | PC_FLAG_ABORT = (1 << 0), | ||
395 | PC_FLAG_SUPPRESS_ERROR = (1 << 1), | ||
396 | PC_FLAG_WAIT_FOR_DSC = (1 << 2), | ||
397 | PC_FLAG_DMA_OK = (1 << 3), | ||
398 | PC_FLAG_DMA_IN_PROGRESS = (1 << 4), | ||
399 | PC_FLAG_DMA_ERROR = (1 << 5), | ||
400 | PC_FLAG_WRITING = (1 << 6), | ||
401 | /* command timed out */ | ||
402 | PC_FLAG_TIMEDOUT = (1 << 7), | ||
403 | }; | ||
404 | |||
405 | /* | ||
406 | * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. | ||
407 | * This is used for several packet commands (not for READ/WRITE commands). | ||
408 | */ | ||
409 | #define IDE_PC_BUFFER_SIZE 256 | ||
410 | |||
411 | struct ide_atapi_pc { | ||
412 | /* actual packet bytes */ | ||
413 | u8 c[12]; | ||
414 | /* incremented on each retry */ | ||
415 | int retries; | ||
416 | int error; | ||
417 | |||
418 | /* bytes to transfer */ | ||
419 | int req_xfer; | ||
420 | /* bytes actually transferred */ | ||
421 | int xferred; | ||
422 | |||
423 | /* data buffer */ | ||
424 | u8 *buf; | ||
425 | /* current buffer position */ | ||
426 | u8 *cur_pos; | ||
427 | int buf_size; | ||
428 | /* missing/available data on the current buffer */ | ||
429 | int b_count; | ||
430 | |||
431 | /* the corresponding request */ | ||
432 | struct request *rq; | ||
433 | |||
434 | unsigned long flags; | ||
435 | |||
436 | /* | ||
437 | * those are more or less driver-specific and some of them are subject | ||
438 | * to change/removal later. | ||
439 | */ | ||
440 | u8 pc_buf[IDE_PC_BUFFER_SIZE]; | ||
441 | |||
442 | /* idetape only */ | ||
443 | struct idetape_bh *bh; | ||
444 | char *b_data; | ||
445 | |||
446 | /* idescsi only for now */ | ||
447 | struct scatterlist *sg; | ||
448 | unsigned int sg_cnt; | ||
449 | |||
450 | struct scsi_cmnd *scsi_cmd; | ||
451 | void (*done) (struct scsi_cmnd *); | ||
452 | |||
453 | unsigned long timeout; | ||
454 | }; | ||
455 | |||
456 | struct ide_devset; | ||
306 | struct ide_driver_s; | 457 | struct ide_driver_s; |
307 | struct ide_settings_s; | ||
308 | 458 | ||
309 | #ifdef CONFIG_BLK_DEV_IDEACPI | 459 | #ifdef CONFIG_BLK_DEV_IDEACPI |
310 | struct ide_acpi_drive_link; | 460 | struct ide_acpi_drive_link; |
@@ -315,10 +465,10 @@ struct ide_acpi_hwif_link; | |||
315 | enum { | 465 | enum { |
316 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | 466 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), |
317 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), | 467 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), |
318 | |||
319 | /* ide-cd */ | ||
320 | /* Drive cannot lock the door. */ | 468 | /* Drive cannot lock the door. */ |
321 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), | 469 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), |
470 | |||
471 | /* ide-cd */ | ||
322 | /* Drive cannot eject the disc. */ | 472 | /* Drive cannot eject the disc. */ |
323 | IDE_AFLAG_NO_EJECT = (1 << 3), | 473 | IDE_AFLAG_NO_EJECT = (1 << 3), |
324 | /* Drive is a pre ATAPI 1.2 drive. */ | 474 | /* Drive is a pre ATAPI 1.2 drive. */ |
@@ -354,19 +504,81 @@ enum { | |||
354 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | 504 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), |
355 | /* Requires BH algorithm for packets */ | 505 | /* Requires BH algorithm for packets */ |
356 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | 506 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), |
507 | /* Write protect */ | ||
508 | IDE_AFLAG_WP = (1 << 21), | ||
509 | /* Supports format progress report */ | ||
510 | IDE_AFLAG_SRFP = (1 << 22), | ||
357 | 511 | ||
358 | /* ide-tape */ | 512 | /* ide-tape */ |
359 | IDE_AFLAG_IGNORE_DSC = (1 << 21), | 513 | IDE_AFLAG_IGNORE_DSC = (1 << 23), |
360 | /* 0 When the tape position is unknown */ | 514 | /* 0 When the tape position is unknown */ |
361 | IDE_AFLAG_ADDRESS_VALID = (1 << 22), | 515 | IDE_AFLAG_ADDRESS_VALID = (1 << 24), |
362 | /* Device already opened */ | 516 | /* Device already opened */ |
363 | IDE_AFLAG_BUSY = (1 << 23), | 517 | IDE_AFLAG_BUSY = (1 << 25), |
364 | /* Attempt to auto-detect the current user block size */ | 518 | /* Attempt to auto-detect the current user block size */ |
365 | IDE_AFLAG_DETECT_BS = (1 << 24), | 519 | IDE_AFLAG_DETECT_BS = (1 << 26), |
366 | /* Currently on a filemark */ | 520 | /* Currently on a filemark */ |
367 | IDE_AFLAG_FILEMARK = (1 << 25), | 521 | IDE_AFLAG_FILEMARK = (1 << 27), |
368 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | 522 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ |
369 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | 523 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 28), |
524 | |||
525 | IDE_AFLAG_NO_AUTOCLOSE = (1 << 29), | ||
526 | }; | ||
527 | |||
528 | /* device flags */ | ||
529 | enum { | ||
530 | /* restore settings after device reset */ | ||
531 | IDE_DFLAG_KEEP_SETTINGS = (1 << 0), | ||
532 | /* device is using DMA for read/write */ | ||
533 | IDE_DFLAG_USING_DMA = (1 << 1), | ||
534 | /* okay to unmask other IRQs */ | ||
535 | IDE_DFLAG_UNMASK = (1 << 2), | ||
536 | /* don't attempt flushes */ | ||
537 | IDE_DFLAG_NOFLUSH = (1 << 3), | ||
538 | /* DSC overlap */ | ||
539 | IDE_DFLAG_DSC_OVERLAP = (1 << 4), | ||
540 | /* give potential excess bandwidth */ | ||
541 | IDE_DFLAG_NICE1 = (1 << 5), | ||
542 | /* device is physically present */ | ||
543 | IDE_DFLAG_PRESENT = (1 << 6), | ||
544 | /* device ejected hint */ | ||
545 | IDE_DFLAG_DEAD = (1 << 7), | ||
546 | /* id read from device (synthetic if not set) */ | ||
547 | IDE_DFLAG_ID_READ = (1 << 8), | ||
548 | IDE_DFLAG_NOPROBE = (1 << 9), | ||
549 | /* need to do check_media_change() */ | ||
550 | IDE_DFLAG_REMOVABLE = (1 << 10), | ||
551 | /* needed for removable devices */ | ||
552 | IDE_DFLAG_ATTACH = (1 << 11), | ||
553 | IDE_DFLAG_FORCED_GEOM = (1 << 12), | ||
554 | /* disallow setting unmask bit */ | ||
555 | IDE_DFLAG_NO_UNMASK = (1 << 13), | ||
556 | /* disallow enabling 32-bit I/O */ | ||
557 | IDE_DFLAG_NO_IO_32BIT = (1 << 14), | ||
558 | /* for removable only: door lock/unlock works */ | ||
559 | IDE_DFLAG_DOORLOCKING = (1 << 15), | ||
560 | /* disallow DMA */ | ||
561 | IDE_DFLAG_NODMA = (1 << 16), | ||
562 | /* powermanagment told us not to do anything, so sleep nicely */ | ||
563 | IDE_DFLAG_BLOCKED = (1 << 17), | ||
564 | /* ide-scsi emulation */ | ||
565 | IDE_DFLAG_SCSI = (1 << 18), | ||
566 | /* sleeping & sleep field valid */ | ||
567 | IDE_DFLAG_SLEEPING = (1 << 19), | ||
568 | IDE_DFLAG_POST_RESET = (1 << 20), | ||
569 | IDE_DFLAG_UDMA33_WARNED = (1 << 21), | ||
570 | IDE_DFLAG_LBA48 = (1 << 22), | ||
571 | /* status of write cache */ | ||
572 | IDE_DFLAG_WCACHE = (1 << 23), | ||
573 | /* used for ignoring ATA_DF */ | ||
574 | IDE_DFLAG_NOWERR = (1 << 24), | ||
575 | /* retrying in PIO */ | ||
576 | IDE_DFLAG_DMA_PIO_RETRY = (1 << 25), | ||
577 | IDE_DFLAG_LBA = (1 << 26), | ||
578 | /* don't unload heads */ | ||
579 | IDE_DFLAG_NO_UNLOAD = (1 << 27), | ||
580 | /* heads unloaded, please don't reset port */ | ||
581 | IDE_DFLAG_PARKED = (1 << 28) | ||
370 | }; | 582 | }; |
371 | 583 | ||
372 | struct ide_drive_s { | 584 | struct ide_drive_s { |
@@ -378,72 +590,47 @@ struct ide_drive_s { | |||
378 | struct request *rq; /* current request */ | 590 | struct request *rq; /* current request */ |
379 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 591 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
380 | void *driver_data; /* extra driver data */ | 592 | void *driver_data; /* extra driver data */ |
381 | struct hd_driveid *id; /* drive model identification info */ | 593 | u16 *id; /* identification info */ |
382 | #ifdef CONFIG_IDE_PROC_FS | 594 | #ifdef CONFIG_IDE_PROC_FS |
383 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 595 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
384 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ | 596 | const struct ide_proc_devset *settings; /* /proc/ide/ drive settings */ |
385 | #endif | 597 | #endif |
386 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 598 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
387 | 599 | ||
600 | unsigned long dev_flags; | ||
601 | |||
388 | unsigned long sleep; /* sleep until this time */ | 602 | unsigned long sleep; /* sleep until this time */ |
389 | unsigned long service_start; /* time we started last request */ | 603 | unsigned long service_start; /* time we started last request */ |
390 | unsigned long service_time; /* service time of last request */ | 604 | unsigned long service_time; /* service time of last request */ |
391 | unsigned long timeout; /* max time to wait for irq */ | 605 | unsigned long timeout; /* max time to wait for irq */ |
392 | 606 | ||
393 | special_t special; /* special action flags */ | 607 | special_t special; /* special action flags */ |
394 | select_t select; /* basic drive/head select reg value */ | ||
395 | 608 | ||
396 | u8 keep_settings; /* restore settings after drive reset */ | 609 | u8 select; /* basic drive/head select reg value */ |
397 | u8 using_dma; /* disk is using dma for read/write */ | ||
398 | u8 retry_pio; /* retrying dma capable host in pio */ | 610 | u8 retry_pio; /* retrying dma capable host in pio */ |
399 | u8 state; /* retry state */ | ||
400 | u8 waiting_for_dma; /* dma currently in progress */ | 611 | u8 waiting_for_dma; /* dma currently in progress */ |
401 | u8 unmask; /* okay to unmask other irqs */ | 612 | u8 dma; /* atapi dma flag */ |
402 | u8 noflush; /* don't attempt flushes */ | 613 | |
403 | u8 dsc_overlap; /* DSC overlap */ | ||
404 | u8 nice1; /* give potential excess bandwidth */ | ||
405 | |||
406 | unsigned present : 1; /* drive is physically present */ | ||
407 | unsigned dead : 1; /* device ejected hint */ | ||
408 | unsigned id_read : 1; /* 1=id read from disk 0 = synthetic */ | ||
409 | unsigned noprobe : 1; /* from: hdx=noprobe */ | ||
410 | unsigned removable : 1; /* 1 if need to do check_media_change */ | ||
411 | unsigned attach : 1; /* needed for removable devices */ | ||
412 | unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ | ||
413 | unsigned no_unmask : 1; /* disallow setting unmask bit */ | ||
414 | unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ | ||
415 | unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */ | ||
416 | unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ | ||
417 | unsigned nodma : 1; /* disallow DMA */ | ||
418 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | ||
419 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | ||
420 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | ||
421 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | ||
422 | unsigned post_reset : 1; | ||
423 | unsigned udma33_warned : 1; | ||
424 | |||
425 | u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ | ||
426 | u8 quirk_list; /* considered quirky, set for a specific host */ | 614 | u8 quirk_list; /* considered quirky, set for a specific host */ |
427 | u8 init_speed; /* transfer rate set at boot */ | 615 | u8 init_speed; /* transfer rate set at boot */ |
428 | u8 current_speed; /* current transfer rate set */ | 616 | u8 current_speed; /* current transfer rate set */ |
429 | u8 desired_speed; /* desired transfer rate set */ | 617 | u8 desired_speed; /* desired transfer rate set */ |
430 | u8 dn; /* now wide spread use */ | 618 | u8 dn; /* now wide spread use */ |
431 | u8 wcache; /* status of write cache */ | ||
432 | u8 acoustic; /* acoustic management */ | 619 | u8 acoustic; /* acoustic management */ |
433 | u8 media; /* disk, cdrom, tape, floppy, ... */ | 620 | u8 media; /* disk, cdrom, tape, floppy, ... */ |
434 | u8 ready_stat; /* min status value for drive ready */ | 621 | u8 ready_stat; /* min status value for drive ready */ |
435 | u8 mult_count; /* current multiple sector setting */ | 622 | u8 mult_count; /* current multiple sector setting */ |
436 | u8 mult_req; /* requested multiple sector setting */ | 623 | u8 mult_req; /* requested multiple sector setting */ |
437 | u8 tune_req; /* requested drive tuning setting */ | ||
438 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ | 624 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ |
439 | u8 bad_wstat; /* used for ignoring WRERR_STAT */ | 625 | u8 bad_wstat; /* used for ignoring ATA_DF */ |
440 | u8 nowerr; /* used for ignoring WRERR_STAT */ | ||
441 | u8 sect0; /* offset of first sector for DM6:DDO */ | ||
442 | u8 head; /* "real" number of heads */ | 626 | u8 head; /* "real" number of heads */ |
443 | u8 sect; /* "real" sectors per track */ | 627 | u8 sect; /* "real" sectors per track */ |
444 | u8 bios_head; /* BIOS/fdisk/LILO number of heads */ | 628 | u8 bios_head; /* BIOS/fdisk/LILO number of heads */ |
445 | u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */ | 629 | u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */ |
446 | 630 | ||
631 | /* delay this long before sending packet command */ | ||
632 | u8 pc_delay; | ||
633 | |||
447 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 634 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
448 | unsigned int cyl; /* "real" number of cyls */ | 635 | unsigned int cyl; /* "real" number of cyls */ |
449 | unsigned int drive_data; /* used by set_pio_mode/selectproc */ | 636 | unsigned int drive_data; /* used by set_pio_mode/selectproc */ |
@@ -455,6 +642,9 @@ struct ide_drive_s { | |||
455 | 642 | ||
456 | int lun; /* logical unit */ | 643 | int lun; /* logical unit */ |
457 | int crc_count; /* crc counter to reduce drive speed */ | 644 | int crc_count; /* crc counter to reduce drive speed */ |
645 | |||
646 | unsigned long debug_mask; /* debugging levels switch */ | ||
647 | |||
458 | #ifdef CONFIG_BLK_DEV_IDEACPI | 648 | #ifdef CONFIG_BLK_DEV_IDEACPI |
459 | struct ide_acpi_drive_link *acpidata; | 649 | struct ide_acpi_drive_link *acpidata; |
460 | #endif | 650 | #endif |
@@ -462,21 +652,32 @@ struct ide_drive_s { | |||
462 | struct device gendev; | 652 | struct device gendev; |
463 | struct completion gendev_rel_comp; /* to deal with device release() */ | 653 | struct completion gendev_rel_comp; /* to deal with device release() */ |
464 | 654 | ||
655 | /* current packet command */ | ||
656 | struct ide_atapi_pc *pc; | ||
657 | |||
465 | /* callback for packet commands */ | 658 | /* callback for packet commands */ |
466 | void (*pc_callback)(struct ide_drive_s *); | 659 | void (*pc_callback)(struct ide_drive_s *, int); |
660 | |||
661 | void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *); | ||
662 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, | ||
663 | unsigned int, int); | ||
467 | 664 | ||
468 | unsigned long atapi_flags; | 665 | unsigned long atapi_flags; |
666 | |||
667 | struct ide_atapi_pc request_sense_pc; | ||
668 | struct request request_sense_rq; | ||
469 | }; | 669 | }; |
470 | 670 | ||
471 | typedef struct ide_drive_s ide_drive_t; | 671 | typedef struct ide_drive_s ide_drive_t; |
472 | 672 | ||
473 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | 673 | #define to_ide_device(dev) container_of(dev, ide_drive_t, gendev) |
674 | |||
675 | #define to_ide_drv(obj, cont_type) \ | ||
676 | container_of(obj, struct cont_type, kref) | ||
474 | 677 | ||
475 | #define IDE_CHIPSET_PCI_MASK \ | 678 | #define ide_drv_g(disk, cont_type) \ |
476 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 679 | container_of((disk)->private_data, struct cont_type, driver) |
477 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | ||
478 | 680 | ||
479 | struct ide_task_s; | ||
480 | struct ide_port_info; | 681 | struct ide_port_info; |
481 | 682 | ||
482 | struct ide_tp_ops { | 683 | struct ide_tp_ops { |
@@ -510,6 +711,7 @@ extern const struct ide_tp_ops default_tp_ops; | |||
510 | * @resetproc: routine to reset controller after a disk reset | 711 | * @resetproc: routine to reset controller after a disk reset |
511 | * @maskproc: special host masking for drive selection | 712 | * @maskproc: special host masking for drive selection |
512 | * @quirkproc: check host's drive quirk list | 713 | * @quirkproc: check host's drive quirk list |
714 | * @clear_irq: clear IRQ | ||
513 | * | 715 | * |
514 | * @mdma_filter: filter MDMA modes | 716 | * @mdma_filter: filter MDMA modes |
515 | * @udma_filter: filter UDMA modes | 717 | * @udma_filter: filter UDMA modes |
@@ -526,6 +728,7 @@ struct ide_port_ops { | |||
526 | void (*resetproc)(ide_drive_t *); | 728 | void (*resetproc)(ide_drive_t *); |
527 | void (*maskproc)(ide_drive_t *, int); | 729 | void (*maskproc)(ide_drive_t *, int); |
528 | void (*quirkproc)(ide_drive_t *); | 730 | void (*quirkproc)(ide_drive_t *); |
731 | void (*clear_irq)(ide_drive_t *); | ||
529 | 732 | ||
530 | u8 (*mdma_filter)(ide_drive_t *); | 733 | u8 (*mdma_filter)(ide_drive_t *); |
531 | u8 (*udma_filter)(ide_drive_t *); | 734 | u8 (*udma_filter)(ide_drive_t *); |
@@ -565,7 +768,6 @@ typedef struct hwif_s { | |||
565 | u8 major; /* our major number */ | 768 | u8 major; /* our major number */ |
566 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 769 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
567 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ | 770 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ |
568 | u8 bus_state; /* power state of the IDE bus */ | ||
569 | 771 | ||
570 | u32 host_flags; | 772 | u32 host_flags; |
571 | 773 | ||
@@ -589,12 +791,16 @@ typedef struct hwif_s { | |||
589 | const struct ide_port_ops *port_ops; | 791 | const struct ide_port_ops *port_ops; |
590 | const struct ide_dma_ops *dma_ops; | 792 | const struct ide_dma_ops *dma_ops; |
591 | 793 | ||
592 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | ||
593 | |||
594 | /* dma physical region descriptor table (cpu view) */ | 794 | /* dma physical region descriptor table (cpu view) */ |
595 | unsigned int *dmatable_cpu; | 795 | unsigned int *dmatable_cpu; |
596 | /* dma physical region descriptor table (dma view) */ | 796 | /* dma physical region descriptor table (dma view) */ |
597 | dma_addr_t dmatable_dma; | 797 | dma_addr_t dmatable_dma; |
798 | |||
799 | /* maximum number of PRD table entries */ | ||
800 | int prd_max_nents; | ||
801 | /* PRD entry size in bytes */ | ||
802 | int prd_ent_size; | ||
803 | |||
598 | /* Scatter-gather list used to build the above */ | 804 | /* Scatter-gather list used to build the above */ |
599 | struct scatterlist *sg_table; | 805 | struct scatterlist *sg_table; |
600 | int sg_max_nents; /* Maximum number of entries in it */ | 806 | int sg_max_nents; /* Maximum number of entries in it */ |
@@ -604,6 +810,8 @@ typedef struct hwif_s { | |||
604 | /* data phase of the active command (currently only valid for PIO/DMA) */ | 810 | /* data phase of the active command (currently only valid for PIO/DMA) */ |
605 | int data_phase; | 811 | int data_phase; |
606 | 812 | ||
813 | struct ide_task_s task; /* current command */ | ||
814 | |||
607 | unsigned int nsect; | 815 | unsigned int nsect; |
608 | unsigned int nleft; | 816 | unsigned int nleft; |
609 | struct scatterlist *cursg; | 817 | struct scatterlist *cursg; |
@@ -632,17 +840,18 @@ typedef struct hwif_s { | |||
632 | 840 | ||
633 | void *hwif_data; /* extra hwif data */ | 841 | void *hwif_data; /* extra hwif data */ |
634 | 842 | ||
635 | unsigned dma; | ||
636 | |||
637 | #ifdef CONFIG_BLK_DEV_IDEACPI | 843 | #ifdef CONFIG_BLK_DEV_IDEACPI |
638 | struct ide_acpi_hwif_link *acpidata; | 844 | struct ide_acpi_hwif_link *acpidata; |
639 | #endif | 845 | #endif |
640 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 846 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
641 | 847 | ||
848 | #define MAX_HOST_PORTS 4 | ||
849 | |||
642 | struct ide_host { | 850 | struct ide_host { |
643 | ide_hwif_t *ports[MAX_HWIFS]; | 851 | ide_hwif_t *ports[MAX_HOST_PORTS]; |
644 | unsigned int n_ports; | 852 | unsigned int n_ports; |
645 | struct device *dev[2]; | 853 | struct device *dev[2]; |
854 | unsigned int (*init_chipset)(struct pci_dev *); | ||
646 | unsigned long host_flags; | 855 | unsigned long host_flags; |
647 | void *host_priv; | 856 | void *host_priv; |
648 | }; | 857 | }; |
@@ -690,102 +899,116 @@ typedef struct ide_driver_s ide_driver_t; | |||
690 | 899 | ||
691 | extern struct mutex ide_setting_mtx; | 900 | extern struct mutex ide_setting_mtx; |
692 | 901 | ||
693 | int set_io_32bit(ide_drive_t *, int); | 902 | /* |
694 | int set_pio_mode(ide_drive_t *, int); | 903 | * configurable drive settings |
695 | int set_using_dma(ide_drive_t *, int); | 904 | */ |
696 | 905 | ||
697 | /* ATAPI packet command flags */ | 906 | #define DS_SYNC (1 << 0) |
698 | enum { | 907 | |
699 | /* set when an error is considered normal - no retry (ide-tape) */ | 908 | struct ide_devset { |
700 | PC_FLAG_ABORT = (1 << 0), | 909 | int (*get)(ide_drive_t *); |
701 | PC_FLAG_SUPPRESS_ERROR = (1 << 1), | 910 | int (*set)(ide_drive_t *, int); |
702 | PC_FLAG_WAIT_FOR_DSC = (1 << 2), | 911 | unsigned int flags; |
703 | PC_FLAG_DMA_OK = (1 << 3), | ||
704 | PC_FLAG_DMA_IN_PROGRESS = (1 << 4), | ||
705 | PC_FLAG_DMA_ERROR = (1 << 5), | ||
706 | PC_FLAG_WRITING = (1 << 6), | ||
707 | /* command timed out */ | ||
708 | PC_FLAG_TIMEDOUT = (1 << 7), | ||
709 | }; | 912 | }; |
710 | 913 | ||
711 | struct ide_atapi_pc { | 914 | #define __DEVSET(_flags, _get, _set) { \ |
712 | /* actual packet bytes */ | 915 | .flags = _flags, \ |
713 | u8 c[12]; | 916 | .get = _get, \ |
714 | /* incremented on each retry */ | 917 | .set = _set, \ |
715 | int retries; | 918 | } |
716 | int error; | ||
717 | 919 | ||
718 | /* bytes to transfer */ | 920 | #define ide_devset_get(name, field) \ |
719 | int req_xfer; | 921 | static int get_##name(ide_drive_t *drive) \ |
720 | /* bytes actually transferred */ | 922 | { \ |
721 | int xferred; | 923 | return drive->field; \ |
924 | } | ||
722 | 925 | ||
723 | /* data buffer */ | 926 | #define ide_devset_set(name, field) \ |
724 | u8 *buf; | 927 | static int set_##name(ide_drive_t *drive, int arg) \ |
725 | /* current buffer position */ | 928 | { \ |
726 | u8 *cur_pos; | 929 | drive->field = arg; \ |
727 | int buf_size; | 930 | return 0; \ |
728 | /* missing/available data on the current buffer */ | 931 | } |
729 | int b_count; | ||
730 | 932 | ||
731 | /* the corresponding request */ | 933 | #define ide_devset_get_flag(name, flag) \ |
732 | struct request *rq; | 934 | static int get_##name(ide_drive_t *drive) \ |
935 | { \ | ||
936 | return !!(drive->dev_flags & flag); \ | ||
937 | } | ||
733 | 938 | ||
734 | unsigned long flags; | 939 | #define ide_devset_set_flag(name, flag) \ |
940 | static int set_##name(ide_drive_t *drive, int arg) \ | ||
941 | { \ | ||
942 | if (arg) \ | ||
943 | drive->dev_flags |= flag; \ | ||
944 | else \ | ||
945 | drive->dev_flags &= ~flag; \ | ||
946 | return 0; \ | ||
947 | } | ||
735 | 948 | ||
736 | /* | 949 | #define __IDE_DEVSET(_name, _flags, _get, _set) \ |
737 | * those are more or less driver-specific and some of them are subject | 950 | const struct ide_devset ide_devset_##_name = \ |
738 | * to change/removal later. | 951 | __DEVSET(_flags, _get, _set) |
739 | */ | ||
740 | u8 pc_buf[256]; | ||
741 | 952 | ||
742 | /* idetape only */ | 953 | #define IDE_DEVSET(_name, _flags, _get, _set) \ |
743 | struct idetape_bh *bh; | 954 | static __IDE_DEVSET(_name, _flags, _get, _set) |
744 | char *b_data; | ||
745 | 955 | ||
746 | /* idescsi only for now */ | 956 | #define ide_devset_rw(_name, _func) \ |
747 | struct scatterlist *sg; | 957 | IDE_DEVSET(_name, 0, get_##_func, set_##_func) |
748 | unsigned int sg_cnt; | ||
749 | 958 | ||
750 | struct scsi_cmnd *scsi_cmd; | 959 | #define ide_devset_w(_name, _func) \ |
751 | void (*done) (struct scsi_cmnd *); | 960 | IDE_DEVSET(_name, 0, NULL, set_##_func) |
752 | 961 | ||
753 | unsigned long timeout; | 962 | #define ide_ext_devset_rw(_name, _func) \ |
754 | }; | 963 | __IDE_DEVSET(_name, 0, get_##_func, set_##_func) |
964 | |||
965 | #define ide_ext_devset_rw_sync(_name, _func) \ | ||
966 | __IDE_DEVSET(_name, DS_SYNC, get_##_func, set_##_func) | ||
967 | |||
968 | #define ide_decl_devset(_name) \ | ||
969 | extern const struct ide_devset ide_devset_##_name | ||
970 | |||
971 | ide_decl_devset(io_32bit); | ||
972 | ide_decl_devset(keepsettings); | ||
973 | ide_decl_devset(pio_mode); | ||
974 | ide_decl_devset(unmaskirq); | ||
975 | ide_decl_devset(using_dma); | ||
755 | 976 | ||
756 | #ifdef CONFIG_IDE_PROC_FS | 977 | #ifdef CONFIG_IDE_PROC_FS |
757 | /* | 978 | /* |
758 | * configurable drive settings | 979 | * /proc/ide interface |
759 | */ | 980 | */ |
760 | 981 | ||
761 | #define TYPE_INT 0 | 982 | #define ide_devset_rw_field(_name, _field) \ |
762 | #define TYPE_BYTE 1 | 983 | ide_devset_get(_name, _field); \ |
763 | #define TYPE_SHORT 2 | 984 | ide_devset_set(_name, _field); \ |
985 | IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name) | ||
986 | |||
987 | #define ide_devset_rw_flag(_name, _field) \ | ||
988 | ide_devset_get_flag(_name, _field); \ | ||
989 | ide_devset_set_flag(_name, _field); \ | ||
990 | IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name) | ||
991 | |||
992 | struct ide_proc_devset { | ||
993 | const char *name; | ||
994 | const struct ide_devset *setting; | ||
995 | int min, max; | ||
996 | int (*mulf)(ide_drive_t *); | ||
997 | int (*divf)(ide_drive_t *); | ||
998 | }; | ||
764 | 999 | ||
765 | #define SETTING_READ (1 << 0) | 1000 | #define __IDE_PROC_DEVSET(_name, _min, _max, _mulf, _divf) { \ |
766 | #define SETTING_WRITE (1 << 1) | 1001 | .name = __stringify(_name), \ |
767 | #define SETTING_RW (SETTING_READ | SETTING_WRITE) | 1002 | .setting = &ide_devset_##_name, \ |
1003 | .min = _min, \ | ||
1004 | .max = _max, \ | ||
1005 | .mulf = _mulf, \ | ||
1006 | .divf = _divf, \ | ||
1007 | } | ||
768 | 1008 | ||
769 | typedef int (ide_procset_t)(ide_drive_t *, int); | 1009 | #define IDE_PROC_DEVSET(_name, _min, _max) \ |
770 | typedef struct ide_settings_s { | 1010 | __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL) |
771 | char *name; | ||
772 | int rw; | ||
773 | int data_type; | ||
774 | int min; | ||
775 | int max; | ||
776 | int mul_factor; | ||
777 | int div_factor; | ||
778 | void *data; | ||
779 | ide_procset_t *set; | ||
780 | int auto_remove; | ||
781 | struct ide_settings_s *next; | ||
782 | } ide_settings_t; | ||
783 | |||
784 | int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set); | ||
785 | 1011 | ||
786 | /* | ||
787 | * /proc/ide interface | ||
788 | */ | ||
789 | typedef struct { | 1012 | typedef struct { |
790 | const char *name; | 1013 | const char *name; |
791 | mode_t mode; | 1014 | mode_t mode; |
@@ -802,8 +1025,6 @@ void ide_proc_unregister_port(ide_hwif_t *); | |||
802 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | 1025 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); |
803 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | 1026 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); |
804 | 1027 | ||
805 | void ide_add_generic_settings(ide_drive_t *); | ||
806 | |||
807 | read_proc_t proc_ide_read_capacity; | 1028 | read_proc_t proc_ide_read_capacity; |
808 | read_proc_t proc_ide_read_geometry; | 1029 | read_proc_t proc_ide_read_geometry; |
809 | 1030 | ||
@@ -831,41 +1052,58 @@ static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } | |||
831 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | 1052 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } |
832 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1053 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
833 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1054 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
834 | static inline void ide_add_generic_settings(ide_drive_t *drive) { ; } | ||
835 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | 1055 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
836 | #endif | 1056 | #endif |
837 | 1057 | ||
1058 | enum { | ||
1059 | /* enter/exit functions */ | ||
1060 | IDE_DBG_FUNC = (1 << 0), | ||
1061 | /* sense key/asc handling */ | ||
1062 | IDE_DBG_SENSE = (1 << 1), | ||
1063 | /* packet commands handling */ | ||
1064 | IDE_DBG_PC = (1 << 2), | ||
1065 | /* request handling */ | ||
1066 | IDE_DBG_RQ = (1 << 3), | ||
1067 | /* driver probing/setup */ | ||
1068 | IDE_DBG_PROBE = (1 << 4), | ||
1069 | }; | ||
1070 | |||
1071 | /* DRV_NAME has to be defined in the driver before using the macro below */ | ||
1072 | #define __ide_debug_log(lvl, fmt, args...) \ | ||
1073 | { \ | ||
1074 | if (unlikely(drive->debug_mask & lvl)) \ | ||
1075 | printk(KERN_INFO DRV_NAME ": " fmt, ## args); \ | ||
1076 | } | ||
1077 | |||
838 | /* | 1078 | /* |
839 | * Power Management step value (rq->pm->pm_step). | 1079 | * Power Management state machine (rq->pm->pm_step). |
840 | * | 1080 | * |
841 | * The step value starts at 0 (ide_pm_state_start_suspend) for a | 1081 | * For each step, the core calls ide_start_power_step() first. |
842 | * suspend operation or 1000 (ide_pm_state_start_resume) for a | ||
843 | * resume operation. | ||
844 | * | ||
845 | * For each step, the core calls the subdriver start_power_step() first. | ||
846 | * This can return: | 1082 | * This can return: |
847 | * - ide_stopped : In this case, the core calls us back again unless | 1083 | * - ide_stopped : In this case, the core calls us back again unless |
848 | * step have been set to ide_power_state_completed. | 1084 | * step have been set to ide_power_state_completed. |
849 | * - ide_started : In this case, the channel is left busy until an | 1085 | * - ide_started : In this case, the channel is left busy until an |
850 | * async event (interrupt) occurs. | 1086 | * async event (interrupt) occurs. |
851 | * Typically, start_power_step() will issue a taskfile request with | 1087 | * Typically, ide_start_power_step() will issue a taskfile request with |
852 | * do_rw_taskfile(). | 1088 | * do_rw_taskfile(). |
853 | * | 1089 | * |
854 | * Upon reception of the interrupt, the core will call complete_power_step() | 1090 | * Upon reception of the interrupt, the core will call ide_complete_power_step() |
855 | * with the error code if any. This routine should update the step value | 1091 | * with the error code if any. This routine should update the step value |
856 | * and return. It should not start a new request. The core will call | 1092 | * and return. It should not start a new request. The core will call |
857 | * start_power_step for the new step value, unless step have been set to | 1093 | * ide_start_power_step() for the new step value, unless step have been |
858 | * ide_power_state_completed. | 1094 | * set to IDE_PM_COMPLETED. |
859 | * | ||
860 | * Subdrivers are expected to define their own additional power | ||
861 | * steps from 1..999 for suspend and from 1001..1999 for resume, | ||
862 | * other values are reserved for future use. | ||
863 | */ | 1095 | */ |
864 | |||
865 | enum { | 1096 | enum { |
866 | ide_pm_state_completed = -1, | 1097 | IDE_PM_START_SUSPEND, |
867 | ide_pm_state_start_suspend = 0, | 1098 | IDE_PM_FLUSH_CACHE = IDE_PM_START_SUSPEND, |
868 | ide_pm_state_start_resume = 1000, | 1099 | IDE_PM_STANDBY, |
1100 | |||
1101 | IDE_PM_START_RESUME, | ||
1102 | IDE_PM_RESTORE_PIO = IDE_PM_START_RESUME, | ||
1103 | IDE_PM_IDLE, | ||
1104 | IDE_PM_RESTORE_DMA, | ||
1105 | |||
1106 | IDE_PM_COMPLETED, | ||
869 | }; | 1107 | }; |
870 | 1108 | ||
871 | /* | 1109 | /* |
@@ -876,8 +1114,6 @@ enum { | |||
876 | */ | 1114 | */ |
877 | struct ide_driver_s { | 1115 | struct ide_driver_s { |
878 | const char *version; | 1116 | const char *version; |
879 | u8 media; | ||
880 | unsigned supports_dsc_overlap : 1; | ||
881 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 1117 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
882 | int (*end_request)(ide_drive_t *, int, int); | 1118 | int (*end_request)(ide_drive_t *, int, int); |
883 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | 1119 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); |
@@ -887,7 +1123,8 @@ struct ide_driver_s { | |||
887 | void (*resume)(ide_drive_t *); | 1123 | void (*resume)(ide_drive_t *); |
888 | void (*shutdown)(ide_drive_t *); | 1124 | void (*shutdown)(ide_drive_t *); |
889 | #ifdef CONFIG_IDE_PROC_FS | 1125 | #ifdef CONFIG_IDE_PROC_FS |
890 | ide_proc_entry_t *proc; | 1126 | ide_proc_entry_t *proc; |
1127 | const struct ide_proc_devset *settings; | ||
891 | #endif | 1128 | #endif |
892 | }; | 1129 | }; |
893 | 1130 | ||
@@ -896,7 +1133,17 @@ struct ide_driver_s { | |||
896 | int ide_device_get(ide_drive_t *); | 1133 | int ide_device_get(ide_drive_t *); |
897 | void ide_device_put(ide_drive_t *); | 1134 | void ide_device_put(ide_drive_t *); |
898 | 1135 | ||
899 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 1136 | struct ide_ioctl_devset { |
1137 | unsigned int get_ioctl; | ||
1138 | unsigned int set_ioctl; | ||
1139 | const struct ide_devset *setting; | ||
1140 | }; | ||
1141 | |||
1142 | int ide_setting_ioctl(ide_drive_t *, struct block_device *, unsigned int, | ||
1143 | unsigned long, const struct ide_ioctl_devset *); | ||
1144 | |||
1145 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, | ||
1146 | unsigned, unsigned long); | ||
900 | 1147 | ||
901 | extern int ide_vlb_clk; | 1148 | extern int ide_vlb_clk; |
902 | extern int ide_pci_clk; | 1149 | extern int ide_pci_clk; |
@@ -918,122 +1165,23 @@ ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | |||
918 | 1165 | ||
919 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); | 1166 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); |
920 | 1167 | ||
921 | extern void ide_fix_driveid(struct hd_driveid *); | 1168 | void ide_fix_driveid(u16 *); |
922 | 1169 | ||
923 | extern void ide_fixstring(u8 *, const int, const int); | 1170 | extern void ide_fixstring(u8 *, const int, const int); |
924 | 1171 | ||
1172 | int ide_busy_sleep(ide_hwif_t *, unsigned long, int); | ||
1173 | |||
925 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); | 1174 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); |
926 | 1175 | ||
927 | extern ide_startstop_t ide_do_reset (ide_drive_t *); | 1176 | extern ide_startstop_t ide_do_reset (ide_drive_t *); |
928 | 1177 | ||
1178 | extern int ide_devset_execute(ide_drive_t *drive, | ||
1179 | const struct ide_devset *setting, int arg); | ||
1180 | |||
929 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); | 1181 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); |
930 | 1182 | ||
931 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 1183 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
932 | 1184 | ||
933 | enum { | ||
934 | IDE_TFLAG_LBA48 = (1 << 0), | ||
935 | IDE_TFLAG_FLAGGED = (1 << 2), | ||
936 | IDE_TFLAG_OUT_DATA = (1 << 3), | ||
937 | IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4), | ||
938 | IDE_TFLAG_OUT_HOB_NSECT = (1 << 5), | ||
939 | IDE_TFLAG_OUT_HOB_LBAL = (1 << 6), | ||
940 | IDE_TFLAG_OUT_HOB_LBAM = (1 << 7), | ||
941 | IDE_TFLAG_OUT_HOB_LBAH = (1 << 8), | ||
942 | IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE | | ||
943 | IDE_TFLAG_OUT_HOB_NSECT | | ||
944 | IDE_TFLAG_OUT_HOB_LBAL | | ||
945 | IDE_TFLAG_OUT_HOB_LBAM | | ||
946 | IDE_TFLAG_OUT_HOB_LBAH, | ||
947 | IDE_TFLAG_OUT_FEATURE = (1 << 9), | ||
948 | IDE_TFLAG_OUT_NSECT = (1 << 10), | ||
949 | IDE_TFLAG_OUT_LBAL = (1 << 11), | ||
950 | IDE_TFLAG_OUT_LBAM = (1 << 12), | ||
951 | IDE_TFLAG_OUT_LBAH = (1 << 13), | ||
952 | IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE | | ||
953 | IDE_TFLAG_OUT_NSECT | | ||
954 | IDE_TFLAG_OUT_LBAL | | ||
955 | IDE_TFLAG_OUT_LBAM | | ||
956 | IDE_TFLAG_OUT_LBAH, | ||
957 | IDE_TFLAG_OUT_DEVICE = (1 << 14), | ||
958 | IDE_TFLAG_WRITE = (1 << 15), | ||
959 | IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16), | ||
960 | IDE_TFLAG_IN_DATA = (1 << 17), | ||
961 | IDE_TFLAG_CUSTOM_HANDLER = (1 << 18), | ||
962 | IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19), | ||
963 | IDE_TFLAG_IN_HOB_FEATURE = (1 << 20), | ||
964 | IDE_TFLAG_IN_HOB_NSECT = (1 << 21), | ||
965 | IDE_TFLAG_IN_HOB_LBAL = (1 << 22), | ||
966 | IDE_TFLAG_IN_HOB_LBAM = (1 << 23), | ||
967 | IDE_TFLAG_IN_HOB_LBAH = (1 << 24), | ||
968 | IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL | | ||
969 | IDE_TFLAG_IN_HOB_LBAM | | ||
970 | IDE_TFLAG_IN_HOB_LBAH, | ||
971 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | ||
972 | IDE_TFLAG_IN_HOB_NSECT | | ||
973 | IDE_TFLAG_IN_HOB_LBA, | ||
974 | IDE_TFLAG_IN_FEATURE = (1 << 1), | ||
975 | IDE_TFLAG_IN_NSECT = (1 << 25), | ||
976 | IDE_TFLAG_IN_LBAL = (1 << 26), | ||
977 | IDE_TFLAG_IN_LBAM = (1 << 27), | ||
978 | IDE_TFLAG_IN_LBAH = (1 << 28), | ||
979 | IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL | | ||
980 | IDE_TFLAG_IN_LBAM | | ||
981 | IDE_TFLAG_IN_LBAH, | ||
982 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | | ||
983 | IDE_TFLAG_IN_LBA, | ||
984 | IDE_TFLAG_IN_DEVICE = (1 << 29), | ||
985 | IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB | | ||
986 | IDE_TFLAG_IN_HOB, | ||
987 | IDE_TFLAG_TF = IDE_TFLAG_OUT_TF | | ||
988 | IDE_TFLAG_IN_TF, | ||
989 | IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE | | ||
990 | IDE_TFLAG_IN_DEVICE, | ||
991 | /* force 16-bit I/O operations */ | ||
992 | IDE_TFLAG_IO_16BIT = (1 << 30), | ||
993 | /* ide_task_t was allocated using kmalloc() */ | ||
994 | IDE_TFLAG_DYN = (1 << 31), | ||
995 | }; | ||
996 | |||
997 | struct ide_taskfile { | ||
998 | u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ | ||
999 | |||
1000 | u8 hob_feature; /* 1-5: additional data to support LBA48 */ | ||
1001 | u8 hob_nsect; | ||
1002 | u8 hob_lbal; | ||
1003 | u8 hob_lbam; | ||
1004 | u8 hob_lbah; | ||
1005 | |||
1006 | u8 data; /* 6: low data byte (for TASKFILE IOCTL) */ | ||
1007 | |||
1008 | union { /* Â 7: */ | ||
1009 | u8 error; /* read: error */ | ||
1010 | u8 feature; /* write: feature */ | ||
1011 | }; | ||
1012 | |||
1013 | u8 nsect; /* 8: number of sectors */ | ||
1014 | u8 lbal; /* 9: LBA low */ | ||
1015 | u8 lbam; /* 10: LBA mid */ | ||
1016 | u8 lbah; /* 11: LBA high */ | ||
1017 | |||
1018 | u8 device; /* 12: device select */ | ||
1019 | |||
1020 | union { /* 13: */ | ||
1021 | u8 status; /*  read: status  */ | ||
1022 | u8 command; /* write: command */ | ||
1023 | }; | ||
1024 | }; | ||
1025 | |||
1026 | typedef struct ide_task_s { | ||
1027 | union { | ||
1028 | struct ide_taskfile tf; | ||
1029 | u8 tf_array[14]; | ||
1030 | }; | ||
1031 | u32 tf_flags; | ||
1032 | int data_phase; | ||
1033 | struct request *rq; /* copy of request */ | ||
1034 | void *special; /* valid_t generally */ | ||
1035 | } ide_task_t; | ||
1036 | |||
1037 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1185 | void ide_tf_dump(const char *, struct ide_taskfile *); |
1038 | 1186 | ||
1039 | void ide_exec_command(ide_hwif_t *, u8); | 1187 | void ide_exec_command(ide_hwif_t *, u8); |
@@ -1049,6 +1197,8 @@ void ide_tf_read(ide_drive_t *, ide_task_t *); | |||
1049 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); | 1197 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); |
1050 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); | 1198 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); |
1051 | 1199 | ||
1200 | int ide_io_buffers(ide_drive_t *, struct ide_atapi_pc *, unsigned int, int); | ||
1201 | |||
1052 | extern void SELECT_DRIVE(ide_drive_t *); | 1202 | extern void SELECT_DRIVE(ide_drive_t *); |
1053 | void SELECT_MASK(ide_drive_t *, int); | 1203 | void SELECT_MASK(ide_drive_t *, int); |
1054 | 1204 | ||
@@ -1059,16 +1209,46 @@ extern int drive_is_ready(ide_drive_t *); | |||
1059 | 1209 | ||
1060 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | 1210 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
1061 | 1211 | ||
1062 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | 1212 | int ide_check_atapi_device(ide_drive_t *, const char *); |
1063 | ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, | 1213 | |
1064 | void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), | 1214 | void ide_init_pc(struct ide_atapi_pc *); |
1065 | void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *), | 1215 | |
1066 | void (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int, | 1216 | /* Disk head parking */ |
1067 | int)); | 1217 | extern wait_queue_head_t ide_park_wq; |
1068 | ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *, | 1218 | ssize_t ide_park_show(struct device *dev, struct device_attribute *attr, |
1069 | ide_handler_t *, unsigned int, ide_expiry_t *); | 1219 | char *buf); |
1070 | ide_startstop_t ide_issue_pc(ide_drive_t *, struct ide_atapi_pc *, | 1220 | ssize_t ide_park_store(struct device *dev, struct device_attribute *attr, |
1071 | ide_handler_t *, unsigned int, ide_expiry_t *); | 1221 | const char *buf, size_t len); |
1222 | |||
1223 | /* | ||
1224 | * Special requests for ide-tape block device strategy routine. | ||
1225 | * | ||
1226 | * In order to service a character device command, we add special requests to | ||
1227 | * the tail of our block device request queue and wait for their completion. | ||
1228 | */ | ||
1229 | enum { | ||
1230 | REQ_IDETAPE_PC1 = (1 << 0), /* packet command (first stage) */ | ||
1231 | REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */ | ||
1232 | REQ_IDETAPE_READ = (1 << 2), | ||
1233 | REQ_IDETAPE_WRITE = (1 << 3), | ||
1234 | }; | ||
1235 | |||
1236 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *); | ||
1237 | |||
1238 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); | ||
1239 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); | ||
1240 | int ide_set_media_lock(ide_drive_t *, struct gendisk *, int); | ||
1241 | void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); | ||
1242 | void ide_retry_pc(ide_drive_t *, struct gendisk *); | ||
1243 | |||
1244 | static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc) | ||
1245 | { | ||
1246 | return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies); | ||
1247 | } | ||
1248 | |||
1249 | int ide_scsi_expiry(ide_drive_t *); | ||
1250 | |||
1251 | ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *); | ||
1072 | 1252 | ||
1073 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); | 1253 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); |
1074 | 1254 | ||
@@ -1078,8 +1258,6 @@ int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); | |||
1078 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | 1258 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); |
1079 | 1259 | ||
1080 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); | 1260 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); |
1081 | int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long); | ||
1082 | int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long); | ||
1083 | 1261 | ||
1084 | extern int ide_driveid_update(ide_drive_t *); | 1262 | extern int ide_driveid_update(ide_drive_t *); |
1085 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 1263 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
@@ -1090,7 +1268,6 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); | |||
1090 | 1268 | ||
1091 | extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | 1269 | extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); |
1092 | 1270 | ||
1093 | extern int ide_spin_wait_hwgroup(ide_drive_t *); | ||
1094 | extern void ide_timer_expiry(unsigned long); | 1271 | extern void ide_timer_expiry(unsigned long); |
1095 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1272 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
1096 | extern void do_ide_request(struct request_queue *); | 1273 | extern void do_ide_request(struct request_queue *); |
@@ -1227,6 +1404,14 @@ int ide_pci_init_two(struct pci_dev *, struct pci_dev *, | |||
1227 | const struct ide_port_info *, void *); | 1404 | const struct ide_port_info *, void *); |
1228 | void ide_pci_remove(struct pci_dev *); | 1405 | void ide_pci_remove(struct pci_dev *); |
1229 | 1406 | ||
1407 | #ifdef CONFIG_PM | ||
1408 | int ide_pci_suspend(struct pci_dev *, pm_message_t); | ||
1409 | int ide_pci_resume(struct pci_dev *); | ||
1410 | #else | ||
1411 | #define ide_pci_suspend NULL | ||
1412 | #define ide_pci_resume NULL | ||
1413 | #endif | ||
1414 | |||
1230 | void ide_map_sg(ide_drive_t *, struct request *); | 1415 | void ide_map_sg(ide_drive_t *, struct request *); |
1231 | void ide_init_sg_cmd(ide_drive_t *, struct request *); | 1416 | void ide_init_sg_cmd(ide_drive_t *, struct request *); |
1232 | 1417 | ||
@@ -1238,9 +1423,10 @@ struct drive_list_entry { | |||
1238 | const char *id_firmware; | 1423 | const char *id_firmware; |
1239 | }; | 1424 | }; |
1240 | 1425 | ||
1241 | int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | 1426 | int ide_in_drive_list(u16 *, const struct drive_list_entry *); |
1242 | 1427 | ||
1243 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1428 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1429 | int ide_dma_good_drive(ide_drive_t *); | ||
1244 | int __ide_dma_bad_drive(ide_drive_t *); | 1430 | int __ide_dma_bad_drive(ide_drive_t *); |
1245 | int ide_id_dma_bug(ide_drive_t *); | 1431 | int ide_id_dma_bug(ide_drive_t *); |
1246 | 1432 | ||
@@ -1258,25 +1444,29 @@ int ide_set_dma(ide_drive_t *); | |||
1258 | void ide_check_dma_crc(ide_drive_t *); | 1444 | void ide_check_dma_crc(ide_drive_t *); |
1259 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1445 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1260 | 1446 | ||
1447 | int ide_allocate_dma_engine(ide_hwif_t *); | ||
1448 | void ide_release_dma_engine(ide_hwif_t *); | ||
1449 | |||
1261 | int ide_build_sglist(ide_drive_t *, struct request *); | 1450 | int ide_build_sglist(ide_drive_t *, struct request *); |
1262 | void ide_destroy_dmatable(ide_drive_t *); | 1451 | void ide_destroy_dmatable(ide_drive_t *); |
1263 | 1452 | ||
1264 | #ifdef CONFIG_BLK_DEV_IDEDMA_SFF | 1453 | #ifdef CONFIG_BLK_DEV_IDEDMA_SFF |
1454 | int config_drive_for_dma(ide_drive_t *); | ||
1265 | extern int ide_build_dmatable(ide_drive_t *, struct request *); | 1455 | extern int ide_build_dmatable(ide_drive_t *, struct request *); |
1266 | int ide_allocate_dma_engine(ide_hwif_t *); | ||
1267 | void ide_release_dma_engine(ide_hwif_t *); | ||
1268 | |||
1269 | void ide_dma_host_set(ide_drive_t *, int); | 1456 | void ide_dma_host_set(ide_drive_t *, int); |
1270 | extern int ide_dma_setup(ide_drive_t *); | 1457 | extern int ide_dma_setup(ide_drive_t *); |
1271 | void ide_dma_exec_cmd(ide_drive_t *, u8); | 1458 | void ide_dma_exec_cmd(ide_drive_t *, u8); |
1272 | extern void ide_dma_start(ide_drive_t *); | 1459 | extern void ide_dma_start(ide_drive_t *); |
1273 | extern int __ide_dma_end(ide_drive_t *); | 1460 | int ide_dma_end(ide_drive_t *); |
1274 | int ide_dma_test_irq(ide_drive_t *); | 1461 | int ide_dma_test_irq(ide_drive_t *); |
1275 | extern void ide_dma_lost_irq(ide_drive_t *); | ||
1276 | extern void ide_dma_timeout(ide_drive_t *); | ||
1277 | extern const struct ide_dma_ops sff_dma_ops; | 1462 | extern const struct ide_dma_ops sff_dma_ops; |
1463 | #else | ||
1464 | static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } | ||
1278 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ | 1465 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ |
1279 | 1466 | ||
1467 | void ide_dma_lost_irq(ide_drive_t *); | ||
1468 | void ide_dma_timeout(ide_drive_t *); | ||
1469 | |||
1280 | #else | 1470 | #else |
1281 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | 1471 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } |
1282 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | 1472 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } |
@@ -1287,11 +1477,8 @@ static inline void ide_dma_on(ide_drive_t *drive) { ; } | |||
1287 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1477 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1288 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1478 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } |
1289 | static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } | 1479 | static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } |
1290 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | ||
1291 | |||
1292 | #ifndef CONFIG_BLK_DEV_IDEDMA_SFF | ||
1293 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } | 1480 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } |
1294 | #endif | 1481 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1295 | 1482 | ||
1296 | #ifdef CONFIG_BLK_DEV_IDEACPI | 1483 | #ifdef CONFIG_BLK_DEV_IDEACPI |
1297 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | 1484 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); |
@@ -1319,7 +1506,6 @@ void ide_undecoded_slave(ide_drive_t *); | |||
1319 | 1506 | ||
1320 | void ide_port_apply_params(ide_hwif_t *); | 1507 | void ide_port_apply_params(ide_hwif_t *); |
1321 | 1508 | ||
1322 | struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **); | ||
1323 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); | 1509 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1324 | void ide_host_free(struct ide_host *); | 1510 | void ide_host_free(struct ide_host *); |
1325 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | 1511 | int ide_host_register(struct ide_host *, const struct ide_port_info *, |
@@ -1345,24 +1531,6 @@ const char *ide_xfer_verbose(u8 mode); | |||
1345 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1531 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1346 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1532 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1347 | 1533 | ||
1348 | static inline int ide_dev_has_iordy(struct hd_driveid *id) | ||
1349 | { | ||
1350 | return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0; | ||
1351 | } | ||
1352 | |||
1353 | static inline int ide_dev_is_sata(struct hd_driveid *id) | ||
1354 | { | ||
1355 | /* | ||
1356 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
1357 | * verifying that word 80 by casting it to a signed type -- | ||
1358 | * this trick allows us to filter out the reserved values of | ||
1359 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
1360 | */ | ||
1361 | if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020) | ||
1362 | return 1; | ||
1363 | return 0; | ||
1364 | } | ||
1365 | |||
1366 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1534 | u64 ide_get_lba_addr(struct ide_taskfile *, int); |
1367 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1535 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1368 | 1536 | ||
@@ -1434,13 +1602,6 @@ extern struct mutex ide_cfg_mtx; | |||
1434 | extern struct bus_type ide_bus_type; | 1602 | extern struct bus_type ide_bus_type; |
1435 | extern struct class *ide_port_class; | 1603 | extern struct class *ide_port_class; |
1436 | 1604 | ||
1437 | /* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */ | ||
1438 | #define ide_id_has_flush_cache(id) ((id)->cfs_enable_2 & 0x3000) | ||
1439 | |||
1440 | /* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */ | ||
1441 | #define ide_id_has_flush_cache_ext(id) \ | ||
1442 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) | ||
1443 | |||
1444 | static inline void ide_dump_identify(u8 *id) | 1605 | static inline void ide_dump_identify(u8 *id) |
1445 | { | 1606 | { |
1446 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); | 1607 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); |
@@ -1451,10 +1612,10 @@ static inline int hwif_to_node(ide_hwif_t *hwif) | |||
1451 | return hwif->dev ? dev_to_node(hwif->dev) : -1; | 1612 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1452 | } | 1613 | } |
1453 | 1614 | ||
1454 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1615 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) |
1455 | { | 1616 | { |
1456 | ide_hwif_t *hwif = HWIF(drive); | 1617 | ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1]; |
1457 | 1618 | ||
1458 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1619 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
1459 | } | 1620 | } |
1460 | #endif /* _IDE_H */ | 1621 | #endif /* _IDE_H */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 7f4df7c7659d..14126bc36641 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -471,6 +471,11 @@ struct ieee80211s_hdr { | |||
471 | u8 eaddr3[6]; | 471 | u8 eaddr3[6]; |
472 | } __attribute__ ((packed)); | 472 | } __attribute__ ((packed)); |
473 | 473 | ||
474 | /* Mesh flags */ | ||
475 | #define MESH_FLAGS_AE_A4 0x1 | ||
476 | #define MESH_FLAGS_AE_A5_A6 0x2 | ||
477 | #define MESH_FLAGS_PS_DEEP 0x4 | ||
478 | |||
474 | /** | 479 | /** |
475 | * struct ieee80211_quiet_ie | 480 | * struct ieee80211_quiet_ie |
476 | * | 481 | * |
@@ -643,6 +648,9 @@ struct ieee80211_mgmt { | |||
643 | } u; | 648 | } u; |
644 | } __attribute__ ((packed)); | 649 | } __attribute__ ((packed)); |
645 | 650 | ||
651 | /* mgmt header + 1 byte category code */ | ||
652 | #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) | ||
653 | |||
646 | 654 | ||
647 | /* Control frames */ | 655 | /* Control frames */ |
648 | struct ieee80211_rts { | 656 | struct ieee80211_rts { |
@@ -708,12 +716,13 @@ struct ieee80211_ht_addt_info { | |||
708 | 716 | ||
709 | /* 802.11n HT capabilities masks */ | 717 | /* 802.11n HT capabilities masks */ |
710 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 | 718 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 |
711 | #define IEEE80211_HT_CAP_MIMO_PS 0x000C | 719 | #define IEEE80211_HT_CAP_SM_PS 0x000C |
712 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 720 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 |
713 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 721 | #define IEEE80211_HT_CAP_SGI_20 0x0020 |
714 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 722 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
715 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 723 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
716 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 724 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
725 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | ||
717 | /* 802.11n HT capability AMPDU settings */ | 726 | /* 802.11n HT capability AMPDU settings */ |
718 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | 727 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 |
719 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | 728 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C |
@@ -736,11 +745,26 @@ struct ieee80211_ht_addt_info { | |||
736 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 | 745 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 |
737 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 | 746 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 |
738 | 747 | ||
739 | /* MIMO Power Save Modes */ | 748 | /* block-ack parameters */ |
740 | #define WLAN_HT_CAP_MIMO_PS_STATIC 0 | 749 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
741 | #define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 | 750 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C |
742 | #define WLAN_HT_CAP_MIMO_PS_INVALID 2 | 751 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 |
743 | #define WLAN_HT_CAP_MIMO_PS_DISABLED 3 | 752 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 |
753 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 | ||
754 | |||
755 | /* | ||
756 | * A-PMDU buffer sizes | ||
757 | * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) | ||
758 | */ | ||
759 | #define IEEE80211_MIN_AMPDU_BUF 0x8 | ||
760 | #define IEEE80211_MAX_AMPDU_BUF 0x40 | ||
761 | |||
762 | |||
763 | /* Spatial Multiplexing Power Save Modes */ | ||
764 | #define WLAN_HT_CAP_SM_PS_STATIC 0 | ||
765 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 | ||
766 | #define WLAN_HT_CAP_SM_PS_INVALID 2 | ||
767 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 | ||
744 | 768 | ||
745 | /* Authentication algorithms */ | 769 | /* Authentication algorithms */ |
746 | #define WLAN_AUTH_OPEN 0 | 770 | #define WLAN_AUTH_OPEN 0 |
diff --git a/include/linux/if.h b/include/linux/if.h index 5c9d1fa93fef..65246846c844 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/compiler.h> /* for "__user" et al */ | 24 | #include <linux/compiler.h> /* for "__user" et al */ |
25 | 25 | ||
26 | #define IFNAMSIZ 16 | 26 | #define IFNAMSIZ 16 |
27 | #define IFALIASZ 256 | ||
27 | #include <linux/hdlc/ioctl.h> | 28 | #include <linux/hdlc/ioctl.h> |
28 | 29 | ||
29 | /* Standard interface flags (netdevice->flags). */ | 30 | /* Standard interface flags (netdevice->flags). */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index e157c1399b61..7f3c735f422b 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
11 | * Donald Becker, <becker@super.org> | 11 | * Donald Becker, <becker@super.org> |
12 | * Alan Cox, <alan@redhat.com> | 12 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> |
13 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> | 13 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> |
14 | * | 14 | * |
15 | * This program is free software; you can redistribute it and/or | 15 | * This program is free software; you can redistribute it and/or |
@@ -56,6 +56,7 @@ | |||
56 | #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ | 56 | #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ |
57 | #define ETH_P_CUST 0x6006 /* DEC Customer use */ | 57 | #define ETH_P_CUST 0x6006 /* DEC Customer use */ |
58 | #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ | 58 | #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ |
59 | #define ETH_P_TEB 0x6558 /* Trans Ether Bridging */ | ||
59 | #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ | 60 | #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ |
60 | #define ETH_P_ATALK 0x809B /* Appletalk DDP */ | 61 | #define ETH_P_ATALK 0x809B /* Appletalk DDP */ |
61 | #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ | 62 | #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ |
@@ -74,8 +75,10 @@ | |||
74 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport | 75 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport |
75 | * over Ethernet | 76 | * over Ethernet |
76 | */ | 77 | */ |
78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | ||
77 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
78 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
81 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
79 | 82 | ||
80 | /* | 83 | /* |
81 | * Non DIX types. Won't clash for 1500 types. | 84 | * Non DIX types. Won't clash for 1500 types. |
@@ -99,6 +102,9 @@ | |||
99 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ | 102 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ |
100 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ | 103 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ |
101 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ | 104 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ |
105 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ | ||
106 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ | ||
107 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ | ||
102 | 108 | ||
103 | /* | 109 | /* |
104 | * This is an Ethernet frame header. | 110 | * This is an Ethernet frame header. |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index ae77daed6c2f..45de1046dbbf 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
@@ -12,7 +12,7 @@ | |||
12 | * if_fddi.h is based on previous if_ether.h and if_tr.h work by | 12 | * if_fddi.h is based on previous if_ether.h and if_tr.h work by |
13 | * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 13 | * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
14 | * Donald Becker, <becker@super.org> | 14 | * Donald Becker, <becker@super.org> |
15 | * Alan Cox, <alan@redhat.com> | 15 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> |
16 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> | 16 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> |
17 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> | 17 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> |
18 | * | 18 | * |
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index 94d31ca7d71a..f0f23516bb59 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
11 | * Donald Becker, <becker@super.org> | 11 | * Donald Becker, <becker@super.org> |
12 | * Alan Cox, <alan@redhat.com> | 12 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> |
13 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> | 13 | * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> |
14 | * Jes Sorensen, <Jes.Sorensen@cern.ch> | 14 | * Jes Sorensen, <Jes.Sorensen@cern.ch> |
15 | * | 15 | * |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 84c3492ae5cb..f9032c88716a 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -79,6 +79,7 @@ enum | |||
79 | IFLA_LINKINFO, | 79 | IFLA_LINKINFO, |
80 | #define IFLA_LINKINFO IFLA_LINKINFO | 80 | #define IFLA_LINKINFO IFLA_LINKINFO |
81 | IFLA_NET_NS_PID, | 81 | IFLA_NET_NS_PID, |
82 | IFLA_IFALIAS, | ||
82 | __IFLA_MAX | 83 | __IFLA_MAX |
83 | }; | 84 | }; |
84 | 85 | ||
diff --git a/include/linux/if_phonet.h b/include/linux/if_phonet.h new file mode 100644 index 000000000000..d70034bcec05 --- /dev/null +++ b/include/linux/if_phonet.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * File: if_phonet.h | ||
3 | * | ||
4 | * Phonet interface kernel definitions | ||
5 | * | ||
6 | * Copyright (C) 2008 Nokia Corporation. All rights reserved. | ||
7 | */ | ||
8 | #ifndef LINUX_IF_PHONET_H | ||
9 | #define LINUX_IF_PHONET_H | ||
10 | |||
11 | #define PHONET_MIN_MTU 6 /* pn_length = 0 */ | ||
12 | #define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */ | ||
13 | #define PHONET_DEV_MTU PHONET_MAX_MTU | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | extern struct header_ops phonet_header_ops; | ||
17 | #endif | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index d4efe4014705..aeab2cb32a9c 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _IF_TUNNEL_H_ | 2 | #define _IF_TUNNEL_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/ip.h> | ||
5 | 6 | ||
6 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) | 7 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) |
7 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) | 8 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) |
@@ -47,4 +48,22 @@ struct ip_tunnel_prl { | |||
47 | /* PRL flags */ | 48 | /* PRL flags */ |
48 | #define PRL_DEFAULT 0x0001 | 49 | #define PRL_DEFAULT 0x0001 |
49 | 50 | ||
51 | enum | ||
52 | { | ||
53 | IFLA_GRE_UNSPEC, | ||
54 | IFLA_GRE_LINK, | ||
55 | IFLA_GRE_IFLAGS, | ||
56 | IFLA_GRE_OFLAGS, | ||
57 | IFLA_GRE_IKEY, | ||
58 | IFLA_GRE_OKEY, | ||
59 | IFLA_GRE_LOCAL, | ||
60 | IFLA_GRE_REMOTE, | ||
61 | IFLA_GRE_TTL, | ||
62 | IFLA_GRE_TOS, | ||
63 | IFLA_GRE_PMTUDISC, | ||
64 | __IFLA_GRE_MAX, | ||
65 | }; | ||
66 | |||
67 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) | ||
68 | |||
50 | #endif /* _IF_TUNNEL_H_ */ | 69 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 7bb3c095c15b..f734a0ba0698 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Linux NET3: Internet Group Management Protocol [IGMP] | 2 | * Linux NET3: Internet Group Management Protocol [IGMP] |
3 | * | 3 | * |
4 | * Authors: | 4 | * Authors: |
5 | * Alan Cox <Alan.Cox@linux.org> | 5 | * Alan Cox <alan@lxorguk.ukuu.org.uk> |
6 | * | 6 | * |
7 | * Extended to talk the BSD extended IGMP protocol of mrouted 3.6 | 7 | * Extended to talk the BSD extended IGMP protocol of mrouted 3.6 |
8 | * | 8 | * |
diff --git a/include/linux/in.h b/include/linux/in.h index 4065313cd7ee..db458beef19d 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -75,6 +75,7 @@ struct in_addr { | |||
75 | #define IP_IPSEC_POLICY 16 | 75 | #define IP_IPSEC_POLICY 16 |
76 | #define IP_XFRM_POLICY 17 | 76 | #define IP_XFRM_POLICY 17 |
77 | #define IP_PASSSEC 18 | 77 | #define IP_PASSSEC 18 |
78 | #define IP_TRANSPARENT 19 | ||
78 | 79 | ||
79 | /* BSD compatibility */ | 80 | /* BSD compatibility */ |
80 | #define IP_RECVRETOPTS IP_RETOPTS | 81 | #define IP_RECVRETOPTS IP_RETOPTS |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index c6f51ad52d5b..06fcdb45106b 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -25,6 +25,7 @@ struct in_device | |||
25 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 25 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
26 | rwlock_t mc_list_lock; | 26 | rwlock_t mc_list_lock; |
27 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ | 27 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ |
28 | int mc_count; /* Number of installed mcasts */ | ||
28 | spinlock_t mc_tomb_lock; | 29 | spinlock_t mc_tomb_lock; |
29 | struct ip_mc_list *mc_tomb; | 30 | struct ip_mc_list *mc_tomb; |
30 | unsigned long mr_v1_seen; | 31 | unsigned long mr_v1_seen; |
diff --git a/include/linux/init.h b/include/linux/init.h index 93538b696e3d..ad63824460e3 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -233,9 +233,6 @@ struct obs_kernel_param { | |||
233 | __attribute__((aligned((sizeof(long))))) \ | 233 | __attribute__((aligned((sizeof(long))))) \ |
234 | = { __setup_str_##unique_id, fn, early } | 234 | = { __setup_str_##unique_id, fn, early } |
235 | 235 | ||
236 | #define __setup_null_param(str, unique_id) \ | ||
237 | __setup_param(str, unique_id, NULL, 0) | ||
238 | |||
239 | #define __setup(str, fn) \ | 236 | #define __setup(str, fn) \ |
240 | __setup_param(str, fn, fn, 0) | 237 | __setup_param(str, fn, fn, 0) |
241 | 238 | ||
@@ -296,7 +293,6 @@ void __init parse_early_param(void); | |||
296 | void cleanup_module(void) __attribute__((alias(#exitfn))); | 293 | void cleanup_module(void) __attribute__((alias(#exitfn))); |
297 | 294 | ||
298 | #define __setup_param(str, unique_id, fn) /* nothing */ | 295 | #define __setup_param(str, unique_id, fn) /* nothing */ |
299 | #define __setup_null_param(str, unique_id) /* nothing */ | ||
300 | #define __setup(str, func) /* nothing */ | 296 | #define __setup(str, func) /* nothing */ |
301 | #endif | 297 | #endif |
302 | 298 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index a5802c9c81a4..b86fb5581ce6 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -577,9 +577,22 @@ struct input_absinfo { | |||
577 | #define KEY_BRL_DOT9 0x1f9 | 577 | #define KEY_BRL_DOT9 0x1f9 |
578 | #define KEY_BRL_DOT10 0x1fa | 578 | #define KEY_BRL_DOT10 0x1fa |
579 | 579 | ||
580 | #define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ | ||
581 | #define KEY_NUMERIC_1 0x201 /* and other keypads */ | ||
582 | #define KEY_NUMERIC_2 0x202 | ||
583 | #define KEY_NUMERIC_3 0x203 | ||
584 | #define KEY_NUMERIC_4 0x204 | ||
585 | #define KEY_NUMERIC_5 0x205 | ||
586 | #define KEY_NUMERIC_6 0x206 | ||
587 | #define KEY_NUMERIC_7 0x207 | ||
588 | #define KEY_NUMERIC_8 0x208 | ||
589 | #define KEY_NUMERIC_9 0x209 | ||
590 | #define KEY_NUMERIC_STAR 0x20a | ||
591 | #define KEY_NUMERIC_POUND 0x20b | ||
592 | |||
580 | /* We avoid low common keys in module aliases so they don't get huge. */ | 593 | /* We avoid low common keys in module aliases so they don't get huge. */ |
581 | #define KEY_MIN_INTERESTING KEY_MUTE | 594 | #define KEY_MIN_INTERESTING KEY_MUTE |
582 | #define KEY_MAX 0x1ff | 595 | #define KEY_MAX 0x2ff |
583 | #define KEY_CNT (KEY_MAX+1) | 596 | #define KEY_CNT (KEY_MAX+1) |
584 | 597 | ||
585 | /* | 598 | /* |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h new file mode 100644 index 000000000000..2e117f30a76c --- /dev/null +++ b/include/linux/intel-iommu.h | |||
@@ -0,0 +1,327 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Copyright (C) 2006-2008 Intel Corporation | ||
18 | * Author: Ashok Raj <ashok.raj@intel.com> | ||
19 | * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | ||
20 | */ | ||
21 | |||
22 | #ifndef _INTEL_IOMMU_H_ | ||
23 | #define _INTEL_IOMMU_H_ | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | #include <linux/msi.h> | ||
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/iova.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <linux/dma_remapping.h> | ||
31 | #include <asm/cacheflush.h> | ||
32 | |||
33 | /* | ||
34 | * Intel IOMMU register specification per version 1.0 public spec. | ||
35 | */ | ||
36 | |||
37 | #define DMAR_VER_REG 0x0 /* Arch version supported by this IOMMU */ | ||
38 | #define DMAR_CAP_REG 0x8 /* Hardware supported capabilities */ | ||
39 | #define DMAR_ECAP_REG 0x10 /* Extended capabilities supported */ | ||
40 | #define DMAR_GCMD_REG 0x18 /* Global command register */ | ||
41 | #define DMAR_GSTS_REG 0x1c /* Global status register */ | ||
42 | #define DMAR_RTADDR_REG 0x20 /* Root entry table */ | ||
43 | #define DMAR_CCMD_REG 0x28 /* Context command reg */ | ||
44 | #define DMAR_FSTS_REG 0x34 /* Fault Status register */ | ||
45 | #define DMAR_FECTL_REG 0x38 /* Fault control register */ | ||
46 | #define DMAR_FEDATA_REG 0x3c /* Fault event interrupt data register */ | ||
47 | #define DMAR_FEADDR_REG 0x40 /* Fault event interrupt addr register */ | ||
48 | #define DMAR_FEUADDR_REG 0x44 /* Upper address register */ | ||
49 | #define DMAR_AFLOG_REG 0x58 /* Advanced Fault control */ | ||
50 | #define DMAR_PMEN_REG 0x64 /* Enable Protected Memory Region */ | ||
51 | #define DMAR_PLMBASE_REG 0x68 /* PMRR Low addr */ | ||
52 | #define DMAR_PLMLIMIT_REG 0x6c /* PMRR low limit */ | ||
53 | #define DMAR_PHMBASE_REG 0x70 /* pmrr high base addr */ | ||
54 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ | ||
55 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ | ||
56 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ | ||
57 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ | ||
58 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ | ||
59 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ | ||
60 | |||
61 | #define OFFSET_STRIDE (9) | ||
62 | /* | ||
63 | #define dmar_readl(dmar, reg) readl(dmar + reg) | ||
64 | #define dmar_readq(dmar, reg) ({ \ | ||
65 | u32 lo, hi; \ | ||
66 | lo = readl(dmar + reg); \ | ||
67 | hi = readl(dmar + reg + 4); \ | ||
68 | (((u64) hi) << 32) + lo; }) | ||
69 | */ | ||
70 | static inline u64 dmar_readq(void __iomem *addr) | ||
71 | { | ||
72 | u32 lo, hi; | ||
73 | lo = readl(addr); | ||
74 | hi = readl(addr + 4); | ||
75 | return (((u64) hi) << 32) + lo; | ||
76 | } | ||
77 | |||
78 | static inline void dmar_writeq(void __iomem *addr, u64 val) | ||
79 | { | ||
80 | writel((u32)val, addr); | ||
81 | writel((u32)(val >> 32), addr + 4); | ||
82 | } | ||
83 | |||
84 | #define DMAR_VER_MAJOR(v) (((v) & 0xf0) >> 4) | ||
85 | #define DMAR_VER_MINOR(v) ((v) & 0x0f) | ||
86 | |||
87 | /* | ||
88 | * Decoding Capability Register | ||
89 | */ | ||
90 | #define cap_read_drain(c) (((c) >> 55) & 1) | ||
91 | #define cap_write_drain(c) (((c) >> 54) & 1) | ||
92 | #define cap_max_amask_val(c) (((c) >> 48) & 0x3f) | ||
93 | #define cap_num_fault_regs(c) ((((c) >> 40) & 0xff) + 1) | ||
94 | #define cap_pgsel_inv(c) (((c) >> 39) & 1) | ||
95 | |||
96 | #define cap_super_page_val(c) (((c) >> 34) & 0xf) | ||
97 | #define cap_super_offset(c) (((find_first_bit(&cap_super_page_val(c), 4)) \ | ||
98 | * OFFSET_STRIDE) + 21) | ||
99 | |||
100 | #define cap_fault_reg_offset(c) ((((c) >> 24) & 0x3ff) * 16) | ||
101 | #define cap_max_fault_reg_offset(c) \ | ||
102 | (cap_fault_reg_offset(c) + cap_num_fault_regs(c) * 16) | ||
103 | |||
104 | #define cap_zlr(c) (((c) >> 22) & 1) | ||
105 | #define cap_isoch(c) (((c) >> 23) & 1) | ||
106 | #define cap_mgaw(c) ((((c) >> 16) & 0x3f) + 1) | ||
107 | #define cap_sagaw(c) (((c) >> 8) & 0x1f) | ||
108 | #define cap_caching_mode(c) (((c) >> 7) & 1) | ||
109 | #define cap_phmr(c) (((c) >> 6) & 1) | ||
110 | #define cap_plmr(c) (((c) >> 5) & 1) | ||
111 | #define cap_rwbf(c) (((c) >> 4) & 1) | ||
112 | #define cap_afl(c) (((c) >> 3) & 1) | ||
113 | #define cap_ndoms(c) (((unsigned long)1) << (4 + 2 * ((c) & 0x7))) | ||
114 | /* | ||
115 | * Extended Capability Register | ||
116 | */ | ||
117 | |||
118 | #define ecap_niotlb_iunits(e) ((((e) >> 24) & 0xff) + 1) | ||
119 | #define ecap_iotlb_offset(e) ((((e) >> 8) & 0x3ff) * 16) | ||
120 | #define ecap_max_iotlb_offset(e) \ | ||
121 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) | ||
122 | #define ecap_coherent(e) ((e) & 0x1) | ||
123 | #define ecap_qis(e) ((e) & 0x2) | ||
124 | #define ecap_eim_support(e) ((e >> 4) & 0x1) | ||
125 | #define ecap_ir_support(e) ((e >> 3) & 0x1) | ||
126 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) | ||
127 | |||
128 | |||
129 | /* IOTLB_REG */ | ||
130 | #define DMA_TLB_GLOBAL_FLUSH (((u64)1) << 60) | ||
131 | #define DMA_TLB_DSI_FLUSH (((u64)2) << 60) | ||
132 | #define DMA_TLB_PSI_FLUSH (((u64)3) << 60) | ||
133 | #define DMA_TLB_IIRG(type) ((type >> 60) & 7) | ||
134 | #define DMA_TLB_IAIG(val) (((val) >> 57) & 7) | ||
135 | #define DMA_TLB_READ_DRAIN (((u64)1) << 49) | ||
136 | #define DMA_TLB_WRITE_DRAIN (((u64)1) << 48) | ||
137 | #define DMA_TLB_DID(id) (((u64)((id) & 0xffff)) << 32) | ||
138 | #define DMA_TLB_IVT (((u64)1) << 63) | ||
139 | #define DMA_TLB_IH_NONLEAF (((u64)1) << 6) | ||
140 | #define DMA_TLB_MAX_SIZE (0x3f) | ||
141 | |||
142 | /* INVALID_DESC */ | ||
143 | #define DMA_ID_TLB_GLOBAL_FLUSH (((u64)1) << 3) | ||
144 | #define DMA_ID_TLB_DSI_FLUSH (((u64)2) << 3) | ||
145 | #define DMA_ID_TLB_PSI_FLUSH (((u64)3) << 3) | ||
146 | #define DMA_ID_TLB_READ_DRAIN (((u64)1) << 7) | ||
147 | #define DMA_ID_TLB_WRITE_DRAIN (((u64)1) << 6) | ||
148 | #define DMA_ID_TLB_DID(id) (((u64)((id & 0xffff) << 16))) | ||
149 | #define DMA_ID_TLB_IH_NONLEAF (((u64)1) << 6) | ||
150 | #define DMA_ID_TLB_ADDR(addr) (addr) | ||
151 | #define DMA_ID_TLB_ADDR_MASK(mask) (mask) | ||
152 | |||
153 | /* PMEN_REG */ | ||
154 | #define DMA_PMEN_EPM (((u32)1)<<31) | ||
155 | #define DMA_PMEN_PRS (((u32)1)<<0) | ||
156 | |||
157 | /* GCMD_REG */ | ||
158 | #define DMA_GCMD_TE (((u32)1) << 31) | ||
159 | #define DMA_GCMD_SRTP (((u32)1) << 30) | ||
160 | #define DMA_GCMD_SFL (((u32)1) << 29) | ||
161 | #define DMA_GCMD_EAFL (((u32)1) << 28) | ||
162 | #define DMA_GCMD_WBF (((u32)1) << 27) | ||
163 | #define DMA_GCMD_QIE (((u32)1) << 26) | ||
164 | #define DMA_GCMD_SIRTP (((u32)1) << 24) | ||
165 | #define DMA_GCMD_IRE (((u32) 1) << 25) | ||
166 | |||
167 | /* GSTS_REG */ | ||
168 | #define DMA_GSTS_TES (((u32)1) << 31) | ||
169 | #define DMA_GSTS_RTPS (((u32)1) << 30) | ||
170 | #define DMA_GSTS_FLS (((u32)1) << 29) | ||
171 | #define DMA_GSTS_AFLS (((u32)1) << 28) | ||
172 | #define DMA_GSTS_WBFS (((u32)1) << 27) | ||
173 | #define DMA_GSTS_QIES (((u32)1) << 26) | ||
174 | #define DMA_GSTS_IRTPS (((u32)1) << 24) | ||
175 | #define DMA_GSTS_IRES (((u32)1) << 25) | ||
176 | |||
177 | /* CCMD_REG */ | ||
178 | #define DMA_CCMD_ICC (((u64)1) << 63) | ||
179 | #define DMA_CCMD_GLOBAL_INVL (((u64)1) << 61) | ||
180 | #define DMA_CCMD_DOMAIN_INVL (((u64)2) << 61) | ||
181 | #define DMA_CCMD_DEVICE_INVL (((u64)3) << 61) | ||
182 | #define DMA_CCMD_FM(m) (((u64)((m) & 0x3)) << 32) | ||
183 | #define DMA_CCMD_MASK_NOBIT 0 | ||
184 | #define DMA_CCMD_MASK_1BIT 1 | ||
185 | #define DMA_CCMD_MASK_2BIT 2 | ||
186 | #define DMA_CCMD_MASK_3BIT 3 | ||
187 | #define DMA_CCMD_SID(s) (((u64)((s) & 0xffff)) << 16) | ||
188 | #define DMA_CCMD_DID(d) ((u64)((d) & 0xffff)) | ||
189 | |||
190 | /* FECTL_REG */ | ||
191 | #define DMA_FECTL_IM (((u32)1) << 31) | ||
192 | |||
193 | /* FSTS_REG */ | ||
194 | #define DMA_FSTS_PPF ((u32)2) | ||
195 | #define DMA_FSTS_PFO ((u32)1) | ||
196 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) | ||
197 | |||
198 | /* FRCD_REG, 32 bits access */ | ||
199 | #define DMA_FRCD_F (((u32)1) << 31) | ||
200 | #define dma_frcd_type(d) ((d >> 30) & 1) | ||
201 | #define dma_frcd_fault_reason(c) (c & 0xff) | ||
202 | #define dma_frcd_source_id(c) (c & 0xffff) | ||
203 | #define dma_frcd_page_addr(d) (d & (((u64)-1) << 12)) /* low 64 bit */ | ||
204 | |||
205 | #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */ | ||
206 | |||
207 | #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ | ||
208 | {\ | ||
209 | cycles_t start_time = get_cycles();\ | ||
210 | while (1) {\ | ||
211 | sts = op (iommu->reg + offset);\ | ||
212 | if (cond)\ | ||
213 | break;\ | ||
214 | if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\ | ||
215 | panic("DMAR hardware is malfunctioning\n");\ | ||
216 | cpu_relax();\ | ||
217 | }\ | ||
218 | } | ||
219 | |||
220 | #define QI_LENGTH 256 /* queue length */ | ||
221 | |||
222 | enum { | ||
223 | QI_FREE, | ||
224 | QI_IN_USE, | ||
225 | QI_DONE | ||
226 | }; | ||
227 | |||
228 | #define QI_CC_TYPE 0x1 | ||
229 | #define QI_IOTLB_TYPE 0x2 | ||
230 | #define QI_DIOTLB_TYPE 0x3 | ||
231 | #define QI_IEC_TYPE 0x4 | ||
232 | #define QI_IWD_TYPE 0x5 | ||
233 | |||
234 | #define QI_IEC_SELECTIVE (((u64)1) << 4) | ||
235 | #define QI_IEC_IIDEX(idx) (((u64)(idx & 0xffff) << 32)) | ||
236 | #define QI_IEC_IM(m) (((u64)(m & 0x1f) << 27)) | ||
237 | |||
238 | #define QI_IWD_STATUS_DATA(d) (((u64)d) << 32) | ||
239 | #define QI_IWD_STATUS_WRITE (((u64)1) << 5) | ||
240 | |||
241 | struct qi_desc { | ||
242 | u64 low, high; | ||
243 | }; | ||
244 | |||
245 | struct q_inval { | ||
246 | spinlock_t q_lock; | ||
247 | struct qi_desc *desc; /* invalidation queue */ | ||
248 | int *desc_status; /* desc status */ | ||
249 | int free_head; /* first free entry */ | ||
250 | int free_tail; /* last free entry */ | ||
251 | int free_cnt; | ||
252 | }; | ||
253 | |||
254 | #ifdef CONFIG_INTR_REMAP | ||
255 | /* 1MB - maximum possible interrupt remapping table size */ | ||
256 | #define INTR_REMAP_PAGE_ORDER 8 | ||
257 | #define INTR_REMAP_TABLE_REG_SIZE 0xf | ||
258 | |||
259 | #define INTR_REMAP_TABLE_ENTRIES 65536 | ||
260 | |||
261 | struct ir_table { | ||
262 | struct irte *base; | ||
263 | }; | ||
264 | #endif | ||
265 | |||
266 | struct intel_iommu { | ||
267 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ | ||
268 | u64 cap; | ||
269 | u64 ecap; | ||
270 | int seg; | ||
271 | u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ | ||
272 | spinlock_t register_lock; /* protect register handling */ | ||
273 | int seq_id; /* sequence id of the iommu */ | ||
274 | |||
275 | #ifdef CONFIG_DMAR | ||
276 | unsigned long *domain_ids; /* bitmap of domains */ | ||
277 | struct dmar_domain **domains; /* ptr to domains */ | ||
278 | spinlock_t lock; /* protect context, domain ids */ | ||
279 | struct root_entry *root_entry; /* virtual address */ | ||
280 | |||
281 | unsigned int irq; | ||
282 | unsigned char name[7]; /* Device Name */ | ||
283 | struct msi_msg saved_msg; | ||
284 | struct sys_device sysdev; | ||
285 | #endif | ||
286 | struct q_inval *qi; /* Queued invalidation info */ | ||
287 | #ifdef CONFIG_INTR_REMAP | ||
288 | struct ir_table *ir_table; /* Interrupt remapping info */ | ||
289 | #endif | ||
290 | }; | ||
291 | |||
292 | static inline void __iommu_flush_cache( | ||
293 | struct intel_iommu *iommu, void *addr, int size) | ||
294 | { | ||
295 | if (!ecap_coherent(iommu->ecap)) | ||
296 | clflush_cache_range(addr, size); | ||
297 | } | ||
298 | |||
299 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); | ||
300 | |||
301 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); | ||
302 | extern void free_iommu(struct intel_iommu *iommu); | ||
303 | extern int dmar_enable_qi(struct intel_iommu *iommu); | ||
304 | extern void qi_global_iec(struct intel_iommu *iommu); | ||
305 | |||
306 | extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | ||
307 | |||
308 | void intel_iommu_domain_exit(struct dmar_domain *domain); | ||
309 | struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev); | ||
310 | int intel_iommu_context_mapping(struct dmar_domain *domain, | ||
311 | struct pci_dev *pdev); | ||
312 | int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova, | ||
313 | u64 hpa, size_t size, int prot); | ||
314 | void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn); | ||
315 | struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev); | ||
316 | u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova); | ||
317 | |||
318 | #ifdef CONFIG_DMAR | ||
319 | int intel_iommu_found(void); | ||
320 | #else /* CONFIG_DMAR */ | ||
321 | static inline int intel_iommu_found(void) | ||
322 | { | ||
323 | return 0; | ||
324 | } | ||
325 | #endif /* CONFIG_DMAR */ | ||
326 | |||
327 | #endif | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 58ff4e74b2f3..54b3623434ec 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -252,6 +252,8 @@ enum | |||
252 | HRTIMER_SOFTIRQ, | 252 | HRTIMER_SOFTIRQ, |
253 | #endif | 253 | #endif |
254 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | 254 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ |
255 | |||
256 | NR_SOFTIRQS | ||
255 | }; | 257 | }; |
256 | 258 | ||
257 | /* softirq mask and active fields moved to irq_cpustat_t in | 259 | /* softirq mask and active fields moved to irq_cpustat_t in |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index c975caf75385..3b068e5b5671 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -1,6 +1,20 @@ | |||
1 | #ifndef _LINUX_IOMMU_HELPER_H | ||
2 | #define _LINUX_IOMMU_HELPER_H | ||
3 | |||
4 | static inline unsigned long iommu_device_max_index(unsigned long size, | ||
5 | unsigned long offset, | ||
6 | u64 dma_mask) | ||
7 | { | ||
8 | if (size + offset > dma_mask) | ||
9 | return dma_mask - offset + 1; | ||
10 | else | ||
11 | return size; | ||
12 | } | ||
13 | |||
1 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, | 14 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, |
2 | unsigned long shift, | 15 | unsigned long shift, |
3 | unsigned long boundary_size); | 16 | unsigned long boundary_size); |
17 | extern void iommu_area_reserve(unsigned long *map, unsigned long i, int len); | ||
4 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | 18 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, |
5 | unsigned long start, unsigned int nr, | 19 | unsigned long start, unsigned int nr, |
6 | unsigned long shift, | 20 | unsigned long shift, |
@@ -8,3 +22,8 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
8 | unsigned long align_mask); | 22 | unsigned long align_mask); |
9 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 23 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
10 | unsigned int nr); | 24 | unsigned int nr); |
25 | |||
26 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len, | ||
27 | unsigned long io_page_size); | ||
28 | |||
29 | #endif | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 8d3b7a9afd17..041e95aac2bf 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -34,7 +34,8 @@ struct resource_list { | |||
34 | */ | 34 | */ |
35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ | 35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ |
36 | 36 | ||
37 | #define IORESOURCE_IO 0x00000100 /* Resource type */ | 37 | #define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */ |
38 | #define IORESOURCE_IO 0x00000100 | ||
38 | #define IORESOURCE_MEM 0x00000200 | 39 | #define IORESOURCE_MEM 0x00000200 |
39 | #define IORESOURCE_IRQ 0x00000400 | 40 | #define IORESOURCE_IRQ 0x00000400 |
40 | #define IORESOURCE_DMA 0x00000800 | 41 | #define IORESOURCE_DMA 0x00000800 |
@@ -108,6 +109,9 @@ extern struct resource iomem_resource; | |||
108 | 109 | ||
109 | extern int request_resource(struct resource *root, struct resource *new); | 110 | extern int request_resource(struct resource *root, struct resource *new); |
110 | extern int release_resource(struct resource *new); | 111 | extern int release_resource(struct resource *new); |
112 | extern void reserve_region_with_split(struct resource *root, | ||
113 | resource_size_t start, resource_size_t end, | ||
114 | const char *name); | ||
111 | extern int insert_resource(struct resource *parent, struct resource *new); | 115 | extern int insert_resource(struct resource *parent, struct resource *new); |
112 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | 116 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); |
113 | extern int allocate_resource(struct resource *root, struct resource *new, | 117 | extern int allocate_resource(struct resource *root, struct resource *new, |
@@ -123,6 +127,10 @@ static inline resource_size_t resource_size(struct resource *res) | |||
123 | { | 127 | { |
124 | return res->end - res->start + 1; | 128 | return res->end - res->start + 1; |
125 | } | 129 | } |
130 | static inline unsigned long resource_type(struct resource *res) | ||
131 | { | ||
132 | return res->flags & IORESOURCE_TYPE_BITS; | ||
133 | } | ||
126 | 134 | ||
127 | /* Convenience shorthand with allocation */ | 135 | /* Convenience shorthand with allocation */ |
128 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 136 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
@@ -159,13 +167,14 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
159 | struct resource *parent, resource_size_t start, | 167 | struct resource *parent, resource_size_t start, |
160 | resource_size_t n, const char *name); | 168 | resource_size_t n, const char *name); |
161 | 169 | ||
162 | #define devm_release_region(start,n) \ | 170 | #define devm_release_region(dev, start, n) \ |
163 | __devm_release_region(dev, &ioport_resource, (start), (n)) | 171 | __devm_release_region(dev, &ioport_resource, (start), (n)) |
164 | #define devm_release_mem_region(start,n) \ | 172 | #define devm_release_mem_region(dev, start, n) \ |
165 | __devm_release_region(dev, &iomem_resource, (start), (n)) | 173 | __devm_release_region(dev, &iomem_resource, (start), (n)) |
166 | 174 | ||
167 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 175 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
168 | resource_size_t start, resource_size_t n); | 176 | resource_size_t start, resource_size_t n); |
177 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | ||
169 | 178 | ||
170 | #endif /* __ASSEMBLY__ */ | 179 | #endif /* __ASSEMBLY__ */ |
171 | #endif /* _LINUX_IOPORT_H */ | 180 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h new file mode 100644 index 000000000000..228f6c94b69c --- /dev/null +++ b/include/linux/iova.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006, Intel Corporation. | ||
3 | * | ||
4 | * This file is released under the GPLv2. | ||
5 | * | ||
6 | * Copyright (C) 2006-2008 Intel Corporation | ||
7 | * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #ifndef _IOVA_H_ | ||
12 | #define _IOVA_H_ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/rbtree.h> | ||
17 | #include <linux/dma-mapping.h> | ||
18 | |||
19 | /* IO virtual address start page frame number */ | ||
20 | #define IOVA_START_PFN (1) | ||
21 | |||
22 | /* iova structure */ | ||
23 | struct iova { | ||
24 | struct rb_node node; | ||
25 | unsigned long pfn_hi; /* IOMMU dish out addr hi */ | ||
26 | unsigned long pfn_lo; /* IOMMU dish out addr lo */ | ||
27 | }; | ||
28 | |||
29 | /* holds all the iova translations for a domain */ | ||
30 | struct iova_domain { | ||
31 | spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */ | ||
32 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | ||
33 | struct rb_root rbroot; /* iova domain rbtree root */ | ||
34 | struct rb_node *cached32_node; /* Save last alloced node */ | ||
35 | unsigned long dma_32bit_pfn; | ||
36 | }; | ||
37 | |||
38 | struct iova *alloc_iova_mem(void); | ||
39 | void free_iova_mem(struct iova *iova); | ||
40 | void free_iova(struct iova_domain *iovad, unsigned long pfn); | ||
41 | void __free_iova(struct iova_domain *iovad, struct iova *iova); | ||
42 | struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size, | ||
43 | unsigned long limit_pfn, | ||
44 | bool size_aligned); | ||
45 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, | ||
46 | unsigned long pfn_hi); | ||
47 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); | ||
48 | void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit); | ||
49 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); | ||
50 | void put_iova_domain(struct iova_domain *iovad); | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h index ec6eb49af2d8..0f434a28fb58 100644 --- a/include/linux/ip_vs.h +++ b/include/linux/ip_vs.h | |||
@@ -242,4 +242,164 @@ struct ip_vs_daemon_user { | |||
242 | int syncid; | 242 | int syncid; |
243 | }; | 243 | }; |
244 | 244 | ||
245 | /* | ||
246 | * | ||
247 | * IPVS Generic Netlink interface definitions | ||
248 | * | ||
249 | */ | ||
250 | |||
251 | /* Generic Netlink family info */ | ||
252 | |||
253 | #define IPVS_GENL_NAME "IPVS" | ||
254 | #define IPVS_GENL_VERSION 0x1 | ||
255 | |||
256 | struct ip_vs_flags { | ||
257 | __be32 flags; | ||
258 | __be32 mask; | ||
259 | }; | ||
260 | |||
261 | /* Generic Netlink command attributes */ | ||
262 | enum { | ||
263 | IPVS_CMD_UNSPEC = 0, | ||
264 | |||
265 | IPVS_CMD_NEW_SERVICE, /* add service */ | ||
266 | IPVS_CMD_SET_SERVICE, /* modify service */ | ||
267 | IPVS_CMD_DEL_SERVICE, /* delete service */ | ||
268 | IPVS_CMD_GET_SERVICE, /* get service info */ | ||
269 | |||
270 | IPVS_CMD_NEW_DEST, /* add destination */ | ||
271 | IPVS_CMD_SET_DEST, /* modify destination */ | ||
272 | IPVS_CMD_DEL_DEST, /* delete destination */ | ||
273 | IPVS_CMD_GET_DEST, /* get destination info */ | ||
274 | |||
275 | IPVS_CMD_NEW_DAEMON, /* start sync daemon */ | ||
276 | IPVS_CMD_DEL_DAEMON, /* stop sync daemon */ | ||
277 | IPVS_CMD_GET_DAEMON, /* get sync daemon status */ | ||
278 | |||
279 | IPVS_CMD_SET_CONFIG, /* set config settings */ | ||
280 | IPVS_CMD_GET_CONFIG, /* get config settings */ | ||
281 | |||
282 | IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */ | ||
283 | IPVS_CMD_GET_INFO, /* get general IPVS info */ | ||
284 | |||
285 | IPVS_CMD_ZERO, /* zero all counters and stats */ | ||
286 | IPVS_CMD_FLUSH, /* flush services and dests */ | ||
287 | |||
288 | __IPVS_CMD_MAX, | ||
289 | }; | ||
290 | |||
291 | #define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1) | ||
292 | |||
293 | /* Attributes used in the first level of commands */ | ||
294 | enum { | ||
295 | IPVS_CMD_ATTR_UNSPEC = 0, | ||
296 | IPVS_CMD_ATTR_SERVICE, /* nested service attribute */ | ||
297 | IPVS_CMD_ATTR_DEST, /* nested destination attribute */ | ||
298 | IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */ | ||
299 | IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */ | ||
300 | IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */ | ||
301 | IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */ | ||
302 | __IPVS_CMD_ATTR_MAX, | ||
303 | }; | ||
304 | |||
305 | #define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) | ||
306 | |||
307 | /* | ||
308 | * Attributes used to describe a service | ||
309 | * | ||
310 | * Used inside nested attribute IPVS_CMD_ATTR_SERVICE | ||
311 | */ | ||
312 | enum { | ||
313 | IPVS_SVC_ATTR_UNSPEC = 0, | ||
314 | IPVS_SVC_ATTR_AF, /* address family */ | ||
315 | IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */ | ||
316 | IPVS_SVC_ATTR_ADDR, /* virtual service address */ | ||
317 | IPVS_SVC_ATTR_PORT, /* virtual service port */ | ||
318 | IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */ | ||
319 | |||
320 | IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */ | ||
321 | IPVS_SVC_ATTR_FLAGS, /* virtual service flags */ | ||
322 | IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */ | ||
323 | IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ | ||
324 | |||
325 | IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ | ||
326 | __IPVS_SVC_ATTR_MAX, | ||
327 | }; | ||
328 | |||
329 | #define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) | ||
330 | |||
331 | /* | ||
332 | * Attributes used to describe a destination (real server) | ||
333 | * | ||
334 | * Used inside nested attribute IPVS_CMD_ATTR_DEST | ||
335 | */ | ||
336 | enum { | ||
337 | IPVS_DEST_ATTR_UNSPEC = 0, | ||
338 | IPVS_DEST_ATTR_ADDR, /* real server address */ | ||
339 | IPVS_DEST_ATTR_PORT, /* real server port */ | ||
340 | |||
341 | IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */ | ||
342 | IPVS_DEST_ATTR_WEIGHT, /* destination weight */ | ||
343 | |||
344 | IPVS_DEST_ATTR_U_THRESH, /* upper threshold */ | ||
345 | IPVS_DEST_ATTR_L_THRESH, /* lower threshold */ | ||
346 | |||
347 | IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */ | ||
348 | IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */ | ||
349 | IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */ | ||
350 | |||
351 | IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */ | ||
352 | __IPVS_DEST_ATTR_MAX, | ||
353 | }; | ||
354 | |||
355 | #define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1) | ||
356 | |||
357 | /* | ||
358 | * Attributes describing a sync daemon | ||
359 | * | ||
360 | * Used inside nested attribute IPVS_CMD_ATTR_DAEMON | ||
361 | */ | ||
362 | enum { | ||
363 | IPVS_DAEMON_ATTR_UNSPEC = 0, | ||
364 | IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */ | ||
365 | IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */ | ||
366 | IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */ | ||
367 | __IPVS_DAEMON_ATTR_MAX, | ||
368 | }; | ||
369 | |||
370 | #define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1) | ||
371 | |||
372 | /* | ||
373 | * Attributes used to describe service or destination entry statistics | ||
374 | * | ||
375 | * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS | ||
376 | */ | ||
377 | enum { | ||
378 | IPVS_STATS_ATTR_UNSPEC = 0, | ||
379 | IPVS_STATS_ATTR_CONNS, /* connections scheduled */ | ||
380 | IPVS_STATS_ATTR_INPKTS, /* incoming packets */ | ||
381 | IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */ | ||
382 | IPVS_STATS_ATTR_INBYTES, /* incoming bytes */ | ||
383 | IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */ | ||
384 | |||
385 | IPVS_STATS_ATTR_CPS, /* current connection rate */ | ||
386 | IPVS_STATS_ATTR_INPPS, /* current in packet rate */ | ||
387 | IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */ | ||
388 | IPVS_STATS_ATTR_INBPS, /* current in byte rate */ | ||
389 | IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */ | ||
390 | __IPVS_STATS_ATTR_MAX, | ||
391 | }; | ||
392 | |||
393 | #define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1) | ||
394 | |||
395 | /* Attributes used in response to IPVS_CMD_GET_INFO command */ | ||
396 | enum { | ||
397 | IPVS_INFO_ATTR_UNSPEC = 0, | ||
398 | IPVS_INFO_ATTR_VERSION, /* IPVS version number */ | ||
399 | IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */ | ||
400 | __IPVS_INFO_ATTR_MAX, | ||
401 | }; | ||
402 | |||
403 | #define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1) | ||
404 | |||
245 | #endif /* _IP_VS_H */ | 405 | #endif /* _IP_VS_H */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 8ccb462ea42c..8d9411bc60f6 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -62,6 +62,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, | |||
62 | #define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ | 62 | #define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ |
63 | #define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ | 63 | #define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ |
64 | #define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ | 64 | #define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ |
65 | #define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ | ||
65 | 66 | ||
66 | #ifdef CONFIG_IRQ_PER_CPU | 67 | #ifdef CONFIG_IRQ_PER_CPU |
67 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 68 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 8687a7dc0632..4c218ee7587a 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
@@ -157,7 +157,7 @@ typedef struct { | |||
157 | 157 | ||
158 | typedef struct { | 158 | typedef struct { |
159 | int mp_mrru; /* unused */ | 159 | int mp_mrru; /* unused */ |
160 | struct sk_buff * frags; /* fragments sl list -- use skb->next */ | 160 | struct sk_buff_head frags; /* fragments sl list */ |
161 | long frames; /* number of frames in the frame list */ | 161 | long frames; /* number of frames in the frame list */ |
162 | unsigned int seq; /* last processed packet seq #: any packets | 162 | unsigned int seq; /* last processed packet seq #: any packets |
163 | * with smaller seq # will be dropped | 163 | * with smaller seq # will be dropped |
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h index 17ca64b5a66c..f2720280b9ec 100644 --- a/include/linux/ivtv.h +++ b/include/linux/ivtv.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/videodev2.h> | ||
26 | 27 | ||
27 | /* ivtv knows several distinct output modes: MPEG streaming, | 28 | /* ivtv knows several distinct output modes: MPEG streaming, |
28 | YUV streaming, YUV updates through user DMA and the passthrough | 29 | YUV streaming, YUV updates through user DMA and the passthrough |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 07a9b52a2654..7ebbcb1c9ba4 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -61,7 +61,7 @@ extern u8 journal_enable_debug; | |||
61 | do { \ | 61 | do { \ |
62 | if ((n) <= journal_enable_debug) { \ | 62 | if ((n) <= journal_enable_debug) { \ |
63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
64 | __FILE__, __LINE__, __FUNCTION__); \ | 64 | __FILE__, __LINE__, __func__); \ |
65 | printk (f, ## a); \ | 65 | printk (f, ## a); \ |
66 | } \ | 66 | } \ |
67 | } while (0) | 67 | } while (0) |
@@ -984,7 +984,7 @@ extern int cleanup_journal_tail(journal_t *); | |||
984 | 984 | ||
985 | #define jbd_ENOSYS() \ | 985 | #define jbd_ENOSYS() \ |
986 | do { \ | 986 | do { \ |
987 | printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ | 987 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ |
988 | current->state = TASK_UNINTERRUPTIBLE; \ | 988 | current->state = TASK_UNINTERRUPTIBLE; \ |
989 | schedule(); \ | 989 | schedule(); \ |
990 | } while (1) | 990 | } while (1) |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 3dd209007098..463d6f10b64f 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -61,7 +61,7 @@ extern u8 jbd2_journal_enable_debug; | |||
61 | do { \ | 61 | do { \ |
62 | if ((n) <= jbd2_journal_enable_debug) { \ | 62 | if ((n) <= jbd2_journal_enable_debug) { \ |
63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 63 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
64 | __FILE__, __LINE__, __FUNCTION__); \ | 64 | __FILE__, __LINE__, __func__); \ |
65 | printk (f, ## a); \ | 65 | printk (f, ## a); \ |
66 | } \ | 66 | } \ |
67 | } while (0) | 67 | } while (0) |
@@ -850,7 +850,8 @@ struct journal_s | |||
850 | */ | 850 | */ |
851 | struct block_device *j_dev; | 851 | struct block_device *j_dev; |
852 | int j_blocksize; | 852 | int j_blocksize; |
853 | unsigned long long j_blk_offset; | 853 | unsigned long long j_blk_offset; |
854 | char j_devname[BDEVNAME_SIZE+24]; | ||
854 | 855 | ||
855 | /* | 856 | /* |
856 | * Device which holds the client fs. For internal journal this will be | 857 | * Device which holds the client fs. For internal journal this will be |
@@ -966,6 +967,9 @@ struct journal_s | |||
966 | #define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */ | 967 | #define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */ |
967 | #define JBD2_LOADED 0x010 /* The journal superblock has been loaded */ | 968 | #define JBD2_LOADED 0x010 /* The journal superblock has been loaded */ |
968 | #define JBD2_BARRIER 0x020 /* Use IDE barriers */ | 969 | #define JBD2_BARRIER 0x020 /* Use IDE barriers */ |
970 | #define JBD2_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file | ||
971 | * data write error in ordered | ||
972 | * mode */ | ||
969 | 973 | ||
970 | /* | 974 | /* |
971 | * Function declarations for the journaling transaction and buffer | 975 | * Function declarations for the journaling transaction and buffer |
@@ -1059,7 +1063,7 @@ extern void jbd2_journal_clear_features | |||
1059 | (journal_t *, unsigned long, unsigned long, unsigned long); | 1063 | (journal_t *, unsigned long, unsigned long, unsigned long); |
1060 | extern int jbd2_journal_create (journal_t *); | 1064 | extern int jbd2_journal_create (journal_t *); |
1061 | extern int jbd2_journal_load (journal_t *journal); | 1065 | extern int jbd2_journal_load (journal_t *journal); |
1062 | extern void jbd2_journal_destroy (journal_t *); | 1066 | extern int jbd2_journal_destroy (journal_t *); |
1063 | extern int jbd2_journal_recover (journal_t *journal); | 1067 | extern int jbd2_journal_recover (journal_t *journal); |
1064 | extern int jbd2_journal_wipe (journal_t *, int); | 1068 | extern int jbd2_journal_wipe (journal_t *, int); |
1065 | extern int jbd2_journal_skip_recovery (journal_t *); | 1069 | extern int jbd2_journal_skip_recovery (journal_t *); |
@@ -1139,7 +1143,7 @@ extern int jbd2_cleanup_journal_tail(journal_t *); | |||
1139 | 1143 | ||
1140 | #define jbd_ENOSYS() \ | 1144 | #define jbd_ENOSYS() \ |
1141 | do { \ | 1145 | do { \ |
1142 | printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ | 1146 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ |
1143 | current->state = TASK_UNINTERRUPTIBLE; \ | 1147 | current->state = TASK_UNINTERRUPTIBLE; \ |
1144 | schedule(); \ | 1148 | schedule(); \ |
1145 | } while (1) | 1149 | } while (1) |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index 8a62d1e84b9b..bb70ebb6a2d5 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * buffer_head fields for JBD | 4 | * buffer_head fields for JBD |
5 | * | 5 | * |
6 | * 27 May 2001 Andrew Morton <akpm@digeo.com> | 6 | * 27 May 2001 Andrew Morton |
7 | * Created - pulled out of fs.h | 7 | * Created - pulled out of fs.h |
8 | */ | 8 | */ |
9 | 9 | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index b96144887444..f3fe34391d8e 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -93,12 +93,10 @@ static inline void print_symbol(const char *fmt, unsigned long addr) | |||
93 | } | 93 | } |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * Pretty-print a function pointer. | 96 | * Pretty-print a function pointer. This function is deprecated. |
97 | * | 97 | * Please use the "%pF" vsprintf format instead. |
98 | * ia64 and ppc64 function pointers are really function descriptors, | ||
99 | * which contain a pointer the real address. | ||
100 | */ | 98 | */ |
101 | static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) | 99 | static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr) |
102 | { | 100 | { |
103 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | 101 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) |
104 | addr = *(void **)addr; | 102 | addr = *(void **)addr; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2651f805ba6d..6803318fa2ea 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
17 | #include <linux/typecheck.h> | 17 | #include <linux/typecheck.h> |
18 | #include <linux/ratelimit.h> | 18 | #include <linux/ratelimit.h> |
19 | #include <linux/dynamic_printk.h> | ||
19 | #include <asm/byteorder.h> | 20 | #include <asm/byteorder.h> |
20 | #include <asm/bug.h> | 21 | #include <asm/bug.h> |
21 | 22 | ||
@@ -182,7 +183,7 @@ extern int vsscanf(const char *, const char *, va_list) | |||
182 | 183 | ||
183 | extern int get_option(char **str, int *pint); | 184 | extern int get_option(char **str, int *pint); |
184 | extern char *get_options(const char *str, int nints, int *ints); | 185 | extern char *get_options(const char *str, int nints, int *ints); |
185 | extern unsigned long long memparse(char *ptr, char **retptr); | 186 | extern unsigned long long memparse(const char *ptr, char **retptr); |
186 | 187 | ||
187 | extern int core_kernel_text(unsigned long addr); | 188 | extern int core_kernel_text(unsigned long addr); |
188 | extern int __kernel_text_address(unsigned long addr); | 189 | extern int __kernel_text_address(unsigned long addr); |
@@ -213,6 +214,9 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | |||
213 | { return false; } | 214 | { return false; } |
214 | #endif | 215 | #endif |
215 | 216 | ||
217 | extern int printk_needs_cpu(int cpu); | ||
218 | extern void printk_tick(void); | ||
219 | |||
216 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | 220 | extern void asmlinkage __attribute__((format(printf, 1, 2))) |
217 | early_printk(const char *fmt, ...); | 221 | early_printk(const char *fmt, ...); |
218 | 222 | ||
@@ -235,9 +239,10 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in | |||
235 | extern int panic_timeout; | 239 | extern int panic_timeout; |
236 | extern int panic_on_oops; | 240 | extern int panic_on_oops; |
237 | extern int panic_on_unrecovered_nmi; | 241 | extern int panic_on_unrecovered_nmi; |
238 | extern int tainted; | ||
239 | extern const char *print_tainted(void); | 242 | extern const char *print_tainted(void); |
240 | extern void add_taint(unsigned); | 243 | extern void add_taint(unsigned flag); |
244 | extern int test_taint(unsigned flag); | ||
245 | extern unsigned long get_taint(void); | ||
241 | extern int root_mountflags; | 246 | extern int root_mountflags; |
242 | 247 | ||
243 | /* Values used for system_state */ | 248 | /* Values used for system_state */ |
@@ -250,16 +255,16 @@ extern enum system_states { | |||
250 | SYSTEM_SUSPEND_DISK, | 255 | SYSTEM_SUSPEND_DISK, |
251 | } system_state; | 256 | } system_state; |
252 | 257 | ||
253 | #define TAINT_PROPRIETARY_MODULE (1<<0) | 258 | #define TAINT_PROPRIETARY_MODULE 0 |
254 | #define TAINT_FORCED_MODULE (1<<1) | 259 | #define TAINT_FORCED_MODULE 1 |
255 | #define TAINT_UNSAFE_SMP (1<<2) | 260 | #define TAINT_UNSAFE_SMP 2 |
256 | #define TAINT_FORCED_RMMOD (1<<3) | 261 | #define TAINT_FORCED_RMMOD 3 |
257 | #define TAINT_MACHINE_CHECK (1<<4) | 262 | #define TAINT_MACHINE_CHECK 4 |
258 | #define TAINT_BAD_PAGE (1<<5) | 263 | #define TAINT_BAD_PAGE 5 |
259 | #define TAINT_USER (1<<6) | 264 | #define TAINT_USER 6 |
260 | #define TAINT_DIE (1<<7) | 265 | #define TAINT_DIE 7 |
261 | #define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) | 266 | #define TAINT_OVERRIDDEN_ACPI_TABLE 8 |
262 | #define TAINT_WARN (1<<9) | 267 | #define TAINT_WARN 9 |
263 | 268 | ||
264 | extern void dump_stack(void) __cold; | 269 | extern void dump_stack(void) __cold; |
265 | 270 | ||
@@ -303,8 +308,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
303 | #define pr_info(fmt, arg...) \ | 308 | #define pr_info(fmt, arg...) \ |
304 | printk(KERN_INFO fmt, ##arg) | 309 | printk(KERN_INFO fmt, ##arg) |
305 | 310 | ||
306 | #ifdef DEBUG | ||
307 | /* If you are writing a driver, please use dev_dbg instead */ | 311 | /* If you are writing a driver, please use dev_dbg instead */ |
312 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
313 | #define pr_debug(fmt, ...) do { \ | ||
314 | dynamic_pr_debug(fmt, ##__VA_ARGS__); \ | ||
315 | } while (0) | ||
316 | #elif defined(DEBUG) | ||
308 | #define pr_debug(fmt, arg...) \ | 317 | #define pr_debug(fmt, arg...) \ |
309 | printk(KERN_DEBUG fmt, ##arg) | 318 | printk(KERN_DEBUG fmt, ##arg) |
310 | #else | 319 | #else |
diff --git a/include/linux/key.h b/include/linux/key.h index c45c962d1cc5..1b70e35a71e3 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -299,6 +299,7 @@ extern void key_init(void); | |||
299 | #define key_validate(k) 0 | 299 | #define key_validate(k) 0 |
300 | #define key_serial(k) 0 | 300 | #define key_serial(k) 0 |
301 | #define key_get(k) ({ NULL; }) | 301 | #define key_get(k) ({ NULL; }) |
302 | #define key_revoke(k) do { } while(0) | ||
302 | #define key_put(k) do { } while(0) | 303 | #define key_put(k) do { } while(0) |
303 | #define key_ref_put(k) do { } while(0) | 304 | #define key_ref_put(k) do { } while(0) |
304 | #define make_key_ref(k, p) ({ NULL; }) | 305 | #define make_key_ref(k, p) ({ NULL; }) |
diff --git a/include/linux/klist.h b/include/linux/klist.h index 06c338ef7f1b..8ea98db223e5 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -38,7 +38,7 @@ extern void klist_init(struct klist *k, void (*get)(struct klist_node *), | |||
38 | void (*put)(struct klist_node *)); | 38 | void (*put)(struct klist_node *)); |
39 | 39 | ||
40 | struct klist_node { | 40 | struct klist_node { |
41 | struct klist *n_klist; | 41 | void *n_klist; /* never access directly */ |
42 | struct list_head n_node; | 42 | struct list_head n_node; |
43 | struct kref n_ref; | 43 | struct kref n_ref; |
44 | struct completion n_removed; | 44 | struct completion n_removed; |
@@ -57,7 +57,6 @@ extern int klist_node_attached(struct klist_node *n); | |||
57 | 57 | ||
58 | struct klist_iter { | 58 | struct klist_iter { |
59 | struct klist *i_klist; | 59 | struct klist *i_klist; |
60 | struct list_head *i_head; | ||
61 | struct klist_node *i_cur; | 60 | struct klist_node *i_cur; |
62 | }; | 61 | }; |
63 | 62 | ||
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index a1a91577813c..92213a9194e1 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -99,4 +99,7 @@ struct file; | |||
99 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | 99 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], |
100 | struct file **filp); | 100 | struct file **filp); |
101 | 101 | ||
102 | extern int usermodehelper_disable(void); | ||
103 | extern void usermodehelper_enable(void); | ||
104 | |||
102 | #endif /* __LINUX_KMOD_H__ */ | 105 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 70a30651cd12..797fcd781242 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -311,22 +311,33 @@ struct kvm_s390_interrupt { | |||
311 | 311 | ||
312 | /* This structure represents a single trace buffer record. */ | 312 | /* This structure represents a single trace buffer record. */ |
313 | struct kvm_trace_rec { | 313 | struct kvm_trace_rec { |
314 | __u32 event:28; | 314 | /* variable rec_val |
315 | __u32 extra_u32:3; | 315 | * is split into: |
316 | __u32 cycle_in:1; | 316 | * bits 0 - 27 -> event id |
317 | * bits 28 -30 -> number of extra data args of size u32 | ||
318 | * bits 31 -> binary indicator for if tsc is in record | ||
319 | */ | ||
320 | __u32 rec_val; | ||
317 | __u32 pid; | 321 | __u32 pid; |
318 | __u32 vcpu_id; | 322 | __u32 vcpu_id; |
319 | union { | 323 | union { |
320 | struct { | 324 | struct { |
321 | __u64 cycle_u64; | 325 | __u64 timestamp; |
322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 326 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
323 | } __attribute__((packed)) cycle; | 327 | } __attribute__((packed)) timestamp; |
324 | struct { | 328 | struct { |
325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 329 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
326 | } nocycle; | 330 | } notimestamp; |
327 | } u; | 331 | } u; |
328 | }; | 332 | }; |
329 | 333 | ||
334 | #define TRACE_REC_EVENT_ID(val) \ | ||
335 | (0x0fffffff & (val)) | ||
336 | #define TRACE_REC_NUM_DATA_ARGS(val) \ | ||
337 | (0x70000000 & ((val) << 28)) | ||
338 | #define TRACE_REC_TCS(val) \ | ||
339 | (0x80000000 & ((val) << 31)) | ||
340 | |||
330 | #define KVMIO 0xAE | 341 | #define KVMIO 0xAE |
331 | 342 | ||
332 | /* | 343 | /* |
@@ -372,6 +383,10 @@ struct kvm_trace_rec { | |||
372 | #define KVM_CAP_MP_STATE 14 | 383 | #define KVM_CAP_MP_STATE 14 |
373 | #define KVM_CAP_COALESCED_MMIO 15 | 384 | #define KVM_CAP_COALESCED_MMIO 15 |
374 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ | 385 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ |
386 | #if defined(CONFIG_X86)||defined(CONFIG_IA64) | ||
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | ||
388 | #endif | ||
389 | #define KVM_CAP_IOMMU 18 | ||
375 | 390 | ||
376 | /* | 391 | /* |
377 | * ioctls for VM fds | 392 | * ioctls for VM fds |
@@ -401,6 +416,10 @@ struct kvm_trace_rec { | |||
401 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | 416 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
402 | #define KVM_UNREGISTER_COALESCED_MMIO \ | 417 | #define KVM_UNREGISTER_COALESCED_MMIO \ |
403 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | 418 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
419 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | ||
420 | struct kvm_assigned_pci_dev) | ||
421 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | ||
422 | struct kvm_assigned_irq) | ||
404 | 423 | ||
405 | /* | 424 | /* |
406 | * ioctls for vcpu fds | 425 | * ioctls for vcpu fds |
@@ -440,4 +459,45 @@ struct kvm_trace_rec { | |||
440 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 459 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
441 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 460 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
442 | 461 | ||
462 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | ||
463 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | ||
464 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | ||
465 | #define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05) | ||
466 | #define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06) | ||
467 | #define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07) | ||
468 | #define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08) | ||
469 | #define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09) | ||
470 | #define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A) | ||
471 | #define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B) | ||
472 | #define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C) | ||
473 | #define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D) | ||
474 | #define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E) | ||
475 | #define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F) | ||
476 | #define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10) | ||
477 | #define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11) | ||
478 | #define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) | ||
479 | #define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) | ||
480 | #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) | ||
481 | #define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) | ||
482 | #define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16) | ||
483 | #define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17) | ||
484 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) | ||
485 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) | ||
486 | |||
487 | struct kvm_assigned_pci_dev { | ||
488 | __u32 assigned_dev_id; | ||
489 | __u32 busnr; | ||
490 | __u32 devfn; | ||
491 | __u32 flags; | ||
492 | }; | ||
493 | |||
494 | struct kvm_assigned_irq { | ||
495 | __u32 assigned_dev_id; | ||
496 | __u32 host_irq; | ||
497 | __u32 guest_irq; | ||
498 | __u32 flags; | ||
499 | }; | ||
500 | |||
501 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | ||
502 | |||
443 | #endif | 503 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 8525afc53107..3833c48fae3a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #define KVM_REQ_MMU_RELOAD 3 | 34 | #define KVM_REQ_MMU_RELOAD 3 |
35 | #define KVM_REQ_TRIPLE_FAULT 4 | 35 | #define KVM_REQ_TRIPLE_FAULT 4 |
36 | #define KVM_REQ_PENDING_TIMER 5 | 36 | #define KVM_REQ_PENDING_TIMER 5 |
37 | #define KVM_REQ_UNHALT 6 | ||
38 | #define KVM_REQ_MMU_SYNC 7 | ||
37 | 39 | ||
38 | struct kvm_vcpu; | 40 | struct kvm_vcpu; |
39 | extern struct kmem_cache *kvm_vcpu_cache; | 41 | extern struct kmem_cache *kvm_vcpu_cache; |
@@ -279,12 +281,68 @@ void kvm_free_physmem(struct kvm *kvm); | |||
279 | 281 | ||
280 | struct kvm *kvm_arch_create_vm(void); | 282 | struct kvm *kvm_arch_create_vm(void); |
281 | void kvm_arch_destroy_vm(struct kvm *kvm); | 283 | void kvm_arch_destroy_vm(struct kvm *kvm); |
284 | void kvm_free_all_assigned_devices(struct kvm *kvm); | ||
282 | 285 | ||
283 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | 286 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); |
284 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); | 287 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); |
285 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); | 288 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); |
286 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 289 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
287 | 290 | ||
291 | int kvm_is_mmio_pfn(pfn_t pfn); | ||
292 | |||
293 | struct kvm_irq_ack_notifier { | ||
294 | struct hlist_node link; | ||
295 | unsigned gsi; | ||
296 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | ||
297 | }; | ||
298 | |||
299 | struct kvm_assigned_dev_kernel { | ||
300 | struct kvm_irq_ack_notifier ack_notifier; | ||
301 | struct work_struct interrupt_work; | ||
302 | struct list_head list; | ||
303 | int assigned_dev_id; | ||
304 | int host_busnr; | ||
305 | int host_devfn; | ||
306 | int host_irq; | ||
307 | int guest_irq; | ||
308 | int irq_requested; | ||
309 | struct pci_dev *dev; | ||
310 | struct kvm *kvm; | ||
311 | }; | ||
312 | void kvm_set_irq(struct kvm *kvm, int irq, int level); | ||
313 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); | ||
314 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | ||
315 | struct kvm_irq_ack_notifier *kian); | ||
316 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | ||
317 | struct kvm_irq_ack_notifier *kian); | ||
318 | |||
319 | #ifdef CONFIG_DMAR | ||
320 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, | ||
321 | unsigned long npages); | ||
322 | int kvm_iommu_map_guest(struct kvm *kvm, | ||
323 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
324 | int kvm_iommu_unmap_guest(struct kvm *kvm); | ||
325 | #else /* CONFIG_DMAR */ | ||
326 | static inline int kvm_iommu_map_pages(struct kvm *kvm, | ||
327 | gfn_t base_gfn, | ||
328 | unsigned long npages) | ||
329 | { | ||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | static inline int kvm_iommu_map_guest(struct kvm *kvm, | ||
334 | struct kvm_assigned_dev_kernel | ||
335 | *assigned_dev) | ||
336 | { | ||
337 | return -ENODEV; | ||
338 | } | ||
339 | |||
340 | static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | ||
341 | { | ||
342 | return 0; | ||
343 | } | ||
344 | #endif /* CONFIG_DMAR */ | ||
345 | |||
288 | static inline void kvm_guest_enter(void) | 346 | static inline void kvm_guest_enter(void) |
289 | { | 347 | { |
290 | account_system_vtime(current); | 348 | account_system_vtime(current); |
@@ -307,6 +365,11 @@ static inline gpa_t gfn_to_gpa(gfn_t gfn) | |||
307 | return (gpa_t)gfn << PAGE_SHIFT; | 365 | return (gpa_t)gfn << PAGE_SHIFT; |
308 | } | 366 | } |
309 | 367 | ||
368 | static inline hpa_t pfn_to_hpa(pfn_t pfn) | ||
369 | { | ||
370 | return (hpa_t)pfn << PAGE_SHIFT; | ||
371 | } | ||
372 | |||
310 | static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu) | 373 | static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu) |
311 | { | 374 | { |
312 | set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); | 375 | set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); |
@@ -326,6 +389,25 @@ struct kvm_stats_debugfs_item { | |||
326 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 389 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
327 | extern struct dentry *kvm_debugfs_dir; | 390 | extern struct dentry *kvm_debugfs_dir; |
328 | 391 | ||
392 | #define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \ | ||
393 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
394 | vcpu, 5, d1, d2, d3, d4, d5) | ||
395 | #define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \ | ||
396 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
397 | vcpu, 4, d1, d2, d3, d4, 0) | ||
398 | #define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \ | ||
399 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
400 | vcpu, 3, d1, d2, d3, 0, 0) | ||
401 | #define KVMTRACE_2D(evt, vcpu, d1, d2, name) \ | ||
402 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
403 | vcpu, 2, d1, d2, 0, 0, 0) | ||
404 | #define KVMTRACE_1D(evt, vcpu, d1, name) \ | ||
405 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
406 | vcpu, 1, d1, 0, 0, 0, 0) | ||
407 | #define KVMTRACE_0D(evt, vcpu, name) \ | ||
408 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
409 | vcpu, 0, 0, 0, 0, 0, 0) | ||
410 | |||
329 | #ifdef CONFIG_KVM_TRACE | 411 | #ifdef CONFIG_KVM_TRACE |
330 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); | 412 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); |
331 | void kvm_trace_cleanup(void); | 413 | void kvm_trace_cleanup(void); |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 173febac6656..c67fecafff90 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
13 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
14 | #include <linux/fb.h> | ||
14 | 15 | ||
15 | /* Notes on locking: | 16 | /* Notes on locking: |
16 | * | 17 | * |
@@ -45,6 +46,8 @@ struct lcd_ops { | |||
45 | int (*get_contrast)(struct lcd_device *); | 46 | int (*get_contrast)(struct lcd_device *); |
46 | /* Set LCD panel contrast */ | 47 | /* Set LCD panel contrast */ |
47 | int (*set_contrast)(struct lcd_device *, int contrast); | 48 | int (*set_contrast)(struct lcd_device *, int contrast); |
49 | /* Set LCD panel mode (resolutions ...) */ | ||
50 | int (*set_mode)(struct lcd_device *, struct fb_videomode *); | ||
48 | /* Check if given framebuffer device is the one LCD is bound to; | 51 | /* Check if given framebuffer device is the one LCD is bound to; |
49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ | 52 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ |
50 | int (*check_fb)(struct lcd_device *, struct fb_info *); | 53 | int (*check_fb)(struct lcd_device *, struct fb_info *); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 225bfc5bd9ec..947cf84e555d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -146,6 +146,7 @@ enum { | |||
146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ | 146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ |
147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ | 147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ |
148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ | 148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ |
149 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ | ||
149 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, | 150 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, |
150 | 151 | ||
151 | ATA_DFLAG_DETACH = (1 << 24), | 152 | ATA_DFLAG_DETACH = (1 << 24), |
@@ -244,6 +245,7 @@ enum { | |||
244 | ATA_TMOUT_BOOT = 30000, /* heuristic */ | 245 | ATA_TMOUT_BOOT = 30000, /* heuristic */ |
245 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ | 246 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ |
246 | ATA_TMOUT_INTERNAL_QUICK = 5000, | 247 | ATA_TMOUT_INTERNAL_QUICK = 5000, |
248 | ATA_TMOUT_MAX_PARK = 30000, | ||
247 | 249 | ||
248 | /* FIXME: GoVault needs 2s but we can't afford that without | 250 | /* FIXME: GoVault needs 2s but we can't afford that without |
249 | * parallel probing. 800ms is enough for iVDR disk | 251 | * parallel probing. 800ms is enough for iVDR disk |
@@ -319,8 +321,11 @@ enum { | |||
319 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | 321 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, |
320 | ATA_EH_ENABLE_LINK = (1 << 3), | 322 | ATA_EH_ENABLE_LINK = (1 << 3), |
321 | ATA_EH_LPM = (1 << 4), /* link power management action */ | 323 | ATA_EH_LPM = (1 << 4), /* link power management action */ |
324 | ATA_EH_PARK = (1 << 5), /* unload heads and stop I/O */ | ||
322 | 325 | ||
323 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, | 326 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_PARK, |
327 | ATA_EH_ALL_ACTIONS = ATA_EH_REVALIDATE | ATA_EH_RESET | | ||
328 | ATA_EH_ENABLE_LINK | ATA_EH_LPM, | ||
324 | 329 | ||
325 | /* ata_eh_info->flags */ | 330 | /* ata_eh_info->flags */ |
326 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | 331 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ |
@@ -452,6 +457,7 @@ enum link_pm { | |||
452 | MEDIUM_POWER, | 457 | MEDIUM_POWER, |
453 | }; | 458 | }; |
454 | extern struct device_attribute dev_attr_link_power_management_policy; | 459 | extern struct device_attribute dev_attr_link_power_management_policy; |
460 | extern struct device_attribute dev_attr_unload_heads; | ||
455 | extern struct device_attribute dev_attr_em_message_type; | 461 | extern struct device_attribute dev_attr_em_message_type; |
456 | extern struct device_attribute dev_attr_em_message; | 462 | extern struct device_attribute dev_attr_em_message; |
457 | extern struct device_attribute dev_attr_sw_activity; | 463 | extern struct device_attribute dev_attr_sw_activity; |
@@ -554,8 +560,8 @@ struct ata_ering { | |||
554 | struct ata_device { | 560 | struct ata_device { |
555 | struct ata_link *link; | 561 | struct ata_link *link; |
556 | unsigned int devno; /* 0 or 1 */ | 562 | unsigned int devno; /* 0 or 1 */ |
557 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
558 | unsigned int horkage; /* List of broken features */ | 563 | unsigned int horkage; /* List of broken features */ |
564 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
559 | struct scsi_device *sdev; /* attached SCSI device */ | 565 | struct scsi_device *sdev; /* attached SCSI device */ |
560 | #ifdef CONFIG_ATA_ACPI | 566 | #ifdef CONFIG_ATA_ACPI |
561 | acpi_handle acpi_handle; | 567 | acpi_handle acpi_handle; |
@@ -564,6 +570,7 @@ struct ata_device { | |||
564 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 570 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
565 | u64 n_sectors; /* size of device, if ATA */ | 571 | u64 n_sectors; /* size of device, if ATA */ |
566 | unsigned int class; /* ATA_DEV_xxx */ | 572 | unsigned int class; /* ATA_DEV_xxx */ |
573 | unsigned long unpark_deadline; | ||
567 | 574 | ||
568 | u8 pio_mode; | 575 | u8 pio_mode; |
569 | u8 dma_mode; | 576 | u8 dma_mode; |
@@ -621,6 +628,7 @@ struct ata_eh_context { | |||
621 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; | 628 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; |
622 | unsigned int classes[ATA_MAX_DEVICES]; | 629 | unsigned int classes[ATA_MAX_DEVICES]; |
623 | unsigned int did_probe_mask; | 630 | unsigned int did_probe_mask; |
631 | unsigned int unloaded_mask; | ||
624 | unsigned int saved_ncq_enabled; | 632 | unsigned int saved_ncq_enabled; |
625 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; | 633 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; |
626 | /* timestamp for the last reset attempt or success */ | 634 | /* timestamp for the last reset attempt or success */ |
@@ -688,7 +696,8 @@ struct ata_port { | |||
688 | unsigned int qc_active; | 696 | unsigned int qc_active; |
689 | int nr_active_links; /* #links with active qcs */ | 697 | int nr_active_links; /* #links with active qcs */ |
690 | 698 | ||
691 | struct ata_link link; /* host default link */ | 699 | struct ata_link link; /* host default link */ |
700 | struct ata_link *slave_link; /* see ata_slave_link_init() */ | ||
692 | 701 | ||
693 | int nr_pmp_links; /* nr of available PMP links */ | 702 | int nr_pmp_links; /* nr of available PMP links */ |
694 | struct ata_link *pmp_link; /* array of PMP links */ | 703 | struct ata_link *pmp_link; /* array of PMP links */ |
@@ -709,6 +718,7 @@ struct ata_port { | |||
709 | struct list_head eh_done_q; | 718 | struct list_head eh_done_q; |
710 | wait_queue_head_t eh_wait_q; | 719 | wait_queue_head_t eh_wait_q; |
711 | int eh_tries; | 720 | int eh_tries; |
721 | struct completion park_req_pending; | ||
712 | 722 | ||
713 | pm_message_t pm_mesg; | 723 | pm_message_t pm_mesg; |
714 | int *pm_result; | 724 | int *pm_result; |
@@ -772,8 +782,8 @@ struct ata_port_operations { | |||
772 | /* | 782 | /* |
773 | * Optional features | 783 | * Optional features |
774 | */ | 784 | */ |
775 | int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val); | 785 | int (*scr_read)(struct ata_link *link, unsigned int sc_reg, u32 *val); |
776 | int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val); | 786 | int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val); |
777 | void (*pmp_attach)(struct ata_port *ap); | 787 | void (*pmp_attach)(struct ata_port *ap); |
778 | void (*pmp_detach)(struct ata_port *ap); | 788 | void (*pmp_detach)(struct ata_port *ap); |
779 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); | 789 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); |
@@ -895,6 +905,7 @@ extern void ata_port_disable(struct ata_port *); | |||
895 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); | 905 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
896 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | 906 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, |
897 | const struct ata_port_info * const * ppi, int n_ports); | 907 | const struct ata_port_info * const * ppi, int n_ports); |
908 | extern int ata_slave_link_init(struct ata_port *ap); | ||
898 | extern int ata_host_start(struct ata_host *host); | 909 | extern int ata_host_start(struct ata_host *host); |
899 | extern int ata_host_register(struct ata_host *host, | 910 | extern int ata_host_register(struct ata_host *host, |
900 | struct scsi_host_template *sht); | 911 | struct scsi_host_template *sht); |
@@ -920,8 +931,8 @@ extern int sata_scr_valid(struct ata_link *link); | |||
920 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); | 931 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); |
921 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); | 932 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); |
922 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); | 933 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); |
923 | extern int ata_link_online(struct ata_link *link); | 934 | extern bool ata_link_online(struct ata_link *link); |
924 | extern int ata_link_offline(struct ata_link *link); | 935 | extern bool ata_link_offline(struct ata_link *link); |
925 | #ifdef CONFIG_PM | 936 | #ifdef CONFIG_PM |
926 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 937 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
927 | extern void ata_host_resume(struct ata_host *host); | 938 | extern void ata_host_resume(struct ata_host *host); |
@@ -1098,6 +1109,7 @@ extern void ata_std_error_handler(struct ata_port *ap); | |||
1098 | */ | 1109 | */ |
1099 | extern const struct ata_port_operations ata_base_port_ops; | 1110 | extern const struct ata_port_operations ata_base_port_ops; |
1100 | extern const struct ata_port_operations sata_port_ops; | 1111 | extern const struct ata_port_operations sata_port_ops; |
1112 | extern struct device_attribute *ata_common_sdev_attrs[]; | ||
1101 | 1113 | ||
1102 | #define ATA_BASE_SHT(drv_name) \ | 1114 | #define ATA_BASE_SHT(drv_name) \ |
1103 | .module = THIS_MODULE, \ | 1115 | .module = THIS_MODULE, \ |
@@ -1112,7 +1124,8 @@ extern const struct ata_port_operations sata_port_ops; | |||
1112 | .proc_name = drv_name, \ | 1124 | .proc_name = drv_name, \ |
1113 | .slave_configure = ata_scsi_slave_config, \ | 1125 | .slave_configure = ata_scsi_slave_config, \ |
1114 | .slave_destroy = ata_scsi_slave_destroy, \ | 1126 | .slave_destroy = ata_scsi_slave_destroy, \ |
1115 | .bios_param = ata_std_bios_param | 1127 | .bios_param = ata_std_bios_param, \ |
1128 | .sdev_attrs = ata_common_sdev_attrs | ||
1116 | 1129 | ||
1117 | #define ATA_NCQ_SHT(drv_name) \ | 1130 | #define ATA_NCQ_SHT(drv_name) \ |
1118 | ATA_BASE_SHT(drv_name), \ | 1131 | ATA_BASE_SHT(drv_name), \ |
@@ -1134,7 +1147,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap) | |||
1134 | 1147 | ||
1135 | static inline int ata_is_host_link(const struct ata_link *link) | 1148 | static inline int ata_is_host_link(const struct ata_link *link) |
1136 | { | 1149 | { |
1137 | return link == &link->ap->link; | 1150 | return link == &link->ap->link || link == link->ap->slave_link; |
1138 | } | 1151 | } |
1139 | #else /* CONFIG_SATA_PMP */ | 1152 | #else /* CONFIG_SATA_PMP */ |
1140 | static inline bool sata_pmp_supported(struct ata_port *ap) | 1153 | static inline bool sata_pmp_supported(struct ata_port *ap) |
@@ -1167,7 +1180,7 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1167 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1180 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) |
1168 | 1181 | ||
1169 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1182 | #define ata_link_printk(link, lv, fmt, args...) do { \ |
1170 | if (sata_pmp_attached((link)->ap)) \ | 1183 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ |
1171 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1184 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ |
1172 | (link)->pmp , ##args); \ | 1185 | (link)->pmp , ##args); \ |
1173 | else \ | 1186 | else \ |
@@ -1265,34 +1278,17 @@ static inline int ata_link_active(struct ata_link *link) | |||
1265 | return ata_tag_valid(link->active_tag) || link->sactive; | 1278 | return ata_tag_valid(link->active_tag) || link->sactive; |
1266 | } | 1279 | } |
1267 | 1280 | ||
1268 | static inline struct ata_link *ata_port_first_link(struct ata_port *ap) | 1281 | extern struct ata_link *__ata_port_next_link(struct ata_port *ap, |
1269 | { | 1282 | struct ata_link *link, |
1270 | if (sata_pmp_attached(ap)) | 1283 | bool dev_only); |
1271 | return ap->pmp_link; | ||
1272 | return &ap->link; | ||
1273 | } | ||
1274 | |||
1275 | static inline struct ata_link *ata_port_next_link(struct ata_link *link) | ||
1276 | { | ||
1277 | struct ata_port *ap = link->ap; | ||
1278 | |||
1279 | if (ata_is_host_link(link)) { | ||
1280 | if (!sata_pmp_attached(ap)) | ||
1281 | return NULL; | ||
1282 | return ap->pmp_link; | ||
1283 | } | ||
1284 | |||
1285 | if (++link < ap->nr_pmp_links + ap->pmp_link) | ||
1286 | return link; | ||
1287 | return NULL; | ||
1288 | } | ||
1289 | 1284 | ||
1290 | #define __ata_port_for_each_link(lk, ap) \ | 1285 | #define __ata_port_for_each_link(link, ap) \ |
1291 | for ((lk) = &(ap)->link; (lk); (lk) = ata_port_next_link(lk)) | 1286 | for ((link) = __ata_port_next_link((ap), NULL, false); (link); \ |
1287 | (link) = __ata_port_next_link((ap), (link), false)) | ||
1292 | 1288 | ||
1293 | #define ata_port_for_each_link(link, ap) \ | 1289 | #define ata_port_for_each_link(link, ap) \ |
1294 | for ((link) = ata_port_first_link(ap); (link); \ | 1290 | for ((link) = __ata_port_next_link((ap), NULL, true); (link); \ |
1295 | (link) = ata_port_next_link(link)) | 1291 | (link) = __ata_port_next_link((ap), (link), true)) |
1296 | 1292 | ||
1297 | #define ata_link_for_each_dev(dev, link) \ | 1293 | #define ata_link_for_each_dev(dev, link) \ |
1298 | for ((dev) = (link)->device; \ | 1294 | for ((dev) = (link)->device; \ |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 3d25bcd139d1..e5872dc994c0 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -27,7 +27,6 @@ struct nlmsvc_binding { | |||
27 | struct nfs_fh *, | 27 | struct nfs_fh *, |
28 | struct file **); | 28 | struct file **); |
29 | void (*fclose)(struct file *); | 29 | void (*fclose)(struct file *); |
30 | unsigned long (*get_grace_period)(void); | ||
31 | }; | 30 | }; |
32 | 31 | ||
33 | extern struct nlmsvc_binding * nlmsvc_ops; | 32 | extern struct nlmsvc_binding * nlmsvc_ops; |
@@ -53,15 +52,7 @@ extern void nlmclnt_done(struct nlm_host *host); | |||
53 | 52 | ||
54 | extern int nlmclnt_proc(struct nlm_host *host, int cmd, | 53 | extern int nlmclnt_proc(struct nlm_host *host, int cmd, |
55 | struct file_lock *fl); | 54 | struct file_lock *fl); |
56 | extern int lockd_up(int proto); | 55 | extern int lockd_up(void); |
57 | extern void lockd_down(void); | 56 | extern void lockd_down(void); |
58 | 57 | ||
59 | unsigned long get_nfs_grace_period(void); | ||
60 | |||
61 | #ifdef CONFIG_NFSD_V4 | ||
62 | unsigned long get_nfs4_grace_period(void); | ||
63 | #else | ||
64 | static inline unsigned long get_nfs4_grace_period(void) {return 0;} | ||
65 | #endif | ||
66 | |||
67 | #endif /* LINUX_LOCKD_BIND_H */ | 58 | #endif /* LINUX_LOCKD_BIND_H */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index dbb87ab282e8..b56d5aa9b194 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | 13 | ||
14 | #include <linux/in.h> | 14 | #include <linux/in.h> |
15 | #include <linux/in6.h> | ||
16 | #include <net/ipv6.h> | ||
15 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
16 | #include <linux/kref.h> | 18 | #include <linux/kref.h> |
17 | #include <linux/utsname.h> | 19 | #include <linux/utsname.h> |
@@ -38,8 +40,9 @@ | |||
38 | */ | 40 | */ |
39 | struct nlm_host { | 41 | struct nlm_host { |
40 | struct hlist_node h_hash; /* doubly linked list */ | 42 | struct hlist_node h_hash; /* doubly linked list */ |
41 | struct sockaddr_in h_addr; /* peer address */ | 43 | struct sockaddr_storage h_addr; /* peer address */ |
42 | struct sockaddr_in h_saddr; /* our address (optional) */ | 44 | size_t h_addrlen; |
45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ | ||
43 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 46 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ |
44 | char * h_name; /* remote hostname */ | 47 | char * h_name; /* remote hostname */ |
45 | u32 h_version; /* interface version */ | 48 | u32 h_version; /* interface version */ |
@@ -61,18 +64,56 @@ struct nlm_host { | |||
61 | struct list_head h_granted; /* Locks in GRANTED state */ | 64 | struct list_head h_granted; /* Locks in GRANTED state */ |
62 | struct list_head h_reclaim; /* Locks in RECLAIM state */ | 65 | struct list_head h_reclaim; /* Locks in RECLAIM state */ |
63 | struct nsm_handle * h_nsmhandle; /* NSM status handle */ | 66 | struct nsm_handle * h_nsmhandle; /* NSM status handle */ |
67 | |||
68 | char h_addrbuf[48], /* address eyecatchers */ | ||
69 | h_srcaddrbuf[48]; | ||
64 | }; | 70 | }; |
65 | 71 | ||
66 | struct nsm_handle { | 72 | struct nsm_handle { |
67 | struct list_head sm_link; | 73 | struct list_head sm_link; |
68 | atomic_t sm_count; | 74 | atomic_t sm_count; |
69 | char * sm_name; | 75 | char * sm_name; |
70 | struct sockaddr_in sm_addr; | 76 | struct sockaddr_storage sm_addr; |
77 | size_t sm_addrlen; | ||
71 | unsigned int sm_monitored : 1, | 78 | unsigned int sm_monitored : 1, |
72 | sm_sticky : 1; /* don't unmonitor */ | 79 | sm_sticky : 1; /* don't unmonitor */ |
80 | char sm_addrbuf[48]; /* address eyecatcher */ | ||
73 | }; | 81 | }; |
74 | 82 | ||
75 | /* | 83 | /* |
84 | * Rigorous type checking on sockaddr type conversions | ||
85 | */ | ||
86 | static inline struct sockaddr_in *nlm_addr_in(const struct nlm_host *host) | ||
87 | { | ||
88 | return (struct sockaddr_in *)&host->h_addr; | ||
89 | } | ||
90 | |||
91 | static inline struct sockaddr *nlm_addr(const struct nlm_host *host) | ||
92 | { | ||
93 | return (struct sockaddr *)&host->h_addr; | ||
94 | } | ||
95 | |||
96 | static inline struct sockaddr_in *nlm_srcaddr_in(const struct nlm_host *host) | ||
97 | { | ||
98 | return (struct sockaddr_in *)&host->h_srcaddr; | ||
99 | } | ||
100 | |||
101 | static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) | ||
102 | { | ||
103 | return (struct sockaddr *)&host->h_srcaddr; | ||
104 | } | ||
105 | |||
106 | static inline struct sockaddr_in *nsm_addr_in(const struct nsm_handle *handle) | ||
107 | { | ||
108 | return (struct sockaddr_in *)&handle->sm_addr; | ||
109 | } | ||
110 | |||
111 | static inline struct sockaddr *nsm_addr(const struct nsm_handle *handle) | ||
112 | { | ||
113 | return (struct sockaddr *)&handle->sm_addr; | ||
114 | } | ||
115 | |||
116 | /* | ||
76 | * Map an fl_owner_t into a unique 32-bit "pid" | 117 | * Map an fl_owner_t into a unique 32-bit "pid" |
77 | */ | 118 | */ |
78 | struct nlm_lockowner { | 119 | struct nlm_lockowner { |
@@ -166,7 +207,8 @@ int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); | |||
166 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); | 207 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); |
167 | void nlmclnt_finish_block(struct nlm_wait *block); | 208 | void nlmclnt_finish_block(struct nlm_wait *block); |
168 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); | 209 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); |
169 | __be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); | 210 | __be32 nlmclnt_grant(const struct sockaddr *addr, |
211 | const struct nlm_lock *lock); | ||
170 | void nlmclnt_recovery(struct nlm_host *); | 212 | void nlmclnt_recovery(struct nlm_host *); |
171 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 213 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); |
172 | void nlmclnt_next_cookie(struct nlm_cookie *); | 214 | void nlmclnt_next_cookie(struct nlm_cookie *); |
@@ -174,12 +216,14 @@ void nlmclnt_next_cookie(struct nlm_cookie *); | |||
174 | /* | 216 | /* |
175 | * Host cache | 217 | * Host cache |
176 | */ | 218 | */ |
177 | struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin, | 219 | struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, |
178 | int proto, u32 version, | 220 | const size_t salen, |
221 | const unsigned short protocol, | ||
222 | const u32 version, | ||
223 | const char *hostname); | ||
224 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, | ||
179 | const char *hostname, | 225 | const char *hostname, |
180 | unsigned int hostname_len); | 226 | const size_t hostname_len); |
181 | struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *, | ||
182 | unsigned int); | ||
183 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); | 227 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); |
184 | void nlm_rebind_host(struct nlm_host *); | 228 | void nlm_rebind_host(struct nlm_host *); |
185 | struct nlm_host * nlm_get_host(struct nlm_host *); | 229 | struct nlm_host * nlm_get_host(struct nlm_host *); |
@@ -201,7 +245,7 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref); | |||
201 | */ | 245 | */ |
202 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | 246 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, |
203 | struct nlm_host *, struct nlm_lock *, int, | 247 | struct nlm_host *, struct nlm_lock *, int, |
204 | struct nlm_cookie *); | 248 | struct nlm_cookie *, int); |
205 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 249 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
206 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, | 250 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, |
207 | struct nlm_host *, struct nlm_lock *, | 251 | struct nlm_host *, struct nlm_lock *, |
@@ -233,15 +277,82 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) | |||
233 | return file->f_file->f_path.dentry->d_inode; | 277 | return file->f_file->f_path.dentry->d_inode; |
234 | } | 278 | } |
235 | 279 | ||
280 | static inline int __nlm_privileged_request4(const struct sockaddr *sap) | ||
281 | { | ||
282 | const struct sockaddr_in *sin = (struct sockaddr_in *)sap; | ||
283 | return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && | ||
284 | (ntohs(sin->sin_port) < 1024); | ||
285 | } | ||
286 | |||
287 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
288 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | ||
289 | { | ||
290 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; | ||
291 | return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) && | ||
292 | (ntohs(sin6->sin6_port) < 1024); | ||
293 | } | ||
294 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | ||
295 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | ||
296 | { | ||
297 | return 0; | ||
298 | } | ||
299 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | ||
300 | |||
236 | /* | 301 | /* |
237 | * Compare two host addresses (needs modifying for ipv6) | 302 | * Ensure incoming requests are from local privileged callers. |
303 | * | ||
304 | * Return TRUE if sender is local and is connecting via a privileged port; | ||
305 | * otherwise return FALSE. | ||
238 | */ | 306 | */ |
239 | static inline int nlm_cmp_addr(const struct sockaddr_in *sin1, | 307 | static inline int nlm_privileged_requester(const struct svc_rqst *rqstp) |
240 | const struct sockaddr_in *sin2) | ||
241 | { | 308 | { |
309 | const struct sockaddr *sap = svc_addr(rqstp); | ||
310 | |||
311 | switch (sap->sa_family) { | ||
312 | case AF_INET: | ||
313 | return __nlm_privileged_request4(sap); | ||
314 | case AF_INET6: | ||
315 | return __nlm_privileged_request6(sap); | ||
316 | default: | ||
317 | return 0; | ||
318 | } | ||
319 | } | ||
320 | |||
321 | static inline int __nlm_cmp_addr4(const struct sockaddr *sap1, | ||
322 | const struct sockaddr *sap2) | ||
323 | { | ||
324 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
325 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
242 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | 326 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; |
243 | } | 327 | } |
244 | 328 | ||
329 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
330 | const struct sockaddr *sap2) | ||
331 | { | ||
332 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
333 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
334 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
335 | } | ||
336 | |||
337 | /* | ||
338 | * Compare two host addresses | ||
339 | * | ||
340 | * Return TRUE if the addresses are the same; otherwise FALSE. | ||
341 | */ | ||
342 | static inline int nlm_cmp_addr(const struct sockaddr *sap1, | ||
343 | const struct sockaddr *sap2) | ||
344 | { | ||
345 | if (sap1->sa_family == sap2->sa_family) { | ||
346 | switch (sap1->sa_family) { | ||
347 | case AF_INET: | ||
348 | return __nlm_cmp_addr4(sap1, sap2); | ||
349 | case AF_INET6: | ||
350 | return __nlm_cmp_addr6(sap1, sap2); | ||
351 | } | ||
352 | } | ||
353 | return 0; | ||
354 | } | ||
355 | |||
245 | /* | 356 | /* |
246 | * Compare two NLM locks. | 357 | * Compare two NLM locks. |
247 | * When the second lock is of type F_UNLCK, this acts like a wildcard. | 358 | * When the second lock is of type F_UNLCK, this acts like a wildcard. |
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h index df18fa053bcd..d6b3a802c046 100644 --- a/include/linux/lockd/xdr.h +++ b/include/linux/lockd/xdr.h | |||
@@ -81,8 +81,6 @@ struct nlm_reboot { | |||
81 | unsigned int len; | 81 | unsigned int len; |
82 | u32 state; | 82 | u32 state; |
83 | __be32 addr; | 83 | __be32 addr; |
84 | __be32 vers; | ||
85 | __be32 proto; | ||
86 | }; | 84 | }; |
87 | 85 | ||
88 | /* | 86 | /* |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1fa0c2ce4dec..f7f3fdddbef0 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -6,6 +6,10 @@ | |||
6 | #define AFS_SUPER_MAGIC 0x5346414F | 6 | #define AFS_SUPER_MAGIC 0x5346414F |
7 | #define AUTOFS_SUPER_MAGIC 0x0187 | 7 | #define AUTOFS_SUPER_MAGIC 0x0187 |
8 | #define CODA_SUPER_MAGIC 0x73757245 | 8 | #define CODA_SUPER_MAGIC 0x73757245 |
9 | #define DEBUGFS_MAGIC 0x64626720 | ||
10 | #define SYSFS_MAGIC 0x62656572 | ||
11 | #define SECURITYFS_MAGIC 0x73636673 | ||
12 | #define TMPFS_MAGIC 0x01021994 | ||
9 | #define EFS_SUPER_MAGIC 0x414A53 | 13 | #define EFS_SUPER_MAGIC 0x414A53 |
10 | #define EXT2_SUPER_MAGIC 0xEF53 | 14 | #define EXT2_SUPER_MAGIC 0xEF53 |
11 | #define EXT3_SUPER_MAGIC 0xEF53 | 15 | #define EXT3_SUPER_MAGIC 0xEF53 |
diff --git a/include/linux/major.h b/include/linux/major.h index 53d5fafd85c3..88249452b935 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -170,4 +170,6 @@ | |||
170 | 170 | ||
171 | #define VIOTAPE_MAJOR 230 | 171 | #define VIOTAPE_MAJOR 230 |
172 | 172 | ||
173 | #define BLOCK_EXT_MAJOR 259 | ||
174 | |||
173 | #endif | 175 | #endif |
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h new file mode 100644 index 000000000000..7df8432c4402 --- /dev/null +++ b/include/linux/map_to_7segment.h | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef MAP_TO_7SEGMENT_H | ||
20 | #define MAP_TO_7SEGMENT_H | ||
21 | |||
22 | /* This file provides translation primitives and tables for the conversion | ||
23 | * of (ASCII) characters to a 7-segments notation. | ||
24 | * | ||
25 | * The 7 segment's wikipedia notation below is used as standard. | ||
26 | * See: http://en.wikipedia.org/wiki/Seven_segment_display | ||
27 | * | ||
28 | * Notation: +-a-+ | ||
29 | * f b | ||
30 | * +-g-+ | ||
31 | * e c | ||
32 | * +-d-+ | ||
33 | * | ||
34 | * Usage: | ||
35 | * | ||
36 | * Register a map variable, and fill it with a character set: | ||
37 | * static SEG7_DEFAULT_MAP(map_seg7); | ||
38 | * | ||
39 | * | ||
40 | * Then use for conversion: | ||
41 | * seg7 = map_to_seg7(&map_seg7, some_char); | ||
42 | * ... | ||
43 | * | ||
44 | * In device drivers it is recommended, if required, to make the char map | ||
45 | * accessible via the sysfs interface using the following scheme: | ||
46 | * | ||
47 | * static ssize_t show_map(struct device *dev, char *buf) { | ||
48 | * memcpy(buf, &map_seg7, sizeof(map_seg7)); | ||
49 | * return sizeof(map_seg7); | ||
50 | * } | ||
51 | * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) { | ||
52 | * if(cnt != sizeof(map_seg7)) | ||
53 | * return -EINVAL; | ||
54 | * memcpy(&map_seg7, buf, cnt); | ||
55 | * return cnt; | ||
56 | * } | ||
57 | * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map); | ||
58 | * | ||
59 | * History: | ||
60 | * 2005-05-31 RFC linux-kernel@vger.kernel.org | ||
61 | */ | ||
62 | #include <linux/errno.h> | ||
63 | |||
64 | |||
65 | #define BIT_SEG7_A 0 | ||
66 | #define BIT_SEG7_B 1 | ||
67 | #define BIT_SEG7_C 2 | ||
68 | #define BIT_SEG7_D 3 | ||
69 | #define BIT_SEG7_E 4 | ||
70 | #define BIT_SEG7_F 5 | ||
71 | #define BIT_SEG7_G 6 | ||
72 | #define BIT_SEG7_RESERVED 7 | ||
73 | |||
74 | struct seg7_conversion_map { | ||
75 | unsigned char table[128]; | ||
76 | }; | ||
77 | |||
78 | static inline int map_to_seg7(struct seg7_conversion_map *map, int c) | ||
79 | { | ||
80 | return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; | ||
81 | } | ||
82 | |||
83 | #define SEG7_CONVERSION_MAP(_name, _map) \ | ||
84 | struct seg7_conversion_map _name = { .table = { _map } } | ||
85 | |||
86 | /* | ||
87 | * It is recommended to use a facility that allows user space to redefine | ||
88 | * custom character sets for LCD devices. Please use a sysfs interface | ||
89 | * as described above. | ||
90 | */ | ||
91 | #define MAP_TO_SEG7_SYSFS_FILE "map_seg7" | ||
92 | |||
93 | /******************************************************************************* | ||
94 | * ASCII conversion table | ||
95 | ******************************************************************************/ | ||
96 | |||
97 | #define _SEG7(l,a,b,c,d,e,f,g) \ | ||
98 | ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \ | ||
99 | e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G ) | ||
100 | |||
101 | #define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
102 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
103 | |||
104 | #define _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
105 | _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\ | ||
106 | _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\ | ||
107 | _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\ | ||
108 | _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\ | ||
109 | _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1), | ||
110 | |||
111 | #define _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
112 | _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\ | ||
113 | _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\ | ||
114 | _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\ | ||
115 | _SEG7('9',1,1,1,1,0,1,1), | ||
116 | |||
117 | #define _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
118 | _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\ | ||
119 | _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\ | ||
120 | _SEG7('@',1,1,0,1,1,1,1), | ||
121 | |||
122 | #define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
123 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\ | ||
124 | _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
125 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\ | ||
126 | _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
127 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\ | ||
128 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\ | ||
129 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\ | ||
130 | _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
131 | _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
132 | |||
133 | #define _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
134 | _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\ | ||
135 | _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0), | ||
136 | |||
137 | #define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
138 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\ | ||
139 | _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
140 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\ | ||
141 | _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
142 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\ | ||
143 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\ | ||
144 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\ | ||
145 | _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
146 | _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
147 | |||
148 | #define _MAP_123_126_ASCII_SEG7_SYMBOL \ | ||
149 | _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\ | ||
150 | _SEG7('~',1,0,0,0,0,0,0), | ||
151 | |||
152 | /* Maps */ | ||
153 | |||
154 | /* This set tries to map as close as possible to the visible characteristics | ||
155 | * of the ASCII symbol, lowercase and uppercase letters may differ in | ||
156 | * presentation on the display. | ||
157 | */ | ||
158 | #define MAP_ASCII7SEG_ALPHANUM \ | ||
159 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
160 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
161 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
162 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
163 | _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
164 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
165 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
166 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
167 | |||
168 | /* This set tries to map as close as possible to the symbolic characteristics | ||
169 | * of the ASCII character for maximum discrimination. | ||
170 | * For now this means all alpha chars are in lower case representations. | ||
171 | * (This for example facilitates the use of hex numbers with uppercase input.) | ||
172 | */ | ||
173 | #define MAP_ASCII7SEG_ALPHANUM_LC \ | ||
174 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
175 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
176 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
177 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
178 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
179 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
180 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
181 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
182 | |||
183 | #define SEG7_DEFAULT_MAP(_name) \ | ||
184 | SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM) | ||
185 | |||
186 | #endif /* MAP_TO_7SEGMENT_H */ | ||
187 | |||
diff --git a/include/linux/memstick.h b/include/linux/memstick.h index a9f998a3f48b..d0c37e682234 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h | |||
@@ -21,30 +21,30 @@ | |||
21 | struct ms_status_register { | 21 | struct ms_status_register { |
22 | unsigned char reserved; | 22 | unsigned char reserved; |
23 | unsigned char interrupt; | 23 | unsigned char interrupt; |
24 | #define MEMSTICK_INT_CMDNAK 0x0001 | 24 | #define MEMSTICK_INT_CMDNAK 0x01 |
25 | #define MEMSTICK_INT_IOREQ 0x0008 | 25 | #define MEMSTICK_INT_IOREQ 0x08 |
26 | #define MEMSTICK_INT_IOBREQ 0x0010 | 26 | #define MEMSTICK_INT_IOBREQ 0x10 |
27 | #define MEMSTICK_INT_BREQ 0x0020 | 27 | #define MEMSTICK_INT_BREQ 0x20 |
28 | #define MEMSTICK_INT_ERR 0x0040 | 28 | #define MEMSTICK_INT_ERR 0x40 |
29 | #define MEMSTICK_INT_CED 0x0080 | 29 | #define MEMSTICK_INT_CED 0x80 |
30 | 30 | ||
31 | unsigned char status0; | 31 | unsigned char status0; |
32 | #define MEMSTICK_STATUS0_WP 0x0001 | 32 | #define MEMSTICK_STATUS0_WP 0x01 |
33 | #define MEMSTICK_STATUS0_SL 0x0002 | 33 | #define MEMSTICK_STATUS0_SL 0x02 |
34 | #define MEMSTICK_STATUS0_BF 0x0010 | 34 | #define MEMSTICK_STATUS0_BF 0x10 |
35 | #define MEMSTICK_STATUS0_BE 0x0020 | 35 | #define MEMSTICK_STATUS0_BE 0x20 |
36 | #define MEMSTICK_STATUS0_FB0 0x0040 | 36 | #define MEMSTICK_STATUS0_FB0 0x40 |
37 | #define MEMSTICK_STATUS0_MB 0x0080 | 37 | #define MEMSTICK_STATUS0_MB 0x80 |
38 | 38 | ||
39 | unsigned char status1; | 39 | unsigned char status1; |
40 | #define MEMSTICK_STATUS1_UCFG 0x0001 | 40 | #define MEMSTICK_STATUS1_UCFG 0x01 |
41 | #define MEMSTICK_STATUS1_FGER 0x0002 | 41 | #define MEMSTICK_STATUS1_FGER 0x02 |
42 | #define MEMSTICK_STATUS1_UCEX 0x0004 | 42 | #define MEMSTICK_STATUS1_UCEX 0x04 |
43 | #define MEMSTICK_STATUS1_EXER 0x0008 | 43 | #define MEMSTICK_STATUS1_EXER 0x08 |
44 | #define MEMSTICK_STATUS1_UCDT 0x0010 | 44 | #define MEMSTICK_STATUS1_UCDT 0x10 |
45 | #define MEMSTICK_STATUS1_DTER 0x0020 | 45 | #define MEMSTICK_STATUS1_DTER 0x20 |
46 | #define MEMSTICK_STATUS1_FBI 0x0040 | 46 | #define MEMSTICK_STATUS1_FB1 0x40 |
47 | #define MEMSTICK_STATUS1_MB 0x0080 | 47 | #define MEMSTICK_STATUS1_MB 0x80 |
48 | } __attribute__((packed)); | 48 | } __attribute__((packed)); |
49 | 49 | ||
50 | struct ms_id_register { | 50 | struct ms_id_register { |
@@ -56,32 +56,32 @@ struct ms_id_register { | |||
56 | 56 | ||
57 | struct ms_param_register { | 57 | struct ms_param_register { |
58 | unsigned char system; | 58 | unsigned char system; |
59 | #define MEMSTICK_SYS_ATEN 0xc0 | ||
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
61 | #define MEMSTICK_SYS_PAM 0x08 | 59 | #define MEMSTICK_SYS_PAM 0x08 |
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
62 | 61 | ||
63 | unsigned char block_address_msb; | 62 | unsigned char block_address_msb; |
64 | unsigned short block_address; | 63 | unsigned short block_address; |
65 | unsigned char cp; | 64 | unsigned char cp; |
66 | #define MEMSTICK_CP_BLOCK 0x0000 | 65 | #define MEMSTICK_CP_BLOCK 0x00 |
67 | #define MEMSTICK_CP_PAGE 0x0020 | 66 | #define MEMSTICK_CP_PAGE 0x20 |
68 | #define MEMSTICK_CP_EXTRA 0x0040 | 67 | #define MEMSTICK_CP_EXTRA 0x40 |
69 | #define MEMSTICK_CP_OVERWRITE 0x0080 | 68 | #define MEMSTICK_CP_OVERWRITE 0x80 |
70 | 69 | ||
71 | unsigned char page_address; | 70 | unsigned char page_address; |
72 | } __attribute__((packed)); | 71 | } __attribute__((packed)); |
73 | 72 | ||
74 | struct ms_extra_data_register { | 73 | struct ms_extra_data_register { |
75 | unsigned char overwrite_flag; | 74 | unsigned char overwrite_flag; |
76 | #define MEMSTICK_OVERWRITE_UPDATA 0x0010 | 75 | #define MEMSTICK_OVERWRITE_UDST 0x10 |
77 | #define MEMSTICK_OVERWRITE_PAGE 0x0060 | 76 | #define MEMSTICK_OVERWRITE_PGST1 0x20 |
78 | #define MEMSTICK_OVERWRITE_BLOCK 0x0080 | 77 | #define MEMSTICK_OVERWRITE_PGST0 0x40 |
78 | #define MEMSTICK_OVERWRITE_BKST 0x80 | ||
79 | 79 | ||
80 | unsigned char management_flag; | 80 | unsigned char management_flag; |
81 | #define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 | 81 | #define MEMSTICK_MANAGEMENT_SYSFLG 0x04 |
82 | #define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 | 82 | #define MEMSTICK_MANAGEMENT_ATFLG 0x08 |
83 | #define MEMSTICK_MANAGEMENT_COPY 0x0010 | 83 | #define MEMSTICK_MANAGEMENT_SCMS1 0x10 |
84 | #define MEMSTICK_MANAGEMENT_ACCESS 0x0020 | 84 | #define MEMSTICK_MANAGEMENT_SCMS0 0x20 |
85 | 85 | ||
86 | unsigned short logical_address; | 86 | unsigned short logical_address; |
87 | } __attribute__((packed)); | 87 | } __attribute__((packed)); |
@@ -96,9 +96,9 @@ struct ms_register { | |||
96 | 96 | ||
97 | struct mspro_param_register { | 97 | struct mspro_param_register { |
98 | unsigned char system; | 98 | unsigned char system; |
99 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
100 | #define MEMSTICK_SYS_PAR4 0x00 | 99 | #define MEMSTICK_SYS_PAR4 0x00 |
101 | #define MEMSTICK_SYS_PAR8 0x40 | 100 | #define MEMSTICK_SYS_PAR8 0x40 |
101 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
102 | 102 | ||
103 | unsigned short data_count; | 103 | unsigned short data_count; |
104 | unsigned int data_address; | 104 | unsigned int data_address; |
@@ -147,7 +147,7 @@ struct ms_register_addr { | |||
147 | unsigned char w_length; | 147 | unsigned char w_length; |
148 | } __attribute__((packed)); | 148 | } __attribute__((packed)); |
149 | 149 | ||
150 | enum { | 150 | enum memstick_tpc { |
151 | MS_TPC_READ_MG_STATUS = 0x01, | 151 | MS_TPC_READ_MG_STATUS = 0x01, |
152 | MS_TPC_READ_LONG_DATA = 0x02, | 152 | MS_TPC_READ_LONG_DATA = 0x02, |
153 | MS_TPC_READ_SHORT_DATA = 0x03, | 153 | MS_TPC_READ_SHORT_DATA = 0x03, |
@@ -167,7 +167,7 @@ enum { | |||
167 | MS_TPC_SET_CMD = 0x0e | 167 | MS_TPC_SET_CMD = 0x0e |
168 | }; | 168 | }; |
169 | 169 | ||
170 | enum { | 170 | enum memstick_command { |
171 | MS_CMD_BLOCK_END = 0x33, | 171 | MS_CMD_BLOCK_END = 0x33, |
172 | MS_CMD_RESET = 0x3c, | 172 | MS_CMD_RESET = 0x3c, |
173 | MS_CMD_BLOCK_WRITE = 0x55, | 173 | MS_CMD_BLOCK_WRITE = 0x55, |
@@ -201,8 +201,6 @@ enum { | |||
201 | 201 | ||
202 | /*** Driver structures and functions ***/ | 202 | /*** Driver structures and functions ***/ |
203 | 203 | ||
204 | #define MEMSTICK_PART_SHIFT 3 | ||
205 | |||
206 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | 204 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; |
207 | 205 | ||
208 | #define MEMSTICK_POWER_OFF 0 | 206 | #define MEMSTICK_POWER_OFF 0 |
@@ -215,24 +213,27 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | |||
215 | struct memstick_host; | 213 | struct memstick_host; |
216 | struct memstick_driver; | 214 | struct memstick_driver; |
217 | 215 | ||
216 | struct memstick_device_id { | ||
217 | unsigned char match_flags; | ||
218 | #define MEMSTICK_MATCH_ALL 0x01 | 218 | #define MEMSTICK_MATCH_ALL 0x01 |
219 | 219 | ||
220 | unsigned char type; | ||
220 | #define MEMSTICK_TYPE_LEGACY 0xff | 221 | #define MEMSTICK_TYPE_LEGACY 0xff |
221 | #define MEMSTICK_TYPE_DUO 0x00 | 222 | #define MEMSTICK_TYPE_DUO 0x00 |
222 | #define MEMSTICK_TYPE_PRO 0x01 | 223 | #define MEMSTICK_TYPE_PRO 0x01 |
223 | 224 | ||
225 | unsigned char category; | ||
224 | #define MEMSTICK_CATEGORY_STORAGE 0xff | 226 | #define MEMSTICK_CATEGORY_STORAGE 0xff |
225 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 | 227 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 |
228 | #define MEMSTICK_CATEGORY_IO 0x01 | ||
229 | #define MEMSTICK_CATEGORY_IO_PRO 0x10 | ||
226 | 230 | ||
227 | #define MEMSTICK_CLASS_GENERIC 0xff | ||
228 | #define MEMSTICK_CLASS_GENERIC_DUO 0x00 | ||
229 | |||
230 | |||
231 | struct memstick_device_id { | ||
232 | unsigned char match_flags; | ||
233 | unsigned char type; | ||
234 | unsigned char category; | ||
235 | unsigned char class; | 231 | unsigned char class; |
232 | #define MEMSTICK_CLASS_FLASH 0xff | ||
233 | #define MEMSTICK_CLASS_DUO 0x00 | ||
234 | #define MEMSTICK_CLASS_ROM 0x01 | ||
235 | #define MEMSTICK_CLASS_RO 0x02 | ||
236 | #define MEMSTICK_CLASS_WP 0x03 | ||
236 | }; | 237 | }; |
237 | 238 | ||
238 | struct memstick_request { | 239 | struct memstick_request { |
@@ -319,9 +320,9 @@ void memstick_suspend_host(struct memstick_host *host); | |||
319 | void memstick_resume_host(struct memstick_host *host); | 320 | void memstick_resume_host(struct memstick_host *host); |
320 | 321 | ||
321 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, | 322 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, |
322 | struct scatterlist *sg); | 323 | const struct scatterlist *sg); |
323 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, | 324 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, |
324 | void *buf, size_t length); | 325 | const void *buf, size_t length); |
325 | int memstick_next_req(struct memstick_host *host, | 326 | int memstick_next_req(struct memstick_host *host, |
326 | struct memstick_request **mrq); | 327 | struct memstick_request **mrq); |
327 | void memstick_new_req(struct memstick_host *host); | 328 | void memstick_new_req(struct memstick_host *host); |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index ec612e66391c..516d955ab8a1 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef MFD_TMIO_H | 1 | #ifndef MFD_TMIO_H |
2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
3 | 3 | ||
4 | #include <linux/fb.h> | ||
5 | |||
4 | #define tmio_ioread8(addr) readb(addr) | 6 | #define tmio_ioread8(addr) readb(addr) |
5 | #define tmio_ioread16(addr) readw(addr) | 7 | #define tmio_ioread16(addr) readw(addr) |
6 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) | 8 | #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) |
@@ -25,4 +27,21 @@ struct tmio_nand_data { | |||
25 | unsigned int num_partitions; | 27 | unsigned int num_partitions; |
26 | }; | 28 | }; |
27 | 29 | ||
30 | #define FBIO_TMIO_ACC_WRITE 0x7C639300 | ||
31 | #define FBIO_TMIO_ACC_SYNC 0x7C639301 | ||
32 | |||
33 | struct tmio_fb_data { | ||
34 | int (*lcd_set_power)(struct platform_device *fb_dev, | ||
35 | bool on); | ||
36 | int (*lcd_mode)(struct platform_device *fb_dev, | ||
37 | const struct fb_videomode *mode); | ||
38 | int num_modes; | ||
39 | struct fb_videomode *modes; | ||
40 | |||
41 | /* in mm: size of screen */ | ||
42 | int height; | ||
43 | int width; | ||
44 | }; | ||
45 | |||
46 | |||
28 | #endif | 47 | #endif |
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h new file mode 100644 index 000000000000..217bb22ebb8e --- /dev/null +++ b/include/linux/mfd/wm8350/audio.h | |||
@@ -0,0 +1,598 @@ | |||
1 | /* | ||
2 | * audio.h -- Audio Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_WM8350_AUDIO_H_ | ||
14 | #define __LINUX_MFD_WM8350_AUDIO_H_ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | #define WM8350_CLOCK_CONTROL_1 0x28 | ||
19 | #define WM8350_CLOCK_CONTROL_2 0x29 | ||
20 | #define WM8350_FLL_CONTROL_1 0x2A | ||
21 | #define WM8350_FLL_CONTROL_2 0x2B | ||
22 | #define WM8350_FLL_CONTROL_3 0x2C | ||
23 | #define WM8350_FLL_CONTROL_4 0x2D | ||
24 | #define WM8350_DAC_CONTROL 0x30 | ||
25 | #define WM8350_DAC_DIGITAL_VOLUME_L 0x32 | ||
26 | #define WM8350_DAC_DIGITAL_VOLUME_R 0x33 | ||
27 | #define WM8350_DAC_LR_RATE 0x35 | ||
28 | #define WM8350_DAC_CLOCK_CONTROL 0x36 | ||
29 | #define WM8350_DAC_MUTE 0x3A | ||
30 | #define WM8350_DAC_MUTE_VOLUME 0x3B | ||
31 | #define WM8350_DAC_SIDE 0x3C | ||
32 | #define WM8350_ADC_CONTROL 0x40 | ||
33 | #define WM8350_ADC_DIGITAL_VOLUME_L 0x42 | ||
34 | #define WM8350_ADC_DIGITAL_VOLUME_R 0x43 | ||
35 | #define WM8350_ADC_DIVIDER 0x44 | ||
36 | #define WM8350_ADC_LR_RATE 0x46 | ||
37 | #define WM8350_INPUT_CONTROL 0x48 | ||
38 | #define WM8350_IN3_INPUT_CONTROL 0x49 | ||
39 | #define WM8350_MIC_BIAS_CONTROL 0x4A | ||
40 | #define WM8350_OUTPUT_CONTROL 0x4C | ||
41 | #define WM8350_JACK_DETECT 0x4D | ||
42 | #define WM8350_ANTI_POP_CONTROL 0x4E | ||
43 | #define WM8350_LEFT_INPUT_VOLUME 0x50 | ||
44 | #define WM8350_RIGHT_INPUT_VOLUME 0x51 | ||
45 | #define WM8350_LEFT_MIXER_CONTROL 0x58 | ||
46 | #define WM8350_RIGHT_MIXER_CONTROL 0x59 | ||
47 | #define WM8350_OUT3_MIXER_CONTROL 0x5C | ||
48 | #define WM8350_OUT4_MIXER_CONTROL 0x5D | ||
49 | #define WM8350_OUTPUT_LEFT_MIXER_VOLUME 0x60 | ||
50 | #define WM8350_OUTPUT_RIGHT_MIXER_VOLUME 0x61 | ||
51 | #define WM8350_INPUT_MIXER_VOLUME_L 0x62 | ||
52 | #define WM8350_INPUT_MIXER_VOLUME_R 0x63 | ||
53 | #define WM8350_INPUT_MIXER_VOLUME 0x64 | ||
54 | #define WM8350_LOUT1_VOLUME 0x68 | ||
55 | #define WM8350_ROUT1_VOLUME 0x69 | ||
56 | #define WM8350_LOUT2_VOLUME 0x6A | ||
57 | #define WM8350_ROUT2_VOLUME 0x6B | ||
58 | #define WM8350_BEEP_VOLUME 0x6F | ||
59 | #define WM8350_AI_FORMATING 0x70 | ||
60 | #define WM8350_ADC_DAC_COMP 0x71 | ||
61 | #define WM8350_AI_ADC_CONTROL 0x72 | ||
62 | #define WM8350_AI_DAC_CONTROL 0x73 | ||
63 | #define WM8350_AIF_TEST 0x74 | ||
64 | #define WM8350_JACK_PIN_STATUS 0xE7 | ||
65 | |||
66 | /* Bit values for R08 (0x08) */ | ||
67 | #define WM8350_CODEC_ISEL_1_5 0 /* x1.5 */ | ||
68 | #define WM8350_CODEC_ISEL_1_0 1 /* x1.0 */ | ||
69 | #define WM8350_CODEC_ISEL_0_75 2 /* x0.75 */ | ||
70 | #define WM8350_CODEC_ISEL_0_5 3 /* x0.5 */ | ||
71 | |||
72 | #define WM8350_VMID_OFF 0 | ||
73 | #define WM8350_VMID_500K 1 | ||
74 | #define WM8350_VMID_100K 2 | ||
75 | #define WM8350_VMID_10K 3 | ||
76 | |||
77 | /* | ||
78 | * R40 (0x28) - Clock Control 1 | ||
79 | */ | ||
80 | #define WM8350_TOCLK_RATE 0x4000 | ||
81 | #define WM8350_MCLK_SEL 0x0800 | ||
82 | #define WM8350_MCLK_DIV_MASK 0x0100 | ||
83 | #define WM8350_BCLK_DIV_MASK 0x00F0 | ||
84 | #define WM8350_OPCLK_DIV_MASK 0x0007 | ||
85 | |||
86 | /* | ||
87 | * R41 (0x29) - Clock Control 2 | ||
88 | */ | ||
89 | #define WM8350_LRC_ADC_SEL 0x8000 | ||
90 | #define WM8350_MCLK_DIR 0x0001 | ||
91 | |||
92 | /* | ||
93 | * R42 (0x2A) - FLL Control 1 | ||
94 | */ | ||
95 | #define WM8350_FLL_DITHER_WIDTH_MASK 0x3000 | ||
96 | #define WM8350_FLL_DITHER_HP 0x0800 | ||
97 | #define WM8350_FLL_OUTDIV_MASK 0x0700 | ||
98 | #define WM8350_FLL_RSP_RATE_MASK 0x00F0 | ||
99 | #define WM8350_FLL_RATE_MASK 0x0007 | ||
100 | |||
101 | /* | ||
102 | * R43 (0x2B) - FLL Control 2 | ||
103 | */ | ||
104 | #define WM8350_FLL_RATIO_MASK 0xF800 | ||
105 | #define WM8350_FLL_N_MASK 0x03FF | ||
106 | |||
107 | /* | ||
108 | * R44 (0x2C) - FLL Control 3 | ||
109 | */ | ||
110 | #define WM8350_FLL_K_MASK 0xFFFF | ||
111 | |||
112 | /* | ||
113 | * R45 (0x2D) - FLL Control 4 | ||
114 | */ | ||
115 | #define WM8350_FLL_FRAC 0x0020 | ||
116 | #define WM8350_FLL_SLOW_LOCK_REF 0x0010 | ||
117 | #define WM8350_FLL_CLK_SRC_MASK 0x0003 | ||
118 | |||
119 | /* | ||
120 | * R48 (0x30) - DAC Control | ||
121 | */ | ||
122 | #define WM8350_DAC_MONO 0x2000 | ||
123 | #define WM8350_AIF_LRCLKRATE 0x1000 | ||
124 | #define WM8350_DEEMP_MASK 0x0030 | ||
125 | #define WM8350_DACL_DATINV 0x0002 | ||
126 | #define WM8350_DACR_DATINV 0x0001 | ||
127 | |||
128 | /* | ||
129 | * R50 (0x32) - DAC Digital Volume L | ||
130 | */ | ||
131 | #define WM8350_DAC_VU 0x0100 | ||
132 | #define WM8350_DACL_VOL_MASK 0x00FF | ||
133 | |||
134 | /* | ||
135 | * R51 (0x33) - DAC Digital Volume R | ||
136 | */ | ||
137 | #define WM8350_DAC_VU 0x0100 | ||
138 | #define WM8350_DACR_VOL_MASK 0x00FF | ||
139 | |||
140 | /* | ||
141 | * R53 (0x35) - DAC LR Rate | ||
142 | */ | ||
143 | #define WM8350_DACLRC_ENA 0x0800 | ||
144 | #define WM8350_DACLRC_RATE_MASK 0x07FF | ||
145 | |||
146 | /* | ||
147 | * R54 (0x36) - DAC Clock Control | ||
148 | */ | ||
149 | #define WM8350_DACCLK_POL 0x0010 | ||
150 | #define WM8350_DAC_CLKDIV_MASK 0x0007 | ||
151 | |||
152 | /* | ||
153 | * R58 (0x3A) - DAC Mute | ||
154 | */ | ||
155 | #define WM8350_DAC_MUTE_ENA 0x4000 | ||
156 | |||
157 | /* | ||
158 | * R59 (0x3B) - DAC Mute Volume | ||
159 | */ | ||
160 | #define WM8350_DAC_MUTEMODE 0x4000 | ||
161 | #define WM8350_DAC_MUTERATE 0x2000 | ||
162 | #define WM8350_DAC_SB_FILT 0x1000 | ||
163 | |||
164 | /* | ||
165 | * R60 (0x3C) - DAC Side | ||
166 | */ | ||
167 | #define WM8350_ADC_TO_DACL_MASK 0x3000 | ||
168 | #define WM8350_ADC_TO_DACR_MASK 0x0C00 | ||
169 | |||
170 | /* | ||
171 | * R64 (0x40) - ADC Control | ||
172 | */ | ||
173 | #define WM8350_ADC_HPF_CUT_MASK 0x0300 | ||
174 | #define WM8350_ADCL_DATINV 0x0002 | ||
175 | #define WM8350_ADCR_DATINV 0x0001 | ||
176 | |||
177 | /* | ||
178 | * R66 (0x42) - ADC Digital Volume L | ||
179 | */ | ||
180 | #define WM8350_ADC_VU 0x0100 | ||
181 | #define WM8350_ADCL_VOL_MASK 0x00FF | ||
182 | |||
183 | /* | ||
184 | * R67 (0x43) - ADC Digital Volume R | ||
185 | */ | ||
186 | #define WM8350_ADC_VU 0x0100 | ||
187 | #define WM8350_ADCR_VOL_MASK 0x00FF | ||
188 | |||
189 | /* | ||
190 | * R68 (0x44) - ADC Divider | ||
191 | */ | ||
192 | #define WM8350_ADCL_DAC_SVOL_MASK 0x0F00 | ||
193 | #define WM8350_ADCR_DAC_SVOL_MASK 0x00F0 | ||
194 | #define WM8350_ADCCLK_POL 0x0008 | ||
195 | #define WM8350_ADC_CLKDIV_MASK 0x0007 | ||
196 | |||
197 | /* | ||
198 | * R70 (0x46) - ADC LR Rate | ||
199 | */ | ||
200 | #define WM8350_ADCLRC_ENA 0x0800 | ||
201 | #define WM8350_ADCLRC_RATE_MASK 0x07FF | ||
202 | |||
203 | /* | ||
204 | * R72 (0x48) - Input Control | ||
205 | */ | ||
206 | #define WM8350_IN2R_ENA 0x0400 | ||
207 | #define WM8350_IN1RN_ENA 0x0200 | ||
208 | #define WM8350_IN1RP_ENA 0x0100 | ||
209 | #define WM8350_IN2L_ENA 0x0004 | ||
210 | #define WM8350_IN1LN_ENA 0x0002 | ||
211 | #define WM8350_IN1LP_ENA 0x0001 | ||
212 | |||
213 | /* | ||
214 | * R73 (0x49) - IN3 Input Control | ||
215 | */ | ||
216 | #define WM8350_IN3R_SHORT 0x4000 | ||
217 | #define WM8350_IN3L_SHORT 0x0040 | ||
218 | |||
219 | /* | ||
220 | * R74 (0x4A) - Mic Bias Control | ||
221 | */ | ||
222 | #define WM8350_MICBSEL 0x4000 | ||
223 | #define WM8350_MCDTHR_MASK 0x001C | ||
224 | #define WM8350_MCDSCTHR_MASK 0x0003 | ||
225 | |||
226 | /* | ||
227 | * R76 (0x4C) - Output Control | ||
228 | */ | ||
229 | #define WM8350_OUT4_VROI 0x0800 | ||
230 | #define WM8350_OUT3_VROI 0x0400 | ||
231 | #define WM8350_OUT2_VROI 0x0200 | ||
232 | #define WM8350_OUT1_VROI 0x0100 | ||
233 | #define WM8350_OUT2_FB 0x0004 | ||
234 | #define WM8350_OUT1_FB 0x0001 | ||
235 | |||
236 | /* | ||
237 | * R77 (0x4D) - Jack Detect | ||
238 | */ | ||
239 | #define WM8350_JDL_ENA 0x8000 | ||
240 | #define WM8350_JDR_ENA 0x4000 | ||
241 | |||
242 | /* | ||
243 | * R78 (0x4E) - Anti Pop Control | ||
244 | */ | ||
245 | #define WM8350_ANTI_POP_MASK 0x0300 | ||
246 | #define WM8350_DIS_OP_LN4_MASK 0x00C0 | ||
247 | #define WM8350_DIS_OP_LN3_MASK 0x0030 | ||
248 | #define WM8350_DIS_OP_OUT2_MASK 0x000C | ||
249 | #define WM8350_DIS_OP_OUT1_MASK 0x0003 | ||
250 | |||
251 | /* | ||
252 | * R80 (0x50) - Left Input Volume | ||
253 | */ | ||
254 | #define WM8350_INL_MUTE 0x4000 | ||
255 | #define WM8350_INL_ZC 0x2000 | ||
256 | #define WM8350_IN_VU 0x0100 | ||
257 | #define WM8350_INL_VOL_MASK 0x00FC | ||
258 | |||
259 | /* | ||
260 | * R81 (0x51) - Right Input Volume | ||
261 | */ | ||
262 | #define WM8350_INR_MUTE 0x4000 | ||
263 | #define WM8350_INR_ZC 0x2000 | ||
264 | #define WM8350_IN_VU 0x0100 | ||
265 | #define WM8350_INR_VOL_MASK 0x00FC | ||
266 | |||
267 | /* | ||
268 | * R88 (0x58) - Left Mixer Control | ||
269 | */ | ||
270 | #define WM8350_DACR_TO_MIXOUTL 0x1000 | ||
271 | #define WM8350_DACL_TO_MIXOUTL 0x0800 | ||
272 | #define WM8350_IN3L_TO_MIXOUTL 0x0004 | ||
273 | #define WM8350_INR_TO_MIXOUTL 0x0002 | ||
274 | #define WM8350_INL_TO_MIXOUTL 0x0001 | ||
275 | |||
276 | /* | ||
277 | * R89 (0x59) - Right Mixer Control | ||
278 | */ | ||
279 | #define WM8350_DACR_TO_MIXOUTR 0x1000 | ||
280 | #define WM8350_DACL_TO_MIXOUTR 0x0800 | ||
281 | #define WM8350_IN3R_TO_MIXOUTR 0x0008 | ||
282 | #define WM8350_INR_TO_MIXOUTR 0x0002 | ||
283 | #define WM8350_INL_TO_MIXOUTR 0x0001 | ||
284 | |||
285 | /* | ||
286 | * R92 (0x5C) - OUT3 Mixer Control | ||
287 | */ | ||
288 | #define WM8350_DACL_TO_OUT3 0x0800 | ||
289 | #define WM8350_MIXINL_TO_OUT3 0x0100 | ||
290 | #define WM8350_OUT4_TO_OUT3 0x0008 | ||
291 | #define WM8350_MIXOUTL_TO_OUT3 0x0001 | ||
292 | |||
293 | /* | ||
294 | * R93 (0x5D) - OUT4 Mixer Control | ||
295 | */ | ||
296 | #define WM8350_DACR_TO_OUT4 0x1000 | ||
297 | #define WM8350_DACL_TO_OUT4 0x0800 | ||
298 | #define WM8350_OUT4_ATTN 0x0400 | ||
299 | #define WM8350_MIXINR_TO_OUT4 0x0200 | ||
300 | #define WM8350_OUT3_TO_OUT4 0x0004 | ||
301 | #define WM8350_MIXOUTR_TO_OUT4 0x0002 | ||
302 | #define WM8350_MIXOUTL_TO_OUT4 0x0001 | ||
303 | |||
304 | /* | ||
305 | * R96 (0x60) - Output Left Mixer Volume | ||
306 | */ | ||
307 | #define WM8350_IN3L_MIXOUTL_VOL_MASK 0x0E00 | ||
308 | #define WM8350_IN3L_MIXOUTL_VOL_SHIFT 9 | ||
309 | #define WM8350_INR_MIXOUTL_VOL_MASK 0x00E0 | ||
310 | #define WM8350_INR_MIXOUTL_VOL_SHIFT 5 | ||
311 | #define WM8350_INL_MIXOUTL_VOL_MASK 0x000E | ||
312 | #define WM8350_INL_MIXOUTL_VOL_SHIFT 1 | ||
313 | |||
314 | /* Bit values for R96 (0x60) */ | ||
315 | #define WM8350_IN3L_MIXOUTL_VOL_OFF 0 | ||
316 | #define WM8350_IN3L_MIXOUTL_VOL_M12DB 1 | ||
317 | #define WM8350_IN3L_MIXOUTL_VOL_M9DB 2 | ||
318 | #define WM8350_IN3L_MIXOUTL_VOL_M6DB 3 | ||
319 | #define WM8350_IN3L_MIXOUTL_VOL_M3DB 4 | ||
320 | #define WM8350_IN3L_MIXOUTL_VOL_0DB 5 | ||
321 | #define WM8350_IN3L_MIXOUTL_VOL_3DB 6 | ||
322 | #define WM8350_IN3L_MIXOUTL_VOL_6DB 7 | ||
323 | |||
324 | #define WM8350_INR_MIXOUTL_VOL_OFF 0 | ||
325 | #define WM8350_INR_MIXOUTL_VOL_M12DB 1 | ||
326 | #define WM8350_INR_MIXOUTL_VOL_M9DB 2 | ||
327 | #define WM8350_INR_MIXOUTL_VOL_M6DB 3 | ||
328 | #define WM8350_INR_MIXOUTL_VOL_M3DB 4 | ||
329 | #define WM8350_INR_MIXOUTL_VOL_0DB 5 | ||
330 | #define WM8350_INR_MIXOUTL_VOL_3DB 6 | ||
331 | #define WM8350_INR_MIXOUTL_VOL_6DB 7 | ||
332 | |||
333 | #define WM8350_INL_MIXOUTL_VOL_OFF 0 | ||
334 | #define WM8350_INL_MIXOUTL_VOL_M12DB 1 | ||
335 | #define WM8350_INL_MIXOUTL_VOL_M9DB 2 | ||
336 | #define WM8350_INL_MIXOUTL_VOL_M6DB 3 | ||
337 | #define WM8350_INL_MIXOUTL_VOL_M3DB 4 | ||
338 | #define WM8350_INL_MIXOUTL_VOL_0DB 5 | ||
339 | #define WM8350_INL_MIXOUTL_VOL_3DB 6 | ||
340 | #define WM8350_INL_MIXOUTL_VOL_6DB 7 | ||
341 | |||
342 | /* | ||
343 | * R97 (0x61) - Output Right Mixer Volume | ||
344 | */ | ||
345 | #define WM8350_IN3R_MIXOUTR_VOL_MASK 0xE000 | ||
346 | #define WM8350_IN3R_MIXOUTR_VOL_SHIFT 13 | ||
347 | #define WM8350_INR_MIXOUTR_VOL_MASK 0x00E0 | ||
348 | #define WM8350_INR_MIXOUTR_VOL_SHIFT 5 | ||
349 | #define WM8350_INL_MIXOUTR_VOL_MASK 0x000E | ||
350 | #define WM8350_INL_MIXOUTR_VOL_SHIFT 1 | ||
351 | |||
352 | /* Bit values for R96 (0x60) */ | ||
353 | #define WM8350_IN3R_MIXOUTR_VOL_OFF 0 | ||
354 | #define WM8350_IN3R_MIXOUTR_VOL_M12DB 1 | ||
355 | #define WM8350_IN3R_MIXOUTR_VOL_M9DB 2 | ||
356 | #define WM8350_IN3R_MIXOUTR_VOL_M6DB 3 | ||
357 | #define WM8350_IN3R_MIXOUTR_VOL_M3DB 4 | ||
358 | #define WM8350_IN3R_MIXOUTR_VOL_0DB 5 | ||
359 | #define WM8350_IN3R_MIXOUTR_VOL_3DB 6 | ||
360 | #define WM8350_IN3R_MIXOUTR_VOL_6DB 7 | ||
361 | |||
362 | #define WM8350_INR_MIXOUTR_VOL_OFF 0 | ||
363 | #define WM8350_INR_MIXOUTR_VOL_M12DB 1 | ||
364 | #define WM8350_INR_MIXOUTR_VOL_M9DB 2 | ||
365 | #define WM8350_INR_MIXOUTR_VOL_M6DB 3 | ||
366 | #define WM8350_INR_MIXOUTR_VOL_M3DB 4 | ||
367 | #define WM8350_INR_MIXOUTR_VOL_0DB 5 | ||
368 | #define WM8350_INR_MIXOUTR_VOL_3DB 6 | ||
369 | #define WM8350_INR_MIXOUTR_VOL_6DB 7 | ||
370 | |||
371 | #define WM8350_INL_MIXOUTR_VOL_OFF 0 | ||
372 | #define WM8350_INL_MIXOUTR_VOL_M12DB 1 | ||
373 | #define WM8350_INL_MIXOUTR_VOL_M9DB 2 | ||
374 | #define WM8350_INL_MIXOUTR_VOL_M6DB 3 | ||
375 | #define WM8350_INL_MIXOUTR_VOL_M3DB 4 | ||
376 | #define WM8350_INL_MIXOUTR_VOL_0DB 5 | ||
377 | #define WM8350_INL_MIXOUTR_VOL_3DB 6 | ||
378 | #define WM8350_INL_MIXOUTR_VOL_6DB 7 | ||
379 | |||
380 | /* | ||
381 | * R98 (0x62) - Input Mixer Volume L | ||
382 | */ | ||
383 | #define WM8350_IN3L_MIXINL_VOL_MASK 0x0E00 | ||
384 | #define WM8350_IN2L_MIXINL_VOL_MASK 0x000E | ||
385 | #define WM8350_INL_MIXINL_VOL 0x0001 | ||
386 | |||
387 | /* | ||
388 | * R99 (0x63) - Input Mixer Volume R | ||
389 | */ | ||
390 | #define WM8350_IN3R_MIXINR_VOL_MASK 0xE000 | ||
391 | #define WM8350_IN2R_MIXINR_VOL_MASK 0x00E0 | ||
392 | #define WM8350_INR_MIXINR_VOL 0x0001 | ||
393 | |||
394 | /* | ||
395 | * R100 (0x64) - Input Mixer Volume | ||
396 | */ | ||
397 | #define WM8350_OUT4_MIXIN_DST 0x8000 | ||
398 | #define WM8350_OUT4_MIXIN_VOL_MASK 0x000E | ||
399 | |||
400 | /* | ||
401 | * R104 (0x68) - LOUT1 Volume | ||
402 | */ | ||
403 | #define WM8350_OUT1L_MUTE 0x4000 | ||
404 | #define WM8350_OUT1L_ZC 0x2000 | ||
405 | #define WM8350_OUT1_VU 0x0100 | ||
406 | #define WM8350_OUT1L_VOL_MASK 0x00FC | ||
407 | #define WM8350_OUT1L_VOL_SHIFT 2 | ||
408 | |||
409 | /* | ||
410 | * R105 (0x69) - ROUT1 Volume | ||
411 | */ | ||
412 | #define WM8350_OUT1R_MUTE 0x4000 | ||
413 | #define WM8350_OUT1R_ZC 0x2000 | ||
414 | #define WM8350_OUT1_VU 0x0100 | ||
415 | #define WM8350_OUT1R_VOL_MASK 0x00FC | ||
416 | #define WM8350_OUT1R_VOL_SHIFT 2 | ||
417 | |||
418 | /* | ||
419 | * R106 (0x6A) - LOUT2 Volume | ||
420 | */ | ||
421 | #define WM8350_OUT2L_MUTE 0x4000 | ||
422 | #define WM8350_OUT2L_ZC 0x2000 | ||
423 | #define WM8350_OUT2_VU 0x0100 | ||
424 | #define WM8350_OUT2L_VOL_MASK 0x00FC | ||
425 | |||
426 | /* | ||
427 | * R107 (0x6B) - ROUT2 Volume | ||
428 | */ | ||
429 | #define WM8350_OUT2R_MUTE 0x4000 | ||
430 | #define WM8350_OUT2R_ZC 0x2000 | ||
431 | #define WM8350_OUT2R_INV 0x0400 | ||
432 | #define WM8350_OUT2R_INV_MUTE 0x0200 | ||
433 | #define WM8350_OUT2_VU 0x0100 | ||
434 | #define WM8350_OUT2R_VOL_MASK 0x00FC | ||
435 | |||
436 | /* | ||
437 | * R111 (0x6F) - BEEP Volume | ||
438 | */ | ||
439 | #define WM8350_IN3R_OUT2R_VOL_MASK 0x00E0 | ||
440 | |||
441 | /* | ||
442 | * R112 (0x70) - AI Formating | ||
443 | */ | ||
444 | #define WM8350_AIF_BCLK_INV 0x8000 | ||
445 | #define WM8350_AIF_TRI 0x2000 | ||
446 | #define WM8350_AIF_LRCLK_INV 0x1000 | ||
447 | #define WM8350_AIF_WL_MASK 0x0C00 | ||
448 | #define WM8350_AIF_FMT_MASK 0x0300 | ||
449 | |||
450 | /* | ||
451 | * R113 (0x71) - ADC DAC COMP | ||
452 | */ | ||
453 | #define WM8350_DAC_COMP 0x0080 | ||
454 | #define WM8350_DAC_COMPMODE 0x0040 | ||
455 | #define WM8350_ADC_COMP 0x0020 | ||
456 | #define WM8350_ADC_COMPMODE 0x0010 | ||
457 | #define WM8350_LOOPBACK 0x0001 | ||
458 | |||
459 | /* | ||
460 | * R114 (0x72) - AI ADC Control | ||
461 | */ | ||
462 | #define WM8350_AIFADC_PD 0x0080 | ||
463 | #define WM8350_AIFADCL_SRC 0x0040 | ||
464 | #define WM8350_AIFADCR_SRC 0x0020 | ||
465 | #define WM8350_AIFADC_TDM_CHAN 0x0010 | ||
466 | #define WM8350_AIFADC_TDM 0x0008 | ||
467 | |||
468 | /* | ||
469 | * R115 (0x73) - AI DAC Control | ||
470 | */ | ||
471 | #define WM8350_BCLK_MSTR 0x4000 | ||
472 | #define WM8350_AIFDAC_PD 0x0080 | ||
473 | #define WM8350_DACL_SRC 0x0040 | ||
474 | #define WM8350_DACR_SRC 0x0020 | ||
475 | #define WM8350_AIFDAC_TDM_CHAN 0x0010 | ||
476 | #define WM8350_AIFDAC_TDM 0x0008 | ||
477 | #define WM8350_DAC_BOOST_MASK 0x0003 | ||
478 | |||
479 | /* | ||
480 | * R116 (0x74) - AIF Test | ||
481 | */ | ||
482 | #define WM8350_CODEC_BYP 0x4000 | ||
483 | #define WM8350_AIFADC_WR_TST 0x2000 | ||
484 | #define WM8350_AIFADC_RD_TST 0x1000 | ||
485 | #define WM8350_AIFDAC_WR_TST 0x0800 | ||
486 | #define WM8350_AIFDAC_RD_TST 0x0400 | ||
487 | #define WM8350_AIFADC_ASYN 0x0020 | ||
488 | #define WM8350_AIFDAC_ASYN 0x0010 | ||
489 | |||
490 | /* | ||
491 | * R231 (0xE7) - Jack Status | ||
492 | */ | ||
493 | #define WM8350_JACK_R_LVL 0x0400 | ||
494 | |||
495 | /* | ||
496 | * WM8350 Platform setup | ||
497 | */ | ||
498 | #define WM8350_S_CURVE_NONE 0x0 | ||
499 | #define WM8350_S_CURVE_FAST 0x1 | ||
500 | #define WM8350_S_CURVE_MEDIUM 0x2 | ||
501 | #define WM8350_S_CURVE_SLOW 0x3 | ||
502 | |||
503 | #define WM8350_DISCHARGE_OFF 0x0 | ||
504 | #define WM8350_DISCHARGE_FAST 0x1 | ||
505 | #define WM8350_DISCHARGE_MEDIUM 0x2 | ||
506 | #define WM8350_DISCHARGE_SLOW 0x3 | ||
507 | |||
508 | #define WM8350_TIE_OFF_500R 0x0 | ||
509 | #define WM8350_TIE_OFF_30K 0x1 | ||
510 | |||
511 | /* | ||
512 | * Clock sources & directions | ||
513 | */ | ||
514 | #define WM8350_SYSCLK 0 | ||
515 | |||
516 | #define WM8350_MCLK_SEL_PLL_MCLK 0 | ||
517 | #define WM8350_MCLK_SEL_PLL_DAC 1 | ||
518 | #define WM8350_MCLK_SEL_PLL_ADC 2 | ||
519 | #define WM8350_MCLK_SEL_PLL_32K 3 | ||
520 | #define WM8350_MCLK_SEL_MCLK 5 | ||
521 | |||
522 | #define WM8350_MCLK_DIR_OUT 0 | ||
523 | #define WM8350_MCLK_DIR_IN 1 | ||
524 | |||
525 | /* clock divider id's */ | ||
526 | #define WM8350_ADC_CLKDIV 0 | ||
527 | #define WM8350_DAC_CLKDIV 1 | ||
528 | #define WM8350_BCLK_CLKDIV 2 | ||
529 | #define WM8350_OPCLK_CLKDIV 3 | ||
530 | #define WM8350_TO_CLKDIV 4 | ||
531 | #define WM8350_SYS_CLKDIV 5 | ||
532 | #define WM8350_DACLR_CLKDIV 6 | ||
533 | #define WM8350_ADCLR_CLKDIV 7 | ||
534 | |||
535 | /* ADC clock dividers */ | ||
536 | #define WM8350_ADCDIV_1 0x0 | ||
537 | #define WM8350_ADCDIV_1_5 0x1 | ||
538 | #define WM8350_ADCDIV_2 0x2 | ||
539 | #define WM8350_ADCDIV_3 0x3 | ||
540 | #define WM8350_ADCDIV_4 0x4 | ||
541 | #define WM8350_ADCDIV_5_5 0x5 | ||
542 | #define WM8350_ADCDIV_6 0x6 | ||
543 | |||
544 | /* ADC clock dividers */ | ||
545 | #define WM8350_DACDIV_1 0x0 | ||
546 | #define WM8350_DACDIV_1_5 0x1 | ||
547 | #define WM8350_DACDIV_2 0x2 | ||
548 | #define WM8350_DACDIV_3 0x3 | ||
549 | #define WM8350_DACDIV_4 0x4 | ||
550 | #define WM8350_DACDIV_5_5 0x5 | ||
551 | #define WM8350_DACDIV_6 0x6 | ||
552 | |||
553 | /* BCLK clock dividers */ | ||
554 | #define WM8350_BCLK_DIV_1 (0x0 << 4) | ||
555 | #define WM8350_BCLK_DIV_1_5 (0x1 << 4) | ||
556 | #define WM8350_BCLK_DIV_2 (0x2 << 4) | ||
557 | #define WM8350_BCLK_DIV_3 (0x3 << 4) | ||
558 | #define WM8350_BCLK_DIV_4 (0x4 << 4) | ||
559 | #define WM8350_BCLK_DIV_5_5 (0x5 << 4) | ||
560 | #define WM8350_BCLK_DIV_6 (0x6 << 4) | ||
561 | #define WM8350_BCLK_DIV_8 (0x7 << 4) | ||
562 | #define WM8350_BCLK_DIV_11 (0x8 << 4) | ||
563 | #define WM8350_BCLK_DIV_12 (0x9 << 4) | ||
564 | #define WM8350_BCLK_DIV_16 (0xa << 4) | ||
565 | #define WM8350_BCLK_DIV_22 (0xb << 4) | ||
566 | #define WM8350_BCLK_DIV_24 (0xc << 4) | ||
567 | #define WM8350_BCLK_DIV_32 (0xd << 4) | ||
568 | #define WM8350_BCLK_DIV_44 (0xe << 4) | ||
569 | #define WM8350_BCLK_DIV_48 (0xf << 4) | ||
570 | |||
571 | /* Sys (MCLK) clock dividers */ | ||
572 | #define WM8350_MCLK_DIV_1 (0x0 << 8) | ||
573 | #define WM8350_MCLK_DIV_2 (0x1 << 8) | ||
574 | |||
575 | /* OP clock dividers */ | ||
576 | #define WM8350_OPCLK_DIV_1 0x0 | ||
577 | #define WM8350_OPCLK_DIV_2 0x1 | ||
578 | #define WM8350_OPCLK_DIV_3 0x2 | ||
579 | #define WM8350_OPCLK_DIV_4 0x3 | ||
580 | #define WM8350_OPCLK_DIV_5_5 0x4 | ||
581 | #define WM8350_OPCLK_DIV_6 0x5 | ||
582 | |||
583 | /* DAI ID */ | ||
584 | #define WM8350_HIFI_DAI 0 | ||
585 | |||
586 | /* | ||
587 | * Audio interrupts. | ||
588 | */ | ||
589 | #define WM8350_IRQ_CODEC_JCK_DET_L 39 | ||
590 | #define WM8350_IRQ_CODEC_JCK_DET_R 40 | ||
591 | #define WM8350_IRQ_CODEC_MICSCD 41 | ||
592 | #define WM8350_IRQ_CODEC_MICD 42 | ||
593 | |||
594 | struct wm8350_codec { | ||
595 | struct platform_device *pdev; | ||
596 | }; | ||
597 | |||
598 | #endif | ||
diff --git a/include/linux/mfd/wm8350/comparator.h b/include/linux/mfd/wm8350/comparator.h new file mode 100644 index 000000000000..053788649452 --- /dev/null +++ b/include/linux/mfd/wm8350/comparator.h | |||
@@ -0,0 +1,167 @@ | |||
1 | /* | ||
2 | * comparator.h -- Comparator Aux ADC for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_WM8350_COMPARATOR_H_ | ||
13 | #define __LINUX_MFD_WM8350_COMPARATOR_H_ | ||
14 | |||
15 | /* | ||
16 | * Registers | ||
17 | */ | ||
18 | |||
19 | #define WM8350_DIGITISER_CONTROL_1 0x90 | ||
20 | #define WM8350_DIGITISER_CONTROL_2 0x91 | ||
21 | #define WM8350_AUX1_READBACK 0x98 | ||
22 | #define WM8350_AUX2_READBACK 0x99 | ||
23 | #define WM8350_AUX3_READBACK 0x9A | ||
24 | #define WM8350_AUX4_READBACK 0x9B | ||
25 | #define WM8350_CHIP_TEMP_READBACK 0x9F | ||
26 | #define WM8350_GENERIC_COMPARATOR_CONTROL 0xA3 | ||
27 | #define WM8350_GENERIC_COMPARATOR_1 0xA4 | ||
28 | #define WM8350_GENERIC_COMPARATOR_2 0xA5 | ||
29 | #define WM8350_GENERIC_COMPARATOR_3 0xA6 | ||
30 | #define WM8350_GENERIC_COMPARATOR_4 0xA7 | ||
31 | |||
32 | /* | ||
33 | * R144 (0x90) - Digitiser Control (1) | ||
34 | */ | ||
35 | #define WM8350_AUXADC_CTC 0x4000 | ||
36 | #define WM8350_AUXADC_POLL 0x2000 | ||
37 | #define WM8350_AUXADC_HIB_MODE 0x1000 | ||
38 | #define WM8350_AUXADC_SEL8 0x0080 | ||
39 | #define WM8350_AUXADC_SEL7 0x0040 | ||
40 | #define WM8350_AUXADC_SEL6 0x0020 | ||
41 | #define WM8350_AUXADC_SEL5 0x0010 | ||
42 | #define WM8350_AUXADC_SEL4 0x0008 | ||
43 | #define WM8350_AUXADC_SEL3 0x0004 | ||
44 | #define WM8350_AUXADC_SEL2 0x0002 | ||
45 | #define WM8350_AUXADC_SEL1 0x0001 | ||
46 | |||
47 | /* | ||
48 | * R145 (0x91) - Digitiser Control (2) | ||
49 | */ | ||
50 | #define WM8350_AUXADC_MASKMODE_MASK 0x3000 | ||
51 | #define WM8350_AUXADC_CRATE_MASK 0x0700 | ||
52 | #define WM8350_AUXADC_CAL 0x0004 | ||
53 | #define WM8350_AUX_RBMODE 0x0002 | ||
54 | #define WM8350_AUXADC_WAIT 0x0001 | ||
55 | |||
56 | /* | ||
57 | * R152 (0x98) - AUX1 Readback | ||
58 | */ | ||
59 | #define WM8350_AUXADC_SCALE1_MASK 0x6000 | ||
60 | #define WM8350_AUXADC_REF1 0x1000 | ||
61 | #define WM8350_AUXADC_DATA1_MASK 0x0FFF | ||
62 | |||
63 | /* | ||
64 | * R153 (0x99) - AUX2 Readback | ||
65 | */ | ||
66 | #define WM8350_AUXADC_SCALE2_MASK 0x6000 | ||
67 | #define WM8350_AUXADC_REF2 0x1000 | ||
68 | #define WM8350_AUXADC_DATA2_MASK 0x0FFF | ||
69 | |||
70 | /* | ||
71 | * R154 (0x9A) - AUX3 Readback | ||
72 | */ | ||
73 | #define WM8350_AUXADC_SCALE3_MASK 0x6000 | ||
74 | #define WM8350_AUXADC_REF3 0x1000 | ||
75 | #define WM8350_AUXADC_DATA3_MASK 0x0FFF | ||
76 | |||
77 | /* | ||
78 | * R155 (0x9B) - AUX4 Readback | ||
79 | */ | ||
80 | #define WM8350_AUXADC_SCALE4_MASK 0x6000 | ||
81 | #define WM8350_AUXADC_REF4 0x1000 | ||
82 | #define WM8350_AUXADC_DATA4_MASK 0x0FFF | ||
83 | |||
84 | /* | ||
85 | * R156 (0x9C) - USB Voltage Readback | ||
86 | */ | ||
87 | #define WM8350_AUXADC_DATA_USB_MASK 0x0FFF | ||
88 | |||
89 | /* | ||
90 | * R157 (0x9D) - LINE Voltage Readback | ||
91 | */ | ||
92 | #define WM8350_AUXADC_DATA_LINE_MASK 0x0FFF | ||
93 | |||
94 | /* | ||
95 | * R158 (0x9E) - BATT Voltage Readback | ||
96 | */ | ||
97 | #define WM8350_AUXADC_DATA_BATT_MASK 0x0FFF | ||
98 | |||
99 | /* | ||
100 | * R159 (0x9F) - Chip Temp Readback | ||
101 | */ | ||
102 | #define WM8350_AUXADC_DATA_CHIPTEMP_MASK 0x0FFF | ||
103 | |||
104 | /* | ||
105 | * R163 (0xA3) - Generic Comparator Control | ||
106 | */ | ||
107 | #define WM8350_DCMP4_ENA 0x0008 | ||
108 | #define WM8350_DCMP3_ENA 0x0004 | ||
109 | #define WM8350_DCMP2_ENA 0x0002 | ||
110 | #define WM8350_DCMP1_ENA 0x0001 | ||
111 | |||
112 | /* | ||
113 | * R164 (0xA4) - Generic comparator 1 | ||
114 | */ | ||
115 | #define WM8350_DCMP1_SRCSEL_MASK 0xE000 | ||
116 | #define WM8350_DCMP1_GT 0x1000 | ||
117 | #define WM8350_DCMP1_THR_MASK 0x0FFF | ||
118 | |||
119 | /* | ||
120 | * R165 (0xA5) - Generic comparator 2 | ||
121 | */ | ||
122 | #define WM8350_DCMP2_SRCSEL_MASK 0xE000 | ||
123 | #define WM8350_DCMP2_GT 0x1000 | ||
124 | #define WM8350_DCMP2_THR_MASK 0x0FFF | ||
125 | |||
126 | /* | ||
127 | * R166 (0xA6) - Generic comparator 3 | ||
128 | */ | ||
129 | #define WM8350_DCMP3_SRCSEL_MASK 0xE000 | ||
130 | #define WM8350_DCMP3_GT 0x1000 | ||
131 | #define WM8350_DCMP3_THR_MASK 0x0FFF | ||
132 | |||
133 | /* | ||
134 | * R167 (0xA7) - Generic comparator 4 | ||
135 | */ | ||
136 | #define WM8350_DCMP4_SRCSEL_MASK 0xE000 | ||
137 | #define WM8350_DCMP4_GT 0x1000 | ||
138 | #define WM8350_DCMP4_THR_MASK 0x0FFF | ||
139 | |||
140 | /* | ||
141 | * Interrupts. | ||
142 | */ | ||
143 | #define WM8350_IRQ_AUXADC_DATARDY 16 | ||
144 | #define WM8350_IRQ_AUXADC_DCOMP4 17 | ||
145 | #define WM8350_IRQ_AUXADC_DCOMP3 18 | ||
146 | #define WM8350_IRQ_AUXADC_DCOMP2 19 | ||
147 | #define WM8350_IRQ_AUXADC_DCOMP1 20 | ||
148 | #define WM8350_IRQ_SYS_HYST_COMP_FAIL 21 | ||
149 | #define WM8350_IRQ_SYS_CHIP_GT115 22 | ||
150 | #define WM8350_IRQ_SYS_CHIP_GT140 23 | ||
151 | |||
152 | /* | ||
153 | * USB/2, LINE & BATT = ((VRTC * 2) / 4095)) * 10e6 uV | ||
154 | * Where VRTC = 2.7 V | ||
155 | */ | ||
156 | #define WM8350_AUX_COEFF 1319 | ||
157 | |||
158 | #define WM8350_AUXADC_AUX1 0 | ||
159 | #define WM8350_AUXADC_AUX2 1 | ||
160 | #define WM8350_AUXADC_AUX3 2 | ||
161 | #define WM8350_AUXADC_AUX4 3 | ||
162 | #define WM8350_AUXADC_USB 4 | ||
163 | #define WM8350_AUXADC_LINE 5 | ||
164 | #define WM8350_AUXADC_BATT 6 | ||
165 | #define WM8350_AUXADC_TEMP 7 | ||
166 | |||
167 | #endif | ||
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h new file mode 100644 index 000000000000..6ebf97f2a475 --- /dev/null +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -0,0 +1,631 @@ | |||
1 | /* | ||
2 | * core.h -- Core Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_WM8350_CORE_H_ | ||
14 | #define __LINUX_MFD_WM8350_CORE_H_ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/mutex.h> | ||
18 | #include <linux/workqueue.h> | ||
19 | |||
20 | #include <linux/mfd/wm8350/audio.h> | ||
21 | #include <linux/mfd/wm8350/gpio.h> | ||
22 | #include <linux/mfd/wm8350/pmic.h> | ||
23 | #include <linux/mfd/wm8350/rtc.h> | ||
24 | #include <linux/mfd/wm8350/supply.h> | ||
25 | #include <linux/mfd/wm8350/wdt.h> | ||
26 | |||
27 | /* | ||
28 | * Register values. | ||
29 | */ | ||
30 | #define WM8350_RESET_ID 0x00 | ||
31 | #define WM8350_ID 0x01 | ||
32 | #define WM8350_SYSTEM_CONTROL_1 0x03 | ||
33 | #define WM8350_SYSTEM_CONTROL_2 0x04 | ||
34 | #define WM8350_SYSTEM_HIBERNATE 0x05 | ||
35 | #define WM8350_INTERFACE_CONTROL 0x06 | ||
36 | #define WM8350_POWER_MGMT_1 0x08 | ||
37 | #define WM8350_POWER_MGMT_2 0x09 | ||
38 | #define WM8350_POWER_MGMT_3 0x0A | ||
39 | #define WM8350_POWER_MGMT_4 0x0B | ||
40 | #define WM8350_POWER_MGMT_5 0x0C | ||
41 | #define WM8350_POWER_MGMT_6 0x0D | ||
42 | #define WM8350_POWER_MGMT_7 0x0E | ||
43 | |||
44 | #define WM8350_SYSTEM_INTERRUPTS 0x18 | ||
45 | #define WM8350_INT_STATUS_1 0x19 | ||
46 | #define WM8350_INT_STATUS_2 0x1A | ||
47 | #define WM8350_POWER_UP_INT_STATUS 0x1B | ||
48 | #define WM8350_UNDER_VOLTAGE_INT_STATUS 0x1C | ||
49 | #define WM8350_OVER_CURRENT_INT_STATUS 0x1D | ||
50 | #define WM8350_GPIO_INT_STATUS 0x1E | ||
51 | #define WM8350_COMPARATOR_INT_STATUS 0x1F | ||
52 | #define WM8350_SYSTEM_INTERRUPTS_MASK 0x20 | ||
53 | #define WM8350_INT_STATUS_1_MASK 0x21 | ||
54 | #define WM8350_INT_STATUS_2_MASK 0x22 | ||
55 | #define WM8350_POWER_UP_INT_STATUS_MASK 0x23 | ||
56 | #define WM8350_UNDER_VOLTAGE_INT_STATUS_MASK 0x24 | ||
57 | #define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 | ||
58 | #define WM8350_GPIO_INT_STATUS_MASK 0x26 | ||
59 | #define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 | ||
60 | |||
61 | #define WM8350_MAX_REGISTER 0xFF | ||
62 | |||
63 | /* | ||
64 | * Field Definitions. | ||
65 | */ | ||
66 | |||
67 | /* | ||
68 | * R0 (0x00) - Reset/ID | ||
69 | */ | ||
70 | #define WM8350_SW_RESET_CHIP_ID_MASK 0xFFFF | ||
71 | |||
72 | /* | ||
73 | * R1 (0x01) - ID | ||
74 | */ | ||
75 | #define WM8350_CHIP_REV_MASK 0x7000 | ||
76 | #define WM8350_CONF_STS_MASK 0x0C00 | ||
77 | #define WM8350_CUST_ID_MASK 0x00FF | ||
78 | |||
79 | /* | ||
80 | * R3 (0x03) - System Control 1 | ||
81 | */ | ||
82 | #define WM8350_CHIP_ON 0x8000 | ||
83 | #define WM8350_POWERCYCLE 0x2000 | ||
84 | #define WM8350_VCC_FAULT_OV 0x1000 | ||
85 | #define WM8350_REG_RSTB_TIME_MASK 0x0C00 | ||
86 | #define WM8350_BG_SLEEP 0x0200 | ||
87 | #define WM8350_MEM_VALID 0x0020 | ||
88 | #define WM8350_CHIP_SET_UP 0x0010 | ||
89 | #define WM8350_ON_DEB_T 0x0008 | ||
90 | #define WM8350_ON_POL 0x0002 | ||
91 | #define WM8350_IRQ_POL 0x0001 | ||
92 | |||
93 | /* | ||
94 | * R4 (0x04) - System Control 2 | ||
95 | */ | ||
96 | #define WM8350_USB_SUSPEND_8MA 0x8000 | ||
97 | #define WM8350_USB_SUSPEND 0x4000 | ||
98 | #define WM8350_USB_MSTR 0x2000 | ||
99 | #define WM8350_USB_MSTR_SRC 0x1000 | ||
100 | #define WM8350_USB_500MA 0x0800 | ||
101 | #define WM8350_USB_NOLIM 0x0400 | ||
102 | |||
103 | /* | ||
104 | * R5 (0x05) - System Hibernate | ||
105 | */ | ||
106 | #define WM8350_HIBERNATE 0x8000 | ||
107 | #define WM8350_WDOG_HIB_MODE 0x0080 | ||
108 | #define WM8350_REG_HIB_STARTUP_SEQ 0x0040 | ||
109 | #define WM8350_REG_RESET_HIB_MODE 0x0020 | ||
110 | #define WM8350_RST_HIB_MODE 0x0010 | ||
111 | #define WM8350_IRQ_HIB_MODE 0x0008 | ||
112 | #define WM8350_MEMRST_HIB_MODE 0x0004 | ||
113 | #define WM8350_PCCOMP_HIB_MODE 0x0002 | ||
114 | #define WM8350_TEMPMON_HIB_MODE 0x0001 | ||
115 | |||
116 | /* | ||
117 | * R6 (0x06) - Interface Control | ||
118 | */ | ||
119 | #define WM8350_USE_DEV_PINS 0x8000 | ||
120 | #define WM8350_USE_DEV_PINS_MASK 0x8000 | ||
121 | #define WM8350_USE_DEV_PINS_SHIFT 15 | ||
122 | #define WM8350_DEV_ADDR_MASK 0x6000 | ||
123 | #define WM8350_DEV_ADDR_SHIFT 13 | ||
124 | #define WM8350_CONFIG_DONE 0x1000 | ||
125 | #define WM8350_CONFIG_DONE_MASK 0x1000 | ||
126 | #define WM8350_CONFIG_DONE_SHIFT 12 | ||
127 | #define WM8350_RECONFIG_AT_ON 0x0800 | ||
128 | #define WM8350_RECONFIG_AT_ON_MASK 0x0800 | ||
129 | #define WM8350_RECONFIG_AT_ON_SHIFT 11 | ||
130 | #define WM8350_AUTOINC 0x0200 | ||
131 | #define WM8350_AUTOINC_MASK 0x0200 | ||
132 | #define WM8350_AUTOINC_SHIFT 9 | ||
133 | #define WM8350_ARA 0x0100 | ||
134 | #define WM8350_ARA_MASK 0x0100 | ||
135 | #define WM8350_ARA_SHIFT 8 | ||
136 | #define WM8350_SPI_CFG 0x0008 | ||
137 | #define WM8350_SPI_CFG_MASK 0x0008 | ||
138 | #define WM8350_SPI_CFG_SHIFT 3 | ||
139 | #define WM8350_SPI_4WIRE 0x0004 | ||
140 | #define WM8350_SPI_4WIRE_MASK 0x0004 | ||
141 | #define WM8350_SPI_4WIRE_SHIFT 2 | ||
142 | #define WM8350_SPI_3WIRE 0x0002 | ||
143 | #define WM8350_SPI_3WIRE_MASK 0x0002 | ||
144 | #define WM8350_SPI_3WIRE_SHIFT 1 | ||
145 | |||
146 | /* Bit values for R06 (0x06) */ | ||
147 | #define WM8350_USE_DEV_PINS_PRIMARY 0 | ||
148 | #define WM8350_USE_DEV_PINS_DEV 1 | ||
149 | |||
150 | #define WM8350_DEV_ADDR_34 0 | ||
151 | #define WM8350_DEV_ADDR_36 1 | ||
152 | #define WM8350_DEV_ADDR_3C 2 | ||
153 | #define WM8350_DEV_ADDR_3E 3 | ||
154 | |||
155 | #define WM8350_CONFIG_DONE_OFF 0 | ||
156 | #define WM8350_CONFIG_DONE_DONE 1 | ||
157 | |||
158 | #define WM8350_RECONFIG_AT_ON_OFF 0 | ||
159 | #define WM8350_RECONFIG_AT_ON_ON 1 | ||
160 | |||
161 | #define WM8350_AUTOINC_OFF 0 | ||
162 | #define WM8350_AUTOINC_ON 1 | ||
163 | |||
164 | #define WM8350_ARA_OFF 0 | ||
165 | #define WM8350_ARA_ON 1 | ||
166 | |||
167 | #define WM8350_SPI_CFG_CMOS 0 | ||
168 | #define WM8350_SPI_CFG_OD 1 | ||
169 | |||
170 | #define WM8350_SPI_4WIRE_3WIRE 0 | ||
171 | #define WM8350_SPI_4WIRE_4WIRE 1 | ||
172 | |||
173 | #define WM8350_SPI_3WIRE_I2C 0 | ||
174 | #define WM8350_SPI_3WIRE_SPI 1 | ||
175 | |||
176 | /* | ||
177 | * R8 (0x08) - Power mgmt (1) | ||
178 | */ | ||
179 | #define WM8350_CODEC_ISEL_MASK 0xC000 | ||
180 | #define WM8350_VBUFEN 0x2000 | ||
181 | #define WM8350_OUTPUT_DRAIN_EN 0x0400 | ||
182 | #define WM8350_MIC_DET_ENA 0x0100 | ||
183 | #define WM8350_BIASEN 0x0020 | ||
184 | #define WM8350_MICBEN 0x0010 | ||
185 | #define WM8350_VMIDEN 0x0004 | ||
186 | #define WM8350_VMID_MASK 0x0003 | ||
187 | #define WM8350_VMID_SHIFT 0 | ||
188 | |||
189 | /* | ||
190 | * R9 (0x09) - Power mgmt (2) | ||
191 | */ | ||
192 | #define WM8350_IN3R_ENA 0x0800 | ||
193 | #define WM8350_IN3L_ENA 0x0400 | ||
194 | #define WM8350_INR_ENA 0x0200 | ||
195 | #define WM8350_INL_ENA 0x0100 | ||
196 | #define WM8350_MIXINR_ENA 0x0080 | ||
197 | #define WM8350_MIXINL_ENA 0x0040 | ||
198 | #define WM8350_OUT4_ENA 0x0020 | ||
199 | #define WM8350_OUT3_ENA 0x0010 | ||
200 | #define WM8350_MIXOUTR_ENA 0x0002 | ||
201 | #define WM8350_MIXOUTL_ENA 0x0001 | ||
202 | |||
203 | /* | ||
204 | * R10 (0x0A) - Power mgmt (3) | ||
205 | */ | ||
206 | #define WM8350_IN3R_TO_OUT2R 0x0080 | ||
207 | #define WM8350_OUT2R_ENA 0x0008 | ||
208 | #define WM8350_OUT2L_ENA 0x0004 | ||
209 | #define WM8350_OUT1R_ENA 0x0002 | ||
210 | #define WM8350_OUT1L_ENA 0x0001 | ||
211 | |||
212 | /* | ||
213 | * R11 (0x0B) - Power mgmt (4) | ||
214 | */ | ||
215 | #define WM8350_SYSCLK_ENA 0x4000 | ||
216 | #define WM8350_ADC_HPF_ENA 0x2000 | ||
217 | #define WM8350_FLL_ENA 0x0800 | ||
218 | #define WM8350_FLL_OSC_ENA 0x0400 | ||
219 | #define WM8350_TOCLK_ENA 0x0100 | ||
220 | #define WM8350_DACR_ENA 0x0020 | ||
221 | #define WM8350_DACL_ENA 0x0010 | ||
222 | #define WM8350_ADCR_ENA 0x0008 | ||
223 | #define WM8350_ADCL_ENA 0x0004 | ||
224 | |||
225 | /* | ||
226 | * R12 (0x0C) - Power mgmt (5) | ||
227 | */ | ||
228 | #define WM8350_CODEC_ENA 0x1000 | ||
229 | #define WM8350_RTC_TICK_ENA 0x0800 | ||
230 | #define WM8350_OSC32K_ENA 0x0400 | ||
231 | #define WM8350_CHG_ENA 0x0200 | ||
232 | #define WM8350_ACC_DET_ENA 0x0100 | ||
233 | #define WM8350_AUXADC_ENA 0x0080 | ||
234 | #define WM8350_DCMP4_ENA 0x0008 | ||
235 | #define WM8350_DCMP3_ENA 0x0004 | ||
236 | #define WM8350_DCMP2_ENA 0x0002 | ||
237 | #define WM8350_DCMP1_ENA 0x0001 | ||
238 | |||
239 | /* | ||
240 | * R13 (0x0D) - Power mgmt (6) | ||
241 | */ | ||
242 | #define WM8350_LS_ENA 0x8000 | ||
243 | #define WM8350_LDO4_ENA 0x0800 | ||
244 | #define WM8350_LDO3_ENA 0x0400 | ||
245 | #define WM8350_LDO2_ENA 0x0200 | ||
246 | #define WM8350_LDO1_ENA 0x0100 | ||
247 | #define WM8350_DC6_ENA 0x0020 | ||
248 | #define WM8350_DC5_ENA 0x0010 | ||
249 | #define WM8350_DC4_ENA 0x0008 | ||
250 | #define WM8350_DC3_ENA 0x0004 | ||
251 | #define WM8350_DC2_ENA 0x0002 | ||
252 | #define WM8350_DC1_ENA 0x0001 | ||
253 | |||
254 | /* | ||
255 | * R14 (0x0E) - Power mgmt (7) | ||
256 | */ | ||
257 | #define WM8350_CS2_ENA 0x0002 | ||
258 | #define WM8350_CS1_ENA 0x0001 | ||
259 | |||
260 | /* | ||
261 | * R24 (0x18) - System Interrupts | ||
262 | */ | ||
263 | #define WM8350_OC_INT 0x2000 | ||
264 | #define WM8350_UV_INT 0x1000 | ||
265 | #define WM8350_PUTO_INT 0x0800 | ||
266 | #define WM8350_CS_INT 0x0200 | ||
267 | #define WM8350_EXT_INT 0x0100 | ||
268 | #define WM8350_CODEC_INT 0x0080 | ||
269 | #define WM8350_GP_INT 0x0040 | ||
270 | #define WM8350_AUXADC_INT 0x0020 | ||
271 | #define WM8350_RTC_INT 0x0010 | ||
272 | #define WM8350_SYS_INT 0x0008 | ||
273 | #define WM8350_CHG_INT 0x0004 | ||
274 | #define WM8350_USB_INT 0x0002 | ||
275 | #define WM8350_WKUP_INT 0x0001 | ||
276 | |||
277 | /* | ||
278 | * R25 (0x19) - Interrupt Status 1 | ||
279 | */ | ||
280 | #define WM8350_CHG_BAT_HOT_EINT 0x8000 | ||
281 | #define WM8350_CHG_BAT_COLD_EINT 0x4000 | ||
282 | #define WM8350_CHG_BAT_FAIL_EINT 0x2000 | ||
283 | #define WM8350_CHG_TO_EINT 0x1000 | ||
284 | #define WM8350_CHG_END_EINT 0x0800 | ||
285 | #define WM8350_CHG_START_EINT 0x0400 | ||
286 | #define WM8350_CHG_FAST_RDY_EINT 0x0200 | ||
287 | #define WM8350_RTC_PER_EINT 0x0080 | ||
288 | #define WM8350_RTC_SEC_EINT 0x0040 | ||
289 | #define WM8350_RTC_ALM_EINT 0x0020 | ||
290 | #define WM8350_CHG_VBATT_LT_3P9_EINT 0x0004 | ||
291 | #define WM8350_CHG_VBATT_LT_3P1_EINT 0x0002 | ||
292 | #define WM8350_CHG_VBATT_LT_2P85_EINT 0x0001 | ||
293 | |||
294 | /* | ||
295 | * R26 (0x1A) - Interrupt Status 2 | ||
296 | */ | ||
297 | #define WM8350_CS1_EINT 0x2000 | ||
298 | #define WM8350_CS2_EINT 0x1000 | ||
299 | #define WM8350_USB_LIMIT_EINT 0x0400 | ||
300 | #define WM8350_AUXADC_DATARDY_EINT 0x0100 | ||
301 | #define WM8350_AUXADC_DCOMP4_EINT 0x0080 | ||
302 | #define WM8350_AUXADC_DCOMP3_EINT 0x0040 | ||
303 | #define WM8350_AUXADC_DCOMP2_EINT 0x0020 | ||
304 | #define WM8350_AUXADC_DCOMP1_EINT 0x0010 | ||
305 | #define WM8350_SYS_HYST_COMP_FAIL_EINT 0x0008 | ||
306 | #define WM8350_SYS_CHIP_GT115_EINT 0x0004 | ||
307 | #define WM8350_SYS_CHIP_GT140_EINT 0x0002 | ||
308 | #define WM8350_SYS_WDOG_TO_EINT 0x0001 | ||
309 | |||
310 | /* | ||
311 | * R27 (0x1B) - Power Up Interrupt Status | ||
312 | */ | ||
313 | #define WM8350_PUTO_LDO4_EINT 0x0800 | ||
314 | #define WM8350_PUTO_LDO3_EINT 0x0400 | ||
315 | #define WM8350_PUTO_LDO2_EINT 0x0200 | ||
316 | #define WM8350_PUTO_LDO1_EINT 0x0100 | ||
317 | #define WM8350_PUTO_DC6_EINT 0x0020 | ||
318 | #define WM8350_PUTO_DC5_EINT 0x0010 | ||
319 | #define WM8350_PUTO_DC4_EINT 0x0008 | ||
320 | #define WM8350_PUTO_DC3_EINT 0x0004 | ||
321 | #define WM8350_PUTO_DC2_EINT 0x0002 | ||
322 | #define WM8350_PUTO_DC1_EINT 0x0001 | ||
323 | |||
324 | /* | ||
325 | * R28 (0x1C) - Under Voltage Interrupt status | ||
326 | */ | ||
327 | #define WM8350_UV_LDO4_EINT 0x0800 | ||
328 | #define WM8350_UV_LDO3_EINT 0x0400 | ||
329 | #define WM8350_UV_LDO2_EINT 0x0200 | ||
330 | #define WM8350_UV_LDO1_EINT 0x0100 | ||
331 | #define WM8350_UV_DC6_EINT 0x0020 | ||
332 | #define WM8350_UV_DC5_EINT 0x0010 | ||
333 | #define WM8350_UV_DC4_EINT 0x0008 | ||
334 | #define WM8350_UV_DC3_EINT 0x0004 | ||
335 | #define WM8350_UV_DC2_EINT 0x0002 | ||
336 | #define WM8350_UV_DC1_EINT 0x0001 | ||
337 | |||
338 | /* | ||
339 | * R29 (0x1D) - Over Current Interrupt status | ||
340 | */ | ||
341 | #define WM8350_OC_LS_EINT 0x8000 | ||
342 | |||
343 | /* | ||
344 | * R30 (0x1E) - GPIO Interrupt Status | ||
345 | */ | ||
346 | #define WM8350_GP12_EINT 0x1000 | ||
347 | #define WM8350_GP11_EINT 0x0800 | ||
348 | #define WM8350_GP10_EINT 0x0400 | ||
349 | #define WM8350_GP9_EINT 0x0200 | ||
350 | #define WM8350_GP8_EINT 0x0100 | ||
351 | #define WM8350_GP7_EINT 0x0080 | ||
352 | #define WM8350_GP6_EINT 0x0040 | ||
353 | #define WM8350_GP5_EINT 0x0020 | ||
354 | #define WM8350_GP4_EINT 0x0010 | ||
355 | #define WM8350_GP3_EINT 0x0008 | ||
356 | #define WM8350_GP2_EINT 0x0004 | ||
357 | #define WM8350_GP1_EINT 0x0002 | ||
358 | #define WM8350_GP0_EINT 0x0001 | ||
359 | |||
360 | /* | ||
361 | * R31 (0x1F) - Comparator Interrupt Status | ||
362 | */ | ||
363 | #define WM8350_EXT_USB_FB_EINT 0x8000 | ||
364 | #define WM8350_EXT_WALL_FB_EINT 0x4000 | ||
365 | #define WM8350_EXT_BAT_FB_EINT 0x2000 | ||
366 | #define WM8350_CODEC_JCK_DET_L_EINT 0x0800 | ||
367 | #define WM8350_CODEC_JCK_DET_R_EINT 0x0400 | ||
368 | #define WM8350_CODEC_MICSCD_EINT 0x0200 | ||
369 | #define WM8350_CODEC_MICD_EINT 0x0100 | ||
370 | #define WM8350_WKUP_OFF_STATE_EINT 0x0040 | ||
371 | #define WM8350_WKUP_HIB_STATE_EINT 0x0020 | ||
372 | #define WM8350_WKUP_CONV_FAULT_EINT 0x0010 | ||
373 | #define WM8350_WKUP_WDOG_RST_EINT 0x0008 | ||
374 | #define WM8350_WKUP_GP_PWR_ON_EINT 0x0004 | ||
375 | #define WM8350_WKUP_ONKEY_EINT 0x0002 | ||
376 | #define WM8350_WKUP_GP_WAKEUP_EINT 0x0001 | ||
377 | |||
378 | /* | ||
379 | * R32 (0x20) - System Interrupts Mask | ||
380 | */ | ||
381 | #define WM8350_IM_OC_INT 0x2000 | ||
382 | #define WM8350_IM_UV_INT 0x1000 | ||
383 | #define WM8350_IM_PUTO_INT 0x0800 | ||
384 | #define WM8350_IM_SPARE_INT 0x0400 | ||
385 | #define WM8350_IM_CS_INT 0x0200 | ||
386 | #define WM8350_IM_EXT_INT 0x0100 | ||
387 | #define WM8350_IM_CODEC_INT 0x0080 | ||
388 | #define WM8350_IM_GP_INT 0x0040 | ||
389 | #define WM8350_IM_AUXADC_INT 0x0020 | ||
390 | #define WM8350_IM_RTC_INT 0x0010 | ||
391 | #define WM8350_IM_SYS_INT 0x0008 | ||
392 | #define WM8350_IM_CHG_INT 0x0004 | ||
393 | #define WM8350_IM_USB_INT 0x0002 | ||
394 | #define WM8350_IM_WKUP_INT 0x0001 | ||
395 | |||
396 | /* | ||
397 | * R33 (0x21) - Interrupt Status 1 Mask | ||
398 | */ | ||
399 | #define WM8350_IM_CHG_BAT_HOT_EINT 0x8000 | ||
400 | #define WM8350_IM_CHG_BAT_COLD_EINT 0x4000 | ||
401 | #define WM8350_IM_CHG_BAT_FAIL_EINT 0x2000 | ||
402 | #define WM8350_IM_CHG_TO_EINT 0x1000 | ||
403 | #define WM8350_IM_CHG_END_EINT 0x0800 | ||
404 | #define WM8350_IM_CHG_START_EINT 0x0400 | ||
405 | #define WM8350_IM_CHG_FAST_RDY_EINT 0x0200 | ||
406 | #define WM8350_IM_RTC_PER_EINT 0x0080 | ||
407 | #define WM8350_IM_RTC_SEC_EINT 0x0040 | ||
408 | #define WM8350_IM_RTC_ALM_EINT 0x0020 | ||
409 | #define WM8350_IM_CHG_VBATT_LT_3P9_EINT 0x0004 | ||
410 | #define WM8350_IM_CHG_VBATT_LT_3P1_EINT 0x0002 | ||
411 | #define WM8350_IM_CHG_VBATT_LT_2P85_EINT 0x0001 | ||
412 | |||
413 | /* | ||
414 | * R34 (0x22) - Interrupt Status 2 Mask | ||
415 | */ | ||
416 | #define WM8350_IM_SPARE2_EINT 0x8000 | ||
417 | #define WM8350_IM_SPARE1_EINT 0x4000 | ||
418 | #define WM8350_IM_CS1_EINT 0x2000 | ||
419 | #define WM8350_IM_CS2_EINT 0x1000 | ||
420 | #define WM8350_IM_USB_LIMIT_EINT 0x0400 | ||
421 | #define WM8350_IM_AUXADC_DATARDY_EINT 0x0100 | ||
422 | #define WM8350_IM_AUXADC_DCOMP4_EINT 0x0080 | ||
423 | #define WM8350_IM_AUXADC_DCOMP3_EINT 0x0040 | ||
424 | #define WM8350_IM_AUXADC_DCOMP2_EINT 0x0020 | ||
425 | #define WM8350_IM_AUXADC_DCOMP1_EINT 0x0010 | ||
426 | #define WM8350_IM_SYS_HYST_COMP_FAIL_EINT 0x0008 | ||
427 | #define WM8350_IM_SYS_CHIP_GT115_EINT 0x0004 | ||
428 | #define WM8350_IM_SYS_CHIP_GT140_EINT 0x0002 | ||
429 | #define WM8350_IM_SYS_WDOG_TO_EINT 0x0001 | ||
430 | |||
431 | /* | ||
432 | * R35 (0x23) - Power Up Interrupt Status Mask | ||
433 | */ | ||
434 | #define WM8350_IM_PUTO_LDO4_EINT 0x0800 | ||
435 | #define WM8350_IM_PUTO_LDO3_EINT 0x0400 | ||
436 | #define WM8350_IM_PUTO_LDO2_EINT 0x0200 | ||
437 | #define WM8350_IM_PUTO_LDO1_EINT 0x0100 | ||
438 | #define WM8350_IM_PUTO_DC6_EINT 0x0020 | ||
439 | #define WM8350_IM_PUTO_DC5_EINT 0x0010 | ||
440 | #define WM8350_IM_PUTO_DC4_EINT 0x0008 | ||
441 | #define WM8350_IM_PUTO_DC3_EINT 0x0004 | ||
442 | #define WM8350_IM_PUTO_DC2_EINT 0x0002 | ||
443 | #define WM8350_IM_PUTO_DC1_EINT 0x0001 | ||
444 | |||
445 | /* | ||
446 | * R36 (0x24) - Under Voltage Interrupt status Mask | ||
447 | */ | ||
448 | #define WM8350_IM_UV_LDO4_EINT 0x0800 | ||
449 | #define WM8350_IM_UV_LDO3_EINT 0x0400 | ||
450 | #define WM8350_IM_UV_LDO2_EINT 0x0200 | ||
451 | #define WM8350_IM_UV_LDO1_EINT 0x0100 | ||
452 | #define WM8350_IM_UV_DC6_EINT 0x0020 | ||
453 | #define WM8350_IM_UV_DC5_EINT 0x0010 | ||
454 | #define WM8350_IM_UV_DC4_EINT 0x0008 | ||
455 | #define WM8350_IM_UV_DC3_EINT 0x0004 | ||
456 | #define WM8350_IM_UV_DC2_EINT 0x0002 | ||
457 | #define WM8350_IM_UV_DC1_EINT 0x0001 | ||
458 | |||
459 | /* | ||
460 | * R37 (0x25) - Over Current Interrupt status Mask | ||
461 | */ | ||
462 | #define WM8350_IM_OC_LS_EINT 0x8000 | ||
463 | |||
464 | /* | ||
465 | * R38 (0x26) - GPIO Interrupt Status Mask | ||
466 | */ | ||
467 | #define WM8350_IM_GP12_EINT 0x1000 | ||
468 | #define WM8350_IM_GP11_EINT 0x0800 | ||
469 | #define WM8350_IM_GP10_EINT 0x0400 | ||
470 | #define WM8350_IM_GP9_EINT 0x0200 | ||
471 | #define WM8350_IM_GP8_EINT 0x0100 | ||
472 | #define WM8350_IM_GP7_EINT 0x0080 | ||
473 | #define WM8350_IM_GP6_EINT 0x0040 | ||
474 | #define WM8350_IM_GP5_EINT 0x0020 | ||
475 | #define WM8350_IM_GP4_EINT 0x0010 | ||
476 | #define WM8350_IM_GP3_EINT 0x0008 | ||
477 | #define WM8350_IM_GP2_EINT 0x0004 | ||
478 | #define WM8350_IM_GP1_EINT 0x0002 | ||
479 | #define WM8350_IM_GP0_EINT 0x0001 | ||
480 | |||
481 | /* | ||
482 | * R39 (0x27) - Comparator Interrupt Status Mask | ||
483 | */ | ||
484 | #define WM8350_IM_EXT_USB_FB_EINT 0x8000 | ||
485 | #define WM8350_IM_EXT_WALL_FB_EINT 0x4000 | ||
486 | #define WM8350_IM_EXT_BAT_FB_EINT 0x2000 | ||
487 | #define WM8350_IM_CODEC_JCK_DET_L_EINT 0x0800 | ||
488 | #define WM8350_IM_CODEC_JCK_DET_R_EINT 0x0400 | ||
489 | #define WM8350_IM_CODEC_MICSCD_EINT 0x0200 | ||
490 | #define WM8350_IM_CODEC_MICD_EINT 0x0100 | ||
491 | #define WM8350_IM_WKUP_OFF_STATE_EINT 0x0040 | ||
492 | #define WM8350_IM_WKUP_HIB_STATE_EINT 0x0020 | ||
493 | #define WM8350_IM_WKUP_CONV_FAULT_EINT 0x0010 | ||
494 | #define WM8350_IM_WKUP_WDOG_RST_EINT 0x0008 | ||
495 | #define WM8350_IM_WKUP_GP_PWR_ON_EINT 0x0004 | ||
496 | #define WM8350_IM_WKUP_ONKEY_EINT 0x0002 | ||
497 | #define WM8350_IM_WKUP_GP_WAKEUP_EINT 0x0001 | ||
498 | |||
499 | /* | ||
500 | * R220 (0xDC) - RAM BIST 1 | ||
501 | */ | ||
502 | #define WM8350_READ_STATUS 0x0800 | ||
503 | #define WM8350_TSTRAM_CLK 0x0100 | ||
504 | #define WM8350_TSTRAM_CLK_ENA 0x0080 | ||
505 | #define WM8350_STARTSEQ 0x0040 | ||
506 | #define WM8350_READ_SRC 0x0020 | ||
507 | #define WM8350_COUNT_DIR 0x0010 | ||
508 | #define WM8350_TSTRAM_MODE_MASK 0x000E | ||
509 | #define WM8350_TSTRAM_ENA 0x0001 | ||
510 | |||
511 | /* | ||
512 | * R225 (0xE1) - DCDC/LDO status | ||
513 | */ | ||
514 | #define WM8350_LS_STS 0x8000 | ||
515 | #define WM8350_LDO4_STS 0x0800 | ||
516 | #define WM8350_LDO3_STS 0x0400 | ||
517 | #define WM8350_LDO2_STS 0x0200 | ||
518 | #define WM8350_LDO1_STS 0x0100 | ||
519 | #define WM8350_DC6_STS 0x0020 | ||
520 | #define WM8350_DC5_STS 0x0010 | ||
521 | #define WM8350_DC4_STS 0x0008 | ||
522 | #define WM8350_DC3_STS 0x0004 | ||
523 | #define WM8350_DC2_STS 0x0002 | ||
524 | #define WM8350_DC1_STS 0x0001 | ||
525 | |||
526 | /* WM8350 wake up conditions */ | ||
527 | #define WM8350_IRQ_WKUP_OFF_STATE 43 | ||
528 | #define WM8350_IRQ_WKUP_HIB_STATE 44 | ||
529 | #define WM8350_IRQ_WKUP_CONV_FAULT 45 | ||
530 | #define WM8350_IRQ_WKUP_WDOG_RST 46 | ||
531 | #define WM8350_IRQ_WKUP_GP_PWR_ON 47 | ||
532 | #define WM8350_IRQ_WKUP_ONKEY 48 | ||
533 | #define WM8350_IRQ_WKUP_GP_WAKEUP 49 | ||
534 | |||
535 | /* wm8350 chip revisions */ | ||
536 | #define WM8350_REV_E 0x4 | ||
537 | #define WM8350_REV_F 0x5 | ||
538 | #define WM8350_REV_G 0x6 | ||
539 | |||
540 | #define WM8350_NUM_IRQ 63 | ||
541 | |||
542 | struct wm8350_reg_access { | ||
543 | u16 readable; /* Mask of readable bits */ | ||
544 | u16 writable; /* Mask of writable bits */ | ||
545 | u16 vol; /* Mask of volatile bits */ | ||
546 | }; | ||
547 | extern const struct wm8350_reg_access wm8350_reg_io_map[]; | ||
548 | extern const u16 wm8350_mode0_defaults[]; | ||
549 | extern const u16 wm8350_mode1_defaults[]; | ||
550 | extern const u16 wm8350_mode2_defaults[]; | ||
551 | extern const u16 wm8350_mode3_defaults[]; | ||
552 | |||
553 | struct wm8350; | ||
554 | |||
555 | struct wm8350_irq { | ||
556 | void (*handler) (struct wm8350 *, int, void *); | ||
557 | void *data; | ||
558 | }; | ||
559 | |||
560 | struct wm8350 { | ||
561 | int rev; /* chip revision */ | ||
562 | |||
563 | struct device *dev; | ||
564 | |||
565 | /* device IO */ | ||
566 | union { | ||
567 | struct i2c_client *i2c_client; | ||
568 | struct spi_device *spi_device; | ||
569 | }; | ||
570 | int (*read_dev)(struct wm8350 *wm8350, char reg, int size, void *dest); | ||
571 | int (*write_dev)(struct wm8350 *wm8350, char reg, int size, | ||
572 | void *src); | ||
573 | u16 *reg_cache; | ||
574 | |||
575 | /* Interrupt handling */ | ||
576 | struct work_struct irq_work; | ||
577 | struct mutex irq_mutex; /* IRQ table mutex */ | ||
578 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | ||
579 | int chip_irq; | ||
580 | |||
581 | /* Client devices */ | ||
582 | struct wm8350_codec codec; | ||
583 | struct wm8350_gpio gpio; | ||
584 | struct wm8350_pmic pmic; | ||
585 | struct wm8350_power power; | ||
586 | struct wm8350_rtc rtc; | ||
587 | struct wm8350_wdt wdt; | ||
588 | }; | ||
589 | |||
590 | /** | ||
591 | * Data to be supplied by the platform to initialise the WM8350. | ||
592 | * | ||
593 | * @init: Function called during driver initialisation. Should be | ||
594 | * used by the platform to configure GPIO functions and similar. | ||
595 | */ | ||
596 | struct wm8350_platform_data { | ||
597 | int (*init)(struct wm8350 *wm8350); | ||
598 | }; | ||
599 | |||
600 | |||
601 | /* | ||
602 | * WM8350 device initialisation and exit. | ||
603 | */ | ||
604 | int wm8350_device_init(struct wm8350 *wm8350, int irq, | ||
605 | struct wm8350_platform_data *pdata); | ||
606 | void wm8350_device_exit(struct wm8350 *wm8350); | ||
607 | |||
608 | /* | ||
609 | * WM8350 device IO | ||
610 | */ | ||
611 | int wm8350_clear_bits(struct wm8350 *wm8350, u16 reg, u16 mask); | ||
612 | int wm8350_set_bits(struct wm8350 *wm8350, u16 reg, u16 mask); | ||
613 | u16 wm8350_reg_read(struct wm8350 *wm8350, int reg); | ||
614 | int wm8350_reg_write(struct wm8350 *wm8350, int reg, u16 val); | ||
615 | int wm8350_reg_lock(struct wm8350 *wm8350); | ||
616 | int wm8350_reg_unlock(struct wm8350 *wm8350); | ||
617 | int wm8350_block_read(struct wm8350 *wm8350, int reg, int size, u16 *dest); | ||
618 | int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | ||
619 | |||
620 | /* | ||
621 | * WM8350 internal interrupts | ||
622 | */ | ||
623 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | ||
624 | void (*handler) (struct wm8350 *, int, void *), | ||
625 | void *data); | ||
626 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); | ||
627 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | ||
628 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | ||
629 | |||
630 | |||
631 | #endif | ||
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h new file mode 100644 index 000000000000..ed91e8f5d298 --- /dev/null +++ b/include/linux/mfd/wm8350/gpio.h | |||
@@ -0,0 +1,342 @@ | |||
1 | /* | ||
2 | * gpio.h -- GPIO Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_WM8350_GPIO_H_ | ||
14 | #define __LINUX_MFD_WM8350_GPIO_H_ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | /* | ||
19 | * GPIO Registers. | ||
20 | */ | ||
21 | #define WM8350_GPIO_DEBOUNCE 0x80 | ||
22 | #define WM8350_GPIO_PIN_PULL_UP_CONTROL 0x81 | ||
23 | #define WM8350_GPIO_PULL_DOWN_CONTROL 0x82 | ||
24 | #define WM8350_GPIO_INT_MODE 0x83 | ||
25 | #define WM8350_GPIO_CONTROL 0x85 | ||
26 | #define WM8350_GPIO_CONFIGURATION_I_O 0x86 | ||
27 | #define WM8350_GPIO_PIN_POLARITY_TYPE 0x87 | ||
28 | #define WM8350_GPIO_FUNCTION_SELECT_1 0x8C | ||
29 | #define WM8350_GPIO_FUNCTION_SELECT_2 0x8D | ||
30 | #define WM8350_GPIO_FUNCTION_SELECT_3 0x8E | ||
31 | #define WM8350_GPIO_FUNCTION_SELECT_4 0x8F | ||
32 | |||
33 | /* | ||
34 | * GPIO Functions | ||
35 | */ | ||
36 | #define WM8350_GPIO0_GPIO_IN 0x0 | ||
37 | #define WM8350_GPIO0_GPIO_OUT 0x0 | ||
38 | #define WM8350_GPIO0_PWR_ON_IN 0x1 | ||
39 | #define WM8350_GPIO0_PWR_ON_OUT 0x1 | ||
40 | #define WM8350_GPIO0_LDO_EN_IN 0x2 | ||
41 | #define WM8350_GPIO0_VRTC_OUT 0x2 | ||
42 | #define WM8350_GPIO0_LPWR1_IN 0x3 | ||
43 | #define WM8350_GPIO0_POR_B_OUT 0x3 | ||
44 | |||
45 | #define WM8350_GPIO1_GPIO_IN 0x0 | ||
46 | #define WM8350_GPIO1_GPIO_OUT 0x0 | ||
47 | #define WM8350_GPIO1_PWR_ON_IN 0x1 | ||
48 | #define WM8350_GPIO1_DO_CONF_OUT 0x1 | ||
49 | #define WM8350_GPIO1_LDO_EN_IN 0x2 | ||
50 | #define WM8350_GPIO1_RESET_OUT 0x2 | ||
51 | #define WM8350_GPIO1_LPWR2_IN 0x3 | ||
52 | #define WM8350_GPIO1_MEMRST_OUT 0x3 | ||
53 | |||
54 | #define WM8350_GPIO2_GPIO_IN 0x0 | ||
55 | #define WM8350_GPIO2_GPIO_OUT 0x0 | ||
56 | #define WM8350_GPIO2_PWR_ON_IN 0x1 | ||
57 | #define WM8350_GPIO2_PWR_ON_OUT 0x1 | ||
58 | #define WM8350_GPIO2_WAKE_UP_IN 0x2 | ||
59 | #define WM8350_GPIO2_VRTC_OUT 0x2 | ||
60 | #define WM8350_GPIO2_32KHZ_IN 0x3 | ||
61 | #define WM8350_GPIO2_32KHZ_OUT 0x3 | ||
62 | |||
63 | #define WM8350_GPIO3_GPIO_IN 0x0 | ||
64 | #define WM8350_GPIO3_GPIO_OUT 0x0 | ||
65 | #define WM8350_GPIO3_PWR_ON_IN 0x1 | ||
66 | #define WM8350_GPIO3_P_CLK_OUT 0x1 | ||
67 | #define WM8350_GPIO3_LDO_EN_IN 0x2 | ||
68 | #define WM8350_GPIO3_VRTC_OUT 0x2 | ||
69 | #define WM8350_GPIO3_PWR_OFF_IN 0x3 | ||
70 | #define WM8350_GPIO3_32KHZ_OUT 0x3 | ||
71 | |||
72 | #define WM8350_GPIO4_GPIO_IN 0x0 | ||
73 | #define WM8350_GPIO4_GPIO_OUT 0x0 | ||
74 | #define WM8350_GPIO4_MR_IN 0x1 | ||
75 | #define WM8350_GPIO4_MEM_RST_OUT 0x1 | ||
76 | #define WM8350_GPIO4_FLASH_IN 0x2 | ||
77 | #define WM8350_GPIO4_ADA_OUT 0x2 | ||
78 | #define WM8350_GPIO4_HIBERNATE_IN 0x3 | ||
79 | #define WM8350_GPIO4_FLASH_OUT 0x3 | ||
80 | #define WM8350_GPIO4_MICDET_OUT 0x4 | ||
81 | #define WM8350_GPIO4_MICSHT_OUT 0x5 | ||
82 | |||
83 | #define WM8350_GPIO5_GPIO_IN 0x0 | ||
84 | #define WM8350_GPIO5_GPIO_OUT 0x0 | ||
85 | #define WM8350_GPIO5_LPWR1_IN 0x1 | ||
86 | #define WM8350_GPIO5_P_CLK_OUT 0x1 | ||
87 | #define WM8350_GPIO5_ADCLRCLK_IN 0x2 | ||
88 | #define WM8350_GPIO5_ADCLRCLK_OUT 0x2 | ||
89 | #define WM8350_GPIO5_HIBERNATE_IN 0x3 | ||
90 | #define WM8350_GPIO5_32KHZ_OUT 0x3 | ||
91 | #define WM8350_GPIO5_MICDET_OUT 0x4 | ||
92 | #define WM8350_GPIO5_MICSHT_OUT 0x5 | ||
93 | #define WM8350_GPIO5_ADA_OUT 0x6 | ||
94 | #define WM8350_GPIO5_OPCLK_OUT 0x7 | ||
95 | |||
96 | #define WM8350_GPIO6_GPIO_IN 0x0 | ||
97 | #define WM8350_GPIO6_GPIO_OUT 0x0 | ||
98 | #define WM8350_GPIO6_LPWR2_IN 0x1 | ||
99 | #define WM8350_GPIO6_MEMRST_OUT 0x1 | ||
100 | #define WM8350_GPIO6_FLASH_IN 0x2 | ||
101 | #define WM8350_GPIO6_ADA_OUT 0x2 | ||
102 | #define WM8350_GPIO6_HIBERNATE_IN 0x3 | ||
103 | #define WM8350_GPIO6_RTC_OUT 0x3 | ||
104 | #define WM8350_GPIO6_MICDET_OUT 0x4 | ||
105 | #define WM8350_GPIO6_MICSHT_OUT 0x5 | ||
106 | #define WM8350_GPIO6_ADCLRCLKB_OUT 0x6 | ||
107 | #define WM8350_GPIO6_SDOUT_OUT 0x7 | ||
108 | |||
109 | #define WM8350_GPIO7_GPIO_IN 0x0 | ||
110 | #define WM8350_GPIO7_GPIO_OUT 0x0 | ||
111 | #define WM8350_GPIO7_LPWR3_IN 0x1 | ||
112 | #define WM8350_GPIO7_P_CLK_OUT 0x1 | ||
113 | #define WM8350_GPIO7_MASK_IN 0x2 | ||
114 | #define WM8350_GPIO7_VCC_FAULT_OUT 0x2 | ||
115 | #define WM8350_GPIO7_HIBERNATE_IN 0x3 | ||
116 | #define WM8350_GPIO7_BATT_FAULT_OUT 0x3 | ||
117 | #define WM8350_GPIO7_MICDET_OUT 0x4 | ||
118 | #define WM8350_GPIO7_MICSHT_OUT 0x5 | ||
119 | #define WM8350_GPIO7_ADA_OUT 0x6 | ||
120 | #define WM8350_GPIO7_CSB_IN 0x7 | ||
121 | |||
122 | #define WM8350_GPIO8_GPIO_IN 0x0 | ||
123 | #define WM8350_GPIO8_GPIO_OUT 0x0 | ||
124 | #define WM8350_GPIO8_MR_IN 0x1 | ||
125 | #define WM8350_GPIO8_VCC_FAULT_OUT 0x1 | ||
126 | #define WM8350_GPIO8_ADCBCLK_IN 0x2 | ||
127 | #define WM8350_GPIO8_ADCBCLK_OUT 0x2 | ||
128 | #define WM8350_GPIO8_PWR_OFF_IN 0x3 | ||
129 | #define WM8350_GPIO8_BATT_FAULT_OUT 0x3 | ||
130 | #define WM8350_GPIO8_ALTSCL_IN 0xf | ||
131 | |||
132 | #define WM8350_GPIO9_GPIO_IN 0x0 | ||
133 | #define WM8350_GPIO9_GPIO_OUT 0x0 | ||
134 | #define WM8350_GPIO9_HEARTBEAT_IN 0x1 | ||
135 | #define WM8350_GPIO9_VCC_FAULT_OUT 0x1 | ||
136 | #define WM8350_GPIO9_MASK_IN 0x2 | ||
137 | #define WM8350_GPIO9_LINE_GT_BATT_OUT 0x2 | ||
138 | #define WM8350_GPIO9_PWR_OFF_IN 0x3 | ||
139 | #define WM8350_GPIO9_BATT_FAULT_OUT 0x3 | ||
140 | #define WM8350_GPIO9_ALTSDA_OUT 0xf | ||
141 | |||
142 | #define WM8350_GPIO10_GPIO_IN 0x0 | ||
143 | #define WM8350_GPIO10_GPIO_OUT 0x0 | ||
144 | #define WM8350_GPIO10_ISINKC_OUT 0x1 | ||
145 | #define WM8350_GPIO10_PWR_OFF_IN 0x2 | ||
146 | #define WM8350_GPIO10_LINE_GT_BATT_OUT 0x2 | ||
147 | #define WM8350_GPIO10_CHD_IND_IN 0x3 | ||
148 | |||
149 | #define WM8350_GPIO11_GPIO_IN 0x0 | ||
150 | #define WM8350_GPIO11_GPIO_OUT 0x0 | ||
151 | #define WM8350_GPIO11_ISINKD_OUT 0x1 | ||
152 | #define WM8350_GPIO11_WAKEUP_IN 0x2 | ||
153 | #define WM8350_GPIO11_LINE_GT_BATT_OUT 0x2 | ||
154 | #define WM8350_GPIO11_CHD_IND_IN 0x3 | ||
155 | |||
156 | #define WM8350_GPIO12_GPIO_IN 0x0 | ||
157 | #define WM8350_GPIO12_GPIO_OUT 0x0 | ||
158 | #define WM8350_GPIO12_ISINKE_OUT 0x1 | ||
159 | #define WM8350_GPIO12_LINE_GT_BATT_OUT 0x2 | ||
160 | #define WM8350_GPIO12_LINE_EN_OUT 0x3 | ||
161 | #define WM8350_GPIO12_32KHZ_OUT 0x4 | ||
162 | |||
163 | #define WM8350_GPIO_DIR_IN 0 | ||
164 | #define WM8350_GPIO_DIR_OUT 1 | ||
165 | #define WM8350_GPIO_ACTIVE_LOW 0 | ||
166 | #define WM8350_GPIO_ACTIVE_HIGH 1 | ||
167 | #define WM8350_GPIO_PULL_NONE 0 | ||
168 | #define WM8350_GPIO_PULL_UP 1 | ||
169 | #define WM8350_GPIO_PULL_DOWN 2 | ||
170 | #define WM8350_GPIO_INVERT_OFF 0 | ||
171 | #define WM8350_GPIO_INVERT_ON 1 | ||
172 | #define WM8350_GPIO_DEBOUNCE_OFF 0 | ||
173 | #define WM8350_GPIO_DEBOUNCE_ON 1 | ||
174 | |||
175 | /* | ||
176 | * R128 (0x80) - GPIO Debounce | ||
177 | */ | ||
178 | #define WM8350_GP12_DB 0x1000 | ||
179 | #define WM8350_GP11_DB 0x0800 | ||
180 | #define WM8350_GP10_DB 0x0400 | ||
181 | #define WM8350_GP9_DB 0x0200 | ||
182 | #define WM8350_GP8_DB 0x0100 | ||
183 | #define WM8350_GP7_DB 0x0080 | ||
184 | #define WM8350_GP6_DB 0x0040 | ||
185 | #define WM8350_GP5_DB 0x0020 | ||
186 | #define WM8350_GP4_DB 0x0010 | ||
187 | #define WM8350_GP3_DB 0x0008 | ||
188 | #define WM8350_GP2_DB 0x0004 | ||
189 | #define WM8350_GP1_DB 0x0002 | ||
190 | #define WM8350_GP0_DB 0x0001 | ||
191 | |||
192 | /* | ||
193 | * R129 (0x81) - GPIO Pin pull up Control | ||
194 | */ | ||
195 | #define WM8350_GP12_PU 0x1000 | ||
196 | #define WM8350_GP11_PU 0x0800 | ||
197 | #define WM8350_GP10_PU 0x0400 | ||
198 | #define WM8350_GP9_PU 0x0200 | ||
199 | #define WM8350_GP8_PU 0x0100 | ||
200 | #define WM8350_GP7_PU 0x0080 | ||
201 | #define WM8350_GP6_PU 0x0040 | ||
202 | #define WM8350_GP5_PU 0x0020 | ||
203 | #define WM8350_GP4_PU 0x0010 | ||
204 | #define WM8350_GP3_PU 0x0008 | ||
205 | #define WM8350_GP2_PU 0x0004 | ||
206 | #define WM8350_GP1_PU 0x0002 | ||
207 | #define WM8350_GP0_PU 0x0001 | ||
208 | |||
209 | /* | ||
210 | * R130 (0x82) - GPIO Pull down Control | ||
211 | */ | ||
212 | #define WM8350_GP12_PD 0x1000 | ||
213 | #define WM8350_GP11_PD 0x0800 | ||
214 | #define WM8350_GP10_PD 0x0400 | ||
215 | #define WM8350_GP9_PD 0x0200 | ||
216 | #define WM8350_GP8_PD 0x0100 | ||
217 | #define WM8350_GP7_PD 0x0080 | ||
218 | #define WM8350_GP6_PD 0x0040 | ||
219 | #define WM8350_GP5_PD 0x0020 | ||
220 | #define WM8350_GP4_PD 0x0010 | ||
221 | #define WM8350_GP3_PD 0x0008 | ||
222 | #define WM8350_GP2_PD 0x0004 | ||
223 | #define WM8350_GP1_PD 0x0002 | ||
224 | #define WM8350_GP0_PD 0x0001 | ||
225 | |||
226 | /* | ||
227 | * R131 (0x83) - GPIO Interrupt Mode | ||
228 | */ | ||
229 | #define WM8350_GP12_INTMODE 0x1000 | ||
230 | #define WM8350_GP11_INTMODE 0x0800 | ||
231 | #define WM8350_GP10_INTMODE 0x0400 | ||
232 | #define WM8350_GP9_INTMODE 0x0200 | ||
233 | #define WM8350_GP8_INTMODE 0x0100 | ||
234 | #define WM8350_GP7_INTMODE 0x0080 | ||
235 | #define WM8350_GP6_INTMODE 0x0040 | ||
236 | #define WM8350_GP5_INTMODE 0x0020 | ||
237 | #define WM8350_GP4_INTMODE 0x0010 | ||
238 | #define WM8350_GP3_INTMODE 0x0008 | ||
239 | #define WM8350_GP2_INTMODE 0x0004 | ||
240 | #define WM8350_GP1_INTMODE 0x0002 | ||
241 | #define WM8350_GP0_INTMODE 0x0001 | ||
242 | |||
243 | /* | ||
244 | * R133 (0x85) - GPIO Control | ||
245 | */ | ||
246 | #define WM8350_GP_DBTIME_MASK 0x00C0 | ||
247 | |||
248 | /* | ||
249 | * R134 (0x86) - GPIO Configuration (i/o) | ||
250 | */ | ||
251 | #define WM8350_GP12_DIR 0x1000 | ||
252 | #define WM8350_GP11_DIR 0x0800 | ||
253 | #define WM8350_GP10_DIR 0x0400 | ||
254 | #define WM8350_GP9_DIR 0x0200 | ||
255 | #define WM8350_GP8_DIR 0x0100 | ||
256 | #define WM8350_GP7_DIR 0x0080 | ||
257 | #define WM8350_GP6_DIR 0x0040 | ||
258 | #define WM8350_GP5_DIR 0x0020 | ||
259 | #define WM8350_GP4_DIR 0x0010 | ||
260 | #define WM8350_GP3_DIR 0x0008 | ||
261 | #define WM8350_GP2_DIR 0x0004 | ||
262 | #define WM8350_GP1_DIR 0x0002 | ||
263 | #define WM8350_GP0_DIR 0x0001 | ||
264 | |||
265 | /* | ||
266 | * R135 (0x87) - GPIO Pin Polarity / Type | ||
267 | */ | ||
268 | #define WM8350_GP12_CFG 0x1000 | ||
269 | #define WM8350_GP11_CFG 0x0800 | ||
270 | #define WM8350_GP10_CFG 0x0400 | ||
271 | #define WM8350_GP9_CFG 0x0200 | ||
272 | #define WM8350_GP8_CFG 0x0100 | ||
273 | #define WM8350_GP7_CFG 0x0080 | ||
274 | #define WM8350_GP6_CFG 0x0040 | ||
275 | #define WM8350_GP5_CFG 0x0020 | ||
276 | #define WM8350_GP4_CFG 0x0010 | ||
277 | #define WM8350_GP3_CFG 0x0008 | ||
278 | #define WM8350_GP2_CFG 0x0004 | ||
279 | #define WM8350_GP1_CFG 0x0002 | ||
280 | #define WM8350_GP0_CFG 0x0001 | ||
281 | |||
282 | /* | ||
283 | * R140 (0x8C) - GPIO Function Select 1 | ||
284 | */ | ||
285 | #define WM8350_GP3_FN_MASK 0xF000 | ||
286 | #define WM8350_GP2_FN_MASK 0x0F00 | ||
287 | #define WM8350_GP1_FN_MASK 0x00F0 | ||
288 | #define WM8350_GP0_FN_MASK 0x000F | ||
289 | |||
290 | /* | ||
291 | * R141 (0x8D) - GPIO Function Select 2 | ||
292 | */ | ||
293 | #define WM8350_GP7_FN_MASK 0xF000 | ||
294 | #define WM8350_GP6_FN_MASK 0x0F00 | ||
295 | #define WM8350_GP5_FN_MASK 0x00F0 | ||
296 | #define WM8350_GP4_FN_MASK 0x000F | ||
297 | |||
298 | /* | ||
299 | * R142 (0x8E) - GPIO Function Select 3 | ||
300 | */ | ||
301 | #define WM8350_GP11_FN_MASK 0xF000 | ||
302 | #define WM8350_GP10_FN_MASK 0x0F00 | ||
303 | #define WM8350_GP9_FN_MASK 0x00F0 | ||
304 | #define WM8350_GP8_FN_MASK 0x000F | ||
305 | |||
306 | /* | ||
307 | * R143 (0x8F) - GPIO Function Select 4 | ||
308 | */ | ||
309 | #define WM8350_GP12_FN_MASK 0x000F | ||
310 | |||
311 | /* | ||
312 | * R230 (0xE6) - GPIO Pin Status | ||
313 | */ | ||
314 | #define WM8350_GP12_LVL 0x1000 | ||
315 | #define WM8350_GP11_LVL 0x0800 | ||
316 | #define WM8350_GP10_LVL 0x0400 | ||
317 | #define WM8350_GP9_LVL 0x0200 | ||
318 | #define WM8350_GP8_LVL 0x0100 | ||
319 | #define WM8350_GP7_LVL 0x0080 | ||
320 | #define WM8350_GP6_LVL 0x0040 | ||
321 | #define WM8350_GP5_LVL 0x0020 | ||
322 | #define WM8350_GP4_LVL 0x0010 | ||
323 | #define WM8350_GP3_LVL 0x0008 | ||
324 | #define WM8350_GP2_LVL 0x0004 | ||
325 | #define WM8350_GP1_LVL 0x0002 | ||
326 | #define WM8350_GP0_LVL 0x0001 | ||
327 | |||
328 | struct wm8350; | ||
329 | |||
330 | int wm8350_gpio_config(struct wm8350 *wm8350, int gpio, int dir, int func, | ||
331 | int pol, int pull, int invert, int debounce); | ||
332 | |||
333 | struct wm8350_gpio { | ||
334 | struct platform_device *pdev; | ||
335 | }; | ||
336 | |||
337 | /* | ||
338 | * GPIO Interrupts | ||
339 | */ | ||
340 | #define WM8350_IRQ_GPIO(x) (50 + x) | ||
341 | |||
342 | #endif | ||
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h new file mode 100644 index 000000000000..69b69e07f62f --- /dev/null +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -0,0 +1,741 @@ | |||
1 | /* | ||
2 | * pmic.h -- Power Managment Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_WM8350_PMIC_H | ||
14 | #define __LINUX_MFD_WM8350_PMIC_H | ||
15 | |||
16 | /* | ||
17 | * Register values. | ||
18 | */ | ||
19 | |||
20 | #define WM8350_CURRENT_SINK_DRIVER_A 0xAC | ||
21 | #define WM8350_CSA_FLASH_CONTROL 0xAD | ||
22 | #define WM8350_CURRENT_SINK_DRIVER_B 0xAE | ||
23 | #define WM8350_CSB_FLASH_CONTROL 0xAF | ||
24 | #define WM8350_DCDC_LDO_REQUESTED 0xB0 | ||
25 | #define WM8350_DCDC_ACTIVE_OPTIONS 0xB1 | ||
26 | #define WM8350_DCDC_SLEEP_OPTIONS 0xB2 | ||
27 | #define WM8350_POWER_CHECK_COMPARATOR 0xB3 | ||
28 | #define WM8350_DCDC1_CONTROL 0xB4 | ||
29 | #define WM8350_DCDC1_TIMEOUTS 0xB5 | ||
30 | #define WM8350_DCDC1_LOW_POWER 0xB6 | ||
31 | #define WM8350_DCDC2_CONTROL 0xB7 | ||
32 | #define WM8350_DCDC2_TIMEOUTS 0xB8 | ||
33 | #define WM8350_DCDC3_CONTROL 0xBA | ||
34 | #define WM8350_DCDC3_TIMEOUTS 0xBB | ||
35 | #define WM8350_DCDC3_LOW_POWER 0xBC | ||
36 | #define WM8350_DCDC4_CONTROL 0xBD | ||
37 | #define WM8350_DCDC4_TIMEOUTS 0xBE | ||
38 | #define WM8350_DCDC4_LOW_POWER 0xBF | ||
39 | #define WM8350_DCDC5_CONTROL 0xC0 | ||
40 | #define WM8350_DCDC5_TIMEOUTS 0xC1 | ||
41 | #define WM8350_DCDC6_CONTROL 0xC3 | ||
42 | #define WM8350_DCDC6_TIMEOUTS 0xC4 | ||
43 | #define WM8350_DCDC6_LOW_POWER 0xC5 | ||
44 | #define WM8350_LIMIT_SWITCH_CONTROL 0xC7 | ||
45 | #define WM8350_LDO1_CONTROL 0xC8 | ||
46 | #define WM8350_LDO1_TIMEOUTS 0xC9 | ||
47 | #define WM8350_LDO1_LOW_POWER 0xCA | ||
48 | #define WM8350_LDO2_CONTROL 0xCB | ||
49 | #define WM8350_LDO2_TIMEOUTS 0xCC | ||
50 | #define WM8350_LDO2_LOW_POWER 0xCD | ||
51 | #define WM8350_LDO3_CONTROL 0xCE | ||
52 | #define WM8350_LDO3_TIMEOUTS 0xCF | ||
53 | #define WM8350_LDO3_LOW_POWER 0xD0 | ||
54 | #define WM8350_LDO4_CONTROL 0xD1 | ||
55 | #define WM8350_LDO4_TIMEOUTS 0xD2 | ||
56 | #define WM8350_LDO4_LOW_POWER 0xD3 | ||
57 | #define WM8350_VCC_FAULT_MASKS 0xD7 | ||
58 | #define WM8350_MAIN_BANDGAP_CONTROL 0xD8 | ||
59 | #define WM8350_OSC_CONTROL 0xD9 | ||
60 | #define WM8350_RTC_TICK_CONTROL 0xDA | ||
61 | #define WM8350_SECURITY 0xDB | ||
62 | #define WM8350_RAM_BIST_1 0xDC | ||
63 | #define WM8350_DCDC_LDO_STATUS 0xE1 | ||
64 | #define WM8350_GPIO_PIN_STATUS 0xE6 | ||
65 | |||
66 | #define WM8350_DCDC1_FORCE_PWM 0xF8 | ||
67 | #define WM8350_DCDC3_FORCE_PWM 0xFA | ||
68 | #define WM8350_DCDC4_FORCE_PWM 0xFB | ||
69 | #define WM8350_DCDC6_FORCE_PWM 0xFD | ||
70 | |||
71 | /* | ||
72 | * R172 (0xAC) - Current Sink Driver A | ||
73 | */ | ||
74 | #define WM8350_CS1_HIB_MODE 0x1000 | ||
75 | #define WM8350_CS1_HIB_MODE_MASK 0x1000 | ||
76 | #define WM8350_CS1_HIB_MODE_SHIFT 12 | ||
77 | #define WM8350_CS1_ISEL_MASK 0x003F | ||
78 | #define WM8350_CS1_ISEL_SHIFT 0 | ||
79 | |||
80 | /* Bit values for R172 (0xAC) */ | ||
81 | #define WM8350_CS1_HIB_MODE_DISABLE 0 | ||
82 | #define WM8350_CS1_HIB_MODE_LEAVE 1 | ||
83 | |||
84 | #define WM8350_CS1_ISEL_220M 0x3F | ||
85 | |||
86 | /* | ||
87 | * R173 (0xAD) - CSA Flash control | ||
88 | */ | ||
89 | #define WM8350_CS1_FLASH_MODE 0x8000 | ||
90 | #define WM8350_CS1_TRIGSRC 0x4000 | ||
91 | #define WM8350_CS1_DRIVE 0x2000 | ||
92 | #define WM8350_CS1_FLASH_DUR_MASK 0x0300 | ||
93 | #define WM8350_CS1_OFF_RAMP_MASK 0x0030 | ||
94 | #define WM8350_CS1_ON_RAMP_MASK 0x0003 | ||
95 | |||
96 | /* | ||
97 | * R174 (0xAE) - Current Sink Driver B | ||
98 | */ | ||
99 | #define WM8350_CS2_HIB_MODE 0x1000 | ||
100 | #define WM8350_CS2_ISEL_MASK 0x003F | ||
101 | |||
102 | /* | ||
103 | * R175 (0xAF) - CSB Flash control | ||
104 | */ | ||
105 | #define WM8350_CS2_FLASH_MODE 0x8000 | ||
106 | #define WM8350_CS2_TRIGSRC 0x4000 | ||
107 | #define WM8350_CS2_DRIVE 0x2000 | ||
108 | #define WM8350_CS2_FLASH_DUR_MASK 0x0300 | ||
109 | #define WM8350_CS2_OFF_RAMP_MASK 0x0030 | ||
110 | #define WM8350_CS2_ON_RAMP_MASK 0x0003 | ||
111 | |||
112 | /* | ||
113 | * R176 (0xB0) - DCDC/LDO requested | ||
114 | */ | ||
115 | #define WM8350_LS_ENA 0x8000 | ||
116 | #define WM8350_LDO4_ENA 0x0800 | ||
117 | #define WM8350_LDO3_ENA 0x0400 | ||
118 | #define WM8350_LDO2_ENA 0x0200 | ||
119 | #define WM8350_LDO1_ENA 0x0100 | ||
120 | #define WM8350_DC6_ENA 0x0020 | ||
121 | #define WM8350_DC5_ENA 0x0010 | ||
122 | #define WM8350_DC4_ENA 0x0008 | ||
123 | #define WM8350_DC3_ENA 0x0004 | ||
124 | #define WM8350_DC2_ENA 0x0002 | ||
125 | #define WM8350_DC1_ENA 0x0001 | ||
126 | |||
127 | /* | ||
128 | * R177 (0xB1) - DCDC Active options | ||
129 | */ | ||
130 | #define WM8350_PUTO_MASK 0x3000 | ||
131 | #define WM8350_PWRUP_DELAY_MASK 0x0300 | ||
132 | #define WM8350_DC6_ACTIVE 0x0020 | ||
133 | #define WM8350_DC4_ACTIVE 0x0008 | ||
134 | #define WM8350_DC3_ACTIVE 0x0004 | ||
135 | #define WM8350_DC1_ACTIVE 0x0001 | ||
136 | |||
137 | /* | ||
138 | * R178 (0xB2) - DCDC Sleep options | ||
139 | */ | ||
140 | #define WM8350_DC6_SLEEP 0x0020 | ||
141 | #define WM8350_DC4_SLEEP 0x0008 | ||
142 | #define WM8350_DC3_SLEEP 0x0004 | ||
143 | #define WM8350_DC1_SLEEP 0x0001 | ||
144 | |||
145 | /* | ||
146 | * R179 (0xB3) - Power-check comparator | ||
147 | */ | ||
148 | #define WM8350_PCCMP_ERRACT 0x4000 | ||
149 | #define WM8350_PCCMP_RAIL 0x0100 | ||
150 | #define WM8350_PCCMP_OFF_THR_MASK 0x0070 | ||
151 | #define WM8350_PCCMP_ON_THR_MASK 0x0007 | ||
152 | |||
153 | /* | ||
154 | * R180 (0xB4) - DCDC1 Control | ||
155 | */ | ||
156 | #define WM8350_DC1_OPFLT 0x0400 | ||
157 | #define WM8350_DC1_VSEL_MASK 0x007F | ||
158 | #define WM8350_DC1_VSEL_SHIFT 0 | ||
159 | |||
160 | /* | ||
161 | * R181 (0xB5) - DCDC1 Timeouts | ||
162 | */ | ||
163 | #define WM8350_DC1_ERRACT_MASK 0xC000 | ||
164 | #define WM8350_DC1_ERRACT_SHIFT 14 | ||
165 | #define WM8350_DC1_ENSLOT_MASK 0x3C00 | ||
166 | #define WM8350_DC1_ENSLOT_SHIFT 10 | ||
167 | #define WM8350_DC1_SDSLOT_MASK 0x03C0 | ||
168 | #define WM8350_DC1_UVTO_MASK 0x0030 | ||
169 | #define WM8350_DC1_SDSLOT_SHIFT 6 | ||
170 | |||
171 | /* Bit values for R181 (0xB5) */ | ||
172 | #define WM8350_DC1_ERRACT_NONE 0 | ||
173 | #define WM8350_DC1_ERRACT_SHUTDOWN_CONV 1 | ||
174 | #define WM8350_DC1_ERRACT_SHUTDOWN_SYS 2 | ||
175 | |||
176 | /* | ||
177 | * R182 (0xB6) - DCDC1 Low Power | ||
178 | */ | ||
179 | #define WM8350_DC1_HIB_MODE_MASK 0x7000 | ||
180 | #define WM8350_DC1_HIB_TRIG_MASK 0x0300 | ||
181 | #define WM8350_DC1_VIMG_MASK 0x007F | ||
182 | |||
183 | /* | ||
184 | * R183 (0xB7) - DCDC2 Control | ||
185 | */ | ||
186 | #define WM8350_DC2_MODE 0x4000 | ||
187 | #define WM8350_DC2_MODE_MASK 0x4000 | ||
188 | #define WM8350_DC2_MODE_SHIFT 14 | ||
189 | #define WM8350_DC2_HIB_MODE 0x1000 | ||
190 | #define WM8350_DC2_HIB_MODE_MASK 0x1000 | ||
191 | #define WM8350_DC2_HIB_MODE_SHIFT 12 | ||
192 | #define WM8350_DC2_HIB_TRIG_MASK 0x0300 | ||
193 | #define WM8350_DC2_HIB_TRIG_SHIFT 8 | ||
194 | #define WM8350_DC2_ILIM 0x0040 | ||
195 | #define WM8350_DC2_ILIM_MASK 0x0040 | ||
196 | #define WM8350_DC2_ILIM_SHIFT 6 | ||
197 | #define WM8350_DC2_RMP_MASK 0x0018 | ||
198 | #define WM8350_DC2_RMP_SHIFT 3 | ||
199 | #define WM8350_DC2_FBSRC_MASK 0x0003 | ||
200 | #define WM8350_DC2_FBSRC_SHIFT 0 | ||
201 | |||
202 | /* Bit values for R183 (0xB7) */ | ||
203 | #define WM8350_DC2_MODE_BOOST 0 | ||
204 | #define WM8350_DC2_MODE_SWITCH 1 | ||
205 | |||
206 | #define WM8350_DC2_HIB_MODE_ACTIVE 1 | ||
207 | #define WM8350_DC2_HIB_MODE_DISABLE 0 | ||
208 | |||
209 | #define WM8350_DC2_HIB_TRIG_NONE 0 | ||
210 | #define WM8350_DC2_HIB_TRIG_LPWR1 1 | ||
211 | #define WM8350_DC2_HIB_TRIG_LPWR2 2 | ||
212 | #define WM8350_DC2_HIB_TRIG_LPWR3 3 | ||
213 | |||
214 | #define WM8350_DC2_ILIM_HIGH 0 | ||
215 | #define WM8350_DC2_ILIM_LOW 1 | ||
216 | |||
217 | #define WM8350_DC2_RMP_30V 0 | ||
218 | #define WM8350_DC2_RMP_20V 1 | ||
219 | #define WM8350_DC2_RMP_10V 2 | ||
220 | #define WM8350_DC2_RMP_5V 3 | ||
221 | |||
222 | #define WM8350_DC2_FBSRC_FB2 0 | ||
223 | #define WM8350_DC2_FBSRC_ISINKA 1 | ||
224 | #define WM8350_DC2_FBSRC_ISINKB 2 | ||
225 | #define WM8350_DC2_FBSRC_USB 3 | ||
226 | |||
227 | /* | ||
228 | * R184 (0xB8) - DCDC2 Timeouts | ||
229 | */ | ||
230 | #define WM8350_DC2_ERRACT_MASK 0xC000 | ||
231 | #define WM8350_DC2_ERRACT_SHIFT 14 | ||
232 | #define WM8350_DC2_ENSLOT_MASK 0x3C00 | ||
233 | #define WM8350_DC2_ENSLOT_SHIFT 10 | ||
234 | #define WM8350_DC2_SDSLOT_MASK 0x03C0 | ||
235 | #define WM8350_DC2_UVTO_MASK 0x0030 | ||
236 | |||
237 | /* Bit values for R184 (0xB8) */ | ||
238 | #define WM8350_DC2_ERRACT_NONE 0 | ||
239 | #define WM8350_DC2_ERRACT_SHUTDOWN_CONV 1 | ||
240 | #define WM8350_DC2_ERRACT_SHUTDOWN_SYS 2 | ||
241 | |||
242 | /* | ||
243 | * R186 (0xBA) - DCDC3 Control | ||
244 | */ | ||
245 | #define WM8350_DC3_OPFLT 0x0400 | ||
246 | #define WM8350_DC3_VSEL_MASK 0x007F | ||
247 | #define WM8350_DC3_VSEL_SHIFT 0 | ||
248 | |||
249 | /* | ||
250 | * R187 (0xBB) - DCDC3 Timeouts | ||
251 | */ | ||
252 | #define WM8350_DC3_ERRACT_MASK 0xC000 | ||
253 | #define WM8350_DC3_ERRACT_SHIFT 14 | ||
254 | #define WM8350_DC3_ENSLOT_MASK 0x3C00 | ||
255 | #define WM8350_DC3_ENSLOT_SHIFT 10 | ||
256 | #define WM8350_DC3_SDSLOT_MASK 0x03C0 | ||
257 | #define WM8350_DC3_UVTO_MASK 0x0030 | ||
258 | #define WM8350_DC3_SDSLOT_SHIFT 6 | ||
259 | |||
260 | /* Bit values for R187 (0xBB) */ | ||
261 | #define WM8350_DC3_ERRACT_NONE 0 | ||
262 | #define WM8350_DC3_ERRACT_SHUTDOWN_CONV 1 | ||
263 | #define WM8350_DC3_ERRACT_SHUTDOWN_SYS 2 | ||
264 | /* | ||
265 | * R188 (0xBC) - DCDC3 Low Power | ||
266 | */ | ||
267 | #define WM8350_DC3_HIB_MODE_MASK 0x7000 | ||
268 | #define WM8350_DC3_HIB_TRIG_MASK 0x0300 | ||
269 | #define WM8350_DC3_VIMG_MASK 0x007F | ||
270 | |||
271 | /* | ||
272 | * R189 (0xBD) - DCDC4 Control | ||
273 | */ | ||
274 | #define WM8350_DC4_OPFLT 0x0400 | ||
275 | #define WM8350_DC4_VSEL_MASK 0x007F | ||
276 | #define WM8350_DC4_VSEL_SHIFT 0 | ||
277 | |||
278 | /* | ||
279 | * R190 (0xBE) - DCDC4 Timeouts | ||
280 | */ | ||
281 | #define WM8350_DC4_ERRACT_MASK 0xC000 | ||
282 | #define WM8350_DC4_ERRACT_SHIFT 14 | ||
283 | #define WM8350_DC4_ENSLOT_MASK 0x3C00 | ||
284 | #define WM8350_DC4_ENSLOT_SHIFT 10 | ||
285 | #define WM8350_DC4_SDSLOT_MASK 0x03C0 | ||
286 | #define WM8350_DC4_UVTO_MASK 0x0030 | ||
287 | #define WM8350_DC4_SDSLOT_SHIFT 6 | ||
288 | |||
289 | /* Bit values for R190 (0xBE) */ | ||
290 | #define WM8350_DC4_ERRACT_NONE 0 | ||
291 | #define WM8350_DC4_ERRACT_SHUTDOWN_CONV 1 | ||
292 | #define WM8350_DC4_ERRACT_SHUTDOWN_SYS 2 | ||
293 | |||
294 | /* | ||
295 | * R191 (0xBF) - DCDC4 Low Power | ||
296 | */ | ||
297 | #define WM8350_DC4_HIB_MODE_MASK 0x7000 | ||
298 | #define WM8350_DC4_HIB_TRIG_MASK 0x0300 | ||
299 | #define WM8350_DC4_VIMG_MASK 0x007F | ||
300 | |||
301 | /* | ||
302 | * R192 (0xC0) - DCDC5 Control | ||
303 | */ | ||
304 | #define WM8350_DC5_MODE 0x4000 | ||
305 | #define WM8350_DC5_MODE_MASK 0x4000 | ||
306 | #define WM8350_DC5_MODE_SHIFT 14 | ||
307 | #define WM8350_DC5_HIB_MODE 0x1000 | ||
308 | #define WM8350_DC5_HIB_MODE_MASK 0x1000 | ||
309 | #define WM8350_DC5_HIB_MODE_SHIFT 12 | ||
310 | #define WM8350_DC5_HIB_TRIG_MASK 0x0300 | ||
311 | #define WM8350_DC5_HIB_TRIG_SHIFT 8 | ||
312 | #define WM8350_DC5_ILIM 0x0040 | ||
313 | #define WM8350_DC5_ILIM_MASK 0x0040 | ||
314 | #define WM8350_DC5_ILIM_SHIFT 6 | ||
315 | #define WM8350_DC5_RMP_MASK 0x0018 | ||
316 | #define WM8350_DC5_RMP_SHIFT 3 | ||
317 | #define WM8350_DC5_FBSRC_MASK 0x0003 | ||
318 | #define WM8350_DC5_FBSRC_SHIFT 0 | ||
319 | |||
320 | /* Bit values for R192 (0xC0) */ | ||
321 | #define WM8350_DC5_MODE_BOOST 0 | ||
322 | #define WM8350_DC5_MODE_SWITCH 1 | ||
323 | |||
324 | #define WM8350_DC5_HIB_MODE_ACTIVE 1 | ||
325 | #define WM8350_DC5_HIB_MODE_DISABLE 0 | ||
326 | |||
327 | #define WM8350_DC5_HIB_TRIG_NONE 0 | ||
328 | #define WM8350_DC5_HIB_TRIG_LPWR1 1 | ||
329 | #define WM8350_DC5_HIB_TRIG_LPWR2 2 | ||
330 | #define WM8350_DC5_HIB_TRIG_LPWR3 3 | ||
331 | |||
332 | #define WM8350_DC5_ILIM_HIGH 0 | ||
333 | #define WM8350_DC5_ILIM_LOW 1 | ||
334 | |||
335 | #define WM8350_DC5_RMP_30V 0 | ||
336 | #define WM8350_DC5_RMP_20V 1 | ||
337 | #define WM8350_DC5_RMP_10V 2 | ||
338 | #define WM8350_DC5_RMP_5V 3 | ||
339 | |||
340 | #define WM8350_DC5_FBSRC_FB2 0 | ||
341 | #define WM8350_DC5_FBSRC_ISINKA 1 | ||
342 | #define WM8350_DC5_FBSRC_ISINKB 2 | ||
343 | #define WM8350_DC5_FBSRC_USB 3 | ||
344 | |||
345 | /* | ||
346 | * R193 (0xC1) - DCDC5 Timeouts | ||
347 | */ | ||
348 | #define WM8350_DC5_ERRACT_MASK 0xC000 | ||
349 | #define WM8350_DC5_ERRACT_SHIFT 14 | ||
350 | #define WM8350_DC5_ENSLOT_MASK 0x3C00 | ||
351 | #define WM8350_DC5_ENSLOT_SHIFT 10 | ||
352 | #define WM8350_DC5_SDSLOT_MASK 0x03C0 | ||
353 | #define WM8350_DC5_UVTO_MASK 0x0030 | ||
354 | #define WM8350_DC5_SDSLOT_SHIFT 6 | ||
355 | |||
356 | /* Bit values for R193 (0xC1) */ | ||
357 | #define WM8350_DC5_ERRACT_NONE 0 | ||
358 | #define WM8350_DC5_ERRACT_SHUTDOWN_CONV 1 | ||
359 | #define WM8350_DC5_ERRACT_SHUTDOWN_SYS 2 | ||
360 | |||
361 | /* | ||
362 | * R195 (0xC3) - DCDC6 Control | ||
363 | */ | ||
364 | #define WM8350_DC6_OPFLT 0x0400 | ||
365 | #define WM8350_DC6_VSEL_MASK 0x007F | ||
366 | #define WM8350_DC6_VSEL_SHIFT 0 | ||
367 | |||
368 | /* | ||
369 | * R196 (0xC4) - DCDC6 Timeouts | ||
370 | */ | ||
371 | #define WM8350_DC6_ERRACT_MASK 0xC000 | ||
372 | #define WM8350_DC6_ERRACT_SHIFT 14 | ||
373 | #define WM8350_DC6_ENSLOT_MASK 0x3C00 | ||
374 | #define WM8350_DC6_ENSLOT_SHIFT 10 | ||
375 | #define WM8350_DC6_SDSLOT_MASK 0x03C0 | ||
376 | #define WM8350_DC6_UVTO_MASK 0x0030 | ||
377 | #define WM8350_DC6_SDSLOT_SHIFT 6 | ||
378 | |||
379 | /* Bit values for R196 (0xC4) */ | ||
380 | #define WM8350_DC6_ERRACT_NONE 0 | ||
381 | #define WM8350_DC6_ERRACT_SHUTDOWN_CONV 1 | ||
382 | #define WM8350_DC6_ERRACT_SHUTDOWN_SYS 2 | ||
383 | |||
384 | /* | ||
385 | * R197 (0xC5) - DCDC6 Low Power | ||
386 | */ | ||
387 | #define WM8350_DC6_HIB_MODE_MASK 0x7000 | ||
388 | #define WM8350_DC6_HIB_TRIG_MASK 0x0300 | ||
389 | #define WM8350_DC6_VIMG_MASK 0x007F | ||
390 | |||
391 | /* | ||
392 | * R199 (0xC7) - Limit Switch Control | ||
393 | */ | ||
394 | #define WM8350_LS_ERRACT_MASK 0xC000 | ||
395 | #define WM8350_LS_ERRACT_SHIFT 14 | ||
396 | #define WM8350_LS_ENSLOT_MASK 0x3C00 | ||
397 | #define WM8350_LS_ENSLOT_SHIFT 10 | ||
398 | #define WM8350_LS_SDSLOT_MASK 0x03C0 | ||
399 | #define WM8350_LS_SDSLOT_SHIFT 6 | ||
400 | #define WM8350_LS_HIB_MODE 0x0010 | ||
401 | #define WM8350_LS_HIB_MODE_MASK 0x0010 | ||
402 | #define WM8350_LS_HIB_MODE_SHIFT 4 | ||
403 | #define WM8350_LS_HIB_PROT 0x0002 | ||
404 | #define WM8350_LS_HIB_PROT_MASK 0x0002 | ||
405 | #define WM8350_LS_HIB_PROT_SHIFT 1 | ||
406 | #define WM8350_LS_PROT 0x0001 | ||
407 | #define WM8350_LS_PROT_MASK 0x0001 | ||
408 | #define WM8350_LS_PROT_SHIFT 0 | ||
409 | |||
410 | /* Bit values for R199 (0xC7) */ | ||
411 | #define WM8350_LS_ERRACT_NONE 0 | ||
412 | #define WM8350_LS_ERRACT_SHUTDOWN_CONV 1 | ||
413 | #define WM8350_LS_ERRACT_SHUTDOWN_SYS 2 | ||
414 | |||
415 | /* | ||
416 | * R200 (0xC8) - LDO1 Control | ||
417 | */ | ||
418 | #define WM8350_LDO1_SWI 0x4000 | ||
419 | #define WM8350_LDO1_OPFLT 0x0400 | ||
420 | #define WM8350_LDO1_VSEL_MASK 0x001F | ||
421 | #define WM8350_LDO1_VSEL_SHIFT 0 | ||
422 | |||
423 | /* | ||
424 | * R201 (0xC9) - LDO1 Timeouts | ||
425 | */ | ||
426 | #define WM8350_LDO1_ERRACT_MASK 0xC000 | ||
427 | #define WM8350_LDO1_ERRACT_SHIFT 14 | ||
428 | #define WM8350_LDO1_ENSLOT_MASK 0x3C00 | ||
429 | #define WM8350_LDO1_ENSLOT_SHIFT 10 | ||
430 | #define WM8350_LDO1_SDSLOT_MASK 0x03C0 | ||
431 | #define WM8350_LDO1_UVTO_MASK 0x0030 | ||
432 | #define WM8350_LDO1_SDSLOT_SHIFT 6 | ||
433 | |||
434 | /* Bit values for R201 (0xC9) */ | ||
435 | #define WM8350_LDO1_ERRACT_NONE 0 | ||
436 | #define WM8350_LDO1_ERRACT_SHUTDOWN_CONV 1 | ||
437 | #define WM8350_LDO1_ERRACT_SHUTDOWN_SYS 2 | ||
438 | |||
439 | /* | ||
440 | * R202 (0xCA) - LDO1 Low Power | ||
441 | */ | ||
442 | #define WM8350_LDO1_HIB_MODE_MASK 0x3000 | ||
443 | #define WM8350_LDO1_HIB_TRIG_MASK 0x0300 | ||
444 | #define WM8350_LDO1_VIMG_MASK 0x001F | ||
445 | #define WM8350_LDO1_HIB_MODE_DIS (0x1 << 12) | ||
446 | |||
447 | |||
448 | /* | ||
449 | * R203 (0xCB) - LDO2 Control | ||
450 | */ | ||
451 | #define WM8350_LDO2_SWI 0x4000 | ||
452 | #define WM8350_LDO2_OPFLT 0x0400 | ||
453 | #define WM8350_LDO2_VSEL_MASK 0x001F | ||
454 | #define WM8350_LDO2_VSEL_SHIFT 0 | ||
455 | |||
456 | /* | ||
457 | * R204 (0xCC) - LDO2 Timeouts | ||
458 | */ | ||
459 | #define WM8350_LDO2_ERRACT_MASK 0xC000 | ||
460 | #define WM8350_LDO2_ERRACT_SHIFT 14 | ||
461 | #define WM8350_LDO2_ENSLOT_MASK 0x3C00 | ||
462 | #define WM8350_LDO2_ENSLOT_SHIFT 10 | ||
463 | #define WM8350_LDO2_SDSLOT_MASK 0x03C0 | ||
464 | #define WM8350_LDO2_SDSLOT_SHIFT 6 | ||
465 | |||
466 | /* Bit values for R204 (0xCC) */ | ||
467 | #define WM8350_LDO2_ERRACT_NONE 0 | ||
468 | #define WM8350_LDO2_ERRACT_SHUTDOWN_CONV 1 | ||
469 | #define WM8350_LDO2_ERRACT_SHUTDOWN_SYS 2 | ||
470 | |||
471 | /* | ||
472 | * R205 (0xCD) - LDO2 Low Power | ||
473 | */ | ||
474 | #define WM8350_LDO2_HIB_MODE_MASK 0x3000 | ||
475 | #define WM8350_LDO2_HIB_TRIG_MASK 0x0300 | ||
476 | #define WM8350_LDO2_VIMG_MASK 0x001F | ||
477 | |||
478 | /* | ||
479 | * R206 (0xCE) - LDO3 Control | ||
480 | */ | ||
481 | #define WM8350_LDO3_SWI 0x4000 | ||
482 | #define WM8350_LDO3_OPFLT 0x0400 | ||
483 | #define WM8350_LDO3_VSEL_MASK 0x001F | ||
484 | #define WM8350_LDO3_VSEL_SHIFT 0 | ||
485 | |||
486 | /* | ||
487 | * R207 (0xCF) - LDO3 Timeouts | ||
488 | */ | ||
489 | #define WM8350_LDO3_ERRACT_MASK 0xC000 | ||
490 | #define WM8350_LDO3_ERRACT_SHIFT 14 | ||
491 | #define WM8350_LDO3_ENSLOT_MASK 0x3C00 | ||
492 | #define WM8350_LDO3_ENSLOT_SHIFT 10 | ||
493 | #define WM8350_LDO3_SDSLOT_MASK 0x03C0 | ||
494 | #define WM8350_LDO3_UVTO_MASK 0x0030 | ||
495 | #define WM8350_LDO3_SDSLOT_SHIFT 6 | ||
496 | |||
497 | /* Bit values for R207 (0xCF) */ | ||
498 | #define WM8350_LDO3_ERRACT_NONE 0 | ||
499 | #define WM8350_LDO3_ERRACT_SHUTDOWN_CONV 1 | ||
500 | #define WM8350_LDO3_ERRACT_SHUTDOWN_SYS 2 | ||
501 | |||
502 | /* | ||
503 | * R208 (0xD0) - LDO3 Low Power | ||
504 | */ | ||
505 | #define WM8350_LDO3_HIB_MODE_MASK 0x3000 | ||
506 | #define WM8350_LDO3_HIB_TRIG_MASK 0x0300 | ||
507 | #define WM8350_LDO3_VIMG_MASK 0x001F | ||
508 | |||
509 | /* | ||
510 | * R209 (0xD1) - LDO4 Control | ||
511 | */ | ||
512 | #define WM8350_LDO4_SWI 0x4000 | ||
513 | #define WM8350_LDO4_OPFLT 0x0400 | ||
514 | #define WM8350_LDO4_VSEL_MASK 0x001F | ||
515 | #define WM8350_LDO4_VSEL_SHIFT 0 | ||
516 | |||
517 | /* | ||
518 | * R210 (0xD2) - LDO4 Timeouts | ||
519 | */ | ||
520 | #define WM8350_LDO4_ERRACT_MASK 0xC000 | ||
521 | #define WM8350_LDO4_ERRACT_SHIFT 14 | ||
522 | #define WM8350_LDO4_ENSLOT_MASK 0x3C00 | ||
523 | #define WM8350_LDO4_ENSLOT_SHIFT 10 | ||
524 | #define WM8350_LDO4_SDSLOT_MASK 0x03C0 | ||
525 | #define WM8350_LDO4_UVTO_MASK 0x0030 | ||
526 | #define WM8350_LDO4_SDSLOT_SHIFT 6 | ||
527 | |||
528 | /* Bit values for R210 (0xD2) */ | ||
529 | #define WM8350_LDO4_ERRACT_NONE 0 | ||
530 | #define WM8350_LDO4_ERRACT_SHUTDOWN_CONV 1 | ||
531 | #define WM8350_LDO4_ERRACT_SHUTDOWN_SYS 2 | ||
532 | |||
533 | /* | ||
534 | * R211 (0xD3) - LDO4 Low Power | ||
535 | */ | ||
536 | #define WM8350_LDO4_HIB_MODE_MASK 0x3000 | ||
537 | #define WM8350_LDO4_HIB_TRIG_MASK 0x0300 | ||
538 | #define WM8350_LDO4_VIMG_MASK 0x001F | ||
539 | |||
540 | /* | ||
541 | * R215 (0xD7) - VCC_FAULT Masks | ||
542 | */ | ||
543 | #define WM8350_LS_FAULT 0x8000 | ||
544 | #define WM8350_LDO4_FAULT 0x0800 | ||
545 | #define WM8350_LDO3_FAULT 0x0400 | ||
546 | #define WM8350_LDO2_FAULT 0x0200 | ||
547 | #define WM8350_LDO1_FAULT 0x0100 | ||
548 | #define WM8350_DC6_FAULT 0x0020 | ||
549 | #define WM8350_DC5_FAULT 0x0010 | ||
550 | #define WM8350_DC4_FAULT 0x0008 | ||
551 | #define WM8350_DC3_FAULT 0x0004 | ||
552 | #define WM8350_DC2_FAULT 0x0002 | ||
553 | #define WM8350_DC1_FAULT 0x0001 | ||
554 | |||
555 | /* | ||
556 | * R216 (0xD8) - Main Bandgap Control | ||
557 | */ | ||
558 | #define WM8350_MBG_LOAD_FUSES 0x8000 | ||
559 | #define WM8350_MBG_FUSE_WPREP 0x4000 | ||
560 | #define WM8350_MBG_FUSE_WRITE 0x2000 | ||
561 | #define WM8350_MBG_FUSE_TRIM_MASK 0x1F00 | ||
562 | #define WM8350_MBG_TRIM_SRC 0x0020 | ||
563 | #define WM8350_MBG_USER_TRIM_MASK 0x001F | ||
564 | |||
565 | /* | ||
566 | * R217 (0xD9) - OSC Control | ||
567 | */ | ||
568 | #define WM8350_OSC_LOAD_FUSES 0x8000 | ||
569 | #define WM8350_OSC_FUSE_WPREP 0x4000 | ||
570 | #define WM8350_OSC_FUSE_WRITE 0x2000 | ||
571 | #define WM8350_OSC_FUSE_TRIM_MASK 0x0F00 | ||
572 | #define WM8350_OSC_TRIM_SRC 0x0020 | ||
573 | #define WM8350_OSC_USER_TRIM_MASK 0x000F | ||
574 | |||
575 | /* | ||
576 | * R248 (0xF8) - DCDC1 Force PWM | ||
577 | */ | ||
578 | #define WM8350_DCDC1_FORCE_PWM_ENA 0x0010 | ||
579 | |||
580 | /* | ||
581 | * R250 (0xFA) - DCDC3 Force PWM | ||
582 | */ | ||
583 | #define WM8350_DCDC3_FORCE_PWM_ENA 0x0010 | ||
584 | |||
585 | /* | ||
586 | * R251 (0xFB) - DCDC4 Force PWM | ||
587 | */ | ||
588 | #define WM8350_DCDC4_FORCE_PWM_ENA 0x0010 | ||
589 | |||
590 | /* | ||
591 | * R253 (0xFD) - DCDC1 Force PWM | ||
592 | */ | ||
593 | #define WM8350_DCDC6_FORCE_PWM_ENA 0x0010 | ||
594 | |||
595 | /* | ||
596 | * DCDC's | ||
597 | */ | ||
598 | #define WM8350_DCDC_1 0 | ||
599 | #define WM8350_DCDC_2 1 | ||
600 | #define WM8350_DCDC_3 2 | ||
601 | #define WM8350_DCDC_4 3 | ||
602 | #define WM8350_DCDC_5 4 | ||
603 | #define WM8350_DCDC_6 5 | ||
604 | |||
605 | /* DCDC modes */ | ||
606 | #define WM8350_DCDC_ACTIVE_STANDBY 0 | ||
607 | #define WM8350_DCDC_ACTIVE_PULSE 1 | ||
608 | #define WM8350_DCDC_SLEEP_NORMAL 0 | ||
609 | #define WM8350_DCDC_SLEEP_LOW 1 | ||
610 | |||
611 | /* DCDC Low power (Hibernate) mode */ | ||
612 | #define WM8350_DCDC_HIB_MODE_CUR (0 << 12) | ||
613 | #define WM8350_DCDC_HIB_MODE_IMAGE (1 << 12) | ||
614 | #define WM8350_DCDC_HIB_MODE_STANDBY (2 << 12) | ||
615 | #define WM8350_DCDC_HIB_MODE_LDO (4 << 12) | ||
616 | #define WM8350_DCDC_HIB_MODE_LDO_IM (5 << 12) | ||
617 | #define WM8350_DCDC_HIB_MODE_DIS (7 << 12) | ||
618 | #define WM8350_DCDC_HIB_MODE_MASK (7 << 12) | ||
619 | |||
620 | /* DCDC Low Power (Hibernate) signal */ | ||
621 | #define WM8350_DCDC_HIB_SIG_REG (0 << 8) | ||
622 | #define WM8350_DCDC_HIB_SIG_LPWR1 (1 << 8) | ||
623 | #define WM8350_DCDC_HIB_SIG_LPWR2 (2 << 8) | ||
624 | #define WM8350_DCDC_HIB_SIG_LPWR3 (3 << 8) | ||
625 | |||
626 | /* LDO Low power (Hibernate) mode */ | ||
627 | #define WM8350_LDO_HIB_MODE_IMAGE (0 << 0) | ||
628 | #define WM8350_LDO_HIB_MODE_DIS (1 << 0) | ||
629 | |||
630 | /* LDO Low Power (Hibernate) signal */ | ||
631 | #define WM8350_LDO_HIB_SIG_REG (0 << 8) | ||
632 | #define WM8350_LDO_HIB_SIG_LPWR1 (1 << 8) | ||
633 | #define WM8350_LDO_HIB_SIG_LPWR2 (2 << 8) | ||
634 | #define WM8350_LDO_HIB_SIG_LPWR3 (3 << 8) | ||
635 | |||
636 | /* | ||
637 | * LDOs | ||
638 | */ | ||
639 | #define WM8350_LDO_1 6 | ||
640 | #define WM8350_LDO_2 7 | ||
641 | #define WM8350_LDO_3 8 | ||
642 | #define WM8350_LDO_4 9 | ||
643 | |||
644 | /* | ||
645 | * ISINKs | ||
646 | */ | ||
647 | #define WM8350_ISINK_A 10 | ||
648 | #define WM8350_ISINK_B 11 | ||
649 | |||
650 | #define WM8350_ISINK_MODE_BOOST 0 | ||
651 | #define WM8350_ISINK_MODE_SWITCH 1 | ||
652 | #define WM8350_ISINK_ILIM_NORMAL 0 | ||
653 | #define WM8350_ISINK_ILIM_LOW 1 | ||
654 | |||
655 | #define WM8350_ISINK_FLASH_DISABLE 0 | ||
656 | #define WM8350_ISINK_FLASH_ENABLE 1 | ||
657 | #define WM8350_ISINK_FLASH_TRIG_BIT 0 | ||
658 | #define WM8350_ISINK_FLASH_TRIG_GPIO 1 | ||
659 | #define WM8350_ISINK_FLASH_MODE_EN (1 << 13) | ||
660 | #define WM8350_ISINK_FLASH_MODE_DIS (0 << 13) | ||
661 | #define WM8350_ISINK_FLASH_DUR_32MS (0 << 8) | ||
662 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) | ||
663 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) | ||
664 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) | ||
665 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) | ||
666 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) | ||
667 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) | ||
668 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) | ||
669 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) | ||
670 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) | ||
671 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) | ||
672 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) | ||
673 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) | ||
674 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) | ||
675 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) | ||
676 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) | ||
677 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) | ||
678 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) | ||
679 | |||
680 | /* | ||
681 | * Regulator Interrupts. | ||
682 | */ | ||
683 | #define WM8350_IRQ_CS1 13 | ||
684 | #define WM8350_IRQ_CS2 14 | ||
685 | #define WM8350_IRQ_UV_LDO4 25 | ||
686 | #define WM8350_IRQ_UV_LDO3 26 | ||
687 | #define WM8350_IRQ_UV_LDO2 27 | ||
688 | #define WM8350_IRQ_UV_LDO1 28 | ||
689 | #define WM8350_IRQ_UV_DC6 29 | ||
690 | #define WM8350_IRQ_UV_DC5 30 | ||
691 | #define WM8350_IRQ_UV_DC4 31 | ||
692 | #define WM8350_IRQ_UV_DC3 32 | ||
693 | #define WM8350_IRQ_UV_DC2 33 | ||
694 | #define WM8350_IRQ_UV_DC1 34 | ||
695 | #define WM8350_IRQ_OC_LS 35 | ||
696 | |||
697 | #define NUM_WM8350_REGULATORS 12 | ||
698 | |||
699 | struct wm8350; | ||
700 | struct platform_device; | ||
701 | struct regulator_init_data; | ||
702 | |||
703 | struct wm8350_pmic { | ||
704 | /* ISINK to DCDC mapping */ | ||
705 | int isink_A_dcdc; | ||
706 | int isink_B_dcdc; | ||
707 | |||
708 | /* hibernate configs */ | ||
709 | u16 dcdc1_hib_mode; | ||
710 | u16 dcdc3_hib_mode; | ||
711 | u16 dcdc4_hib_mode; | ||
712 | u16 dcdc6_hib_mode; | ||
713 | |||
714 | /* regulator devices */ | ||
715 | struct platform_device *pdev[NUM_WM8350_REGULATORS]; | ||
716 | }; | ||
717 | |||
718 | int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | ||
719 | struct regulator_init_data *initdata); | ||
720 | |||
721 | /* | ||
722 | * Additional DCDC control not supported via regulator API | ||
723 | */ | ||
724 | int wm8350_dcdc_set_slot(struct wm8350 *wm8350, int dcdc, u16 start, | ||
725 | u16 stop, u16 fault); | ||
726 | int wm8350_dcdc25_set_mode(struct wm8350 *wm8350, int dcdc, u16 mode, | ||
727 | u16 ilim, u16 ramp, u16 feedback); | ||
728 | |||
729 | /* | ||
730 | * Additional LDO control not supported via regulator API | ||
731 | */ | ||
732 | int wm8350_ldo_set_slot(struct wm8350 *wm8350, int ldo, u16 start, u16 stop); | ||
733 | |||
734 | /* | ||
735 | * Additional ISINK control not supported via regulator API | ||
736 | */ | ||
737 | int wm8350_isink_set_flash(struct wm8350 *wm8350, int isink, u16 mode, | ||
738 | u16 trigger, u16 duration, u16 on_ramp, | ||
739 | u16 off_ramp, u16 drive); | ||
740 | |||
741 | #endif | ||
diff --git a/include/linux/mfd/wm8350/rtc.h b/include/linux/mfd/wm8350/rtc.h new file mode 100644 index 000000000000..dfda69e9f440 --- /dev/null +++ b/include/linux/mfd/wm8350/rtc.h | |||
@@ -0,0 +1,266 @@ | |||
1 | /* | ||
2 | * rtc.h -- RTC driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_WM8350_RTC_H | ||
13 | #define __LINUX_MFD_WM8350_RTC_H | ||
14 | |||
15 | #include <linux/platform_device.h> | ||
16 | |||
17 | /* | ||
18 | * Register values. | ||
19 | */ | ||
20 | #define WM8350_RTC_SECONDS_MINUTES 0x10 | ||
21 | #define WM8350_RTC_HOURS_DAY 0x11 | ||
22 | #define WM8350_RTC_DATE_MONTH 0x12 | ||
23 | #define WM8350_RTC_YEAR 0x13 | ||
24 | #define WM8350_ALARM_SECONDS_MINUTES 0x14 | ||
25 | #define WM8350_ALARM_HOURS_DAY 0x15 | ||
26 | #define WM8350_ALARM_DATE_MONTH 0x16 | ||
27 | #define WM8350_RTC_TIME_CONTROL 0x17 | ||
28 | |||
29 | /* | ||
30 | * R16 (0x10) - RTC Seconds/Minutes | ||
31 | */ | ||
32 | #define WM8350_RTC_MINS_MASK 0x7F00 | ||
33 | #define WM8350_RTC_MINS_SHIFT 8 | ||
34 | #define WM8350_RTC_SECS_MASK 0x007F | ||
35 | #define WM8350_RTC_SECS_SHIFT 0 | ||
36 | |||
37 | /* | ||
38 | * R17 (0x11) - RTC Hours/Day | ||
39 | */ | ||
40 | #define WM8350_RTC_DAY_MASK 0x0700 | ||
41 | #define WM8350_RTC_DAY_SHIFT 8 | ||
42 | #define WM8350_RTC_HPM_MASK 0x0020 | ||
43 | #define WM8350_RTC_HPM_SHIFT 5 | ||
44 | #define WM8350_RTC_HRS_MASK 0x001F | ||
45 | #define WM8350_RTC_HRS_SHIFT 0 | ||
46 | |||
47 | /* Bit values for R21 (0x15) */ | ||
48 | #define WM8350_RTC_DAY_SUN 1 | ||
49 | #define WM8350_RTC_DAY_MON 2 | ||
50 | #define WM8350_RTC_DAY_TUE 3 | ||
51 | #define WM8350_RTC_DAY_WED 4 | ||
52 | #define WM8350_RTC_DAY_THU 5 | ||
53 | #define WM8350_RTC_DAY_FRI 6 | ||
54 | #define WM8350_RTC_DAY_SAT 7 | ||
55 | |||
56 | #define WM8350_RTC_HPM_AM 0 | ||
57 | #define WM8350_RTC_HPM_PM 1 | ||
58 | |||
59 | /* | ||
60 | * R18 (0x12) - RTC Date/Month | ||
61 | */ | ||
62 | #define WM8350_RTC_MTH_MASK 0x1F00 | ||
63 | #define WM8350_RTC_MTH_SHIFT 8 | ||
64 | #define WM8350_RTC_DATE_MASK 0x003F | ||
65 | #define WM8350_RTC_DATE_SHIFT 0 | ||
66 | |||
67 | /* Bit values for R22 (0x16) */ | ||
68 | #define WM8350_RTC_MTH_JAN 1 | ||
69 | #define WM8350_RTC_MTH_FEB 2 | ||
70 | #define WM8350_RTC_MTH_MAR 3 | ||
71 | #define WM8350_RTC_MTH_APR 4 | ||
72 | #define WM8350_RTC_MTH_MAY 5 | ||
73 | #define WM8350_RTC_MTH_JUN 6 | ||
74 | #define WM8350_RTC_MTH_JUL 7 | ||
75 | #define WM8350_RTC_MTH_AUG 8 | ||
76 | #define WM8350_RTC_MTH_SEP 9 | ||
77 | #define WM8350_RTC_MTH_OCT 10 | ||
78 | #define WM8350_RTC_MTH_NOV 11 | ||
79 | #define WM8350_RTC_MTH_DEC 12 | ||
80 | #define WM8350_RTC_MTH_JAN_BCD 0x01 | ||
81 | #define WM8350_RTC_MTH_FEB_BCD 0x02 | ||
82 | #define WM8350_RTC_MTH_MAR_BCD 0x03 | ||
83 | #define WM8350_RTC_MTH_APR_BCD 0x04 | ||
84 | #define WM8350_RTC_MTH_MAY_BCD 0x05 | ||
85 | #define WM8350_RTC_MTH_JUN_BCD 0x06 | ||
86 | #define WM8350_RTC_MTH_JUL_BCD 0x07 | ||
87 | #define WM8350_RTC_MTH_AUG_BCD 0x08 | ||
88 | #define WM8350_RTC_MTH_SEP_BCD 0x09 | ||
89 | #define WM8350_RTC_MTH_OCT_BCD 0x10 | ||
90 | #define WM8350_RTC_MTH_NOV_BCD 0x11 | ||
91 | #define WM8350_RTC_MTH_DEC_BCD 0x12 | ||
92 | |||
93 | /* | ||
94 | * R19 (0x13) - RTC Year | ||
95 | */ | ||
96 | #define WM8350_RTC_YHUNDREDS_MASK 0x3F00 | ||
97 | #define WM8350_RTC_YHUNDREDS_SHIFT 8 | ||
98 | #define WM8350_RTC_YUNITS_MASK 0x00FF | ||
99 | #define WM8350_RTC_YUNITS_SHIFT 0 | ||
100 | |||
101 | /* | ||
102 | * R20 (0x14) - Alarm Seconds/Minutes | ||
103 | */ | ||
104 | #define WM8350_RTC_ALMMINS_MASK 0x7F00 | ||
105 | #define WM8350_RTC_ALMMINS_SHIFT 8 | ||
106 | #define WM8350_RTC_ALMSECS_MASK 0x007F | ||
107 | #define WM8350_RTC_ALMSECS_SHIFT 0 | ||
108 | |||
109 | /* Bit values for R20 (0x14) */ | ||
110 | #define WM8350_RTC_ALMMINS_DONT_CARE -1 | ||
111 | #define WM8350_RTC_ALMSECS_DONT_CARE -1 | ||
112 | |||
113 | /* | ||
114 | * R21 (0x15) - Alarm Hours/Day | ||
115 | */ | ||
116 | #define WM8350_RTC_ALMDAY_MASK 0x0F00 | ||
117 | #define WM8350_RTC_ALMDAY_SHIFT 8 | ||
118 | #define WM8350_RTC_ALMHPM_MASK 0x0020 | ||
119 | #define WM8350_RTC_ALMHPM_SHIFT 5 | ||
120 | #define WM8350_RTC_ALMHRS_MASK 0x001F | ||
121 | #define WM8350_RTC_ALMHRS_SHIFT 0 | ||
122 | |||
123 | /* Bit values for R21 (0x15) */ | ||
124 | #define WM8350_RTC_ALMDAY_DONT_CARE -1 | ||
125 | #define WM8350_RTC_ALMDAY_SUN 1 | ||
126 | #define WM8350_RTC_ALMDAY_MON 2 | ||
127 | #define WM8350_RTC_ALMDAY_TUE 3 | ||
128 | #define WM8350_RTC_ALMDAY_WED 4 | ||
129 | #define WM8350_RTC_ALMDAY_THU 5 | ||
130 | #define WM8350_RTC_ALMDAY_FRI 6 | ||
131 | #define WM8350_RTC_ALMDAY_SAT 7 | ||
132 | |||
133 | #define WM8350_RTC_ALMHPM_AM 0 | ||
134 | #define WM8350_RTC_ALMHPM_PM 1 | ||
135 | |||
136 | #define WM8350_RTC_ALMHRS_DONT_CARE -1 | ||
137 | |||
138 | /* | ||
139 | * R22 (0x16) - Alarm Date/Month | ||
140 | */ | ||
141 | #define WM8350_RTC_ALMMTH_MASK 0x1F00 | ||
142 | #define WM8350_RTC_ALMMTH_SHIFT 8 | ||
143 | #define WM8350_RTC_ALMDATE_MASK 0x003F | ||
144 | #define WM8350_RTC_ALMDATE_SHIFT 0 | ||
145 | |||
146 | /* Bit values for R22 (0x16) */ | ||
147 | #define WM8350_RTC_ALMDATE_DONT_CARE -1 | ||
148 | |||
149 | #define WM8350_RTC_ALMMTH_DONT_CARE -1 | ||
150 | #define WM8350_RTC_ALMMTH_JAN 1 | ||
151 | #define WM8350_RTC_ALMMTH_FEB 2 | ||
152 | #define WM8350_RTC_ALMMTH_MAR 3 | ||
153 | #define WM8350_RTC_ALMMTH_APR 4 | ||
154 | #define WM8350_RTC_ALMMTH_MAY 5 | ||
155 | #define WM8350_RTC_ALMMTH_JUN 6 | ||
156 | #define WM8350_RTC_ALMMTH_JUL 7 | ||
157 | #define WM8350_RTC_ALMMTH_AUG 8 | ||
158 | #define WM8350_RTC_ALMMTH_SEP 9 | ||
159 | #define WM8350_RTC_ALMMTH_OCT 10 | ||
160 | #define WM8350_RTC_ALMMTH_NOV 11 | ||
161 | #define WM8350_RTC_ALMMTH_DEC 12 | ||
162 | #define WM8350_RTC_ALMMTH_JAN_BCD 0x01 | ||
163 | #define WM8350_RTC_ALMMTH_FEB_BCD 0x02 | ||
164 | #define WM8350_RTC_ALMMTH_MAR_BCD 0x03 | ||
165 | #define WM8350_RTC_ALMMTH_APR_BCD 0x04 | ||
166 | #define WM8350_RTC_ALMMTH_MAY_BCD 0x05 | ||
167 | #define WM8350_RTC_ALMMTH_JUN_BCD 0x06 | ||
168 | #define WM8350_RTC_ALMMTH_JUL_BCD 0x07 | ||
169 | #define WM8350_RTC_ALMMTH_AUG_BCD 0x08 | ||
170 | #define WM8350_RTC_ALMMTH_SEP_BCD 0x09 | ||
171 | #define WM8350_RTC_ALMMTH_OCT_BCD 0x10 | ||
172 | #define WM8350_RTC_ALMMTH_NOV_BCD 0x11 | ||
173 | #define WM8350_RTC_ALMMTH_DEC_BCD 0x12 | ||
174 | |||
175 | /* | ||
176 | * R23 (0x17) - RTC Time Control | ||
177 | */ | ||
178 | #define WM8350_RTC_BCD 0x8000 | ||
179 | #define WM8350_RTC_BCD_MASK 0x8000 | ||
180 | #define WM8350_RTC_BCD_SHIFT 15 | ||
181 | #define WM8350_RTC_12HR 0x4000 | ||
182 | #define WM8350_RTC_12HR_MASK 0x4000 | ||
183 | #define WM8350_RTC_12HR_SHIFT 14 | ||
184 | #define WM8350_RTC_DST 0x2000 | ||
185 | #define WM8350_RTC_DST_MASK 0x2000 | ||
186 | #define WM8350_RTC_DST_SHIFT 13 | ||
187 | #define WM8350_RTC_SET 0x0800 | ||
188 | #define WM8350_RTC_SET_MASK 0x0800 | ||
189 | #define WM8350_RTC_SET_SHIFT 11 | ||
190 | #define WM8350_RTC_STS 0x0400 | ||
191 | #define WM8350_RTC_STS_MASK 0x0400 | ||
192 | #define WM8350_RTC_STS_SHIFT 10 | ||
193 | #define WM8350_RTC_ALMSET 0x0200 | ||
194 | #define WM8350_RTC_ALMSET_MASK 0x0200 | ||
195 | #define WM8350_RTC_ALMSET_SHIFT 9 | ||
196 | #define WM8350_RTC_ALMSTS 0x0100 | ||
197 | #define WM8350_RTC_ALMSTS_MASK 0x0100 | ||
198 | #define WM8350_RTC_ALMSTS_SHIFT 8 | ||
199 | #define WM8350_RTC_PINT 0x0070 | ||
200 | #define WM8350_RTC_PINT_MASK 0x0070 | ||
201 | #define WM8350_RTC_PINT_SHIFT 4 | ||
202 | #define WM8350_RTC_DSW 0x000F | ||
203 | #define WM8350_RTC_DSW_MASK 0x000F | ||
204 | #define WM8350_RTC_DSW_SHIFT 0 | ||
205 | |||
206 | /* Bit values for R23 (0x17) */ | ||
207 | #define WM8350_RTC_BCD_BINARY 0 | ||
208 | #define WM8350_RTC_BCD_BCD 1 | ||
209 | |||
210 | #define WM8350_RTC_12HR_24HR 0 | ||
211 | #define WM8350_RTC_12HR_12HR 1 | ||
212 | |||
213 | #define WM8350_RTC_DST_DISABLED 0 | ||
214 | #define WM8350_RTC_DST_ENABLED 1 | ||
215 | |||
216 | #define WM8350_RTC_SET_RUN 0 | ||
217 | #define WM8350_RTC_SET_SET 1 | ||
218 | |||
219 | #define WM8350_RTC_STS_RUNNING 0 | ||
220 | #define WM8350_RTC_STS_STOPPED 1 | ||
221 | |||
222 | #define WM8350_RTC_ALMSET_RUN 0 | ||
223 | #define WM8350_RTC_ALMSET_SET 1 | ||
224 | |||
225 | #define WM8350_RTC_ALMSTS_RUNNING 0 | ||
226 | #define WM8350_RTC_ALMSTS_STOPPED 1 | ||
227 | |||
228 | #define WM8350_RTC_PINT_DISABLED 0 | ||
229 | #define WM8350_RTC_PINT_SECS 1 | ||
230 | #define WM8350_RTC_PINT_MINS 2 | ||
231 | #define WM8350_RTC_PINT_HRS 3 | ||
232 | #define WM8350_RTC_PINT_DAYS 4 | ||
233 | #define WM8350_RTC_PINT_MTHS 5 | ||
234 | |||
235 | #define WM8350_RTC_DSW_DISABLED 0 | ||
236 | #define WM8350_RTC_DSW_1HZ 1 | ||
237 | #define WM8350_RTC_DSW_2HZ 2 | ||
238 | #define WM8350_RTC_DSW_4HZ 3 | ||
239 | #define WM8350_RTC_DSW_8HZ 4 | ||
240 | #define WM8350_RTC_DSW_16HZ 5 | ||
241 | #define WM8350_RTC_DSW_32HZ 6 | ||
242 | #define WM8350_RTC_DSW_64HZ 7 | ||
243 | #define WM8350_RTC_DSW_128HZ 8 | ||
244 | #define WM8350_RTC_DSW_256HZ 9 | ||
245 | #define WM8350_RTC_DSW_512HZ 10 | ||
246 | #define WM8350_RTC_DSW_1024HZ 11 | ||
247 | |||
248 | /* | ||
249 | * R218 (0xDA) - RTC Tick Control | ||
250 | */ | ||
251 | #define WM8350_RTC_TICKSTS 0x4000 | ||
252 | #define WM8350_RTC_CLKSRC 0x2000 | ||
253 | #define WM8350_RTC_TRIM_MASK 0x03FF | ||
254 | |||
255 | /* | ||
256 | * RTC Interrupts. | ||
257 | */ | ||
258 | #define WM8350_IRQ_RTC_PER 7 | ||
259 | #define WM8350_IRQ_RTC_SEC 8 | ||
260 | #define WM8350_IRQ_RTC_ALM 9 | ||
261 | |||
262 | struct wm8350_rtc { | ||
263 | struct platform_device *pdev; | ||
264 | }; | ||
265 | |||
266 | #endif | ||
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h new file mode 100644 index 000000000000..1c8f3cde79b0 --- /dev/null +++ b/include/linux/mfd/wm8350/supply.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * supply.h -- Power Supply Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ | ||
14 | #define __LINUX_MFD_WM8350_SUPPLY_H_ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | /* | ||
19 | * Charger registers | ||
20 | */ | ||
21 | #define WM8350_BATTERY_CHARGER_CONTROL_1 0xA8 | ||
22 | #define WM8350_BATTERY_CHARGER_CONTROL_2 0xA9 | ||
23 | #define WM8350_BATTERY_CHARGER_CONTROL_3 0xAA | ||
24 | |||
25 | /* | ||
26 | * R168 (0xA8) - Battery Charger Control 1 | ||
27 | */ | ||
28 | #define WM8350_CHG_ENA_R168 0x8000 | ||
29 | #define WM8350_CHG_THR 0x2000 | ||
30 | #define WM8350_CHG_EOC_SEL_MASK 0x1C00 | ||
31 | #define WM8350_CHG_TRICKLE_TEMP_CHOKE 0x0200 | ||
32 | #define WM8350_CHG_TRICKLE_USB_CHOKE 0x0100 | ||
33 | #define WM8350_CHG_RECOVER_T 0x0080 | ||
34 | #define WM8350_CHG_END_ACT 0x0040 | ||
35 | #define WM8350_CHG_FAST 0x0020 | ||
36 | #define WM8350_CHG_FAST_USB_THROTTLE 0x0010 | ||
37 | #define WM8350_CHG_NTC_MON 0x0008 | ||
38 | #define WM8350_CHG_BATT_HOT_MON 0x0004 | ||
39 | #define WM8350_CHG_BATT_COLD_MON 0x0002 | ||
40 | #define WM8350_CHG_CHIP_TEMP_MON 0x0001 | ||
41 | |||
42 | /* | ||
43 | * R169 (0xA9) - Battery Charger Control 2 | ||
44 | */ | ||
45 | #define WM8350_CHG_ACTIVE 0x8000 | ||
46 | #define WM8350_CHG_PAUSE 0x4000 | ||
47 | #define WM8350_CHG_STS_MASK 0x3000 | ||
48 | #define WM8350_CHG_TIME_MASK 0x0F00 | ||
49 | #define WM8350_CHG_MASK_WALL_FB 0x0080 | ||
50 | #define WM8350_CHG_TRICKLE_SEL 0x0040 | ||
51 | #define WM8350_CHG_VSEL_MASK 0x0030 | ||
52 | #define WM8350_CHG_ISEL_MASK 0x000F | ||
53 | #define WM8350_CHG_STS_OFF 0x0000 | ||
54 | #define WM8350_CHG_STS_TRICKLE 0x1000 | ||
55 | #define WM8350_CHG_STS_FAST 0x2000 | ||
56 | |||
57 | /* | ||
58 | * R170 (0xAA) - Battery Charger Control 3 | ||
59 | */ | ||
60 | #define WM8350_CHG_THROTTLE_T_MASK 0x0060 | ||
61 | #define WM8350_CHG_SMART 0x0010 | ||
62 | #define WM8350_CHG_TIMER_ADJT_MASK 0x000F | ||
63 | |||
64 | /* | ||
65 | * Charger Interrupts | ||
66 | */ | ||
67 | #define WM8350_IRQ_CHG_BAT_HOT 0 | ||
68 | #define WM8350_IRQ_CHG_BAT_COLD 1 | ||
69 | #define WM8350_IRQ_CHG_BAT_FAIL 2 | ||
70 | #define WM8350_IRQ_CHG_TO 3 | ||
71 | #define WM8350_IRQ_CHG_END 4 | ||
72 | #define WM8350_IRQ_CHG_START 5 | ||
73 | #define WM8350_IRQ_CHG_FAST_RDY 6 | ||
74 | #define WM8350_IRQ_CHG_VBATT_LT_3P9 10 | ||
75 | #define WM8350_IRQ_CHG_VBATT_LT_3P1 11 | ||
76 | #define WM8350_IRQ_CHG_VBATT_LT_2P85 12 | ||
77 | |||
78 | /* | ||
79 | * Charger Policy | ||
80 | */ | ||
81 | #define WM8350_CHG_TRICKLE_50mA (0 << 6) | ||
82 | #define WM8350_CHG_TRICKLE_100mA (1 << 6) | ||
83 | #define WM8350_CHG_4_05V (0 << 4) | ||
84 | #define WM8350_CHG_4_10V (1 << 4) | ||
85 | #define WM8350_CHG_4_15V (2 << 4) | ||
86 | #define WM8350_CHG_4_20V (3 << 4) | ||
87 | #define WM8350_CHG_FAST_LIMIT_mA(x) ((x / 50) & 0xf) | ||
88 | #define WM8350_CHG_EOC_mA(x) (((x - 10) & 0x7) << 10) | ||
89 | #define WM8350_CHG_TRICKLE_3_1V (0 << 13) | ||
90 | #define WM8350_CHG_TRICKLE_3_9V (1 << 13) | ||
91 | |||
92 | /* | ||
93 | * Supply Registers. | ||
94 | */ | ||
95 | #define WM8350_USB_VOLTAGE_READBACK 0x9C | ||
96 | #define WM8350_LINE_VOLTAGE_READBACK 0x9D | ||
97 | #define WM8350_BATT_VOLTAGE_READBACK 0x9E | ||
98 | |||
99 | /* | ||
100 | * Supply Interrupts. | ||
101 | */ | ||
102 | #define WM8350_IRQ_USB_LIMIT 15 | ||
103 | #define WM8350_IRQ_EXT_USB_FB 36 | ||
104 | #define WM8350_IRQ_EXT_WALL_FB 37 | ||
105 | #define WM8350_IRQ_EXT_BAT_FB 38 | ||
106 | |||
107 | struct wm8350_power { | ||
108 | struct platform_device *pdev; | ||
109 | }; | ||
110 | |||
111 | #endif | ||
diff --git a/include/linux/mfd/wm8350/wdt.h b/include/linux/mfd/wm8350/wdt.h new file mode 100644 index 000000000000..f6135b5e5ef4 --- /dev/null +++ b/include/linux/mfd/wm8350/wdt.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * wdt.h -- Watchdog Driver for Wolfson WM8350 PMIC | ||
3 | * | ||
4 | * Copyright 2007, 2008 Wolfson Microelectronics PLC | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_WM8350_WDT_H_ | ||
13 | #define __LINUX_MFD_WM8350_WDT_H_ | ||
14 | |||
15 | #include <linux/platform_device.h> | ||
16 | |||
17 | #define WM8350_WDOG_HIB_MODE 0x0080 | ||
18 | #define WM8350_WDOG_DEBUG 0x0040 | ||
19 | #define WM8350_WDOG_MODE_MASK 0x0030 | ||
20 | #define WM8350_WDOG_TO_MASK 0x0007 | ||
21 | |||
22 | #define WM8350_IRQ_SYS_WDOG_TO 24 | ||
23 | |||
24 | struct wm8350_wdt { | ||
25 | struct platform_device *pdev; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
diff --git a/include/linux/mfd/wm8400-audio.h b/include/linux/mfd/wm8400-audio.h new file mode 100644 index 000000000000..b6640e018046 --- /dev/null +++ b/include/linux/mfd/wm8400-audio.h | |||
@@ -0,0 +1,1186 @@ | |||
1 | /* | ||
2 | * wm8400 private definitions for audio | ||
3 | * | ||
4 | * Copyright 2008 Wolfson Microelectronics plc | ||
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_MFD_WM8400_AUDIO_H | ||
22 | #define __LINUX_MFD_WM8400_AUDIO_H | ||
23 | |||
24 | #include <linux/mfd/wm8400-audio.h> | ||
25 | |||
26 | /* | ||
27 | * R2 (0x02) - Power Management (1) | ||
28 | */ | ||
29 | #define WM8400_CODEC_ENA 0x8000 /* CODEC_ENA */ | ||
30 | #define WM8400_CODEC_ENA_MASK 0x8000 /* CODEC_ENA */ | ||
31 | #define WM8400_CODEC_ENA_SHIFT 15 /* CODEC_ENA */ | ||
32 | #define WM8400_CODEC_ENA_WIDTH 1 /* CODEC_ENA */ | ||
33 | #define WM8400_SYSCLK_ENA 0x4000 /* SYSCLK_ENA */ | ||
34 | #define WM8400_SYSCLK_ENA_MASK 0x4000 /* SYSCLK_ENA */ | ||
35 | #define WM8400_SYSCLK_ENA_SHIFT 14 /* SYSCLK_ENA */ | ||
36 | #define WM8400_SYSCLK_ENA_WIDTH 1 /* SYSCLK_ENA */ | ||
37 | #define WM8400_SPK_MIX_ENA 0x2000 /* SPK_MIX_ENA */ | ||
38 | #define WM8400_SPK_MIX_ENA_MASK 0x2000 /* SPK_MIX_ENA */ | ||
39 | #define WM8400_SPK_MIX_ENA_SHIFT 13 /* SPK_MIX_ENA */ | ||
40 | #define WM8400_SPK_MIX_ENA_WIDTH 1 /* SPK_MIX_ENA */ | ||
41 | #define WM8400_SPK_ENA 0x1000 /* SPK_ENA */ | ||
42 | #define WM8400_SPK_ENA_MASK 0x1000 /* SPK_ENA */ | ||
43 | #define WM8400_SPK_ENA_SHIFT 12 /* SPK_ENA */ | ||
44 | #define WM8400_SPK_ENA_WIDTH 1 /* SPK_ENA */ | ||
45 | #define WM8400_OUT3_ENA 0x0800 /* OUT3_ENA */ | ||
46 | #define WM8400_OUT3_ENA_MASK 0x0800 /* OUT3_ENA */ | ||
47 | #define WM8400_OUT3_ENA_SHIFT 11 /* OUT3_ENA */ | ||
48 | #define WM8400_OUT3_ENA_WIDTH 1 /* OUT3_ENA */ | ||
49 | #define WM8400_OUT4_ENA 0x0400 /* OUT4_ENA */ | ||
50 | #define WM8400_OUT4_ENA_MASK 0x0400 /* OUT4_ENA */ | ||
51 | #define WM8400_OUT4_ENA_SHIFT 10 /* OUT4_ENA */ | ||
52 | #define WM8400_OUT4_ENA_WIDTH 1 /* OUT4_ENA */ | ||
53 | #define WM8400_LOUT_ENA 0x0200 /* LOUT_ENA */ | ||
54 | #define WM8400_LOUT_ENA_MASK 0x0200 /* LOUT_ENA */ | ||
55 | #define WM8400_LOUT_ENA_SHIFT 9 /* LOUT_ENA */ | ||
56 | #define WM8400_LOUT_ENA_WIDTH 1 /* LOUT_ENA */ | ||
57 | #define WM8400_ROUT_ENA 0x0100 /* ROUT_ENA */ | ||
58 | #define WM8400_ROUT_ENA_MASK 0x0100 /* ROUT_ENA */ | ||
59 | #define WM8400_ROUT_ENA_SHIFT 8 /* ROUT_ENA */ | ||
60 | #define WM8400_ROUT_ENA_WIDTH 1 /* ROUT_ENA */ | ||
61 | #define WM8400_MIC1BIAS_ENA 0x0010 /* MIC1BIAS_ENA */ | ||
62 | #define WM8400_MIC1BIAS_ENA_MASK 0x0010 /* MIC1BIAS_ENA */ | ||
63 | #define WM8400_MIC1BIAS_ENA_SHIFT 4 /* MIC1BIAS_ENA */ | ||
64 | #define WM8400_MIC1BIAS_ENA_WIDTH 1 /* MIC1BIAS_ENA */ | ||
65 | #define WM8400_VMID_MODE_MASK 0x0006 /* VMID_MODE - [2:1] */ | ||
66 | #define WM8400_VMID_MODE_SHIFT 1 /* VMID_MODE - [2:1] */ | ||
67 | #define WM8400_VMID_MODE_WIDTH 2 /* VMID_MODE - [2:1] */ | ||
68 | #define WM8400_VREF_ENA 0x0001 /* VREF_ENA */ | ||
69 | #define WM8400_VREF_ENA_MASK 0x0001 /* VREF_ENA */ | ||
70 | #define WM8400_VREF_ENA_SHIFT 0 /* VREF_ENA */ | ||
71 | #define WM8400_VREF_ENA_WIDTH 1 /* VREF_ENA */ | ||
72 | |||
73 | /* | ||
74 | * R3 (0x03) - Power Management (2) | ||
75 | */ | ||
76 | #define WM8400_FLL_ENA 0x8000 /* FLL_ENA */ | ||
77 | #define WM8400_FLL_ENA_MASK 0x8000 /* FLL_ENA */ | ||
78 | #define WM8400_FLL_ENA_SHIFT 15 /* FLL_ENA */ | ||
79 | #define WM8400_FLL_ENA_WIDTH 1 /* FLL_ENA */ | ||
80 | #define WM8400_TSHUT_ENA 0x4000 /* TSHUT_ENA */ | ||
81 | #define WM8400_TSHUT_ENA_MASK 0x4000 /* TSHUT_ENA */ | ||
82 | #define WM8400_TSHUT_ENA_SHIFT 14 /* TSHUT_ENA */ | ||
83 | #define WM8400_TSHUT_ENA_WIDTH 1 /* TSHUT_ENA */ | ||
84 | #define WM8400_TSHUT_OPDIS 0x2000 /* TSHUT_OPDIS */ | ||
85 | #define WM8400_TSHUT_OPDIS_MASK 0x2000 /* TSHUT_OPDIS */ | ||
86 | #define WM8400_TSHUT_OPDIS_SHIFT 13 /* TSHUT_OPDIS */ | ||
87 | #define WM8400_TSHUT_OPDIS_WIDTH 1 /* TSHUT_OPDIS */ | ||
88 | #define WM8400_OPCLK_ENA 0x0800 /* OPCLK_ENA */ | ||
89 | #define WM8400_OPCLK_ENA_MASK 0x0800 /* OPCLK_ENA */ | ||
90 | #define WM8400_OPCLK_ENA_SHIFT 11 /* OPCLK_ENA */ | ||
91 | #define WM8400_OPCLK_ENA_WIDTH 1 /* OPCLK_ENA */ | ||
92 | #define WM8400_AINL_ENA 0x0200 /* AINL_ENA */ | ||
93 | #define WM8400_AINL_ENA_MASK 0x0200 /* AINL_ENA */ | ||
94 | #define WM8400_AINL_ENA_SHIFT 9 /* AINL_ENA */ | ||
95 | #define WM8400_AINL_ENA_WIDTH 1 /* AINL_ENA */ | ||
96 | #define WM8400_AINR_ENA 0x0100 /* AINR_ENA */ | ||
97 | #define WM8400_AINR_ENA_MASK 0x0100 /* AINR_ENA */ | ||
98 | #define WM8400_AINR_ENA_SHIFT 8 /* AINR_ENA */ | ||
99 | #define WM8400_AINR_ENA_WIDTH 1 /* AINR_ENA */ | ||
100 | #define WM8400_LIN34_ENA 0x0080 /* LIN34_ENA */ | ||
101 | #define WM8400_LIN34_ENA_MASK 0x0080 /* LIN34_ENA */ | ||
102 | #define WM8400_LIN34_ENA_SHIFT 7 /* LIN34_ENA */ | ||
103 | #define WM8400_LIN34_ENA_WIDTH 1 /* LIN34_ENA */ | ||
104 | #define WM8400_LIN12_ENA 0x0040 /* LIN12_ENA */ | ||
105 | #define WM8400_LIN12_ENA_MASK 0x0040 /* LIN12_ENA */ | ||
106 | #define WM8400_LIN12_ENA_SHIFT 6 /* LIN12_ENA */ | ||
107 | #define WM8400_LIN12_ENA_WIDTH 1 /* LIN12_ENA */ | ||
108 | #define WM8400_RIN34_ENA 0x0020 /* RIN34_ENA */ | ||
109 | #define WM8400_RIN34_ENA_MASK 0x0020 /* RIN34_ENA */ | ||
110 | #define WM8400_RIN34_ENA_SHIFT 5 /* RIN34_ENA */ | ||
111 | #define WM8400_RIN34_ENA_WIDTH 1 /* RIN34_ENA */ | ||
112 | #define WM8400_RIN12_ENA 0x0010 /* RIN12_ENA */ | ||
113 | #define WM8400_RIN12_ENA_MASK 0x0010 /* RIN12_ENA */ | ||
114 | #define WM8400_RIN12_ENA_SHIFT 4 /* RIN12_ENA */ | ||
115 | #define WM8400_RIN12_ENA_WIDTH 1 /* RIN12_ENA */ | ||
116 | #define WM8400_ADCL_ENA 0x0002 /* ADCL_ENA */ | ||
117 | #define WM8400_ADCL_ENA_MASK 0x0002 /* ADCL_ENA */ | ||
118 | #define WM8400_ADCL_ENA_SHIFT 1 /* ADCL_ENA */ | ||
119 | #define WM8400_ADCL_ENA_WIDTH 1 /* ADCL_ENA */ | ||
120 | #define WM8400_ADCR_ENA 0x0001 /* ADCR_ENA */ | ||
121 | #define WM8400_ADCR_ENA_MASK 0x0001 /* ADCR_ENA */ | ||
122 | #define WM8400_ADCR_ENA_SHIFT 0 /* ADCR_ENA */ | ||
123 | #define WM8400_ADCR_ENA_WIDTH 1 /* ADCR_ENA */ | ||
124 | |||
125 | /* | ||
126 | * R4 (0x04) - Power Management (3) | ||
127 | */ | ||
128 | #define WM8400_LON_ENA 0x2000 /* LON_ENA */ | ||
129 | #define WM8400_LON_ENA_MASK 0x2000 /* LON_ENA */ | ||
130 | #define WM8400_LON_ENA_SHIFT 13 /* LON_ENA */ | ||
131 | #define WM8400_LON_ENA_WIDTH 1 /* LON_ENA */ | ||
132 | #define WM8400_LOP_ENA 0x1000 /* LOP_ENA */ | ||
133 | #define WM8400_LOP_ENA_MASK 0x1000 /* LOP_ENA */ | ||
134 | #define WM8400_LOP_ENA_SHIFT 12 /* LOP_ENA */ | ||
135 | #define WM8400_LOP_ENA_WIDTH 1 /* LOP_ENA */ | ||
136 | #define WM8400_RON_ENA 0x0800 /* RON_ENA */ | ||
137 | #define WM8400_RON_ENA_MASK 0x0800 /* RON_ENA */ | ||
138 | #define WM8400_RON_ENA_SHIFT 11 /* RON_ENA */ | ||
139 | #define WM8400_RON_ENA_WIDTH 1 /* RON_ENA */ | ||
140 | #define WM8400_ROP_ENA 0x0400 /* ROP_ENA */ | ||
141 | #define WM8400_ROP_ENA_MASK 0x0400 /* ROP_ENA */ | ||
142 | #define WM8400_ROP_ENA_SHIFT 10 /* ROP_ENA */ | ||
143 | #define WM8400_ROP_ENA_WIDTH 1 /* ROP_ENA */ | ||
144 | #define WM8400_LOPGA_ENA 0x0080 /* LOPGA_ENA */ | ||
145 | #define WM8400_LOPGA_ENA_MASK 0x0080 /* LOPGA_ENA */ | ||
146 | #define WM8400_LOPGA_ENA_SHIFT 7 /* LOPGA_ENA */ | ||
147 | #define WM8400_LOPGA_ENA_WIDTH 1 /* LOPGA_ENA */ | ||
148 | #define WM8400_ROPGA_ENA 0x0040 /* ROPGA_ENA */ | ||
149 | #define WM8400_ROPGA_ENA_MASK 0x0040 /* ROPGA_ENA */ | ||
150 | #define WM8400_ROPGA_ENA_SHIFT 6 /* ROPGA_ENA */ | ||
151 | #define WM8400_ROPGA_ENA_WIDTH 1 /* ROPGA_ENA */ | ||
152 | #define WM8400_LOMIX_ENA 0x0020 /* LOMIX_ENA */ | ||
153 | #define WM8400_LOMIX_ENA_MASK 0x0020 /* LOMIX_ENA */ | ||
154 | #define WM8400_LOMIX_ENA_SHIFT 5 /* LOMIX_ENA */ | ||
155 | #define WM8400_LOMIX_ENA_WIDTH 1 /* LOMIX_ENA */ | ||
156 | #define WM8400_ROMIX_ENA 0x0010 /* ROMIX_ENA */ | ||
157 | #define WM8400_ROMIX_ENA_MASK 0x0010 /* ROMIX_ENA */ | ||
158 | #define WM8400_ROMIX_ENA_SHIFT 4 /* ROMIX_ENA */ | ||
159 | #define WM8400_ROMIX_ENA_WIDTH 1 /* ROMIX_ENA */ | ||
160 | #define WM8400_DACL_ENA 0x0002 /* DACL_ENA */ | ||
161 | #define WM8400_DACL_ENA_MASK 0x0002 /* DACL_ENA */ | ||
162 | #define WM8400_DACL_ENA_SHIFT 1 /* DACL_ENA */ | ||
163 | #define WM8400_DACL_ENA_WIDTH 1 /* DACL_ENA */ | ||
164 | #define WM8400_DACR_ENA 0x0001 /* DACR_ENA */ | ||
165 | #define WM8400_DACR_ENA_MASK 0x0001 /* DACR_ENA */ | ||
166 | #define WM8400_DACR_ENA_SHIFT 0 /* DACR_ENA */ | ||
167 | #define WM8400_DACR_ENA_WIDTH 1 /* DACR_ENA */ | ||
168 | |||
169 | /* | ||
170 | * R5 (0x05) - Audio Interface (1) | ||
171 | */ | ||
172 | #define WM8400_AIFADCL_SRC 0x8000 /* AIFADCL_SRC */ | ||
173 | #define WM8400_AIFADCL_SRC_MASK 0x8000 /* AIFADCL_SRC */ | ||
174 | #define WM8400_AIFADCL_SRC_SHIFT 15 /* AIFADCL_SRC */ | ||
175 | #define WM8400_AIFADCL_SRC_WIDTH 1 /* AIFADCL_SRC */ | ||
176 | #define WM8400_AIFADCR_SRC 0x4000 /* AIFADCR_SRC */ | ||
177 | #define WM8400_AIFADCR_SRC_MASK 0x4000 /* AIFADCR_SRC */ | ||
178 | #define WM8400_AIFADCR_SRC_SHIFT 14 /* AIFADCR_SRC */ | ||
179 | #define WM8400_AIFADCR_SRC_WIDTH 1 /* AIFADCR_SRC */ | ||
180 | #define WM8400_AIFADC_TDM 0x2000 /* AIFADC_TDM */ | ||
181 | #define WM8400_AIFADC_TDM_MASK 0x2000 /* AIFADC_TDM */ | ||
182 | #define WM8400_AIFADC_TDM_SHIFT 13 /* AIFADC_TDM */ | ||
183 | #define WM8400_AIFADC_TDM_WIDTH 1 /* AIFADC_TDM */ | ||
184 | #define WM8400_AIFADC_TDM_CHAN 0x1000 /* AIFADC_TDM_CHAN */ | ||
185 | #define WM8400_AIFADC_TDM_CHAN_MASK 0x1000 /* AIFADC_TDM_CHAN */ | ||
186 | #define WM8400_AIFADC_TDM_CHAN_SHIFT 12 /* AIFADC_TDM_CHAN */ | ||
187 | #define WM8400_AIFADC_TDM_CHAN_WIDTH 1 /* AIFADC_TDM_CHAN */ | ||
188 | #define WM8400_AIF_BCLK_INV 0x0100 /* AIF_BCLK_INV */ | ||
189 | #define WM8400_AIF_BCLK_INV_MASK 0x0100 /* AIF_BCLK_INV */ | ||
190 | #define WM8400_AIF_BCLK_INV_SHIFT 8 /* AIF_BCLK_INV */ | ||
191 | #define WM8400_AIF_BCLK_INV_WIDTH 1 /* AIF_BCLK_INV */ | ||
192 | #define WM8400_AIF_LRCLK_INV 0x0080 /* AIF_LRCLK_INV */ | ||
193 | #define WM8400_AIF_LRCLK_INV_MASK 0x0080 /* AIF_LRCLK_INV */ | ||
194 | #define WM8400_AIF_LRCLK_INV_SHIFT 7 /* AIF_LRCLK_INV */ | ||
195 | #define WM8400_AIF_LRCLK_INV_WIDTH 1 /* AIF_LRCLK_INV */ | ||
196 | #define WM8400_AIF_WL_MASK 0x0060 /* AIF_WL - [6:5] */ | ||
197 | #define WM8400_AIF_WL_SHIFT 5 /* AIF_WL - [6:5] */ | ||
198 | #define WM8400_AIF_WL_WIDTH 2 /* AIF_WL - [6:5] */ | ||
199 | #define WM8400_AIF_WL_16BITS (0 << 5) | ||
200 | #define WM8400_AIF_WL_20BITS (1 << 5) | ||
201 | #define WM8400_AIF_WL_24BITS (2 << 5) | ||
202 | #define WM8400_AIF_WL_32BITS (3 << 5) | ||
203 | #define WM8400_AIF_FMT_MASK 0x0018 /* AIF_FMT - [4:3] */ | ||
204 | #define WM8400_AIF_FMT_SHIFT 3 /* AIF_FMT - [4:3] */ | ||
205 | #define WM8400_AIF_FMT_WIDTH 2 /* AIF_FMT - [4:3] */ | ||
206 | #define WM8400_AIF_FMT_RIGHTJ (0 << 3) | ||
207 | #define WM8400_AIF_FMT_LEFTJ (1 << 3) | ||
208 | #define WM8400_AIF_FMT_I2S (2 << 3) | ||
209 | #define WM8400_AIF_FMT_DSP (3 << 3) | ||
210 | |||
211 | /* | ||
212 | * R6 (0x06) - Audio Interface (2) | ||
213 | */ | ||
214 | #define WM8400_DACL_SRC 0x8000 /* DACL_SRC */ | ||
215 | #define WM8400_DACL_SRC_MASK 0x8000 /* DACL_SRC */ | ||
216 | #define WM8400_DACL_SRC_SHIFT 15 /* DACL_SRC */ | ||
217 | #define WM8400_DACL_SRC_WIDTH 1 /* DACL_SRC */ | ||
218 | #define WM8400_DACR_SRC 0x4000 /* DACR_SRC */ | ||
219 | #define WM8400_DACR_SRC_MASK 0x4000 /* DACR_SRC */ | ||
220 | #define WM8400_DACR_SRC_SHIFT 14 /* DACR_SRC */ | ||
221 | #define WM8400_DACR_SRC_WIDTH 1 /* DACR_SRC */ | ||
222 | #define WM8400_AIFDAC_TDM 0x2000 /* AIFDAC_TDM */ | ||
223 | #define WM8400_AIFDAC_TDM_MASK 0x2000 /* AIFDAC_TDM */ | ||
224 | #define WM8400_AIFDAC_TDM_SHIFT 13 /* AIFDAC_TDM */ | ||
225 | #define WM8400_AIFDAC_TDM_WIDTH 1 /* AIFDAC_TDM */ | ||
226 | #define WM8400_AIFDAC_TDM_CHAN 0x1000 /* AIFDAC_TDM_CHAN */ | ||
227 | #define WM8400_AIFDAC_TDM_CHAN_MASK 0x1000 /* AIFDAC_TDM_CHAN */ | ||
228 | #define WM8400_AIFDAC_TDM_CHAN_SHIFT 12 /* AIFDAC_TDM_CHAN */ | ||
229 | #define WM8400_AIFDAC_TDM_CHAN_WIDTH 1 /* AIFDAC_TDM_CHAN */ | ||
230 | #define WM8400_DAC_BOOST_MASK 0x0C00 /* DAC_BOOST - [11:10] */ | ||
231 | #define WM8400_DAC_BOOST_SHIFT 10 /* DAC_BOOST - [11:10] */ | ||
232 | #define WM8400_DAC_BOOST_WIDTH 2 /* DAC_BOOST - [11:10] */ | ||
233 | #define WM8400_DAC_COMP 0x0010 /* DAC_COMP */ | ||
234 | #define WM8400_DAC_COMP_MASK 0x0010 /* DAC_COMP */ | ||
235 | #define WM8400_DAC_COMP_SHIFT 4 /* DAC_COMP */ | ||
236 | #define WM8400_DAC_COMP_WIDTH 1 /* DAC_COMP */ | ||
237 | #define WM8400_DAC_COMPMODE 0x0008 /* DAC_COMPMODE */ | ||
238 | #define WM8400_DAC_COMPMODE_MASK 0x0008 /* DAC_COMPMODE */ | ||
239 | #define WM8400_DAC_COMPMODE_SHIFT 3 /* DAC_COMPMODE */ | ||
240 | #define WM8400_DAC_COMPMODE_WIDTH 1 /* DAC_COMPMODE */ | ||
241 | #define WM8400_ADC_COMP 0x0004 /* ADC_COMP */ | ||
242 | #define WM8400_ADC_COMP_MASK 0x0004 /* ADC_COMP */ | ||
243 | #define WM8400_ADC_COMP_SHIFT 2 /* ADC_COMP */ | ||
244 | #define WM8400_ADC_COMP_WIDTH 1 /* ADC_COMP */ | ||
245 | #define WM8400_ADC_COMPMODE 0x0002 /* ADC_COMPMODE */ | ||
246 | #define WM8400_ADC_COMPMODE_MASK 0x0002 /* ADC_COMPMODE */ | ||
247 | #define WM8400_ADC_COMPMODE_SHIFT 1 /* ADC_COMPMODE */ | ||
248 | #define WM8400_ADC_COMPMODE_WIDTH 1 /* ADC_COMPMODE */ | ||
249 | #define WM8400_LOOPBACK 0x0001 /* LOOPBACK */ | ||
250 | #define WM8400_LOOPBACK_MASK 0x0001 /* LOOPBACK */ | ||
251 | #define WM8400_LOOPBACK_SHIFT 0 /* LOOPBACK */ | ||
252 | #define WM8400_LOOPBACK_WIDTH 1 /* LOOPBACK */ | ||
253 | |||
254 | /* | ||
255 | * R7 (0x07) - Clocking (1) | ||
256 | */ | ||
257 | #define WM8400_TOCLK_RATE 0x8000 /* TOCLK_RATE */ | ||
258 | #define WM8400_TOCLK_RATE_MASK 0x8000 /* TOCLK_RATE */ | ||
259 | #define WM8400_TOCLK_RATE_SHIFT 15 /* TOCLK_RATE */ | ||
260 | #define WM8400_TOCLK_RATE_WIDTH 1 /* TOCLK_RATE */ | ||
261 | #define WM8400_TOCLK_ENA 0x4000 /* TOCLK_ENA */ | ||
262 | #define WM8400_TOCLK_ENA_MASK 0x4000 /* TOCLK_ENA */ | ||
263 | #define WM8400_TOCLK_ENA_SHIFT 14 /* TOCLK_ENA */ | ||
264 | #define WM8400_TOCLK_ENA_WIDTH 1 /* TOCLK_ENA */ | ||
265 | #define WM8400_OPCLKDIV_MASK 0x1E00 /* OPCLKDIV - [12:9] */ | ||
266 | #define WM8400_OPCLKDIV_SHIFT 9 /* OPCLKDIV - [12:9] */ | ||
267 | #define WM8400_OPCLKDIV_WIDTH 4 /* OPCLKDIV - [12:9] */ | ||
268 | #define WM8400_DCLKDIV_MASK 0x01C0 /* DCLKDIV - [8:6] */ | ||
269 | #define WM8400_DCLKDIV_SHIFT 6 /* DCLKDIV - [8:6] */ | ||
270 | #define WM8400_DCLKDIV_WIDTH 3 /* DCLKDIV - [8:6] */ | ||
271 | #define WM8400_BCLK_DIV_MASK 0x001E /* BCLK_DIV - [4:1] */ | ||
272 | #define WM8400_BCLK_DIV_SHIFT 1 /* BCLK_DIV - [4:1] */ | ||
273 | #define WM8400_BCLK_DIV_WIDTH 4 /* BCLK_DIV - [4:1] */ | ||
274 | |||
275 | /* | ||
276 | * R8 (0x08) - Clocking (2) | ||
277 | */ | ||
278 | #define WM8400_MCLK_SRC 0x8000 /* MCLK_SRC */ | ||
279 | #define WM8400_MCLK_SRC_MASK 0x8000 /* MCLK_SRC */ | ||
280 | #define WM8400_MCLK_SRC_SHIFT 15 /* MCLK_SRC */ | ||
281 | #define WM8400_MCLK_SRC_WIDTH 1 /* MCLK_SRC */ | ||
282 | #define WM8400_SYSCLK_SRC 0x4000 /* SYSCLK_SRC */ | ||
283 | #define WM8400_SYSCLK_SRC_MASK 0x4000 /* SYSCLK_SRC */ | ||
284 | #define WM8400_SYSCLK_SRC_SHIFT 14 /* SYSCLK_SRC */ | ||
285 | #define WM8400_SYSCLK_SRC_WIDTH 1 /* SYSCLK_SRC */ | ||
286 | #define WM8400_CLK_FORCE 0x2000 /* CLK_FORCE */ | ||
287 | #define WM8400_CLK_FORCE_MASK 0x2000 /* CLK_FORCE */ | ||
288 | #define WM8400_CLK_FORCE_SHIFT 13 /* CLK_FORCE */ | ||
289 | #define WM8400_CLK_FORCE_WIDTH 1 /* CLK_FORCE */ | ||
290 | #define WM8400_MCLK_DIV_MASK 0x1800 /* MCLK_DIV - [12:11] */ | ||
291 | #define WM8400_MCLK_DIV_SHIFT 11 /* MCLK_DIV - [12:11] */ | ||
292 | #define WM8400_MCLK_DIV_WIDTH 2 /* MCLK_DIV - [12:11] */ | ||
293 | #define WM8400_MCLK_INV 0x0400 /* MCLK_INV */ | ||
294 | #define WM8400_MCLK_INV_MASK 0x0400 /* MCLK_INV */ | ||
295 | #define WM8400_MCLK_INV_SHIFT 10 /* MCLK_INV */ | ||
296 | #define WM8400_MCLK_INV_WIDTH 1 /* MCLK_INV */ | ||
297 | #define WM8400_ADC_CLKDIV_MASK 0x00E0 /* ADC_CLKDIV - [7:5] */ | ||
298 | #define WM8400_ADC_CLKDIV_SHIFT 5 /* ADC_CLKDIV - [7:5] */ | ||
299 | #define WM8400_ADC_CLKDIV_WIDTH 3 /* ADC_CLKDIV - [7:5] */ | ||
300 | #define WM8400_DAC_CLKDIV_MASK 0x001C /* DAC_CLKDIV - [4:2] */ | ||
301 | #define WM8400_DAC_CLKDIV_SHIFT 2 /* DAC_CLKDIV - [4:2] */ | ||
302 | #define WM8400_DAC_CLKDIV_WIDTH 3 /* DAC_CLKDIV - [4:2] */ | ||
303 | |||
304 | /* | ||
305 | * R9 (0x09) - Audio Interface (3) | ||
306 | */ | ||
307 | #define WM8400_AIF_MSTR1 0x8000 /* AIF_MSTR1 */ | ||
308 | #define WM8400_AIF_MSTR1_MASK 0x8000 /* AIF_MSTR1 */ | ||
309 | #define WM8400_AIF_MSTR1_SHIFT 15 /* AIF_MSTR1 */ | ||
310 | #define WM8400_AIF_MSTR1_WIDTH 1 /* AIF_MSTR1 */ | ||
311 | #define WM8400_AIF_MSTR2 0x4000 /* AIF_MSTR2 */ | ||
312 | #define WM8400_AIF_MSTR2_MASK 0x4000 /* AIF_MSTR2 */ | ||
313 | #define WM8400_AIF_MSTR2_SHIFT 14 /* AIF_MSTR2 */ | ||
314 | #define WM8400_AIF_MSTR2_WIDTH 1 /* AIF_MSTR2 */ | ||
315 | #define WM8400_AIF_SEL 0x2000 /* AIF_SEL */ | ||
316 | #define WM8400_AIF_SEL_MASK 0x2000 /* AIF_SEL */ | ||
317 | #define WM8400_AIF_SEL_SHIFT 13 /* AIF_SEL */ | ||
318 | #define WM8400_AIF_SEL_WIDTH 1 /* AIF_SEL */ | ||
319 | #define WM8400_ADCLRC_DIR 0x0800 /* ADCLRC_DIR */ | ||
320 | #define WM8400_ADCLRC_DIR_MASK 0x0800 /* ADCLRC_DIR */ | ||
321 | #define WM8400_ADCLRC_DIR_SHIFT 11 /* ADCLRC_DIR */ | ||
322 | #define WM8400_ADCLRC_DIR_WIDTH 1 /* ADCLRC_DIR */ | ||
323 | #define WM8400_ADCLRC_RATE_MASK 0x07FF /* ADCLRC_RATE - [10:0] */ | ||
324 | #define WM8400_ADCLRC_RATE_SHIFT 0 /* ADCLRC_RATE - [10:0] */ | ||
325 | #define WM8400_ADCLRC_RATE_WIDTH 11 /* ADCLRC_RATE - [10:0] */ | ||
326 | |||
327 | /* | ||
328 | * R10 (0x0A) - Audio Interface (4) | ||
329 | */ | ||
330 | #define WM8400_ALRCGPIO1 0x8000 /* ALRCGPIO1 */ | ||
331 | #define WM8400_ALRCGPIO1_MASK 0x8000 /* ALRCGPIO1 */ | ||
332 | #define WM8400_ALRCGPIO1_SHIFT 15 /* ALRCGPIO1 */ | ||
333 | #define WM8400_ALRCGPIO1_WIDTH 1 /* ALRCGPIO1 */ | ||
334 | #define WM8400_ALRCBGPIO6 0x4000 /* ALRCBGPIO6 */ | ||
335 | #define WM8400_ALRCBGPIO6_MASK 0x4000 /* ALRCBGPIO6 */ | ||
336 | #define WM8400_ALRCBGPIO6_SHIFT 14 /* ALRCBGPIO6 */ | ||
337 | #define WM8400_ALRCBGPIO6_WIDTH 1 /* ALRCBGPIO6 */ | ||
338 | #define WM8400_AIF_TRIS 0x2000 /* AIF_TRIS */ | ||
339 | #define WM8400_AIF_TRIS_MASK 0x2000 /* AIF_TRIS */ | ||
340 | #define WM8400_AIF_TRIS_SHIFT 13 /* AIF_TRIS */ | ||
341 | #define WM8400_AIF_TRIS_WIDTH 1 /* AIF_TRIS */ | ||
342 | #define WM8400_DACLRC_DIR 0x0800 /* DACLRC_DIR */ | ||
343 | #define WM8400_DACLRC_DIR_MASK 0x0800 /* DACLRC_DIR */ | ||
344 | #define WM8400_DACLRC_DIR_SHIFT 11 /* DACLRC_DIR */ | ||
345 | #define WM8400_DACLRC_DIR_WIDTH 1 /* DACLRC_DIR */ | ||
346 | #define WM8400_DACLRC_RATE_MASK 0x07FF /* DACLRC_RATE - [10:0] */ | ||
347 | #define WM8400_DACLRC_RATE_SHIFT 0 /* DACLRC_RATE - [10:0] */ | ||
348 | #define WM8400_DACLRC_RATE_WIDTH 11 /* DACLRC_RATE - [10:0] */ | ||
349 | |||
350 | /* | ||
351 | * R11 (0x0B) - DAC CTRL | ||
352 | */ | ||
353 | #define WM8400_DAC_SDMCLK_RATE 0x2000 /* DAC_SDMCLK_RATE */ | ||
354 | #define WM8400_DAC_SDMCLK_RATE_MASK 0x2000 /* DAC_SDMCLK_RATE */ | ||
355 | #define WM8400_DAC_SDMCLK_RATE_SHIFT 13 /* DAC_SDMCLK_RATE */ | ||
356 | #define WM8400_DAC_SDMCLK_RATE_WIDTH 1 /* DAC_SDMCLK_RATE */ | ||
357 | #define WM8400_AIF_LRCLKRATE 0x0400 /* AIF_LRCLKRATE */ | ||
358 | #define WM8400_AIF_LRCLKRATE_MASK 0x0400 /* AIF_LRCLKRATE */ | ||
359 | #define WM8400_AIF_LRCLKRATE_SHIFT 10 /* AIF_LRCLKRATE */ | ||
360 | #define WM8400_AIF_LRCLKRATE_WIDTH 1 /* AIF_LRCLKRATE */ | ||
361 | #define WM8400_DAC_MONO 0x0200 /* DAC_MONO */ | ||
362 | #define WM8400_DAC_MONO_MASK 0x0200 /* DAC_MONO */ | ||
363 | #define WM8400_DAC_MONO_SHIFT 9 /* DAC_MONO */ | ||
364 | #define WM8400_DAC_MONO_WIDTH 1 /* DAC_MONO */ | ||
365 | #define WM8400_DAC_SB_FILT 0x0100 /* DAC_SB_FILT */ | ||
366 | #define WM8400_DAC_SB_FILT_MASK 0x0100 /* DAC_SB_FILT */ | ||
367 | #define WM8400_DAC_SB_FILT_SHIFT 8 /* DAC_SB_FILT */ | ||
368 | #define WM8400_DAC_SB_FILT_WIDTH 1 /* DAC_SB_FILT */ | ||
369 | #define WM8400_DAC_MUTERATE 0x0080 /* DAC_MUTERATE */ | ||
370 | #define WM8400_DAC_MUTERATE_MASK 0x0080 /* DAC_MUTERATE */ | ||
371 | #define WM8400_DAC_MUTERATE_SHIFT 7 /* DAC_MUTERATE */ | ||
372 | #define WM8400_DAC_MUTERATE_WIDTH 1 /* DAC_MUTERATE */ | ||
373 | #define WM8400_DAC_MUTEMODE 0x0040 /* DAC_MUTEMODE */ | ||
374 | #define WM8400_DAC_MUTEMODE_MASK 0x0040 /* DAC_MUTEMODE */ | ||
375 | #define WM8400_DAC_MUTEMODE_SHIFT 6 /* DAC_MUTEMODE */ | ||
376 | #define WM8400_DAC_MUTEMODE_WIDTH 1 /* DAC_MUTEMODE */ | ||
377 | #define WM8400_DEEMP_MASK 0x0030 /* DEEMP - [5:4] */ | ||
378 | #define WM8400_DEEMP_SHIFT 4 /* DEEMP - [5:4] */ | ||
379 | #define WM8400_DEEMP_WIDTH 2 /* DEEMP - [5:4] */ | ||
380 | #define WM8400_DAC_MUTE 0x0004 /* DAC_MUTE */ | ||
381 | #define WM8400_DAC_MUTE_MASK 0x0004 /* DAC_MUTE */ | ||
382 | #define WM8400_DAC_MUTE_SHIFT 2 /* DAC_MUTE */ | ||
383 | #define WM8400_DAC_MUTE_WIDTH 1 /* DAC_MUTE */ | ||
384 | #define WM8400_DACL_DATINV 0x0002 /* DACL_DATINV */ | ||
385 | #define WM8400_DACL_DATINV_MASK 0x0002 /* DACL_DATINV */ | ||
386 | #define WM8400_DACL_DATINV_SHIFT 1 /* DACL_DATINV */ | ||
387 | #define WM8400_DACL_DATINV_WIDTH 1 /* DACL_DATINV */ | ||
388 | #define WM8400_DACR_DATINV 0x0001 /* DACR_DATINV */ | ||
389 | #define WM8400_DACR_DATINV_MASK 0x0001 /* DACR_DATINV */ | ||
390 | #define WM8400_DACR_DATINV_SHIFT 0 /* DACR_DATINV */ | ||
391 | #define WM8400_DACR_DATINV_WIDTH 1 /* DACR_DATINV */ | ||
392 | |||
393 | /* | ||
394 | * R12 (0x0C) - Left DAC Digital Volume | ||
395 | */ | ||
396 | #define WM8400_DAC_VU 0x0100 /* DAC_VU */ | ||
397 | #define WM8400_DAC_VU_MASK 0x0100 /* DAC_VU */ | ||
398 | #define WM8400_DAC_VU_SHIFT 8 /* DAC_VU */ | ||
399 | #define WM8400_DAC_VU_WIDTH 1 /* DAC_VU */ | ||
400 | #define WM8400_DACL_VOL_MASK 0x00FF /* DACL_VOL - [7:0] */ | ||
401 | #define WM8400_DACL_VOL_SHIFT 0 /* DACL_VOL - [7:0] */ | ||
402 | #define WM8400_DACL_VOL_WIDTH 8 /* DACL_VOL - [7:0] */ | ||
403 | |||
404 | /* | ||
405 | * R13 (0x0D) - Right DAC Digital Volume | ||
406 | */ | ||
407 | #define WM8400_DAC_VU 0x0100 /* DAC_VU */ | ||
408 | #define WM8400_DAC_VU_MASK 0x0100 /* DAC_VU */ | ||
409 | #define WM8400_DAC_VU_SHIFT 8 /* DAC_VU */ | ||
410 | #define WM8400_DAC_VU_WIDTH 1 /* DAC_VU */ | ||
411 | #define WM8400_DACR_VOL_MASK 0x00FF /* DACR_VOL - [7:0] */ | ||
412 | #define WM8400_DACR_VOL_SHIFT 0 /* DACR_VOL - [7:0] */ | ||
413 | #define WM8400_DACR_VOL_WIDTH 8 /* DACR_VOL - [7:0] */ | ||
414 | |||
415 | /* | ||
416 | * R14 (0x0E) - Digital Side Tone | ||
417 | */ | ||
418 | #define WM8400_ADCL_DAC_SVOL_MASK 0x1E00 /* ADCL_DAC_SVOL - [12:9] */ | ||
419 | #define WM8400_ADCL_DAC_SVOL_SHIFT 9 /* ADCL_DAC_SVOL - [12:9] */ | ||
420 | #define WM8400_ADCL_DAC_SVOL_WIDTH 4 /* ADCL_DAC_SVOL - [12:9] */ | ||
421 | #define WM8400_ADCR_DAC_SVOL_MASK 0x01E0 /* ADCR_DAC_SVOL - [8:5] */ | ||
422 | #define WM8400_ADCR_DAC_SVOL_SHIFT 5 /* ADCR_DAC_SVOL - [8:5] */ | ||
423 | #define WM8400_ADCR_DAC_SVOL_WIDTH 4 /* ADCR_DAC_SVOL - [8:5] */ | ||
424 | #define WM8400_ADC_TO_DACL_MASK 0x000C /* ADC_TO_DACL - [3:2] */ | ||
425 | #define WM8400_ADC_TO_DACL_SHIFT 2 /* ADC_TO_DACL - [3:2] */ | ||
426 | #define WM8400_ADC_TO_DACL_WIDTH 2 /* ADC_TO_DACL - [3:2] */ | ||
427 | #define WM8400_ADC_TO_DACR_MASK 0x0003 /* ADC_TO_DACR - [1:0] */ | ||
428 | #define WM8400_ADC_TO_DACR_SHIFT 0 /* ADC_TO_DACR - [1:0] */ | ||
429 | #define WM8400_ADC_TO_DACR_WIDTH 2 /* ADC_TO_DACR - [1:0] */ | ||
430 | |||
431 | /* | ||
432 | * R15 (0x0F) - ADC CTRL | ||
433 | */ | ||
434 | #define WM8400_ADC_HPF_ENA 0x0100 /* ADC_HPF_ENA */ | ||
435 | #define WM8400_ADC_HPF_ENA_MASK 0x0100 /* ADC_HPF_ENA */ | ||
436 | #define WM8400_ADC_HPF_ENA_SHIFT 8 /* ADC_HPF_ENA */ | ||
437 | #define WM8400_ADC_HPF_ENA_WIDTH 1 /* ADC_HPF_ENA */ | ||
438 | #define WM8400_ADC_HPF_CUT_MASK 0x0060 /* ADC_HPF_CUT - [6:5] */ | ||
439 | #define WM8400_ADC_HPF_CUT_SHIFT 5 /* ADC_HPF_CUT - [6:5] */ | ||
440 | #define WM8400_ADC_HPF_CUT_WIDTH 2 /* ADC_HPF_CUT - [6:5] */ | ||
441 | #define WM8400_ADCL_DATINV 0x0002 /* ADCL_DATINV */ | ||
442 | #define WM8400_ADCL_DATINV_MASK 0x0002 /* ADCL_DATINV */ | ||
443 | #define WM8400_ADCL_DATINV_SHIFT 1 /* ADCL_DATINV */ | ||
444 | #define WM8400_ADCL_DATINV_WIDTH 1 /* ADCL_DATINV */ | ||
445 | #define WM8400_ADCR_DATINV 0x0001 /* ADCR_DATINV */ | ||
446 | #define WM8400_ADCR_DATINV_MASK 0x0001 /* ADCR_DATINV */ | ||
447 | #define WM8400_ADCR_DATINV_SHIFT 0 /* ADCR_DATINV */ | ||
448 | #define WM8400_ADCR_DATINV_WIDTH 1 /* ADCR_DATINV */ | ||
449 | |||
450 | /* | ||
451 | * R16 (0x10) - Left ADC Digital Volume | ||
452 | */ | ||
453 | #define WM8400_ADC_VU 0x0100 /* ADC_VU */ | ||
454 | #define WM8400_ADC_VU_MASK 0x0100 /* ADC_VU */ | ||
455 | #define WM8400_ADC_VU_SHIFT 8 /* ADC_VU */ | ||
456 | #define WM8400_ADC_VU_WIDTH 1 /* ADC_VU */ | ||
457 | #define WM8400_ADCL_VOL_MASK 0x00FF /* ADCL_VOL - [7:0] */ | ||
458 | #define WM8400_ADCL_VOL_SHIFT 0 /* ADCL_VOL - [7:0] */ | ||
459 | #define WM8400_ADCL_VOL_WIDTH 8 /* ADCL_VOL - [7:0] */ | ||
460 | |||
461 | /* | ||
462 | * R17 (0x11) - Right ADC Digital Volume | ||
463 | */ | ||
464 | #define WM8400_ADC_VU 0x0100 /* ADC_VU */ | ||
465 | #define WM8400_ADC_VU_MASK 0x0100 /* ADC_VU */ | ||
466 | #define WM8400_ADC_VU_SHIFT 8 /* ADC_VU */ | ||
467 | #define WM8400_ADC_VU_WIDTH 1 /* ADC_VU */ | ||
468 | #define WM8400_ADCR_VOL_MASK 0x00FF /* ADCR_VOL - [7:0] */ | ||
469 | #define WM8400_ADCR_VOL_SHIFT 0 /* ADCR_VOL - [7:0] */ | ||
470 | #define WM8400_ADCR_VOL_WIDTH 8 /* ADCR_VOL - [7:0] */ | ||
471 | |||
472 | /* | ||
473 | * R24 (0x18) - Left Line Input 1&2 Volume | ||
474 | */ | ||
475 | #define WM8400_IPVU 0x0100 /* IPVU */ | ||
476 | #define WM8400_IPVU_MASK 0x0100 /* IPVU */ | ||
477 | #define WM8400_IPVU_SHIFT 8 /* IPVU */ | ||
478 | #define WM8400_IPVU_WIDTH 1 /* IPVU */ | ||
479 | #define WM8400_LI12MUTE 0x0080 /* LI12MUTE */ | ||
480 | #define WM8400_LI12MUTE_MASK 0x0080 /* LI12MUTE */ | ||
481 | #define WM8400_LI12MUTE_SHIFT 7 /* LI12MUTE */ | ||
482 | #define WM8400_LI12MUTE_WIDTH 1 /* LI12MUTE */ | ||
483 | #define WM8400_LI12ZC 0x0040 /* LI12ZC */ | ||
484 | #define WM8400_LI12ZC_MASK 0x0040 /* LI12ZC */ | ||
485 | #define WM8400_LI12ZC_SHIFT 6 /* LI12ZC */ | ||
486 | #define WM8400_LI12ZC_WIDTH 1 /* LI12ZC */ | ||
487 | #define WM8400_LIN12VOL_MASK 0x001F /* LIN12VOL - [4:0] */ | ||
488 | #define WM8400_LIN12VOL_SHIFT 0 /* LIN12VOL - [4:0] */ | ||
489 | #define WM8400_LIN12VOL_WIDTH 5 /* LIN12VOL - [4:0] */ | ||
490 | |||
491 | /* | ||
492 | * R25 (0x19) - Left Line Input 3&4 Volume | ||
493 | */ | ||
494 | #define WM8400_IPVU 0x0100 /* IPVU */ | ||
495 | #define WM8400_IPVU_MASK 0x0100 /* IPVU */ | ||
496 | #define WM8400_IPVU_SHIFT 8 /* IPVU */ | ||
497 | #define WM8400_IPVU_WIDTH 1 /* IPVU */ | ||
498 | #define WM8400_LI34MUTE 0x0080 /* LI34MUTE */ | ||
499 | #define WM8400_LI34MUTE_MASK 0x0080 /* LI34MUTE */ | ||
500 | #define WM8400_LI34MUTE_SHIFT 7 /* LI34MUTE */ | ||
501 | #define WM8400_LI34MUTE_WIDTH 1 /* LI34MUTE */ | ||
502 | #define WM8400_LI34ZC 0x0040 /* LI34ZC */ | ||
503 | #define WM8400_LI34ZC_MASK 0x0040 /* LI34ZC */ | ||
504 | #define WM8400_LI34ZC_SHIFT 6 /* LI34ZC */ | ||
505 | #define WM8400_LI34ZC_WIDTH 1 /* LI34ZC */ | ||
506 | #define WM8400_LIN34VOL_MASK 0x001F /* LIN34VOL - [4:0] */ | ||
507 | #define WM8400_LIN34VOL_SHIFT 0 /* LIN34VOL - [4:0] */ | ||
508 | #define WM8400_LIN34VOL_WIDTH 5 /* LIN34VOL - [4:0] */ | ||
509 | |||
510 | /* | ||
511 | * R26 (0x1A) - Right Line Input 1&2 Volume | ||
512 | */ | ||
513 | #define WM8400_IPVU 0x0100 /* IPVU */ | ||
514 | #define WM8400_IPVU_MASK 0x0100 /* IPVU */ | ||
515 | #define WM8400_IPVU_SHIFT 8 /* IPVU */ | ||
516 | #define WM8400_IPVU_WIDTH 1 /* IPVU */ | ||
517 | #define WM8400_RI12MUTE 0x0080 /* RI12MUTE */ | ||
518 | #define WM8400_RI12MUTE_MASK 0x0080 /* RI12MUTE */ | ||
519 | #define WM8400_RI12MUTE_SHIFT 7 /* RI12MUTE */ | ||
520 | #define WM8400_RI12MUTE_WIDTH 1 /* RI12MUTE */ | ||
521 | #define WM8400_RI12ZC 0x0040 /* RI12ZC */ | ||
522 | #define WM8400_RI12ZC_MASK 0x0040 /* RI12ZC */ | ||
523 | #define WM8400_RI12ZC_SHIFT 6 /* RI12ZC */ | ||
524 | #define WM8400_RI12ZC_WIDTH 1 /* RI12ZC */ | ||
525 | #define WM8400_RIN12VOL_MASK 0x001F /* RIN12VOL - [4:0] */ | ||
526 | #define WM8400_RIN12VOL_SHIFT 0 /* RIN12VOL - [4:0] */ | ||
527 | #define WM8400_RIN12VOL_WIDTH 5 /* RIN12VOL - [4:0] */ | ||
528 | |||
529 | /* | ||
530 | * R27 (0x1B) - Right Line Input 3&4 Volume | ||
531 | */ | ||
532 | #define WM8400_IPVU 0x0100 /* IPVU */ | ||
533 | #define WM8400_IPVU_MASK 0x0100 /* IPVU */ | ||
534 | #define WM8400_IPVU_SHIFT 8 /* IPVU */ | ||
535 | #define WM8400_IPVU_WIDTH 1 /* IPVU */ | ||
536 | #define WM8400_RI34MUTE 0x0080 /* RI34MUTE */ | ||
537 | #define WM8400_RI34MUTE_MASK 0x0080 /* RI34MUTE */ | ||
538 | #define WM8400_RI34MUTE_SHIFT 7 /* RI34MUTE */ | ||
539 | #define WM8400_RI34MUTE_WIDTH 1 /* RI34MUTE */ | ||
540 | #define WM8400_RI34ZC 0x0040 /* RI34ZC */ | ||
541 | #define WM8400_RI34ZC_MASK 0x0040 /* RI34ZC */ | ||
542 | #define WM8400_RI34ZC_SHIFT 6 /* RI34ZC */ | ||
543 | #define WM8400_RI34ZC_WIDTH 1 /* RI34ZC */ | ||
544 | #define WM8400_RIN34VOL_MASK 0x001F /* RIN34VOL - [4:0] */ | ||
545 | #define WM8400_RIN34VOL_SHIFT 0 /* RIN34VOL - [4:0] */ | ||
546 | #define WM8400_RIN34VOL_WIDTH 5 /* RIN34VOL - [4:0] */ | ||
547 | |||
548 | /* | ||
549 | * R28 (0x1C) - Left Output Volume | ||
550 | */ | ||
551 | #define WM8400_OPVU 0x0100 /* OPVU */ | ||
552 | #define WM8400_OPVU_MASK 0x0100 /* OPVU */ | ||
553 | #define WM8400_OPVU_SHIFT 8 /* OPVU */ | ||
554 | #define WM8400_OPVU_WIDTH 1 /* OPVU */ | ||
555 | #define WM8400_LOZC 0x0080 /* LOZC */ | ||
556 | #define WM8400_LOZC_MASK 0x0080 /* LOZC */ | ||
557 | #define WM8400_LOZC_SHIFT 7 /* LOZC */ | ||
558 | #define WM8400_LOZC_WIDTH 1 /* LOZC */ | ||
559 | #define WM8400_LOUTVOL_MASK 0x007F /* LOUTVOL - [6:0] */ | ||
560 | #define WM8400_LOUTVOL_SHIFT 0 /* LOUTVOL - [6:0] */ | ||
561 | #define WM8400_LOUTVOL_WIDTH 7 /* LOUTVOL - [6:0] */ | ||
562 | |||
563 | /* | ||
564 | * R29 (0x1D) - Right Output Volume | ||
565 | */ | ||
566 | #define WM8400_OPVU 0x0100 /* OPVU */ | ||
567 | #define WM8400_OPVU_MASK 0x0100 /* OPVU */ | ||
568 | #define WM8400_OPVU_SHIFT 8 /* OPVU */ | ||
569 | #define WM8400_OPVU_WIDTH 1 /* OPVU */ | ||
570 | #define WM8400_ROZC 0x0080 /* ROZC */ | ||
571 | #define WM8400_ROZC_MASK 0x0080 /* ROZC */ | ||
572 | #define WM8400_ROZC_SHIFT 7 /* ROZC */ | ||
573 | #define WM8400_ROZC_WIDTH 1 /* ROZC */ | ||
574 | #define WM8400_ROUTVOL_MASK 0x007F /* ROUTVOL - [6:0] */ | ||
575 | #define WM8400_ROUTVOL_SHIFT 0 /* ROUTVOL - [6:0] */ | ||
576 | #define WM8400_ROUTVOL_WIDTH 7 /* ROUTVOL - [6:0] */ | ||
577 | |||
578 | /* | ||
579 | * R30 (0x1E) - Line Outputs Volume | ||
580 | */ | ||
581 | #define WM8400_LONMUTE 0x0040 /* LONMUTE */ | ||
582 | #define WM8400_LONMUTE_MASK 0x0040 /* LONMUTE */ | ||
583 | #define WM8400_LONMUTE_SHIFT 6 /* LONMUTE */ | ||
584 | #define WM8400_LONMUTE_WIDTH 1 /* LONMUTE */ | ||
585 | #define WM8400_LOPMUTE 0x0020 /* LOPMUTE */ | ||
586 | #define WM8400_LOPMUTE_MASK 0x0020 /* LOPMUTE */ | ||
587 | #define WM8400_LOPMUTE_SHIFT 5 /* LOPMUTE */ | ||
588 | #define WM8400_LOPMUTE_WIDTH 1 /* LOPMUTE */ | ||
589 | #define WM8400_LOATTN 0x0010 /* LOATTN */ | ||
590 | #define WM8400_LOATTN_MASK 0x0010 /* LOATTN */ | ||
591 | #define WM8400_LOATTN_SHIFT 4 /* LOATTN */ | ||
592 | #define WM8400_LOATTN_WIDTH 1 /* LOATTN */ | ||
593 | #define WM8400_RONMUTE 0x0004 /* RONMUTE */ | ||
594 | #define WM8400_RONMUTE_MASK 0x0004 /* RONMUTE */ | ||
595 | #define WM8400_RONMUTE_SHIFT 2 /* RONMUTE */ | ||
596 | #define WM8400_RONMUTE_WIDTH 1 /* RONMUTE */ | ||
597 | #define WM8400_ROPMUTE 0x0002 /* ROPMUTE */ | ||
598 | #define WM8400_ROPMUTE_MASK 0x0002 /* ROPMUTE */ | ||
599 | #define WM8400_ROPMUTE_SHIFT 1 /* ROPMUTE */ | ||
600 | #define WM8400_ROPMUTE_WIDTH 1 /* ROPMUTE */ | ||
601 | #define WM8400_ROATTN 0x0001 /* ROATTN */ | ||
602 | #define WM8400_ROATTN_MASK 0x0001 /* ROATTN */ | ||
603 | #define WM8400_ROATTN_SHIFT 0 /* ROATTN */ | ||
604 | #define WM8400_ROATTN_WIDTH 1 /* ROATTN */ | ||
605 | |||
606 | /* | ||
607 | * R31 (0x1F) - Out3/4 Volume | ||
608 | */ | ||
609 | #define WM8400_OUT3MUTE 0x0020 /* OUT3MUTE */ | ||
610 | #define WM8400_OUT3MUTE_MASK 0x0020 /* OUT3MUTE */ | ||
611 | #define WM8400_OUT3MUTE_SHIFT 5 /* OUT3MUTE */ | ||
612 | #define WM8400_OUT3MUTE_WIDTH 1 /* OUT3MUTE */ | ||
613 | #define WM8400_OUT3ATTN 0x0010 /* OUT3ATTN */ | ||
614 | #define WM8400_OUT3ATTN_MASK 0x0010 /* OUT3ATTN */ | ||
615 | #define WM8400_OUT3ATTN_SHIFT 4 /* OUT3ATTN */ | ||
616 | #define WM8400_OUT3ATTN_WIDTH 1 /* OUT3ATTN */ | ||
617 | #define WM8400_OUT4MUTE 0x0002 /* OUT4MUTE */ | ||
618 | #define WM8400_OUT4MUTE_MASK 0x0002 /* OUT4MUTE */ | ||
619 | #define WM8400_OUT4MUTE_SHIFT 1 /* OUT4MUTE */ | ||
620 | #define WM8400_OUT4MUTE_WIDTH 1 /* OUT4MUTE */ | ||
621 | #define WM8400_OUT4ATTN 0x0001 /* OUT4ATTN */ | ||
622 | #define WM8400_OUT4ATTN_MASK 0x0001 /* OUT4ATTN */ | ||
623 | #define WM8400_OUT4ATTN_SHIFT 0 /* OUT4ATTN */ | ||
624 | #define WM8400_OUT4ATTN_WIDTH 1 /* OUT4ATTN */ | ||
625 | |||
626 | /* | ||
627 | * R32 (0x20) - Left OPGA Volume | ||
628 | */ | ||
629 | #define WM8400_OPVU 0x0100 /* OPVU */ | ||
630 | #define WM8400_OPVU_MASK 0x0100 /* OPVU */ | ||
631 | #define WM8400_OPVU_SHIFT 8 /* OPVU */ | ||
632 | #define WM8400_OPVU_WIDTH 1 /* OPVU */ | ||
633 | #define WM8400_LOPGAZC 0x0080 /* LOPGAZC */ | ||
634 | #define WM8400_LOPGAZC_MASK 0x0080 /* LOPGAZC */ | ||
635 | #define WM8400_LOPGAZC_SHIFT 7 /* LOPGAZC */ | ||
636 | #define WM8400_LOPGAZC_WIDTH 1 /* LOPGAZC */ | ||
637 | #define WM8400_LOPGAVOL_MASK 0x007F /* LOPGAVOL - [6:0] */ | ||
638 | #define WM8400_LOPGAVOL_SHIFT 0 /* LOPGAVOL - [6:0] */ | ||
639 | #define WM8400_LOPGAVOL_WIDTH 7 /* LOPGAVOL - [6:0] */ | ||
640 | |||
641 | /* | ||
642 | * R33 (0x21) - Right OPGA Volume | ||
643 | */ | ||
644 | #define WM8400_OPVU 0x0100 /* OPVU */ | ||
645 | #define WM8400_OPVU_MASK 0x0100 /* OPVU */ | ||
646 | #define WM8400_OPVU_SHIFT 8 /* OPVU */ | ||
647 | #define WM8400_OPVU_WIDTH 1 /* OPVU */ | ||
648 | #define WM8400_ROPGAZC 0x0080 /* ROPGAZC */ | ||
649 | #define WM8400_ROPGAZC_MASK 0x0080 /* ROPGAZC */ | ||
650 | #define WM8400_ROPGAZC_SHIFT 7 /* ROPGAZC */ | ||
651 | #define WM8400_ROPGAZC_WIDTH 1 /* ROPGAZC */ | ||
652 | #define WM8400_ROPGAVOL_MASK 0x007F /* ROPGAVOL - [6:0] */ | ||
653 | #define WM8400_ROPGAVOL_SHIFT 0 /* ROPGAVOL - [6:0] */ | ||
654 | #define WM8400_ROPGAVOL_WIDTH 7 /* ROPGAVOL - [6:0] */ | ||
655 | |||
656 | /* | ||
657 | * R34 (0x22) - Speaker Volume | ||
658 | */ | ||
659 | #define WM8400_SPKATTN_MASK 0x0003 /* SPKATTN - [1:0] */ | ||
660 | #define WM8400_SPKATTN_SHIFT 0 /* SPKATTN - [1:0] */ | ||
661 | #define WM8400_SPKATTN_WIDTH 2 /* SPKATTN - [1:0] */ | ||
662 | |||
663 | /* | ||
664 | * R35 (0x23) - ClassD1 | ||
665 | */ | ||
666 | #define WM8400_CDMODE 0x0100 /* CDMODE */ | ||
667 | #define WM8400_CDMODE_MASK 0x0100 /* CDMODE */ | ||
668 | #define WM8400_CDMODE_SHIFT 8 /* CDMODE */ | ||
669 | #define WM8400_CDMODE_WIDTH 1 /* CDMODE */ | ||
670 | #define WM8400_CLASSD_CLK_SEL 0x0080 /* CLASSD_CLK_SEL */ | ||
671 | #define WM8400_CLASSD_CLK_SEL_MASK 0x0080 /* CLASSD_CLK_SEL */ | ||
672 | #define WM8400_CLASSD_CLK_SEL_SHIFT 7 /* CLASSD_CLK_SEL */ | ||
673 | #define WM8400_CLASSD_CLK_SEL_WIDTH 1 /* CLASSD_CLK_SEL */ | ||
674 | #define WM8400_CD_SRCTRL 0x0040 /* CD_SRCTRL */ | ||
675 | #define WM8400_CD_SRCTRL_MASK 0x0040 /* CD_SRCTRL */ | ||
676 | #define WM8400_CD_SRCTRL_SHIFT 6 /* CD_SRCTRL */ | ||
677 | #define WM8400_CD_SRCTRL_WIDTH 1 /* CD_SRCTRL */ | ||
678 | #define WM8400_SPKNOPOP 0x0020 /* SPKNOPOP */ | ||
679 | #define WM8400_SPKNOPOP_MASK 0x0020 /* SPKNOPOP */ | ||
680 | #define WM8400_SPKNOPOP_SHIFT 5 /* SPKNOPOP */ | ||
681 | #define WM8400_SPKNOPOP_WIDTH 1 /* SPKNOPOP */ | ||
682 | #define WM8400_DBLERATE 0x0010 /* DBLERATE */ | ||
683 | #define WM8400_DBLERATE_MASK 0x0010 /* DBLERATE */ | ||
684 | #define WM8400_DBLERATE_SHIFT 4 /* DBLERATE */ | ||
685 | #define WM8400_DBLERATE_WIDTH 1 /* DBLERATE */ | ||
686 | #define WM8400_LOOPTEST 0x0008 /* LOOPTEST */ | ||
687 | #define WM8400_LOOPTEST_MASK 0x0008 /* LOOPTEST */ | ||
688 | #define WM8400_LOOPTEST_SHIFT 3 /* LOOPTEST */ | ||
689 | #define WM8400_LOOPTEST_WIDTH 1 /* LOOPTEST */ | ||
690 | #define WM8400_HALFABBIAS 0x0004 /* HALFABBIAS */ | ||
691 | #define WM8400_HALFABBIAS_MASK 0x0004 /* HALFABBIAS */ | ||
692 | #define WM8400_HALFABBIAS_SHIFT 2 /* HALFABBIAS */ | ||
693 | #define WM8400_HALFABBIAS_WIDTH 1 /* HALFABBIAS */ | ||
694 | #define WM8400_TRIDEL_MASK 0x0003 /* TRIDEL - [1:0] */ | ||
695 | #define WM8400_TRIDEL_SHIFT 0 /* TRIDEL - [1:0] */ | ||
696 | #define WM8400_TRIDEL_WIDTH 2 /* TRIDEL - [1:0] */ | ||
697 | |||
698 | /* | ||
699 | * R37 (0x25) - ClassD3 | ||
700 | */ | ||
701 | #define WM8400_DCGAIN_MASK 0x0038 /* DCGAIN - [5:3] */ | ||
702 | #define WM8400_DCGAIN_SHIFT 3 /* DCGAIN - [5:3] */ | ||
703 | #define WM8400_DCGAIN_WIDTH 3 /* DCGAIN - [5:3] */ | ||
704 | #define WM8400_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */ | ||
705 | #define WM8400_ACGAIN_SHIFT 0 /* ACGAIN - [2:0] */ | ||
706 | #define WM8400_ACGAIN_WIDTH 3 /* ACGAIN - [2:0] */ | ||
707 | |||
708 | /* | ||
709 | * R39 (0x27) - Input Mixer1 | ||
710 | */ | ||
711 | #define WM8400_AINLMODE_MASK 0x000C /* AINLMODE - [3:2] */ | ||
712 | #define WM8400_AINLMODE_SHIFT 2 /* AINLMODE - [3:2] */ | ||
713 | #define WM8400_AINLMODE_WIDTH 2 /* AINLMODE - [3:2] */ | ||
714 | #define WM8400_AINRMODE_MASK 0x0003 /* AINRMODE - [1:0] */ | ||
715 | #define WM8400_AINRMODE_SHIFT 0 /* AINRMODE - [1:0] */ | ||
716 | #define WM8400_AINRMODE_WIDTH 2 /* AINRMODE - [1:0] */ | ||
717 | |||
718 | /* | ||
719 | * R40 (0x28) - Input Mixer2 | ||
720 | */ | ||
721 | #define WM8400_LMP4 0x0080 /* LMP4 */ | ||
722 | #define WM8400_LMP4_MASK 0x0080 /* LMP4 */ | ||
723 | #define WM8400_LMP4_SHIFT 7 /* LMP4 */ | ||
724 | #define WM8400_LMP4_WIDTH 1 /* LMP4 */ | ||
725 | #define WM8400_LMN3 0x0040 /* LMN3 */ | ||
726 | #define WM8400_LMN3_MASK 0x0040 /* LMN3 */ | ||
727 | #define WM8400_LMN3_SHIFT 6 /* LMN3 */ | ||
728 | #define WM8400_LMN3_WIDTH 1 /* LMN3 */ | ||
729 | #define WM8400_LMP2 0x0020 /* LMP2 */ | ||
730 | #define WM8400_LMP2_MASK 0x0020 /* LMP2 */ | ||
731 | #define WM8400_LMP2_SHIFT 5 /* LMP2 */ | ||
732 | #define WM8400_LMP2_WIDTH 1 /* LMP2 */ | ||
733 | #define WM8400_LMN1 0x0010 /* LMN1 */ | ||
734 | #define WM8400_LMN1_MASK 0x0010 /* LMN1 */ | ||
735 | #define WM8400_LMN1_SHIFT 4 /* LMN1 */ | ||
736 | #define WM8400_LMN1_WIDTH 1 /* LMN1 */ | ||
737 | #define WM8400_RMP4 0x0008 /* RMP4 */ | ||
738 | #define WM8400_RMP4_MASK 0x0008 /* RMP4 */ | ||
739 | #define WM8400_RMP4_SHIFT 3 /* RMP4 */ | ||
740 | #define WM8400_RMP4_WIDTH 1 /* RMP4 */ | ||
741 | #define WM8400_RMN3 0x0004 /* RMN3 */ | ||
742 | #define WM8400_RMN3_MASK 0x0004 /* RMN3 */ | ||
743 | #define WM8400_RMN3_SHIFT 2 /* RMN3 */ | ||
744 | #define WM8400_RMN3_WIDTH 1 /* RMN3 */ | ||
745 | #define WM8400_RMP2 0x0002 /* RMP2 */ | ||
746 | #define WM8400_RMP2_MASK 0x0002 /* RMP2 */ | ||
747 | #define WM8400_RMP2_SHIFT 1 /* RMP2 */ | ||
748 | #define WM8400_RMP2_WIDTH 1 /* RMP2 */ | ||
749 | #define WM8400_RMN1 0x0001 /* RMN1 */ | ||
750 | #define WM8400_RMN1_MASK 0x0001 /* RMN1 */ | ||
751 | #define WM8400_RMN1_SHIFT 0 /* RMN1 */ | ||
752 | #define WM8400_RMN1_WIDTH 1 /* RMN1 */ | ||
753 | |||
754 | /* | ||
755 | * R41 (0x29) - Input Mixer3 | ||
756 | */ | ||
757 | #define WM8400_L34MNB 0x0100 /* L34MNB */ | ||
758 | #define WM8400_L34MNB_MASK 0x0100 /* L34MNB */ | ||
759 | #define WM8400_L34MNB_SHIFT 8 /* L34MNB */ | ||
760 | #define WM8400_L34MNB_WIDTH 1 /* L34MNB */ | ||
761 | #define WM8400_L34MNBST 0x0080 /* L34MNBST */ | ||
762 | #define WM8400_L34MNBST_MASK 0x0080 /* L34MNBST */ | ||
763 | #define WM8400_L34MNBST_SHIFT 7 /* L34MNBST */ | ||
764 | #define WM8400_L34MNBST_WIDTH 1 /* L34MNBST */ | ||
765 | #define WM8400_L12MNB 0x0020 /* L12MNB */ | ||
766 | #define WM8400_L12MNB_MASK 0x0020 /* L12MNB */ | ||
767 | #define WM8400_L12MNB_SHIFT 5 /* L12MNB */ | ||
768 | #define WM8400_L12MNB_WIDTH 1 /* L12MNB */ | ||
769 | #define WM8400_L12MNBST 0x0010 /* L12MNBST */ | ||
770 | #define WM8400_L12MNBST_MASK 0x0010 /* L12MNBST */ | ||
771 | #define WM8400_L12MNBST_SHIFT 4 /* L12MNBST */ | ||
772 | #define WM8400_L12MNBST_WIDTH 1 /* L12MNBST */ | ||
773 | #define WM8400_LDBVOL_MASK 0x0007 /* LDBVOL - [2:0] */ | ||
774 | #define WM8400_LDBVOL_SHIFT 0 /* LDBVOL - [2:0] */ | ||
775 | #define WM8400_LDBVOL_WIDTH 3 /* LDBVOL - [2:0] */ | ||
776 | |||
777 | /* | ||
778 | * R42 (0x2A) - Input Mixer4 | ||
779 | */ | ||
780 | #define WM8400_R34MNB 0x0100 /* R34MNB */ | ||
781 | #define WM8400_R34MNB_MASK 0x0100 /* R34MNB */ | ||
782 | #define WM8400_R34MNB_SHIFT 8 /* R34MNB */ | ||
783 | #define WM8400_R34MNB_WIDTH 1 /* R34MNB */ | ||
784 | #define WM8400_R34MNBST 0x0080 /* R34MNBST */ | ||
785 | #define WM8400_R34MNBST_MASK 0x0080 /* R34MNBST */ | ||
786 | #define WM8400_R34MNBST_SHIFT 7 /* R34MNBST */ | ||
787 | #define WM8400_R34MNBST_WIDTH 1 /* R34MNBST */ | ||
788 | #define WM8400_R12MNB 0x0020 /* R12MNB */ | ||
789 | #define WM8400_R12MNB_MASK 0x0020 /* R12MNB */ | ||
790 | #define WM8400_R12MNB_SHIFT 5 /* R12MNB */ | ||
791 | #define WM8400_R12MNB_WIDTH 1 /* R12MNB */ | ||
792 | #define WM8400_R12MNBST 0x0010 /* R12MNBST */ | ||
793 | #define WM8400_R12MNBST_MASK 0x0010 /* R12MNBST */ | ||
794 | #define WM8400_R12MNBST_SHIFT 4 /* R12MNBST */ | ||
795 | #define WM8400_R12MNBST_WIDTH 1 /* R12MNBST */ | ||
796 | #define WM8400_RDBVOL_MASK 0x0007 /* RDBVOL - [2:0] */ | ||
797 | #define WM8400_RDBVOL_SHIFT 0 /* RDBVOL - [2:0] */ | ||
798 | #define WM8400_RDBVOL_WIDTH 3 /* RDBVOL - [2:0] */ | ||
799 | |||
800 | /* | ||
801 | * R43 (0x2B) - Input Mixer5 | ||
802 | */ | ||
803 | #define WM8400_LI2BVOL_MASK 0x01C0 /* LI2BVOL - [8:6] */ | ||
804 | #define WM8400_LI2BVOL_SHIFT 6 /* LI2BVOL - [8:6] */ | ||
805 | #define WM8400_LI2BVOL_WIDTH 3 /* LI2BVOL - [8:6] */ | ||
806 | #define WM8400_LR4BVOL_MASK 0x0038 /* LR4BVOL - [5:3] */ | ||
807 | #define WM8400_LR4BVOL_SHIFT 3 /* LR4BVOL - [5:3] */ | ||
808 | #define WM8400_LR4BVOL_WIDTH 3 /* LR4BVOL - [5:3] */ | ||
809 | #define WM8400_LL4BVOL_MASK 0x0007 /* LL4BVOL - [2:0] */ | ||
810 | #define WM8400_LL4BVOL_SHIFT 0 /* LL4BVOL - [2:0] */ | ||
811 | #define WM8400_LL4BVOL_WIDTH 3 /* LL4BVOL - [2:0] */ | ||
812 | |||
813 | /* | ||
814 | * R44 (0x2C) - Input Mixer6 | ||
815 | */ | ||
816 | #define WM8400_RI2BVOL_MASK 0x01C0 /* RI2BVOL - [8:6] */ | ||
817 | #define WM8400_RI2BVOL_SHIFT 6 /* RI2BVOL - [8:6] */ | ||
818 | #define WM8400_RI2BVOL_WIDTH 3 /* RI2BVOL - [8:6] */ | ||
819 | #define WM8400_RL4BVOL_MASK 0x0038 /* RL4BVOL - [5:3] */ | ||
820 | #define WM8400_RL4BVOL_SHIFT 3 /* RL4BVOL - [5:3] */ | ||
821 | #define WM8400_RL4BVOL_WIDTH 3 /* RL4BVOL - [5:3] */ | ||
822 | #define WM8400_RR4BVOL_MASK 0x0007 /* RR4BVOL - [2:0] */ | ||
823 | #define WM8400_RR4BVOL_SHIFT 0 /* RR4BVOL - [2:0] */ | ||
824 | #define WM8400_RR4BVOL_WIDTH 3 /* RR4BVOL - [2:0] */ | ||
825 | |||
826 | /* | ||
827 | * R45 (0x2D) - Output Mixer1 | ||
828 | */ | ||
829 | #define WM8400_LRBLO 0x0080 /* LRBLO */ | ||
830 | #define WM8400_LRBLO_MASK 0x0080 /* LRBLO */ | ||
831 | #define WM8400_LRBLO_SHIFT 7 /* LRBLO */ | ||
832 | #define WM8400_LRBLO_WIDTH 1 /* LRBLO */ | ||
833 | #define WM8400_LLBLO 0x0040 /* LLBLO */ | ||
834 | #define WM8400_LLBLO_MASK 0x0040 /* LLBLO */ | ||
835 | #define WM8400_LLBLO_SHIFT 6 /* LLBLO */ | ||
836 | #define WM8400_LLBLO_WIDTH 1 /* LLBLO */ | ||
837 | #define WM8400_LRI3LO 0x0020 /* LRI3LO */ | ||
838 | #define WM8400_LRI3LO_MASK 0x0020 /* LRI3LO */ | ||
839 | #define WM8400_LRI3LO_SHIFT 5 /* LRI3LO */ | ||
840 | #define WM8400_LRI3LO_WIDTH 1 /* LRI3LO */ | ||
841 | #define WM8400_LLI3LO 0x0010 /* LLI3LO */ | ||
842 | #define WM8400_LLI3LO_MASK 0x0010 /* LLI3LO */ | ||
843 | #define WM8400_LLI3LO_SHIFT 4 /* LLI3LO */ | ||
844 | #define WM8400_LLI3LO_WIDTH 1 /* LLI3LO */ | ||
845 | #define WM8400_LR12LO 0x0008 /* LR12LO */ | ||
846 | #define WM8400_LR12LO_MASK 0x0008 /* LR12LO */ | ||
847 | #define WM8400_LR12LO_SHIFT 3 /* LR12LO */ | ||
848 | #define WM8400_LR12LO_WIDTH 1 /* LR12LO */ | ||
849 | #define WM8400_LL12LO 0x0004 /* LL12LO */ | ||
850 | #define WM8400_LL12LO_MASK 0x0004 /* LL12LO */ | ||
851 | #define WM8400_LL12LO_SHIFT 2 /* LL12LO */ | ||
852 | #define WM8400_LL12LO_WIDTH 1 /* LL12LO */ | ||
853 | #define WM8400_LDLO 0x0001 /* LDLO */ | ||
854 | #define WM8400_LDLO_MASK 0x0001 /* LDLO */ | ||
855 | #define WM8400_LDLO_SHIFT 0 /* LDLO */ | ||
856 | #define WM8400_LDLO_WIDTH 1 /* LDLO */ | ||
857 | |||
858 | /* | ||
859 | * R46 (0x2E) - Output Mixer2 | ||
860 | */ | ||
861 | #define WM8400_RLBRO 0x0080 /* RLBRO */ | ||
862 | #define WM8400_RLBRO_MASK 0x0080 /* RLBRO */ | ||
863 | #define WM8400_RLBRO_SHIFT 7 /* RLBRO */ | ||
864 | #define WM8400_RLBRO_WIDTH 1 /* RLBRO */ | ||
865 | #define WM8400_RRBRO 0x0040 /* RRBRO */ | ||
866 | #define WM8400_RRBRO_MASK 0x0040 /* RRBRO */ | ||
867 | #define WM8400_RRBRO_SHIFT 6 /* RRBRO */ | ||
868 | #define WM8400_RRBRO_WIDTH 1 /* RRBRO */ | ||
869 | #define WM8400_RLI3RO 0x0020 /* RLI3RO */ | ||
870 | #define WM8400_RLI3RO_MASK 0x0020 /* RLI3RO */ | ||
871 | #define WM8400_RLI3RO_SHIFT 5 /* RLI3RO */ | ||
872 | #define WM8400_RLI3RO_WIDTH 1 /* RLI3RO */ | ||
873 | #define WM8400_RRI3RO 0x0010 /* RRI3RO */ | ||
874 | #define WM8400_RRI3RO_MASK 0x0010 /* RRI3RO */ | ||
875 | #define WM8400_RRI3RO_SHIFT 4 /* RRI3RO */ | ||
876 | #define WM8400_RRI3RO_WIDTH 1 /* RRI3RO */ | ||
877 | #define WM8400_RL12RO 0x0008 /* RL12RO */ | ||
878 | #define WM8400_RL12RO_MASK 0x0008 /* RL12RO */ | ||
879 | #define WM8400_RL12RO_SHIFT 3 /* RL12RO */ | ||
880 | #define WM8400_RL12RO_WIDTH 1 /* RL12RO */ | ||
881 | #define WM8400_RR12RO 0x0004 /* RR12RO */ | ||
882 | #define WM8400_RR12RO_MASK 0x0004 /* RR12RO */ | ||
883 | #define WM8400_RR12RO_SHIFT 2 /* RR12RO */ | ||
884 | #define WM8400_RR12RO_WIDTH 1 /* RR12RO */ | ||
885 | #define WM8400_RDRO 0x0001 /* RDRO */ | ||
886 | #define WM8400_RDRO_MASK 0x0001 /* RDRO */ | ||
887 | #define WM8400_RDRO_SHIFT 0 /* RDRO */ | ||
888 | #define WM8400_RDRO_WIDTH 1 /* RDRO */ | ||
889 | |||
890 | /* | ||
891 | * R47 (0x2F) - Output Mixer3 | ||
892 | */ | ||
893 | #define WM8400_LLI3LOVOL_MASK 0x01C0 /* LLI3LOVOL - [8:6] */ | ||
894 | #define WM8400_LLI3LOVOL_SHIFT 6 /* LLI3LOVOL - [8:6] */ | ||
895 | #define WM8400_LLI3LOVOL_WIDTH 3 /* LLI3LOVOL - [8:6] */ | ||
896 | #define WM8400_LR12LOVOL_MASK 0x0038 /* LR12LOVOL - [5:3] */ | ||
897 | #define WM8400_LR12LOVOL_SHIFT 3 /* LR12LOVOL - [5:3] */ | ||
898 | #define WM8400_LR12LOVOL_WIDTH 3 /* LR12LOVOL - [5:3] */ | ||
899 | #define WM8400_LL12LOVOL_MASK 0x0007 /* LL12LOVOL - [2:0] */ | ||
900 | #define WM8400_LL12LOVOL_SHIFT 0 /* LL12LOVOL - [2:0] */ | ||
901 | #define WM8400_LL12LOVOL_WIDTH 3 /* LL12LOVOL - [2:0] */ | ||
902 | |||
903 | /* | ||
904 | * R48 (0x30) - Output Mixer4 | ||
905 | */ | ||
906 | #define WM8400_RRI3ROVOL_MASK 0x01C0 /* RRI3ROVOL - [8:6] */ | ||
907 | #define WM8400_RRI3ROVOL_SHIFT 6 /* RRI3ROVOL - [8:6] */ | ||
908 | #define WM8400_RRI3ROVOL_WIDTH 3 /* RRI3ROVOL - [8:6] */ | ||
909 | #define WM8400_RL12ROVOL_MASK 0x0038 /* RL12ROVOL - [5:3] */ | ||
910 | #define WM8400_RL12ROVOL_SHIFT 3 /* RL12ROVOL - [5:3] */ | ||
911 | #define WM8400_RL12ROVOL_WIDTH 3 /* RL12ROVOL - [5:3] */ | ||
912 | #define WM8400_RR12ROVOL_MASK 0x0007 /* RR12ROVOL - [2:0] */ | ||
913 | #define WM8400_RR12ROVOL_SHIFT 0 /* RR12ROVOL - [2:0] */ | ||
914 | #define WM8400_RR12ROVOL_WIDTH 3 /* RR12ROVOL - [2:0] */ | ||
915 | |||
916 | /* | ||
917 | * R49 (0x31) - Output Mixer5 | ||
918 | */ | ||
919 | #define WM8400_LRI3LOVOL_MASK 0x01C0 /* LRI3LOVOL - [8:6] */ | ||
920 | #define WM8400_LRI3LOVOL_SHIFT 6 /* LRI3LOVOL - [8:6] */ | ||
921 | #define WM8400_LRI3LOVOL_WIDTH 3 /* LRI3LOVOL - [8:6] */ | ||
922 | #define WM8400_LRBLOVOL_MASK 0x0038 /* LRBLOVOL - [5:3] */ | ||
923 | #define WM8400_LRBLOVOL_SHIFT 3 /* LRBLOVOL - [5:3] */ | ||
924 | #define WM8400_LRBLOVOL_WIDTH 3 /* LRBLOVOL - [5:3] */ | ||
925 | #define WM8400_LLBLOVOL_MASK 0x0007 /* LLBLOVOL - [2:0] */ | ||
926 | #define WM8400_LLBLOVOL_SHIFT 0 /* LLBLOVOL - [2:0] */ | ||
927 | #define WM8400_LLBLOVOL_WIDTH 3 /* LLBLOVOL - [2:0] */ | ||
928 | |||
929 | /* | ||
930 | * R50 (0x32) - Output Mixer6 | ||
931 | */ | ||
932 | #define WM8400_RLI3ROVOL_MASK 0x01C0 /* RLI3ROVOL - [8:6] */ | ||
933 | #define WM8400_RLI3ROVOL_SHIFT 6 /* RLI3ROVOL - [8:6] */ | ||
934 | #define WM8400_RLI3ROVOL_WIDTH 3 /* RLI3ROVOL - [8:6] */ | ||
935 | #define WM8400_RLBROVOL_MASK 0x0038 /* RLBROVOL - [5:3] */ | ||
936 | #define WM8400_RLBROVOL_SHIFT 3 /* RLBROVOL - [5:3] */ | ||
937 | #define WM8400_RLBROVOL_WIDTH 3 /* RLBROVOL - [5:3] */ | ||
938 | #define WM8400_RRBROVOL_MASK 0x0007 /* RRBROVOL - [2:0] */ | ||
939 | #define WM8400_RRBROVOL_SHIFT 0 /* RRBROVOL - [2:0] */ | ||
940 | #define WM8400_RRBROVOL_WIDTH 3 /* RRBROVOL - [2:0] */ | ||
941 | |||
942 | /* | ||
943 | * R51 (0x33) - Out3/4 Mixer | ||
944 | */ | ||
945 | #define WM8400_VSEL_MASK 0x0180 /* VSEL - [8:7] */ | ||
946 | #define WM8400_VSEL_SHIFT 7 /* VSEL - [8:7] */ | ||
947 | #define WM8400_VSEL_WIDTH 2 /* VSEL - [8:7] */ | ||
948 | #define WM8400_LI4O3 0x0020 /* LI4O3 */ | ||
949 | #define WM8400_LI4O3_MASK 0x0020 /* LI4O3 */ | ||
950 | #define WM8400_LI4O3_SHIFT 5 /* LI4O3 */ | ||
951 | #define WM8400_LI4O3_WIDTH 1 /* LI4O3 */ | ||
952 | #define WM8400_LPGAO3 0x0010 /* LPGAO3 */ | ||
953 | #define WM8400_LPGAO3_MASK 0x0010 /* LPGAO3 */ | ||
954 | #define WM8400_LPGAO3_SHIFT 4 /* LPGAO3 */ | ||
955 | #define WM8400_LPGAO3_WIDTH 1 /* LPGAO3 */ | ||
956 | #define WM8400_RI4O4 0x0002 /* RI4O4 */ | ||
957 | #define WM8400_RI4O4_MASK 0x0002 /* RI4O4 */ | ||
958 | #define WM8400_RI4O4_SHIFT 1 /* RI4O4 */ | ||
959 | #define WM8400_RI4O4_WIDTH 1 /* RI4O4 */ | ||
960 | #define WM8400_RPGAO4 0x0001 /* RPGAO4 */ | ||
961 | #define WM8400_RPGAO4_MASK 0x0001 /* RPGAO4 */ | ||
962 | #define WM8400_RPGAO4_SHIFT 0 /* RPGAO4 */ | ||
963 | #define WM8400_RPGAO4_WIDTH 1 /* RPGAO4 */ | ||
964 | |||
965 | /* | ||
966 | * R52 (0x34) - Line Mixer1 | ||
967 | */ | ||
968 | #define WM8400_LLOPGALON 0x0040 /* LLOPGALON */ | ||
969 | #define WM8400_LLOPGALON_MASK 0x0040 /* LLOPGALON */ | ||
970 | #define WM8400_LLOPGALON_SHIFT 6 /* LLOPGALON */ | ||
971 | #define WM8400_LLOPGALON_WIDTH 1 /* LLOPGALON */ | ||
972 | #define WM8400_LROPGALON 0x0020 /* LROPGALON */ | ||
973 | #define WM8400_LROPGALON_MASK 0x0020 /* LROPGALON */ | ||
974 | #define WM8400_LROPGALON_SHIFT 5 /* LROPGALON */ | ||
975 | #define WM8400_LROPGALON_WIDTH 1 /* LROPGALON */ | ||
976 | #define WM8400_LOPLON 0x0010 /* LOPLON */ | ||
977 | #define WM8400_LOPLON_MASK 0x0010 /* LOPLON */ | ||
978 | #define WM8400_LOPLON_SHIFT 4 /* LOPLON */ | ||
979 | #define WM8400_LOPLON_WIDTH 1 /* LOPLON */ | ||
980 | #define WM8400_LR12LOP 0x0004 /* LR12LOP */ | ||
981 | #define WM8400_LR12LOP_MASK 0x0004 /* LR12LOP */ | ||
982 | #define WM8400_LR12LOP_SHIFT 2 /* LR12LOP */ | ||
983 | #define WM8400_LR12LOP_WIDTH 1 /* LR12LOP */ | ||
984 | #define WM8400_LL12LOP 0x0002 /* LL12LOP */ | ||
985 | #define WM8400_LL12LOP_MASK 0x0002 /* LL12LOP */ | ||
986 | #define WM8400_LL12LOP_SHIFT 1 /* LL12LOP */ | ||
987 | #define WM8400_LL12LOP_WIDTH 1 /* LL12LOP */ | ||
988 | #define WM8400_LLOPGALOP 0x0001 /* LLOPGALOP */ | ||
989 | #define WM8400_LLOPGALOP_MASK 0x0001 /* LLOPGALOP */ | ||
990 | #define WM8400_LLOPGALOP_SHIFT 0 /* LLOPGALOP */ | ||
991 | #define WM8400_LLOPGALOP_WIDTH 1 /* LLOPGALOP */ | ||
992 | |||
993 | /* | ||
994 | * R53 (0x35) - Line Mixer2 | ||
995 | */ | ||
996 | #define WM8400_RROPGARON 0x0040 /* RROPGARON */ | ||
997 | #define WM8400_RROPGARON_MASK 0x0040 /* RROPGARON */ | ||
998 | #define WM8400_RROPGARON_SHIFT 6 /* RROPGARON */ | ||
999 | #define WM8400_RROPGARON_WIDTH 1 /* RROPGARON */ | ||
1000 | #define WM8400_RLOPGARON 0x0020 /* RLOPGARON */ | ||
1001 | #define WM8400_RLOPGARON_MASK 0x0020 /* RLOPGARON */ | ||
1002 | #define WM8400_RLOPGARON_SHIFT 5 /* RLOPGARON */ | ||
1003 | #define WM8400_RLOPGARON_WIDTH 1 /* RLOPGARON */ | ||
1004 | #define WM8400_ROPRON 0x0010 /* ROPRON */ | ||
1005 | #define WM8400_ROPRON_MASK 0x0010 /* ROPRON */ | ||
1006 | #define WM8400_ROPRON_SHIFT 4 /* ROPRON */ | ||
1007 | #define WM8400_ROPRON_WIDTH 1 /* ROPRON */ | ||
1008 | #define WM8400_RL12ROP 0x0004 /* RL12ROP */ | ||
1009 | #define WM8400_RL12ROP_MASK 0x0004 /* RL12ROP */ | ||
1010 | #define WM8400_RL12ROP_SHIFT 2 /* RL12ROP */ | ||
1011 | #define WM8400_RL12ROP_WIDTH 1 /* RL12ROP */ | ||
1012 | #define WM8400_RR12ROP 0x0002 /* RR12ROP */ | ||
1013 | #define WM8400_RR12ROP_MASK 0x0002 /* RR12ROP */ | ||
1014 | #define WM8400_RR12ROP_SHIFT 1 /* RR12ROP */ | ||
1015 | #define WM8400_RR12ROP_WIDTH 1 /* RR12ROP */ | ||
1016 | #define WM8400_RROPGAROP 0x0001 /* RROPGAROP */ | ||
1017 | #define WM8400_RROPGAROP_MASK 0x0001 /* RROPGAROP */ | ||
1018 | #define WM8400_RROPGAROP_SHIFT 0 /* RROPGAROP */ | ||
1019 | #define WM8400_RROPGAROP_WIDTH 1 /* RROPGAROP */ | ||
1020 | |||
1021 | /* | ||
1022 | * R54 (0x36) - Speaker Mixer | ||
1023 | */ | ||
1024 | #define WM8400_LB2SPK 0x0080 /* LB2SPK */ | ||
1025 | #define WM8400_LB2SPK_MASK 0x0080 /* LB2SPK */ | ||
1026 | #define WM8400_LB2SPK_SHIFT 7 /* LB2SPK */ | ||
1027 | #define WM8400_LB2SPK_WIDTH 1 /* LB2SPK */ | ||
1028 | #define WM8400_RB2SPK 0x0040 /* RB2SPK */ | ||
1029 | #define WM8400_RB2SPK_MASK 0x0040 /* RB2SPK */ | ||
1030 | #define WM8400_RB2SPK_SHIFT 6 /* RB2SPK */ | ||
1031 | #define WM8400_RB2SPK_WIDTH 1 /* RB2SPK */ | ||
1032 | #define WM8400_LI2SPK 0x0020 /* LI2SPK */ | ||
1033 | #define WM8400_LI2SPK_MASK 0x0020 /* LI2SPK */ | ||
1034 | #define WM8400_LI2SPK_SHIFT 5 /* LI2SPK */ | ||
1035 | #define WM8400_LI2SPK_WIDTH 1 /* LI2SPK */ | ||
1036 | #define WM8400_RI2SPK 0x0010 /* RI2SPK */ | ||
1037 | #define WM8400_RI2SPK_MASK 0x0010 /* RI2SPK */ | ||
1038 | #define WM8400_RI2SPK_SHIFT 4 /* RI2SPK */ | ||
1039 | #define WM8400_RI2SPK_WIDTH 1 /* RI2SPK */ | ||
1040 | #define WM8400_LOPGASPK 0x0008 /* LOPGASPK */ | ||
1041 | #define WM8400_LOPGASPK_MASK 0x0008 /* LOPGASPK */ | ||
1042 | #define WM8400_LOPGASPK_SHIFT 3 /* LOPGASPK */ | ||
1043 | #define WM8400_LOPGASPK_WIDTH 1 /* LOPGASPK */ | ||
1044 | #define WM8400_ROPGASPK 0x0004 /* ROPGASPK */ | ||
1045 | #define WM8400_ROPGASPK_MASK 0x0004 /* ROPGASPK */ | ||
1046 | #define WM8400_ROPGASPK_SHIFT 2 /* ROPGASPK */ | ||
1047 | #define WM8400_ROPGASPK_WIDTH 1 /* ROPGASPK */ | ||
1048 | #define WM8400_LDSPK 0x0002 /* LDSPK */ | ||
1049 | #define WM8400_LDSPK_MASK 0x0002 /* LDSPK */ | ||
1050 | #define WM8400_LDSPK_SHIFT 1 /* LDSPK */ | ||
1051 | #define WM8400_LDSPK_WIDTH 1 /* LDSPK */ | ||
1052 | #define WM8400_RDSPK 0x0001 /* RDSPK */ | ||
1053 | #define WM8400_RDSPK_MASK 0x0001 /* RDSPK */ | ||
1054 | #define WM8400_RDSPK_SHIFT 0 /* RDSPK */ | ||
1055 | #define WM8400_RDSPK_WIDTH 1 /* RDSPK */ | ||
1056 | |||
1057 | /* | ||
1058 | * R55 (0x37) - Additional Control | ||
1059 | */ | ||
1060 | #define WM8400_VROI 0x0001 /* VROI */ | ||
1061 | #define WM8400_VROI_MASK 0x0001 /* VROI */ | ||
1062 | #define WM8400_VROI_SHIFT 0 /* VROI */ | ||
1063 | #define WM8400_VROI_WIDTH 1 /* VROI */ | ||
1064 | |||
1065 | /* | ||
1066 | * R56 (0x38) - AntiPOP1 | ||
1067 | */ | ||
1068 | #define WM8400_DIS_LLINE 0x0020 /* DIS_LLINE */ | ||
1069 | #define WM8400_DIS_LLINE_MASK 0x0020 /* DIS_LLINE */ | ||
1070 | #define WM8400_DIS_LLINE_SHIFT 5 /* DIS_LLINE */ | ||
1071 | #define WM8400_DIS_LLINE_WIDTH 1 /* DIS_LLINE */ | ||
1072 | #define WM8400_DIS_RLINE 0x0010 /* DIS_RLINE */ | ||
1073 | #define WM8400_DIS_RLINE_MASK 0x0010 /* DIS_RLINE */ | ||
1074 | #define WM8400_DIS_RLINE_SHIFT 4 /* DIS_RLINE */ | ||
1075 | #define WM8400_DIS_RLINE_WIDTH 1 /* DIS_RLINE */ | ||
1076 | #define WM8400_DIS_OUT3 0x0008 /* DIS_OUT3 */ | ||
1077 | #define WM8400_DIS_OUT3_MASK 0x0008 /* DIS_OUT3 */ | ||
1078 | #define WM8400_DIS_OUT3_SHIFT 3 /* DIS_OUT3 */ | ||
1079 | #define WM8400_DIS_OUT3_WIDTH 1 /* DIS_OUT3 */ | ||
1080 | #define WM8400_DIS_OUT4 0x0004 /* DIS_OUT4 */ | ||
1081 | #define WM8400_DIS_OUT4_MASK 0x0004 /* DIS_OUT4 */ | ||
1082 | #define WM8400_DIS_OUT4_SHIFT 2 /* DIS_OUT4 */ | ||
1083 | #define WM8400_DIS_OUT4_WIDTH 1 /* DIS_OUT4 */ | ||
1084 | #define WM8400_DIS_LOUT 0x0002 /* DIS_LOUT */ | ||
1085 | #define WM8400_DIS_LOUT_MASK 0x0002 /* DIS_LOUT */ | ||
1086 | #define WM8400_DIS_LOUT_SHIFT 1 /* DIS_LOUT */ | ||
1087 | #define WM8400_DIS_LOUT_WIDTH 1 /* DIS_LOUT */ | ||
1088 | #define WM8400_DIS_ROUT 0x0001 /* DIS_ROUT */ | ||
1089 | #define WM8400_DIS_ROUT_MASK 0x0001 /* DIS_ROUT */ | ||
1090 | #define WM8400_DIS_ROUT_SHIFT 0 /* DIS_ROUT */ | ||
1091 | #define WM8400_DIS_ROUT_WIDTH 1 /* DIS_ROUT */ | ||
1092 | |||
1093 | /* | ||
1094 | * R57 (0x39) - AntiPOP2 | ||
1095 | */ | ||
1096 | #define WM8400_SOFTST 0x0040 /* SOFTST */ | ||
1097 | #define WM8400_SOFTST_MASK 0x0040 /* SOFTST */ | ||
1098 | #define WM8400_SOFTST_SHIFT 6 /* SOFTST */ | ||
1099 | #define WM8400_SOFTST_WIDTH 1 /* SOFTST */ | ||
1100 | #define WM8400_BUFIOEN 0x0008 /* BUFIOEN */ | ||
1101 | #define WM8400_BUFIOEN_MASK 0x0008 /* BUFIOEN */ | ||
1102 | #define WM8400_BUFIOEN_SHIFT 3 /* BUFIOEN */ | ||
1103 | #define WM8400_BUFIOEN_WIDTH 1 /* BUFIOEN */ | ||
1104 | #define WM8400_BUFDCOPEN 0x0004 /* BUFDCOPEN */ | ||
1105 | #define WM8400_BUFDCOPEN_MASK 0x0004 /* BUFDCOPEN */ | ||
1106 | #define WM8400_BUFDCOPEN_SHIFT 2 /* BUFDCOPEN */ | ||
1107 | #define WM8400_BUFDCOPEN_WIDTH 1 /* BUFDCOPEN */ | ||
1108 | #define WM8400_POBCTRL 0x0002 /* POBCTRL */ | ||
1109 | #define WM8400_POBCTRL_MASK 0x0002 /* POBCTRL */ | ||
1110 | #define WM8400_POBCTRL_SHIFT 1 /* POBCTRL */ | ||
1111 | #define WM8400_POBCTRL_WIDTH 1 /* POBCTRL */ | ||
1112 | #define WM8400_VMIDTOG 0x0001 /* VMIDTOG */ | ||
1113 | #define WM8400_VMIDTOG_MASK 0x0001 /* VMIDTOG */ | ||
1114 | #define WM8400_VMIDTOG_SHIFT 0 /* VMIDTOG */ | ||
1115 | #define WM8400_VMIDTOG_WIDTH 1 /* VMIDTOG */ | ||
1116 | |||
1117 | /* | ||
1118 | * R58 (0x3A) - MICBIAS | ||
1119 | */ | ||
1120 | #define WM8400_MCDSCTH_MASK 0x00C0 /* MCDSCTH - [7:6] */ | ||
1121 | #define WM8400_MCDSCTH_SHIFT 6 /* MCDSCTH - [7:6] */ | ||
1122 | #define WM8400_MCDSCTH_WIDTH 2 /* MCDSCTH - [7:6] */ | ||
1123 | #define WM8400_MCDTHR_MASK 0x0038 /* MCDTHR - [5:3] */ | ||
1124 | #define WM8400_MCDTHR_SHIFT 3 /* MCDTHR - [5:3] */ | ||
1125 | #define WM8400_MCDTHR_WIDTH 3 /* MCDTHR - [5:3] */ | ||
1126 | #define WM8400_MCD 0x0004 /* MCD */ | ||
1127 | #define WM8400_MCD_MASK 0x0004 /* MCD */ | ||
1128 | #define WM8400_MCD_SHIFT 2 /* MCD */ | ||
1129 | #define WM8400_MCD_WIDTH 1 /* MCD */ | ||
1130 | #define WM8400_MBSEL 0x0001 /* MBSEL */ | ||
1131 | #define WM8400_MBSEL_MASK 0x0001 /* MBSEL */ | ||
1132 | #define WM8400_MBSEL_SHIFT 0 /* MBSEL */ | ||
1133 | #define WM8400_MBSEL_WIDTH 1 /* MBSEL */ | ||
1134 | |||
1135 | /* | ||
1136 | * R60 (0x3C) - FLL Control 1 | ||
1137 | */ | ||
1138 | #define WM8400_FLL_REF_FREQ 0x1000 /* FLL_REF_FREQ */ | ||
1139 | #define WM8400_FLL_REF_FREQ_MASK 0x1000 /* FLL_REF_FREQ */ | ||
1140 | #define WM8400_FLL_REF_FREQ_SHIFT 12 /* FLL_REF_FREQ */ | ||
1141 | #define WM8400_FLL_REF_FREQ_WIDTH 1 /* FLL_REF_FREQ */ | ||
1142 | #define WM8400_FLL_CLK_SRC_MASK 0x0C00 /* FLL_CLK_SRC - [11:10] */ | ||
1143 | #define WM8400_FLL_CLK_SRC_SHIFT 10 /* FLL_CLK_SRC - [11:10] */ | ||
1144 | #define WM8400_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [11:10] */ | ||
1145 | #define WM8400_FLL_FRAC 0x0200 /* FLL_FRAC */ | ||
1146 | #define WM8400_FLL_FRAC_MASK 0x0200 /* FLL_FRAC */ | ||
1147 | #define WM8400_FLL_FRAC_SHIFT 9 /* FLL_FRAC */ | ||
1148 | #define WM8400_FLL_FRAC_WIDTH 1 /* FLL_FRAC */ | ||
1149 | #define WM8400_FLL_OSC_ENA 0x0100 /* FLL_OSC_ENA */ | ||
1150 | #define WM8400_FLL_OSC_ENA_MASK 0x0100 /* FLL_OSC_ENA */ | ||
1151 | #define WM8400_FLL_OSC_ENA_SHIFT 8 /* FLL_OSC_ENA */ | ||
1152 | #define WM8400_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */ | ||
1153 | #define WM8400_FLL_CTRL_RATE_MASK 0x00E0 /* FLL_CTRL_RATE - [7:5] */ | ||
1154 | #define WM8400_FLL_CTRL_RATE_SHIFT 5 /* FLL_CTRL_RATE - [7:5] */ | ||
1155 | #define WM8400_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [7:5] */ | ||
1156 | #define WM8400_FLL_FRATIO_MASK 0x001F /* FLL_FRATIO - [4:0] */ | ||
1157 | #define WM8400_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [4:0] */ | ||
1158 | #define WM8400_FLL_FRATIO_WIDTH 5 /* FLL_FRATIO - [4:0] */ | ||
1159 | |||
1160 | /* | ||
1161 | * R61 (0x3D) - FLL Control 2 | ||
1162 | */ | ||
1163 | #define WM8400_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */ | ||
1164 | #define WM8400_FLL_K_SHIFT 0 /* FLL_K - [15:0] */ | ||
1165 | #define WM8400_FLL_K_WIDTH 16 /* FLL_K - [15:0] */ | ||
1166 | |||
1167 | /* | ||
1168 | * R62 (0x3E) - FLL Control 3 | ||
1169 | */ | ||
1170 | #define WM8400_FLL_N_MASK 0x03FF /* FLL_N - [9:0] */ | ||
1171 | #define WM8400_FLL_N_SHIFT 0 /* FLL_N - [9:0] */ | ||
1172 | #define WM8400_FLL_N_WIDTH 10 /* FLL_N - [9:0] */ | ||
1173 | |||
1174 | /* | ||
1175 | * R63 (0x3F) - FLL Control 4 | ||
1176 | */ | ||
1177 | #define WM8400_FLL_TRK_GAIN_MASK 0x0078 /* FLL_TRK_GAIN - [6:3] */ | ||
1178 | #define WM8400_FLL_TRK_GAIN_SHIFT 3 /* FLL_TRK_GAIN - [6:3] */ | ||
1179 | #define WM8400_FLL_TRK_GAIN_WIDTH 4 /* FLL_TRK_GAIN - [6:3] */ | ||
1180 | #define WM8400_FLL_OUTDIV_MASK 0x0007 /* FLL_OUTDIV - [2:0] */ | ||
1181 | #define WM8400_FLL_OUTDIV_SHIFT 0 /* FLL_OUTDIV - [2:0] */ | ||
1182 | #define WM8400_FLL_OUTDIV_WIDTH 3 /* FLL_OUTDIV - [2:0] */ | ||
1183 | |||
1184 | void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400); | ||
1185 | |||
1186 | #endif | ||
diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h new file mode 100644 index 000000000000..2aab4e93a5c9 --- /dev/null +++ b/include/linux/mfd/wm8400-private.h | |||
@@ -0,0 +1,936 @@ | |||
1 | /* | ||
2 | * wm8400 private definitions. | ||
3 | * | ||
4 | * Copyright 2008 Wolfson Microelectronics plc | ||
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_MFD_WM8400_PRIV_H | ||
22 | #define __LINUX_MFD_WM8400_PRIV_H | ||
23 | |||
24 | #include <linux/mfd/wm8400.h> | ||
25 | #include <linux/mutex.h> | ||
26 | #include <linux/platform_device.h> | ||
27 | |||
28 | #define WM8400_REGISTER_COUNT 0x55 | ||
29 | |||
30 | struct wm8400 { | ||
31 | struct device *dev; | ||
32 | |||
33 | int (*read_dev)(void *data, char reg, int count, u16 *dst); | ||
34 | int (*write_dev)(void *data, char reg, int count, const u16 *src); | ||
35 | |||
36 | struct mutex io_lock; | ||
37 | void *io_data; | ||
38 | |||
39 | u16 reg_cache[WM8400_REGISTER_COUNT]; | ||
40 | |||
41 | struct platform_device regulators[6]; | ||
42 | }; | ||
43 | |||
44 | /* | ||
45 | * Register values. | ||
46 | */ | ||
47 | #define WM8400_RESET_ID 0x00 | ||
48 | #define WM8400_ID 0x01 | ||
49 | #define WM8400_POWER_MANAGEMENT_1 0x02 | ||
50 | #define WM8400_POWER_MANAGEMENT_2 0x03 | ||
51 | #define WM8400_POWER_MANAGEMENT_3 0x04 | ||
52 | #define WM8400_AUDIO_INTERFACE_1 0x05 | ||
53 | #define WM8400_AUDIO_INTERFACE_2 0x06 | ||
54 | #define WM8400_CLOCKING_1 0x07 | ||
55 | #define WM8400_CLOCKING_2 0x08 | ||
56 | #define WM8400_AUDIO_INTERFACE_3 0x09 | ||
57 | #define WM8400_AUDIO_INTERFACE_4 0x0A | ||
58 | #define WM8400_DAC_CTRL 0x0B | ||
59 | #define WM8400_LEFT_DAC_DIGITAL_VOLUME 0x0C | ||
60 | #define WM8400_RIGHT_DAC_DIGITAL_VOLUME 0x0D | ||
61 | #define WM8400_DIGITAL_SIDE_TONE 0x0E | ||
62 | #define WM8400_ADC_CTRL 0x0F | ||
63 | #define WM8400_LEFT_ADC_DIGITAL_VOLUME 0x10 | ||
64 | #define WM8400_RIGHT_ADC_DIGITAL_VOLUME 0x11 | ||
65 | #define WM8400_GPIO_CTRL_1 0x12 | ||
66 | #define WM8400_GPIO1_GPIO2 0x13 | ||
67 | #define WM8400_GPIO3_GPIO4 0x14 | ||
68 | #define WM8400_GPIO5_GPIO6 0x15 | ||
69 | #define WM8400_GPIOCTRL_2 0x16 | ||
70 | #define WM8400_GPIO_POL 0x17 | ||
71 | #define WM8400_LEFT_LINE_INPUT_1_2_VOLUME 0x18 | ||
72 | #define WM8400_LEFT_LINE_INPUT_3_4_VOLUME 0x19 | ||
73 | #define WM8400_RIGHT_LINE_INPUT_1_2_VOLUME 0x1A | ||
74 | #define WM8400_RIGHT_LINE_INPUT_3_4_VOLUME 0x1B | ||
75 | #define WM8400_LEFT_OUTPUT_VOLUME 0x1C | ||
76 | #define WM8400_RIGHT_OUTPUT_VOLUME 0x1D | ||
77 | #define WM8400_LINE_OUTPUTS_VOLUME 0x1E | ||
78 | #define WM8400_OUT3_4_VOLUME 0x1F | ||
79 | #define WM8400_LEFT_OPGA_VOLUME 0x20 | ||
80 | #define WM8400_RIGHT_OPGA_VOLUME 0x21 | ||
81 | #define WM8400_SPEAKER_VOLUME 0x22 | ||
82 | #define WM8400_CLASSD1 0x23 | ||
83 | #define WM8400_CLASSD3 0x25 | ||
84 | #define WM8400_INPUT_MIXER1 0x27 | ||
85 | #define WM8400_INPUT_MIXER2 0x28 | ||
86 | #define WM8400_INPUT_MIXER3 0x29 | ||
87 | #define WM8400_INPUT_MIXER4 0x2A | ||
88 | #define WM8400_INPUT_MIXER5 0x2B | ||
89 | #define WM8400_INPUT_MIXER6 0x2C | ||
90 | #define WM8400_OUTPUT_MIXER1 0x2D | ||
91 | #define WM8400_OUTPUT_MIXER2 0x2E | ||
92 | #define WM8400_OUTPUT_MIXER3 0x2F | ||
93 | #define WM8400_OUTPUT_MIXER4 0x30 | ||
94 | #define WM8400_OUTPUT_MIXER5 0x31 | ||
95 | #define WM8400_OUTPUT_MIXER6 0x32 | ||
96 | #define WM8400_OUT3_4_MIXER 0x33 | ||
97 | #define WM8400_LINE_MIXER1 0x34 | ||
98 | #define WM8400_LINE_MIXER2 0x35 | ||
99 | #define WM8400_SPEAKER_MIXER 0x36 | ||
100 | #define WM8400_ADDITIONAL_CONTROL 0x37 | ||
101 | #define WM8400_ANTIPOP1 0x38 | ||
102 | #define WM8400_ANTIPOP2 0x39 | ||
103 | #define WM8400_MICBIAS 0x3A | ||
104 | #define WM8400_FLL_CONTROL_1 0x3C | ||
105 | #define WM8400_FLL_CONTROL_2 0x3D | ||
106 | #define WM8400_FLL_CONTROL_3 0x3E | ||
107 | #define WM8400_FLL_CONTROL_4 0x3F | ||
108 | #define WM8400_LDO1_CONTROL 0x41 | ||
109 | #define WM8400_LDO2_CONTROL 0x42 | ||
110 | #define WM8400_LDO3_CONTROL 0x43 | ||
111 | #define WM8400_LDO4_CONTROL 0x44 | ||
112 | #define WM8400_DCDC1_CONTROL_1 0x46 | ||
113 | #define WM8400_DCDC1_CONTROL_2 0x47 | ||
114 | #define WM8400_DCDC2_CONTROL_1 0x48 | ||
115 | #define WM8400_DCDC2_CONTROL_2 0x49 | ||
116 | #define WM8400_INTERFACE 0x4B | ||
117 | #define WM8400_PM_GENERAL 0x4C | ||
118 | #define WM8400_PM_SHUTDOWN_CONTROL 0x4E | ||
119 | #define WM8400_INTERRUPT_STATUS_1 0x4F | ||
120 | #define WM8400_INTERRUPT_STATUS_1_MASK 0x50 | ||
121 | #define WM8400_INTERRUPT_LEVELS 0x51 | ||
122 | #define WM8400_SHUTDOWN_REASON 0x52 | ||
123 | #define WM8400_LINE_CIRCUITS 0x54 | ||
124 | |||
125 | /* | ||
126 | * Field Definitions. | ||
127 | */ | ||
128 | |||
129 | /* | ||
130 | * R0 (0x00) - Reset/ID | ||
131 | */ | ||
132 | #define WM8400_SW_RESET_CHIP_ID_MASK 0xFFFF /* SW_RESET/CHIP_ID - [15:0] */ | ||
133 | #define WM8400_SW_RESET_CHIP_ID_SHIFT 0 /* SW_RESET/CHIP_ID - [15:0] */ | ||
134 | #define WM8400_SW_RESET_CHIP_ID_WIDTH 16 /* SW_RESET/CHIP_ID - [15:0] */ | ||
135 | |||
136 | /* | ||
137 | * R1 (0x01) - ID | ||
138 | */ | ||
139 | #define WM8400_CHIP_REV_MASK 0x7000 /* CHIP_REV - [14:12] */ | ||
140 | #define WM8400_CHIP_REV_SHIFT 12 /* CHIP_REV - [14:12] */ | ||
141 | #define WM8400_CHIP_REV_WIDTH 3 /* CHIP_REV - [14:12] */ | ||
142 | |||
143 | /* | ||
144 | * R18 (0x12) - GPIO CTRL 1 | ||
145 | */ | ||
146 | #define WM8400_IRQ 0x1000 /* IRQ */ | ||
147 | #define WM8400_IRQ_MASK 0x1000 /* IRQ */ | ||
148 | #define WM8400_IRQ_SHIFT 12 /* IRQ */ | ||
149 | #define WM8400_IRQ_WIDTH 1 /* IRQ */ | ||
150 | #define WM8400_TEMPOK 0x0800 /* TEMPOK */ | ||
151 | #define WM8400_TEMPOK_MASK 0x0800 /* TEMPOK */ | ||
152 | #define WM8400_TEMPOK_SHIFT 11 /* TEMPOK */ | ||
153 | #define WM8400_TEMPOK_WIDTH 1 /* TEMPOK */ | ||
154 | #define WM8400_MIC1SHRT 0x0400 /* MIC1SHRT */ | ||
155 | #define WM8400_MIC1SHRT_MASK 0x0400 /* MIC1SHRT */ | ||
156 | #define WM8400_MIC1SHRT_SHIFT 10 /* MIC1SHRT */ | ||
157 | #define WM8400_MIC1SHRT_WIDTH 1 /* MIC1SHRT */ | ||
158 | #define WM8400_MIC1DET 0x0200 /* MIC1DET */ | ||
159 | #define WM8400_MIC1DET_MASK 0x0200 /* MIC1DET */ | ||
160 | #define WM8400_MIC1DET_SHIFT 9 /* MIC1DET */ | ||
161 | #define WM8400_MIC1DET_WIDTH 1 /* MIC1DET */ | ||
162 | #define WM8400_FLL_LCK 0x0100 /* FLL_LCK */ | ||
163 | #define WM8400_FLL_LCK_MASK 0x0100 /* FLL_LCK */ | ||
164 | #define WM8400_FLL_LCK_SHIFT 8 /* FLL_LCK */ | ||
165 | #define WM8400_FLL_LCK_WIDTH 1 /* FLL_LCK */ | ||
166 | #define WM8400_GPIO_STATUS_MASK 0x00FF /* GPIO_STATUS - [7:0] */ | ||
167 | #define WM8400_GPIO_STATUS_SHIFT 0 /* GPIO_STATUS - [7:0] */ | ||
168 | #define WM8400_GPIO_STATUS_WIDTH 8 /* GPIO_STATUS - [7:0] */ | ||
169 | |||
170 | /* | ||
171 | * R19 (0x13) - GPIO1 & GPIO2 | ||
172 | */ | ||
173 | #define WM8400_GPIO2_DEB_ENA 0x8000 /* GPIO2_DEB_ENA */ | ||
174 | #define WM8400_GPIO2_DEB_ENA_MASK 0x8000 /* GPIO2_DEB_ENA */ | ||
175 | #define WM8400_GPIO2_DEB_ENA_SHIFT 15 /* GPIO2_DEB_ENA */ | ||
176 | #define WM8400_GPIO2_DEB_ENA_WIDTH 1 /* GPIO2_DEB_ENA */ | ||
177 | #define WM8400_GPIO2_IRQ_ENA 0x4000 /* GPIO2_IRQ_ENA */ | ||
178 | #define WM8400_GPIO2_IRQ_ENA_MASK 0x4000 /* GPIO2_IRQ_ENA */ | ||
179 | #define WM8400_GPIO2_IRQ_ENA_SHIFT 14 /* GPIO2_IRQ_ENA */ | ||
180 | #define WM8400_GPIO2_IRQ_ENA_WIDTH 1 /* GPIO2_IRQ_ENA */ | ||
181 | #define WM8400_GPIO2_PU 0x2000 /* GPIO2_PU */ | ||
182 | #define WM8400_GPIO2_PU_MASK 0x2000 /* GPIO2_PU */ | ||
183 | #define WM8400_GPIO2_PU_SHIFT 13 /* GPIO2_PU */ | ||
184 | #define WM8400_GPIO2_PU_WIDTH 1 /* GPIO2_PU */ | ||
185 | #define WM8400_GPIO2_PD 0x1000 /* GPIO2_PD */ | ||
186 | #define WM8400_GPIO2_PD_MASK 0x1000 /* GPIO2_PD */ | ||
187 | #define WM8400_GPIO2_PD_SHIFT 12 /* GPIO2_PD */ | ||
188 | #define WM8400_GPIO2_PD_WIDTH 1 /* GPIO2_PD */ | ||
189 | #define WM8400_GPIO2_SEL_MASK 0x0F00 /* GPIO2_SEL - [11:8] */ | ||
190 | #define WM8400_GPIO2_SEL_SHIFT 8 /* GPIO2_SEL - [11:8] */ | ||
191 | #define WM8400_GPIO2_SEL_WIDTH 4 /* GPIO2_SEL - [11:8] */ | ||
192 | #define WM8400_GPIO1_DEB_ENA 0x0080 /* GPIO1_DEB_ENA */ | ||
193 | #define WM8400_GPIO1_DEB_ENA_MASK 0x0080 /* GPIO1_DEB_ENA */ | ||
194 | #define WM8400_GPIO1_DEB_ENA_SHIFT 7 /* GPIO1_DEB_ENA */ | ||
195 | #define WM8400_GPIO1_DEB_ENA_WIDTH 1 /* GPIO1_DEB_ENA */ | ||
196 | #define WM8400_GPIO1_IRQ_ENA 0x0040 /* GPIO1_IRQ_ENA */ | ||
197 | #define WM8400_GPIO1_IRQ_ENA_MASK 0x0040 /* GPIO1_IRQ_ENA */ | ||
198 | #define WM8400_GPIO1_IRQ_ENA_SHIFT 6 /* GPIO1_IRQ_ENA */ | ||
199 | #define WM8400_GPIO1_IRQ_ENA_WIDTH 1 /* GPIO1_IRQ_ENA */ | ||
200 | #define WM8400_GPIO1_PU 0x0020 /* GPIO1_PU */ | ||
201 | #define WM8400_GPIO1_PU_MASK 0x0020 /* GPIO1_PU */ | ||
202 | #define WM8400_GPIO1_PU_SHIFT 5 /* GPIO1_PU */ | ||
203 | #define WM8400_GPIO1_PU_WIDTH 1 /* GPIO1_PU */ | ||
204 | #define WM8400_GPIO1_PD 0x0010 /* GPIO1_PD */ | ||
205 | #define WM8400_GPIO1_PD_MASK 0x0010 /* GPIO1_PD */ | ||
206 | #define WM8400_GPIO1_PD_SHIFT 4 /* GPIO1_PD */ | ||
207 | #define WM8400_GPIO1_PD_WIDTH 1 /* GPIO1_PD */ | ||
208 | #define WM8400_GPIO1_SEL_MASK 0x000F /* GPIO1_SEL - [3:0] */ | ||
209 | #define WM8400_GPIO1_SEL_SHIFT 0 /* GPIO1_SEL - [3:0] */ | ||
210 | #define WM8400_GPIO1_SEL_WIDTH 4 /* GPIO1_SEL - [3:0] */ | ||
211 | |||
212 | /* | ||
213 | * R20 (0x14) - GPIO3 & GPIO4 | ||
214 | */ | ||
215 | #define WM8400_GPIO4_DEB_ENA 0x8000 /* GPIO4_DEB_ENA */ | ||
216 | #define WM8400_GPIO4_DEB_ENA_MASK 0x8000 /* GPIO4_DEB_ENA */ | ||
217 | #define WM8400_GPIO4_DEB_ENA_SHIFT 15 /* GPIO4_DEB_ENA */ | ||
218 | #define WM8400_GPIO4_DEB_ENA_WIDTH 1 /* GPIO4_DEB_ENA */ | ||
219 | #define WM8400_GPIO4_IRQ_ENA 0x4000 /* GPIO4_IRQ_ENA */ | ||
220 | #define WM8400_GPIO4_IRQ_ENA_MASK 0x4000 /* GPIO4_IRQ_ENA */ | ||
221 | #define WM8400_GPIO4_IRQ_ENA_SHIFT 14 /* GPIO4_IRQ_ENA */ | ||
222 | #define WM8400_GPIO4_IRQ_ENA_WIDTH 1 /* GPIO4_IRQ_ENA */ | ||
223 | #define WM8400_GPIO4_PU 0x2000 /* GPIO4_PU */ | ||
224 | #define WM8400_GPIO4_PU_MASK 0x2000 /* GPIO4_PU */ | ||
225 | #define WM8400_GPIO4_PU_SHIFT 13 /* GPIO4_PU */ | ||
226 | #define WM8400_GPIO4_PU_WIDTH 1 /* GPIO4_PU */ | ||
227 | #define WM8400_GPIO4_PD 0x1000 /* GPIO4_PD */ | ||
228 | #define WM8400_GPIO4_PD_MASK 0x1000 /* GPIO4_PD */ | ||
229 | #define WM8400_GPIO4_PD_SHIFT 12 /* GPIO4_PD */ | ||
230 | #define WM8400_GPIO4_PD_WIDTH 1 /* GPIO4_PD */ | ||
231 | #define WM8400_GPIO4_SEL_MASK 0x0F00 /* GPIO4_SEL - [11:8] */ | ||
232 | #define WM8400_GPIO4_SEL_SHIFT 8 /* GPIO4_SEL - [11:8] */ | ||
233 | #define WM8400_GPIO4_SEL_WIDTH 4 /* GPIO4_SEL - [11:8] */ | ||
234 | #define WM8400_GPIO3_DEB_ENA 0x0080 /* GPIO3_DEB_ENA */ | ||
235 | #define WM8400_GPIO3_DEB_ENA_MASK 0x0080 /* GPIO3_DEB_ENA */ | ||
236 | #define WM8400_GPIO3_DEB_ENA_SHIFT 7 /* GPIO3_DEB_ENA */ | ||
237 | #define WM8400_GPIO3_DEB_ENA_WIDTH 1 /* GPIO3_DEB_ENA */ | ||
238 | #define WM8400_GPIO3_IRQ_ENA 0x0040 /* GPIO3_IRQ_ENA */ | ||
239 | #define WM8400_GPIO3_IRQ_ENA_MASK 0x0040 /* GPIO3_IRQ_ENA */ | ||
240 | #define WM8400_GPIO3_IRQ_ENA_SHIFT 6 /* GPIO3_IRQ_ENA */ | ||
241 | #define WM8400_GPIO3_IRQ_ENA_WIDTH 1 /* GPIO3_IRQ_ENA */ | ||
242 | #define WM8400_GPIO3_PU 0x0020 /* GPIO3_PU */ | ||
243 | #define WM8400_GPIO3_PU_MASK 0x0020 /* GPIO3_PU */ | ||
244 | #define WM8400_GPIO3_PU_SHIFT 5 /* GPIO3_PU */ | ||
245 | #define WM8400_GPIO3_PU_WIDTH 1 /* GPIO3_PU */ | ||
246 | #define WM8400_GPIO3_PD 0x0010 /* GPIO3_PD */ | ||
247 | #define WM8400_GPIO3_PD_MASK 0x0010 /* GPIO3_PD */ | ||
248 | #define WM8400_GPIO3_PD_SHIFT 4 /* GPIO3_PD */ | ||
249 | #define WM8400_GPIO3_PD_WIDTH 1 /* GPIO3_PD */ | ||
250 | #define WM8400_GPIO3_SEL_MASK 0x000F /* GPIO3_SEL - [3:0] */ | ||
251 | #define WM8400_GPIO3_SEL_SHIFT 0 /* GPIO3_SEL - [3:0] */ | ||
252 | #define WM8400_GPIO3_SEL_WIDTH 4 /* GPIO3_SEL - [3:0] */ | ||
253 | |||
254 | /* | ||
255 | * R21 (0x15) - GPIO5 & GPIO6 | ||
256 | */ | ||
257 | #define WM8400_GPIO6_DEB_ENA 0x8000 /* GPIO6_DEB_ENA */ | ||
258 | #define WM8400_GPIO6_DEB_ENA_MASK 0x8000 /* GPIO6_DEB_ENA */ | ||
259 | #define WM8400_GPIO6_DEB_ENA_SHIFT 15 /* GPIO6_DEB_ENA */ | ||
260 | #define WM8400_GPIO6_DEB_ENA_WIDTH 1 /* GPIO6_DEB_ENA */ | ||
261 | #define WM8400_GPIO6_IRQ_ENA 0x4000 /* GPIO6_IRQ_ENA */ | ||
262 | #define WM8400_GPIO6_IRQ_ENA_MASK 0x4000 /* GPIO6_IRQ_ENA */ | ||
263 | #define WM8400_GPIO6_IRQ_ENA_SHIFT 14 /* GPIO6_IRQ_ENA */ | ||
264 | #define WM8400_GPIO6_IRQ_ENA_WIDTH 1 /* GPIO6_IRQ_ENA */ | ||
265 | #define WM8400_GPIO6_PU 0x2000 /* GPIO6_PU */ | ||
266 | #define WM8400_GPIO6_PU_MASK 0x2000 /* GPIO6_PU */ | ||
267 | #define WM8400_GPIO6_PU_SHIFT 13 /* GPIO6_PU */ | ||
268 | #define WM8400_GPIO6_PU_WIDTH 1 /* GPIO6_PU */ | ||
269 | #define WM8400_GPIO6_PD 0x1000 /* GPIO6_PD */ | ||
270 | #define WM8400_GPIO6_PD_MASK 0x1000 /* GPIO6_PD */ | ||
271 | #define WM8400_GPIO6_PD_SHIFT 12 /* GPIO6_PD */ | ||
272 | #define WM8400_GPIO6_PD_WIDTH 1 /* GPIO6_PD */ | ||
273 | #define WM8400_GPIO6_SEL_MASK 0x0F00 /* GPIO6_SEL - [11:8] */ | ||
274 | #define WM8400_GPIO6_SEL_SHIFT 8 /* GPIO6_SEL - [11:8] */ | ||
275 | #define WM8400_GPIO6_SEL_WIDTH 4 /* GPIO6_SEL - [11:8] */ | ||
276 | #define WM8400_GPIO5_DEB_ENA 0x0080 /* GPIO5_DEB_ENA */ | ||
277 | #define WM8400_GPIO5_DEB_ENA_MASK 0x0080 /* GPIO5_DEB_ENA */ | ||
278 | #define WM8400_GPIO5_DEB_ENA_SHIFT 7 /* GPIO5_DEB_ENA */ | ||
279 | #define WM8400_GPIO5_DEB_ENA_WIDTH 1 /* GPIO5_DEB_ENA */ | ||
280 | #define WM8400_GPIO5_IRQ_ENA 0x0040 /* GPIO5_IRQ_ENA */ | ||
281 | #define WM8400_GPIO5_IRQ_ENA_MASK 0x0040 /* GPIO5_IRQ_ENA */ | ||
282 | #define WM8400_GPIO5_IRQ_ENA_SHIFT 6 /* GPIO5_IRQ_ENA */ | ||
283 | #define WM8400_GPIO5_IRQ_ENA_WIDTH 1 /* GPIO5_IRQ_ENA */ | ||
284 | #define WM8400_GPIO5_PU 0x0020 /* GPIO5_PU */ | ||
285 | #define WM8400_GPIO5_PU_MASK 0x0020 /* GPIO5_PU */ | ||
286 | #define WM8400_GPIO5_PU_SHIFT 5 /* GPIO5_PU */ | ||
287 | #define WM8400_GPIO5_PU_WIDTH 1 /* GPIO5_PU */ | ||
288 | #define WM8400_GPIO5_PD 0x0010 /* GPIO5_PD */ | ||
289 | #define WM8400_GPIO5_PD_MASK 0x0010 /* GPIO5_PD */ | ||
290 | #define WM8400_GPIO5_PD_SHIFT 4 /* GPIO5_PD */ | ||
291 | #define WM8400_GPIO5_PD_WIDTH 1 /* GPIO5_PD */ | ||
292 | #define WM8400_GPIO5_SEL_MASK 0x000F /* GPIO5_SEL - [3:0] */ | ||
293 | #define WM8400_GPIO5_SEL_SHIFT 0 /* GPIO5_SEL - [3:0] */ | ||
294 | #define WM8400_GPIO5_SEL_WIDTH 4 /* GPIO5_SEL - [3:0] */ | ||
295 | |||
296 | /* | ||
297 | * R22 (0x16) - GPIOCTRL 2 | ||
298 | */ | ||
299 | #define WM8400_TEMPOK_IRQ_ENA 0x0800 /* TEMPOK_IRQ_ENA */ | ||
300 | #define WM8400_TEMPOK_IRQ_ENA_MASK 0x0800 /* TEMPOK_IRQ_ENA */ | ||
301 | #define WM8400_TEMPOK_IRQ_ENA_SHIFT 11 /* TEMPOK_IRQ_ENA */ | ||
302 | #define WM8400_TEMPOK_IRQ_ENA_WIDTH 1 /* TEMPOK_IRQ_ENA */ | ||
303 | #define WM8400_MIC1SHRT_IRQ_ENA 0x0400 /* MIC1SHRT_IRQ_ENA */ | ||
304 | #define WM8400_MIC1SHRT_IRQ_ENA_MASK 0x0400 /* MIC1SHRT_IRQ_ENA */ | ||
305 | #define WM8400_MIC1SHRT_IRQ_ENA_SHIFT 10 /* MIC1SHRT_IRQ_ENA */ | ||
306 | #define WM8400_MIC1SHRT_IRQ_ENA_WIDTH 1 /* MIC1SHRT_IRQ_ENA */ | ||
307 | #define WM8400_MIC1DET_IRQ_ENA 0x0200 /* MIC1DET_IRQ_ENA */ | ||
308 | #define WM8400_MIC1DET_IRQ_ENA_MASK 0x0200 /* MIC1DET_IRQ_ENA */ | ||
309 | #define WM8400_MIC1DET_IRQ_ENA_SHIFT 9 /* MIC1DET_IRQ_ENA */ | ||
310 | #define WM8400_MIC1DET_IRQ_ENA_WIDTH 1 /* MIC1DET_IRQ_ENA */ | ||
311 | #define WM8400_FLL_LCK_IRQ_ENA 0x0100 /* FLL_LCK_IRQ_ENA */ | ||
312 | #define WM8400_FLL_LCK_IRQ_ENA_MASK 0x0100 /* FLL_LCK_IRQ_ENA */ | ||
313 | #define WM8400_FLL_LCK_IRQ_ENA_SHIFT 8 /* FLL_LCK_IRQ_ENA */ | ||
314 | #define WM8400_FLL_LCK_IRQ_ENA_WIDTH 1 /* FLL_LCK_IRQ_ENA */ | ||
315 | #define WM8400_GPI8_DEB_ENA 0x0080 /* GPI8_DEB_ENA */ | ||
316 | #define WM8400_GPI8_DEB_ENA_MASK 0x0080 /* GPI8_DEB_ENA */ | ||
317 | #define WM8400_GPI8_DEB_ENA_SHIFT 7 /* GPI8_DEB_ENA */ | ||
318 | #define WM8400_GPI8_DEB_ENA_WIDTH 1 /* GPI8_DEB_ENA */ | ||
319 | #define WM8400_GPI8_IRQ_ENA 0x0040 /* GPI8_IRQ_ENA */ | ||
320 | #define WM8400_GPI8_IRQ_ENA_MASK 0x0040 /* GPI8_IRQ_ENA */ | ||
321 | #define WM8400_GPI8_IRQ_ENA_SHIFT 6 /* GPI8_IRQ_ENA */ | ||
322 | #define WM8400_GPI8_IRQ_ENA_WIDTH 1 /* GPI8_IRQ_ENA */ | ||
323 | #define WM8400_GPI8_ENA 0x0010 /* GPI8_ENA */ | ||
324 | #define WM8400_GPI8_ENA_MASK 0x0010 /* GPI8_ENA */ | ||
325 | #define WM8400_GPI8_ENA_SHIFT 4 /* GPI8_ENA */ | ||
326 | #define WM8400_GPI8_ENA_WIDTH 1 /* GPI8_ENA */ | ||
327 | #define WM8400_GPI7_DEB_ENA 0x0008 /* GPI7_DEB_ENA */ | ||
328 | #define WM8400_GPI7_DEB_ENA_MASK 0x0008 /* GPI7_DEB_ENA */ | ||
329 | #define WM8400_GPI7_DEB_ENA_SHIFT 3 /* GPI7_DEB_ENA */ | ||
330 | #define WM8400_GPI7_DEB_ENA_WIDTH 1 /* GPI7_DEB_ENA */ | ||
331 | #define WM8400_GPI7_IRQ_ENA 0x0004 /* GPI7_IRQ_ENA */ | ||
332 | #define WM8400_GPI7_IRQ_ENA_MASK 0x0004 /* GPI7_IRQ_ENA */ | ||
333 | #define WM8400_GPI7_IRQ_ENA_SHIFT 2 /* GPI7_IRQ_ENA */ | ||
334 | #define WM8400_GPI7_IRQ_ENA_WIDTH 1 /* GPI7_IRQ_ENA */ | ||
335 | #define WM8400_GPI7_ENA 0x0001 /* GPI7_ENA */ | ||
336 | #define WM8400_GPI7_ENA_MASK 0x0001 /* GPI7_ENA */ | ||
337 | #define WM8400_GPI7_ENA_SHIFT 0 /* GPI7_ENA */ | ||
338 | #define WM8400_GPI7_ENA_WIDTH 1 /* GPI7_ENA */ | ||
339 | |||
340 | /* | ||
341 | * R23 (0x17) - GPIO_POL | ||
342 | */ | ||
343 | #define WM8400_IRQ_INV 0x1000 /* IRQ_INV */ | ||
344 | #define WM8400_IRQ_INV_MASK 0x1000 /* IRQ_INV */ | ||
345 | #define WM8400_IRQ_INV_SHIFT 12 /* IRQ_INV */ | ||
346 | #define WM8400_IRQ_INV_WIDTH 1 /* IRQ_INV */ | ||
347 | #define WM8400_TEMPOK_POL 0x0800 /* TEMPOK_POL */ | ||
348 | #define WM8400_TEMPOK_POL_MASK 0x0800 /* TEMPOK_POL */ | ||
349 | #define WM8400_TEMPOK_POL_SHIFT 11 /* TEMPOK_POL */ | ||
350 | #define WM8400_TEMPOK_POL_WIDTH 1 /* TEMPOK_POL */ | ||
351 | #define WM8400_MIC1SHRT_POL 0x0400 /* MIC1SHRT_POL */ | ||
352 | #define WM8400_MIC1SHRT_POL_MASK 0x0400 /* MIC1SHRT_POL */ | ||
353 | #define WM8400_MIC1SHRT_POL_SHIFT 10 /* MIC1SHRT_POL */ | ||
354 | #define WM8400_MIC1SHRT_POL_WIDTH 1 /* MIC1SHRT_POL */ | ||
355 | #define WM8400_MIC1DET_POL 0x0200 /* MIC1DET_POL */ | ||
356 | #define WM8400_MIC1DET_POL_MASK 0x0200 /* MIC1DET_POL */ | ||
357 | #define WM8400_MIC1DET_POL_SHIFT 9 /* MIC1DET_POL */ | ||
358 | #define WM8400_MIC1DET_POL_WIDTH 1 /* MIC1DET_POL */ | ||
359 | #define WM8400_FLL_LCK_POL 0x0100 /* FLL_LCK_POL */ | ||
360 | #define WM8400_FLL_LCK_POL_MASK 0x0100 /* FLL_LCK_POL */ | ||
361 | #define WM8400_FLL_LCK_POL_SHIFT 8 /* FLL_LCK_POL */ | ||
362 | #define WM8400_FLL_LCK_POL_WIDTH 1 /* FLL_LCK_POL */ | ||
363 | #define WM8400_GPIO_POL_MASK 0x00FF /* GPIO_POL - [7:0] */ | ||
364 | #define WM8400_GPIO_POL_SHIFT 0 /* GPIO_POL - [7:0] */ | ||
365 | #define WM8400_GPIO_POL_WIDTH 8 /* GPIO_POL - [7:0] */ | ||
366 | |||
367 | /* | ||
368 | * R65 (0x41) - LDO 1 Control | ||
369 | */ | ||
370 | #define WM8400_LDO1_ENA 0x8000 /* LDO1_ENA */ | ||
371 | #define WM8400_LDO1_ENA_MASK 0x8000 /* LDO1_ENA */ | ||
372 | #define WM8400_LDO1_ENA_SHIFT 15 /* LDO1_ENA */ | ||
373 | #define WM8400_LDO1_ENA_WIDTH 1 /* LDO1_ENA */ | ||
374 | #define WM8400_LDO1_SWI 0x4000 /* LDO1_SWI */ | ||
375 | #define WM8400_LDO1_SWI_MASK 0x4000 /* LDO1_SWI */ | ||
376 | #define WM8400_LDO1_SWI_SHIFT 14 /* LDO1_SWI */ | ||
377 | #define WM8400_LDO1_SWI_WIDTH 1 /* LDO1_SWI */ | ||
378 | #define WM8400_LDO1_OPFLT 0x1000 /* LDO1_OPFLT */ | ||
379 | #define WM8400_LDO1_OPFLT_MASK 0x1000 /* LDO1_OPFLT */ | ||
380 | #define WM8400_LDO1_OPFLT_SHIFT 12 /* LDO1_OPFLT */ | ||
381 | #define WM8400_LDO1_OPFLT_WIDTH 1 /* LDO1_OPFLT */ | ||
382 | #define WM8400_LDO1_ERRACT 0x0800 /* LDO1_ERRACT */ | ||
383 | #define WM8400_LDO1_ERRACT_MASK 0x0800 /* LDO1_ERRACT */ | ||
384 | #define WM8400_LDO1_ERRACT_SHIFT 11 /* LDO1_ERRACT */ | ||
385 | #define WM8400_LDO1_ERRACT_WIDTH 1 /* LDO1_ERRACT */ | ||
386 | #define WM8400_LDO1_HIB_MODE 0x0400 /* LDO1_HIB_MODE */ | ||
387 | #define WM8400_LDO1_HIB_MODE_MASK 0x0400 /* LDO1_HIB_MODE */ | ||
388 | #define WM8400_LDO1_HIB_MODE_SHIFT 10 /* LDO1_HIB_MODE */ | ||
389 | #define WM8400_LDO1_HIB_MODE_WIDTH 1 /* LDO1_HIB_MODE */ | ||
390 | #define WM8400_LDO1_VIMG_MASK 0x03E0 /* LDO1_VIMG - [9:5] */ | ||
391 | #define WM8400_LDO1_VIMG_SHIFT 5 /* LDO1_VIMG - [9:5] */ | ||
392 | #define WM8400_LDO1_VIMG_WIDTH 5 /* LDO1_VIMG - [9:5] */ | ||
393 | #define WM8400_LDO1_VSEL_MASK 0x001F /* LDO1_VSEL - [4:0] */ | ||
394 | #define WM8400_LDO1_VSEL_SHIFT 0 /* LDO1_VSEL - [4:0] */ | ||
395 | #define WM8400_LDO1_VSEL_WIDTH 5 /* LDO1_VSEL - [4:0] */ | ||
396 | |||
397 | /* | ||
398 | * R66 (0x42) - LDO 2 Control | ||
399 | */ | ||
400 | #define WM8400_LDO2_ENA 0x8000 /* LDO2_ENA */ | ||
401 | #define WM8400_LDO2_ENA_MASK 0x8000 /* LDO2_ENA */ | ||
402 | #define WM8400_LDO2_ENA_SHIFT 15 /* LDO2_ENA */ | ||
403 | #define WM8400_LDO2_ENA_WIDTH 1 /* LDO2_ENA */ | ||
404 | #define WM8400_LDO2_SWI 0x4000 /* LDO2_SWI */ | ||
405 | #define WM8400_LDO2_SWI_MASK 0x4000 /* LDO2_SWI */ | ||
406 | #define WM8400_LDO2_SWI_SHIFT 14 /* LDO2_SWI */ | ||
407 | #define WM8400_LDO2_SWI_WIDTH 1 /* LDO2_SWI */ | ||
408 | #define WM8400_LDO2_OPFLT 0x1000 /* LDO2_OPFLT */ | ||
409 | #define WM8400_LDO2_OPFLT_MASK 0x1000 /* LDO2_OPFLT */ | ||
410 | #define WM8400_LDO2_OPFLT_SHIFT 12 /* LDO2_OPFLT */ | ||
411 | #define WM8400_LDO2_OPFLT_WIDTH 1 /* LDO2_OPFLT */ | ||
412 | #define WM8400_LDO2_ERRACT 0x0800 /* LDO2_ERRACT */ | ||
413 | #define WM8400_LDO2_ERRACT_MASK 0x0800 /* LDO2_ERRACT */ | ||
414 | #define WM8400_LDO2_ERRACT_SHIFT 11 /* LDO2_ERRACT */ | ||
415 | #define WM8400_LDO2_ERRACT_WIDTH 1 /* LDO2_ERRACT */ | ||
416 | #define WM8400_LDO2_HIB_MODE 0x0400 /* LDO2_HIB_MODE */ | ||
417 | #define WM8400_LDO2_HIB_MODE_MASK 0x0400 /* LDO2_HIB_MODE */ | ||
418 | #define WM8400_LDO2_HIB_MODE_SHIFT 10 /* LDO2_HIB_MODE */ | ||
419 | #define WM8400_LDO2_HIB_MODE_WIDTH 1 /* LDO2_HIB_MODE */ | ||
420 | #define WM8400_LDO2_VIMG_MASK 0x03E0 /* LDO2_VIMG - [9:5] */ | ||
421 | #define WM8400_LDO2_VIMG_SHIFT 5 /* LDO2_VIMG - [9:5] */ | ||
422 | #define WM8400_LDO2_VIMG_WIDTH 5 /* LDO2_VIMG - [9:5] */ | ||
423 | #define WM8400_LDO2_VSEL_MASK 0x001F /* LDO2_VSEL - [4:0] */ | ||
424 | #define WM8400_LDO2_VSEL_SHIFT 0 /* LDO2_VSEL - [4:0] */ | ||
425 | #define WM8400_LDO2_VSEL_WIDTH 5 /* LDO2_VSEL - [4:0] */ | ||
426 | |||
427 | /* | ||
428 | * R67 (0x43) - LDO 3 Control | ||
429 | */ | ||
430 | #define WM8400_LDO3_ENA 0x8000 /* LDO3_ENA */ | ||
431 | #define WM8400_LDO3_ENA_MASK 0x8000 /* LDO3_ENA */ | ||
432 | #define WM8400_LDO3_ENA_SHIFT 15 /* LDO3_ENA */ | ||
433 | #define WM8400_LDO3_ENA_WIDTH 1 /* LDO3_ENA */ | ||
434 | #define WM8400_LDO3_SWI 0x4000 /* LDO3_SWI */ | ||
435 | #define WM8400_LDO3_SWI_MASK 0x4000 /* LDO3_SWI */ | ||
436 | #define WM8400_LDO3_SWI_SHIFT 14 /* LDO3_SWI */ | ||
437 | #define WM8400_LDO3_SWI_WIDTH 1 /* LDO3_SWI */ | ||
438 | #define WM8400_LDO3_OPFLT 0x1000 /* LDO3_OPFLT */ | ||
439 | #define WM8400_LDO3_OPFLT_MASK 0x1000 /* LDO3_OPFLT */ | ||
440 | #define WM8400_LDO3_OPFLT_SHIFT 12 /* LDO3_OPFLT */ | ||
441 | #define WM8400_LDO3_OPFLT_WIDTH 1 /* LDO3_OPFLT */ | ||
442 | #define WM8400_LDO3_ERRACT 0x0800 /* LDO3_ERRACT */ | ||
443 | #define WM8400_LDO3_ERRACT_MASK 0x0800 /* LDO3_ERRACT */ | ||
444 | #define WM8400_LDO3_ERRACT_SHIFT 11 /* LDO3_ERRACT */ | ||
445 | #define WM8400_LDO3_ERRACT_WIDTH 1 /* LDO3_ERRACT */ | ||
446 | #define WM8400_LDO3_HIB_MODE 0x0400 /* LDO3_HIB_MODE */ | ||
447 | #define WM8400_LDO3_HIB_MODE_MASK 0x0400 /* LDO3_HIB_MODE */ | ||
448 | #define WM8400_LDO3_HIB_MODE_SHIFT 10 /* LDO3_HIB_MODE */ | ||
449 | #define WM8400_LDO3_HIB_MODE_WIDTH 1 /* LDO3_HIB_MODE */ | ||
450 | #define WM8400_LDO3_VIMG_MASK 0x03E0 /* LDO3_VIMG - [9:5] */ | ||
451 | #define WM8400_LDO3_VIMG_SHIFT 5 /* LDO3_VIMG - [9:5] */ | ||
452 | #define WM8400_LDO3_VIMG_WIDTH 5 /* LDO3_VIMG - [9:5] */ | ||
453 | #define WM8400_LDO3_VSEL_MASK 0x001F /* LDO3_VSEL - [4:0] */ | ||
454 | #define WM8400_LDO3_VSEL_SHIFT 0 /* LDO3_VSEL - [4:0] */ | ||
455 | #define WM8400_LDO3_VSEL_WIDTH 5 /* LDO3_VSEL - [4:0] */ | ||
456 | |||
457 | /* | ||
458 | * R68 (0x44) - LDO 4 Control | ||
459 | */ | ||
460 | #define WM8400_LDO4_ENA 0x8000 /* LDO4_ENA */ | ||
461 | #define WM8400_LDO4_ENA_MASK 0x8000 /* LDO4_ENA */ | ||
462 | #define WM8400_LDO4_ENA_SHIFT 15 /* LDO4_ENA */ | ||
463 | #define WM8400_LDO4_ENA_WIDTH 1 /* LDO4_ENA */ | ||
464 | #define WM8400_LDO4_SWI 0x4000 /* LDO4_SWI */ | ||
465 | #define WM8400_LDO4_SWI_MASK 0x4000 /* LDO4_SWI */ | ||
466 | #define WM8400_LDO4_SWI_SHIFT 14 /* LDO4_SWI */ | ||
467 | #define WM8400_LDO4_SWI_WIDTH 1 /* LDO4_SWI */ | ||
468 | #define WM8400_LDO4_OPFLT 0x1000 /* LDO4_OPFLT */ | ||
469 | #define WM8400_LDO4_OPFLT_MASK 0x1000 /* LDO4_OPFLT */ | ||
470 | #define WM8400_LDO4_OPFLT_SHIFT 12 /* LDO4_OPFLT */ | ||
471 | #define WM8400_LDO4_OPFLT_WIDTH 1 /* LDO4_OPFLT */ | ||
472 | #define WM8400_LDO4_ERRACT 0x0800 /* LDO4_ERRACT */ | ||
473 | #define WM8400_LDO4_ERRACT_MASK 0x0800 /* LDO4_ERRACT */ | ||
474 | #define WM8400_LDO4_ERRACT_SHIFT 11 /* LDO4_ERRACT */ | ||
475 | #define WM8400_LDO4_ERRACT_WIDTH 1 /* LDO4_ERRACT */ | ||
476 | #define WM8400_LDO4_HIB_MODE 0x0400 /* LDO4_HIB_MODE */ | ||
477 | #define WM8400_LDO4_HIB_MODE_MASK 0x0400 /* LDO4_HIB_MODE */ | ||
478 | #define WM8400_LDO4_HIB_MODE_SHIFT 10 /* LDO4_HIB_MODE */ | ||
479 | #define WM8400_LDO4_HIB_MODE_WIDTH 1 /* LDO4_HIB_MODE */ | ||
480 | #define WM8400_LDO4_VIMG_MASK 0x03E0 /* LDO4_VIMG - [9:5] */ | ||
481 | #define WM8400_LDO4_VIMG_SHIFT 5 /* LDO4_VIMG - [9:5] */ | ||
482 | #define WM8400_LDO4_VIMG_WIDTH 5 /* LDO4_VIMG - [9:5] */ | ||
483 | #define WM8400_LDO4_VSEL_MASK 0x001F /* LDO4_VSEL - [4:0] */ | ||
484 | #define WM8400_LDO4_VSEL_SHIFT 0 /* LDO4_VSEL - [4:0] */ | ||
485 | #define WM8400_LDO4_VSEL_WIDTH 5 /* LDO4_VSEL - [4:0] */ | ||
486 | |||
487 | /* | ||
488 | * R70 (0x46) - DCDC1 Control 1 | ||
489 | */ | ||
490 | #define WM8400_DC1_ENA 0x8000 /* DC1_ENA */ | ||
491 | #define WM8400_DC1_ENA_MASK 0x8000 /* DC1_ENA */ | ||
492 | #define WM8400_DC1_ENA_SHIFT 15 /* DC1_ENA */ | ||
493 | #define WM8400_DC1_ENA_WIDTH 1 /* DC1_ENA */ | ||
494 | #define WM8400_DC1_ACTIVE 0x4000 /* DC1_ACTIVE */ | ||
495 | #define WM8400_DC1_ACTIVE_MASK 0x4000 /* DC1_ACTIVE */ | ||
496 | #define WM8400_DC1_ACTIVE_SHIFT 14 /* DC1_ACTIVE */ | ||
497 | #define WM8400_DC1_ACTIVE_WIDTH 1 /* DC1_ACTIVE */ | ||
498 | #define WM8400_DC1_SLEEP 0x2000 /* DC1_SLEEP */ | ||
499 | #define WM8400_DC1_SLEEP_MASK 0x2000 /* DC1_SLEEP */ | ||
500 | #define WM8400_DC1_SLEEP_SHIFT 13 /* DC1_SLEEP */ | ||
501 | #define WM8400_DC1_SLEEP_WIDTH 1 /* DC1_SLEEP */ | ||
502 | #define WM8400_DC1_OPFLT 0x1000 /* DC1_OPFLT */ | ||
503 | #define WM8400_DC1_OPFLT_MASK 0x1000 /* DC1_OPFLT */ | ||
504 | #define WM8400_DC1_OPFLT_SHIFT 12 /* DC1_OPFLT */ | ||
505 | #define WM8400_DC1_OPFLT_WIDTH 1 /* DC1_OPFLT */ | ||
506 | #define WM8400_DC1_ERRACT 0x0800 /* DC1_ERRACT */ | ||
507 | #define WM8400_DC1_ERRACT_MASK 0x0800 /* DC1_ERRACT */ | ||
508 | #define WM8400_DC1_ERRACT_SHIFT 11 /* DC1_ERRACT */ | ||
509 | #define WM8400_DC1_ERRACT_WIDTH 1 /* DC1_ERRACT */ | ||
510 | #define WM8400_DC1_HIB_MODE 0x0400 /* DC1_HIB_MODE */ | ||
511 | #define WM8400_DC1_HIB_MODE_MASK 0x0400 /* DC1_HIB_MODE */ | ||
512 | #define WM8400_DC1_HIB_MODE_SHIFT 10 /* DC1_HIB_MODE */ | ||
513 | #define WM8400_DC1_HIB_MODE_WIDTH 1 /* DC1_HIB_MODE */ | ||
514 | #define WM8400_DC1_SOFTST_MASK 0x0300 /* DC1_SOFTST - [9:8] */ | ||
515 | #define WM8400_DC1_SOFTST_SHIFT 8 /* DC1_SOFTST - [9:8] */ | ||
516 | #define WM8400_DC1_SOFTST_WIDTH 2 /* DC1_SOFTST - [9:8] */ | ||
517 | #define WM8400_DC1_OV_PROT 0x0080 /* DC1_OV_PROT */ | ||
518 | #define WM8400_DC1_OV_PROT_MASK 0x0080 /* DC1_OV_PROT */ | ||
519 | #define WM8400_DC1_OV_PROT_SHIFT 7 /* DC1_OV_PROT */ | ||
520 | #define WM8400_DC1_OV_PROT_WIDTH 1 /* DC1_OV_PROT */ | ||
521 | #define WM8400_DC1_VSEL_MASK 0x007F /* DC1_VSEL - [6:0] */ | ||
522 | #define WM8400_DC1_VSEL_SHIFT 0 /* DC1_VSEL - [6:0] */ | ||
523 | #define WM8400_DC1_VSEL_WIDTH 7 /* DC1_VSEL - [6:0] */ | ||
524 | |||
525 | /* | ||
526 | * R71 (0x47) - DCDC1 Control 2 | ||
527 | */ | ||
528 | #define WM8400_DC1_FRC_PWM 0x2000 /* DC1_FRC_PWM */ | ||
529 | #define WM8400_DC1_FRC_PWM_MASK 0x2000 /* DC1_FRC_PWM */ | ||
530 | #define WM8400_DC1_FRC_PWM_SHIFT 13 /* DC1_FRC_PWM */ | ||
531 | #define WM8400_DC1_FRC_PWM_WIDTH 1 /* DC1_FRC_PWM */ | ||
532 | #define WM8400_DC1_STBY_LIM_MASK 0x0300 /* DC1_STBY_LIM - [9:8] */ | ||
533 | #define WM8400_DC1_STBY_LIM_SHIFT 8 /* DC1_STBY_LIM - [9:8] */ | ||
534 | #define WM8400_DC1_STBY_LIM_WIDTH 2 /* DC1_STBY_LIM - [9:8] */ | ||
535 | #define WM8400_DC1_ACT_LIM 0x0080 /* DC1_ACT_LIM */ | ||
536 | #define WM8400_DC1_ACT_LIM_MASK 0x0080 /* DC1_ACT_LIM */ | ||
537 | #define WM8400_DC1_ACT_LIM_SHIFT 7 /* DC1_ACT_LIM */ | ||
538 | #define WM8400_DC1_ACT_LIM_WIDTH 1 /* DC1_ACT_LIM */ | ||
539 | #define WM8400_DC1_VIMG_MASK 0x007F /* DC1_VIMG - [6:0] */ | ||
540 | #define WM8400_DC1_VIMG_SHIFT 0 /* DC1_VIMG - [6:0] */ | ||
541 | #define WM8400_DC1_VIMG_WIDTH 7 /* DC1_VIMG - [6:0] */ | ||
542 | |||
543 | /* | ||
544 | * R72 (0x48) - DCDC2 Control 1 | ||
545 | */ | ||
546 | #define WM8400_DC2_ENA 0x8000 /* DC2_ENA */ | ||
547 | #define WM8400_DC2_ENA_MASK 0x8000 /* DC2_ENA */ | ||
548 | #define WM8400_DC2_ENA_SHIFT 15 /* DC2_ENA */ | ||
549 | #define WM8400_DC2_ENA_WIDTH 1 /* DC2_ENA */ | ||
550 | #define WM8400_DC2_ACTIVE 0x4000 /* DC2_ACTIVE */ | ||
551 | #define WM8400_DC2_ACTIVE_MASK 0x4000 /* DC2_ACTIVE */ | ||
552 | #define WM8400_DC2_ACTIVE_SHIFT 14 /* DC2_ACTIVE */ | ||
553 | #define WM8400_DC2_ACTIVE_WIDTH 1 /* DC2_ACTIVE */ | ||
554 | #define WM8400_DC2_SLEEP 0x2000 /* DC2_SLEEP */ | ||
555 | #define WM8400_DC2_SLEEP_MASK 0x2000 /* DC2_SLEEP */ | ||
556 | #define WM8400_DC2_SLEEP_SHIFT 13 /* DC2_SLEEP */ | ||
557 | #define WM8400_DC2_SLEEP_WIDTH 1 /* DC2_SLEEP */ | ||
558 | #define WM8400_DC2_OPFLT 0x1000 /* DC2_OPFLT */ | ||
559 | #define WM8400_DC2_OPFLT_MASK 0x1000 /* DC2_OPFLT */ | ||
560 | #define WM8400_DC2_OPFLT_SHIFT 12 /* DC2_OPFLT */ | ||
561 | #define WM8400_DC2_OPFLT_WIDTH 1 /* DC2_OPFLT */ | ||
562 | #define WM8400_DC2_ERRACT 0x0800 /* DC2_ERRACT */ | ||
563 | #define WM8400_DC2_ERRACT_MASK 0x0800 /* DC2_ERRACT */ | ||
564 | #define WM8400_DC2_ERRACT_SHIFT 11 /* DC2_ERRACT */ | ||
565 | #define WM8400_DC2_ERRACT_WIDTH 1 /* DC2_ERRACT */ | ||
566 | #define WM8400_DC2_HIB_MODE 0x0400 /* DC2_HIB_MODE */ | ||
567 | #define WM8400_DC2_HIB_MODE_MASK 0x0400 /* DC2_HIB_MODE */ | ||
568 | #define WM8400_DC2_HIB_MODE_SHIFT 10 /* DC2_HIB_MODE */ | ||
569 | #define WM8400_DC2_HIB_MODE_WIDTH 1 /* DC2_HIB_MODE */ | ||
570 | #define WM8400_DC2_SOFTST_MASK 0x0300 /* DC2_SOFTST - [9:8] */ | ||
571 | #define WM8400_DC2_SOFTST_SHIFT 8 /* DC2_SOFTST - [9:8] */ | ||
572 | #define WM8400_DC2_SOFTST_WIDTH 2 /* DC2_SOFTST - [9:8] */ | ||
573 | #define WM8400_DC2_OV_PROT 0x0080 /* DC2_OV_PROT */ | ||
574 | #define WM8400_DC2_OV_PROT_MASK 0x0080 /* DC2_OV_PROT */ | ||
575 | #define WM8400_DC2_OV_PROT_SHIFT 7 /* DC2_OV_PROT */ | ||
576 | #define WM8400_DC2_OV_PROT_WIDTH 1 /* DC2_OV_PROT */ | ||
577 | #define WM8400_DC2_VSEL_MASK 0x007F /* DC2_VSEL - [6:0] */ | ||
578 | #define WM8400_DC2_VSEL_SHIFT 0 /* DC2_VSEL - [6:0] */ | ||
579 | #define WM8400_DC2_VSEL_WIDTH 7 /* DC2_VSEL - [6:0] */ | ||
580 | |||
581 | /* | ||
582 | * R73 (0x49) - DCDC2 Control 2 | ||
583 | */ | ||
584 | #define WM8400_DC2_FRC_PWM 0x2000 /* DC2_FRC_PWM */ | ||
585 | #define WM8400_DC2_FRC_PWM_MASK 0x2000 /* DC2_FRC_PWM */ | ||
586 | #define WM8400_DC2_FRC_PWM_SHIFT 13 /* DC2_FRC_PWM */ | ||
587 | #define WM8400_DC2_FRC_PWM_WIDTH 1 /* DC2_FRC_PWM */ | ||
588 | #define WM8400_DC2_STBY_LIM_MASK 0x0300 /* DC2_STBY_LIM - [9:8] */ | ||
589 | #define WM8400_DC2_STBY_LIM_SHIFT 8 /* DC2_STBY_LIM - [9:8] */ | ||
590 | #define WM8400_DC2_STBY_LIM_WIDTH 2 /* DC2_STBY_LIM - [9:8] */ | ||
591 | #define WM8400_DC2_ACT_LIM 0x0080 /* DC2_ACT_LIM */ | ||
592 | #define WM8400_DC2_ACT_LIM_MASK 0x0080 /* DC2_ACT_LIM */ | ||
593 | #define WM8400_DC2_ACT_LIM_SHIFT 7 /* DC2_ACT_LIM */ | ||
594 | #define WM8400_DC2_ACT_LIM_WIDTH 1 /* DC2_ACT_LIM */ | ||
595 | #define WM8400_DC2_VIMG_MASK 0x007F /* DC2_VIMG - [6:0] */ | ||
596 | #define WM8400_DC2_VIMG_SHIFT 0 /* DC2_VIMG - [6:0] */ | ||
597 | #define WM8400_DC2_VIMG_WIDTH 7 /* DC2_VIMG - [6:0] */ | ||
598 | |||
599 | /* | ||
600 | * R75 (0x4B) - Interface | ||
601 | */ | ||
602 | #define WM8400_AUTOINC 0x0008 /* AUTOINC */ | ||
603 | #define WM8400_AUTOINC_MASK 0x0008 /* AUTOINC */ | ||
604 | #define WM8400_AUTOINC_SHIFT 3 /* AUTOINC */ | ||
605 | #define WM8400_AUTOINC_WIDTH 1 /* AUTOINC */ | ||
606 | #define WM8400_ARA_ENA 0x0004 /* ARA_ENA */ | ||
607 | #define WM8400_ARA_ENA_MASK 0x0004 /* ARA_ENA */ | ||
608 | #define WM8400_ARA_ENA_SHIFT 2 /* ARA_ENA */ | ||
609 | #define WM8400_ARA_ENA_WIDTH 1 /* ARA_ENA */ | ||
610 | #define WM8400_SPI_CFG 0x0002 /* SPI_CFG */ | ||
611 | #define WM8400_SPI_CFG_MASK 0x0002 /* SPI_CFG */ | ||
612 | #define WM8400_SPI_CFG_SHIFT 1 /* SPI_CFG */ | ||
613 | #define WM8400_SPI_CFG_WIDTH 1 /* SPI_CFG */ | ||
614 | |||
615 | /* | ||
616 | * R76 (0x4C) - PM GENERAL | ||
617 | */ | ||
618 | #define WM8400_CODEC_SOFTST 0x8000 /* CODEC_SOFTST */ | ||
619 | #define WM8400_CODEC_SOFTST_MASK 0x8000 /* CODEC_SOFTST */ | ||
620 | #define WM8400_CODEC_SOFTST_SHIFT 15 /* CODEC_SOFTST */ | ||
621 | #define WM8400_CODEC_SOFTST_WIDTH 1 /* CODEC_SOFTST */ | ||
622 | #define WM8400_CODEC_SOFTSD 0x4000 /* CODEC_SOFTSD */ | ||
623 | #define WM8400_CODEC_SOFTSD_MASK 0x4000 /* CODEC_SOFTSD */ | ||
624 | #define WM8400_CODEC_SOFTSD_SHIFT 14 /* CODEC_SOFTSD */ | ||
625 | #define WM8400_CODEC_SOFTSD_WIDTH 1 /* CODEC_SOFTSD */ | ||
626 | #define WM8400_CHIP_SOFTSD 0x2000 /* CHIP_SOFTSD */ | ||
627 | #define WM8400_CHIP_SOFTSD_MASK 0x2000 /* CHIP_SOFTSD */ | ||
628 | #define WM8400_CHIP_SOFTSD_SHIFT 13 /* CHIP_SOFTSD */ | ||
629 | #define WM8400_CHIP_SOFTSD_WIDTH 1 /* CHIP_SOFTSD */ | ||
630 | #define WM8400_DSLEEP1_POL 0x0008 /* DSLEEP1_POL */ | ||
631 | #define WM8400_DSLEEP1_POL_MASK 0x0008 /* DSLEEP1_POL */ | ||
632 | #define WM8400_DSLEEP1_POL_SHIFT 3 /* DSLEEP1_POL */ | ||
633 | #define WM8400_DSLEEP1_POL_WIDTH 1 /* DSLEEP1_POL */ | ||
634 | #define WM8400_DSLEEP2_POL 0x0004 /* DSLEEP2_POL */ | ||
635 | #define WM8400_DSLEEP2_POL_MASK 0x0004 /* DSLEEP2_POL */ | ||
636 | #define WM8400_DSLEEP2_POL_SHIFT 2 /* DSLEEP2_POL */ | ||
637 | #define WM8400_DSLEEP2_POL_WIDTH 1 /* DSLEEP2_POL */ | ||
638 | #define WM8400_PWR_STATE_MASK 0x0003 /* PWR_STATE - [1:0] */ | ||
639 | #define WM8400_PWR_STATE_SHIFT 0 /* PWR_STATE - [1:0] */ | ||
640 | #define WM8400_PWR_STATE_WIDTH 2 /* PWR_STATE - [1:0] */ | ||
641 | |||
642 | /* | ||
643 | * R78 (0x4E) - PM Shutdown Control | ||
644 | */ | ||
645 | #define WM8400_CHIP_GT150_ERRACT 0x0200 /* CHIP_GT150_ERRACT */ | ||
646 | #define WM8400_CHIP_GT150_ERRACT_MASK 0x0200 /* CHIP_GT150_ERRACT */ | ||
647 | #define WM8400_CHIP_GT150_ERRACT_SHIFT 9 /* CHIP_GT150_ERRACT */ | ||
648 | #define WM8400_CHIP_GT150_ERRACT_WIDTH 1 /* CHIP_GT150_ERRACT */ | ||
649 | #define WM8400_CHIP_GT115_ERRACT 0x0100 /* CHIP_GT115_ERRACT */ | ||
650 | #define WM8400_CHIP_GT115_ERRACT_MASK 0x0100 /* CHIP_GT115_ERRACT */ | ||
651 | #define WM8400_CHIP_GT115_ERRACT_SHIFT 8 /* CHIP_GT115_ERRACT */ | ||
652 | #define WM8400_CHIP_GT115_ERRACT_WIDTH 1 /* CHIP_GT115_ERRACT */ | ||
653 | #define WM8400_LINE_CMP_ERRACT 0x0080 /* LINE_CMP_ERRACT */ | ||
654 | #define WM8400_LINE_CMP_ERRACT_MASK 0x0080 /* LINE_CMP_ERRACT */ | ||
655 | #define WM8400_LINE_CMP_ERRACT_SHIFT 7 /* LINE_CMP_ERRACT */ | ||
656 | #define WM8400_LINE_CMP_ERRACT_WIDTH 1 /* LINE_CMP_ERRACT */ | ||
657 | #define WM8400_UVLO_ERRACT 0x0040 /* UVLO_ERRACT */ | ||
658 | #define WM8400_UVLO_ERRACT_MASK 0x0040 /* UVLO_ERRACT */ | ||
659 | #define WM8400_UVLO_ERRACT_SHIFT 6 /* UVLO_ERRACT */ | ||
660 | #define WM8400_UVLO_ERRACT_WIDTH 1 /* UVLO_ERRACT */ | ||
661 | |||
662 | /* | ||
663 | * R79 (0x4F) - Interrupt Status 1 | ||
664 | */ | ||
665 | #define WM8400_MICD_CINT 0x8000 /* MICD_CINT */ | ||
666 | #define WM8400_MICD_CINT_MASK 0x8000 /* MICD_CINT */ | ||
667 | #define WM8400_MICD_CINT_SHIFT 15 /* MICD_CINT */ | ||
668 | #define WM8400_MICD_CINT_WIDTH 1 /* MICD_CINT */ | ||
669 | #define WM8400_MICSCD_CINT 0x4000 /* MICSCD_CINT */ | ||
670 | #define WM8400_MICSCD_CINT_MASK 0x4000 /* MICSCD_CINT */ | ||
671 | #define WM8400_MICSCD_CINT_SHIFT 14 /* MICSCD_CINT */ | ||
672 | #define WM8400_MICSCD_CINT_WIDTH 1 /* MICSCD_CINT */ | ||
673 | #define WM8400_JDL_CINT 0x2000 /* JDL_CINT */ | ||
674 | #define WM8400_JDL_CINT_MASK 0x2000 /* JDL_CINT */ | ||
675 | #define WM8400_JDL_CINT_SHIFT 13 /* JDL_CINT */ | ||
676 | #define WM8400_JDL_CINT_WIDTH 1 /* JDL_CINT */ | ||
677 | #define WM8400_JDR_CINT 0x1000 /* JDR_CINT */ | ||
678 | #define WM8400_JDR_CINT_MASK 0x1000 /* JDR_CINT */ | ||
679 | #define WM8400_JDR_CINT_SHIFT 12 /* JDR_CINT */ | ||
680 | #define WM8400_JDR_CINT_WIDTH 1 /* JDR_CINT */ | ||
681 | #define WM8400_CODEC_SEQ_END_EINT 0x0800 /* CODEC_SEQ_END_EINT */ | ||
682 | #define WM8400_CODEC_SEQ_END_EINT_MASK 0x0800 /* CODEC_SEQ_END_EINT */ | ||
683 | #define WM8400_CODEC_SEQ_END_EINT_SHIFT 11 /* CODEC_SEQ_END_EINT */ | ||
684 | #define WM8400_CODEC_SEQ_END_EINT_WIDTH 1 /* CODEC_SEQ_END_EINT */ | ||
685 | #define WM8400_CDEL_TO_EINT 0x0400 /* CDEL_TO_EINT */ | ||
686 | #define WM8400_CDEL_TO_EINT_MASK 0x0400 /* CDEL_TO_EINT */ | ||
687 | #define WM8400_CDEL_TO_EINT_SHIFT 10 /* CDEL_TO_EINT */ | ||
688 | #define WM8400_CDEL_TO_EINT_WIDTH 1 /* CDEL_TO_EINT */ | ||
689 | #define WM8400_CHIP_GT150_EINT 0x0200 /* CHIP_GT150_EINT */ | ||
690 | #define WM8400_CHIP_GT150_EINT_MASK 0x0200 /* CHIP_GT150_EINT */ | ||
691 | #define WM8400_CHIP_GT150_EINT_SHIFT 9 /* CHIP_GT150_EINT */ | ||
692 | #define WM8400_CHIP_GT150_EINT_WIDTH 1 /* CHIP_GT150_EINT */ | ||
693 | #define WM8400_CHIP_GT115_EINT 0x0100 /* CHIP_GT115_EINT */ | ||
694 | #define WM8400_CHIP_GT115_EINT_MASK 0x0100 /* CHIP_GT115_EINT */ | ||
695 | #define WM8400_CHIP_GT115_EINT_SHIFT 8 /* CHIP_GT115_EINT */ | ||
696 | #define WM8400_CHIP_GT115_EINT_WIDTH 1 /* CHIP_GT115_EINT */ | ||
697 | #define WM8400_LINE_CMP_EINT 0x0080 /* LINE_CMP_EINT */ | ||
698 | #define WM8400_LINE_CMP_EINT_MASK 0x0080 /* LINE_CMP_EINT */ | ||
699 | #define WM8400_LINE_CMP_EINT_SHIFT 7 /* LINE_CMP_EINT */ | ||
700 | #define WM8400_LINE_CMP_EINT_WIDTH 1 /* LINE_CMP_EINT */ | ||
701 | #define WM8400_UVLO_EINT 0x0040 /* UVLO_EINT */ | ||
702 | #define WM8400_UVLO_EINT_MASK 0x0040 /* UVLO_EINT */ | ||
703 | #define WM8400_UVLO_EINT_SHIFT 6 /* UVLO_EINT */ | ||
704 | #define WM8400_UVLO_EINT_WIDTH 1 /* UVLO_EINT */ | ||
705 | #define WM8400_DC2_UV_EINT 0x0020 /* DC2_UV_EINT */ | ||
706 | #define WM8400_DC2_UV_EINT_MASK 0x0020 /* DC2_UV_EINT */ | ||
707 | #define WM8400_DC2_UV_EINT_SHIFT 5 /* DC2_UV_EINT */ | ||
708 | #define WM8400_DC2_UV_EINT_WIDTH 1 /* DC2_UV_EINT */ | ||
709 | #define WM8400_DC1_UV_EINT 0x0010 /* DC1_UV_EINT */ | ||
710 | #define WM8400_DC1_UV_EINT_MASK 0x0010 /* DC1_UV_EINT */ | ||
711 | #define WM8400_DC1_UV_EINT_SHIFT 4 /* DC1_UV_EINT */ | ||
712 | #define WM8400_DC1_UV_EINT_WIDTH 1 /* DC1_UV_EINT */ | ||
713 | #define WM8400_LDO4_UV_EINT 0x0008 /* LDO4_UV_EINT */ | ||
714 | #define WM8400_LDO4_UV_EINT_MASK 0x0008 /* LDO4_UV_EINT */ | ||
715 | #define WM8400_LDO4_UV_EINT_SHIFT 3 /* LDO4_UV_EINT */ | ||
716 | #define WM8400_LDO4_UV_EINT_WIDTH 1 /* LDO4_UV_EINT */ | ||
717 | #define WM8400_LDO3_UV_EINT 0x0004 /* LDO3_UV_EINT */ | ||
718 | #define WM8400_LDO3_UV_EINT_MASK 0x0004 /* LDO3_UV_EINT */ | ||
719 | #define WM8400_LDO3_UV_EINT_SHIFT 2 /* LDO3_UV_EINT */ | ||
720 | #define WM8400_LDO3_UV_EINT_WIDTH 1 /* LDO3_UV_EINT */ | ||
721 | #define WM8400_LDO2_UV_EINT 0x0002 /* LDO2_UV_EINT */ | ||
722 | #define WM8400_LDO2_UV_EINT_MASK 0x0002 /* LDO2_UV_EINT */ | ||
723 | #define WM8400_LDO2_UV_EINT_SHIFT 1 /* LDO2_UV_EINT */ | ||
724 | #define WM8400_LDO2_UV_EINT_WIDTH 1 /* LDO2_UV_EINT */ | ||
725 | #define WM8400_LDO1_UV_EINT 0x0001 /* LDO1_UV_EINT */ | ||
726 | #define WM8400_LDO1_UV_EINT_MASK 0x0001 /* LDO1_UV_EINT */ | ||
727 | #define WM8400_LDO1_UV_EINT_SHIFT 0 /* LDO1_UV_EINT */ | ||
728 | #define WM8400_LDO1_UV_EINT_WIDTH 1 /* LDO1_UV_EINT */ | ||
729 | |||
730 | /* | ||
731 | * R80 (0x50) - Interrupt Status 1 Mask | ||
732 | */ | ||
733 | #define WM8400_IM_MICD_CINT 0x8000 /* IM_MICD_CINT */ | ||
734 | #define WM8400_IM_MICD_CINT_MASK 0x8000 /* IM_MICD_CINT */ | ||
735 | #define WM8400_IM_MICD_CINT_SHIFT 15 /* IM_MICD_CINT */ | ||
736 | #define WM8400_IM_MICD_CINT_WIDTH 1 /* IM_MICD_CINT */ | ||
737 | #define WM8400_IM_MICSCD_CINT 0x4000 /* IM_MICSCD_CINT */ | ||
738 | #define WM8400_IM_MICSCD_CINT_MASK 0x4000 /* IM_MICSCD_CINT */ | ||
739 | #define WM8400_IM_MICSCD_CINT_SHIFT 14 /* IM_MICSCD_CINT */ | ||
740 | #define WM8400_IM_MICSCD_CINT_WIDTH 1 /* IM_MICSCD_CINT */ | ||
741 | #define WM8400_IM_JDL_CINT 0x2000 /* IM_JDL_CINT */ | ||
742 | #define WM8400_IM_JDL_CINT_MASK 0x2000 /* IM_JDL_CINT */ | ||
743 | #define WM8400_IM_JDL_CINT_SHIFT 13 /* IM_JDL_CINT */ | ||
744 | #define WM8400_IM_JDL_CINT_WIDTH 1 /* IM_JDL_CINT */ | ||
745 | #define WM8400_IM_JDR_CINT 0x1000 /* IM_JDR_CINT */ | ||
746 | #define WM8400_IM_JDR_CINT_MASK 0x1000 /* IM_JDR_CINT */ | ||
747 | #define WM8400_IM_JDR_CINT_SHIFT 12 /* IM_JDR_CINT */ | ||
748 | #define WM8400_IM_JDR_CINT_WIDTH 1 /* IM_JDR_CINT */ | ||
749 | #define WM8400_IM_CODEC_SEQ_END_EINT 0x0800 /* IM_CODEC_SEQ_END_EINT */ | ||
750 | #define WM8400_IM_CODEC_SEQ_END_EINT_MASK 0x0800 /* IM_CODEC_SEQ_END_EINT */ | ||
751 | #define WM8400_IM_CODEC_SEQ_END_EINT_SHIFT 11 /* IM_CODEC_SEQ_END_EINT */ | ||
752 | #define WM8400_IM_CODEC_SEQ_END_EINT_WIDTH 1 /* IM_CODEC_SEQ_END_EINT */ | ||
753 | #define WM8400_IM_CDEL_TO_EINT 0x0400 /* IM_CDEL_TO_EINT */ | ||
754 | #define WM8400_IM_CDEL_TO_EINT_MASK 0x0400 /* IM_CDEL_TO_EINT */ | ||
755 | #define WM8400_IM_CDEL_TO_EINT_SHIFT 10 /* IM_CDEL_TO_EINT */ | ||
756 | #define WM8400_IM_CDEL_TO_EINT_WIDTH 1 /* IM_CDEL_TO_EINT */ | ||
757 | #define WM8400_IM_CHIP_GT150_EINT 0x0200 /* IM_CHIP_GT150_EINT */ | ||
758 | #define WM8400_IM_CHIP_GT150_EINT_MASK 0x0200 /* IM_CHIP_GT150_EINT */ | ||
759 | #define WM8400_IM_CHIP_GT150_EINT_SHIFT 9 /* IM_CHIP_GT150_EINT */ | ||
760 | #define WM8400_IM_CHIP_GT150_EINT_WIDTH 1 /* IM_CHIP_GT150_EINT */ | ||
761 | #define WM8400_IM_CHIP_GT115_EINT 0x0100 /* IM_CHIP_GT115_EINT */ | ||
762 | #define WM8400_IM_CHIP_GT115_EINT_MASK 0x0100 /* IM_CHIP_GT115_EINT */ | ||
763 | #define WM8400_IM_CHIP_GT115_EINT_SHIFT 8 /* IM_CHIP_GT115_EINT */ | ||
764 | #define WM8400_IM_CHIP_GT115_EINT_WIDTH 1 /* IM_CHIP_GT115_EINT */ | ||
765 | #define WM8400_IM_LINE_CMP_EINT 0x0080 /* IM_LINE_CMP_EINT */ | ||
766 | #define WM8400_IM_LINE_CMP_EINT_MASK 0x0080 /* IM_LINE_CMP_EINT */ | ||
767 | #define WM8400_IM_LINE_CMP_EINT_SHIFT 7 /* IM_LINE_CMP_EINT */ | ||
768 | #define WM8400_IM_LINE_CMP_EINT_WIDTH 1 /* IM_LINE_CMP_EINT */ | ||
769 | #define WM8400_IM_UVLO_EINT 0x0040 /* IM_UVLO_EINT */ | ||
770 | #define WM8400_IM_UVLO_EINT_MASK 0x0040 /* IM_UVLO_EINT */ | ||
771 | #define WM8400_IM_UVLO_EINT_SHIFT 6 /* IM_UVLO_EINT */ | ||
772 | #define WM8400_IM_UVLO_EINT_WIDTH 1 /* IM_UVLO_EINT */ | ||
773 | #define WM8400_IM_DC2_UV_EINT 0x0020 /* IM_DC2_UV_EINT */ | ||
774 | #define WM8400_IM_DC2_UV_EINT_MASK 0x0020 /* IM_DC2_UV_EINT */ | ||
775 | #define WM8400_IM_DC2_UV_EINT_SHIFT 5 /* IM_DC2_UV_EINT */ | ||
776 | #define WM8400_IM_DC2_UV_EINT_WIDTH 1 /* IM_DC2_UV_EINT */ | ||
777 | #define WM8400_IM_DC1_UV_EINT 0x0010 /* IM_DC1_UV_EINT */ | ||
778 | #define WM8400_IM_DC1_UV_EINT_MASK 0x0010 /* IM_DC1_UV_EINT */ | ||
779 | #define WM8400_IM_DC1_UV_EINT_SHIFT 4 /* IM_DC1_UV_EINT */ | ||
780 | #define WM8400_IM_DC1_UV_EINT_WIDTH 1 /* IM_DC1_UV_EINT */ | ||
781 | #define WM8400_IM_LDO4_UV_EINT 0x0008 /* IM_LDO4_UV_EINT */ | ||
782 | #define WM8400_IM_LDO4_UV_EINT_MASK 0x0008 /* IM_LDO4_UV_EINT */ | ||
783 | #define WM8400_IM_LDO4_UV_EINT_SHIFT 3 /* IM_LDO4_UV_EINT */ | ||
784 | #define WM8400_IM_LDO4_UV_EINT_WIDTH 1 /* IM_LDO4_UV_EINT */ | ||
785 | #define WM8400_IM_LDO3_UV_EINT 0x0004 /* IM_LDO3_UV_EINT */ | ||
786 | #define WM8400_IM_LDO3_UV_EINT_MASK 0x0004 /* IM_LDO3_UV_EINT */ | ||
787 | #define WM8400_IM_LDO3_UV_EINT_SHIFT 2 /* IM_LDO3_UV_EINT */ | ||
788 | #define WM8400_IM_LDO3_UV_EINT_WIDTH 1 /* IM_LDO3_UV_EINT */ | ||
789 | #define WM8400_IM_LDO2_UV_EINT 0x0002 /* IM_LDO2_UV_EINT */ | ||
790 | #define WM8400_IM_LDO2_UV_EINT_MASK 0x0002 /* IM_LDO2_UV_EINT */ | ||
791 | #define WM8400_IM_LDO2_UV_EINT_SHIFT 1 /* IM_LDO2_UV_EINT */ | ||
792 | #define WM8400_IM_LDO2_UV_EINT_WIDTH 1 /* IM_LDO2_UV_EINT */ | ||
793 | #define WM8400_IM_LDO1_UV_EINT 0x0001 /* IM_LDO1_UV_EINT */ | ||
794 | #define WM8400_IM_LDO1_UV_EINT_MASK 0x0001 /* IM_LDO1_UV_EINT */ | ||
795 | #define WM8400_IM_LDO1_UV_EINT_SHIFT 0 /* IM_LDO1_UV_EINT */ | ||
796 | #define WM8400_IM_LDO1_UV_EINT_WIDTH 1 /* IM_LDO1_UV_EINT */ | ||
797 | |||
798 | /* | ||
799 | * R81 (0x51) - Interrupt Levels | ||
800 | */ | ||
801 | #define WM8400_MICD_LVL 0x8000 /* MICD_LVL */ | ||
802 | #define WM8400_MICD_LVL_MASK 0x8000 /* MICD_LVL */ | ||
803 | #define WM8400_MICD_LVL_SHIFT 15 /* MICD_LVL */ | ||
804 | #define WM8400_MICD_LVL_WIDTH 1 /* MICD_LVL */ | ||
805 | #define WM8400_MICSCD_LVL 0x4000 /* MICSCD_LVL */ | ||
806 | #define WM8400_MICSCD_LVL_MASK 0x4000 /* MICSCD_LVL */ | ||
807 | #define WM8400_MICSCD_LVL_SHIFT 14 /* MICSCD_LVL */ | ||
808 | #define WM8400_MICSCD_LVL_WIDTH 1 /* MICSCD_LVL */ | ||
809 | #define WM8400_JDL_LVL 0x2000 /* JDL_LVL */ | ||
810 | #define WM8400_JDL_LVL_MASK 0x2000 /* JDL_LVL */ | ||
811 | #define WM8400_JDL_LVL_SHIFT 13 /* JDL_LVL */ | ||
812 | #define WM8400_JDL_LVL_WIDTH 1 /* JDL_LVL */ | ||
813 | #define WM8400_JDR_LVL 0x1000 /* JDR_LVL */ | ||
814 | #define WM8400_JDR_LVL_MASK 0x1000 /* JDR_LVL */ | ||
815 | #define WM8400_JDR_LVL_SHIFT 12 /* JDR_LVL */ | ||
816 | #define WM8400_JDR_LVL_WIDTH 1 /* JDR_LVL */ | ||
817 | #define WM8400_CODEC_SEQ_END_LVL 0x0800 /* CODEC_SEQ_END_LVL */ | ||
818 | #define WM8400_CODEC_SEQ_END_LVL_MASK 0x0800 /* CODEC_SEQ_END_LVL */ | ||
819 | #define WM8400_CODEC_SEQ_END_LVL_SHIFT 11 /* CODEC_SEQ_END_LVL */ | ||
820 | #define WM8400_CODEC_SEQ_END_LVL_WIDTH 1 /* CODEC_SEQ_END_LVL */ | ||
821 | #define WM8400_CDEL_TO_LVL 0x0400 /* CDEL_TO_LVL */ | ||
822 | #define WM8400_CDEL_TO_LVL_MASK 0x0400 /* CDEL_TO_LVL */ | ||
823 | #define WM8400_CDEL_TO_LVL_SHIFT 10 /* CDEL_TO_LVL */ | ||
824 | #define WM8400_CDEL_TO_LVL_WIDTH 1 /* CDEL_TO_LVL */ | ||
825 | #define WM8400_CHIP_GT150_LVL 0x0200 /* CHIP_GT150_LVL */ | ||
826 | #define WM8400_CHIP_GT150_LVL_MASK 0x0200 /* CHIP_GT150_LVL */ | ||
827 | #define WM8400_CHIP_GT150_LVL_SHIFT 9 /* CHIP_GT150_LVL */ | ||
828 | #define WM8400_CHIP_GT150_LVL_WIDTH 1 /* CHIP_GT150_LVL */ | ||
829 | #define WM8400_CHIP_GT115_LVL 0x0100 /* CHIP_GT115_LVL */ | ||
830 | #define WM8400_CHIP_GT115_LVL_MASK 0x0100 /* CHIP_GT115_LVL */ | ||
831 | #define WM8400_CHIP_GT115_LVL_SHIFT 8 /* CHIP_GT115_LVL */ | ||
832 | #define WM8400_CHIP_GT115_LVL_WIDTH 1 /* CHIP_GT115_LVL */ | ||
833 | #define WM8400_LINE_CMP_LVL 0x0080 /* LINE_CMP_LVL */ | ||
834 | #define WM8400_LINE_CMP_LVL_MASK 0x0080 /* LINE_CMP_LVL */ | ||
835 | #define WM8400_LINE_CMP_LVL_SHIFT 7 /* LINE_CMP_LVL */ | ||
836 | #define WM8400_LINE_CMP_LVL_WIDTH 1 /* LINE_CMP_LVL */ | ||
837 | #define WM8400_UVLO_LVL 0x0040 /* UVLO_LVL */ | ||
838 | #define WM8400_UVLO_LVL_MASK 0x0040 /* UVLO_LVL */ | ||
839 | #define WM8400_UVLO_LVL_SHIFT 6 /* UVLO_LVL */ | ||
840 | #define WM8400_UVLO_LVL_WIDTH 1 /* UVLO_LVL */ | ||
841 | #define WM8400_DC2_UV_LVL 0x0020 /* DC2_UV_LVL */ | ||
842 | #define WM8400_DC2_UV_LVL_MASK 0x0020 /* DC2_UV_LVL */ | ||
843 | #define WM8400_DC2_UV_LVL_SHIFT 5 /* DC2_UV_LVL */ | ||
844 | #define WM8400_DC2_UV_LVL_WIDTH 1 /* DC2_UV_LVL */ | ||
845 | #define WM8400_DC1_UV_LVL 0x0010 /* DC1_UV_LVL */ | ||
846 | #define WM8400_DC1_UV_LVL_MASK 0x0010 /* DC1_UV_LVL */ | ||
847 | #define WM8400_DC1_UV_LVL_SHIFT 4 /* DC1_UV_LVL */ | ||
848 | #define WM8400_DC1_UV_LVL_WIDTH 1 /* DC1_UV_LVL */ | ||
849 | #define WM8400_LDO4_UV_LVL 0x0008 /* LDO4_UV_LVL */ | ||
850 | #define WM8400_LDO4_UV_LVL_MASK 0x0008 /* LDO4_UV_LVL */ | ||
851 | #define WM8400_LDO4_UV_LVL_SHIFT 3 /* LDO4_UV_LVL */ | ||
852 | #define WM8400_LDO4_UV_LVL_WIDTH 1 /* LDO4_UV_LVL */ | ||
853 | #define WM8400_LDO3_UV_LVL 0x0004 /* LDO3_UV_LVL */ | ||
854 | #define WM8400_LDO3_UV_LVL_MASK 0x0004 /* LDO3_UV_LVL */ | ||
855 | #define WM8400_LDO3_UV_LVL_SHIFT 2 /* LDO3_UV_LVL */ | ||
856 | #define WM8400_LDO3_UV_LVL_WIDTH 1 /* LDO3_UV_LVL */ | ||
857 | #define WM8400_LDO2_UV_LVL 0x0002 /* LDO2_UV_LVL */ | ||
858 | #define WM8400_LDO2_UV_LVL_MASK 0x0002 /* LDO2_UV_LVL */ | ||
859 | #define WM8400_LDO2_UV_LVL_SHIFT 1 /* LDO2_UV_LVL */ | ||
860 | #define WM8400_LDO2_UV_LVL_WIDTH 1 /* LDO2_UV_LVL */ | ||
861 | #define WM8400_LDO1_UV_LVL 0x0001 /* LDO1_UV_LVL */ | ||
862 | #define WM8400_LDO1_UV_LVL_MASK 0x0001 /* LDO1_UV_LVL */ | ||
863 | #define WM8400_LDO1_UV_LVL_SHIFT 0 /* LDO1_UV_LVL */ | ||
864 | #define WM8400_LDO1_UV_LVL_WIDTH 1 /* LDO1_UV_LVL */ | ||
865 | |||
866 | /* | ||
867 | * R82 (0x52) - Shutdown Reason | ||
868 | */ | ||
869 | #define WM8400_SDR_CHIP_SOFTSD 0x2000 /* SDR_CHIP_SOFTSD */ | ||
870 | #define WM8400_SDR_CHIP_SOFTSD_MASK 0x2000 /* SDR_CHIP_SOFTSD */ | ||
871 | #define WM8400_SDR_CHIP_SOFTSD_SHIFT 13 /* SDR_CHIP_SOFTSD */ | ||
872 | #define WM8400_SDR_CHIP_SOFTSD_WIDTH 1 /* SDR_CHIP_SOFTSD */ | ||
873 | #define WM8400_SDR_NPDN 0x0800 /* SDR_NPDN */ | ||
874 | #define WM8400_SDR_NPDN_MASK 0x0800 /* SDR_NPDN */ | ||
875 | #define WM8400_SDR_NPDN_SHIFT 11 /* SDR_NPDN */ | ||
876 | #define WM8400_SDR_NPDN_WIDTH 1 /* SDR_NPDN */ | ||
877 | #define WM8400_SDR_CHIP_GT150 0x0200 /* SDR_CHIP_GT150 */ | ||
878 | #define WM8400_SDR_CHIP_GT150_MASK 0x0200 /* SDR_CHIP_GT150 */ | ||
879 | #define WM8400_SDR_CHIP_GT150_SHIFT 9 /* SDR_CHIP_GT150 */ | ||
880 | #define WM8400_SDR_CHIP_GT150_WIDTH 1 /* SDR_CHIP_GT150 */ | ||
881 | #define WM8400_SDR_CHIP_GT115 0x0100 /* SDR_CHIP_GT115 */ | ||
882 | #define WM8400_SDR_CHIP_GT115_MASK 0x0100 /* SDR_CHIP_GT115 */ | ||
883 | #define WM8400_SDR_CHIP_GT115_SHIFT 8 /* SDR_CHIP_GT115 */ | ||
884 | #define WM8400_SDR_CHIP_GT115_WIDTH 1 /* SDR_CHIP_GT115 */ | ||
885 | #define WM8400_SDR_LINE_CMP 0x0080 /* SDR_LINE_CMP */ | ||
886 | #define WM8400_SDR_LINE_CMP_MASK 0x0080 /* SDR_LINE_CMP */ | ||
887 | #define WM8400_SDR_LINE_CMP_SHIFT 7 /* SDR_LINE_CMP */ | ||
888 | #define WM8400_SDR_LINE_CMP_WIDTH 1 /* SDR_LINE_CMP */ | ||
889 | #define WM8400_SDR_UVLO 0x0040 /* SDR_UVLO */ | ||
890 | #define WM8400_SDR_UVLO_MASK 0x0040 /* SDR_UVLO */ | ||
891 | #define WM8400_SDR_UVLO_SHIFT 6 /* SDR_UVLO */ | ||
892 | #define WM8400_SDR_UVLO_WIDTH 1 /* SDR_UVLO */ | ||
893 | #define WM8400_SDR_DC2_UV 0x0020 /* SDR_DC2_UV */ | ||
894 | #define WM8400_SDR_DC2_UV_MASK 0x0020 /* SDR_DC2_UV */ | ||
895 | #define WM8400_SDR_DC2_UV_SHIFT 5 /* SDR_DC2_UV */ | ||
896 | #define WM8400_SDR_DC2_UV_WIDTH 1 /* SDR_DC2_UV */ | ||
897 | #define WM8400_SDR_DC1_UV 0x0010 /* SDR_DC1_UV */ | ||
898 | #define WM8400_SDR_DC1_UV_MASK 0x0010 /* SDR_DC1_UV */ | ||
899 | #define WM8400_SDR_DC1_UV_SHIFT 4 /* SDR_DC1_UV */ | ||
900 | #define WM8400_SDR_DC1_UV_WIDTH 1 /* SDR_DC1_UV */ | ||
901 | #define WM8400_SDR_LDO4_UV 0x0008 /* SDR_LDO4_UV */ | ||
902 | #define WM8400_SDR_LDO4_UV_MASK 0x0008 /* SDR_LDO4_UV */ | ||
903 | #define WM8400_SDR_LDO4_UV_SHIFT 3 /* SDR_LDO4_UV */ | ||
904 | #define WM8400_SDR_LDO4_UV_WIDTH 1 /* SDR_LDO4_UV */ | ||
905 | #define WM8400_SDR_LDO3_UV 0x0004 /* SDR_LDO3_UV */ | ||
906 | #define WM8400_SDR_LDO3_UV_MASK 0x0004 /* SDR_LDO3_UV */ | ||
907 | #define WM8400_SDR_LDO3_UV_SHIFT 2 /* SDR_LDO3_UV */ | ||
908 | #define WM8400_SDR_LDO3_UV_WIDTH 1 /* SDR_LDO3_UV */ | ||
909 | #define WM8400_SDR_LDO2_UV 0x0002 /* SDR_LDO2_UV */ | ||
910 | #define WM8400_SDR_LDO2_UV_MASK 0x0002 /* SDR_LDO2_UV */ | ||
911 | #define WM8400_SDR_LDO2_UV_SHIFT 1 /* SDR_LDO2_UV */ | ||
912 | #define WM8400_SDR_LDO2_UV_WIDTH 1 /* SDR_LDO2_UV */ | ||
913 | #define WM8400_SDR_LDO1_UV 0x0001 /* SDR_LDO1_UV */ | ||
914 | #define WM8400_SDR_LDO1_UV_MASK 0x0001 /* SDR_LDO1_UV */ | ||
915 | #define WM8400_SDR_LDO1_UV_SHIFT 0 /* SDR_LDO1_UV */ | ||
916 | #define WM8400_SDR_LDO1_UV_WIDTH 1 /* SDR_LDO1_UV */ | ||
917 | |||
918 | /* | ||
919 | * R84 (0x54) - Line Circuits | ||
920 | */ | ||
921 | #define WM8400_BG_LINE_COMP 0x8000 /* BG_LINE_COMP */ | ||
922 | #define WM8400_BG_LINE_COMP_MASK 0x8000 /* BG_LINE_COMP */ | ||
923 | #define WM8400_BG_LINE_COMP_SHIFT 15 /* BG_LINE_COMP */ | ||
924 | #define WM8400_BG_LINE_COMP_WIDTH 1 /* BG_LINE_COMP */ | ||
925 | #define WM8400_LINE_CMP_VTHI_MASK 0x00F0 /* LINE_CMP_VTHI - [7:4] */ | ||
926 | #define WM8400_LINE_CMP_VTHI_SHIFT 4 /* LINE_CMP_VTHI - [7:4] */ | ||
927 | #define WM8400_LINE_CMP_VTHI_WIDTH 4 /* LINE_CMP_VTHI - [7:4] */ | ||
928 | #define WM8400_LINE_CMP_VTHD_MASK 0x000F /* LINE_CMP_VTHD - [3:0] */ | ||
929 | #define WM8400_LINE_CMP_VTHD_SHIFT 0 /* LINE_CMP_VTHD - [3:0] */ | ||
930 | #define WM8400_LINE_CMP_VTHD_WIDTH 4 /* LINE_CMP_VTHD - [3:0] */ | ||
931 | |||
932 | u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg); | ||
933 | int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data); | ||
934 | int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val); | ||
935 | |||
936 | #endif | ||
diff --git a/include/linux/mfd/wm8400.h b/include/linux/mfd/wm8400.h new file mode 100644 index 000000000000..b46b566ac1ac --- /dev/null +++ b/include/linux/mfd/wm8400.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * wm8400 client interface | ||
3 | * | ||
4 | * Copyright 2008 Wolfson Microelectronics plc | ||
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_MFD_WM8400_H | ||
22 | #define __LINUX_MFD_WM8400_H | ||
23 | |||
24 | #include <linux/regulator/machine.h> | ||
25 | |||
26 | #define WM8400_LDO1 0 | ||
27 | #define WM8400_LDO2 1 | ||
28 | #define WM8400_LDO3 2 | ||
29 | #define WM8400_LDO4 3 | ||
30 | #define WM8400_DCDC1 4 | ||
31 | #define WM8400_DCDC2 5 | ||
32 | |||
33 | struct wm8400_platform_data { | ||
34 | int (*platform_init)(struct device *dev); | ||
35 | }; | ||
36 | |||
37 | int wm8400_register_regulator(struct device *dev, int reg, | ||
38 | struct regulator_init_data *initdata); | ||
39 | |||
40 | #endif | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 655ea0d1ee14..b2f944468313 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -141,6 +141,10 @@ enum { | |||
141 | MLX4_STAT_RATE_OFFSET = 5 | 141 | MLX4_STAT_RATE_OFFSET = 5 |
142 | }; | 142 | }; |
143 | 143 | ||
144 | enum { | ||
145 | MLX4_MTT_FLAG_PRESENT = 1 | ||
146 | }; | ||
147 | |||
144 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 148 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
145 | { | 149 | { |
146 | return (major << 32) | (minor << 16) | subminor; | 150 | return (major << 32) | (minor << 16) | subminor; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 72a15dc26bbf..c61ba10768ea 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <linux/gfp.h> | 8 | #include <linux/gfp.h> |
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/mmdebug.h> | ||
10 | #include <linux/mmzone.h> | 11 | #include <linux/mmzone.h> |
11 | #include <linux/rbtree.h> | 12 | #include <linux/rbtree.h> |
12 | #include <linux/prio_tree.h> | 13 | #include <linux/prio_tree.h> |
@@ -219,12 +220,6 @@ struct inode; | |||
219 | */ | 220 | */ |
220 | #include <linux/page-flags.h> | 221 | #include <linux/page-flags.h> |
221 | 222 | ||
222 | #ifdef CONFIG_DEBUG_VM | ||
223 | #define VM_BUG_ON(cond) BUG_ON(cond) | ||
224 | #else | ||
225 | #define VM_BUG_ON(condition) do { } while(0) | ||
226 | #endif | ||
227 | |||
228 | /* | 223 | /* |
229 | * Methods to modify the page usage count. | 224 | * Methods to modify the page usage count. |
230 | * | 225 | * |
@@ -919,7 +914,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
919 | } | 914 | } |
920 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ | 915 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
921 | 916 | ||
922 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 917 | #if USE_SPLIT_PTLOCKS |
923 | /* | 918 | /* |
924 | * We tuck a spinlock to guard each pagetable page into its struct page, | 919 | * We tuck a spinlock to guard each pagetable page into its struct page, |
925 | * at page->private, with BUILD_BUG_ON to make sure that this will not | 920 | * at page->private, with BUILD_BUG_ON to make sure that this will not |
@@ -932,14 +927,14 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
932 | } while (0) | 927 | } while (0) |
933 | #define pte_lock_deinit(page) ((page)->mapping = NULL) | 928 | #define pte_lock_deinit(page) ((page)->mapping = NULL) |
934 | #define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));}) | 929 | #define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));}) |
935 | #else | 930 | #else /* !USE_SPLIT_PTLOCKS */ |
936 | /* | 931 | /* |
937 | * We use mm->page_table_lock to guard all pagetable pages of the mm. | 932 | * We use mm->page_table_lock to guard all pagetable pages of the mm. |
938 | */ | 933 | */ |
939 | #define pte_lock_init(page) do {} while (0) | 934 | #define pte_lock_init(page) do {} while (0) |
940 | #define pte_lock_deinit(page) do {} while (0) | 935 | #define pte_lock_deinit(page) do {} while (0) |
941 | #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) | 936 | #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) |
942 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 937 | #endif /* USE_SPLIT_PTLOCKS */ |
943 | 938 | ||
944 | static inline void pgtable_page_ctor(struct page *page) | 939 | static inline void pgtable_page_ctor(struct page *page) |
945 | { | 940 | { |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bf334138c7c1..9d49fa36bbef 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -21,11 +21,13 @@ | |||
21 | 21 | ||
22 | struct address_space; | 22 | struct address_space; |
23 | 23 | ||
24 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 24 | #define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
25 | |||
26 | #if USE_SPLIT_PTLOCKS | ||
25 | typedef atomic_long_t mm_counter_t; | 27 | typedef atomic_long_t mm_counter_t; |
26 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 28 | #else /* !USE_SPLIT_PTLOCKS */ |
27 | typedef unsigned long mm_counter_t; | 29 | typedef unsigned long mm_counter_t; |
28 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 30 | #endif /* !USE_SPLIT_PTLOCKS */ |
29 | 31 | ||
30 | /* | 32 | /* |
31 | * Each physical page in the system has a struct page associated with | 33 | * Each physical page in the system has a struct page associated with |
@@ -65,7 +67,7 @@ struct page { | |||
65 | * see PAGE_MAPPING_ANON below. | 67 | * see PAGE_MAPPING_ANON below. |
66 | */ | 68 | */ |
67 | }; | 69 | }; |
68 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 70 | #if USE_SPLIT_PTLOCKS |
69 | spinlock_t ptl; | 71 | spinlock_t ptl; |
70 | #endif | 72 | #endif |
71 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ | 73 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9c288c909878..bde891f64591 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -65,7 +65,7 @@ struct mmc_host_ops { | |||
65 | * -ENOSYS when not supported (equal to NULL callback) | 65 | * -ENOSYS when not supported (equal to NULL callback) |
66 | * or a negative errno value when something bad happened | 66 | * or a negative errno value when something bad happened |
67 | * | 67 | * |
68 | * Return values for the get_ro callback should be: | 68 | * Return values for the get_cd callback should be: |
69 | * 0 for a absent card | 69 | * 0 for a absent card |
70 | * 1 for a present card | 70 | * 1 for a present card |
71 | * -ENOSYS when not supported (equal to NULL callback) | 71 | * -ENOSYS when not supported (equal to NULL callback) |
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h new file mode 100644 index 000000000000..8a5509877192 --- /dev/null +++ b/include/linux/mmdebug.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef LINUX_MM_DEBUG_H | ||
2 | #define LINUX_MM_DEBUG_H 1 | ||
3 | |||
4 | #include <linux/autoconf.h> | ||
5 | |||
6 | #ifdef CONFIG_DEBUG_VM | ||
7 | #define VM_BUG_ON(cond) BUG_ON(cond) | ||
8 | #else | ||
9 | #define VM_BUG_ON(cond) do { } while (0) | ||
10 | #endif | ||
11 | |||
12 | #ifdef CONFIG_DEBUG_VIRTUAL | ||
13 | #define VIRTUAL_BUG_ON(cond) BUG_ON(cond) | ||
14 | #else | ||
15 | #define VIRTUAL_BUG_ON(cond) do { } while (0) | ||
16 | #endif | ||
17 | |||
18 | #endif | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 443bc7cd8c62..428328a05fa1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -751,8 +751,9 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
751 | * | 751 | * |
752 | * This function returns the next zone at or below a given zone index that is | 752 | * This function returns the next zone at or below a given zone index that is |
753 | * within the allowed nodemask using a cursor as the starting point for the | 753 | * within the allowed nodemask using a cursor as the starting point for the |
754 | * search. The zoneref returned is a cursor that is used as the next starting | 754 | * search. The zoneref returned is a cursor that represents the current zone |
755 | * point for future calls to next_zones_zonelist(). | 755 | * being examined. It should be advanced by one before calling |
756 | * next_zones_zonelist again. | ||
756 | */ | 757 | */ |
757 | struct zoneref *next_zones_zonelist(struct zoneref *z, | 758 | struct zoneref *next_zones_zonelist(struct zoneref *z, |
758 | enum zone_type highest_zoneidx, | 759 | enum zone_type highest_zoneidx, |
@@ -768,9 +769,8 @@ struct zoneref *next_zones_zonelist(struct zoneref *z, | |||
768 | * | 769 | * |
769 | * This function returns the first zone at or below a given zone index that is | 770 | * This function returns the first zone at or below a given zone index that is |
770 | * within the allowed nodemask. The zoneref returned is a cursor that can be | 771 | * within the allowed nodemask. The zoneref returned is a cursor that can be |
771 | * used to iterate the zonelist with next_zones_zonelist. The cursor should | 772 | * used to iterate the zonelist with next_zones_zonelist by advancing it by |
772 | * not be used by the caller as it does not match the value of the zone | 773 | * one before calling. |
773 | * returned. | ||
774 | */ | 774 | */ |
775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | 775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, |
776 | enum zone_type highest_zoneidx, | 776 | enum zone_type highest_zoneidx, |
@@ -795,7 +795,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ | 795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ |
796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ | 796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ |
797 | zone; \ | 797 | zone; \ |
798 | z = next_zones_zonelist(z, highidx, nodemask, &zone)) \ | 798 | z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \ |
799 | 799 | ||
800 | /** | 800 | /** |
801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index | 801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index c4db5827963d..eb71b45fdf5a 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -131,6 +131,16 @@ struct usb_device_id { | |||
131 | #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 | 131 | #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 |
132 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 | 132 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 |
133 | 133 | ||
134 | #define HID_ANY_ID (~0) | ||
135 | |||
136 | struct hid_device_id { | ||
137 | __u16 bus; | ||
138 | __u32 vendor; | ||
139 | __u32 product; | ||
140 | kernel_ulong_t driver_data | ||
141 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
142 | }; | ||
143 | |||
134 | /* s390 CCW devices */ | 144 | /* s390 CCW devices */ |
135 | struct ccw_device_id { | 145 | struct ccw_device_id { |
136 | __u16 match_flags; /* which fields to match against */ | 146 | __u16 match_flags; /* which fields to match against */ |
@@ -274,7 +284,7 @@ struct pcmcia_device_id { | |||
274 | /* Input */ | 284 | /* Input */ |
275 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | 285 | #define INPUT_DEVICE_ID_EV_MAX 0x1f |
276 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 | 286 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 |
277 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff | 287 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff |
278 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | 288 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
279 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | 289 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f |
280 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 | 290 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 |
@@ -388,5 +398,52 @@ struct i2c_device_id { | |||
388 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 398 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
389 | }; | 399 | }; |
390 | 400 | ||
401 | /* dmi */ | ||
402 | enum dmi_field { | ||
403 | DMI_NONE, | ||
404 | DMI_BIOS_VENDOR, | ||
405 | DMI_BIOS_VERSION, | ||
406 | DMI_BIOS_DATE, | ||
407 | DMI_SYS_VENDOR, | ||
408 | DMI_PRODUCT_NAME, | ||
409 | DMI_PRODUCT_VERSION, | ||
410 | DMI_PRODUCT_SERIAL, | ||
411 | DMI_PRODUCT_UUID, | ||
412 | DMI_BOARD_VENDOR, | ||
413 | DMI_BOARD_NAME, | ||
414 | DMI_BOARD_VERSION, | ||
415 | DMI_BOARD_SERIAL, | ||
416 | DMI_BOARD_ASSET_TAG, | ||
417 | DMI_CHASSIS_VENDOR, | ||
418 | DMI_CHASSIS_TYPE, | ||
419 | DMI_CHASSIS_VERSION, | ||
420 | DMI_CHASSIS_SERIAL, | ||
421 | DMI_CHASSIS_ASSET_TAG, | ||
422 | DMI_STRING_MAX, | ||
423 | }; | ||
424 | |||
425 | struct dmi_strmatch { | ||
426 | unsigned char slot; | ||
427 | char substr[79]; | ||
428 | }; | ||
429 | |||
430 | #ifndef __KERNEL__ | ||
431 | struct dmi_system_id { | ||
432 | kernel_ulong_t callback; | ||
433 | kernel_ulong_t ident; | ||
434 | struct dmi_strmatch matches[4]; | ||
435 | kernel_ulong_t driver_data | ||
436 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
437 | }; | ||
438 | #else | ||
439 | struct dmi_system_id { | ||
440 | int (*callback)(const struct dmi_system_id *); | ||
441 | const char *ident; | ||
442 | struct dmi_strmatch matches[4]; | ||
443 | void *driver_data; | ||
444 | }; | ||
445 | #endif | ||
446 | |||
447 | #define DMI_MATCH(a, b) { a, b } | ||
391 | 448 | ||
392 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 449 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 68e09557c951..a41555cbe00a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -345,7 +345,6 @@ struct module | |||
345 | /* Reference counts */ | 345 | /* Reference counts */ |
346 | struct module_ref ref[NR_CPUS]; | 346 | struct module_ref ref[NR_CPUS]; |
347 | #endif | 347 | #endif |
348 | |||
349 | }; | 348 | }; |
350 | #ifndef MODULE_ARCH_INIT | 349 | #ifndef MODULE_ARCH_INIT |
351 | #define MODULE_ARCH_INIT {} | 350 | #define MODULE_ARCH_INIT {} |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 30a1d63b6fb5..cab2a85e2ee8 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -5,8 +5,6 @@ | |||
5 | * | 5 | * |
6 | * Author: Marco van Wieringen <mvw@planets.elm.net> | 6 | * Author: Marco van Wieringen <mvw@planets.elm.net> |
7 | * | 7 | * |
8 | * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $ | ||
9 | * | ||
10 | */ | 8 | */ |
11 | #ifndef _LINUX_MOUNT_H | 9 | #ifndef _LINUX_MOUNT_H |
12 | #define _LINUX_MOUNT_H | 10 | #define _LINUX_MOUNT_H |
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 310e61606415..8b4aa0523db7 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
@@ -41,6 +41,8 @@ struct mtd_blktrans_ops { | |||
41 | unsigned long block, char *buffer); | 41 | unsigned long block, char *buffer); |
42 | int (*writesect)(struct mtd_blktrans_dev *dev, | 42 | int (*writesect)(struct mtd_blktrans_dev *dev, |
43 | unsigned long block, char *buffer); | 43 | unsigned long block, char *buffer); |
44 | int (*discard)(struct mtd_blktrans_dev *dev, | ||
45 | unsigned long block, unsigned nr_blocks); | ||
44 | 46 | ||
45 | /* Block layer ioctls */ | 47 | /* Block layer ioctls */ |
46 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); | 48 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); |
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h index 12078577aef6..cbbbe9bfecad 100644 --- a/include/linux/mv643xx_eth.h +++ b/include/linux/mv643xx_eth.h | |||
@@ -17,9 +17,14 @@ | |||
17 | 17 | ||
18 | struct mv643xx_eth_shared_platform_data { | 18 | struct mv643xx_eth_shared_platform_data { |
19 | struct mbus_dram_target_info *dram; | 19 | struct mbus_dram_target_info *dram; |
20 | struct platform_device *shared_smi; | ||
20 | unsigned int t_clk; | 21 | unsigned int t_clk; |
21 | }; | 22 | }; |
22 | 23 | ||
24 | #define MV643XX_ETH_PHY_ADDR_DEFAULT 0 | ||
25 | #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x)) | ||
26 | #define MV643XX_ETH_PHY_NONE 0xff | ||
27 | |||
23 | struct mv643xx_eth_platform_data { | 28 | struct mv643xx_eth_platform_data { |
24 | /* | 29 | /* |
25 | * Pointer back to our parent instance, and our port number. | 30 | * Pointer back to our parent instance, and our port number. |
@@ -30,8 +35,6 @@ struct mv643xx_eth_platform_data { | |||
30 | /* | 35 | /* |
31 | * Whether a PHY is present, and if yes, at which address. | 36 | * Whether a PHY is present, and if yes, at which address. |
32 | */ | 37 | */ |
33 | struct platform_device *shared_smi; | ||
34 | int force_phy_addr; | ||
35 | int phy_addr; | 38 | int phy_addr; |
36 | 39 | ||
37 | /* | 40 | /* |
@@ -49,10 +52,10 @@ struct mv643xx_eth_platform_data { | |||
49 | int duplex; | 52 | int duplex; |
50 | 53 | ||
51 | /* | 54 | /* |
52 | * Which RX/TX queues to use. | 55 | * How many RX/TX queues to use. |
53 | */ | 56 | */ |
54 | int rx_queue_mask; | 57 | int rx_queue_count; |
55 | int tx_queue_mask; | 58 | int tx_queue_count; |
56 | 59 | ||
57 | /* | 60 | /* |
58 | * Override default RX/TX queue sizes if nonzero. | 61 | * Override default RX/TX queue sizes if nonzero. |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 488c56e649b5..64875859d654 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -11,7 +11,7 @@ | |||
11 | * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 11 | * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
12 | * Corey Minyard <wf-rch!minyard@relay.EU.net> | 12 | * Corey Minyard <wf-rch!minyard@relay.EU.net> |
13 | * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov> | 13 | * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov> |
14 | * Alan Cox, <Alan.Cox@linux.org> | 14 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> |
15 | * Bjorn Ekwall. <bj0rn@blox.se> | 15 | * Bjorn Ekwall. <bj0rn@blox.se> |
16 | * Pekka Riikonen <priikone@poseidon.pspt.fi> | 16 | * Pekka Riikonen <priikone@poseidon.pspt.fi> |
17 | * | 17 | * |
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/workqueue.h> | 42 | #include <linux/workqueue.h> |
43 | 43 | ||
44 | #include <net/net_namespace.h> | 44 | #include <net/net_namespace.h> |
45 | #include <net/dsa.h> | ||
45 | 46 | ||
46 | struct vlan_group; | 47 | struct vlan_group; |
47 | struct ethtool_ops; | 48 | struct ethtool_ops; |
@@ -471,6 +472,8 @@ struct net_device | |||
471 | char name[IFNAMSIZ]; | 472 | char name[IFNAMSIZ]; |
472 | /* device name hash chain */ | 473 | /* device name hash chain */ |
473 | struct hlist_node name_hlist; | 474 | struct hlist_node name_hlist; |
475 | /* snmp alias */ | ||
476 | char *ifalias; | ||
474 | 477 | ||
475 | /* | 478 | /* |
476 | * I/O specific fields | 479 | * I/O specific fields |
@@ -605,6 +608,9 @@ struct net_device | |||
605 | 608 | ||
606 | /* Protocol specific pointers */ | 609 | /* Protocol specific pointers */ |
607 | 610 | ||
611 | #ifdef CONFIG_NET_DSA | ||
612 | void *dsa_ptr; /* dsa specific data */ | ||
613 | #endif | ||
608 | void *atalk_ptr; /* AppleTalk link */ | 614 | void *atalk_ptr; /* AppleTalk link */ |
609 | void *ip_ptr; /* IPv4 specific data */ | 615 | void *ip_ptr; /* IPv4 specific data */ |
610 | void *dn_ptr; /* DECnet specific data */ | 616 | void *dn_ptr; /* DECnet specific data */ |
@@ -796,6 +802,26 @@ void dev_net_set(struct net_device *dev, struct net *net) | |||
796 | #endif | 802 | #endif |
797 | } | 803 | } |
798 | 804 | ||
805 | static inline bool netdev_uses_dsa_tags(struct net_device *dev) | ||
806 | { | ||
807 | #ifdef CONFIG_NET_DSA_TAG_DSA | ||
808 | if (dev->dsa_ptr != NULL) | ||
809 | return dsa_uses_dsa_tags(dev->dsa_ptr); | ||
810 | #endif | ||
811 | |||
812 | return 0; | ||
813 | } | ||
814 | |||
815 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | ||
816 | { | ||
817 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | ||
818 | if (dev->dsa_ptr != NULL) | ||
819 | return dsa_uses_trailer_tags(dev->dsa_ptr); | ||
820 | #endif | ||
821 | |||
822 | return 0; | ||
823 | } | ||
824 | |||
799 | /** | 825 | /** |
800 | * netdev_priv - access network device private data | 826 | * netdev_priv - access network device private data |
801 | * @dev: network device | 827 | * @dev: network device |
@@ -1223,7 +1249,8 @@ extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | |||
1223 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1249 | extern int dev_ethtool(struct net *net, struct ifreq *); |
1224 | extern unsigned dev_get_flags(const struct net_device *); | 1250 | extern unsigned dev_get_flags(const struct net_device *); |
1225 | extern int dev_change_flags(struct net_device *, unsigned); | 1251 | extern int dev_change_flags(struct net_device *, unsigned); |
1226 | extern int dev_change_name(struct net_device *, char *); | 1252 | extern int dev_change_name(struct net_device *, const char *); |
1253 | extern int dev_set_alias(struct net_device *, const char *, size_t); | ||
1227 | extern int dev_change_net_namespace(struct net_device *, | 1254 | extern int dev_change_net_namespace(struct net_device *, |
1228 | struct net *, const char *); | 1255 | struct net *, const char *); |
1229 | extern int dev_set_mtu(struct net_device *, int); | 1256 | extern int dev_set_mtu(struct net_device *, int); |
@@ -1667,7 +1694,7 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
1667 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 1694 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
1668 | extern void netdev_class_remove_file(struct class_attribute *class_attr); | 1695 | extern void netdev_class_remove_file(struct class_attribute *class_attr); |
1669 | 1696 | ||
1670 | extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); | 1697 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); |
1671 | 1698 | ||
1672 | extern void linkwatch_run_queue(void); | 1699 | extern void linkwatch_run_queue(void); |
1673 | 1700 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 0c5eb7ed8b3f..48cfe51bfddc 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -5,13 +5,11 @@ | |||
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | #include <linux/net.h> | 7 | #include <linux/net.h> |
8 | #include <linux/netdevice.h> | ||
9 | #include <linux/if.h> | 8 | #include <linux/if.h> |
10 | #include <linux/in.h> | 9 | #include <linux/in.h> |
11 | #include <linux/in6.h> | 10 | #include <linux/in6.h> |
12 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
13 | #include <linux/list.h> | 12 | #include <linux/list.h> |
14 | #include <net/net_namespace.h> | ||
15 | #endif | 13 | #endif |
16 | #include <linux/types.h> | 14 | #include <linux/types.h> |
17 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
@@ -52,6 +50,16 @@ enum nf_inet_hooks { | |||
52 | NF_INET_NUMHOOKS | 50 | NF_INET_NUMHOOKS |
53 | }; | 51 | }; |
54 | 52 | ||
53 | enum { | ||
54 | NFPROTO_UNSPEC = 0, | ||
55 | NFPROTO_IPV4 = 2, | ||
56 | NFPROTO_ARP = 3, | ||
57 | NFPROTO_BRIDGE = 7, | ||
58 | NFPROTO_IPV6 = 10, | ||
59 | NFPROTO_DECNET = 12, | ||
60 | NFPROTO_NUMPROTO, | ||
61 | }; | ||
62 | |||
55 | union nf_inet_addr { | 63 | union nf_inet_addr { |
56 | __u32 all[4]; | 64 | __u32 all[4]; |
57 | __be32 ip; | 65 | __be32 ip; |
@@ -92,8 +100,8 @@ struct nf_hook_ops | |||
92 | /* User fills in from here down. */ | 100 | /* User fills in from here down. */ |
93 | nf_hookfn *hook; | 101 | nf_hookfn *hook; |
94 | struct module *owner; | 102 | struct module *owner; |
95 | int pf; | 103 | u_int8_t pf; |
96 | int hooknum; | 104 | unsigned int hooknum; |
97 | /* Hooks are ordered in ascending priority. */ | 105 | /* Hooks are ordered in ascending priority. */ |
98 | int priority; | 106 | int priority; |
99 | }; | 107 | }; |
@@ -102,7 +110,7 @@ struct nf_sockopt_ops | |||
102 | { | 110 | { |
103 | struct list_head list; | 111 | struct list_head list; |
104 | 112 | ||
105 | int pf; | 113 | u_int8_t pf; |
106 | 114 | ||
107 | /* Non-inclusive ranges: use 0/0/NULL to never get called. */ | 115 | /* Non-inclusive ranges: use 0/0/NULL to never get called. */ |
108 | int set_optmin; | 116 | int set_optmin; |
@@ -138,9 +146,9 @@ extern struct ctl_path nf_net_netfilter_sysctl_path[]; | |||
138 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; | 146 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; |
139 | #endif /* CONFIG_SYSCTL */ | 147 | #endif /* CONFIG_SYSCTL */ |
140 | 148 | ||
141 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 149 | extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; |
142 | 150 | ||
143 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | 151 | int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
144 | struct net_device *indev, struct net_device *outdev, | 152 | struct net_device *indev, struct net_device *outdev, |
145 | int (*okfn)(struct sk_buff *), int thresh); | 153 | int (*okfn)(struct sk_buff *), int thresh); |
146 | 154 | ||
@@ -151,7 +159,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | |||
151 | * okfn must be invoked by the caller in this case. Any other return | 159 | * okfn must be invoked by the caller in this case. Any other return |
152 | * value indicates the packet has been consumed by the hook. | 160 | * value indicates the packet has been consumed by the hook. |
153 | */ | 161 | */ |
154 | static inline int nf_hook_thresh(int pf, unsigned int hook, | 162 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
155 | struct sk_buff *skb, | 163 | struct sk_buff *skb, |
156 | struct net_device *indev, | 164 | struct net_device *indev, |
157 | struct net_device *outdev, | 165 | struct net_device *outdev, |
@@ -167,7 +175,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook, | |||
167 | return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); | 175 | return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); |
168 | } | 176 | } |
169 | 177 | ||
170 | static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | 178 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
171 | struct net_device *indev, struct net_device *outdev, | 179 | struct net_device *indev, struct net_device *outdev, |
172 | int (*okfn)(struct sk_buff *)) | 180 | int (*okfn)(struct sk_buff *)) |
173 | { | 181 | { |
@@ -212,14 +220,14 @@ __ret;}) | |||
212 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) | 220 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) |
213 | 221 | ||
214 | /* Call setsockopt() */ | 222 | /* Call setsockopt() */ |
215 | int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 223 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
216 | int len); | 224 | int len); |
217 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 225 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
218 | int *len); | 226 | int *len); |
219 | 227 | ||
220 | int compat_nf_setsockopt(struct sock *sk, int pf, int optval, | 228 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
221 | char __user *opt, int len); | 229 | char __user *opt, int len); |
222 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, | 230 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
223 | char __user *opt, int *len); | 231 | char __user *opt, int *len); |
224 | 232 | ||
225 | /* Call this before modifying an existing packet: ensures it is | 233 | /* Call this before modifying an existing packet: ensures it is |
@@ -247,7 +255,7 @@ struct nf_afinfo { | |||
247 | int route_key_size; | 255 | int route_key_size; |
248 | }; | 256 | }; |
249 | 257 | ||
250 | extern const struct nf_afinfo *nf_afinfo[NPROTO]; | 258 | extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO]; |
251 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) | 259 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) |
252 | { | 260 | { |
253 | return rcu_dereference(nf_afinfo[family]); | 261 | return rcu_dereference(nf_afinfo[family]); |
@@ -292,7 +300,7 @@ extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); | |||
292 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | 300 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); |
293 | 301 | ||
294 | static inline void | 302 | static inline void |
295 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) | 303 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
296 | { | 304 | { |
297 | #ifdef CONFIG_NF_NAT_NEEDED | 305 | #ifdef CONFIG_NF_NAT_NEEDED |
298 | void (*decodefn)(struct sk_buff *, struct flowi *); | 306 | void (*decodefn)(struct sk_buff *, struct flowi *); |
@@ -315,7 +323,7 @@ extern struct proc_dir_entry *proc_net_netfilter; | |||
315 | #else /* !CONFIG_NETFILTER */ | 323 | #else /* !CONFIG_NETFILTER */ |
316 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) | 324 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) |
317 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) | 325 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) |
318 | static inline int nf_hook_thresh(int pf, unsigned int hook, | 326 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
319 | struct sk_buff *skb, | 327 | struct sk_buff *skb, |
320 | struct net_device *indev, | 328 | struct net_device *indev, |
321 | struct net_device *outdev, | 329 | struct net_device *outdev, |
@@ -324,7 +332,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook, | |||
324 | { | 332 | { |
325 | return okfn(skb); | 333 | return okfn(skb); |
326 | } | 334 | } |
327 | static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | 335 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
328 | struct net_device *indev, struct net_device *outdev, | 336 | struct net_device *indev, struct net_device *outdev, |
329 | int (*okfn)(struct sk_buff *)) | 337 | int (*okfn)(struct sk_buff *)) |
330 | { | 338 | { |
@@ -332,7 +340,9 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | |||
332 | } | 340 | } |
333 | struct flowi; | 341 | struct flowi; |
334 | static inline void | 342 | static inline void |
335 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} | 343 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
344 | { | ||
345 | } | ||
336 | #endif /*CONFIG_NETFILTER*/ | 346 | #endif /*CONFIG_NETFILTER*/ |
337 | 347 | ||
338 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 348 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
@@ -343,56 +353,5 @@ extern void (*nf_ct_destroy)(struct nf_conntrack *); | |||
343 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 353 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
344 | #endif | 354 | #endif |
345 | 355 | ||
346 | static inline struct net *nf_pre_routing_net(const struct net_device *in, | ||
347 | const struct net_device *out) | ||
348 | { | ||
349 | #ifdef CONFIG_NET_NS | ||
350 | return in->nd_net; | ||
351 | #else | ||
352 | return &init_net; | ||
353 | #endif | ||
354 | } | ||
355 | |||
356 | static inline struct net *nf_local_in_net(const struct net_device *in, | ||
357 | const struct net_device *out) | ||
358 | { | ||
359 | #ifdef CONFIG_NET_NS | ||
360 | return in->nd_net; | ||
361 | #else | ||
362 | return &init_net; | ||
363 | #endif | ||
364 | } | ||
365 | |||
366 | static inline struct net *nf_forward_net(const struct net_device *in, | ||
367 | const struct net_device *out) | ||
368 | { | ||
369 | #ifdef CONFIG_NET_NS | ||
370 | BUG_ON(in->nd_net != out->nd_net); | ||
371 | return in->nd_net; | ||
372 | #else | ||
373 | return &init_net; | ||
374 | #endif | ||
375 | } | ||
376 | |||
377 | static inline struct net *nf_local_out_net(const struct net_device *in, | ||
378 | const struct net_device *out) | ||
379 | { | ||
380 | #ifdef CONFIG_NET_NS | ||
381 | return out->nd_net; | ||
382 | #else | ||
383 | return &init_net; | ||
384 | #endif | ||
385 | } | ||
386 | |||
387 | static inline struct net *nf_post_routing_net(const struct net_device *in, | ||
388 | const struct net_device *out) | ||
389 | { | ||
390 | #ifdef CONFIG_NET_NS | ||
391 | return out->nd_net; | ||
392 | #else | ||
393 | return &init_net; | ||
394 | #endif | ||
395 | } | ||
396 | |||
397 | #endif /*__KERNEL__*/ | 356 | #endif /*__KERNEL__*/ |
398 | #endif /*__LINUX_NETFILTER_H*/ | 357 | #endif /*__LINUX_NETFILTER_H*/ |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 3aff513d12c8..5a8af875bce2 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -32,6 +32,7 @@ header-y += xt_owner.h | |||
32 | header-y += xt_pkttype.h | 32 | header-y += xt_pkttype.h |
33 | header-y += xt_rateest.h | 33 | header-y += xt_rateest.h |
34 | header-y += xt_realm.h | 34 | header-y += xt_realm.h |
35 | header-y += xt_recent.h | ||
35 | header-y += xt_sctp.h | 36 | header-y += xt_sctp.h |
36 | header-y += xt_state.h | 37 | header-y += xt_state.h |
37 | header-y += xt_statistic.h | 38 | header-y += xt_statistic.h |
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index 535e4219d2bb..2a10efda17fb 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h | |||
@@ -87,7 +87,7 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | |||
87 | /* delete keymap entries */ | 87 | /* delete keymap entries */ |
88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); | 88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); |
89 | 89 | ||
90 | extern void nf_ct_gre_keymap_flush(void); | 90 | extern void nf_ct_gre_keymap_flush(struct net *net); |
91 | extern void nf_nat_need_gre(void); | 91 | extern void nf_nat_need_gre(void); |
92 | 92 | ||
93 | #endif /* __KERNEL__ */ | 93 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 0d8424f76899..7d8e0455ccac 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -78,6 +78,9 @@ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | |||
78 | int echo); | 78 | int echo); |
79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
80 | 80 | ||
81 | extern void nfnl_lock(void); | ||
82 | extern void nfnl_unlock(void); | ||
83 | |||
81 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | 84 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ |
82 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | 85 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) |
83 | 86 | ||
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 2326296b6f25..be41b609c88f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -173,6 +173,98 @@ struct xt_counters_info | |||
173 | 173 | ||
174 | #include <linux/netdevice.h> | 174 | #include <linux/netdevice.h> |
175 | 175 | ||
176 | /** | ||
177 | * struct xt_match_param - parameters for match extensions' match functions | ||
178 | * | ||
179 | * @in: input netdevice | ||
180 | * @out: output netdevice | ||
181 | * @match: struct xt_match through which this function was invoked | ||
182 | * @matchinfo: per-match data | ||
183 | * @fragoff: packet is a fragment, this is the data offset | ||
184 | * @thoff: position of transport header relative to skb->data | ||
185 | * @hotdrop: drop packet if we had inspection problems | ||
186 | * @family: Actual NFPROTO_* through which the function is invoked | ||
187 | * (helpful when match->family == NFPROTO_UNSPEC) | ||
188 | */ | ||
189 | struct xt_match_param { | ||
190 | const struct net_device *in, *out; | ||
191 | const struct xt_match *match; | ||
192 | const void *matchinfo; | ||
193 | int fragoff; | ||
194 | unsigned int thoff; | ||
195 | bool *hotdrop; | ||
196 | u_int8_t family; | ||
197 | }; | ||
198 | |||
199 | /** | ||
200 | * struct xt_mtchk_param - parameters for match extensions' | ||
201 | * checkentry functions | ||
202 | * | ||
203 | * @table: table the rule is tried to be inserted into | ||
204 | * @entryinfo: the family-specific rule data | ||
205 | * (struct ipt_ip, ip6t_ip, ebt_entry) | ||
206 | * @match: struct xt_match through which this function was invoked | ||
207 | * @matchinfo: per-match data | ||
208 | * @hook_mask: via which hooks the new rule is reachable | ||
209 | */ | ||
210 | struct xt_mtchk_param { | ||
211 | const char *table; | ||
212 | const void *entryinfo; | ||
213 | const struct xt_match *match; | ||
214 | void *matchinfo; | ||
215 | unsigned int hook_mask; | ||
216 | u_int8_t family; | ||
217 | }; | ||
218 | |||
219 | /* Match destructor parameters */ | ||
220 | struct xt_mtdtor_param { | ||
221 | const struct xt_match *match; | ||
222 | void *matchinfo; | ||
223 | u_int8_t family; | ||
224 | }; | ||
225 | |||
226 | /** | ||
227 | * struct xt_target_param - parameters for target extensions' target functions | ||
228 | * | ||
229 | * @hooknum: hook through which this target was invoked | ||
230 | * @target: struct xt_target through which this function was invoked | ||
231 | * @targinfo: per-target data | ||
232 | * | ||
233 | * Other fields see above. | ||
234 | */ | ||
235 | struct xt_target_param { | ||
236 | const struct net_device *in, *out; | ||
237 | unsigned int hooknum; | ||
238 | const struct xt_target *target; | ||
239 | const void *targinfo; | ||
240 | u_int8_t family; | ||
241 | }; | ||
242 | |||
243 | /** | ||
244 | * struct xt_tgchk_param - parameters for target extensions' | ||
245 | * checkentry functions | ||
246 | * | ||
247 | * @entryinfo: the family-specific rule data | ||
248 | * (struct ipt_entry, ip6t_entry, arpt_entry, ebt_entry) | ||
249 | * | ||
250 | * Other fields see above. | ||
251 | */ | ||
252 | struct xt_tgchk_param { | ||
253 | const char *table; | ||
254 | void *entryinfo; | ||
255 | const struct xt_target *target; | ||
256 | void *targinfo; | ||
257 | unsigned int hook_mask; | ||
258 | u_int8_t family; | ||
259 | }; | ||
260 | |||
261 | /* Target destructor parameters */ | ||
262 | struct xt_tgdtor_param { | ||
263 | const struct xt_target *target; | ||
264 | void *targinfo; | ||
265 | u_int8_t family; | ||
266 | }; | ||
267 | |||
176 | struct xt_match | 268 | struct xt_match |
177 | { | 269 | { |
178 | struct list_head list; | 270 | struct list_head list; |
@@ -185,24 +277,13 @@ struct xt_match | |||
185 | non-linear skb, using skb_header_pointer and | 277 | non-linear skb, using skb_header_pointer and |
186 | skb_ip_make_writable. */ | 278 | skb_ip_make_writable. */ |
187 | bool (*match)(const struct sk_buff *skb, | 279 | bool (*match)(const struct sk_buff *skb, |
188 | const struct net_device *in, | 280 | const struct xt_match_param *); |
189 | const struct net_device *out, | ||
190 | const struct xt_match *match, | ||
191 | const void *matchinfo, | ||
192 | int offset, | ||
193 | unsigned int protoff, | ||
194 | bool *hotdrop); | ||
195 | 281 | ||
196 | /* Called when user tries to insert an entry of this type. */ | 282 | /* Called when user tries to insert an entry of this type. */ |
197 | /* Should return true or false. */ | 283 | bool (*checkentry)(const struct xt_mtchk_param *); |
198 | bool (*checkentry)(const char *tablename, | ||
199 | const void *ip, | ||
200 | const struct xt_match *match, | ||
201 | void *matchinfo, | ||
202 | unsigned int hook_mask); | ||
203 | 284 | ||
204 | /* Called when entry of this type deleted. */ | 285 | /* Called when entry of this type deleted. */ |
205 | void (*destroy)(const struct xt_match *match, void *matchinfo); | 286 | void (*destroy)(const struct xt_mtdtor_param *); |
206 | 287 | ||
207 | /* Called when userspace align differs from kernel space one */ | 288 | /* Called when userspace align differs from kernel space one */ |
208 | void (*compat_from_user)(void *dst, void *src); | 289 | void (*compat_from_user)(void *dst, void *src); |
@@ -235,24 +316,16 @@ struct xt_target | |||
235 | must now handle non-linear skbs, using skb_copy_bits and | 316 | must now handle non-linear skbs, using skb_copy_bits and |
236 | skb_ip_make_writable. */ | 317 | skb_ip_make_writable. */ |
237 | unsigned int (*target)(struct sk_buff *skb, | 318 | unsigned int (*target)(struct sk_buff *skb, |
238 | const struct net_device *in, | 319 | const struct xt_target_param *); |
239 | const struct net_device *out, | ||
240 | unsigned int hooknum, | ||
241 | const struct xt_target *target, | ||
242 | const void *targinfo); | ||
243 | 320 | ||
244 | /* Called when user tries to insert an entry of this type: | 321 | /* Called when user tries to insert an entry of this type: |
245 | hook_mask is a bitmask of hooks from which it can be | 322 | hook_mask is a bitmask of hooks from which it can be |
246 | called. */ | 323 | called. */ |
247 | /* Should return true or false. */ | 324 | /* Should return true or false. */ |
248 | bool (*checkentry)(const char *tablename, | 325 | bool (*checkentry)(const struct xt_tgchk_param *); |
249 | const void *entry, | ||
250 | const struct xt_target *target, | ||
251 | void *targinfo, | ||
252 | unsigned int hook_mask); | ||
253 | 326 | ||
254 | /* Called when entry of this type deleted. */ | 327 | /* Called when entry of this type deleted. */ |
255 | void (*destroy)(const struct xt_target *target, void *targinfo); | 328 | void (*destroy)(const struct xt_tgdtor_param *); |
256 | 329 | ||
257 | /* Called when userspace align differs from kernel space one */ | 330 | /* Called when userspace align differs from kernel space one */ |
258 | void (*compat_from_user)(void *dst, void *src); | 331 | void (*compat_from_user)(void *dst, void *src); |
@@ -292,7 +365,7 @@ struct xt_table | |||
292 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 365 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
293 | struct module *me; | 366 | struct module *me; |
294 | 367 | ||
295 | int af; /* address/protocol family */ | 368 | u_int8_t af; /* address/protocol family */ |
296 | }; | 369 | }; |
297 | 370 | ||
298 | #include <linux/netfilter_ipv4.h> | 371 | #include <linux/netfilter_ipv4.h> |
@@ -328,12 +401,10 @@ extern void xt_unregister_match(struct xt_match *target); | |||
328 | extern int xt_register_matches(struct xt_match *match, unsigned int n); | 401 | extern int xt_register_matches(struct xt_match *match, unsigned int n); |
329 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); | 402 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); |
330 | 403 | ||
331 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 404 | extern int xt_check_match(struct xt_mtchk_param *, |
332 | unsigned int size, const char *table, unsigned int hook, | 405 | unsigned int size, u_int8_t proto, bool inv_proto); |
333 | unsigned short proto, int inv_proto); | 406 | extern int xt_check_target(struct xt_tgchk_param *, |
334 | extern int xt_check_target(const struct xt_target *target, unsigned short family, | 407 | unsigned int size, u_int8_t proto, bool inv_proto); |
335 | unsigned int size, const char *table, unsigned int hook, | ||
336 | unsigned short proto, int inv_proto); | ||
337 | 408 | ||
338 | extern struct xt_table *xt_register_table(struct net *net, | 409 | extern struct xt_table *xt_register_table(struct net *net, |
339 | struct xt_table *table, | 410 | struct xt_table *table, |
@@ -346,19 +417,19 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table, | |||
346 | struct xt_table_info *newinfo, | 417 | struct xt_table_info *newinfo, |
347 | int *error); | 418 | int *error); |
348 | 419 | ||
349 | extern struct xt_match *xt_find_match(int af, const char *name, u8 revision); | 420 | extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); |
350 | extern struct xt_target *xt_find_target(int af, const char *name, u8 revision); | 421 | extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); |
351 | extern struct xt_target *xt_request_find_target(int af, const char *name, | 422 | extern struct xt_target *xt_request_find_target(u8 af, const char *name, |
352 | u8 revision); | 423 | u8 revision); |
353 | extern int xt_find_revision(int af, const char *name, u8 revision, int target, | 424 | extern int xt_find_revision(u8 af, const char *name, u8 revision, |
354 | int *err); | 425 | int target, int *err); |
355 | 426 | ||
356 | extern struct xt_table *xt_find_table_lock(struct net *net, int af, | 427 | extern struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af, |
357 | const char *name); | 428 | const char *name); |
358 | extern void xt_table_unlock(struct xt_table *t); | 429 | extern void xt_table_unlock(struct xt_table *t); |
359 | 430 | ||
360 | extern int xt_proto_init(struct net *net, int af); | 431 | extern int xt_proto_init(struct net *net, u_int8_t af); |
361 | extern void xt_proto_fini(struct net *net, int af); | 432 | extern void xt_proto_fini(struct net *net, u_int8_t af); |
362 | 433 | ||
363 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); | 434 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); |
364 | extern void xt_free_table_info(struct xt_table_info *info); | 435 | extern void xt_free_table_info(struct xt_table_info *info); |
@@ -423,12 +494,12 @@ struct compat_xt_counters_info | |||
423 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | 494 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ |
424 | & ~(__alignof__(struct compat_xt_counters)-1)) | 495 | & ~(__alignof__(struct compat_xt_counters)-1)) |
425 | 496 | ||
426 | extern void xt_compat_lock(int af); | 497 | extern void xt_compat_lock(u_int8_t af); |
427 | extern void xt_compat_unlock(int af); | 498 | extern void xt_compat_unlock(u_int8_t af); |
428 | 499 | ||
429 | extern int xt_compat_add_offset(int af, unsigned int offset, short delta); | 500 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); |
430 | extern void xt_compat_flush_offsets(int af); | 501 | extern void xt_compat_flush_offsets(u_int8_t af); |
431 | extern short xt_compat_calc_jump(int af, unsigned int offset); | 502 | extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); |
432 | 503 | ||
433 | extern int xt_compat_match_offset(const struct xt_match *match); | 504 | extern int xt_compat_match_offset(const struct xt_match *match); |
434 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 505 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h new file mode 100644 index 000000000000..152e8f97132b --- /dev/null +++ b/include/linux/netfilter/xt_TPROXY.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _XT_TPROXY_H_target | ||
2 | #define _XT_TPROXY_H_target | ||
3 | |||
4 | /* TPROXY target is capable of marking the packet to perform | ||
5 | * redirection. We can get rid of that whenever we get support for | ||
6 | * mutliple targets in the same rule. */ | ||
7 | struct xt_tproxy_target_info { | ||
8 | u_int32_t mark_mask; | ||
9 | u_int32_t mark_value; | ||
10 | __be32 laddr; | ||
11 | __be16 lport; | ||
12 | }; | ||
13 | |||
14 | #endif /* _XT_TPROXY_H_target */ | ||
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h new file mode 100644 index 000000000000..5cfeb81c6794 --- /dev/null +++ b/include/linux/netfilter/xt_recent.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _LINUX_NETFILTER_XT_RECENT_H | ||
2 | #define _LINUX_NETFILTER_XT_RECENT_H 1 | ||
3 | |||
4 | enum { | ||
5 | XT_RECENT_CHECK = 1 << 0, | ||
6 | XT_RECENT_SET = 1 << 1, | ||
7 | XT_RECENT_UPDATE = 1 << 2, | ||
8 | XT_RECENT_REMOVE = 1 << 3, | ||
9 | XT_RECENT_TTL = 1 << 4, | ||
10 | |||
11 | XT_RECENT_SOURCE = 0, | ||
12 | XT_RECENT_DEST = 1, | ||
13 | |||
14 | XT_RECENT_NAME_LEN = 200, | ||
15 | }; | ||
16 | |||
17 | struct xt_recent_mtinfo { | ||
18 | u_int32_t seconds; | ||
19 | u_int32_t hit_count; | ||
20 | u_int8_t check_set; | ||
21 | u_int8_t invert; | ||
22 | char name[XT_RECENT_NAME_LEN]; | ||
23 | u_int8_t side; | ||
24 | }; | ||
25 | |||
26 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ | ||
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index 892f5b7771c7..d45e29cd1cfb 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -31,6 +31,9 @@ | |||
31 | * The 4 lsb are more than enough to store the verdict. */ | 31 | * The 4 lsb are more than enough to store the verdict. */ |
32 | #define EBT_VERDICT_BITS 0x0000000F | 32 | #define EBT_VERDICT_BITS 0x0000000F |
33 | 33 | ||
34 | struct xt_match; | ||
35 | struct xt_target; | ||
36 | |||
34 | struct ebt_counter | 37 | struct ebt_counter |
35 | { | 38 | { |
36 | uint64_t pcnt; | 39 | uint64_t pcnt; |
@@ -121,7 +124,7 @@ struct ebt_entry_match | |||
121 | { | 124 | { |
122 | union { | 125 | union { |
123 | char name[EBT_FUNCTION_MAXNAMELEN]; | 126 | char name[EBT_FUNCTION_MAXNAMELEN]; |
124 | struct ebt_match *match; | 127 | struct xt_match *match; |
125 | } u; | 128 | } u; |
126 | /* size of data */ | 129 | /* size of data */ |
127 | unsigned int match_size; | 130 | unsigned int match_size; |
@@ -132,7 +135,7 @@ struct ebt_entry_watcher | |||
132 | { | 135 | { |
133 | union { | 136 | union { |
134 | char name[EBT_FUNCTION_MAXNAMELEN]; | 137 | char name[EBT_FUNCTION_MAXNAMELEN]; |
135 | struct ebt_watcher *watcher; | 138 | struct xt_target *watcher; |
136 | } u; | 139 | } u; |
137 | /* size of data */ | 140 | /* size of data */ |
138 | unsigned int watcher_size; | 141 | unsigned int watcher_size; |
@@ -143,7 +146,7 @@ struct ebt_entry_target | |||
143 | { | 146 | { |
144 | union { | 147 | union { |
145 | char name[EBT_FUNCTION_MAXNAMELEN]; | 148 | char name[EBT_FUNCTION_MAXNAMELEN]; |
146 | struct ebt_target *target; | 149 | struct xt_target *target; |
147 | } u; | 150 | } u; |
148 | /* size of data */ | 151 | /* size of data */ |
149 | unsigned int target_size; | 152 | unsigned int target_size; |
@@ -207,14 +210,17 @@ struct ebt_match | |||
207 | { | 210 | { |
208 | struct list_head list; | 211 | struct list_head list; |
209 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 212 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
210 | /* 0 == it matches */ | 213 | bool (*match)(const struct sk_buff *skb, const struct net_device *in, |
211 | int (*match)(const struct sk_buff *skb, const struct net_device *in, | 214 | const struct net_device *out, const struct xt_match *match, |
212 | const struct net_device *out, const void *matchdata, | 215 | const void *matchinfo, int offset, unsigned int protoff, |
213 | unsigned int datalen); | 216 | bool *hotdrop); |
214 | /* 0 == let it in */ | 217 | bool (*checkentry)(const char *table, const void *entry, |
215 | int (*check)(const char *tablename, unsigned int hookmask, | 218 | const struct xt_match *match, void *matchinfo, |
216 | const struct ebt_entry *e, void *matchdata, unsigned int datalen); | 219 | unsigned int hook_mask); |
217 | void (*destroy)(void *matchdata, unsigned int datalen); | 220 | void (*destroy)(const struct xt_match *match, void *matchinfo); |
221 | unsigned int matchsize; | ||
222 | u_int8_t revision; | ||
223 | u_int8_t family; | ||
218 | struct module *me; | 224 | struct module *me; |
219 | }; | 225 | }; |
220 | 226 | ||
@@ -222,13 +228,17 @@ struct ebt_watcher | |||
222 | { | 228 | { |
223 | struct list_head list; | 229 | struct list_head list; |
224 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 230 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
225 | void (*watcher)(const struct sk_buff *skb, unsigned int hooknr, | 231 | unsigned int (*target)(struct sk_buff *skb, |
226 | const struct net_device *in, const struct net_device *out, | 232 | const struct net_device *in, const struct net_device *out, |
227 | const void *watcherdata, unsigned int datalen); | 233 | unsigned int hook_num, const struct xt_target *target, |
228 | /* 0 == let it in */ | 234 | const void *targinfo); |
229 | int (*check)(const char *tablename, unsigned int hookmask, | 235 | bool (*checkentry)(const char *table, const void *entry, |
230 | const struct ebt_entry *e, void *watcherdata, unsigned int datalen); | 236 | const struct xt_target *target, void *targinfo, |
231 | void (*destroy)(void *watcherdata, unsigned int datalen); | 237 | unsigned int hook_mask); |
238 | void (*destroy)(const struct xt_target *target, void *targinfo); | ||
239 | unsigned int targetsize; | ||
240 | u_int8_t revision; | ||
241 | u_int8_t family; | ||
232 | struct module *me; | 242 | struct module *me; |
233 | }; | 243 | }; |
234 | 244 | ||
@@ -236,14 +246,18 @@ struct ebt_target | |||
236 | { | 246 | { |
237 | struct list_head list; | 247 | struct list_head list; |
238 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 248 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
239 | /* returns one of the standard verdicts */ | 249 | /* returns one of the standard EBT_* verdicts */ |
240 | int (*target)(struct sk_buff *skb, unsigned int hooknr, | 250 | unsigned int (*target)(struct sk_buff *skb, |
241 | const struct net_device *in, const struct net_device *out, | 251 | const struct net_device *in, const struct net_device *out, |
242 | const void *targetdata, unsigned int datalen); | 252 | unsigned int hook_num, const struct xt_target *target, |
243 | /* 0 == let it in */ | 253 | const void *targinfo); |
244 | int (*check)(const char *tablename, unsigned int hookmask, | 254 | bool (*checkentry)(const char *table, const void *entry, |
245 | const struct ebt_entry *e, void *targetdata, unsigned int datalen); | 255 | const struct xt_target *target, void *targinfo, |
246 | void (*destroy)(void *targetdata, unsigned int datalen); | 256 | unsigned int hook_mask); |
257 | void (*destroy)(const struct xt_target *target, void *targinfo); | ||
258 | unsigned int targetsize; | ||
259 | u_int8_t revision; | ||
260 | u_int8_t family; | ||
247 | struct module *me; | 261 | struct module *me; |
248 | }; | 262 | }; |
249 | 263 | ||
@@ -288,12 +302,6 @@ struct ebt_table | |||
288 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
289 | extern int ebt_register_table(struct ebt_table *table); | 303 | extern int ebt_register_table(struct ebt_table *table); |
290 | extern void ebt_unregister_table(struct ebt_table *table); | 304 | extern void ebt_unregister_table(struct ebt_table *table); |
291 | extern int ebt_register_match(struct ebt_match *match); | ||
292 | extern void ebt_unregister_match(struct ebt_match *match); | ||
293 | extern int ebt_register_watcher(struct ebt_watcher *watcher); | ||
294 | extern void ebt_unregister_watcher(struct ebt_watcher *watcher); | ||
295 | extern int ebt_register_target(struct ebt_target *target); | ||
296 | extern void ebt_unregister_target(struct ebt_target *target); | ||
297 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 305 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
298 | const struct net_device *in, const struct net_device *out, | 306 | const struct net_device *in, const struct net_device *out, |
299 | struct ebt_table *table); | 307 | struct ebt_table *table); |
@@ -302,9 +310,9 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | |||
302 | #define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) | 310 | #define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) |
303 | /* True if the hook mask denotes that the rule is in a base chain, | 311 | /* True if the hook mask denotes that the rule is in a base chain, |
304 | * used in the check() functions */ | 312 | * used in the check() functions */ |
305 | #define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS)) | 313 | #define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS)) |
306 | /* Clear the bit in the hook mask that tells if the rule is on a base chain */ | 314 | /* Clear the bit in the hook mask that tells if the rule is on a base chain */ |
307 | #define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS)) | 315 | #define CLEAR_BASE_CHAIN_BIT (par->hook_mask &= ~(1 << NF_BR_NUMHOOKS)) |
308 | /* True if the target is not a standard target */ | 316 | /* True if the target is not a standard target */ |
309 | #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) | 317 | #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) |
310 | 318 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h index 6508a4592651..d636cca133c2 100644 --- a/include/linux/netfilter_ipv4/ipt_recent.h +++ b/include/linux/netfilter_ipv4/ipt_recent.h | |||
@@ -1,27 +1,21 @@ | |||
1 | #ifndef _IPT_RECENT_H | 1 | #ifndef _IPT_RECENT_H |
2 | #define _IPT_RECENT_H | 2 | #define _IPT_RECENT_H |
3 | 3 | ||
4 | #define RECENT_NAME "ipt_recent" | 4 | #include <linux/netfilter/xt_recent.h> |
5 | #define RECENT_VER "v0.3.1" | ||
6 | 5 | ||
7 | #define IPT_RECENT_CHECK 1 | 6 | #define ipt_recent_info xt_recent_mtinfo |
8 | #define IPT_RECENT_SET 2 | ||
9 | #define IPT_RECENT_UPDATE 4 | ||
10 | #define IPT_RECENT_REMOVE 8 | ||
11 | #define IPT_RECENT_TTL 16 | ||
12 | 7 | ||
13 | #define IPT_RECENT_SOURCE 0 | 8 | enum { |
14 | #define IPT_RECENT_DEST 1 | 9 | IPT_RECENT_CHECK = XT_RECENT_CHECK, |
10 | IPT_RECENT_SET = XT_RECENT_SET, | ||
11 | IPT_RECENT_UPDATE = XT_RECENT_UPDATE, | ||
12 | IPT_RECENT_REMOVE = XT_RECENT_REMOVE, | ||
13 | IPT_RECENT_TTL = XT_RECENT_TTL, | ||
15 | 14 | ||
16 | #define IPT_RECENT_NAME_LEN 200 | 15 | IPT_RECENT_SOURCE = XT_RECENT_SOURCE, |
16 | IPT_RECENT_DEST = XT_RECENT_DEST, | ||
17 | 17 | ||
18 | struct ipt_recent_info { | 18 | IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN, |
19 | u_int32_t seconds; | ||
20 | u_int32_t hit_count; | ||
21 | u_int8_t check_set; | ||
22 | u_int8_t invert; | ||
23 | char name[IPT_RECENT_NAME_LEN]; | ||
24 | u_int8_t side; | ||
25 | }; | 19 | }; |
26 | 20 | ||
27 | #endif /*_IPT_RECENT_H*/ | 21 | #endif /*_IPT_RECENT_H*/ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 78a5922a2f11..ac8d0233b05c 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -137,7 +137,7 @@ struct nfs_inode { | |||
137 | unsigned long attrtimeo_timestamp; | 137 | unsigned long attrtimeo_timestamp; |
138 | __u64 change_attr; /* v4 only */ | 138 | __u64 change_attr; /* v4 only */ |
139 | 139 | ||
140 | unsigned long last_updated; | 140 | unsigned long attr_gencount; |
141 | /* "Generation counter" for the attribute cache. This is | 141 | /* "Generation counter" for the attribute cache. This is |
142 | * bumped whenever we update the metadata on the | 142 | * bumped whenever we update the metadata on the |
143 | * server. | 143 | * server. |
@@ -200,11 +200,10 @@ struct nfs_inode { | |||
200 | /* | 200 | /* |
201 | * Bit offsets in flags field | 201 | * Bit offsets in flags field |
202 | */ | 202 | */ |
203 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ | 203 | #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ |
204 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | 204 | #define NFS_INO_STALE (1) /* possible stale inode */ |
205 | #define NFS_INO_STALE (2) /* possible stale inode */ | 205 | #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ |
206 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ | 206 | #define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */ |
207 | #define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */ | ||
208 | 207 | ||
209 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 208 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
210 | { | 209 | { |
@@ -345,15 +344,11 @@ extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ct | |||
345 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 344 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
346 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 345 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
347 | extern u64 nfs_compat_user_ino64(u64 fileid); | 346 | extern u64 nfs_compat_user_ino64(u64 fileid); |
347 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | ||
348 | 348 | ||
349 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 349 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
350 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ | 350 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
351 | 351 | extern unsigned long nfs_inc_attr_generation_counter(void); | |
352 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) | ||
353 | { | ||
354 | fattr->valid = 0; | ||
355 | fattr->time_start = jiffies; | ||
356 | } | ||
357 | 352 | ||
358 | /* | 353 | /* |
359 | * linux/fs/nfs/file.c | 354 | * linux/fs/nfs/file.c |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index c9beacd16c00..4e477ae58699 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -119,7 +119,6 @@ struct nfs_server { | |||
119 | void (*destroy)(struct nfs_server *); | 119 | void (*destroy)(struct nfs_server *); |
120 | 120 | ||
121 | atomic_t active; /* Keep trace of any activity to this server */ | 121 | atomic_t active; /* Keep trace of any activity to this server */ |
122 | wait_queue_head_t active_wq; /* Wait for any activity to stop */ | ||
123 | 122 | ||
124 | /* mountd-related mount options */ | 123 | /* mountd-related mount options */ |
125 | struct sockaddr_storage mountd_address; | 124 | struct sockaddr_storage mountd_address; |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index df7c6b7a7ebb..6549a06ac16e 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -65,4 +65,8 @@ struct nfs_mount_data { | |||
65 | #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ | 65 | #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ |
66 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 66 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
67 | 67 | ||
68 | /* The following are for internal use only */ | ||
69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 | ||
70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 | ||
71 | |||
68 | #endif | 72 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 8c77c11224d1..c1c31acb8a2b 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -36,6 +36,7 @@ struct nfs_fattr { | |||
36 | __u32 nlink; | 36 | __u32 nlink; |
37 | __u32 uid; | 37 | __u32 uid; |
38 | __u32 gid; | 38 | __u32 gid; |
39 | dev_t rdev; | ||
39 | __u64 size; | 40 | __u64 size; |
40 | union { | 41 | union { |
41 | struct { | 42 | struct { |
@@ -46,7 +47,6 @@ struct nfs_fattr { | |||
46 | __u64 used; | 47 | __u64 used; |
47 | } nfs3; | 48 | } nfs3; |
48 | } du; | 49 | } du; |
49 | dev_t rdev; | ||
50 | struct nfs_fsid fsid; | 50 | struct nfs_fsid fsid; |
51 | __u64 fileid; | 51 | __u64 fileid; |
52 | struct timespec atime; | 52 | struct timespec atime; |
@@ -56,6 +56,7 @@ struct nfs_fattr { | |||
56 | __u64 change_attr; /* NFSv4 change attribute */ | 56 | __u64 change_attr; /* NFSv4 change attribute */ |
57 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ | 57 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
58 | unsigned long time_start; | 58 | unsigned long time_start; |
59 | unsigned long gencount; | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 62 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
@@ -672,16 +673,16 @@ struct nfs4_rename_res { | |||
672 | struct nfs_fattr * new_fattr; | 673 | struct nfs_fattr * new_fattr; |
673 | }; | 674 | }; |
674 | 675 | ||
675 | #define NFS4_SETCLIENTID_NAMELEN (56) | 676 | #define NFS4_SETCLIENTID_NAMELEN (127) |
676 | struct nfs4_setclientid { | 677 | struct nfs4_setclientid { |
677 | const nfs4_verifier * sc_verifier; | 678 | const nfs4_verifier * sc_verifier; |
678 | unsigned int sc_name_len; | 679 | unsigned int sc_name_len; |
679 | char sc_name[NFS4_SETCLIENTID_NAMELEN]; | 680 | char sc_name[NFS4_SETCLIENTID_NAMELEN + 1]; |
680 | u32 sc_prog; | 681 | u32 sc_prog; |
681 | unsigned int sc_netid_len; | 682 | unsigned int sc_netid_len; |
682 | char sc_netid[RPCBIND_MAXNETIDLEN]; | 683 | char sc_netid[RPCBIND_MAXNETIDLEN + 1]; |
683 | unsigned int sc_uaddr_len; | 684 | unsigned int sc_uaddr_len; |
684 | char sc_uaddr[RPCBIND_MAXUADDRLEN]; | 685 | char sc_uaddr[RPCBIND_MAXUADDRLEN + 1]; |
685 | u32 sc_cb_ident; | 686 | u32 sc_cb_ident; |
686 | }; | 687 | }; |
687 | 688 | ||
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 108f47e5fd95..21269405ffe2 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define NFSD_MAY_LOCK 32 | 38 | #define NFSD_MAY_LOCK 32 |
39 | #define NFSD_MAY_OWNER_OVERRIDE 64 | 39 | #define NFSD_MAY_OWNER_OVERRIDE 64 |
40 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ | 40 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ |
41 | #define NFSD_MAY_BYPASS_GSS_ON_ROOT 256 | ||
41 | 42 | ||
42 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) | 43 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) |
43 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) | 44 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) |
@@ -125,7 +126,7 @@ int nfsd_truncate(struct svc_rqst *, struct svc_fh *, | |||
125 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, | 126 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, |
126 | loff_t *, struct readdir_cd *, filldir_t); | 127 | loff_t *, struct readdir_cd *, filldir_t); |
127 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | 128 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, |
128 | struct kstatfs *); | 129 | struct kstatfs *, int access); |
129 | 130 | ||
130 | int nfsd_notify_change(struct inode *, struct iattr *); | 131 | int nfsd_notify_change(struct inode *, struct iattr *); |
131 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, | 132 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 2be7c63bc0f2..9bad65400fba 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -89,6 +89,22 @@ | |||
89 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC | 89 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC |
90 | * or, if no MAC address given, all mesh paths, on the interface identified | 90 | * or, if no MAC address given, all mesh paths, on the interface identified |
91 | * by %NL80211_ATTR_IFINDEX. | 91 | * by %NL80211_ATTR_IFINDEX. |
92 | * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by | ||
93 | * %NL80211_ATTR_IFINDEX. | ||
94 | * | ||
95 | * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command | ||
96 | * after being queried by the kernel. CRDA replies by sending a regulatory | ||
97 | * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our | ||
98 | * current alpha2 if it found a match. It also provides | ||
99 | * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each | ||
100 | * regulatory rule is a nested set of attributes given by | ||
101 | * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and | ||
102 | * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by | ||
103 | * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and | ||
104 | * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. | ||
105 | * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain | ||
106 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will | ||
107 | * store this as a valid request and then query userspace for it. | ||
92 | * | 108 | * |
93 | * @NL80211_CMD_MAX: highest used command number | 109 | * @NL80211_CMD_MAX: highest used command number |
94 | * @__NL80211_CMD_AFTER_LAST: internal use | 110 | * @__NL80211_CMD_AFTER_LAST: internal use |
@@ -127,13 +143,23 @@ enum nl80211_commands { | |||
127 | NL80211_CMD_NEW_MPATH, | 143 | NL80211_CMD_NEW_MPATH, |
128 | NL80211_CMD_DEL_MPATH, | 144 | NL80211_CMD_DEL_MPATH, |
129 | 145 | ||
130 | /* add commands here */ | 146 | NL80211_CMD_SET_BSS, |
147 | |||
148 | NL80211_CMD_SET_REG, | ||
149 | NL80211_CMD_REQ_SET_REG, | ||
150 | |||
151 | /* add new commands above here */ | ||
131 | 152 | ||
132 | /* used to define NL80211_CMD_MAX below */ | 153 | /* used to define NL80211_CMD_MAX below */ |
133 | __NL80211_CMD_AFTER_LAST, | 154 | __NL80211_CMD_AFTER_LAST, |
134 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 | 155 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 |
135 | }; | 156 | }; |
136 | 157 | ||
158 | /* | ||
159 | * Allow user space programs to use #ifdef on new commands by defining them | ||
160 | * here | ||
161 | */ | ||
162 | #define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS | ||
137 | 163 | ||
138 | /** | 164 | /** |
139 | * enum nl80211_attrs - nl80211 netlink attributes | 165 | * enum nl80211_attrs - nl80211 netlink attributes |
@@ -188,10 +214,34 @@ enum nl80211_commands { | |||
188 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at | 214 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at |
189 | * &enum nl80211_mpath_info. | 215 | * &enum nl80211_mpath_info. |
190 | * | 216 | * |
191 | * | ||
192 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of | 217 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of |
193 | * &enum nl80211_mntr_flags. | 218 | * &enum nl80211_mntr_flags. |
194 | * | 219 | * |
220 | * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the | ||
221 | * current regulatory domain should be set to or is already set to. | ||
222 | * For example, 'CR', for Costa Rica. This attribute is used by the kernel | ||
223 | * to query the CRDA to retrieve one regulatory domain. This attribute can | ||
224 | * also be used by userspace to query the kernel for the currently set | ||
225 | * regulatory domain. We chose an alpha2 as that is also used by the | ||
226 | * IEEE-802.11d country information element to identify a country. | ||
227 | * Users can also simply ask the wireless core to set regulatory domain | ||
228 | * to a specific alpha2. | ||
229 | * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory | ||
230 | * rules. | ||
231 | * | ||
232 | * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1) | ||
233 | * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled | ||
234 | * (u8, 0 or 1) | ||
235 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled | ||
236 | * (u8, 0 or 1) | ||
237 | * | ||
238 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from | ||
239 | * association request when used with NL80211_CMD_NEW_STATION) | ||
240 | * | ||
241 | * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all | ||
242 | * supported interface types, each a flag attribute with the number | ||
243 | * of the interface mode. | ||
244 | * | ||
195 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 245 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
196 | * @__NL80211_ATTR_AFTER_LAST: internal use | 246 | * @__NL80211_ATTR_AFTER_LAST: internal use |
197 | */ | 247 | */ |
@@ -235,16 +285,35 @@ enum nl80211_attrs { | |||
235 | NL80211_ATTR_MPATH_NEXT_HOP, | 285 | NL80211_ATTR_MPATH_NEXT_HOP, |
236 | NL80211_ATTR_MPATH_INFO, | 286 | NL80211_ATTR_MPATH_INFO, |
237 | 287 | ||
288 | NL80211_ATTR_BSS_CTS_PROT, | ||
289 | NL80211_ATTR_BSS_SHORT_PREAMBLE, | ||
290 | NL80211_ATTR_BSS_SHORT_SLOT_TIME, | ||
291 | |||
292 | NL80211_ATTR_HT_CAPABILITY, | ||
293 | |||
294 | NL80211_ATTR_SUPPORTED_IFTYPES, | ||
295 | |||
296 | NL80211_ATTR_REG_ALPHA2, | ||
297 | NL80211_ATTR_REG_RULES, | ||
298 | |||
238 | /* add attributes here, update the policy in nl80211.c */ | 299 | /* add attributes here, update the policy in nl80211.c */ |
239 | 300 | ||
240 | __NL80211_ATTR_AFTER_LAST, | 301 | __NL80211_ATTR_AFTER_LAST, |
241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 302 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
242 | }; | 303 | }; |
243 | 304 | ||
305 | /* | ||
306 | * Allow user space programs to use #ifdef on new attributes by defining them | ||
307 | * here | ||
308 | */ | ||
309 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | ||
310 | |||
244 | #define NL80211_MAX_SUPP_RATES 32 | 311 | #define NL80211_MAX_SUPP_RATES 32 |
312 | #define NL80211_MAX_SUPP_REG_RULES 32 | ||
245 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 | 313 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 |
246 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 314 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
247 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 315 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
316 | #define NL80211_HT_CAPABILITY_LEN 26 | ||
248 | 317 | ||
249 | /** | 318 | /** |
250 | * enum nl80211_iftype - (virtual) interface types | 319 | * enum nl80211_iftype - (virtual) interface types |
@@ -436,6 +505,66 @@ enum nl80211_bitrate_attr { | |||
436 | }; | 505 | }; |
437 | 506 | ||
438 | /** | 507 | /** |
508 | * enum nl80211_reg_rule_attr - regulatory rule attributes | ||
509 | * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional | ||
510 | * considerations for a given frequency range. These are the | ||
511 | * &enum nl80211_reg_rule_flags. | ||
512 | * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory | ||
513 | * rule in KHz. This is not a center of frequency but an actual regulatory | ||
514 | * band edge. | ||
515 | * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule | ||
516 | * in KHz. This is not a center a frequency but an actual regulatory | ||
517 | * band edge. | ||
518 | * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this | ||
519 | * frequency range, in KHz. | ||
520 | * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain | ||
521 | * for a given frequency range. The value is in mBi (100 * dBi). | ||
522 | * If you don't have one then don't send this. | ||
523 | * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for | ||
524 | * a given frequency range. The value is in mBm (100 * dBm). | ||
525 | */ | ||
526 | enum nl80211_reg_rule_attr { | ||
527 | __NL80211_REG_RULE_ATTR_INVALID, | ||
528 | NL80211_ATTR_REG_RULE_FLAGS, | ||
529 | |||
530 | NL80211_ATTR_FREQ_RANGE_START, | ||
531 | NL80211_ATTR_FREQ_RANGE_END, | ||
532 | NL80211_ATTR_FREQ_RANGE_MAX_BW, | ||
533 | |||
534 | NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, | ||
535 | NL80211_ATTR_POWER_RULE_MAX_EIRP, | ||
536 | |||
537 | /* keep last */ | ||
538 | __NL80211_REG_RULE_ATTR_AFTER_LAST, | ||
539 | NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1 | ||
540 | }; | ||
541 | |||
542 | /** | ||
543 | * enum nl80211_reg_rule_flags - regulatory rule flags | ||
544 | * | ||
545 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed | ||
546 | * @NL80211_RRF_NO_CCK: CCK modulation not allowed | ||
547 | * @NL80211_RRF_NO_INDOOR: indoor operation not allowed | ||
548 | * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed | ||
549 | * @NL80211_RRF_DFS: DFS support is required to be used | ||
550 | * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links | ||
551 | * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links | ||
552 | * @NL80211_RRF_PASSIVE_SCAN: passive scan is required | ||
553 | * @NL80211_RRF_NO_IBSS: no IBSS is allowed | ||
554 | */ | ||
555 | enum nl80211_reg_rule_flags { | ||
556 | NL80211_RRF_NO_OFDM = 1<<0, | ||
557 | NL80211_RRF_NO_CCK = 1<<1, | ||
558 | NL80211_RRF_NO_INDOOR = 1<<2, | ||
559 | NL80211_RRF_NO_OUTDOOR = 1<<3, | ||
560 | NL80211_RRF_DFS = 1<<4, | ||
561 | NL80211_RRF_PTP_ONLY = 1<<5, | ||
562 | NL80211_RRF_PTMP_ONLY = 1<<6, | ||
563 | NL80211_RRF_PASSIVE_SCAN = 1<<7, | ||
564 | NL80211_RRF_NO_IBSS = 1<<8, | ||
565 | }; | ||
566 | |||
567 | /** | ||
439 | * enum nl80211_mntr_flags - monitor configuration flags | 568 | * enum nl80211_mntr_flags - monitor configuration flags |
440 | * | 569 | * |
441 | * Monitor configuration flags. | 570 | * Monitor configuration flags. |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index da2698b0fdd1..b86fa2ffca0c 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -213,9 +213,16 @@ static inline int notifier_to_errno(int ret) | |||
213 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | 213 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ |
214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | 214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ |
215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | 215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, |
216 | * not handling interrupts, soon dead */ | 216 | * not handling interrupts, soon dead. |
217 | * Called on the dying cpu, interrupts | ||
218 | * are already disabled. Must not | ||
219 | * sleep, must not fail */ | ||
217 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | 220 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug |
218 | * lock is dropped */ | 221 | * lock is dropped */ |
222 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
223 | * Called on the new cpu, just before | ||
224 | * enabling interrupts. Must not sleep, | ||
225 | * must not fail */ | ||
219 | 226 | ||
220 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend | 227 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend |
221 | * operation in progress | 228 | * operation in progress |
@@ -229,6 +236,7 @@ static inline int notifier_to_errno(int ret) | |||
229 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | 236 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) |
230 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | 237 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) |
231 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | 238 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) |
239 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
232 | 240 | ||
233 | /* Hibernation and suspend events */ | 241 | /* Hibernation and suspend events */ |
234 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | 242 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ |
diff --git a/include/linux/of.h b/include/linux/of.h index 79886ade070f..e2488f5e7cb2 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -71,5 +71,8 @@ extern int of_n_size_cells(struct device_node *np); | |||
71 | extern const struct of_device_id *of_match_node( | 71 | extern const struct of_device_id *of_match_node( |
72 | const struct of_device_id *matches, const struct device_node *node); | 72 | const struct of_device_id *matches, const struct device_node *node); |
73 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 73 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
74 | extern int of_parse_phandles_with_args(struct device_node *np, | ||
75 | const char *list_name, const char *cells_name, int index, | ||
76 | struct device_node **out_node, const void **out_args); | ||
74 | 77 | ||
75 | #endif /* _LINUX_OF_H */ | 78 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 041bb31100f4..bcb8f725427c 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -36,6 +36,8 @@ | |||
36 | #define XEN_ENTER_SWITCH_CODE 10 | 36 | #define XEN_ENTER_SWITCH_CODE 10 |
37 | #define SPU_PROFILING_CODE 11 | 37 | #define SPU_PROFILING_CODE 11 |
38 | #define SPU_CTX_SWITCH_CODE 12 | 38 | #define SPU_CTX_SWITCH_CODE 12 |
39 | #define IBS_FETCH_CODE 13 | ||
40 | #define IBS_OP_CODE 14 | ||
39 | 41 | ||
40 | struct super_block; | 42 | struct super_block; |
41 | struct dentry; | 43 | struct dentry; |
diff --git a/include/linux/parport.h b/include/linux/parport.h index 6a0d7cdb5774..e1f83c5065c5 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */ | ||
2 | |||
3 | /* | 1 | /* |
4 | * Any part of this program may be used in documents licensed under | 2 | * Any part of this program may be used in documents licensed under |
5 | * the GNU Free Documentation License, Version 1.1 or any later version | 3 | * the GNU Free Documentation License, Version 1.1 or any later version |
diff --git a/include/linux/parser.h b/include/linux/parser.h index 7dcd05075756..ea2281e726f6 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
@@ -25,7 +25,7 @@ typedef struct { | |||
25 | char *to; | 25 | char *to; |
26 | } substring_t; | 26 | } substring_t; |
27 | 27 | ||
28 | int match_token(char *, match_table_t table, substring_t args[]); | 28 | int match_token(char *, const match_table_t table, substring_t args[]); |
29 | int match_int(substring_t *, int *result); | 29 | int match_int(substring_t *, int *result); |
30 | int match_octal(substring_t *, int *result); | 30 | int match_octal(substring_t *, int *result); |
31 | int match_hex(substring_t *, int *result); | 31 | int match_hex(substring_t *, int *result); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c0e14008a3c2..98dc6243a706 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void); | |||
534 | #ifdef CONFIG_PCI_LEGACY | 534 | #ifdef CONFIG_PCI_LEGACY |
535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
536 | unsigned int device, | 536 | unsigned int device, |
537 | const struct pci_dev *from); | 537 | struct pci_dev *from); |
538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | 538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, |
539 | unsigned int devfn); | 539 | unsigned int devfn); |
540 | #endif /* CONFIG_PCI_LEGACY */ | 540 | #endif /* CONFIG_PCI_LEGACY */ |
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | |||
550 | struct pci_dev *from); | 550 | struct pci_dev *from); |
551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | 551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, |
552 | unsigned int ss_vendor, unsigned int ss_device, | 552 | unsigned int ss_vendor, unsigned int ss_device, |
553 | const struct pci_dev *from); | 553 | struct pci_dev *from); |
554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); |
556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,) | |||
816 | 816 | ||
817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, | 817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, |
818 | unsigned int device, | 818 | unsigned int device, |
819 | const struct pci_dev *from) | 819 | struct pci_dev *from) |
820 | { | 820 | { |
821 | return NULL; | 821 | return NULL; |
822 | } | 822 | } |
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | |||
838 | unsigned int device, | 838 | unsigned int device, |
839 | unsigned int ss_vendor, | 839 | unsigned int ss_vendor, |
840 | unsigned int ss_device, | 840 | unsigned int ss_device, |
841 | const struct pci_dev *from) | 841 | struct pci_dev *from) |
842 | { | 842 | { |
843 | return NULL; | 843 | return NULL; |
844 | } | 844 | } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f1624b396754..8edddc240e4f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -497,6 +497,16 @@ | |||
497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 | 497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 |
498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 | 498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 |
499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | 499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 |
500 | #define PCI_DEVICE_ID_AMD_10H_NB_HT 0x1200 | ||
501 | #define PCI_DEVICE_ID_AMD_10H_NB_MAP 0x1201 | ||
502 | #define PCI_DEVICE_ID_AMD_10H_NB_DRAM 0x1202 | ||
503 | #define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203 | ||
504 | #define PCI_DEVICE_ID_AMD_10H_NB_LINK 0x1204 | ||
505 | #define PCI_DEVICE_ID_AMD_11H_NB_HT 0x1300 | ||
506 | #define PCI_DEVICE_ID_AMD_11H_NB_MAP 0x1301 | ||
507 | #define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 | ||
508 | #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 | ||
509 | #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 | ||
500 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 510 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
501 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 511 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
502 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 512 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
@@ -577,6 +587,7 @@ | |||
577 | #define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 | 587 | #define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 |
578 | #define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 | 588 | #define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 |
579 | #define PCI_DEVICE_ID_MATROX_G400 0x0525 | 589 | #define PCI_DEVICE_ID_MATROX_G400 0x0525 |
590 | #define PCI_DEVICE_ID_MATROX_G200EV_PCI 0x0530 | ||
580 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 | 591 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 |
581 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 | 592 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 |
582 | 593 | ||
@@ -1411,6 +1422,8 @@ | |||
1411 | #define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 | 1422 | #define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 |
1412 | #define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 | 1423 | #define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 |
1413 | 1424 | ||
1425 | #define PCI_VENDOR_ID_CISCO 0x1137 | ||
1426 | |||
1414 | #define PCI_VENDOR_ID_ZIATECH 0x1138 | 1427 | #define PCI_VENDOR_ID_ZIATECH 0x1138 |
1415 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 | 1428 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 |
1416 | 1429 | ||
@@ -1521,7 +1534,9 @@ | |||
1521 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1534 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
1522 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1535 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
1523 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 | 1536 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 |
1524 | #define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101 | 1537 | #define PCI_DEVICE_ID_MARVELL_88ALP01_NAND 0x4100 |
1538 | #define PCI_DEVICE_ID_MARVELL_88ALP01_SD 0x4101 | ||
1539 | #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 | ||
1525 | 1540 | ||
1526 | #define PCI_VENDOR_ID_V3 0x11b0 | 1541 | #define PCI_VENDOR_ID_V3 0x11b0 |
1527 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1542 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
@@ -2213,6 +2228,7 @@ | |||
2213 | 2228 | ||
2214 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 | 2229 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 |
2215 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 | 2230 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 |
2231 | #define PCI_DEVICE_ID_ATTANSIC_L2 0x2048 | ||
2216 | 2232 | ||
2217 | #define PCI_VENDOR_ID_JMICRON 0x197B | 2233 | #define PCI_VENDOR_ID_JMICRON 0x197B |
2218 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 | 2234 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 |
@@ -2244,6 +2260,16 @@ | |||
2244 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 | 2260 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 |
2245 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 | 2261 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 |
2246 | 2262 | ||
2263 | #define PCI_VENDOR_ID_NETXEN 0x4040 | ||
2264 | #define PCI_DEVICE_ID_NX2031_10GXSR 0x0001 | ||
2265 | #define PCI_DEVICE_ID_NX2031_10GCX4 0x0002 | ||
2266 | #define PCI_DEVICE_ID_NX2031_4GCU 0x0003 | ||
2267 | #define PCI_DEVICE_ID_NX2031_IMEZ 0x0004 | ||
2268 | #define PCI_DEVICE_ID_NX2031_HMEZ 0x0005 | ||
2269 | #define PCI_DEVICE_ID_NX2031_XG_MGMT 0x0024 | ||
2270 | #define PCI_DEVICE_ID_NX2031_XG_MGMT2 0x0025 | ||
2271 | #define PCI_DEVICE_ID_NX3031 0x0100 | ||
2272 | |||
2247 | #define PCI_VENDOR_ID_AKS 0x416c | 2273 | #define PCI_VENDOR_ID_AKS 0x416c |
2248 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 | 2274 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 |
2249 | 2275 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index fac3337547eb..9f2a3751873a 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -23,12 +23,19 @@ | |||
23 | __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ | 23 | __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ |
24 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ | 24 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ |
25 | ____cacheline_aligned_in_smp | 25 | ____cacheline_aligned_in_smp |
26 | |||
27 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
28 | __attribute__((__section__(".data.percpu.page_aligned"))) \ | ||
29 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
26 | #else | 30 | #else |
27 | #define DEFINE_PER_CPU(type, name) \ | 31 | #define DEFINE_PER_CPU(type, name) \ |
28 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | 32 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name |
29 | 33 | ||
30 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ | 34 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ |
31 | DEFINE_PER_CPU(type, name) | 35 | DEFINE_PER_CPU(type, name) |
36 | |||
37 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
38 | DEFINE_PER_CPU(type, name) | ||
32 | #endif | 39 | #endif |
33 | 40 | ||
34 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) | 41 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 208388835357..9007ccdfc112 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -35,7 +35,7 @@ int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); | |||
35 | void percpu_counter_destroy(struct percpu_counter *fbc); | 35 | void percpu_counter_destroy(struct percpu_counter *fbc); |
36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); |
38 | s64 __percpu_counter_sum(struct percpu_counter *fbc, int set); | 38 | s64 __percpu_counter_sum(struct percpu_counter *fbc); |
39 | 39 | ||
40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
41 | { | 41 | { |
@@ -44,19 +44,13 @@ static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | |||
44 | 44 | ||
45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) | 45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) |
46 | { | 46 | { |
47 | s64 ret = __percpu_counter_sum(fbc, 0); | 47 | s64 ret = __percpu_counter_sum(fbc); |
48 | return ret < 0 ? 0 : ret; | 48 | return ret < 0 ? 0 : ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline s64 percpu_counter_sum_and_set(struct percpu_counter *fbc) | ||
52 | { | ||
53 | return __percpu_counter_sum(fbc, 1); | ||
54 | } | ||
55 | |||
56 | |||
57 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) | 51 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) |
58 | { | 52 | { |
59 | return __percpu_counter_sum(fbc, 0); | 53 | return __percpu_counter_sum(fbc); |
60 | } | 54 | } |
61 | 55 | ||
62 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) | 56 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 700725ddcaae..01b262959f2e 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -226,6 +226,15 @@ struct sadb_x_sec_ctx { | |||
226 | } __attribute__((packed)); | 226 | } __attribute__((packed)); |
227 | /* sizeof(struct sadb_sec_ctx) = 8 */ | 227 | /* sizeof(struct sadb_sec_ctx) = 8 */ |
228 | 228 | ||
229 | /* Used by MIGRATE to pass addresses IKE will use to perform | ||
230 | * negotiation with the peer */ | ||
231 | struct sadb_x_kmaddress { | ||
232 | uint16_t sadb_x_kmaddress_len; | ||
233 | uint16_t sadb_x_kmaddress_exttype; | ||
234 | uint32_t sadb_x_kmaddress_reserved; | ||
235 | } __attribute__((packed)); | ||
236 | /* sizeof(struct sadb_x_kmaddress) == 8 */ | ||
237 | |||
229 | /* Message types */ | 238 | /* Message types */ |
230 | #define SADB_RESERVED 0 | 239 | #define SADB_RESERVED 0 |
231 | #define SADB_GETSPI 1 | 240 | #define SADB_GETSPI 1 |
@@ -346,7 +355,9 @@ struct sadb_x_sec_ctx { | |||
346 | #define SADB_X_EXT_NAT_T_DPORT 22 | 355 | #define SADB_X_EXT_NAT_T_DPORT 22 |
347 | #define SADB_X_EXT_NAT_T_OA 23 | 356 | #define SADB_X_EXT_NAT_T_OA 23 |
348 | #define SADB_X_EXT_SEC_CTX 24 | 357 | #define SADB_X_EXT_SEC_CTX 24 |
349 | #define SADB_EXT_MAX 24 | 358 | /* Used with MIGRATE to pass @ to IKE for negotiation */ |
359 | #define SADB_X_EXT_KMADDRESS 25 | ||
360 | #define SADB_EXT_MAX 25 | ||
350 | 361 | ||
351 | /* Identity Extension values */ | 362 | /* Identity Extension values */ |
352 | #define SADB_IDENTTYPE_RESERVED 0 | 363 | #define SADB_IDENTTYPE_RESERVED 0 |
diff --git a/include/linux/pfn.h b/include/linux/pfn.h index bb01f8b92b56..7646637221f3 100644 --- a/include/linux/pfn.h +++ b/include/linux/pfn.h | |||
@@ -1,9 +1,13 @@ | |||
1 | #ifndef _LINUX_PFN_H_ | 1 | #ifndef _LINUX_PFN_H_ |
2 | #define _LINUX_PFN_H_ | 2 | #define _LINUX_PFN_H_ |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | ||
5 | #include <linux/types.h> | ||
6 | #endif | ||
7 | |||
4 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) | 8 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) |
5 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | 9 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) |
6 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | 10 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
7 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) | 11 | #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) |
8 | 12 | ||
9 | #endif | 13 | #endif |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h new file mode 100644 index 000000000000..c9609f9aedac --- /dev/null +++ b/include/linux/phonet.h | |||
@@ -0,0 +1,170 @@ | |||
1 | /** | ||
2 | * file phonet.h | ||
3 | * | ||
4 | * Phonet sockets kernel interface | ||
5 | * | ||
6 | * Copyright (C) 2008 Nokia Corporation. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * 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., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef LINUX_PHONET_H | ||
24 | #define LINUX_PHONET_H | ||
25 | |||
26 | /* Automatic protocol selection */ | ||
27 | #define PN_PROTO_TRANSPORT 0 | ||
28 | /* Phonet datagram socket */ | ||
29 | #define PN_PROTO_PHONET 1 | ||
30 | /* Phonet pipe */ | ||
31 | #define PN_PROTO_PIPE 2 | ||
32 | #define PHONET_NPROTO 3 | ||
33 | |||
34 | /* Socket options for SOL_PNPIPE level */ | ||
35 | #define PNPIPE_ENCAP 1 | ||
36 | #define PNPIPE_IFINDEX 2 | ||
37 | |||
38 | #define PNADDR_ANY 0 | ||
39 | #define PNPORT_RESOURCE_ROUTING 0 | ||
40 | |||
41 | /* Values for PNPIPE_ENCAP option */ | ||
42 | #define PNPIPE_ENCAP_NONE 0 | ||
43 | #define PNPIPE_ENCAP_IP 1 | ||
44 | |||
45 | /* ioctls */ | ||
46 | #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) | ||
47 | |||
48 | /* Phonet protocol header */ | ||
49 | struct phonethdr { | ||
50 | __u8 pn_rdev; | ||
51 | __u8 pn_sdev; | ||
52 | __u8 pn_res; | ||
53 | __be16 pn_length; | ||
54 | __u8 pn_robj; | ||
55 | __u8 pn_sobj; | ||
56 | } __attribute__((packed)); | ||
57 | |||
58 | /* Common Phonet payload header */ | ||
59 | struct phonetmsg { | ||
60 | __u8 pn_trans_id; /* transaction ID */ | ||
61 | __u8 pn_msg_id; /* message type */ | ||
62 | union { | ||
63 | struct { | ||
64 | __u8 pn_submsg_id; /* message subtype */ | ||
65 | __u8 pn_data[5]; | ||
66 | } base; | ||
67 | struct { | ||
68 | __u16 pn_e_res_id; /* extended resource ID */ | ||
69 | __u8 pn_e_submsg_id; /* message subtype */ | ||
70 | __u8 pn_e_data[3]; | ||
71 | } ext; | ||
72 | } pn_msg_u; | ||
73 | }; | ||
74 | #define PN_COMMON_MESSAGE 0xF0 | ||
75 | #define PN_PREFIX 0xE0 /* resource for extended messages */ | ||
76 | #define pn_submsg_id pn_msg_u.base.pn_submsg_id | ||
77 | #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id | ||
78 | #define pn_e_res_id pn_msg_u.ext.pn_e_res_id | ||
79 | #define pn_data pn_msg_u.base.pn_data | ||
80 | #define pn_e_data pn_msg_u.ext.pn_e_data | ||
81 | |||
82 | /* data for unreachable errors */ | ||
83 | #define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01 | ||
84 | #define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14 | ||
85 | #define pn_orig_msg_id pn_data[0] | ||
86 | #define pn_status pn_data[1] | ||
87 | #define pn_e_orig_msg_id pn_e_data[0] | ||
88 | #define pn_e_status pn_e_data[1] | ||
89 | |||
90 | /* Phonet socket address structure */ | ||
91 | struct sockaddr_pn { | ||
92 | sa_family_t spn_family; | ||
93 | __u8 spn_obj; | ||
94 | __u8 spn_dev; | ||
95 | __u8 spn_resource; | ||
96 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | ||
97 | } __attribute__ ((packed)); | ||
98 | |||
99 | static inline __u16 pn_object(__u8 addr, __u16 port) | ||
100 | { | ||
101 | return (addr << 8) | (port & 0x3ff); | ||
102 | } | ||
103 | |||
104 | static inline __u8 pn_obj(__u16 handle) | ||
105 | { | ||
106 | return handle & 0xff; | ||
107 | } | ||
108 | |||
109 | static inline __u8 pn_dev(__u16 handle) | ||
110 | { | ||
111 | return handle >> 8; | ||
112 | } | ||
113 | |||
114 | static inline __u16 pn_port(__u16 handle) | ||
115 | { | ||
116 | return handle & 0x3ff; | ||
117 | } | ||
118 | |||
119 | static inline __u8 pn_addr(__u16 handle) | ||
120 | { | ||
121 | return (handle >> 8) & 0xfc; | ||
122 | } | ||
123 | |||
124 | static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr) | ||
125 | { | ||
126 | spn->spn_dev &= 0x03; | ||
127 | spn->spn_dev |= addr & 0xfc; | ||
128 | } | ||
129 | |||
130 | static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port) | ||
131 | { | ||
132 | spn->spn_dev &= 0xfc; | ||
133 | spn->spn_dev |= (port >> 8) & 0x03; | ||
134 | spn->spn_obj = port & 0xff; | ||
135 | } | ||
136 | |||
137 | static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn, | ||
138 | __u16 handle) | ||
139 | { | ||
140 | spn->spn_dev = pn_dev(handle); | ||
141 | spn->spn_obj = pn_obj(handle); | ||
142 | } | ||
143 | |||
144 | static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn, | ||
145 | __u8 resource) | ||
146 | { | ||
147 | spn->spn_resource = resource; | ||
148 | } | ||
149 | |||
150 | static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn) | ||
151 | { | ||
152 | return spn->spn_dev & 0xfc; | ||
153 | } | ||
154 | |||
155 | static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn) | ||
156 | { | ||
157 | return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj; | ||
158 | } | ||
159 | |||
160 | static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn) | ||
161 | { | ||
162 | return pn_object(spn->spn_dev, spn->spn_obj); | ||
163 | } | ||
164 | |||
165 | static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn) | ||
166 | { | ||
167 | return spn->spn_resource; | ||
168 | } | ||
169 | |||
170 | #endif | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index 7224c4099a28..77c4ed60b982 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -99,7 +99,14 @@ struct mii_bus { | |||
99 | */ | 99 | */ |
100 | struct mutex mdio_lock; | 100 | struct mutex mdio_lock; |
101 | 101 | ||
102 | struct device *dev; | 102 | struct device *parent; |
103 | enum { | ||
104 | MDIOBUS_ALLOCATED = 1, | ||
105 | MDIOBUS_REGISTERED, | ||
106 | MDIOBUS_UNREGISTERED, | ||
107 | MDIOBUS_RELEASED, | ||
108 | } state; | ||
109 | struct device dev; | ||
103 | 110 | ||
104 | /* list of all PHYs on bus */ | 111 | /* list of all PHYs on bus */ |
105 | struct phy_device *phy_map[PHY_MAX_ADDR]; | 112 | struct phy_device *phy_map[PHY_MAX_ADDR]; |
@@ -113,6 +120,16 @@ struct mii_bus { | |||
113 | */ | 120 | */ |
114 | int *irq; | 121 | int *irq; |
115 | }; | 122 | }; |
123 | #define to_mii_bus(d) container_of(d, struct mii_bus, dev) | ||
124 | |||
125 | struct mii_bus *mdiobus_alloc(void); | ||
126 | int mdiobus_register(struct mii_bus *bus); | ||
127 | void mdiobus_unregister(struct mii_bus *bus); | ||
128 | void mdiobus_free(struct mii_bus *bus); | ||
129 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); | ||
130 | int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum); | ||
131 | int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val); | ||
132 | |||
116 | 133 | ||
117 | #define PHY_INTERRUPT_DISABLED 0x0 | 134 | #define PHY_INTERRUPT_DISABLED 0x0 |
118 | #define PHY_INTERRUPT_ENABLED 0x80000000 | 135 | #define PHY_INTERRUPT_ENABLED 0x80000000 |
@@ -391,8 +408,35 @@ struct phy_fixup { | |||
391 | int (*run)(struct phy_device *phydev); | 408 | int (*run)(struct phy_device *phydev); |
392 | }; | 409 | }; |
393 | 410 | ||
394 | int phy_read(struct phy_device *phydev, u16 regnum); | 411 | /** |
395 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); | 412 | * phy_read - Convenience function for reading a given PHY register |
413 | * @phydev: the phy_device struct | ||
414 | * @regnum: register number to read | ||
415 | * | ||
416 | * NOTE: MUST NOT be called from interrupt context, | ||
417 | * because the bus read/write functions may wait for an interrupt | ||
418 | * to conclude the operation. | ||
419 | */ | ||
420 | static inline int phy_read(struct phy_device *phydev, u16 regnum) | ||
421 | { | ||
422 | return mdiobus_read(phydev->bus, phydev->addr, regnum); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * phy_write - Convenience function for writing a given PHY register | ||
427 | * @phydev: the phy_device struct | ||
428 | * @regnum: register number to write | ||
429 | * @val: value to write to @regnum | ||
430 | * | ||
431 | * NOTE: MUST NOT be called from interrupt context, | ||
432 | * because the bus read/write functions may wait for an interrupt | ||
433 | * to conclude the operation. | ||
434 | */ | ||
435 | static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val) | ||
436 | { | ||
437 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | ||
438 | } | ||
439 | |||
396 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | 440 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); |
397 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 441 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
398 | int phy_clear_interrupt(struct phy_device *phydev); | 442 | int phy_clear_interrupt(struct phy_device *phydev); |
@@ -408,8 +452,6 @@ void phy_start(struct phy_device *phydev); | |||
408 | void phy_stop(struct phy_device *phydev); | 452 | void phy_stop(struct phy_device *phydev); |
409 | int phy_start_aneg(struct phy_device *phydev); | 453 | int phy_start_aneg(struct phy_device *phydev); |
410 | 454 | ||
411 | int mdiobus_register(struct mii_bus *bus); | ||
412 | void mdiobus_unregister(struct mii_bus *bus); | ||
413 | void phy_sanitize_settings(struct phy_device *phydev); | 455 | void phy_sanitize_settings(struct phy_device *phydev); |
414 | int phy_stop_interrupts(struct phy_device *phydev); | 456 | int phy_stop_interrupts(struct phy_device *phydev); |
415 | int phy_enable_interrupts(struct phy_device *phydev); | 457 | int phy_enable_interrupts(struct phy_device *phydev); |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 1af82c4e17d4..d82fe825d62f 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -84,12 +84,6 @@ static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) | |||
84 | return tsk->nsproxy->pid_ns; | 84 | return tsk->nsproxy->pid_ns; |
85 | } | 85 | } |
86 | 86 | ||
87 | static inline struct task_struct *task_child_reaper(struct task_struct *tsk) | ||
88 | { | ||
89 | BUG_ON(tsk != current); | ||
90 | return tsk->nsproxy->pid_ns->child_reaper; | ||
91 | } | ||
92 | |||
93 | void pidhash_init(void); | 87 | void pidhash_init(void); |
94 | void pidmap_init(void); | 88 | void pidmap_init(void); |
95 | 89 | ||
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index e5de421ac7b4..5d921fa91a5b 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -123,6 +123,13 @@ struct tc_prio_qopt | |||
123 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ | 123 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | /* MULTIQ section */ | ||
127 | |||
128 | struct tc_multiq_qopt { | ||
129 | __u16 bands; /* Number of bands */ | ||
130 | __u16 max_bands; /* Maximum number of queues */ | ||
131 | }; | ||
132 | |||
126 | /* TBF section */ | 133 | /* TBF section */ |
127 | 134 | ||
128 | struct tc_tbf_qopt | 135 | struct tc_tbf_qopt |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 95ac21ab3a09..4b8cc6a32479 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -37,6 +37,8 @@ extern int platform_add_devices(struct platform_device **, int); | |||
37 | 37 | ||
38 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 38 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
39 | struct resource *, unsigned int); | 39 | struct resource *, unsigned int); |
40 | extern struct platform_device *platform_device_register_data(struct device *, | ||
41 | const char *, int, const void *, size_t); | ||
40 | 42 | ||
41 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 43 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
42 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | 44 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 4dcce54b6d76..42de4003c4ee 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -419,7 +419,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
419 | 419 | ||
420 | #define suspend_report_result(fn, ret) \ | 420 | #define suspend_report_result(fn, ret) \ |
421 | do { \ | 421 | do { \ |
422 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 422 | __suspend_report_result(__func__, fn, ret); \ |
423 | } while (0) | 423 | } while (0) |
424 | 424 | ||
425 | #else /* !CONFIG_PM_SLEEP */ | 425 | #else /* !CONFIG_PM_SLEEP */ |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 1ce54b63085d..53b70fd1d9a5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -21,7 +21,16 @@ struct pnp_dev; | |||
21 | /* | 21 | /* |
22 | * Resource Management | 22 | * Resource Management |
23 | */ | 23 | */ |
24 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); | 24 | #ifdef CONFIG_PNP |
25 | struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type, | ||
26 | unsigned int num); | ||
27 | #else | ||
28 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, | ||
29 | unsigned long type, unsigned int num) | ||
30 | { | ||
31 | return NULL; | ||
32 | } | ||
33 | #endif | ||
25 | 34 | ||
26 | static inline int pnp_resource_valid(struct resource *res) | 35 | static inline int pnp_resource_valid(struct resource *res) |
27 | { | 36 | { |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index fb61850d1cfc..27d534f4470d 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -139,7 +139,6 @@ extern int proc_readdir(struct file *, void *, filldir_t); | |||
139 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); | 139 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); |
140 | 140 | ||
141 | extern const struct file_operations proc_kcore_operations; | 141 | extern const struct file_operations proc_kcore_operations; |
142 | extern const struct file_operations ppc_htab_operations; | ||
143 | 142 | ||
144 | extern int pid_ns_prepare_proc(struct pid_namespace *ns); | 143 | extern int pid_ns_prepare_proc(struct pid_namespace *ns); |
145 | extern void pid_ns_release_proc(struct pid_namespace *ns); | 144 | extern void pid_ns_release_proc(struct pid_namespace *ns); |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 7e7087239af5..570045053ce9 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -35,7 +35,9 @@ enum profile_type { | |||
35 | extern int prof_on __read_mostly; | 35 | extern int prof_on __read_mostly; |
36 | 36 | ||
37 | /* init basic kernel profiler */ | 37 | /* init basic kernel profiler */ |
38 | void __init profile_init(void); | 38 | int profile_init(void); |
39 | int profile_setup(char *str); | ||
40 | int create_proc_profile(void); | ||
39 | void profile_tick(int type); | 41 | void profile_tick(int type); |
40 | 42 | ||
41 | /* | 43 | /* |
@@ -84,9 +86,9 @@ struct pt_regs; | |||
84 | 86 | ||
85 | #define prof_on 0 | 87 | #define prof_on 0 |
86 | 88 | ||
87 | static inline void profile_init(void) | 89 | static inline int profile_init(void) |
88 | { | 90 | { |
89 | return; | 91 | return 0; |
90 | } | 92 | } |
91 | 93 | ||
92 | static inline void profile_tick(int type) | 94 | static inline void profile_tick(int type) |
diff --git a/include/linux/proportions.h b/include/linux/proportions.h index 5afc1b23346d..cf793bbbd05e 100644 --- a/include/linux/proportions.h +++ b/include/linux/proportions.h | |||
@@ -104,8 +104,8 @@ struct prop_local_single { | |||
104 | * snapshot of the last seen global state | 104 | * snapshot of the last seen global state |
105 | * and a lock protecting this state | 105 | * and a lock protecting this state |
106 | */ | 106 | */ |
107 | int shift; | ||
108 | unsigned long period; | 107 | unsigned long period; |
108 | int shift; | ||
109 | spinlock_t lock; /* protect the snapshot state */ | 109 | spinlock_t lock; /* protect the snapshot state */ |
110 | }; | 110 | }; |
111 | 111 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index 376a05048bc5..40401b554484 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -28,8 +28,6 @@ | |||
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | * SUCH DAMAGE. | 30 | * SUCH DAMAGE. |
31 | * | ||
32 | * Version: $Id: quota.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $ | ||
33 | */ | 31 | */ |
34 | 32 | ||
35 | #ifndef _LINUX_QUOTA_ | 33 | #ifndef _LINUX_QUOTA_ |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index ca6b9b5c8d52..a558a4c1d35a 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -3,9 +3,6 @@ | |||
3 | * macros expand to the right source-code. | 3 | * macros expand to the right source-code. |
4 | * | 4 | * |
5 | * Author: Marco van Wieringen <mvw@planets.elm.net> | 5 | * Author: Marco van Wieringen <mvw@planets.elm.net> |
6 | * | ||
7 | * Version: $Id: quotaops.h,v 1.2 1998/01/15 16:22:26 ecd Exp $ | ||
8 | * | ||
9 | */ | 6 | */ |
10 | #ifndef _LINUX_QUOTAOPS_ | 7 | #ifndef _LINUX_QUOTAOPS_ |
11 | #define _LINUX_QUOTAOPS_ | 8 | #define _LINUX_QUOTAOPS_ |
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index 7e375111d007..f38b9c586afb 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h | |||
@@ -5,8 +5,8 @@ | |||
5 | 5 | ||
6 | struct dev_info { | 6 | struct dev_info { |
7 | mdk_rdev_t *rdev; | 7 | mdk_rdev_t *rdev; |
8 | sector_t size; | 8 | sector_t num_sectors; |
9 | sector_t offset; | 9 | sector_t start_sector; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | typedef struct dev_info dev_info_t; | 12 | typedef struct dev_info dev_info_t; |
@@ -15,9 +15,11 @@ struct linear_private_data | |||
15 | { | 15 | { |
16 | struct linear_private_data *prev; /* earlier version */ | 16 | struct linear_private_data *prev; /* earlier version */ |
17 | dev_info_t **hash_table; | 17 | dev_info_t **hash_table; |
18 | sector_t hash_spacing; | 18 | sector_t spacing; |
19 | sector_t array_sectors; | 19 | sector_t array_sectors; |
20 | int preshift; /* shift before dividing by hash_spacing */ | 20 | int sector_shift; /* shift before dividing |
21 | * by spacing | ||
22 | */ | ||
21 | dev_info_t disks[0]; | 23 | dev_info_t disks[0]; |
22 | }; | 24 | }; |
23 | 25 | ||
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index dc0e3fcb9f28..82bea14cae1a 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -19,27 +19,7 @@ | |||
19 | #define _MD_H | 19 | #define _MD_H |
20 | 20 | ||
21 | #include <linux/blkdev.h> | 21 | #include <linux/blkdev.h> |
22 | #include <linux/major.h> | ||
23 | #include <linux/ioctl.h> | ||
24 | #include <linux/types.h> | ||
25 | #include <linux/bitops.h> | ||
26 | #include <linux/module.h> | ||
27 | #include <linux/hdreg.h> | ||
28 | #include <linux/proc_fs.h> | ||
29 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
30 | #include <linux/smp_lock.h> | ||
31 | #include <linux/delay.h> | ||
32 | #include <net/checksum.h> | ||
33 | #include <linux/random.h> | ||
34 | #include <linux/kernel_stat.h> | ||
35 | #include <asm/io.h> | ||
36 | #include <linux/completion.h> | ||
37 | #include <linux/mempool.h> | ||
38 | #include <linux/list.h> | ||
39 | #include <linux/reboot.h> | ||
40 | #include <linux/vmalloc.h> | ||
41 | #include <linux/blkpg.h> | ||
42 | #include <linux/bio.h> | ||
43 | 23 | ||
44 | /* | 24 | /* |
45 | * 'md_p.h' holds the 'physical' layout of RAID devices | 25 | * 'md_p.h' holds the 'physical' layout of RAID devices |
@@ -74,19 +54,17 @@ | |||
74 | 54 | ||
75 | extern int mdp_major; | 55 | extern int mdp_major; |
76 | 56 | ||
77 | extern int register_md_personality (struct mdk_personality *p); | 57 | extern int register_md_personality(struct mdk_personality *p); |
78 | extern int unregister_md_personality (struct mdk_personality *p); | 58 | extern int unregister_md_personality(struct mdk_personality *p); |
79 | extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), | 59 | extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev), |
80 | mddev_t *mddev, const char *name); | 60 | mddev_t *mddev, const char *name); |
81 | extern void md_unregister_thread (mdk_thread_t *thread); | 61 | extern void md_unregister_thread(mdk_thread_t *thread); |
82 | extern void md_wakeup_thread(mdk_thread_t *thread); | 62 | extern void md_wakeup_thread(mdk_thread_t *thread); |
83 | extern void md_check_recovery(mddev_t *mddev); | 63 | extern void md_check_recovery(mddev_t *mddev); |
84 | extern void md_write_start(mddev_t *mddev, struct bio *bi); | 64 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
85 | extern void md_write_end(mddev_t *mddev); | 65 | extern void md_write_end(mddev_t *mddev); |
86 | extern void md_handle_safemode(mddev_t *mddev); | ||
87 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 66 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); |
88 | extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); | 67 | extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev); |
89 | extern void md_unplug_mddev(mddev_t *mddev); | ||
90 | 68 | ||
91 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 69 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, |
92 | sector_t sector, int size, struct page *page); | 70 | sector_t sector, int size, struct page *page); |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index b160fb18e8d6..37aaf2b39863 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -6,6 +6,7 @@ extern int ramfs_get_sb(struct file_system_type *fs_type, | |||
6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); | 6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); |
7 | 7 | ||
8 | #ifndef CONFIG_MMU | 8 | #ifndef CONFIG_MMU |
9 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | ||
9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 10 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
10 | unsigned long addr, | 11 | unsigned long addr, |
11 | unsigned long len, | 12 | unsigned long len, |
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 4ab843622727..5f89b62e6983 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -40,12 +40,21 @@ | |||
40 | #include <linux/cpumask.h> | 40 | #include <linux/cpumask.h> |
41 | #include <linux/seqlock.h> | 41 | #include <linux/seqlock.h> |
42 | 42 | ||
43 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
44 | #define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ) /* for rcp->jiffies_stall */ | ||
45 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */ | ||
46 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
43 | 47 | ||
44 | /* Global control variables for rcupdate callback mechanism. */ | 48 | /* Global control variables for rcupdate callback mechanism. */ |
45 | struct rcu_ctrlblk { | 49 | struct rcu_ctrlblk { |
46 | long cur; /* Current batch number. */ | 50 | long cur; /* Current batch number. */ |
47 | long completed; /* Number of the last completed batch */ | 51 | long completed; /* Number of the last completed batch */ |
48 | int next_pending; /* Is the next batch already waiting? */ | 52 | long pending; /* Number of the last pending batch */ |
53 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
54 | unsigned long gp_start; /* Time at which GP started in jiffies. */ | ||
55 | unsigned long jiffies_stall; | ||
56 | /* Time at which to check for CPU stalls. */ | ||
57 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
49 | 58 | ||
50 | int signaled; | 59 | int signaled; |
51 | 60 | ||
@@ -66,11 +75,7 @@ static inline int rcu_batch_after(long a, long b) | |||
66 | return (a - b) > 0; | 75 | return (a - b) > 0; |
67 | } | 76 | } |
68 | 77 | ||
69 | /* | 78 | /* Per-CPU data for Read-Copy UPdate. */ |
70 | * Per-CPU data for Read-Copy UPdate. | ||
71 | * nxtlist - new callbacks are added here | ||
72 | * curlist - current batch for which quiescent cycle started if any | ||
73 | */ | ||
74 | struct rcu_data { | 79 | struct rcu_data { |
75 | /* 1) quiescent state handling : */ | 80 | /* 1) quiescent state handling : */ |
76 | long quiescbatch; /* Batch # for grace period */ | 81 | long quiescbatch; /* Batch # for grace period */ |
@@ -78,12 +83,24 @@ struct rcu_data { | |||
78 | int qs_pending; /* core waits for quiesc state */ | 83 | int qs_pending; /* core waits for quiesc state */ |
79 | 84 | ||
80 | /* 2) batch handling */ | 85 | /* 2) batch handling */ |
81 | long batch; /* Batch # for current RCU batch */ | 86 | /* |
87 | * if nxtlist is not NULL, then: | ||
88 | * batch: | ||
89 | * The batch # for the last entry of nxtlist | ||
90 | * [*nxttail[1], NULL = *nxttail[2]): | ||
91 | * Entries that batch # <= batch | ||
92 | * [*nxttail[0], *nxttail[1]): | ||
93 | * Entries that batch # <= batch - 1 | ||
94 | * [nxtlist, *nxttail[0]): | ||
95 | * Entries that batch # <= batch - 2 | ||
96 | * The grace period for these entries has completed, and | ||
97 | * the other grace-period-completed entries may be moved | ||
98 | * here temporarily in rcu_process_callbacks(). | ||
99 | */ | ||
100 | long batch; | ||
82 | struct rcu_head *nxtlist; | 101 | struct rcu_head *nxtlist; |
83 | struct rcu_head **nxttail; | 102 | struct rcu_head **nxttail[3]; |
84 | long qlen; /* # of queued callbacks */ | 103 | long qlen; /* # of queued callbacks */ |
85 | struct rcu_head *curlist; | ||
86 | struct rcu_head **curtail; | ||
87 | struct rcu_head *donelist; | 104 | struct rcu_head *donelist; |
88 | struct rcu_head **donetail; | 105 | struct rcu_head **donetail; |
89 | long blimit; /* Upper limit on a processed batch */ | 106 | long blimit; /* Upper limit on a processed batch */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index eb4443c7e05b..e649bd3f2c97 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -198,20 +198,6 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
198 | at->prev = last; | 198 | at->prev = last; |
199 | } | 199 | } |
200 | 200 | ||
201 | /** | ||
202 | * list_for_each_rcu - iterate over an rcu-protected list | ||
203 | * @pos: the &struct list_head to use as a loop cursor. | ||
204 | * @head: the head for your list. | ||
205 | * | ||
206 | * This list-traversal primitive may safely run concurrently with | ||
207 | * the _rcu list-mutation primitives such as list_add_rcu() | ||
208 | * as long as the traversal is guarded by rcu_read_lock(). | ||
209 | */ | ||
210 | #define list_for_each_rcu(pos, head) \ | ||
211 | for (pos = rcu_dereference((head)->next); \ | ||
212 | prefetch(pos->next), pos != (head); \ | ||
213 | pos = rcu_dereference(pos->next)) | ||
214 | |||
215 | #define __list_for_each_rcu(pos, head) \ | 201 | #define __list_for_each_rcu(pos, head) \ |
216 | for (pos = rcu_dereference((head)->next); \ | 202 | for (pos = rcu_dereference((head)->next); \ |
217 | pos != (head); \ | 203 | pos != (head); \ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index e8b4039cfb2f..86f1f5e43e33 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -133,6 +133,26 @@ struct rcu_head { | |||
133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() | 133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section | ||
137 | * | ||
138 | * Should be used with either | ||
139 | * - synchronize_sched() | ||
140 | * or | ||
141 | * - call_rcu_sched() and rcu_barrier_sched() | ||
142 | * on the write-side to insure proper synchronization. | ||
143 | */ | ||
144 | #define rcu_read_lock_sched() preempt_disable() | ||
145 | |||
146 | /* | ||
147 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section | ||
148 | * | ||
149 | * See rcu_read_lock_sched for more information. | ||
150 | */ | ||
151 | #define rcu_read_unlock_sched() preempt_enable() | ||
152 | |||
153 | |||
154 | |||
155 | /** | ||
136 | * rcu_dereference - fetch an RCU-protected pointer in an | 156 | * rcu_dereference - fetch an RCU-protected pointer in an |
137 | * RCU read-side critical section. This pointer may later | 157 | * RCU read-side critical section. This pointer may later |
138 | * be safely dereferenced. | 158 | * be safely dereferenced. |
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 0967f03b0705..3e05c09b54a2 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
@@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu) | |||
57 | rdssp->sched_qs++; | 57 | rdssp->sched_qs++; |
58 | } | 58 | } |
59 | #define rcu_bh_qsctr_inc(cpu) | 59 | #define rcu_bh_qsctr_inc(cpu) |
60 | #define call_rcu_bh(head, rcu) call_rcu(head, rcu) | 60 | |
61 | /* | ||
62 | * Someone might want to pass call_rcu_bh as a function pointer. | ||
63 | * So this needs to just be a rename and not a macro function. | ||
64 | * (no parentheses) | ||
65 | */ | ||
66 | #define call_rcu_bh call_rcu | ||
61 | 67 | ||
62 | /** | 68 | /** |
63 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. | 69 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. |
@@ -111,7 +117,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); | |||
111 | struct softirq_action; | 117 | struct softirq_action; |
112 | 118 | ||
113 | #ifdef CONFIG_NO_HZ | 119 | #ifdef CONFIG_NO_HZ |
114 | DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched); | ||
115 | 120 | ||
116 | static inline void rcu_enter_nohz(void) | 121 | static inline void rcu_enter_nohz(void) |
117 | { | 122 | { |
@@ -126,8 +131,8 @@ static inline void rcu_exit_nohz(void) | |||
126 | { | 131 | { |
127 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | 132 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); |
128 | 133 | ||
129 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | ||
130 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | 134 | __get_cpu_var(rcu_dyntick_sched).dynticks++; |
135 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | ||
131 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), | 136 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), |
132 | &rs); | 137 | &rs); |
133 | } | 138 | } |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 1d712c7172a2..e37d80561985 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
20 | 20 | ||
21 | struct regulator_constraints; | ||
22 | struct regulator_dev; | 21 | struct regulator_dev; |
22 | struct regulator_init_data; | ||
23 | 23 | ||
24 | /** | 24 | /** |
25 | * struct regulator_ops - regulator operations. | 25 | * struct regulator_ops - regulator operations. |
@@ -51,7 +51,7 @@ struct regulator_ops { | |||
51 | int output_uV, int load_uA); | 51 | int output_uV, int load_uA); |
52 | 52 | ||
53 | /* the operations below are for configuration of regulator state when | 53 | /* the operations below are for configuration of regulator state when |
54 | * it's parent PMIC enters a global STANBY/HIBERNATE state */ | 54 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ |
55 | 55 | ||
56 | /* set regulator suspend voltage */ | 56 | /* set regulator suspend voltage */ |
57 | int (*set_suspend_voltage) (struct regulator_dev *, int uV); | 57 | int (*set_suspend_voltage) (struct regulator_dev *, int uV); |
@@ -85,15 +85,17 @@ struct regulator_desc { | |||
85 | struct module *owner; | 85 | struct module *owner; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | |||
89 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 88 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
90 | void *reg_data); | 89 | struct device *dev, void *driver_data); |
91 | void regulator_unregister(struct regulator_dev *rdev); | 90 | void regulator_unregister(struct regulator_dev *rdev); |
92 | 91 | ||
93 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 92 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
94 | unsigned long event, void *data); | 93 | unsigned long event, void *data); |
95 | 94 | ||
96 | void *rdev_get_drvdata(struct regulator_dev *rdev); | 95 | void *rdev_get_drvdata(struct regulator_dev *rdev); |
96 | struct device *rdev_get_dev(struct regulator_dev *rdev); | ||
97 | int rdev_get_id(struct regulator_dev *rdev); | 97 | int rdev_get_id(struct regulator_dev *rdev); |
98 | 98 | ||
99 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); | ||
100 | |||
99 | #endif | 101 | #endif |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 11e737dbfcf2..c6d69331a81e 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -89,15 +89,33 @@ struct regulation_constraints { | |||
89 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | 89 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | 92 | /** |
93 | * struct regulator_consumer_supply - supply -> device mapping | ||
94 | * | ||
95 | * This maps a supply name to a device. | ||
96 | */ | ||
97 | struct regulator_consumer_supply { | ||
98 | struct device *dev; /* consumer */ | ||
99 | const char *supply; /* consumer supply - e.g. "vcc" */ | ||
100 | }; | ||
93 | 101 | ||
94 | const char *regulator_get_supply(const char *regulator); | 102 | /** |
103 | * struct regulator_init_data - regulator platform initialisation data. | ||
104 | * | ||
105 | * Initialisation constraints, our supply and consumers supplies. | ||
106 | */ | ||
107 | struct regulator_init_data { | ||
108 | struct device *supply_regulator_dev; /* or NULL for LINE */ | ||
95 | 109 | ||
96 | int regulator_set_machine_constraints(const char *regulator, | 110 | struct regulation_constraints constraints; |
97 | struct regulation_constraints *constraints); | ||
98 | 111 | ||
99 | int regulator_set_device_supply(const char *regulator, struct device *dev, | 112 | int num_consumer_supplies; |
100 | const char *supply); | 113 | struct regulator_consumer_supply *consumer_supplies; |
114 | |||
115 | /* optional regulator machine specific init */ | ||
116 | int (*regulator_init)(void *driver_data); | ||
117 | void *driver_data; /* core does not touch this */ | ||
118 | }; | ||
101 | 119 | ||
102 | int regulator_suspend_prepare(suspend_state_t state); | 120 | int regulator_suspend_prepare(suspend_state_t state); |
103 | 121 | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index e9963af16cda..bc5114d35e99 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -87,7 +87,7 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); | |||
87 | if( !( cond ) ) \ | 87 | if( !( cond ) ) \ |
88 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 88 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ |
89 | __FILE__ ":%i:%s: " format "\n", \ | 89 | __FILE__ ":%i:%s: " format "\n", \ |
90 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __FUNCTION__ , ##args ) | 90 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args ) |
91 | 91 | ||
92 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 92 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
93 | 93 | ||
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 741d1a62cc3f..4cd64b0d9825 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -49,6 +49,7 @@ enum rfkill_state { | |||
49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ | 49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ |
50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ | 50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ |
51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ | 51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ |
52 | RFKILL_STATE_MAX, /* marker for last valid state */ | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | /* | 55 | /* |
@@ -110,12 +111,14 @@ struct rfkill { | |||
110 | }; | 111 | }; |
111 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | 112 | #define to_rfkill(d) container_of(d, struct rfkill, dev) |
112 | 113 | ||
113 | struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type); | 114 | struct rfkill * __must_check rfkill_allocate(struct device *parent, |
115 | enum rfkill_type type); | ||
114 | void rfkill_free(struct rfkill *rfkill); | 116 | void rfkill_free(struct rfkill *rfkill); |
115 | int rfkill_register(struct rfkill *rfkill); | 117 | int __must_check rfkill_register(struct rfkill *rfkill); |
116 | void rfkill_unregister(struct rfkill *rfkill); | 118 | void rfkill_unregister(struct rfkill *rfkill); |
117 | 119 | ||
118 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); | 120 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); |
121 | int rfkill_set_default(enum rfkill_type type, enum rfkill_state state); | ||
119 | 122 | ||
120 | /** | 123 | /** |
121 | * rfkill_state_complement - return complementar state | 124 | * rfkill_state_complement - return complementar state |
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h index e8c7c21ceb1f..6fc961459b4a 100644 --- a/include/linux/rtc/m48t59.h +++ b/include/linux/rtc/m48t59.h | |||
@@ -18,40 +18,47 @@ | |||
18 | /* | 18 | /* |
19 | * M48T59 Register Offset | 19 | * M48T59 Register Offset |
20 | */ | 20 | */ |
21 | #define M48T59_YEAR 0x1fff | 21 | #define M48T59_YEAR 0xf |
22 | #define M48T59_MONTH 0x1ffe | 22 | #define M48T59_MONTH 0xe |
23 | #define M48T59_MDAY 0x1ffd /* Day of Month */ | 23 | #define M48T59_MDAY 0xd /* Day of Month */ |
24 | #define M48T59_WDAY 0x1ffc /* Day of Week */ | 24 | #define M48T59_WDAY 0xc /* Day of Week */ |
25 | #define M48T59_WDAY_CB 0x20 /* Century Bit */ | 25 | #define M48T59_WDAY_CB 0x20 /* Century Bit */ |
26 | #define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */ | 26 | #define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */ |
27 | #define M48T59_HOUR 0x1ffb | 27 | #define M48T59_HOUR 0xb |
28 | #define M48T59_MIN 0x1ffa | 28 | #define M48T59_MIN 0xa |
29 | #define M48T59_SEC 0x1ff9 | 29 | #define M48T59_SEC 0x9 |
30 | #define M48T59_CNTL 0x1ff8 | 30 | #define M48T59_CNTL 0x8 |
31 | #define M48T59_CNTL_READ 0x40 | 31 | #define M48T59_CNTL_READ 0x40 |
32 | #define M48T59_CNTL_WRITE 0x80 | 32 | #define M48T59_CNTL_WRITE 0x80 |
33 | #define M48T59_WATCHDOG 0x1ff7 | 33 | #define M48T59_WATCHDOG 0x7 |
34 | #define M48T59_INTR 0x1ff6 | 34 | #define M48T59_INTR 0x6 |
35 | #define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */ | 35 | #define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */ |
36 | #define M48T59_INTR_ABE 0x20 | 36 | #define M48T59_INTR_ABE 0x20 |
37 | #define M48T59_ALARM_DATE 0x1ff5 | 37 | #define M48T59_ALARM_DATE 0x5 |
38 | #define M48T59_ALARM_HOUR 0x1ff4 | 38 | #define M48T59_ALARM_HOUR 0x4 |
39 | #define M48T59_ALARM_MIN 0x1ff3 | 39 | #define M48T59_ALARM_MIN 0x3 |
40 | #define M48T59_ALARM_SEC 0x1ff2 | 40 | #define M48T59_ALARM_SEC 0x2 |
41 | #define M48T59_UNUSED 0x1ff1 | 41 | #define M48T59_UNUSED 0x1 |
42 | #define M48T59_FLAGS 0x1ff0 | 42 | #define M48T59_FLAGS 0x0 |
43 | #define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */ | 43 | #define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */ |
44 | #define M48T59_FLAGS_AF 0x40 /* alarm */ | 44 | #define M48T59_FLAGS_AF 0x40 /* alarm */ |
45 | #define M48T59_FLAGS_BF 0x10 /* low battery */ | 45 | #define M48T59_FLAGS_BF 0x10 /* low battery */ |
46 | 46 | ||
47 | #define M48T59_NVRAM_SIZE 0x1ff0 | 47 | #define M48T59RTC_TYPE_M48T59 0 /* to keep compatibility */ |
48 | #define M48T59RTC_TYPE_M48T02 1 | ||
49 | #define M48T59RTC_TYPE_M48T08 2 | ||
48 | 50 | ||
49 | struct m48t59_plat_data { | 51 | struct m48t59_plat_data { |
50 | /* The method to access M48T59 registers, | 52 | /* The method to access M48T59 registers */ |
51 | * NOTE: The 'ofs' should be 0x00~0x1fff | ||
52 | */ | ||
53 | void (*write_byte)(struct device *dev, u32 ofs, u8 val); | 53 | void (*write_byte)(struct device *dev, u32 ofs, u8 val); |
54 | unsigned char (*read_byte)(struct device *dev, u32 ofs); | 54 | unsigned char (*read_byte)(struct device *dev, u32 ofs); |
55 | |||
56 | int type; /* RTC model */ | ||
57 | |||
58 | /* ioaddr mapped externally */ | ||
59 | void __iomem *ioaddr; | ||
60 | /* offset to RTC registers, automatically set according to the type */ | ||
61 | unsigned int offset; | ||
55 | }; | 62 | }; |
56 | 63 | ||
57 | #endif /* _LINUX_RTC_M48T59_H_ */ | 64 | #endif /* _LINUX_RTC_M48T59_H_ */ |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 382bb7951166..f19b00b7d530 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -54,7 +54,7 @@ struct hrtimer_sleeper; | |||
54 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 54 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
55 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ | 55 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ |
56 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ | 56 | , .name = #mutexname, .file = __FILE__, .line = __LINE__ |
57 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__) | 57 | # define rt_mutex_init(mutex) __rt_mutex_init(mutex, __func__) |
58 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); | 58 | extern void rt_mutex_debug_task_free(struct task_struct *tsk); |
59 | #else | 59 | #else |
60 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) | 60 | # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ca643b13b026..2b3d51c6ec9c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -582,6 +582,10 @@ enum rtnetlink_groups { | |||
582 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE | 582 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE |
583 | RTNLGRP_ND_USEROPT, | 583 | RTNLGRP_ND_USEROPT, |
584 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT | 584 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT |
585 | RTNLGRP_PHONET_IFADDR, | ||
586 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR | ||
587 | RTNLGRP_PHONET_ROUTE, | ||
588 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | ||
585 | __RTNLGRP_MAX | 589 | __RTNLGRP_MAX |
586 | }; | 590 | }; |
587 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 591 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dcc03fd5a7f3..de53c109fd04 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -352,7 +352,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
352 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 352 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
353 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 353 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
354 | 354 | ||
355 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 355 | #if USE_SPLIT_PTLOCKS |
356 | /* | 356 | /* |
357 | * The mm counters are not protected by its page_table_lock, | 357 | * The mm counters are not protected by its page_table_lock, |
358 | * so must be incremented atomically. | 358 | * so must be incremented atomically. |
@@ -363,7 +363,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
363 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) | 363 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) |
364 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) | 364 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) |
365 | 365 | ||
366 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 366 | #else /* !USE_SPLIT_PTLOCKS */ |
367 | /* | 367 | /* |
368 | * The mm counters are protected by its page_table_lock, | 368 | * The mm counters are protected by its page_table_lock, |
369 | * so can be incremented directly. | 369 | * so can be incremented directly. |
@@ -374,7 +374,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
374 | #define inc_mm_counter(mm, member) (mm)->_##member++ | 374 | #define inc_mm_counter(mm, member) (mm)->_##member++ |
375 | #define dec_mm_counter(mm, member) (mm)->_##member-- | 375 | #define dec_mm_counter(mm, member) (mm)->_##member-- |
376 | 376 | ||
377 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 377 | #endif /* !USE_SPLIT_PTLOCKS */ |
378 | 378 | ||
379 | #define get_mm_rss(mm) \ | 379 | #define get_mm_rss(mm) \ |
380 | (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) | 380 | (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) |
@@ -451,8 +451,8 @@ struct signal_struct { | |||
451 | * - everyone except group_exit_task is stopped during signal delivery | 451 | * - everyone except group_exit_task is stopped during signal delivery |
452 | * of fatal signals, group_exit_task processes the signal. | 452 | * of fatal signals, group_exit_task processes the signal. |
453 | */ | 453 | */ |
454 | struct task_struct *group_exit_task; | ||
455 | int notify_count; | 454 | int notify_count; |
455 | struct task_struct *group_exit_task; | ||
456 | 456 | ||
457 | /* thread group stop support, overloads group_exit_code too */ | 457 | /* thread group stop support, overloads group_exit_code too */ |
458 | int group_stop_count; | 458 | int group_stop_count; |
@@ -824,6 +824,9 @@ struct sched_domain { | |||
824 | unsigned int ttwu_move_affine; | 824 | unsigned int ttwu_move_affine; |
825 | unsigned int ttwu_move_balance; | 825 | unsigned int ttwu_move_balance; |
826 | #endif | 826 | #endif |
827 | #ifdef CONFIG_SCHED_DEBUG | ||
828 | char *name; | ||
829 | #endif | ||
827 | }; | 830 | }; |
828 | 831 | ||
829 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 832 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, |
@@ -897,7 +900,7 @@ struct sched_class { | |||
897 | void (*yield_task) (struct rq *rq); | 900 | void (*yield_task) (struct rq *rq); |
898 | int (*select_task_rq)(struct task_struct *p, int sync); | 901 | int (*select_task_rq)(struct task_struct *p, int sync); |
899 | 902 | ||
900 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); | 903 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); |
901 | 904 | ||
902 | struct task_struct * (*pick_next_task) (struct rq *rq); | 905 | struct task_struct * (*pick_next_task) (struct rq *rq); |
903 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 906 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
@@ -1010,8 +1013,8 @@ struct sched_entity { | |||
1010 | 1013 | ||
1011 | struct sched_rt_entity { | 1014 | struct sched_rt_entity { |
1012 | struct list_head run_list; | 1015 | struct list_head run_list; |
1013 | unsigned int time_slice; | ||
1014 | unsigned long timeout; | 1016 | unsigned long timeout; |
1017 | unsigned int time_slice; | ||
1015 | int nr_cpus_allowed; | 1018 | int nr_cpus_allowed; |
1016 | 1019 | ||
1017 | struct sched_rt_entity *back; | 1020 | struct sched_rt_entity *back; |
diff --git a/include/linux/security.h b/include/linux/security.h index 80c4d002864c..f5c4a51eb42e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1560,11 +1560,6 @@ struct security_operations { | |||
1560 | extern int security_init(void); | 1560 | extern int security_init(void); |
1561 | extern int security_module_enable(struct security_operations *ops); | 1561 | extern int security_module_enable(struct security_operations *ops); |
1562 | extern int register_security(struct security_operations *ops); | 1562 | extern int register_security(struct security_operations *ops); |
1563 | extern struct dentry *securityfs_create_file(const char *name, mode_t mode, | ||
1564 | struct dentry *parent, void *data, | ||
1565 | const struct file_operations *fops); | ||
1566 | extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); | ||
1567 | extern void securityfs_remove(struct dentry *dentry); | ||
1568 | 1563 | ||
1569 | /* Security operations */ | 1564 | /* Security operations */ |
1570 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); | 1565 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); |
@@ -2424,25 +2419,6 @@ static inline int security_netlink_recv(struct sk_buff *skb, int cap) | |||
2424 | return cap_netlink_recv(skb, cap); | 2419 | return cap_netlink_recv(skb, cap); |
2425 | } | 2420 | } |
2426 | 2421 | ||
2427 | static inline struct dentry *securityfs_create_dir(const char *name, | ||
2428 | struct dentry *parent) | ||
2429 | { | ||
2430 | return ERR_PTR(-ENODEV); | ||
2431 | } | ||
2432 | |||
2433 | static inline struct dentry *securityfs_create_file(const char *name, | ||
2434 | mode_t mode, | ||
2435 | struct dentry *parent, | ||
2436 | void *data, | ||
2437 | const struct file_operations *fops) | ||
2438 | { | ||
2439 | return ERR_PTR(-ENODEV); | ||
2440 | } | ||
2441 | |||
2442 | static inline void securityfs_remove(struct dentry *dentry) | ||
2443 | { | ||
2444 | } | ||
2445 | |||
2446 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | 2422 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) |
2447 | { | 2423 | { |
2448 | return -EOPNOTSUPP; | 2424 | return -EOPNOTSUPP; |
@@ -2806,5 +2782,35 @@ static inline void security_audit_rule_free(void *lsmrule) | |||
2806 | #endif /* CONFIG_SECURITY */ | 2782 | #endif /* CONFIG_SECURITY */ |
2807 | #endif /* CONFIG_AUDIT */ | 2783 | #endif /* CONFIG_AUDIT */ |
2808 | 2784 | ||
2785 | #ifdef CONFIG_SECURITYFS | ||
2786 | |||
2787 | extern struct dentry *securityfs_create_file(const char *name, mode_t mode, | ||
2788 | struct dentry *parent, void *data, | ||
2789 | const struct file_operations *fops); | ||
2790 | extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); | ||
2791 | extern void securityfs_remove(struct dentry *dentry); | ||
2792 | |||
2793 | #else /* CONFIG_SECURITYFS */ | ||
2794 | |||
2795 | static inline struct dentry *securityfs_create_dir(const char *name, | ||
2796 | struct dentry *parent) | ||
2797 | { | ||
2798 | return ERR_PTR(-ENODEV); | ||
2799 | } | ||
2800 | |||
2801 | static inline struct dentry *securityfs_create_file(const char *name, | ||
2802 | mode_t mode, | ||
2803 | struct dentry *parent, | ||
2804 | void *data, | ||
2805 | const struct file_operations *fops) | ||
2806 | { | ||
2807 | return ERR_PTR(-ENODEV); | ||
2808 | } | ||
2809 | |||
2810 | static inline void securityfs_remove(struct dentry *dentry) | ||
2811 | {} | ||
2812 | |||
2813 | #endif | ||
2814 | |||
2809 | #endif /* ! __LINUX_SECURITY_H */ | 2815 | #endif /* ! __LINUX_SECURITY_H */ |
2810 | 2816 | ||
diff --git a/include/linux/serial.h b/include/linux/serial.h index deb714314fb1..1ea8d9265bf6 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -173,6 +173,22 @@ struct serial_icounter_struct { | |||
173 | int reserved[9]; | 173 | int reserved[9]; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* | ||
177 | * Serial interface for controlling RS485 settings on chips with suitable | ||
178 | * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your | ||
179 | * platform. The set function returns the new state, with any unsupported bits | ||
180 | * reverted appropriately. | ||
181 | */ | ||
182 | |||
183 | struct serial_rs485 { | ||
184 | __u32 flags; /* RS485 feature flags */ | ||
185 | #define SER_RS485_ENABLED (1 << 0) | ||
186 | #define SER_RS485_RTS_ON_SEND (1 << 1) | ||
187 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) | ||
188 | __u32 delay_rts_before_send; /* Milliseconds */ | ||
189 | __u32 padding[6]; /* Memory is cheap, new structs | ||
190 | are a royal PITA .. */ | ||
191 | }; | ||
176 | 192 | ||
177 | #ifdef __KERNEL__ | 193 | #ifdef __KERNEL__ |
178 | #include <linux/compiler.h> | 194 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 3b2f6c04855e..e27f216361fc 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -241,7 +241,7 @@ typedef unsigned int __bitwise__ upf_t; | |||
241 | 241 | ||
242 | struct uart_port { | 242 | struct uart_port { |
243 | spinlock_t lock; /* port lock */ | 243 | spinlock_t lock; /* port lock */ |
244 | unsigned int iobase; /* in/out[bwl] */ | 244 | unsigned long iobase; /* in/out[bwl] */ |
245 | unsigned char __iomem *membase; /* read/write[bwl] */ | 245 | unsigned char __iomem *membase; /* read/write[bwl] */ |
246 | unsigned int irq; /* irq number */ | 246 | unsigned int irq; /* irq number */ |
247 | unsigned int uartclk; /* base uart clock */ | 247 | unsigned int uartclk; /* base uart clock */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 909923717830..2725f4e5a9bf 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -146,8 +146,14 @@ struct skb_shared_info { | |||
146 | unsigned short gso_segs; | 146 | unsigned short gso_segs; |
147 | unsigned short gso_type; | 147 | unsigned short gso_type; |
148 | __be32 ip6_frag_id; | 148 | __be32 ip6_frag_id; |
149 | #ifdef CONFIG_HAS_DMA | ||
150 | unsigned int num_dma_maps; | ||
151 | #endif | ||
149 | struct sk_buff *frag_list; | 152 | struct sk_buff *frag_list; |
150 | skb_frag_t frags[MAX_SKB_FRAGS]; | 153 | skb_frag_t frags[MAX_SKB_FRAGS]; |
154 | #ifdef CONFIG_HAS_DMA | ||
155 | dma_addr_t dma_maps[MAX_SKB_FRAGS + 1]; | ||
156 | #endif | ||
151 | }; | 157 | }; |
152 | 158 | ||
153 | /* We divide dataref into two halves. The higher 16 bits hold references | 159 | /* We divide dataref into two halves. The higher 16 bits hold references |
@@ -353,6 +359,14 @@ struct sk_buff { | |||
353 | 359 | ||
354 | #include <asm/system.h> | 360 | #include <asm/system.h> |
355 | 361 | ||
362 | #ifdef CONFIG_HAS_DMA | ||
363 | #include <linux/dma-mapping.h> | ||
364 | extern int skb_dma_map(struct device *dev, struct sk_buff *skb, | ||
365 | enum dma_data_direction dir); | ||
366 | extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb, | ||
367 | enum dma_data_direction dir); | ||
368 | #endif | ||
369 | |||
356 | extern void kfree_skb(struct sk_buff *skb); | 370 | extern void kfree_skb(struct sk_buff *skb); |
357 | extern void __kfree_skb(struct sk_buff *skb); | 371 | extern void __kfree_skb(struct sk_buff *skb); |
358 | extern struct sk_buff *__alloc_skb(unsigned int size, | 372 | extern struct sk_buff *__alloc_skb(unsigned int size, |
@@ -369,6 +383,8 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
369 | return __alloc_skb(size, priority, 1, -1); | 383 | return __alloc_skb(size, priority, 1, -1); |
370 | } | 384 | } |
371 | 385 | ||
386 | extern int skb_recycle_check(struct sk_buff *skb, int skb_size); | ||
387 | |||
372 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | 388 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); |
373 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 389 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
374 | gfp_t priority); | 390 | gfp_t priority); |
@@ -459,6 +475,37 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) | |||
459 | } | 475 | } |
460 | 476 | ||
461 | /** | 477 | /** |
478 | * skb_queue_is_last - check if skb is the last entry in the queue | ||
479 | * @list: queue head | ||
480 | * @skb: buffer | ||
481 | * | ||
482 | * Returns true if @skb is the last buffer on the list. | ||
483 | */ | ||
484 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, | ||
485 | const struct sk_buff *skb) | ||
486 | { | ||
487 | return (skb->next == (struct sk_buff *) list); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * skb_queue_next - return the next packet in the queue | ||
492 | * @list: queue head | ||
493 | * @skb: current buffer | ||
494 | * | ||
495 | * Return the next packet in @list after @skb. It is only valid to | ||
496 | * call this if skb_queue_is_last() evaluates to false. | ||
497 | */ | ||
498 | static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, | ||
499 | const struct sk_buff *skb) | ||
500 | { | ||
501 | /* This BUG_ON may seem severe, but if we just return then we | ||
502 | * are going to dereference garbage. | ||
503 | */ | ||
504 | BUG_ON(skb_queue_is_last(list, skb)); | ||
505 | return skb->next; | ||
506 | } | ||
507 | |||
508 | /** | ||
462 | * skb_get - reference buffer | 509 | * skb_get - reference buffer |
463 | * @skb: buffer to reference | 510 | * @skb: buffer to reference |
464 | * | 511 | * |
@@ -646,6 +693,22 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_) | |||
646 | return list_->qlen; | 693 | return list_->qlen; |
647 | } | 694 | } |
648 | 695 | ||
696 | /** | ||
697 | * __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head | ||
698 | * @list: queue to initialize | ||
699 | * | ||
700 | * This initializes only the list and queue length aspects of | ||
701 | * an sk_buff_head object. This allows to initialize the list | ||
702 | * aspects of an sk_buff_head without reinitializing things like | ||
703 | * the spinlock. It can also be used for on-stack sk_buff_head | ||
704 | * objects where the spinlock is known to not be used. | ||
705 | */ | ||
706 | static inline void __skb_queue_head_init(struct sk_buff_head *list) | ||
707 | { | ||
708 | list->prev = list->next = (struct sk_buff *)list; | ||
709 | list->qlen = 0; | ||
710 | } | ||
711 | |||
649 | /* | 712 | /* |
650 | * This function creates a split out lock class for each invocation; | 713 | * This function creates a split out lock class for each invocation; |
651 | * this is needed for now since a whole lot of users of the skb-queue | 714 | * this is needed for now since a whole lot of users of the skb-queue |
@@ -657,8 +720,7 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_) | |||
657 | static inline void skb_queue_head_init(struct sk_buff_head *list) | 720 | static inline void skb_queue_head_init(struct sk_buff_head *list) |
658 | { | 721 | { |
659 | spin_lock_init(&list->lock); | 722 | spin_lock_init(&list->lock); |
660 | list->prev = list->next = (struct sk_buff *)list; | 723 | __skb_queue_head_init(list); |
661 | list->qlen = 0; | ||
662 | } | 724 | } |
663 | 725 | ||
664 | static inline void skb_queue_head_init_class(struct sk_buff_head *list, | 726 | static inline void skb_queue_head_init_class(struct sk_buff_head *list, |
@@ -685,6 +747,83 @@ static inline void __skb_insert(struct sk_buff *newsk, | |||
685 | list->qlen++; | 747 | list->qlen++; |
686 | } | 748 | } |
687 | 749 | ||
750 | static inline void __skb_queue_splice(const struct sk_buff_head *list, | ||
751 | struct sk_buff *prev, | ||
752 | struct sk_buff *next) | ||
753 | { | ||
754 | struct sk_buff *first = list->next; | ||
755 | struct sk_buff *last = list->prev; | ||
756 | |||
757 | first->prev = prev; | ||
758 | prev->next = first; | ||
759 | |||
760 | last->next = next; | ||
761 | next->prev = last; | ||
762 | } | ||
763 | |||
764 | /** | ||
765 | * skb_queue_splice - join two skb lists, this is designed for stacks | ||
766 | * @list: the new list to add | ||
767 | * @head: the place to add it in the first list | ||
768 | */ | ||
769 | static inline void skb_queue_splice(const struct sk_buff_head *list, | ||
770 | struct sk_buff_head *head) | ||
771 | { | ||
772 | if (!skb_queue_empty(list)) { | ||
773 | __skb_queue_splice(list, (struct sk_buff *) head, head->next); | ||
774 | head->qlen += list->qlen; | ||
775 | } | ||
776 | } | ||
777 | |||
778 | /** | ||
779 | * skb_queue_splice - join two skb lists and reinitialise the emptied list | ||
780 | * @list: the new list to add | ||
781 | * @head: the place to add it in the first list | ||
782 | * | ||
783 | * The list at @list is reinitialised | ||
784 | */ | ||
785 | static inline void skb_queue_splice_init(struct sk_buff_head *list, | ||
786 | struct sk_buff_head *head) | ||
787 | { | ||
788 | if (!skb_queue_empty(list)) { | ||
789 | __skb_queue_splice(list, (struct sk_buff *) head, head->next); | ||
790 | head->qlen += list->qlen; | ||
791 | __skb_queue_head_init(list); | ||
792 | } | ||
793 | } | ||
794 | |||
795 | /** | ||
796 | * skb_queue_splice_tail - join two skb lists, each list being a queue | ||
797 | * @list: the new list to add | ||
798 | * @head: the place to add it in the first list | ||
799 | */ | ||
800 | static inline void skb_queue_splice_tail(const struct sk_buff_head *list, | ||
801 | struct sk_buff_head *head) | ||
802 | { | ||
803 | if (!skb_queue_empty(list)) { | ||
804 | __skb_queue_splice(list, head->prev, (struct sk_buff *) head); | ||
805 | head->qlen += list->qlen; | ||
806 | } | ||
807 | } | ||
808 | |||
809 | /** | ||
810 | * skb_queue_splice_tail - join two skb lists and reinitialise the emptied list | ||
811 | * @list: the new list to add | ||
812 | * @head: the place to add it in the first list | ||
813 | * | ||
814 | * Each of the lists is a queue. | ||
815 | * The list at @list is reinitialised | ||
816 | */ | ||
817 | static inline void skb_queue_splice_tail_init(struct sk_buff_head *list, | ||
818 | struct sk_buff_head *head) | ||
819 | { | ||
820 | if (!skb_queue_empty(list)) { | ||
821 | __skb_queue_splice(list, head->prev, (struct sk_buff *) head); | ||
822 | head->qlen += list->qlen; | ||
823 | __skb_queue_head_init(list); | ||
824 | } | ||
825 | } | ||
826 | |||
688 | /** | 827 | /** |
689 | * __skb_queue_after - queue a buffer at the list head | 828 | * __skb_queue_after - queue a buffer at the list head |
690 | * @list: list to use | 829 | * @list: list to use |
@@ -829,6 +968,9 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | |||
829 | skb_shinfo(skb)->nr_frags = i + 1; | 968 | skb_shinfo(skb)->nr_frags = i + 1; |
830 | } | 969 | } |
831 | 970 | ||
971 | extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | ||
972 | int off, int size); | ||
973 | |||
832 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 974 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
833 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) | 975 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) |
834 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) | 976 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) |
@@ -1243,6 +1385,26 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1243 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1385 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1244 | } | 1386 | } |
1245 | 1387 | ||
1388 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | ||
1389 | |||
1390 | /** | ||
1391 | * netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
1392 | * @dev: network device to receive on | ||
1393 | * | ||
1394 | * Allocate a new page node local to the specified device. | ||
1395 | * | ||
1396 | * %NULL is returned if there is no free memory. | ||
1397 | */ | ||
1398 | static inline struct page *netdev_alloc_page(struct net_device *dev) | ||
1399 | { | ||
1400 | return __netdev_alloc_page(dev, GFP_ATOMIC); | ||
1401 | } | ||
1402 | |||
1403 | static inline void netdev_free_page(struct net_device *dev, struct page *page) | ||
1404 | { | ||
1405 | __free_page(page); | ||
1406 | } | ||
1407 | |||
1246 | /** | 1408 | /** |
1247 | * skb_clone_writable - is the header of a clone writable | 1409 | * skb_clone_writable - is the header of a clone writable |
1248 | * @skb: buffer to check | 1410 | * @skb: buffer to check |
@@ -1434,6 +1596,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1434 | skb != (struct sk_buff *)(queue); \ | 1596 | skb != (struct sk_buff *)(queue); \ |
1435 | skb = tmp, tmp = skb->next) | 1597 | skb = tmp, tmp = skb->next) |
1436 | 1598 | ||
1599 | #define skb_queue_walk_from(queue, skb) \ | ||
1600 | for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | ||
1601 | skb = skb->next) | ||
1602 | |||
1603 | #define skb_queue_walk_from_safe(queue, skb, tmp) \ | ||
1604 | for (tmp = skb->next; \ | ||
1605 | skb != (struct sk_buff *)(queue); \ | ||
1606 | skb = tmp, tmp = skb->next) | ||
1607 | |||
1437 | #define skb_queue_reverse_walk(queue, skb) \ | 1608 | #define skb_queue_reverse_walk(queue, skb) \ |
1438 | for (skb = (queue)->prev; \ | 1609 | for (skb = (queue)->prev; \ |
1439 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | 1610 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ |
diff --git a/include/linux/smb.h b/include/linux/smb.h index caa43b2370cb..82fefddc5987 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
@@ -11,7 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/magic.h> | 13 | #include <linux/magic.h> |
14 | #ifdef __KERNEL__ | ||
14 | #include <linux/time.h> | 15 | #include <linux/time.h> |
16 | #endif | ||
15 | 17 | ||
16 | enum smb_protocol { | 18 | enum smb_protocol { |
17 | SMB_PROTOCOL_NONE, | 19 | SMB_PROTOCOL_NONE, |
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h index 3827b922ba1f..bc21db598c06 100644 --- a/include/linux/smc91x.h +++ b/include/linux/smc91x.h | |||
@@ -16,8 +16,19 @@ | |||
16 | 16 | ||
17 | #define SMC91X_USE_DMA (1 << 6) | 17 | #define SMC91X_USE_DMA (1 << 6) |
18 | 18 | ||
19 | #define RPC_LED_100_10 (0x00) /* LED = 100Mbps OR's with 10Mbps link detect */ | ||
20 | #define RPC_LED_RES (0x01) /* LED = Reserved */ | ||
21 | #define RPC_LED_10 (0x02) /* LED = 10Mbps link detect */ | ||
22 | #define RPC_LED_FD (0x03) /* LED = Full Duplex Mode */ | ||
23 | #define RPC_LED_TX_RX (0x04) /* LED = TX or RX packet occurred */ | ||
24 | #define RPC_LED_100 (0x05) /* LED = 100Mbps link dectect */ | ||
25 | #define RPC_LED_TX (0x06) /* LED = TX packet occurred */ | ||
26 | #define RPC_LED_RX (0x07) /* LED = RX packet occurred */ | ||
27 | |||
19 | struct smc91x_platdata { | 28 | struct smc91x_platdata { |
20 | unsigned long flags; | 29 | unsigned long flags; |
30 | unsigned char leda; | ||
31 | unsigned char ledb; | ||
21 | }; | 32 | }; |
22 | 33 | ||
23 | #endif /* __SMC91X_H__ */ | 34 | #endif /* __SMC91X_H__ */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index dc5086fe7736..20fc4bbfca42 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -190,7 +190,8 @@ struct ucred { | |||
190 | #define AF_IUCV 32 /* IUCV sockets */ | 190 | #define AF_IUCV 32 /* IUCV sockets */ |
191 | #define AF_RXRPC 33 /* RxRPC sockets */ | 191 | #define AF_RXRPC 33 /* RxRPC sockets */ |
192 | #define AF_ISDN 34 /* mISDN sockets */ | 192 | #define AF_ISDN 34 /* mISDN sockets */ |
193 | #define AF_MAX 35 /* For now.. */ | 193 | #define AF_PHONET 35 /* Phonet sockets */ |
194 | #define AF_MAX 36 /* For now.. */ | ||
194 | 195 | ||
195 | /* Protocol families, same as address families. */ | 196 | /* Protocol families, same as address families. */ |
196 | #define PF_UNSPEC AF_UNSPEC | 197 | #define PF_UNSPEC AF_UNSPEC |
@@ -227,6 +228,7 @@ struct ucred { | |||
227 | #define PF_IUCV AF_IUCV | 228 | #define PF_IUCV AF_IUCV |
228 | #define PF_RXRPC AF_RXRPC | 229 | #define PF_RXRPC AF_RXRPC |
229 | #define PF_ISDN AF_ISDN | 230 | #define PF_ISDN AF_ISDN |
231 | #define PF_PHONET AF_PHONET | ||
230 | #define PF_MAX AF_MAX | 232 | #define PF_MAX AF_MAX |
231 | 233 | ||
232 | /* Maximum queue length specifiable by listen. */ | 234 | /* Maximum queue length specifiable by listen. */ |
@@ -295,6 +297,7 @@ struct ucred { | |||
295 | #define SOL_RXRPC 272 | 297 | #define SOL_RXRPC 272 |
296 | #define SOL_PPPOL2TP 273 | 298 | #define SOL_PPPOL2TP 273 |
297 | #define SOL_BLUETOOTH 274 | 299 | #define SOL_BLUETOOTH 274 |
300 | #define SOL_PNPIPE 275 | ||
298 | 301 | ||
299 | /* IPX options */ | 302 | /* IPX options */ |
300 | #define IPX_TYPE 1 | 303 | #define IPX_TYPE 1 |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index daf744017a31..05eab2f11e63 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -43,6 +43,9 @@ struct ads7846_platform_data { | |||
43 | u16 debounce_tol; /* tolerance used for filtering */ | 43 | u16 debounce_tol; /* tolerance used for filtering */ |
44 | u16 debounce_rep; /* additional consecutive good readings | 44 | u16 debounce_rep; /* additional consecutive good readings |
45 | * required after the first two */ | 45 | * required after the first two */ |
46 | int gpio_pendown; /* the GPIO used to decide the pendown | ||
47 | * state if get_pendown_state == NULL | ||
48 | */ | ||
46 | int (*get_pendown_state)(void); | 49 | int (*get_pendown_state)(void); |
47 | int (*filter_init) (struct ads7846_platform_data *pdata, | 50 | int (*filter_init) (struct ads7846_platform_data *pdata, |
48 | void **filter_data); | 51 | void **filter_data); |
diff --git a/include/linux/spi/corgi_lcd.h b/include/linux/spi/corgi_lcd.h new file mode 100644 index 000000000000..6692b3418ccf --- /dev/null +++ b/include/linux/spi/corgi_lcd.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __LINUX_SPI_CORGI_LCD_H | ||
2 | #define __LINUX_SPI_CORGI_LCD_H | ||
3 | |||
4 | #define CORGI_LCD_MODE_QVGA 1 | ||
5 | #define CORGI_LCD_MODE_VGA 2 | ||
6 | |||
7 | struct corgi_lcd_platform_data { | ||
8 | int init_mode; | ||
9 | int max_intensity; | ||
10 | int default_intensity; | ||
11 | int limit_mask; | ||
12 | |||
13 | int gpio_backlight_on; /* -1 if n/a */ | ||
14 | int gpio_backlight_cont; /* -1 if n/a */ | ||
15 | |||
16 | void (*notify)(int intensity); | ||
17 | void (*kick_battery)(void); | ||
18 | }; | ||
19 | |||
20 | #endif /* __LINUX_SPI_CORGI_LCD_H */ | ||
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h index b4d9fa6f797c..decf6d8c77b7 100644 --- a/include/linux/spi/orion_spi.h +++ b/include/linux/spi/orion_spi.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | struct orion_spi_info { | 12 | struct orion_spi_info { |
13 | u32 tclk; /* no <linux/clk.h> support yet */ | 13 | u32 tclk; /* no <linux/clk.h> support yet */ |
14 | u32 enable_clock_fix; | ||
14 | }; | 15 | }; |
15 | 16 | ||
16 | 17 | ||
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index ebad0bac9801..99a0f991e850 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -245,8 +245,6 @@ | |||
245 | 245 | ||
246 | /* SPROM Revision 3 (inherits most data from rev 2) */ | 246 | /* SPROM Revision 3 (inherits most data from rev 2) */ |
247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ | 247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ |
248 | #define SSB_SPROM3_ET0MAC 0x1050 /* 6 bytes MAC address for Ethernet ?? */ | ||
249 | #define SSB_SPROM3_ET1MAC 0x1050 /* 6 bytes MAC address for 802.11a ?? */ | ||
250 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ | 248 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ |
251 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ | 249 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ |
252 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ | 250 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ |
@@ -267,8 +265,6 @@ | |||
267 | 265 | ||
268 | /* SPROM Revision 4 */ | 266 | /* SPROM Revision 4 */ |
269 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ | 267 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ |
270 | #define SSB_SPROM4_ET0MAC 0x1018 /* 6 bytes MAC address for Ethernet ?? */ | ||
271 | #define SSB_SPROM4_ET1MAC 0x1018 /* 6 bytes MAC address for 802.11a ?? */ | ||
272 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ | 268 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ |
273 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ | 269 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ |
274 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ | 270 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ |
@@ -316,6 +312,21 @@ | |||
316 | #define SSB_SPROM4_PA1B1 0x1090 | 312 | #define SSB_SPROM4_PA1B1 0x1090 |
317 | #define SSB_SPROM4_PA1B2 0x1092 | 313 | #define SSB_SPROM4_PA1B2 0x1092 |
318 | 314 | ||
315 | /* SPROM Revision 5 (inherits most data from rev 4) */ | ||
316 | #define SSB_SPROM5_BFLLO 0x104A /* Boardflags (low 16 bits) */ | ||
317 | #define SSB_SPROM5_BFLHI 0x104C /* Board Flags Hi */ | ||
318 | #define SSB_SPROM5_IL0MAC 0x1052 /* 6 byte MAC address for a/b/g/n */ | ||
319 | #define SSB_SPROM5_CCODE 0x1044 /* Country Code (2 bytes) */ | ||
320 | #define SSB_SPROM5_GPIOA 0x1076 /* Gen. Purpose IO # 0 and 1 */ | ||
321 | #define SSB_SPROM5_GPIOA_P0 0x00FF /* Pin 0 */ | ||
322 | #define SSB_SPROM5_GPIOA_P1 0xFF00 /* Pin 1 */ | ||
323 | #define SSB_SPROM5_GPIOA_P1_SHIFT 8 | ||
324 | #define SSB_SPROM5_GPIOB 0x1078 /* Gen. Purpose IO # 2 and 3 */ | ||
325 | #define SSB_SPROM5_GPIOB_P2 0x00FF /* Pin 2 */ | ||
326 | #define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 | ||
328 | |||
329 | |||
319 | /* Values for SSB_SPROM1_BINF_CCODE */ | 330 | /* Values for SSB_SPROM1_BINF_CCODE */ |
320 | enum { | 331 | enum { |
321 | SSB_SPROM1CCODE_WORLD = 0, | 332 | SSB_SPROM1CCODE_WORLD = 0, |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 5da9794b2d78..b106fd8e0d5c 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_STACKTRACE_H | 1 | #ifndef __LINUX_STACKTRACE_H |
2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
3 | 3 | ||
4 | struct task_struct; | ||
5 | |||
4 | #ifdef CONFIG_STACKTRACE | 6 | #ifdef CONFIG_STACKTRACE |
5 | struct stack_trace { | 7 | struct stack_trace { |
6 | unsigned int nr_entries, max_entries; | 8 | unsigned int nr_entries, max_entries; |
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h new file mode 100644 index 000000000000..a3eb2f65b656 --- /dev/null +++ b/include/linux/string_helpers.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _LINUX_STRING_HELPERS_H_ | ||
2 | #define _LINUX_STRING_HELPERS_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Descriptions of the types of units to | ||
7 | * print in */ | ||
8 | enum string_size_units { | ||
9 | STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ | ||
10 | STRING_UNITS_2, /* use binary powers of 2^10 */ | ||
11 | }; | ||
12 | |||
13 | int string_get_size(u64 size, enum string_size_units units, | ||
14 | char *buf, int len); | ||
15 | |||
16 | #endif | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index e5bfe01ee305..6f0ee1b84a4f 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -104,6 +104,7 @@ struct rpc_create_args { | |||
104 | const struct rpc_timeout *timeout; | 104 | const struct rpc_timeout *timeout; |
105 | char *servername; | 105 | char *servername; |
106 | struct rpc_program *program; | 106 | struct rpc_program *program; |
107 | u32 prognumber; /* overrides program->number */ | ||
107 | u32 version; | 108 | u32 version; |
108 | rpc_authflavor_t authflavor; | 109 | rpc_authflavor_t authflavor; |
109 | unsigned long flags; | 110 | unsigned long flags; |
@@ -124,10 +125,10 @@ struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | |||
124 | void rpc_shutdown_client(struct rpc_clnt *); | 125 | void rpc_shutdown_client(struct rpc_clnt *); |
125 | void rpc_release_client(struct rpc_clnt *); | 126 | void rpc_release_client(struct rpc_clnt *); |
126 | 127 | ||
127 | int rpcb_register(u32, u32, int, unsigned short, int *); | 128 | int rpcb_register(u32, u32, int, unsigned short); |
128 | int rpcb_v4_register(const u32 program, const u32 version, | 129 | int rpcb_v4_register(const u32 program, const u32 version, |
129 | const struct sockaddr *address, | 130 | const struct sockaddr *address, |
130 | const char *netid, int *result); | 131 | const char *netid); |
131 | int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); | 132 | int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); |
132 | void rpcb_getport_async(struct rpc_task *); | 133 | void rpcb_getport_async(struct rpc_task *); |
133 | 134 | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index dc69068d94c7..3afe7fb403b2 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -66,6 +66,7 @@ struct svc_serv { | |||
66 | struct list_head sv_tempsocks; /* all temporary sockets */ | 66 | struct list_head sv_tempsocks; /* all temporary sockets */ |
67 | int sv_tmpcnt; /* count of temporary sockets */ | 67 | int sv_tmpcnt; /* count of temporary sockets */ |
68 | struct timer_list sv_temptimer; /* timer for aging temporary sockets */ | 68 | struct timer_list sv_temptimer; /* timer for aging temporary sockets */ |
69 | sa_family_t sv_family; /* listener's address family */ | ||
69 | 70 | ||
70 | char * sv_name; /* service name */ | 71 | char * sv_name; /* service name */ |
71 | 72 | ||
@@ -265,17 +266,17 @@ struct svc_rqst { | |||
265 | /* | 266 | /* |
266 | * Rigorous type checking on sockaddr type conversions | 267 | * Rigorous type checking on sockaddr type conversions |
267 | */ | 268 | */ |
268 | static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst) | 269 | static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst) |
269 | { | 270 | { |
270 | return (struct sockaddr_in *) &rqst->rq_addr; | 271 | return (struct sockaddr_in *) &rqst->rq_addr; |
271 | } | 272 | } |
272 | 273 | ||
273 | static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst) | 274 | static inline struct sockaddr_in6 *svc_addr_in6(const struct svc_rqst *rqst) |
274 | { | 275 | { |
275 | return (struct sockaddr_in6 *) &rqst->rq_addr; | 276 | return (struct sockaddr_in6 *) &rqst->rq_addr; |
276 | } | 277 | } |
277 | 278 | ||
278 | static inline struct sockaddr *svc_addr(struct svc_rqst *rqst) | 279 | static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst) |
279 | { | 280 | { |
280 | return (struct sockaddr *) &rqst->rq_addr; | 281 | return (struct sockaddr *) &rqst->rq_addr; |
281 | } | 282 | } |
@@ -381,18 +382,20 @@ struct svc_procedure { | |||
381 | /* | 382 | /* |
382 | * Function prototypes. | 383 | * Function prototypes. |
383 | */ | 384 | */ |
384 | struct svc_serv * svc_create(struct svc_program *, unsigned int, | 385 | struct svc_serv *svc_create(struct svc_program *, unsigned int, sa_family_t, |
385 | void (*shutdown)(struct svc_serv*)); | 386 | void (*shutdown)(struct svc_serv *)); |
386 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 387 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
387 | struct svc_pool *pool); | 388 | struct svc_pool *pool); |
388 | void svc_exit_thread(struct svc_rqst *); | 389 | void svc_exit_thread(struct svc_rqst *); |
389 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 390 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
390 | void (*shutdown)(struct svc_serv*), svc_thread_fn, | 391 | sa_family_t, void (*shutdown)(struct svc_serv *), |
391 | struct module *); | 392 | svc_thread_fn, struct module *); |
392 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | 393 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); |
393 | void svc_destroy(struct svc_serv *); | 394 | void svc_destroy(struct svc_serv *); |
394 | int svc_process(struct svc_rqst *); | 395 | int svc_process(struct svc_rqst *); |
395 | int svc_register(struct svc_serv *, int, unsigned short); | 396 | int svc_register(const struct svc_serv *, const unsigned short, |
397 | const unsigned short); | ||
398 | |||
396 | void svc_wake_up(struct svc_serv *); | 399 | void svc_wake_up(struct svc_serv *); |
397 | void svc_reserve(struct svc_rqst *rqstp, int space); | 400 | void svc_reserve(struct svc_rqst *rqstp, int space); |
398 | struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); | 401 | struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index dc05b54bd3a3..c14fe86dac59 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -72,6 +72,7 @@ extern atomic_t rdma_stat_sq_prod; | |||
72 | */ | 72 | */ |
73 | struct svc_rdma_op_ctxt { | 73 | struct svc_rdma_op_ctxt { |
74 | struct svc_rdma_op_ctxt *read_hdr; | 74 | struct svc_rdma_op_ctxt *read_hdr; |
75 | struct svc_rdma_fastreg_mr *frmr; | ||
75 | int hdr_count; | 76 | int hdr_count; |
76 | struct xdr_buf arg; | 77 | struct xdr_buf arg; |
77 | struct list_head dto_q; | 78 | struct list_head dto_q; |
@@ -103,16 +104,30 @@ struct svc_rdma_chunk_sge { | |||
103 | int start; /* sge no for this chunk */ | 104 | int start; /* sge no for this chunk */ |
104 | int count; /* sge count for this chunk */ | 105 | int count; /* sge count for this chunk */ |
105 | }; | 106 | }; |
107 | struct svc_rdma_fastreg_mr { | ||
108 | struct ib_mr *mr; | ||
109 | void *kva; | ||
110 | struct ib_fast_reg_page_list *page_list; | ||
111 | int page_list_len; | ||
112 | unsigned long access_flags; | ||
113 | unsigned long map_len; | ||
114 | enum dma_data_direction direction; | ||
115 | struct list_head frmr_list; | ||
116 | }; | ||
106 | struct svc_rdma_req_map { | 117 | struct svc_rdma_req_map { |
118 | struct svc_rdma_fastreg_mr *frmr; | ||
107 | unsigned long count; | 119 | unsigned long count; |
108 | union { | 120 | union { |
109 | struct kvec sge[RPCSVC_MAXPAGES]; | 121 | struct kvec sge[RPCSVC_MAXPAGES]; |
110 | struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES]; | 122 | struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES]; |
111 | }; | 123 | }; |
112 | }; | 124 | }; |
113 | 125 | #define RDMACTXT_F_FAST_UNREG 1 | |
114 | #define RDMACTXT_F_LAST_CTXT 2 | 126 | #define RDMACTXT_F_LAST_CTXT 2 |
115 | 127 | ||
128 | #define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */ | ||
129 | #define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */ | ||
130 | |||
116 | struct svcxprt_rdma { | 131 | struct svcxprt_rdma { |
117 | struct svc_xprt sc_xprt; /* SVC transport structure */ | 132 | struct svc_xprt sc_xprt; /* SVC transport structure */ |
118 | struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ | 133 | struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ |
@@ -136,6 +151,11 @@ struct svcxprt_rdma { | |||
136 | struct ib_cq *sc_rq_cq; | 151 | struct ib_cq *sc_rq_cq; |
137 | struct ib_cq *sc_sq_cq; | 152 | struct ib_cq *sc_sq_cq; |
138 | struct ib_mr *sc_phys_mr; /* MR for server memory */ | 153 | struct ib_mr *sc_phys_mr; /* MR for server memory */ |
154 | u32 sc_dev_caps; /* distilled device caps */ | ||
155 | u32 sc_dma_lkey; /* local dma key */ | ||
156 | unsigned int sc_frmr_pg_list_len; | ||
157 | struct list_head sc_frmr_q; | ||
158 | spinlock_t sc_frmr_q_lock; | ||
139 | 159 | ||
140 | spinlock_t sc_lock; /* transport lock */ | 160 | spinlock_t sc_lock; /* transport lock */ |
141 | 161 | ||
@@ -192,8 +212,13 @@ extern int svc_rdma_post_recv(struct svcxprt_rdma *); | |||
192 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); | 212 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); |
193 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); | 213 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); |
194 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); | 214 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); |
215 | extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt); | ||
195 | extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); | 216 | extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); |
196 | extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); | 217 | extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); |
218 | extern int svc_rdma_fastreg(struct svcxprt_rdma *, struct svc_rdma_fastreg_mr *); | ||
219 | extern struct svc_rdma_fastreg_mr *svc_rdma_get_frmr(struct svcxprt_rdma *); | ||
220 | extern void svc_rdma_put_frmr(struct svcxprt_rdma *, | ||
221 | struct svc_rdma_fastreg_mr *); | ||
197 | extern void svc_sq_reap(struct svcxprt_rdma *); | 222 | extern void svc_sq_reap(struct svcxprt_rdma *); |
198 | extern void svc_rq_reap(struct svcxprt_rdma *); | 223 | extern void svc_rq_reap(struct svcxprt_rdma *); |
199 | extern struct svc_xprt_class svc_rdma_class; | 224 | extern struct svc_xprt_class svc_rdma_class; |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 8cff696dedf5..483e10380aae 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -39,10 +39,7 @@ int svc_send(struct svc_rqst *); | |||
39 | void svc_drop(struct svc_rqst *); | 39 | void svc_drop(struct svc_rqst *); |
40 | void svc_sock_update_bufs(struct svc_serv *serv); | 40 | void svc_sock_update_bufs(struct svc_serv *serv); |
41 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | 41 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); |
42 | int svc_addsock(struct svc_serv *serv, | 42 | int svc_addsock(struct svc_serv *serv, int fd, char *name_return); |
43 | int fd, | ||
44 | char *name_return, | ||
45 | int *proto); | ||
46 | void svc_init_xprt_sock(void); | 43 | void svc_init_xprt_sock(void); |
47 | void svc_cleanup_xprt_sock(void); | 44 | void svc_cleanup_xprt_sock(void); |
48 | 45 | ||
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h index 4de56b1d372b..54a379c9e8eb 100644 --- a/include/linux/sunrpc/xprtrdma.h +++ b/include/linux/sunrpc/xprtrdma.h | |||
@@ -66,9 +66,6 @@ | |||
66 | 66 | ||
67 | #define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ | 67 | #define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ |
68 | 68 | ||
69 | #define RDMA_RESOLVE_TIMEOUT (5*HZ) /* TBD 5 seconds */ | ||
70 | #define RDMA_CONNECT_RETRY_MAX (2) /* retries if no listener backlog */ | ||
71 | |||
72 | /* memory registration strategies */ | 69 | /* memory registration strategies */ |
73 | #define RPCRDMA_PERSISTENT_REGISTRATION (1) | 70 | #define RPCRDMA_PERSISTENT_REGISTRATION (1) |
74 | 71 | ||
@@ -78,6 +75,7 @@ enum rpcrdma_memreg { | |||
78 | RPCRDMA_MEMWINDOWS, | 75 | RPCRDMA_MEMWINDOWS, |
79 | RPCRDMA_MEMWINDOWS_ASYNC, | 76 | RPCRDMA_MEMWINDOWS_ASYNC, |
80 | RPCRDMA_MTHCAFMR, | 77 | RPCRDMA_MTHCAFMR, |
78 | RPCRDMA_FRMR, | ||
81 | RPCRDMA_ALLPHYSICAL, | 79 | RPCRDMA_ALLPHYSICAL, |
82 | RPCRDMA_LAST | 80 | RPCRDMA_LAST |
83 | }; | 81 | }; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h new file mode 100644 index 000000000000..b18ec5533e8c --- /dev/null +++ b/include/linux/swiotlb.h | |||
@@ -0,0 +1,83 @@ | |||
1 | #ifndef __LINUX_SWIOTLB_H | ||
2 | #define __LINUX_SWIOTLB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct device; | ||
7 | struct dma_attrs; | ||
8 | struct scatterlist; | ||
9 | |||
10 | extern void | ||
11 | swiotlb_init(void); | ||
12 | |||
13 | extern void | ||
14 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
15 | dma_addr_t *dma_handle, gfp_t flags); | ||
16 | |||
17 | extern void | ||
18 | swiotlb_free_coherent(struct device *hwdev, size_t size, | ||
19 | void *vaddr, dma_addr_t dma_handle); | ||
20 | |||
21 | extern dma_addr_t | ||
22 | swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir); | ||
23 | |||
24 | extern void | ||
25 | swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, | ||
26 | size_t size, int dir); | ||
27 | |||
28 | extern dma_addr_t | ||
29 | swiotlb_map_single_attrs(struct device *hwdev, void *ptr, size_t size, | ||
30 | int dir, struct dma_attrs *attrs); | ||
31 | |||
32 | extern void | ||
33 | swiotlb_unmap_single_attrs(struct device *hwdev, dma_addr_t dev_addr, | ||
34 | size_t size, int dir, struct dma_attrs *attrs); | ||
35 | |||
36 | extern int | ||
37 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
38 | int direction); | ||
39 | |||
40 | extern void | ||
41 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
42 | int direction); | ||
43 | |||
44 | extern int | ||
45 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | ||
46 | int dir, struct dma_attrs *attrs); | ||
47 | |||
48 | extern void | ||
49 | swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | ||
50 | int nelems, int dir, struct dma_attrs *attrs); | ||
51 | |||
52 | extern void | ||
53 | swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | ||
54 | size_t size, int dir); | ||
55 | |||
56 | extern void | ||
57 | swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, | ||
58 | int nelems, int dir); | ||
59 | |||
60 | extern void | ||
61 | swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, | ||
62 | size_t size, int dir); | ||
63 | |||
64 | extern void | ||
65 | swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | ||
66 | int nelems, int dir); | ||
67 | |||
68 | extern void | ||
69 | swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | ||
70 | unsigned long offset, size_t size, int dir); | ||
71 | |||
72 | extern void | ||
73 | swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr, | ||
74 | unsigned long offset, size_t size, | ||
75 | int dir); | ||
76 | |||
77 | extern int | ||
78 | swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | ||
79 | |||
80 | extern int | ||
81 | swiotlb_dma_supported(struct device *hwdev, u64 mask); | ||
82 | |||
83 | #endif /* __LINUX_SWIOTLB_H */ | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d0437f36921f..39d471d1163b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -972,7 +972,7 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
972 | 972 | ||
973 | typedef struct ctl_table ctl_table; | 973 | typedef struct ctl_table ctl_table; |
974 | 974 | ||
975 | typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen, | 975 | typedef int ctl_handler (struct ctl_table *table, |
976 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
977 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
978 | 978 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 37fa24152bd8..b330e289d71f 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -78,6 +78,8 @@ struct sysfs_ops { | |||
78 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 78 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
79 | }; | 79 | }; |
80 | 80 | ||
81 | struct sysfs_dirent; | ||
82 | |||
81 | #ifdef CONFIG_SYSFS | 83 | #ifdef CONFIG_SYSFS |
82 | 84 | ||
83 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 85 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
@@ -117,9 +119,14 @@ int sysfs_add_file_to_group(struct kobject *kobj, | |||
117 | void sysfs_remove_file_from_group(struct kobject *kobj, | 119 | void sysfs_remove_file_from_group(struct kobject *kobj, |
118 | const struct attribute *attr, const char *group); | 120 | const struct attribute *attr, const char *group); |
119 | 121 | ||
120 | void sysfs_notify(struct kobject *kobj, char *dir, char *attr); | 122 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
121 | 123 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | |
122 | extern int __must_check sysfs_init(void); | 124 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
125 | const unsigned char *name); | ||
126 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
127 | void sysfs_put(struct sysfs_dirent *sd); | ||
128 | void sysfs_printk_last_file(void); | ||
129 | int __must_check sysfs_init(void); | ||
123 | 130 | ||
124 | #else /* CONFIG_SYSFS */ | 131 | #else /* CONFIG_SYSFS */ |
125 | 132 | ||
@@ -222,7 +229,24 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj, | |||
222 | { | 229 | { |
223 | } | 230 | } |
224 | 231 | ||
225 | static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr) | 232 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, |
233 | const char *attr) | ||
234 | { | ||
235 | } | ||
236 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
237 | { | ||
238 | } | ||
239 | static inline | ||
240 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | ||
241 | const unsigned char *name) | ||
242 | { | ||
243 | return NULL; | ||
244 | } | ||
245 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
246 | { | ||
247 | return NULL; | ||
248 | } | ||
249 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
226 | { | 250 | { |
227 | } | 251 | } |
228 | 252 | ||
@@ -231,6 +255,10 @@ static inline int __must_check sysfs_init(void) | |||
231 | return 0; | 255 | return 0; |
232 | } | 256 | } |
233 | 257 | ||
258 | static inline void sysfs_printk_last_file(void) | ||
259 | { | ||
260 | } | ||
261 | |||
234 | #endif /* CONFIG_SYSFS */ | 262 | #endif /* CONFIG_SYSFS */ |
235 | 263 | ||
236 | #endif /* _SYSFS_H_ */ | 264 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h index 5e88afc9a2fb..bdf855c2856f 100644 --- a/include/linux/task_io_accounting.h +++ b/include/linux/task_io_accounting.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Don't include this header file directly - it is designed to be dragged in via | 5 | * Don't include this header file directly - it is designed to be dragged in via |
6 | * sched.h. | 6 | * sched.h. |
7 | * | 7 | * |
8 | * Blame akpm@osdl.org for all this. | 8 | * Blame Andrew Morton for all this. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | struct task_io_accounting { | 11 | struct task_io_accounting { |
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild index 6dac0d7365cc..76990937f4c9 100644 --- a/include/linux/tc_act/Kbuild +++ b/include/linux/tc_act/Kbuild | |||
@@ -3,3 +3,4 @@ header-y += tc_ipt.h | |||
3 | header-y += tc_mirred.h | 3 | header-y += tc_mirred.h |
4 | header-y += tc_pedit.h | 4 | header-y += tc_pedit.h |
5 | header-y += tc_nat.h | 5 | header-y += tc_nat.h |
6 | header-y += tc_skbedit.h | ||
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h new file mode 100644 index 000000000000..a14e461a7af7 --- /dev/null +++ b/include/linux/tc_act/tc_skbedit.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Author: Alexander Duyck <alexander.h.duyck@intel.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_TC_SKBEDIT_H | ||
21 | #define __LINUX_TC_SKBEDIT_H | ||
22 | |||
23 | #include <linux/pkt_cls.h> | ||
24 | |||
25 | #define TCA_ACT_SKBEDIT 11 | ||
26 | |||
27 | #define SKBEDIT_F_PRIORITY 0x1 | ||
28 | #define SKBEDIT_F_QUEUE_MAPPING 0x2 | ||
29 | |||
30 | struct tc_skbedit { | ||
31 | tc_gen; | ||
32 | }; | ||
33 | |||
34 | enum { | ||
35 | TCA_SKBEDIT_UNSPEC, | ||
36 | TCA_SKBEDIT_TM, | ||
37 | TCA_SKBEDIT_PARMS, | ||
38 | TCA_SKBEDIT_PRIORITY, | ||
39 | TCA_SKBEDIT_QUEUE_MAPPING, | ||
40 | __TCA_SKBEDIT_MAX | ||
41 | }; | ||
42 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) | ||
43 | |||
44 | #endif | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 2e2557388e36..fe77e1499ab7 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -312,8 +312,11 @@ struct tcp_sock { | |||
312 | u32 retrans_out; /* Retransmitted packets out */ | 312 | u32 retrans_out; /* Retransmitted packets out */ |
313 | 313 | ||
314 | u16 urg_data; /* Saved octet of OOB data and control flags */ | 314 | u16 urg_data; /* Saved octet of OOB data and control flags */ |
315 | u8 urg_mode; /* In urgent mode */ | ||
316 | u8 ecn_flags; /* ECN status bits. */ | 315 | u8 ecn_flags; /* ECN status bits. */ |
316 | u8 reordering; /* Packet reordering metric. */ | ||
317 | u32 snd_up; /* Urgent pointer */ | ||
318 | |||
319 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
317 | /* | 320 | /* |
318 | * Options received (usually on last packet, some only on SYN packets). | 321 | * Options received (usually on last packet, some only on SYN packets). |
319 | */ | 322 | */ |
@@ -342,7 +345,6 @@ struct tcp_sock { | |||
342 | struct sk_buff* lost_skb_hint; | 345 | struct sk_buff* lost_skb_hint; |
343 | struct sk_buff *scoreboard_skb_hint; | 346 | struct sk_buff *scoreboard_skb_hint; |
344 | struct sk_buff *retransmit_skb_hint; | 347 | struct sk_buff *retransmit_skb_hint; |
345 | struct sk_buff *forward_skb_hint; | ||
346 | 348 | ||
347 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 349 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
348 | 350 | ||
@@ -358,12 +360,10 @@ struct tcp_sock { | |||
358 | */ | 360 | */ |
359 | 361 | ||
360 | int lost_cnt_hint; | 362 | int lost_cnt_hint; |
361 | int retransmit_cnt_hint; | 363 | u32 retransmit_high; /* L-bits may be on up to this seqno */ |
362 | 364 | ||
363 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ | 365 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ |
364 | 366 | ||
365 | u8 reordering; /* Packet reordering metric. */ | ||
366 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
367 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ | 367 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ |
368 | u32 high_seq; /* snd_nxt at onset of congestion */ | 368 | u32 high_seq; /* snd_nxt at onset of congestion */ |
369 | 369 | ||
@@ -375,8 +375,6 @@ struct tcp_sock { | |||
375 | u32 total_retrans; /* Total retransmits for entire connection */ | 375 | u32 total_retrans; /* Total retransmits for entire connection */ |
376 | 376 | ||
377 | u32 urg_seq; /* Seq of received urgent pointer */ | 377 | u32 urg_seq; /* Seq of received urgent pointer */ |
378 | u32 snd_up; /* Urgent pointer */ | ||
379 | |||
380 | unsigned int keepalive_time; /* time before keep alive takes place */ | 378 | unsigned int keepalive_time; /* time before keep alive takes place */ |
381 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 379 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
382 | 380 | ||
diff --git a/include/linux/telephony.h b/include/linux/telephony.h index 0d0cf2a1e7bc..5b2b6261f193 100644 --- a/include/linux/telephony.h +++ b/include/linux/telephony.h | |||
@@ -28,10 +28,6 @@ | |||
28 | * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION | 28 | * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION |
29 | * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 29 | * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
30 | * | 30 | * |
31 | * Version: $Revision: 4.2 $ | ||
32 | * | ||
33 | * $Id: telephony.h,v 4.2 2001/08/06 07:09:43 craigs Exp $ | ||
34 | * | ||
35 | *****************************************************************************/ | 31 | *****************************************************************************/ |
36 | 32 | ||
37 | #ifndef TELEPHONY_H | 33 | #ifndef TELEPHONY_H |
diff --git a/include/linux/termios.h b/include/linux/termios.h index 478662889f48..2acd0c1f8a2a 100644 --- a/include/linux/termios.h +++ b/include/linux/termios.h | |||
@@ -4,4 +4,19 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/termios.h> | 5 | #include <asm/termios.h> |
6 | 6 | ||
7 | #define NFF 5 | ||
8 | |||
9 | struct termiox | ||
10 | { | ||
11 | __u16 x_hflag; | ||
12 | __u16 x_cflag; | ||
13 | __u16 x_rflag[NFF]; | ||
14 | __u16 x_sflag; | ||
15 | }; | ||
16 | |||
17 | #define RTSXOFF 0x0001 /* RTS flow control on input */ | ||
18 | #define CTSXON 0x0002 /* CTS flow control on output */ | ||
19 | #define DTRXOFF 0x0004 /* DTR flow control on input */ | ||
20 | #define DSRXON 0x0008 /* DCD flow control on output */ | ||
21 | |||
7 | #endif | 22 | #endif |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 8cf8cfe2cc97..98921a3e1aa8 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -126,7 +126,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void) | |||
126 | return len; | 126 | return len; |
127 | } | 127 | } |
128 | static inline void tick_nohz_stop_idle(int cpu) { } | 128 | static inline void tick_nohz_stop_idle(int cpu) { } |
129 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return 0; } | 129 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } |
130 | # endif /* !NO_HZ */ | 130 | # endif /* !NO_HZ */ |
131 | 131 | ||
132 | #endif | 132 | #endif |
diff --git a/include/linux/time.h b/include/linux/time.h index 726976478480..c911ef69ea87 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -29,6 +29,8 @@ struct timezone { | |||
29 | 29 | ||
30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
31 | 31 | ||
32 | extern struct timezone sys_tz; | ||
33 | |||
32 | /* Parameters used to convert the timespec values: */ | 34 | /* Parameters used to convert the timespec values: */ |
33 | #define MSEC_PER_SEC 1000L | 35 | #define MSEC_PER_SEC 1000L |
34 | #define USEC_PER_MSEC 1000L | 36 | #define USEC_PER_MSEC 1000L |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 0cbec74ec086..3b8121d4e36f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
26 | #define NR_LDISCS 18 | 26 | #define NR_LDISCS 19 |
27 | 27 | ||
28 | /* line disciplines */ | 28 | /* line disciplines */ |
29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
@@ -45,6 +45,7 @@ | |||
45 | #define N_HCI 15 /* Bluetooth HCI UART */ | 45 | #define N_HCI 15 /* Bluetooth HCI UART */ |
46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ | 46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ |
47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ |
48 | #define N_PPS 18 /* Pulse per Second */ | ||
48 | 49 | ||
49 | /* | 50 | /* |
50 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 51 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
@@ -181,6 +182,7 @@ struct signal_struct; | |||
181 | 182 | ||
182 | struct tty_port { | 183 | struct tty_port { |
183 | struct tty_struct *tty; /* Back pointer */ | 184 | struct tty_struct *tty; /* Back pointer */ |
185 | spinlock_t lock; /* Lock protecting tty field */ | ||
184 | int blocked_open; /* Waiting to open */ | 186 | int blocked_open; /* Waiting to open */ |
185 | int count; /* Usage count */ | 187 | int count; /* Usage count */ |
186 | wait_queue_head_t open_wait; /* Open waiters */ | 188 | wait_queue_head_t open_wait; /* Open waiters */ |
@@ -208,6 +210,7 @@ struct tty_operations; | |||
208 | 210 | ||
209 | struct tty_struct { | 211 | struct tty_struct { |
210 | int magic; | 212 | int magic; |
213 | struct kref kref; | ||
211 | struct tty_driver *driver; | 214 | struct tty_driver *driver; |
212 | const struct tty_operations *ops; | 215 | const struct tty_operations *ops; |
213 | int index; | 216 | int index; |
@@ -217,6 +220,7 @@ struct tty_struct { | |||
217 | spinlock_t ctrl_lock; | 220 | spinlock_t ctrl_lock; |
218 | /* Termios values are protected by the termios mutex */ | 221 | /* Termios values are protected by the termios mutex */ |
219 | struct ktermios *termios, *termios_locked; | 222 | struct ktermios *termios, *termios_locked; |
223 | struct termiox *termiox; /* May be NULL for unsupported */ | ||
220 | char name[64]; | 224 | char name[64]; |
221 | struct pid *pgrp; /* Protected by ctrl lock */ | 225 | struct pid *pgrp; /* Protected by ctrl lock */ |
222 | struct pid *session; | 226 | struct pid *session; |
@@ -310,6 +314,25 @@ extern int kmsg_redirect; | |||
310 | extern void console_init(void); | 314 | extern void console_init(void); |
311 | extern int vcs_init(void); | 315 | extern int vcs_init(void); |
312 | 316 | ||
317 | extern struct class *tty_class; | ||
318 | |||
319 | /** | ||
320 | * tty_kref_get - get a tty reference | ||
321 | * @tty: tty device | ||
322 | * | ||
323 | * Return a new reference to a tty object. The caller must hold | ||
324 | * sufficient locks/counts to ensure that their existing reference cannot | ||
325 | * go away | ||
326 | */ | ||
327 | |||
328 | extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty) | ||
329 | { | ||
330 | if (tty) | ||
331 | kref_get(&tty->kref); | ||
332 | return tty; | ||
333 | } | ||
334 | extern void tty_kref_put(struct tty_struct *tty); | ||
335 | |||
313 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, | 336 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, |
314 | const char *routine); | 337 | const char *routine); |
315 | extern char *tty_name(struct tty_struct *tty, char *buf); | 338 | extern char *tty_name(struct tty_struct *tty, char *buf); |
@@ -333,13 +356,15 @@ extern void tty_throttle(struct tty_struct *tty); | |||
333 | extern void tty_unthrottle(struct tty_struct *tty); | 356 | extern void tty_unthrottle(struct tty_struct *tty); |
334 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, | 357 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, |
335 | struct winsize *ws); | 358 | struct winsize *ws); |
336 | 359 | extern void tty_shutdown(struct tty_struct *tty); | |
360 | extern void tty_free_termios(struct tty_struct *tty); | ||
337 | extern int is_current_pgrp_orphaned(void); | 361 | extern int is_current_pgrp_orphaned(void); |
338 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 362 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
339 | extern int is_ignored(int sig); | 363 | extern int is_ignored(int sig); |
340 | extern int tty_signal(int sig, struct tty_struct *tty); | 364 | extern int tty_signal(int sig, struct tty_struct *tty); |
341 | extern void tty_hangup(struct tty_struct *tty); | 365 | extern void tty_hangup(struct tty_struct *tty); |
342 | extern void tty_vhangup(struct tty_struct *tty); | 366 | extern void tty_vhangup(struct tty_struct *tty); |
367 | extern void tty_vhangup_self(void); | ||
343 | extern void tty_unhangup(struct file *filp); | 368 | extern void tty_unhangup(struct file *filp); |
344 | extern int tty_hung_up_p(struct file *filp); | 369 | extern int tty_hung_up_p(struct file *filp); |
345 | extern void do_SAK(struct tty_struct *tty); | 370 | extern void do_SAK(struct tty_struct *tty); |
@@ -347,6 +372,9 @@ extern void __do_SAK(struct tty_struct *tty); | |||
347 | extern void disassociate_ctty(int priv); | 372 | extern void disassociate_ctty(int priv); |
348 | extern void no_tty(void); | 373 | extern void no_tty(void); |
349 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 374 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
375 | extern void tty_buffer_free_all(struct tty_struct *tty); | ||
376 | extern void tty_buffer_flush(struct tty_struct *tty); | ||
377 | extern void tty_buffer_init(struct tty_struct *tty); | ||
350 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); | 378 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
351 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 379 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
352 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 380 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
@@ -372,6 +400,15 @@ extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); | |||
372 | extern dev_t tty_devnum(struct tty_struct *tty); | 400 | extern dev_t tty_devnum(struct tty_struct *tty); |
373 | extern void proc_clear_tty(struct task_struct *p); | 401 | extern void proc_clear_tty(struct task_struct *p); |
374 | extern struct tty_struct *get_current_tty(void); | 402 | extern struct tty_struct *get_current_tty(void); |
403 | extern void tty_default_fops(struct file_operations *fops); | ||
404 | extern struct tty_struct *alloc_tty_struct(void); | ||
405 | extern void free_tty_struct(struct tty_struct *tty); | ||
406 | extern void initialize_tty_struct(struct tty_struct *tty, | ||
407 | struct tty_driver *driver, int idx); | ||
408 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, | ||
409 | int first_ok); | ||
410 | extern void tty_release_dev(struct file *filp); | ||
411 | extern int tty_init_termios(struct tty_struct *tty); | ||
375 | 412 | ||
376 | extern struct mutex tty_mutex; | 413 | extern struct mutex tty_mutex; |
377 | 414 | ||
@@ -382,6 +419,8 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
382 | extern void tty_port_init(struct tty_port *port); | 419 | extern void tty_port_init(struct tty_port *port); |
383 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 420 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
384 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 421 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
422 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | ||
423 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | ||
385 | 424 | ||
386 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | 425 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); |
387 | extern int tty_unregister_ldisc(int disc); | 426 | extern int tty_unregister_ldisc(int disc); |
@@ -427,7 +466,7 @@ static inline void tty_audit_push_task(struct task_struct *tsk, | |||
427 | #endif | 466 | #endif |
428 | 467 | ||
429 | /* tty_ioctl.c */ | 468 | /* tty_ioctl.c */ |
430 | extern int n_tty_ioctl(struct tty_struct *tty, struct file *file, | 469 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, |
431 | unsigned int cmd, unsigned long arg); | 470 | unsigned int cmd, unsigned long arg); |
432 | 471 | ||
433 | /* serial.c */ | 472 | /* serial.c */ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 16d27944c321..78416b901589 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -7,6 +7,28 @@ | |||
7 | * defined; unless noted otherwise, they are optional, and can be | 7 | * defined; unless noted otherwise, they are optional, and can be |
8 | * filled in with a null pointer. | 8 | * filled in with a null pointer. |
9 | * | 9 | * |
10 | * struct tty_struct * (*lookup)(struct tty_driver *self, int idx) | ||
11 | * | ||
12 | * Return the tty device corresponding to idx, NULL if there is not | ||
13 | * one currently in use and an ERR_PTR value on error. Called under | ||
14 | * tty_mutex (for now!) | ||
15 | * | ||
16 | * Optional method. Default behaviour is to use the ttys array | ||
17 | * | ||
18 | * int (*install)(struct tty_driver *self, struct tty_struct *tty) | ||
19 | * | ||
20 | * Install a new tty into the tty driver internal tables. Used in | ||
21 | * conjunction with lookup and remove methods. | ||
22 | * | ||
23 | * Optional method. Default behaviour is to use the ttys array | ||
24 | * | ||
25 | * void (*remove)(struct tty_driver *self, struct tty_struct *tty) | ||
26 | * | ||
27 | * Remove a closed tty from the tty driver internal tables. Used in | ||
28 | * conjunction with lookup and remove methods. | ||
29 | * | ||
30 | * Optional method. Default behaviour is to use the ttys array | ||
31 | * | ||
10 | * int (*open)(struct tty_struct * tty, struct file * filp); | 32 | * int (*open)(struct tty_struct * tty, struct file * filp); |
11 | * | 33 | * |
12 | * This routine is called when a particular tty device is opened. | 34 | * This routine is called when a particular tty device is opened. |
@@ -21,6 +43,11 @@ | |||
21 | * | 43 | * |
22 | * Required method. | 44 | * Required method. |
23 | * | 45 | * |
46 | * void (*shutdown)(struct tty_struct * tty); | ||
47 | * | ||
48 | * This routine is called when a particular tty device is closed for | ||
49 | * the last time freeing up the resources. | ||
50 | * | ||
24 | * int (*write)(struct tty_struct * tty, | 51 | * int (*write)(struct tty_struct * tty, |
25 | * const unsigned char *buf, int count); | 52 | * const unsigned char *buf, int count); |
26 | * | 53 | * |
@@ -180,6 +207,14 @@ | |||
180 | * not force errors here if they are not resizable objects (eg a serial | 207 | * not force errors here if they are not resizable objects (eg a serial |
181 | * line). See tty_do_resize() if you need to wrap the standard method | 208 | * line). See tty_do_resize() if you need to wrap the standard method |
182 | * in your own logic - the usual case. | 209 | * in your own logic - the usual case. |
210 | * | ||
211 | * void (*set_termiox)(struct tty_struct *tty, struct termiox *new); | ||
212 | * | ||
213 | * Called when the device receives a termiox based ioctl. Passes down | ||
214 | * the requested data from user space. This method will not be invoked | ||
215 | * unless the tty also has a valid tty->termiox pointer. | ||
216 | * | ||
217 | * Optional: Called under the termios lock | ||
183 | */ | 218 | */ |
184 | 219 | ||
185 | #include <linux/fs.h> | 220 | #include <linux/fs.h> |
@@ -190,8 +225,13 @@ struct tty_struct; | |||
190 | struct tty_driver; | 225 | struct tty_driver; |
191 | 226 | ||
192 | struct tty_operations { | 227 | struct tty_operations { |
228 | struct tty_struct * (*lookup)(struct tty_driver *driver, | ||
229 | struct inode *inode, int idx); | ||
230 | int (*install)(struct tty_driver *driver, struct tty_struct *tty); | ||
231 | void (*remove)(struct tty_driver *driver, struct tty_struct *tty); | ||
193 | int (*open)(struct tty_struct * tty, struct file * filp); | 232 | int (*open)(struct tty_struct * tty, struct file * filp); |
194 | void (*close)(struct tty_struct * tty, struct file * filp); | 233 | void (*close)(struct tty_struct * tty, struct file * filp); |
234 | void (*shutdown)(struct tty_struct *tty); | ||
195 | int (*write)(struct tty_struct * tty, | 235 | int (*write)(struct tty_struct * tty, |
196 | const unsigned char *buf, int count); | 236 | const unsigned char *buf, int count); |
197 | int (*put_char)(struct tty_struct *tty, unsigned char ch); | 237 | int (*put_char)(struct tty_struct *tty, unsigned char ch); |
@@ -220,6 +260,7 @@ struct tty_operations { | |||
220 | unsigned int set, unsigned int clear); | 260 | unsigned int set, unsigned int clear); |
221 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | 261 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, |
222 | struct winsize *ws); | 262 | struct winsize *ws); |
263 | int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); | ||
223 | #ifdef CONFIG_CONSOLE_POLL | 264 | #ifdef CONFIG_CONSOLE_POLL |
224 | int (*poll_init)(struct tty_driver *driver, int line, char *options); | 265 | int (*poll_init)(struct tty_driver *driver, int line, char *options); |
225 | int (*poll_get_char)(struct tty_driver *driver, int line); | 266 | int (*poll_get_char)(struct tty_driver *driver, int line); |
@@ -229,6 +270,7 @@ struct tty_operations { | |||
229 | 270 | ||
230 | struct tty_driver { | 271 | struct tty_driver { |
231 | int magic; /* magic number for this structure */ | 272 | int magic; /* magic number for this structure */ |
273 | struct kref kref; /* Reference management */ | ||
232 | struct cdev cdev; | 274 | struct cdev cdev; |
233 | struct module *owner; | 275 | struct module *owner; |
234 | const char *driver_name; | 276 | const char *driver_name; |
@@ -242,7 +284,6 @@ struct tty_driver { | |||
242 | short subtype; /* subtype of tty driver */ | 284 | short subtype; /* subtype of tty driver */ |
243 | struct ktermios init_termios; /* Initial termios */ | 285 | struct ktermios init_termios; /* Initial termios */ |
244 | int flags; /* tty driver flags */ | 286 | int flags; /* tty driver flags */ |
245 | int refcount; /* for loadable tty drivers */ | ||
246 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ | 287 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ |
247 | struct tty_driver *other; /* only used for the PTY driver */ | 288 | struct tty_driver *other; /* only used for the PTY driver */ |
248 | 289 | ||
@@ -264,12 +305,19 @@ struct tty_driver { | |||
264 | 305 | ||
265 | extern struct list_head tty_drivers; | 306 | extern struct list_head tty_drivers; |
266 | 307 | ||
267 | struct tty_driver *alloc_tty_driver(int lines); | 308 | extern struct tty_driver *alloc_tty_driver(int lines); |
268 | void put_tty_driver(struct tty_driver *driver); | 309 | extern void put_tty_driver(struct tty_driver *driver); |
269 | void tty_set_operations(struct tty_driver *driver, | 310 | extern void tty_set_operations(struct tty_driver *driver, |
270 | const struct tty_operations *op); | 311 | const struct tty_operations *op); |
271 | extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | 312 | extern struct tty_driver *tty_find_polling_driver(char *name, int *line); |
272 | 313 | ||
314 | extern void tty_driver_kref_put(struct tty_driver *driver); | ||
315 | extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | ||
316 | { | ||
317 | kref_get(&d->kref); | ||
318 | return d; | ||
319 | } | ||
320 | |||
273 | /* tty driver magic number */ | 321 | /* tty driver magic number */ |
274 | #define TTY_DRIVER_MAGIC 0x5402 | 322 | #define TTY_DRIVER_MAGIC 0x5402 |
275 | 323 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index d4a9ce6e2760..f24f7beb47df 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -191,12 +191,14 @@ typedef __u32 __bitwise __wsum; | |||
191 | #ifdef __KERNEL__ | 191 | #ifdef __KERNEL__ |
192 | typedef unsigned __bitwise__ gfp_t; | 192 | typedef unsigned __bitwise__ gfp_t; |
193 | 193 | ||
194 | #ifdef CONFIG_RESOURCES_64BIT | 194 | #ifdef CONFIG_PHYS_ADDR_T_64BIT |
195 | typedef u64 resource_size_t; | 195 | typedef u64 phys_addr_t; |
196 | #else | 196 | #else |
197 | typedef u32 resource_size_t; | 197 | typedef u32 phys_addr_t; |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | typedef phys_addr_t resource_size_t; | ||
201 | |||
200 | struct ustat { | 202 | struct ustat { |
201 | __kernel_daddr_t f_tfree; | 203 | __kernel_daddr_t f_tfree; |
202 | __kernel_ino_t f_tinode; | 204 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h new file mode 100644 index 000000000000..970473bf8d5a --- /dev/null +++ b/include/linux/ucb1400.h | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Register definitions and functions for: | ||
3 | * Philips UCB1400 driver | ||
4 | * | ||
5 | * Based on ucb1400_ts: | ||
6 | * Author: Nicolas Pitre | ||
7 | * Created: September 25, 2006 | ||
8 | * Copyright: MontaVista Software, Inc. | ||
9 | * | ||
10 | * Spliting done by: Marek Vasut <marek.vasut@gmail.com> | ||
11 | * If something doesnt work and it worked before spliting, e-mail me, | ||
12 | * dont bother Nicolas please ;-) | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License version 2 as | ||
16 | * published by the Free Software Foundation. | ||
17 | * | ||
18 | * This code is heavily based on ucb1x00-*.c copyrighted by Russell King | ||
19 | * covering the UCB1100, UCB1200 and UCB1300.. Support for the UCB1400 has | ||
20 | * been made separate from ucb1x00-core/ucb1x00-ts on Russell's request. | ||
21 | */ | ||
22 | |||
23 | #ifndef _LINUX__UCB1400_H | ||
24 | #define _LINUX__UCB1400_H | ||
25 | |||
26 | #include <sound/ac97_codec.h> | ||
27 | #include <linux/mutex.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | |||
30 | /* | ||
31 | * UCB1400 AC-link registers | ||
32 | */ | ||
33 | |||
34 | #define UCB_IO_DATA 0x5a | ||
35 | #define UCB_IO_DIR 0x5c | ||
36 | #define UCB_IE_RIS 0x5e | ||
37 | #define UCB_IE_FAL 0x60 | ||
38 | #define UCB_IE_STATUS 0x62 | ||
39 | #define UCB_IE_CLEAR 0x62 | ||
40 | #define UCB_IE_ADC (1 << 11) | ||
41 | #define UCB_IE_TSPX (1 << 12) | ||
42 | |||
43 | #define UCB_TS_CR 0x64 | ||
44 | #define UCB_TS_CR_TSMX_POW (1 << 0) | ||
45 | #define UCB_TS_CR_TSPX_POW (1 << 1) | ||
46 | #define UCB_TS_CR_TSMY_POW (1 << 2) | ||
47 | #define UCB_TS_CR_TSPY_POW (1 << 3) | ||
48 | #define UCB_TS_CR_TSMX_GND (1 << 4) | ||
49 | #define UCB_TS_CR_TSPX_GND (1 << 5) | ||
50 | #define UCB_TS_CR_TSMY_GND (1 << 6) | ||
51 | #define UCB_TS_CR_TSPY_GND (1 << 7) | ||
52 | #define UCB_TS_CR_MODE_INT (0 << 8) | ||
53 | #define UCB_TS_CR_MODE_PRES (1 << 8) | ||
54 | #define UCB_TS_CR_MODE_POS (2 << 8) | ||
55 | #define UCB_TS_CR_BIAS_ENA (1 << 11) | ||
56 | #define UCB_TS_CR_TSPX_LOW (1 << 12) | ||
57 | #define UCB_TS_CR_TSMX_LOW (1 << 13) | ||
58 | |||
59 | #define UCB_ADC_CR 0x66 | ||
60 | #define UCB_ADC_SYNC_ENA (1 << 0) | ||
61 | #define UCB_ADC_VREFBYP_CON (1 << 1) | ||
62 | #define UCB_ADC_INP_TSPX (0 << 2) | ||
63 | #define UCB_ADC_INP_TSMX (1 << 2) | ||
64 | #define UCB_ADC_INP_TSPY (2 << 2) | ||
65 | #define UCB_ADC_INP_TSMY (3 << 2) | ||
66 | #define UCB_ADC_INP_AD0 (4 << 2) | ||
67 | #define UCB_ADC_INP_AD1 (5 << 2) | ||
68 | #define UCB_ADC_INP_AD2 (6 << 2) | ||
69 | #define UCB_ADC_INP_AD3 (7 << 2) | ||
70 | #define UCB_ADC_EXT_REF (1 << 5) | ||
71 | #define UCB_ADC_START (1 << 7) | ||
72 | #define UCB_ADC_ENA (1 << 15) | ||
73 | |||
74 | #define UCB_ADC_DATA 0x68 | ||
75 | #define UCB_ADC_DAT_VALID (1 << 15) | ||
76 | #define UCB_ADC_DAT_MASK 0x3ff | ||
77 | |||
78 | #define UCB_ID 0x7e | ||
79 | #define UCB_ID_1400 0x4304 | ||
80 | |||
81 | struct ucb1400_ts { | ||
82 | struct input_dev *ts_idev; | ||
83 | struct task_struct *ts_task; | ||
84 | int id; | ||
85 | wait_queue_head_t ts_wait; | ||
86 | unsigned int ts_restart:1; | ||
87 | int irq; | ||
88 | unsigned int irq_pending; /* not bit field shared */ | ||
89 | struct snd_ac97 *ac97; | ||
90 | }; | ||
91 | |||
92 | struct ucb1400 { | ||
93 | struct platform_device *ucb1400_ts; | ||
94 | }; | ||
95 | |||
96 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | ||
97 | { | ||
98 | return ac97->bus->ops->read(ac97, reg); | ||
99 | } | ||
100 | |||
101 | static inline void ucb1400_reg_write(struct snd_ac97 *ac97, u16 reg, u16 val) | ||
102 | { | ||
103 | ac97->bus->ops->write(ac97, reg, val); | ||
104 | } | ||
105 | |||
106 | static inline u16 ucb1400_gpio_get_value(struct snd_ac97 *ac97, u16 gpio) | ||
107 | { | ||
108 | return ucb1400_reg_read(ac97, UCB_IO_DATA) & (1 << gpio); | ||
109 | } | ||
110 | |||
111 | static inline void ucb1400_gpio_set_value(struct snd_ac97 *ac97, u16 gpio, | ||
112 | u16 val) | ||
113 | { | ||
114 | ucb1400_reg_write(ac97, UCB_IO_DATA, val ? | ||
115 | ucb1400_reg_read(ac97, UCB_IO_DATA) | (1 << gpio) : | ||
116 | ucb1400_reg_read(ac97, UCB_IO_DATA) & ~(1 << gpio)); | ||
117 | } | ||
118 | |||
119 | static inline u16 ucb1400_gpio_get_direction(struct snd_ac97 *ac97, u16 gpio) | ||
120 | { | ||
121 | return ucb1400_reg_read(ac97, UCB_IO_DIR) & (1 << gpio); | ||
122 | } | ||
123 | |||
124 | static inline void ucb1400_gpio_set_direction(struct snd_ac97 *ac97, u16 gpio, | ||
125 | u16 dir) | ||
126 | { | ||
127 | ucb1400_reg_write(ac97, UCB_IO_DIR, dir ? | ||
128 | ucb1400_reg_read(ac97, UCB_IO_DIR) | (1 << gpio) : | ||
129 | ucb1400_reg_read(ac97, UCB_IO_DIR) & ~(1 << gpio)); | ||
130 | } | ||
131 | |||
132 | static inline void ucb1400_adc_enable(struct snd_ac97 *ac97) | ||
133 | { | ||
134 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); | ||
135 | } | ||
136 | |||
137 | static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | ||
138 | int adcsync) | ||
139 | { | ||
140 | unsigned int val; | ||
141 | |||
142 | if (adcsync) | ||
143 | adc_channel |= UCB_ADC_SYNC_ENA; | ||
144 | |||
145 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel); | ||
146 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel | | ||
147 | UCB_ADC_START); | ||
148 | |||
149 | while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA)) | ||
150 | & UCB_ADC_DAT_VALID)) | ||
151 | schedule_timeout_uninterruptible(1); | ||
152 | |||
153 | return val & UCB_ADC_DAT_MASK; | ||
154 | } | ||
155 | |||
156 | static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | ||
157 | { | ||
158 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); | ||
159 | } | ||
160 | |||
161 | #endif | ||
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h new file mode 100644 index 000000000000..5b88e36c9103 --- /dev/null +++ b/include/linux/usb/ehci_def.h | |||
@@ -0,0 +1,160 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2001-2002 by David Brownell | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software Foundation, | ||
16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_USB_EHCI_DEF_H | ||
20 | #define __LINUX_USB_EHCI_DEF_H | ||
21 | |||
22 | /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ | ||
23 | |||
24 | /* Section 2.2 Host Controller Capability Registers */ | ||
25 | struct ehci_caps { | ||
26 | /* these fields are specified as 8 and 16 bit registers, | ||
27 | * but some hosts can't perform 8 or 16 bit PCI accesses. | ||
28 | */ | ||
29 | u32 hc_capbase; | ||
30 | #define HC_LENGTH(p) (((p)>>00)&0x00ff) /* bits 7:0 */ | ||
31 | #define HC_VERSION(p) (((p)>>16)&0xffff) /* bits 31:16 */ | ||
32 | u32 hcs_params; /* HCSPARAMS - offset 0x4 */ | ||
33 | #define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */ | ||
34 | #define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ | ||
35 | #define HCS_N_CC(p) (((p)>>12)&0xf) /* bits 15:12, #companion HCs */ | ||
36 | #define HCS_N_PCC(p) (((p)>>8)&0xf) /* bits 11:8, ports per CC */ | ||
37 | #define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */ | ||
38 | #define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */ | ||
39 | #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ | ||
40 | |||
41 | u32 hcc_params; /* HCCPARAMS - offset 0x8 */ | ||
42 | #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ | ||
43 | #define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */ | ||
44 | #define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */ | ||
45 | #define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */ | ||
46 | #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ | ||
47 | #define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ | ||
48 | u8 portroute [8]; /* nibbles for routing - offset 0xC */ | ||
49 | } __attribute__ ((packed)); | ||
50 | |||
51 | |||
52 | /* Section 2.3 Host Controller Operational Registers */ | ||
53 | struct ehci_regs { | ||
54 | |||
55 | /* USBCMD: offset 0x00 */ | ||
56 | u32 command; | ||
57 | /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ | ||
58 | #define CMD_PARK (1<<11) /* enable "park" on async qh */ | ||
59 | #define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ | ||
60 | #define CMD_LRESET (1<<7) /* partial reset (no ports, etc) */ | ||
61 | #define CMD_IAAD (1<<6) /* "doorbell" interrupt async advance */ | ||
62 | #define CMD_ASE (1<<5) /* async schedule enable */ | ||
63 | #define CMD_PSE (1<<4) /* periodic schedule enable */ | ||
64 | /* 3:2 is periodic frame list size */ | ||
65 | #define CMD_RESET (1<<1) /* reset HC not bus */ | ||
66 | #define CMD_RUN (1<<0) /* start/stop HC */ | ||
67 | |||
68 | /* USBSTS: offset 0x04 */ | ||
69 | u32 status; | ||
70 | #define STS_ASS (1<<15) /* Async Schedule Status */ | ||
71 | #define STS_PSS (1<<14) /* Periodic Schedule Status */ | ||
72 | #define STS_RECL (1<<13) /* Reclamation */ | ||
73 | #define STS_HALT (1<<12) /* Not running (any reason) */ | ||
74 | /* some bits reserved */ | ||
75 | /* these STS_* flags are also intr_enable bits (USBINTR) */ | ||
76 | #define STS_IAA (1<<5) /* Interrupted on async advance */ | ||
77 | #define STS_FATAL (1<<4) /* such as some PCI access errors */ | ||
78 | #define STS_FLR (1<<3) /* frame list rolled over */ | ||
79 | #define STS_PCD (1<<2) /* port change detect */ | ||
80 | #define STS_ERR (1<<1) /* "error" completion (overflow, ...) */ | ||
81 | #define STS_INT (1<<0) /* "normal" completion (short, ...) */ | ||
82 | |||
83 | /* USBINTR: offset 0x08 */ | ||
84 | u32 intr_enable; | ||
85 | |||
86 | /* FRINDEX: offset 0x0C */ | ||
87 | u32 frame_index; /* current microframe number */ | ||
88 | /* CTRLDSSEGMENT: offset 0x10 */ | ||
89 | u32 segment; /* address bits 63:32 if needed */ | ||
90 | /* PERIODICLISTBASE: offset 0x14 */ | ||
91 | u32 frame_list; /* points to periodic list */ | ||
92 | /* ASYNCLISTADDR: offset 0x18 */ | ||
93 | u32 async_next; /* address of next async queue head */ | ||
94 | |||
95 | u32 reserved [9]; | ||
96 | |||
97 | /* CONFIGFLAG: offset 0x40 */ | ||
98 | u32 configured_flag; | ||
99 | #define FLAG_CF (1<<0) /* true: we'll support "high speed" */ | ||
100 | |||
101 | /* PORTSC: offset 0x44 */ | ||
102 | u32 port_status [0]; /* up to N_PORTS */ | ||
103 | /* 31:23 reserved */ | ||
104 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ | ||
105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | ||
106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ | ||
107 | /* 19:16 for port testing */ | ||
108 | #define PORT_LED_OFF (0<<14) | ||
109 | #define PORT_LED_AMBER (1<<14) | ||
110 | #define PORT_LED_GREEN (2<<14) | ||
111 | #define PORT_LED_MASK (3<<14) | ||
112 | #define PORT_OWNER (1<<13) /* true: companion hc owns this port */ | ||
113 | #define PORT_POWER (1<<12) /* true: has power (see PPC) */ | ||
114 | #define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */ | ||
115 | /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ | ||
116 | /* 9 reserved */ | ||
117 | #define PORT_RESET (1<<8) /* reset port */ | ||
118 | #define PORT_SUSPEND (1<<7) /* suspend port */ | ||
119 | #define PORT_RESUME (1<<6) /* resume it */ | ||
120 | #define PORT_OCC (1<<5) /* over current change */ | ||
121 | #define PORT_OC (1<<4) /* over current active */ | ||
122 | #define PORT_PEC (1<<3) /* port enable change */ | ||
123 | #define PORT_PE (1<<2) /* port enable */ | ||
124 | #define PORT_CSC (1<<1) /* connect status change */ | ||
125 | #define PORT_CONNECT (1<<0) /* device connected */ | ||
126 | #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) | ||
127 | } __attribute__ ((packed)); | ||
128 | |||
129 | #define USBMODE 0x68 /* USB Device mode */ | ||
130 | #define USBMODE_SDIS (1<<3) /* Stream disable */ | ||
131 | #define USBMODE_BE (1<<2) /* BE/LE endianness select */ | ||
132 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | ||
133 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | ||
134 | |||
135 | /* Appendix C, Debug port ... intended for use with special "debug devices" | ||
136 | * that can help if there's no serial console. (nonstandard enumeration.) | ||
137 | */ | ||
138 | struct ehci_dbg_port { | ||
139 | u32 control; | ||
140 | #define DBGP_OWNER (1<<30) | ||
141 | #define DBGP_ENABLED (1<<28) | ||
142 | #define DBGP_DONE (1<<16) | ||
143 | #define DBGP_INUSE (1<<10) | ||
144 | #define DBGP_ERRCODE(x) (((x)>>7)&0x07) | ||
145 | # define DBGP_ERR_BAD 1 | ||
146 | # define DBGP_ERR_SIGNAL 2 | ||
147 | #define DBGP_ERROR (1<<6) | ||
148 | #define DBGP_GO (1<<5) | ||
149 | #define DBGP_OUT (1<<4) | ||
150 | #define DBGP_LEN(x) (((x)>>0)&0x0f) | ||
151 | u32 pids; | ||
152 | #define DBGP_PID_GET(x) (((x)>>16)&0xff) | ||
153 | #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok)) | ||
154 | u32 data03; | ||
155 | u32 data47; | ||
156 | u32 address; | ||
157 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | ||
158 | } __attribute__ ((packed)); | ||
159 | |||
160 | #endif /* __LINUX_USB_EHCI_DEF_H */ | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 303d93ffd6b2..d4b03034ee73 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -910,6 +910,8 @@ enum v4l2_mpeg_audio_encoding { | |||
910 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, | 910 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, |
911 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, | 911 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, |
912 | V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, | 912 | V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, |
913 | V4L2_MPEG_AUDIO_ENCODING_AAC = 3, | ||
914 | V4L2_MPEG_AUDIO_ENCODING_AC3 = 4, | ||
913 | }; | 915 | }; |
914 | #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) | 916 | #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) |
915 | enum v4l2_mpeg_audio_l1_bitrate { | 917 | enum v4l2_mpeg_audio_l1_bitrate { |
@@ -988,12 +990,36 @@ enum v4l2_mpeg_audio_crc { | |||
988 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, | 990 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, |
989 | }; | 991 | }; |
990 | #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) | 992 | #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) |
993 | #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110) | ||
994 | #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111) | ||
995 | enum v4l2_mpeg_audio_ac3_bitrate { | ||
996 | V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0, | ||
997 | V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1, | ||
998 | V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2, | ||
999 | V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3, | ||
1000 | V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4, | ||
1001 | V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5, | ||
1002 | V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6, | ||
1003 | V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7, | ||
1004 | V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8, | ||
1005 | V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9, | ||
1006 | V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10, | ||
1007 | V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11, | ||
1008 | V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12, | ||
1009 | V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13, | ||
1010 | V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14, | ||
1011 | V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15, | ||
1012 | V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16, | ||
1013 | V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17, | ||
1014 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, | ||
1015 | }; | ||
991 | 1016 | ||
992 | /* MPEG video */ | 1017 | /* MPEG video */ |
993 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 1018 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
994 | enum v4l2_mpeg_video_encoding { | 1019 | enum v4l2_mpeg_video_encoding { |
995 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, | 1020 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, |
996 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, | 1021 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, |
1022 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2, | ||
997 | }; | 1023 | }; |
998 | #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) | 1024 | #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) |
999 | enum v4l2_mpeg_video_aspect { | 1025 | enum v4l2_mpeg_video_aspect { |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 1cbd0a7db4e6..2f1113467f70 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -96,7 +96,7 @@ void change_console(struct vc_data *new_vc); | |||
96 | void reset_vc(struct vc_data *vc); | 96 | void reset_vc(struct vc_data *vc); |
97 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | 97 | extern int unbind_con_driver(const struct consw *csw, int first, int last, |
98 | int deflt); | 98 | int deflt); |
99 | int vty_init(void); | 99 | int vty_init(const struct file_operations *console_fops); |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * vc_screen.c shares this temporary buffer with the console write code so that | 102 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 0081147a9fe8..ef609f842fac 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -108,15 +108,6 @@ static inline int waitqueue_active(wait_queue_head_t *q) | |||
108 | return !list_empty(&q->task_list); | 108 | return !list_empty(&q->task_list); |
109 | } | 109 | } |
110 | 110 | ||
111 | /* | ||
112 | * Used to distinguish between sync and async io wait context: | ||
113 | * sync i/o typically specifies a NULL wait queue entry or a wait | ||
114 | * queue entry bound to a task (current task) to wake up. | ||
115 | * aio specifies a wait queue entry with an async notification | ||
116 | * callback routine, not associated with any task. | ||
117 | */ | ||
118 | #define is_sync_wait(wait) (!(wait) || ((wait)->private)) | ||
119 | |||
120 | extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); | 111 | extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); |
121 | extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); | 112 | extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); |
122 | extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); | 113 | extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h new file mode 100644 index 000000000000..9681d1ab0e4f --- /dev/null +++ b/include/linux/wm97xx_batt.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _LINUX_WM97XX_BAT_H | ||
2 | #define _LINUX_WM97XX_BAT_H | ||
3 | |||
4 | #include <linux/wm97xx.h> | ||
5 | |||
6 | struct wm97xx_batt_info { | ||
7 | int batt_aux; | ||
8 | int temp_aux; | ||
9 | int charge_gpio; | ||
10 | int min_voltage; | ||
11 | int max_voltage; | ||
12 | int batt_div; | ||
13 | int batt_mult; | ||
14 | int temp_div; | ||
15 | int temp_mult; | ||
16 | int batt_tech; | ||
17 | char *batt_name; | ||
18 | }; | ||
19 | |||
20 | #ifdef CONFIG_BATTERY_WM97XX | ||
21 | void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | ||
22 | #else | ||
23 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index fb0c215a3051..4bc1e6b86cb2 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -279,6 +279,7 @@ enum xfrm_attr_type_t { | |||
279 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ | 279 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ |
280 | XFRMA_MIGRATE, | 280 | XFRMA_MIGRATE, |
281 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ | 281 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ |
282 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | ||
282 | __XFRMA_MAX | 283 | __XFRMA_MAX |
283 | 284 | ||
284 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 285 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -415,6 +416,15 @@ struct xfrm_user_report { | |||
415 | struct xfrm_selector sel; | 416 | struct xfrm_selector sel; |
416 | }; | 417 | }; |
417 | 418 | ||
419 | /* Used by MIGRATE to pass addresses IKE should use to perform | ||
420 | * SA negotiation with the peer */ | ||
421 | struct xfrm_user_kmaddress { | ||
422 | xfrm_address_t local; | ||
423 | xfrm_address_t remote; | ||
424 | __u32 reserved; | ||
425 | __u16 family; | ||
426 | }; | ||
427 | |||
418 | struct xfrm_user_migrate { | 428 | struct xfrm_user_migrate { |
419 | xfrm_address_t old_daddr; | 429 | xfrm_address_t old_daddr; |
420 | xfrm_address_t old_saddr; | 430 | xfrm_address_t old_saddr; |