diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-11-23 15:47:41 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-11-23 15:47:41 -0500 |
commit | 58a273745fbb2fbd01d26e7a60f0acc8c1d99469 (patch) | |
tree | bc16200f3b6ea150b298422754e32959eaa339bc /include | |
parent | 951c486f62490e032da0ad17e93270b0cfb6687f (diff) | |
parent | 0116da4fcc1ae8a80d9002441e98768f2a6fa2fe (diff) |
Merge branches 'drivers/macb-gem' and 'drivers/pxa-gpio' into next/drivers
Diffstat (limited to 'include')
29 files changed, 431 insertions, 235 deletions
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e49c36d38d7e..bb145e4b935e 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -144,7 +144,7 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) | |||
144 | { | 144 | { |
145 | } | 145 | } |
146 | static inline int register_hotplug_dock_device(acpi_handle handle, | 146 | static inline int register_hotplug_dock_device(acpi_handle handle, |
147 | struct acpi_dock_ops *ops, | 147 | const struct acpi_dock_ops *ops, |
148 | void *context) | 148 | void *context) |
149 | { | 149 | { |
150 | return -ENODEV; | 150 | return -ENODEV; |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index b67231bef632..ed73f6705c86 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -470,7 +470,6 @@ typedef u64 acpi_integer; | |||
470 | */ | 470 | */ |
471 | #define ACPI_FULL_INITIALIZATION 0x00 | 471 | #define ACPI_FULL_INITIALIZATION 0x00 |
472 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 | 472 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 |
473 | #define ACPI_NO_HARDWARE_INIT 0x02 | ||
474 | #define ACPI_NO_EVENT_INIT 0x04 | 473 | #define ACPI_NO_EVENT_INIT 0x04 |
475 | #define ACPI_NO_HANDLER_INIT 0x08 | 474 | #define ACPI_NO_HANDLER_INIT 0x08 |
476 | #define ACPI_NO_ACPI_ENABLE 0x10 | 475 | #define ACPI_NO_ACPI_ENABLE 0x10 |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 67055f180330..610f6fb1bbc2 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -329,6 +329,7 @@ extern void acpi_processor_throttling_init(void); | |||
329 | int acpi_processor_power_init(struct acpi_processor *pr, | 329 | int acpi_processor_power_init(struct acpi_processor *pr, |
330 | struct acpi_device *device); | 330 | struct acpi_device *device); |
331 | int acpi_processor_cst_has_changed(struct acpi_processor *pr); | 331 | int acpi_processor_cst_has_changed(struct acpi_processor *pr); |
332 | int acpi_processor_hotplug(struct acpi_processor *pr); | ||
332 | int acpi_processor_power_exit(struct acpi_processor *pr, | 333 | int acpi_processor_power_exit(struct acpi_processor *pr, |
333 | struct acpi_device *device); | 334 | struct acpi_device *device); |
334 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); | 335 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index cf399495d38f..1f9e9516e2b7 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -990,7 +990,9 @@ struct drm_minor { | |||
990 | struct proc_dir_entry *proc_root; /**< proc directory entry */ | 990 | struct proc_dir_entry *proc_root; /**< proc directory entry */ |
991 | struct drm_info_node proc_nodes; | 991 | struct drm_info_node proc_nodes; |
992 | struct dentry *debugfs_root; | 992 | struct dentry *debugfs_root; |
993 | struct drm_info_node debugfs_nodes; | 993 | |
994 | struct list_head debugfs_list; | ||
995 | struct mutex debugfs_lock; /* Protects debugfs_list. */ | ||
994 | 996 | ||
995 | struct drm_master *master; /* currently active master for this node */ | 997 | struct drm_master *master; /* currently active master for this node */ |
996 | struct list_head master_list; | 998 | struct list_head master_list; |
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 0d2f727e96be..93df2d72750b 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -72,6 +72,7 @@ | |||
72 | 72 | ||
73 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 | 73 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 |
74 | 74 | ||
75 | #define DP_EDP_CONFIGURATION_CAP 0x00d | ||
75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e | 76 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e |
76 | 77 | ||
77 | #define DP_PSR_SUPPORT 0x070 | 78 | #define DP_PSR_SUPPORT 0x070 |
@@ -159,6 +160,8 @@ | |||
159 | # define DP_CP_IRQ (1 << 2) | 160 | # define DP_CP_IRQ (1 << 2) |
160 | # define DP_SINK_SPECIFIC_IRQ (1 << 6) | 161 | # define DP_SINK_SPECIFIC_IRQ (1 << 6) |
161 | 162 | ||
163 | #define DP_EDP_CONFIGURATION_SET 0x10a | ||
164 | |||
162 | #define DP_LANE0_1_STATUS 0x202 | 165 | #define DP_LANE0_1_STATUS 0x202 |
163 | #define DP_LANE2_3_STATUS 0x203 | 166 | #define DP_LANE2_3_STATUS 0x203 |
164 | # define DP_LANE_CR_DONE (1 << 0) | 167 | # define DP_LANE_CR_DONE (1 << 0) |
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index c4961ea50a49..d30bedfeb7ef 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -120,11 +120,12 @@ struct drm_mode_crtc { | |||
120 | struct drm_mode_modeinfo mode; | 120 | struct drm_mode_modeinfo mode; |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define DRM_MODE_ENCODER_NONE 0 | 123 | #define DRM_MODE_ENCODER_NONE 0 |
124 | #define DRM_MODE_ENCODER_DAC 1 | 124 | #define DRM_MODE_ENCODER_DAC 1 |
125 | #define DRM_MODE_ENCODER_TMDS 2 | 125 | #define DRM_MODE_ENCODER_TMDS 2 |
126 | #define DRM_MODE_ENCODER_LVDS 3 | 126 | #define DRM_MODE_ENCODER_LVDS 3 |
127 | #define DRM_MODE_ENCODER_TVDAC 4 | 127 | #define DRM_MODE_ENCODER_TVDAC 4 |
128 | #define DRM_MODE_ENCODER_VIRTUAL 5 | ||
128 | 129 | ||
129 | struct drm_mode_get_encoder { | 130 | struct drm_mode_get_encoder { |
130 | __u32 encoder_id; | 131 | __u32 encoder_id; |
@@ -162,6 +163,7 @@ struct drm_mode_get_encoder { | |||
162 | #define DRM_MODE_CONNECTOR_HDMIB 12 | 163 | #define DRM_MODE_CONNECTOR_HDMIB 12 |
163 | #define DRM_MODE_CONNECTOR_TV 13 | 164 | #define DRM_MODE_CONNECTOR_TV 13 |
164 | #define DRM_MODE_CONNECTOR_eDP 14 | 165 | #define DRM_MODE_CONNECTOR_eDP 14 |
166 | #define DRM_MODE_CONNECTOR_VIRTUAL 15 | ||
165 | 167 | ||
166 | struct drm_mode_get_connector { | 168 | struct drm_mode_get_connector { |
167 | 169 | ||
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h index 874c4d271328..1d161cb3aca5 100644 --- a/include/drm/exynos_drm.h +++ b/include/drm/exynos_drm.h | |||
@@ -36,11 +36,13 @@ | |||
36 | * - this size value would be page-aligned internally. | 36 | * - this size value would be page-aligned internally. |
37 | * @flags: user request for setting memory type or cache attributes. | 37 | * @flags: user request for setting memory type or cache attributes. |
38 | * @handle: returned handle for the object. | 38 | * @handle: returned handle for the object. |
39 | * @pad: just padding to be 64-bit aligned. | ||
39 | */ | 40 | */ |
40 | struct drm_exynos_gem_create { | 41 | struct drm_exynos_gem_create { |
41 | unsigned int size; | 42 | unsigned int size; |
42 | unsigned int flags; | 43 | unsigned int flags; |
43 | unsigned int handle; | 44 | unsigned int handle; |
45 | unsigned int pad; | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | /** | 48 | /** |
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h index cd7cd8162ed6..bcb0912afe7a 100644 --- a/include/drm/vmwgfx_drm.h +++ b/include/drm/vmwgfx_drm.h | |||
@@ -54,7 +54,7 @@ | |||
54 | #define DRM_VMW_FENCE_EVENT 17 | 54 | #define DRM_VMW_FENCE_EVENT 17 |
55 | #define DRM_VMW_PRESENT 18 | 55 | #define DRM_VMW_PRESENT 18 |
56 | #define DRM_VMW_PRESENT_READBACK 19 | 56 | #define DRM_VMW_PRESENT_READBACK 19 |
57 | 57 | #define DRM_VMW_UPDATE_LAYOUT 20 | |
58 | 58 | ||
59 | /*************************************************************************/ | 59 | /*************************************************************************/ |
60 | /** | 60 | /** |
@@ -552,31 +552,6 @@ struct drm_vmw_get_3d_cap_arg { | |||
552 | 552 | ||
553 | /*************************************************************************/ | 553 | /*************************************************************************/ |
554 | /** | 554 | /** |
555 | * DRM_VMW_UPDATE_LAYOUT - Update layout | ||
556 | * | ||
557 | * Updates the preferred modes and connection status for connectors. The | ||
558 | * command conisits of one drm_vmw_update_layout_arg pointing out a array | ||
559 | * of num_outputs drm_vmw_rect's. | ||
560 | */ | ||
561 | |||
562 | /** | ||
563 | * struct drm_vmw_update_layout_arg | ||
564 | * | ||
565 | * @num_outputs: number of active | ||
566 | * @rects: pointer to array of drm_vmw_rect | ||
567 | * | ||
568 | * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl. | ||
569 | */ | ||
570 | |||
571 | struct drm_vmw_update_layout_arg { | ||
572 | uint32_t num_outputs; | ||
573 | uint32_t pad64; | ||
574 | uint64_t rects; | ||
575 | }; | ||
576 | |||
577 | |||
578 | /*************************************************************************/ | ||
579 | /** | ||
580 | * DRM_VMW_FENCE_WAIT | 555 | * DRM_VMW_FENCE_WAIT |
581 | * | 556 | * |
582 | * Waits for a fence object to signal. The wait is interruptible, so that | 557 | * Waits for a fence object to signal. The wait is interruptible, so that |
@@ -788,4 +763,28 @@ struct drm_vmw_present_readback_arg { | |||
788 | uint64_t clips_ptr; | 763 | uint64_t clips_ptr; |
789 | uint64_t fence_rep; | 764 | uint64_t fence_rep; |
790 | }; | 765 | }; |
766 | |||
767 | /*************************************************************************/ | ||
768 | /** | ||
769 | * DRM_VMW_UPDATE_LAYOUT - Update layout | ||
770 | * | ||
771 | * Updates the preferred modes and connection status for connectors. The | ||
772 | * command consists of one drm_vmw_update_layout_arg pointing to an array | ||
773 | * of num_outputs drm_vmw_rect's. | ||
774 | */ | ||
775 | |||
776 | /** | ||
777 | * struct drm_vmw_update_layout_arg | ||
778 | * | ||
779 | * @num_outputs: number of active connectors | ||
780 | * @rects: pointer to array of drm_vmw_rect cast to an uint64_t | ||
781 | * | ||
782 | * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl. | ||
783 | */ | ||
784 | struct drm_vmw_update_layout_arg { | ||
785 | uint32_t num_outputs; | ||
786 | uint32_t pad64; | ||
787 | uint64_t rects; | ||
788 | }; | ||
789 | |||
791 | #endif | 790 | #endif |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 583baf22cad2..7408af843b8a 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -23,57 +23,62 @@ | |||
23 | struct module; | 23 | struct module; |
24 | 24 | ||
25 | struct cpuidle_device; | 25 | struct cpuidle_device; |
26 | struct cpuidle_driver; | ||
26 | 27 | ||
27 | 28 | ||
28 | /**************************** | 29 | /**************************** |
29 | * CPUIDLE DEVICE INTERFACE * | 30 | * CPUIDLE DEVICE INTERFACE * |
30 | ****************************/ | 31 | ****************************/ |
31 | 32 | ||
33 | struct cpuidle_state_usage { | ||
34 | void *driver_data; | ||
35 | |||
36 | unsigned long long usage; | ||
37 | unsigned long long time; /* in US */ | ||
38 | }; | ||
39 | |||
32 | struct cpuidle_state { | 40 | struct cpuidle_state { |
33 | char name[CPUIDLE_NAME_LEN]; | 41 | char name[CPUIDLE_NAME_LEN]; |
34 | char desc[CPUIDLE_DESC_LEN]; | 42 | char desc[CPUIDLE_DESC_LEN]; |
35 | void *driver_data; | ||
36 | 43 | ||
37 | unsigned int flags; | 44 | unsigned int flags; |
38 | unsigned int exit_latency; /* in US */ | 45 | unsigned int exit_latency; /* in US */ |
39 | unsigned int power_usage; /* in mW */ | 46 | unsigned int power_usage; /* in mW */ |
40 | unsigned int target_residency; /* in US */ | 47 | unsigned int target_residency; /* in US */ |
41 | 48 | ||
42 | unsigned long long usage; | ||
43 | unsigned long long time; /* in US */ | ||
44 | |||
45 | int (*enter) (struct cpuidle_device *dev, | 49 | int (*enter) (struct cpuidle_device *dev, |
46 | struct cpuidle_state *state); | 50 | struct cpuidle_driver *drv, |
51 | int index); | ||
47 | }; | 52 | }; |
48 | 53 | ||
49 | /* Idle State Flags */ | 54 | /* Idle State Flags */ |
50 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | 55 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ |
51 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ | ||
52 | 56 | ||
53 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 57 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
54 | 58 | ||
55 | /** | 59 | /** |
56 | * cpuidle_get_statedata - retrieves private driver state data | 60 | * cpuidle_get_statedata - retrieves private driver state data |
57 | * @state: the state | 61 | * @st_usage: the state usage statistics |
58 | */ | 62 | */ |
59 | static inline void * cpuidle_get_statedata(struct cpuidle_state *state) | 63 | static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage) |
60 | { | 64 | { |
61 | return state->driver_data; | 65 | return st_usage->driver_data; |
62 | } | 66 | } |
63 | 67 | ||
64 | /** | 68 | /** |
65 | * cpuidle_set_statedata - stores private driver state data | 69 | * cpuidle_set_statedata - stores private driver state data |
66 | * @state: the state | 70 | * @st_usage: the state usage statistics |
67 | * @data: the private data | 71 | * @data: the private data |
68 | */ | 72 | */ |
69 | static inline void | 73 | static inline void |
70 | cpuidle_set_statedata(struct cpuidle_state *state, void *data) | 74 | cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) |
71 | { | 75 | { |
72 | state->driver_data = data; | 76 | st_usage->driver_data = data; |
73 | } | 77 | } |
74 | 78 | ||
75 | struct cpuidle_state_kobj { | 79 | struct cpuidle_state_kobj { |
76 | struct cpuidle_state *state; | 80 | struct cpuidle_state *state; |
81 | struct cpuidle_state_usage *state_usage; | ||
77 | struct completion kobj_unregister; | 82 | struct completion kobj_unregister; |
78 | struct kobject kobj; | 83 | struct kobject kobj; |
79 | }; | 84 | }; |
@@ -81,22 +86,17 @@ struct cpuidle_state_kobj { | |||
81 | struct cpuidle_device { | 86 | struct cpuidle_device { |
82 | unsigned int registered:1; | 87 | unsigned int registered:1; |
83 | unsigned int enabled:1; | 88 | unsigned int enabled:1; |
84 | unsigned int power_specified:1; | ||
85 | unsigned int cpu; | 89 | unsigned int cpu; |
86 | 90 | ||
87 | int last_residency; | 91 | int last_residency; |
88 | int state_count; | 92 | int state_count; |
89 | struct cpuidle_state states[CPUIDLE_STATE_MAX]; | 93 | struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; |
90 | struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; | 94 | struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; |
91 | struct cpuidle_state *last_state; | ||
92 | 95 | ||
93 | struct list_head device_list; | 96 | struct list_head device_list; |
94 | struct kobject kobj; | 97 | struct kobject kobj; |
95 | struct completion kobj_unregister; | 98 | struct completion kobj_unregister; |
96 | void *governor_data; | 99 | void *governor_data; |
97 | struct cpuidle_state *safe_state; | ||
98 | |||
99 | int (*prepare) (struct cpuidle_device *dev); | ||
100 | }; | 100 | }; |
101 | 101 | ||
102 | DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); | 102 | DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); |
@@ -120,6 +120,11 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) | |||
120 | struct cpuidle_driver { | 120 | struct cpuidle_driver { |
121 | char name[CPUIDLE_NAME_LEN]; | 121 | char name[CPUIDLE_NAME_LEN]; |
122 | struct module *owner; | 122 | struct module *owner; |
123 | |||
124 | unsigned int power_specified:1; | ||
125 | struct cpuidle_state states[CPUIDLE_STATE_MAX]; | ||
126 | int state_count; | ||
127 | int safe_state_index; | ||
123 | }; | 128 | }; |
124 | 129 | ||
125 | #ifdef CONFIG_CPU_IDLE | 130 | #ifdef CONFIG_CPU_IDLE |
@@ -166,11 +171,14 @@ struct cpuidle_governor { | |||
166 | struct list_head governor_list; | 171 | struct list_head governor_list; |
167 | unsigned int rating; | 172 | unsigned int rating; |
168 | 173 | ||
169 | int (*enable) (struct cpuidle_device *dev); | 174 | int (*enable) (struct cpuidle_driver *drv, |
170 | void (*disable) (struct cpuidle_device *dev); | 175 | struct cpuidle_device *dev); |
176 | void (*disable) (struct cpuidle_driver *drv, | ||
177 | struct cpuidle_device *dev); | ||
171 | 178 | ||
172 | int (*select) (struct cpuidle_device *dev); | 179 | int (*select) (struct cpuidle_driver *drv, |
173 | void (*reflect) (struct cpuidle_device *dev); | 180 | struct cpuidle_device *dev); |
181 | void (*reflect) (struct cpuidle_device *dev, int index); | ||
174 | 182 | ||
175 | struct module *owner; | 183 | struct module *owner; |
176 | }; | 184 | }; |
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index afb94583960c..98ce8124b1cc 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -41,7 +41,7 @@ struct devfreq_dev_status { | |||
41 | unsigned long total_time; | 41 | unsigned long total_time; |
42 | unsigned long busy_time; | 42 | unsigned long busy_time; |
43 | unsigned long current_frequency; | 43 | unsigned long current_frequency; |
44 | void *private_date; | 44 | void *private_data; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /** | 47 | /** |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 45f00b61c096..de33de1e2052 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -1097,10 +1097,12 @@ struct ethtool_ops { | |||
1097 | #define SPEED_1000 1000 | 1097 | #define SPEED_1000 1000 |
1098 | #define SPEED_2500 2500 | 1098 | #define SPEED_2500 2500 |
1099 | #define SPEED_10000 10000 | 1099 | #define SPEED_10000 10000 |
1100 | #define SPEED_UNKNOWN -1 | ||
1100 | 1101 | ||
1101 | /* Duplex, half or full. */ | 1102 | /* Duplex, half or full. */ |
1102 | #define DUPLEX_HALF 0x00 | 1103 | #define DUPLEX_HALF 0x00 |
1103 | #define DUPLEX_FULL 0x01 | 1104 | #define DUPLEX_FULL 0x01 |
1105 | #define DUPLEX_UNKNOWN 0xff | ||
1104 | 1106 | ||
1105 | /* Which connector port. */ | 1107 | /* Which connector port. */ |
1106 | #define PORT_TP 0x00 | 1108 | #define PORT_TP 0x00 |
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h index 08a2fee40659..aad6bd4b3efd 100644 --- a/include/linux/hwspinlock.h +++ b/include/linux/hwspinlock.h | |||
@@ -118,7 +118,6 @@ int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags) | |||
118 | static inline | 118 | static inline |
119 | void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) | 119 | void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) |
120 | { | 120 | { |
121 | return 0; | ||
122 | } | 121 | } |
123 | 122 | ||
124 | static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) | 123 | static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index fae295048a8b..83a9caec0e43 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -1963,6 +1963,21 @@ | |||
1963 | #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ | 1963 | #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ |
1964 | 1964 | ||
1965 | /* | 1965 | /* |
1966 | * R210 (0xD2) - Mic Detect 3 | ||
1967 | */ | ||
1968 | #define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | ||
1969 | #define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | ||
1970 | #define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | ||
1971 | #define WM8958_MICD_VALID 0x0002 /* MICD_VALID */ | ||
1972 | #define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */ | ||
1973 | #define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */ | ||
1974 | #define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */ | ||
1975 | #define WM8958_MICD_STS 0x0001 /* MICD_STS */ | ||
1976 | #define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */ | ||
1977 | #define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */ | ||
1978 | #define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */ | ||
1979 | |||
1980 | /* | ||
1966 | * R76 (0x4C) - Charge Pump (1) | 1981 | * R76 (0x4C) - Charge Pump (1) |
1967 | */ | 1982 | */ |
1968 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ | 1983 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 57cc0e63714f..c4eec228eef9 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -86,24 +86,39 @@ struct nand_bbt_descr { | |||
86 | #define NAND_BBT_VERSION 0x00000100 | 86 | #define NAND_BBT_VERSION 0x00000100 |
87 | /* Create a bbt if none exists */ | 87 | /* Create a bbt if none exists */ |
88 | #define NAND_BBT_CREATE 0x00000200 | 88 | #define NAND_BBT_CREATE 0x00000200 |
89 | /* | ||
90 | * Create an empty BBT with no vendor information. Vendor's information may be | ||
91 | * unavailable, for example, if the NAND controller has a different data and OOB | ||
92 | * layout or if this information is already purged. Must be used in conjunction | ||
93 | * with NAND_BBT_CREATE. | ||
94 | */ | ||
95 | #define NAND_BBT_CREATE_EMPTY 0x00000400 | ||
89 | /* Search good / bad pattern through all pages of a block */ | 96 | /* Search good / bad pattern through all pages of a block */ |
90 | #define NAND_BBT_SCANALLPAGES 0x00000400 | 97 | #define NAND_BBT_SCANALLPAGES 0x00000800 |
91 | /* Scan block empty during good / bad block scan */ | 98 | /* Scan block empty during good / bad block scan */ |
92 | #define NAND_BBT_SCANEMPTY 0x00000800 | 99 | #define NAND_BBT_SCANEMPTY 0x00001000 |
93 | /* Write bbt if neccecary */ | 100 | /* Write bbt if neccecary */ |
94 | #define NAND_BBT_WRITE 0x00001000 | 101 | #define NAND_BBT_WRITE 0x00002000 |
95 | /* Read and write back block contents when writing bbt */ | 102 | /* Read and write back block contents when writing bbt */ |
96 | #define NAND_BBT_SAVECONTENT 0x00002000 | 103 | #define NAND_BBT_SAVECONTENT 0x00004000 |
97 | /* Search good / bad pattern on the first and the second page */ | 104 | /* Search good / bad pattern on the first and the second page */ |
98 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 | 105 | #define NAND_BBT_SCAN2NDPAGE 0x00008000 |
99 | /* Search good / bad pattern on the last page of the eraseblock */ | 106 | /* Search good / bad pattern on the last page of the eraseblock */ |
100 | #define NAND_BBT_SCANLASTPAGE 0x00008000 | 107 | #define NAND_BBT_SCANLASTPAGE 0x00010000 |
101 | /* Chip stores bad block marker on BOTH 1st and 6th bytes of OOB */ | 108 | /* |
102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 | 109 | * Use a flash based bad block table. By default, OOB identifier is saved in |
103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ | 110 | * OOB area. This option is passed to the default bad block table function. |
104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 | 111 | */ |
105 | /* The bad block table does not OOB for marker */ | 112 | #define NAND_BBT_USE_FLASH 0x00020000 |
106 | #define NAND_BBT_NO_OOB 0x00400000 | 113 | /* Do not store flash based bad block table in OOB area; store it in-band */ |
114 | #define NAND_BBT_NO_OOB 0x00040000 | ||
115 | |||
116 | /* | ||
117 | * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr | ||
118 | * was allocated dynamicaly and must be freed in nand_release(). Has no meaning | ||
119 | * in nand_chip.bbt_options. | ||
120 | */ | ||
121 | #define NAND_BBT_DYNAMICSTRUCT 0x80000000 | ||
107 | 122 | ||
108 | /* The maximum number of blocks to scan for a bbt */ | 123 | /* The maximum number of blocks to scan for a bbt */ |
109 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | 124 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 37be05bbfbc8..9f5b312af783 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -32,17 +32,19 @@ | |||
32 | #define MTD_CHAR_MAJOR 90 | 32 | #define MTD_CHAR_MAJOR 90 |
33 | #define MTD_BLOCK_MAJOR 31 | 33 | #define MTD_BLOCK_MAJOR 31 |
34 | 34 | ||
35 | #define MTD_ERASE_PENDING 0x01 | 35 | #define MTD_ERASE_PENDING 0x01 |
36 | #define MTD_ERASING 0x02 | 36 | #define MTD_ERASING 0x02 |
37 | #define MTD_ERASE_SUSPEND 0x04 | 37 | #define MTD_ERASE_SUSPEND 0x04 |
38 | #define MTD_ERASE_DONE 0x08 | 38 | #define MTD_ERASE_DONE 0x08 |
39 | #define MTD_ERASE_FAILED 0x10 | 39 | #define MTD_ERASE_FAILED 0x10 |
40 | 40 | ||
41 | #define MTD_FAIL_ADDR_UNKNOWN -1LL | 41 | #define MTD_FAIL_ADDR_UNKNOWN -1LL |
42 | 42 | ||
43 | /* If the erase fails, fail_addr might indicate exactly which block failed. If | 43 | /* |
44 | fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not | 44 | * If the erase fails, fail_addr might indicate exactly which block failed. If |
45 | specific to any particular block. */ | 45 | * fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level |
46 | * or was not specific to any particular block. | ||
47 | */ | ||
46 | struct erase_info { | 48 | struct erase_info { |
47 | struct mtd_info *mtd; | 49 | struct mtd_info *mtd; |
48 | uint64_t addr; | 50 | uint64_t addr; |
@@ -59,26 +61,12 @@ struct erase_info { | |||
59 | }; | 61 | }; |
60 | 62 | ||
61 | struct mtd_erase_region_info { | 63 | struct mtd_erase_region_info { |
62 | uint64_t offset; /* At which this region starts, from the beginning of the MTD */ | 64 | uint64_t offset; /* At which this region starts, from the beginning of the MTD */ |
63 | uint32_t erasesize; /* For this region */ | 65 | uint32_t erasesize; /* For this region */ |
64 | uint32_t numblocks; /* Number of blocks of erasesize in this region */ | 66 | uint32_t numblocks; /* Number of blocks of erasesize in this region */ |
65 | unsigned long *lockmap; /* If keeping bitmap of locks */ | 67 | unsigned long *lockmap; /* If keeping bitmap of locks */ |
66 | }; | 68 | }; |
67 | 69 | ||
68 | /* | ||
69 | * oob operation modes | ||
70 | * | ||
71 | * MTD_OOB_PLACE: oob data are placed at the given offset | ||
72 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas | ||
73 | * which are defined by the ecclayout | ||
74 | * MTD_OOB_RAW: mode to read oob and data without doing ECC checking | ||
75 | */ | ||
76 | typedef enum { | ||
77 | MTD_OOB_PLACE, | ||
78 | MTD_OOB_AUTO, | ||
79 | MTD_OOB_RAW, | ||
80 | } mtd_oob_mode_t; | ||
81 | |||
82 | /** | 70 | /** |
83 | * struct mtd_oob_ops - oob operation operands | 71 | * struct mtd_oob_ops - oob operation operands |
84 | * @mode: operation mode | 72 | * @mode: operation mode |
@@ -90,7 +78,7 @@ typedef enum { | |||
90 | * @ooblen: number of oob bytes to write/read | 78 | * @ooblen: number of oob bytes to write/read |
91 | * @oobretlen: number of oob bytes written/read | 79 | * @oobretlen: number of oob bytes written/read |
92 | * @ooboffs: offset of oob data in the oob area (only relevant when | 80 | * @ooboffs: offset of oob data in the oob area (only relevant when |
93 | * mode = MTD_OOB_PLACE) | 81 | * mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW) |
94 | * @datbuf: data buffer - if NULL only oob data are read/written | 82 | * @datbuf: data buffer - if NULL only oob data are read/written |
95 | * @oobbuf: oob data buffer | 83 | * @oobbuf: oob data buffer |
96 | * | 84 | * |
@@ -99,7 +87,7 @@ typedef enum { | |||
99 | * OOB area. | 87 | * OOB area. |
100 | */ | 88 | */ |
101 | struct mtd_oob_ops { | 89 | struct mtd_oob_ops { |
102 | mtd_oob_mode_t mode; | 90 | unsigned int mode; |
103 | size_t len; | 91 | size_t len; |
104 | size_t retlen; | 92 | size_t retlen; |
105 | size_t ooblen; | 93 | size_t ooblen; |
@@ -173,7 +161,7 @@ struct mtd_info { | |||
173 | const char *name; | 161 | const char *name; |
174 | int index; | 162 | int index; |
175 | 163 | ||
176 | /* ecc layout structure pointer - read only ! */ | 164 | /* ECC layout structure pointer - read only! */ |
177 | struct nand_ecclayout *ecclayout; | 165 | struct nand_ecclayout *ecclayout; |
178 | 166 | ||
179 | /* Data for variable erase regions. If numeraseregions is zero, | 167 | /* Data for variable erase regions. If numeraseregions is zero, |
@@ -324,10 +312,15 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) | |||
324 | /* Kernel-side ioctl definitions */ | 312 | /* Kernel-side ioctl definitions */ |
325 | 313 | ||
326 | struct mtd_partition; | 314 | struct mtd_partition; |
327 | 315 | struct mtd_part_parser_data; | |
328 | extern int mtd_device_register(struct mtd_info *master, | 316 | |
329 | const struct mtd_partition *parts, | 317 | extern int mtd_device_parse_register(struct mtd_info *mtd, |
330 | int nr_parts); | 318 | const char **part_probe_types, |
319 | struct mtd_part_parser_data *parser_data, | ||
320 | const struct mtd_partition *defparts, | ||
321 | int defnr_parts); | ||
322 | #define mtd_device_register(master, parts, nr_parts) \ | ||
323 | mtd_device_parse_register(master, NULL, NULL, parts, nr_parts) | ||
331 | extern int mtd_device_unregister(struct mtd_info *master); | 324 | extern int mtd_device_unregister(struct mtd_info *master); |
332 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); | 325 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); |
333 | extern int __get_mtd_device(struct mtd_info *mtd); | 326 | extern int __get_mtd_device(struct mtd_info *mtd); |
@@ -356,27 +349,16 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); | |||
356 | 349 | ||
357 | void mtd_erase_callback(struct erase_info *instr); | 350 | void mtd_erase_callback(struct erase_info *instr); |
358 | 351 | ||
359 | /* | 352 | static inline int mtd_is_bitflip(int err) { |
360 | * Debugging macro and defines | 353 | return err == -EUCLEAN; |
361 | */ | 354 | } |
362 | #define MTD_DEBUG_LEVEL0 (0) /* Quiet */ | 355 | |
363 | #define MTD_DEBUG_LEVEL1 (1) /* Audible */ | 356 | static inline int mtd_is_eccerr(int err) { |
364 | #define MTD_DEBUG_LEVEL2 (2) /* Loud */ | 357 | return err == -EBADMSG; |
365 | #define MTD_DEBUG_LEVEL3 (3) /* Noisy */ | 358 | } |
366 | 359 | ||
367 | #ifdef CONFIG_MTD_DEBUG | 360 | static inline int mtd_is_bitflip_or_eccerr(int err) { |
368 | #define DEBUG(n, args...) \ | 361 | return mtd_is_bitflip(err) || mtd_is_eccerr(err); |
369 | do { \ | 362 | } |
370 | if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ | ||
371 | printk(KERN_INFO args); \ | ||
372 | } while(0) | ||
373 | #else /* CONFIG_MTD_DEBUG */ | ||
374 | #define DEBUG(n, args...) \ | ||
375 | do { \ | ||
376 | if (0) \ | ||
377 | printk(KERN_INFO args); \ | ||
378 | } while(0) | ||
379 | |||
380 | #endif /* CONFIG_MTD_DEBUG */ | ||
381 | 363 | ||
382 | #endif /* __MTD_MTD_H__ */ | 364 | #endif /* __MTD_MTD_H__ */ |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index c2b9ac4fbc4a..904131bab501 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -42,10 +42,10 @@ extern void nand_release(struct mtd_info *mtd); | |||
42 | /* Internal helper for board drivers which need to override command function */ | 42 | /* Internal helper for board drivers which need to override command function */ |
43 | extern void nand_wait_ready(struct mtd_info *mtd); | 43 | extern void nand_wait_ready(struct mtd_info *mtd); |
44 | 44 | ||
45 | /* locks all blockes present in the device */ | 45 | /* locks all blocks present in the device */ |
46 | extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | 46 | extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); |
47 | 47 | ||
48 | /* unlocks specified locked blockes */ | 48 | /* unlocks specified locked blocks */ |
49 | extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | 49 | extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); |
50 | 50 | ||
51 | /* The maximum number of NAND chips in an array */ | 51 | /* The maximum number of NAND chips in an array */ |
@@ -150,7 +150,7 @@ typedef enum { | |||
150 | #define NAND_ECC_READ 0 | 150 | #define NAND_ECC_READ 0 |
151 | /* Reset Hardware ECC for write */ | 151 | /* Reset Hardware ECC for write */ |
152 | #define NAND_ECC_WRITE 1 | 152 | #define NAND_ECC_WRITE 1 |
153 | /* Enable Hardware ECC before syndrom is read back from flash */ | 153 | /* Enable Hardware ECC before syndrome is read back from flash */ |
154 | #define NAND_ECC_READSYN 2 | 154 | #define NAND_ECC_READSYN 2 |
155 | 155 | ||
156 | /* Bit mask for flags passed to do_nand_read_ecc */ | 156 | /* Bit mask for flags passed to do_nand_read_ecc */ |
@@ -163,7 +163,7 @@ typedef enum { | |||
163 | */ | 163 | */ |
164 | /* Chip can not auto increment pages */ | 164 | /* Chip can not auto increment pages */ |
165 | #define NAND_NO_AUTOINCR 0x00000001 | 165 | #define NAND_NO_AUTOINCR 0x00000001 |
166 | /* Buswitdh is 16 bit */ | 166 | /* Buswidth is 16 bit */ |
167 | #define NAND_BUSWIDTH_16 0x00000002 | 167 | #define NAND_BUSWIDTH_16 0x00000002 |
168 | /* Device supports partial programming without padding */ | 168 | /* Device supports partial programming without padding */ |
169 | #define NAND_NO_PADDING 0x00000004 | 169 | #define NAND_NO_PADDING 0x00000004 |
@@ -219,27 +219,15 @@ typedef enum { | |||
219 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) | 219 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
220 | 220 | ||
221 | /* Non chip related options */ | 221 | /* Non chip related options */ |
222 | /* | ||
223 | * Use a flash based bad block table. OOB identifier is saved in OOB area. | ||
224 | * This option is passed to the default bad block table function. | ||
225 | */ | ||
226 | #define NAND_USE_FLASH_BBT 0x00010000 | ||
227 | /* This option skips the bbt scan during initialization. */ | 222 | /* This option skips the bbt scan during initialization. */ |
228 | #define NAND_SKIP_BBTSCAN 0x00020000 | 223 | #define NAND_SKIP_BBTSCAN 0x00010000 |
229 | /* | 224 | /* |
230 | * This option is defined if the board driver allocates its own buffers | 225 | * This option is defined if the board driver allocates its own buffers |
231 | * (e.g. because it needs them DMA-coherent). | 226 | * (e.g. because it needs them DMA-coherent). |
232 | */ | 227 | */ |
233 | #define NAND_OWN_BUFFERS 0x00040000 | 228 | #define NAND_OWN_BUFFERS 0x00020000 |
234 | /* Chip may not exist, so silence any errors in scan */ | 229 | /* Chip may not exist, so silence any errors in scan */ |
235 | #define NAND_SCAN_SILENT_NODEV 0x00080000 | 230 | #define NAND_SCAN_SILENT_NODEV 0x00040000 |
236 | /* | ||
237 | * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch | ||
238 | * the OOB area. | ||
239 | */ | ||
240 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00800000 | ||
241 | /* Create an empty BBT with no vendor information if the BBT is available */ | ||
242 | #define NAND_CREATE_EMPTY_BBT 0x01000000 | ||
243 | 231 | ||
244 | /* Options set by nand scan */ | 232 | /* Options set by nand scan */ |
245 | /* Nand scan has allocated controller struct */ | 233 | /* Nand scan has allocated controller struct */ |
@@ -331,27 +319,29 @@ struct nand_hw_control { | |||
331 | }; | 319 | }; |
332 | 320 | ||
333 | /** | 321 | /** |
334 | * struct nand_ecc_ctrl - Control structure for ecc | 322 | * struct nand_ecc_ctrl - Control structure for ECC |
335 | * @mode: ecc mode | 323 | * @mode: ECC mode |
336 | * @steps: number of ecc steps per page | 324 | * @steps: number of ECC steps per page |
337 | * @size: data bytes per ecc step | 325 | * @size: data bytes per ECC step |
338 | * @bytes: ecc bytes per step | 326 | * @bytes: ECC bytes per step |
339 | * @total: total number of ecc bytes per page | 327 | * @total: total number of ECC bytes per page |
340 | * @prepad: padding information for syndrome based ecc generators | 328 | * @prepad: padding information for syndrome based ECC generators |
341 | * @postpad: padding information for syndrome based ecc generators | 329 | * @postpad: padding information for syndrome based ECC generators |
342 | * @layout: ECC layout control struct pointer | 330 | * @layout: ECC layout control struct pointer |
343 | * @priv: pointer to private ecc control data | 331 | * @priv: pointer to private ECC control data |
344 | * @hwctl: function to control hardware ecc generator. Must only | 332 | * @hwctl: function to control hardware ECC generator. Must only |
345 | * be provided if an hardware ECC is available | 333 | * be provided if an hardware ECC is available |
346 | * @calculate: function for ecc calculation or readback from ecc hardware | 334 | * @calculate: function for ECC calculation or readback from ECC hardware |
347 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 335 | * @correct: function for ECC correction, matching to ECC generator (sw/hw) |
348 | * @read_page_raw: function to read a raw page without ECC | 336 | * @read_page_raw: function to read a raw page without ECC |
349 | * @write_page_raw: function to write a raw page without ECC | 337 | * @write_page_raw: function to write a raw page without ECC |
350 | * @read_page: function to read a page according to the ecc generator | 338 | * @read_page: function to read a page according to the ECC generator |
351 | * requirements. | 339 | * requirements. |
352 | * @read_subpage: function to read parts of the page covered by ECC. | 340 | * @read_subpage: function to read parts of the page covered by ECC. |
353 | * @write_page: function to write a page according to the ecc generator | 341 | * @write_page: function to write a page according to the ECC generator |
354 | * requirements. | 342 | * requirements. |
343 | * @write_oob_raw: function to write chip OOB data without ECC | ||
344 | * @read_oob_raw: function to read chip OOB data without ECC | ||
355 | * @read_oob: function to read chip OOB data | 345 | * @read_oob: function to read chip OOB data |
356 | * @write_oob: function to write chip OOB data | 346 | * @write_oob: function to write chip OOB data |
357 | */ | 347 | */ |
@@ -380,6 +370,10 @@ struct nand_ecc_ctrl { | |||
380 | uint32_t offs, uint32_t len, uint8_t *buf); | 370 | uint32_t offs, uint32_t len, uint8_t *buf); |
381 | void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | 371 | void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
382 | const uint8_t *buf); | 372 | const uint8_t *buf); |
373 | int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, | ||
374 | int page); | ||
375 | int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, | ||
376 | int page, int sndcmd); | ||
383 | int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, | 377 | int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, |
384 | int sndcmd); | 378 | int sndcmd); |
385 | int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, | 379 | int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, |
@@ -388,8 +382,8 @@ struct nand_ecc_ctrl { | |||
388 | 382 | ||
389 | /** | 383 | /** |
390 | * struct nand_buffers - buffer structure for read/write | 384 | * struct nand_buffers - buffer structure for read/write |
391 | * @ecccalc: buffer for calculated ecc | 385 | * @ecccalc: buffer for calculated ECC |
392 | * @ecccode: buffer for ecc read from flash | 386 | * @ecccode: buffer for ECC read from flash |
393 | * @databuf: buffer for data - dynamically sized | 387 | * @databuf: buffer for data - dynamically sized |
394 | * | 388 | * |
395 | * Do not change the order of buffers. databuf and oobrbuf must be in | 389 | * Do not change the order of buffers. databuf and oobrbuf must be in |
@@ -422,7 +416,7 @@ struct nand_buffers { | |||
422 | * mtd->oobsize, mtd->writesize and so on. | 416 | * mtd->oobsize, mtd->writesize and so on. |
423 | * @id_data contains the 8 bytes values of NAND_CMD_READID. | 417 | * @id_data contains the 8 bytes values of NAND_CMD_READID. |
424 | * Return with the bus width. | 418 | * Return with the bus width. |
425 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing | 419 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accessing |
426 | * device ready/busy line. If set to NULL no access to | 420 | * device ready/busy line. If set to NULL no access to |
427 | * ready/busy is available and the ready/busy information | 421 | * ready/busy is available and the ready/busy information |
428 | * is read from the chip status register. | 422 | * is read from the chip status register. |
@@ -430,17 +424,17 @@ struct nand_buffers { | |||
430 | * commands to the chip. | 424 | * commands to the chip. |
431 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on | 425 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on |
432 | * ready. | 426 | * ready. |
433 | * @ecc: [BOARDSPECIFIC] ecc control ctructure | 427 | * @ecc: [BOARDSPECIFIC] ECC control structure |
434 | * @buffers: buffer structure for read/write | 428 | * @buffers: buffer structure for read/write |
435 | * @hwcontrol: platform-specific hardware control structure | 429 | * @hwcontrol: platform-specific hardware control structure |
436 | * @ops: oob operation operands | ||
437 | * @erase_cmd: [INTERN] erase command write function, selectable due | 430 | * @erase_cmd: [INTERN] erase command write function, selectable due |
438 | * to AND support. | 431 | * to AND support. |
439 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 432 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
440 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring | 433 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring |
441 | * data from array to read regs (tR). | 434 | * data from array to read regs (tR). |
442 | * @state: [INTERN] the current state of the NAND device | 435 | * @state: [INTERN] the current state of the NAND device |
443 | * @oob_poi: poison value buffer | 436 | * @oob_poi: "poison value buffer," used for laying out OOB data |
437 | * before writing | ||
444 | * @page_shift: [INTERN] number of address bits in a page (column | 438 | * @page_shift: [INTERN] number of address bits in a page (column |
445 | * address bits). | 439 | * address bits). |
446 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 440 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
@@ -449,6 +443,9 @@ struct nand_buffers { | |||
449 | * @options: [BOARDSPECIFIC] various chip options. They can partly | 443 | * @options: [BOARDSPECIFIC] various chip options. They can partly |
450 | * be set to inform nand_scan about special functionality. | 444 | * be set to inform nand_scan about special functionality. |
451 | * See the defines for further explanation. | 445 | * See the defines for further explanation. |
446 | * @bbt_options: [INTERN] bad block specific options. All options used | ||
447 | * here must come from bbm.h. By default, these options | ||
448 | * will be copied to the appropriate nand_bbt_descr's. | ||
452 | * @badblockpos: [INTERN] position of the bad block marker in the oob | 449 | * @badblockpos: [INTERN] position of the bad block marker in the oob |
453 | * area. | 450 | * area. |
454 | * @badblockbits: [INTERN] number of bits to left-shift the bad block | 451 | * @badblockbits: [INTERN] number of bits to left-shift the bad block |
@@ -464,7 +461,7 @@ struct nand_buffers { | |||
464 | * non 0 if ONFI supported. | 461 | * non 0 if ONFI supported. |
465 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is | 462 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is |
466 | * supported, 0 otherwise. | 463 | * supported, 0 otherwise. |
467 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | 464 | * @ecclayout: [REPLACEABLE] the default ECC placement scheme |
468 | * @bbt: [INTERN] bad block table pointer | 465 | * @bbt: [INTERN] bad block table pointer |
469 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash | 466 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash |
470 | * lookup. | 467 | * lookup. |
@@ -472,9 +469,9 @@ struct nand_buffers { | |||
472 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial | 469 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial |
473 | * bad block scan. | 470 | * bad block scan. |
474 | * @controller: [REPLACEABLE] a pointer to a hardware controller | 471 | * @controller: [REPLACEABLE] a pointer to a hardware controller |
475 | * structure which is shared among multiple independend | 472 | * structure which is shared among multiple independent |
476 | * devices. | 473 | * devices. |
477 | * @priv: [OPTIONAL] pointer to private chip date | 474 | * @priv: [OPTIONAL] pointer to private chip data |
478 | * @errstat: [OPTIONAL] hardware specific function to perform | 475 | * @errstat: [OPTIONAL] hardware specific function to perform |
479 | * additional error status checks (determine if errors are | 476 | * additional error status checks (determine if errors are |
480 | * correctable). | 477 | * correctable). |
@@ -509,6 +506,7 @@ struct nand_chip { | |||
509 | 506 | ||
510 | int chip_delay; | 507 | int chip_delay; |
511 | unsigned int options; | 508 | unsigned int options; |
509 | unsigned int bbt_options; | ||
512 | 510 | ||
513 | int page_shift; | 511 | int page_shift; |
514 | int phys_erase_shift; | 512 | int phys_erase_shift; |
@@ -536,8 +534,6 @@ struct nand_chip { | |||
536 | struct nand_buffers *buffers; | 534 | struct nand_buffers *buffers; |
537 | struct nand_hw_control hwcontrol; | 535 | struct nand_hw_control hwcontrol; |
538 | 536 | ||
539 | struct mtd_oob_ops ops; | ||
540 | |||
541 | uint8_t *bbt; | 537 | uint8_t *bbt; |
542 | struct nand_bbt_descr *bbt_td; | 538 | struct nand_bbt_descr *bbt_td; |
543 | struct nand_bbt_descr *bbt_md; | 539 | struct nand_bbt_descr *bbt_md; |
@@ -611,10 +607,9 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
611 | * @partitions: mtd partition list | 607 | * @partitions: mtd partition list |
612 | * @chip_delay: R/B delay value in us | 608 | * @chip_delay: R/B delay value in us |
613 | * @options: Option flags, e.g. 16bit buswidth | 609 | * @options: Option flags, e.g. 16bit buswidth |
614 | * @ecclayout: ecc layout info structure | 610 | * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH |
611 | * @ecclayout: ECC layout info structure | ||
615 | * @part_probe_types: NULL-terminated array of probe types | 612 | * @part_probe_types: NULL-terminated array of probe types |
616 | * @set_parts: platform specific function to set partitions | ||
617 | * @priv: hardware controller specific settings | ||
618 | */ | 613 | */ |
619 | struct platform_nand_chip { | 614 | struct platform_nand_chip { |
620 | int nr_chips; | 615 | int nr_chips; |
@@ -624,9 +619,8 @@ struct platform_nand_chip { | |||
624 | struct nand_ecclayout *ecclayout; | 619 | struct nand_ecclayout *ecclayout; |
625 | int chip_delay; | 620 | int chip_delay; |
626 | unsigned int options; | 621 | unsigned int options; |
622 | unsigned int bbt_options; | ||
627 | const char **part_probe_types; | 623 | const char **part_probe_types; |
628 | void (*set_parts)(uint64_t size, struct platform_nand_chip *chip); | ||
629 | void *priv; | ||
630 | }; | 624 | }; |
631 | 625 | ||
632 | /* Keep gcc happy */ | 626 | /* Keep gcc happy */ |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 52b6f187bf49..4596503c9da9 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -184,6 +184,9 @@ struct onenand_chip { | |||
184 | #define ONENAND_IS_CACHE_PROGRAM(this) \ | 184 | #define ONENAND_IS_CACHE_PROGRAM(this) \ |
185 | (this->options & ONENAND_HAS_CACHE_PROGRAM) | 185 | (this->options & ONENAND_HAS_CACHE_PROGRAM) |
186 | 186 | ||
187 | #define ONENAND_IS_NOP_1(this) \ | ||
188 | (this->options & ONENAND_HAS_NOP_1) | ||
189 | |||
187 | /* Check byte access in OneNAND */ | 190 | /* Check byte access in OneNAND */ |
188 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 191 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
189 | 192 | ||
@@ -195,6 +198,7 @@ struct onenand_chip { | |||
195 | #define ONENAND_HAS_2PLANE (0x0004) | 198 | #define ONENAND_HAS_2PLANE (0x0004) |
196 | #define ONENAND_HAS_4KB_PAGE (0x0008) | 199 | #define ONENAND_HAS_4KB_PAGE (0x0008) |
197 | #define ONENAND_HAS_CACHE_PROGRAM (0x0010) | 200 | #define ONENAND_HAS_CACHE_PROGRAM (0x0010) |
201 | #define ONENAND_HAS_NOP_1 (0x0020) | ||
198 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | 202 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) |
199 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 203 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
200 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 204 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 3a6f0372fc96..2475228c1158 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -24,7 +24,9 @@ | |||
24 | * will extend to the end of the master MTD device. | 24 | * will extend to the end of the master MTD device. |
25 | * offset: absolute starting position within the master MTD device; if | 25 | * offset: absolute starting position within the master MTD device; if |
26 | * defined as MTDPART_OFS_APPEND, the partition will start where the | 26 | * defined as MTDPART_OFS_APPEND, the partition will start where the |
27 | * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. | 27 | * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block; |
28 | * if MTDPART_OFS_RETAIN, consume as much as possible, leaving size | ||
29 | * after the end of partition. | ||
28 | * mask_flags: contains flags that have to be masked (removed) from the | 30 | * mask_flags: contains flags that have to be masked (removed) from the |
29 | * master MTD flag set for the corresponding MTD partition. | 31 | * master MTD flag set for the corresponding MTD partition. |
30 | * For example, to force a read-only partition, simply adding | 32 | * For example, to force a read-only partition, simply adding |
@@ -42,12 +44,25 @@ struct mtd_partition { | |||
42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ | 44 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ |
43 | }; | 45 | }; |
44 | 46 | ||
47 | #define MTDPART_OFS_RETAIN (-3) | ||
45 | #define MTDPART_OFS_NXTBLK (-2) | 48 | #define MTDPART_OFS_NXTBLK (-2) |
46 | #define MTDPART_OFS_APPEND (-1) | 49 | #define MTDPART_OFS_APPEND (-1) |
47 | #define MTDPART_SIZ_FULL (0) | 50 | #define MTDPART_SIZ_FULL (0) |
48 | 51 | ||
49 | 52 | ||
50 | struct mtd_info; | 53 | struct mtd_info; |
54 | struct device_node; | ||
55 | |||
56 | /** | ||
57 | * struct mtd_part_parser_data - used to pass data to MTD partition parsers. | ||
58 | * @origin: for RedBoot, start address of MTD device | ||
59 | * @of_node: for OF parsers, device node containing partitioning information | ||
60 | */ | ||
61 | struct mtd_part_parser_data { | ||
62 | unsigned long origin; | ||
63 | struct device_node *of_node; | ||
64 | }; | ||
65 | |||
51 | 66 | ||
52 | /* | 67 | /* |
53 | * Functions dealing with the various ways of partitioning the space | 68 | * Functions dealing with the various ways of partitioning the space |
@@ -57,37 +72,12 @@ struct mtd_part_parser { | |||
57 | struct list_head list; | 72 | struct list_head list; |
58 | struct module *owner; | 73 | struct module *owner; |
59 | const char *name; | 74 | const char *name; |
60 | int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long); | 75 | int (*parse_fn)(struct mtd_info *, struct mtd_partition **, |
76 | struct mtd_part_parser_data *); | ||
61 | }; | 77 | }; |
62 | 78 | ||
63 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 79 | extern int register_mtd_parser(struct mtd_part_parser *parser); |
64 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); | 80 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); |
65 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | ||
66 | struct mtd_partition **pparts, unsigned long origin); | ||
67 | |||
68 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) | ||
69 | |||
70 | struct device; | ||
71 | struct device_node; | ||
72 | |||
73 | #ifdef CONFIG_MTD_OF_PARTS | ||
74 | int __devinit of_mtd_parse_partitions(struct device *dev, | ||
75 | struct device_node *node, | ||
76 | struct mtd_partition **pparts); | ||
77 | #else | ||
78 | static inline int of_mtd_parse_partitions(struct device *dev, | ||
79 | struct device_node *node, | ||
80 | struct mtd_partition **pparts) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | #endif | ||
85 | |||
86 | #ifdef CONFIG_MTD_CMDLINE_PARTS | ||
87 | static inline int mtd_has_cmdlinepart(void) { return 1; } | ||
88 | #else | ||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | ||
90 | #endif | ||
91 | 81 | ||
92 | int mtd_is_partition(struct mtd_info *mtd); | 82 | int mtd_is_partition(struct mtd_info *mtd); |
93 | int mtd_add_partition(struct mtd_info *master, char *name, | 83 | int mtd_add_partition(struct mtd_info *master, char *name, |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index e5f21d293c70..04e018160e2b 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -32,21 +32,4 @@ struct physmap_flash_data { | |||
32 | struct mtd_partition *parts; | 32 | struct mtd_partition *parts; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | /* | ||
36 | * Board needs to specify the exact mapping during their setup time. | ||
37 | */ | ||
38 | void physmap_configure(unsigned long addr, unsigned long size, | ||
39 | int bankwidth, void (*set_vpp)(struct map_info *, int) ); | ||
40 | |||
41 | /* | ||
42 | * Machines that wish to do flash partition may want to call this function in | ||
43 | * their setup routine. | ||
44 | * | ||
45 | * physmap_set_partitions(mypartitions, num_parts); | ||
46 | * | ||
47 | * Note that one can always override this hard-coded partition with | ||
48 | * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS). | ||
49 | */ | ||
50 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); | ||
51 | |||
52 | #endif /* __LINUX_MTD_PHYSMAP__ */ | 35 | #endif /* __LINUX_MTD_PHYSMAP__ */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3fdf251389de..172ba70306d1 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2405,6 +2405,8 @@ | |||
2405 | 2405 | ||
2406 | #define PCI_VENDOR_ID_AZWAVE 0x1a3b | 2406 | #define PCI_VENDOR_ID_AZWAVE 0x1a3b |
2407 | 2407 | ||
2408 | #define PCI_VENDOR_ID_ASMEDIA 0x1b21 | ||
2409 | |||
2408 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 | 2410 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
2409 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 | 2411 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
2410 | 2412 | ||
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 3605e947fa90..04c011038f32 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -121,6 +121,7 @@ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); | |||
121 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | 121 | extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); |
122 | #else | 122 | #else |
123 | 123 | ||
124 | struct pinctrl_dev; | ||
124 | 125 | ||
125 | /* Sufficiently stupid default function when pinctrl is not in use */ | 126 | /* Sufficiently stupid default function when pinctrl is not in use */ |
126 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) | 127 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) |
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h new file mode 100644 index 000000000000..e7c748fb6053 --- /dev/null +++ b/include/linux/platform_data/macb.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __MACB_PDATA_H__ | ||
9 | #define __MACB_PDATA_H__ | ||
10 | |||
11 | struct macb_platform_data { | ||
12 | u32 phy_mask; | ||
13 | u8 phy_irq_pin; /* PHY IRQ */ | ||
14 | u8 is_rmii; /* using RMII interface? */ | ||
15 | }; | ||
16 | |||
17 | #endif /* __MACB_PDATA_H__ */ | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 0efa1f10bc2b..369273a52679 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -67,6 +67,7 @@ enum { | |||
67 | SCIx_IRDA_REGTYPE, | 67 | SCIx_IRDA_REGTYPE, |
68 | SCIx_SCIFA_REGTYPE, | 68 | SCIx_SCIFA_REGTYPE, |
69 | SCIx_SCIFB_REGTYPE, | 69 | SCIx_SCIFB_REGTYPE, |
70 | SCIx_SH2_SCIF_FIFODATA_REGTYPE, | ||
70 | SCIx_SH3_SCIF_REGTYPE, | 71 | SCIx_SH3_SCIF_REGTYPE, |
71 | SCIx_SH4_SCIF_REGTYPE, | 72 | SCIx_SH4_SCIF_REGTYPE, |
72 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 73 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 3ccf18648d0a..a20831cf336a 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
@@ -52,7 +52,6 @@ struct clk { | |||
52 | 52 | ||
53 | unsigned long arch_flags; | 53 | unsigned long arch_flags; |
54 | void *priv; | 54 | void *priv; |
55 | struct dentry *dentry; | ||
56 | struct clk_mapping *mapping; | 55 | struct clk_mapping *mapping; |
57 | struct cpufreq_frequency_table *freq_table; | 56 | struct cpufreq_frequency_table *freq_table; |
58 | unsigned int nr_freqs; | 57 | unsigned int nr_freqs; |
@@ -94,6 +93,9 @@ int clk_rate_table_find(struct clk *clk, | |||
94 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, | 93 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, |
95 | unsigned int div_max, unsigned long rate); | 94 | unsigned int div_max, unsigned long rate); |
96 | 95 | ||
96 | long clk_rate_mult_range_round(struct clk *clk, unsigned int mult_min, | ||
97 | unsigned int mult_max, unsigned long rate); | ||
98 | |||
97 | long clk_round_parent(struct clk *clk, unsigned long target, | 99 | long clk_round_parent(struct clk *clk, unsigned long target, |
98 | unsigned long *best_freq, unsigned long *parent_freq, | 100 | unsigned long *best_freq, unsigned long *parent_freq, |
99 | unsigned int div_min, unsigned int div_max); | 101 | unsigned int div_min, unsigned int div_max); |
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index bc8c9208f7e2..8446789216e5 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h | |||
@@ -104,4 +104,80 @@ struct pinmux_info { | |||
104 | int register_pinmux(struct pinmux_info *pip); | 104 | int register_pinmux(struct pinmux_info *pip); |
105 | int unregister_pinmux(struct pinmux_info *pip); | 105 | int unregister_pinmux(struct pinmux_info *pip); |
106 | 106 | ||
107 | /* helper macro for port */ | ||
108 | #define PORT_1(fn, pfx, sfx) fn(pfx, sfx) | ||
109 | |||
110 | #define PORT_10(fn, pfx, sfx) \ | ||
111 | PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \ | ||
112 | PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \ | ||
113 | PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \ | ||
114 | PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \ | ||
115 | PORT_1(fn, pfx##8, sfx), PORT_1(fn, pfx##9, sfx) | ||
116 | |||
117 | #define PORT_90(fn, pfx, sfx) \ | ||
118 | PORT_10(fn, pfx##1, sfx), PORT_10(fn, pfx##2, sfx), \ | ||
119 | PORT_10(fn, pfx##3, sfx), PORT_10(fn, pfx##4, sfx), \ | ||
120 | PORT_10(fn, pfx##5, sfx), PORT_10(fn, pfx##6, sfx), \ | ||
121 | PORT_10(fn, pfx##7, sfx), PORT_10(fn, pfx##8, sfx), \ | ||
122 | PORT_10(fn, pfx##9, sfx) | ||
123 | |||
124 | #define _PORT_ALL(pfx, sfx) pfx##_##sfx | ||
125 | #define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA) | ||
126 | #define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str) | ||
127 | #define GPIO_PORT_ALL() CPU_ALL_PORT(_GPIO_PORT, , unused) | ||
128 | #define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK) | ||
129 | |||
130 | /* helper macro for pinmux_enum_t */ | ||
131 | #define PORT_DATA_I(nr) \ | ||
132 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN) | ||
133 | |||
134 | #define PORT_DATA_I_PD(nr) \ | ||
135 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
136 | PORT##nr##_IN, PORT##nr##_IN_PD) | ||
137 | |||
138 | #define PORT_DATA_I_PU(nr) \ | ||
139 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
140 | PORT##nr##_IN, PORT##nr##_IN_PU) | ||
141 | |||
142 | #define PORT_DATA_I_PU_PD(nr) \ | ||
143 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \ | ||
144 | PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU) | ||
145 | |||
146 | #define PORT_DATA_O(nr) \ | ||
147 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT) | ||
148 | |||
149 | #define PORT_DATA_IO(nr) \ | ||
150 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
151 | PORT##nr##_IN) | ||
152 | |||
153 | #define PORT_DATA_IO_PD(nr) \ | ||
154 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
155 | PORT##nr##_IN, PORT##nr##_IN_PD) | ||
156 | |||
157 | #define PORT_DATA_IO_PU(nr) \ | ||
158 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
159 | PORT##nr##_IN, PORT##nr##_IN_PU) | ||
160 | |||
161 | #define PORT_DATA_IO_PU_PD(nr) \ | ||
162 | PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \ | ||
163 | PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU) | ||
164 | |||
165 | /* helper macro for top 4 bits in PORTnCR */ | ||
166 | #define _PCRH(in, in_pd, in_pu, out) \ | ||
167 | 0, (out), (in), 0, \ | ||
168 | 0, 0, 0, 0, \ | ||
169 | 0, 0, (in_pd), 0, \ | ||
170 | 0, 0, (in_pu), 0 | ||
171 | |||
172 | #define PORTCR(nr, reg) \ | ||
173 | { \ | ||
174 | PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \ | ||
175 | _PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \ | ||
176 | PORT##nr##_IN_PU, PORT##nr##_OUT), \ | ||
177 | PORT##nr##_FN0, PORT##nr##_FN1, \ | ||
178 | PORT##nr##_FN2, PORT##nr##_FN3, \ | ||
179 | PORT##nr##_FN4, PORT##nr##_FN5, \ | ||
180 | PORT##nr##_FN6, PORT##nr##_FN7 } \ | ||
181 | } | ||
182 | |||
107 | #endif /* __SH_PFC_H */ | 183 | #endif /* __SH_PFC_H */ |
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 2f7d45bcbd24..1a7e1d20adf9 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -45,6 +45,51 @@ struct mtd_oob_buf64 { | |||
45 | __u64 usr_ptr; | 45 | __u64 usr_ptr; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /** | ||
49 | * MTD operation modes | ||
50 | * | ||
51 | * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default) | ||
52 | * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas | ||
53 | * which are defined by the internal ecclayout | ||
54 | * @MTD_OPS_RAW: data are transferred as-is, with no error correction; | ||
55 | * this mode implies %MTD_OPS_PLACE_OOB | ||
56 | * | ||
57 | * These modes can be passed to ioctl(MEMWRITE) and are also used internally. | ||
58 | * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs. | ||
59 | * %MTD_FILE_MODE_RAW. | ||
60 | */ | ||
61 | enum { | ||
62 | MTD_OPS_PLACE_OOB = 0, | ||
63 | MTD_OPS_AUTO_OOB = 1, | ||
64 | MTD_OPS_RAW = 2, | ||
65 | }; | ||
66 | |||
67 | /** | ||
68 | * struct mtd_write_req - data structure for requesting a write operation | ||
69 | * | ||
70 | * @start: start address | ||
71 | * @len: length of data buffer | ||
72 | * @ooblen: length of OOB buffer | ||
73 | * @usr_data: user-provided data buffer | ||
74 | * @usr_oob: user-provided OOB buffer | ||
75 | * @mode: MTD mode (see "MTD operation modes") | ||
76 | * @padding: reserved, must be set to 0 | ||
77 | * | ||
78 | * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB | ||
79 | * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to | ||
80 | * write data-only, set @usr_oob == NULL. However, setting both @usr_data and | ||
81 | * @usr_oob to NULL is not allowed. | ||
82 | */ | ||
83 | struct mtd_write_req { | ||
84 | __u64 start; | ||
85 | __u64 len; | ||
86 | __u64 ooblen; | ||
87 | __u64 usr_data; | ||
88 | __u64 usr_oob; | ||
89 | __u8 mode; | ||
90 | __u8 padding[7]; | ||
91 | }; | ||
92 | |||
48 | #define MTD_ABSENT 0 | 93 | #define MTD_ABSENT 0 |
49 | #define MTD_RAM 1 | 94 | #define MTD_RAM 1 |
50 | #define MTD_ROM 2 | 95 | #define MTD_ROM 2 |
@@ -59,13 +104,13 @@ struct mtd_oob_buf64 { | |||
59 | #define MTD_NO_ERASE 0x1000 /* No erase necessary */ | 104 | #define MTD_NO_ERASE 0x1000 /* No erase necessary */ |
60 | #define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ | 105 | #define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ |
61 | 106 | ||
62 | // Some common devices / combinations of capabilities | 107 | /* Some common devices / combinations of capabilities */ |
63 | #define MTD_CAP_ROM 0 | 108 | #define MTD_CAP_ROM 0 |
64 | #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) | 109 | #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) |
65 | #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) | 110 | #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) |
66 | #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) | 111 | #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) |
67 | 112 | ||
68 | /* ECC byte placement */ | 113 | /* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */ |
69 | #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) | 114 | #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) |
70 | #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) | 115 | #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) |
71 | #define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme | 116 | #define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme |
@@ -80,21 +125,18 @@ struct mtd_oob_buf64 { | |||
80 | struct mtd_info_user { | 125 | struct mtd_info_user { |
81 | __u8 type; | 126 | __u8 type; |
82 | __u32 flags; | 127 | __u32 flags; |
83 | __u32 size; // Total size of the MTD | 128 | __u32 size; /* Total size of the MTD */ |
84 | __u32 erasesize; | 129 | __u32 erasesize; |
85 | __u32 writesize; | 130 | __u32 writesize; |
86 | __u32 oobsize; // Amount of OOB data per block (e.g. 16) | 131 | __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */ |
87 | /* The below two fields are obsolete and broken, do not use them | 132 | __u64 padding; /* Old obsolete field; do not use */ |
88 | * (TODO: remove at some point) */ | ||
89 | __u32 ecctype; | ||
90 | __u32 eccsize; | ||
91 | }; | 133 | }; |
92 | 134 | ||
93 | struct region_info_user { | 135 | struct region_info_user { |
94 | __u32 offset; /* At which this region starts, | 136 | __u32 offset; /* At which this region starts, |
95 | * from the beginning of the MTD */ | 137 | * from the beginning of the MTD */ |
96 | __u32 erasesize; /* For this region */ | 138 | __u32 erasesize; /* For this region */ |
97 | __u32 numblocks; /* Number of blocks in this region */ | 139 | __u32 numblocks; /* Number of blocks in this region */ |
98 | __u32 regionindex; | 140 | __u32 regionindex; |
99 | }; | 141 | }; |
100 | 142 | ||
@@ -104,29 +146,61 @@ struct otp_info { | |||
104 | __u32 locked; | 146 | __u32 locked; |
105 | }; | 147 | }; |
106 | 148 | ||
149 | /* | ||
150 | * Note, the following ioctl existed in the past and was removed: | ||
151 | * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) | ||
152 | * Try to avoid adding a new ioctl with the same ioctl number. | ||
153 | */ | ||
154 | |||
155 | /* Get basic MTD characteristics info (better to use sysfs) */ | ||
107 | #define MEMGETINFO _IOR('M', 1, struct mtd_info_user) | 156 | #define MEMGETINFO _IOR('M', 1, struct mtd_info_user) |
157 | /* Erase segment of MTD */ | ||
108 | #define MEMERASE _IOW('M', 2, struct erase_info_user) | 158 | #define MEMERASE _IOW('M', 2, struct erase_info_user) |
159 | /* Write out-of-band data from MTD */ | ||
109 | #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) | 160 | #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) |
161 | /* Read out-of-band data from MTD */ | ||
110 | #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) | 162 | #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) |
163 | /* Lock a chip (for MTD that supports it) */ | ||
111 | #define MEMLOCK _IOW('M', 5, struct erase_info_user) | 164 | #define MEMLOCK _IOW('M', 5, struct erase_info_user) |
165 | /* Unlock a chip (for MTD that supports it) */ | ||
112 | #define MEMUNLOCK _IOW('M', 6, struct erase_info_user) | 166 | #define MEMUNLOCK _IOW('M', 6, struct erase_info_user) |
167 | /* Get the number of different erase regions */ | ||
113 | #define MEMGETREGIONCOUNT _IOR('M', 7, int) | 168 | #define MEMGETREGIONCOUNT _IOR('M', 7, int) |
169 | /* Get information about the erase region for a specific index */ | ||
114 | #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) | 170 | #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) |
115 | #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) | 171 | /* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */ |
116 | #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) | 172 | #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) |
173 | /* Check if an eraseblock is bad */ | ||
117 | #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) | 174 | #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) |
175 | /* Mark an eraseblock as bad */ | ||
118 | #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) | 176 | #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) |
177 | /* Set OTP (One-Time Programmable) mode (factory vs. user) */ | ||
119 | #define OTPSELECT _IOR('M', 13, int) | 178 | #define OTPSELECT _IOR('M', 13, int) |
179 | /* Get number of OTP (One-Time Programmable) regions */ | ||
120 | #define OTPGETREGIONCOUNT _IOW('M', 14, int) | 180 | #define OTPGETREGIONCOUNT _IOW('M', 14, int) |
181 | /* Get all OTP (One-Time Programmable) info about MTD */ | ||
121 | #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) | 182 | #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) |
183 | /* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */ | ||
122 | #define OTPLOCK _IOR('M', 16, struct otp_info) | 184 | #define OTPLOCK _IOR('M', 16, struct otp_info) |
185 | /* Get ECC layout (deprecated) */ | ||
123 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) | 186 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) |
187 | /* Get statistics about corrected/uncorrected errors */ | ||
124 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) | 188 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) |
189 | /* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */ | ||
125 | #define MTDFILEMODE _IO('M', 19) | 190 | #define MTDFILEMODE _IO('M', 19) |
191 | /* Erase segment of MTD (supports 64-bit address) */ | ||
126 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) | 192 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) |
193 | /* Write data to OOB (64-bit version) */ | ||
127 | #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) | 194 | #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) |
195 | /* Read data from OOB (64-bit version) */ | ||
128 | #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) | 196 | #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) |
197 | /* Check if chip is locked (for MTD that supports it) */ | ||
129 | #define MEMISLOCKED _IOR('M', 23, struct erase_info_user) | 198 | #define MEMISLOCKED _IOR('M', 23, struct erase_info_user) |
199 | /* | ||
200 | * Most generic write interface; can write in-band and/or out-of-band in various | ||
201 | * modes (see "struct mtd_write_req") | ||
202 | */ | ||
203 | #define MEMWRITE _IOWR('M', 24, struct mtd_write_req) | ||
130 | 204 | ||
131 | /* | 205 | /* |
132 | * Obsolete legacy interface. Keep it in order not to break userspace | 206 | * Obsolete legacy interface. Keep it in order not to break userspace |
@@ -177,13 +251,27 @@ struct mtd_ecc_stats { | |||
177 | }; | 251 | }; |
178 | 252 | ||
179 | /* | 253 | /* |
180 | * Read/write file modes for access to MTD | 254 | * MTD file modes - for read/write access to MTD |
255 | * | ||
256 | * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled | ||
257 | * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode | ||
258 | * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode | ||
259 | * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled | ||
260 | * | ||
261 | * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained | ||
262 | * separately for each open file descriptor. | ||
263 | * | ||
264 | * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW - | ||
265 | * raw access to the flash, without error correction or autoplacement schemes. | ||
266 | * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode | ||
267 | * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is | ||
268 | * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)). | ||
181 | */ | 269 | */ |
182 | enum mtd_file_modes { | 270 | enum mtd_file_modes { |
183 | MTD_MODE_NORMAL = MTD_OTP_OFF, | 271 | MTD_FILE_MODE_NORMAL = MTD_OTP_OFF, |
184 | MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY, | 272 | MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY, |
185 | MTD_MODE_OTP_USER = MTD_OTP_USER, | 273 | MTD_FILE_MODE_OTP_USER = MTD_OTP_USER, |
186 | MTD_MODE_RAW, | 274 | MTD_FILE_MODE_RAW, |
187 | }; | 275 | }; |
188 | 276 | ||
189 | #endif /* __MTD_ABI_H__ */ | 277 | #endif /* __MTD_ABI_H__ */ |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index d5eee2093b1e..e2e3ecad1008 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -211,6 +211,7 @@ struct rfcomm_dlc { | |||
211 | #define RFCOMM_AUTH_ACCEPT 6 | 211 | #define RFCOMM_AUTH_ACCEPT 6 |
212 | #define RFCOMM_AUTH_REJECT 7 | 212 | #define RFCOMM_AUTH_REJECT 7 |
213 | #define RFCOMM_DEFER_SETUP 8 | 213 | #define RFCOMM_DEFER_SETUP 8 |
214 | #define RFCOMM_ENC_DROP 9 | ||
214 | 215 | ||
215 | /* Scheduling flags and events */ | 216 | /* Scheduling flags and events */ |
216 | #define RFCOMM_SCHED_WAKEUP 31 | 217 | #define RFCOMM_SCHED_WAKEUP 31 |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index dc1123aa8181..72eddd1b410b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -3567,8 +3567,9 @@ rate_lowest_index(struct ieee80211_supported_band *sband, | |||
3567 | return i; | 3567 | return i; |
3568 | 3568 | ||
3569 | /* warn when we cannot find a rate. */ | 3569 | /* warn when we cannot find a rate. */ |
3570 | WARN_ON(1); | 3570 | WARN_ON_ONCE(1); |
3571 | 3571 | ||
3572 | /* and return 0 (the lowest index) */ | ||
3572 | return 0; | 3573 | return 0; |
3573 | } | 3574 | } |
3574 | 3575 | ||
diff --git a/include/net/netlink.h b/include/net/netlink.h index 98c185441bee..cb1f3504687f 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -192,8 +192,15 @@ enum { | |||
192 | * NLA_NUL_STRING Maximum length of string (excluding NUL) | 192 | * NLA_NUL_STRING Maximum length of string (excluding NUL) |
193 | * NLA_FLAG Unused | 193 | * NLA_FLAG Unused |
194 | * NLA_BINARY Maximum length of attribute payload | 194 | * NLA_BINARY Maximum length of attribute payload |
195 | * NLA_NESTED_COMPAT Exact length of structure payload | 195 | * NLA_NESTED Don't use `len' field -- length verification is |
196 | * All other Exact length of attribute payload | 196 | * done by checking len of nested header (or empty) |
197 | * NLA_NESTED_COMPAT Minimum length of structure payload | ||
198 | * NLA_U8, NLA_U16, | ||
199 | * NLA_U32, NLA_U64, | ||
200 | * NLA_MSECS Leaving the length field zero will verify the | ||
201 | * given type fits, using it verifies minimum length | ||
202 | * just like "All other" | ||
203 | * All other Minimum length of attribute payload | ||
197 | * | 204 | * |
198 | * Example: | 205 | * Example: |
199 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { | 206 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { |