diff options
Diffstat (limited to 'include')
88 files changed, 2317 insertions, 596 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 4543b6f75867..83062ed0ef2f 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -189,6 +189,8 @@ void acpi_os_fixed_event_count(u32 fixed_event_number); | |||
| 189 | /* | 189 | /* |
| 190 | * Threads and Scheduling | 190 | * Threads and Scheduling |
| 191 | */ | 191 | */ |
| 192 | extern struct workqueue_struct *kacpi_hotplug_wq; | ||
| 193 | |||
| 192 | acpi_thread_id acpi_os_get_thread_id(void); | 194 | acpi_thread_id acpi_os_get_thread_id(void); |
| 193 | 195 | ||
| 194 | acpi_status | 196 | acpi_status |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index d494001b1226..8c8621097fa0 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -41,6 +41,7 @@ static inline bool gpio_is_valid(int number) | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | struct device; | 43 | struct device; |
| 44 | struct gpio; | ||
| 44 | struct seq_file; | 45 | struct seq_file; |
| 45 | struct module; | 46 | struct module; |
| 46 | struct device_node; | 47 | struct device_node; |
| @@ -170,18 +171,6 @@ extern int __gpio_cansleep(unsigned gpio); | |||
| 170 | 171 | ||
| 171 | extern int __gpio_to_irq(unsigned gpio); | 172 | extern int __gpio_to_irq(unsigned gpio); |
| 172 | 173 | ||
| 173 | /** | ||
| 174 | * struct gpio - a structure describing a GPIO with configuration | ||
| 175 | * @gpio: the GPIO number | ||
| 176 | * @flags: GPIO configuration as specified by GPIOF_* | ||
| 177 | * @label: a literal description string of this GPIO | ||
| 178 | */ | ||
| 179 | struct gpio { | ||
| 180 | unsigned gpio; | ||
| 181 | unsigned long flags; | ||
| 182 | const char *label; | ||
| 183 | }; | ||
| 184 | |||
| 185 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | 174 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); |
| 186 | extern int gpio_request_array(const struct gpio *array, size_t num); | 175 | extern int gpio_request_array(const struct gpio *array, size_t num); |
| 187 | extern void gpio_free_array(const struct gpio *array, size_t num); | 176 | extern void gpio_free_array(const struct gpio *array, size_t num); |
| @@ -220,13 +209,13 @@ static inline int gpio_cansleep(unsigned gpio) | |||
| 220 | static inline int gpio_get_value_cansleep(unsigned gpio) | 209 | static inline int gpio_get_value_cansleep(unsigned gpio) |
| 221 | { | 210 | { |
| 222 | might_sleep(); | 211 | might_sleep(); |
| 223 | return gpio_get_value(gpio); | 212 | return __gpio_get_value(gpio); |
| 224 | } | 213 | } |
| 225 | 214 | ||
| 226 | static inline void gpio_set_value_cansleep(unsigned gpio, int value) | 215 | static inline void gpio_set_value_cansleep(unsigned gpio, int value) |
| 227 | { | 216 | { |
| 228 | might_sleep(); | 217 | might_sleep(); |
| 229 | gpio_set_value(gpio, value); | 218 | __gpio_set_value(gpio, value); |
| 230 | } | 219 | } |
| 231 | 220 | ||
| 232 | #endif /* !CONFIG_GPIOLIB */ | 221 | #endif /* !CONFIG_GPIOLIB */ |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 9b7c2bb4bb44..43538b643560 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -1624,6 +1624,9 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) | |||
| 1624 | drm_gem_object_unreference_unlocked(obj); | 1624 | drm_gem_object_unreference_unlocked(obj); |
| 1625 | } | 1625 | } |
| 1626 | 1626 | ||
| 1627 | void drm_gem_free_mmap_offset(struct drm_gem_object *obj); | ||
| 1628 | int drm_gem_create_mmap_offset(struct drm_gem_object *obj); | ||
| 1629 | |||
| 1627 | struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, | 1630 | struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, |
| 1628 | struct drm_file *filp, | 1631 | struct drm_file *filp, |
| 1629 | u32 handle); | 1632 | u32 handle); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 44335e57eaaa..802079809282 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -466,6 +466,8 @@ enum drm_connector_force { | |||
| 466 | /* DACs should rarely do this without a lot of testing */ | 466 | /* DACs should rarely do this without a lot of testing */ |
| 467 | #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) | 467 | #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) |
| 468 | 468 | ||
| 469 | #define MAX_ELD_BYTES 128 | ||
| 470 | |||
| 469 | /** | 471 | /** |
| 470 | * drm_connector - central DRM connector control structure | 472 | * drm_connector - central DRM connector control structure |
| 471 | * @crtc: CRTC this connector is currently connected to, NULL if none | 473 | * @crtc: CRTC this connector is currently connected to, NULL if none |
| @@ -523,6 +525,13 @@ struct drm_connector { | |||
| 523 | uint32_t force_encoder_id; | 525 | uint32_t force_encoder_id; |
| 524 | struct drm_encoder *encoder; /* currently active encoder */ | 526 | struct drm_encoder *encoder; /* currently active encoder */ |
| 525 | 527 | ||
| 528 | /* EDID bits */ | ||
| 529 | uint8_t eld[MAX_ELD_BYTES]; | ||
| 530 | bool dvi_dual; | ||
| 531 | int max_tmds_clock; /* in MHz */ | ||
| 532 | bool latency_present[2]; | ||
| 533 | int video_latency[2]; /* [0]: progressive, [1]: interlaced */ | ||
| 534 | int audio_latency[2]; | ||
| 526 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ | 535 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ |
| 527 | }; | 536 | }; |
| 528 | 537 | ||
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 91567bbdb027..0d2f727e96be 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
| @@ -74,6 +74,20 @@ | |||
| 74 | 74 | ||
| 75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e | 75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e |
| 76 | 76 | ||
| 77 | #define DP_PSR_SUPPORT 0x070 | ||
| 78 | # define DP_PSR_IS_SUPPORTED 1 | ||
| 79 | #define DP_PSR_CAPS 0x071 | ||
| 80 | # define DP_PSR_NO_TRAIN_ON_EXIT 1 | ||
| 81 | # define DP_PSR_SETUP_TIME_330 (0 << 1) | ||
| 82 | # define DP_PSR_SETUP_TIME_275 (1 << 1) | ||
| 83 | # define DP_PSR_SETUP_TIME_220 (2 << 1) | ||
| 84 | # define DP_PSR_SETUP_TIME_165 (3 << 1) | ||
| 85 | # define DP_PSR_SETUP_TIME_110 (4 << 1) | ||
| 86 | # define DP_PSR_SETUP_TIME_55 (5 << 1) | ||
| 87 | # define DP_PSR_SETUP_TIME_0 (6 << 1) | ||
| 88 | # define DP_PSR_SETUP_TIME_MASK (7 << 1) | ||
| 89 | # define DP_PSR_SETUP_TIME_SHIFT 1 | ||
| 90 | |||
| 77 | /* link configuration */ | 91 | /* link configuration */ |
| 78 | #define DP_LINK_BW_SET 0x100 | 92 | #define DP_LINK_BW_SET 0x100 |
| 79 | # define DP_LINK_BW_1_62 0x06 | 93 | # define DP_LINK_BW_1_62 0x06 |
| @@ -133,6 +147,18 @@ | |||
| 133 | #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 | 147 | #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 |
| 134 | # define DP_SET_ANSI_8B10B (1 << 0) | 148 | # define DP_SET_ANSI_8B10B (1 << 0) |
| 135 | 149 | ||
| 150 | #define DP_PSR_EN_CFG 0x170 | ||
| 151 | # define DP_PSR_ENABLE (1 << 0) | ||
| 152 | # define DP_PSR_MAIN_LINK_ACTIVE (1 << 1) | ||
| 153 | # define DP_PSR_CRC_VERIFICATION (1 << 2) | ||
| 154 | # define DP_PSR_FRAME_CAPTURE (1 << 3) | ||
| 155 | |||
| 156 | #define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201 | ||
| 157 | # define DP_REMOTE_CONTROL_COMMAND_PENDING (1 << 0) | ||
| 158 | # define DP_AUTOMATED_TEST_REQUEST (1 << 1) | ||
| 159 | # define DP_CP_IRQ (1 << 2) | ||
| 160 | # define DP_SINK_SPECIFIC_IRQ (1 << 6) | ||
| 161 | |||
| 136 | #define DP_LANE0_1_STATUS 0x202 | 162 | #define DP_LANE0_1_STATUS 0x202 |
| 137 | #define DP_LANE2_3_STATUS 0x203 | 163 | #define DP_LANE2_3_STATUS 0x203 |
| 138 | # define DP_LANE_CR_DONE (1 << 0) | 164 | # define DP_LANE_CR_DONE (1 << 0) |
| @@ -165,10 +191,45 @@ | |||
| 165 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 | 191 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 |
| 166 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 | 192 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 |
| 167 | 193 | ||
| 194 | #define DP_TEST_REQUEST 0x218 | ||
| 195 | # define DP_TEST_LINK_TRAINING (1 << 0) | ||
| 196 | # define DP_TEST_LINK_PATTERN (1 << 1) | ||
| 197 | # define DP_TEST_LINK_EDID_READ (1 << 2) | ||
| 198 | # define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */ | ||
| 199 | |||
| 200 | #define DP_TEST_LINK_RATE 0x219 | ||
| 201 | # define DP_LINK_RATE_162 (0x6) | ||
| 202 | # define DP_LINK_RATE_27 (0xa) | ||
| 203 | |||
| 204 | #define DP_TEST_LANE_COUNT 0x220 | ||
| 205 | |||
| 206 | #define DP_TEST_PATTERN 0x221 | ||
| 207 | |||
| 208 | #define DP_TEST_RESPONSE 0x260 | ||
| 209 | # define DP_TEST_ACK (1 << 0) | ||
| 210 | # define DP_TEST_NAK (1 << 1) | ||
| 211 | # define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) | ||
| 212 | |||
| 168 | #define DP_SET_POWER 0x600 | 213 | #define DP_SET_POWER 0x600 |
| 169 | # define DP_SET_POWER_D0 0x1 | 214 | # define DP_SET_POWER_D0 0x1 |
| 170 | # define DP_SET_POWER_D3 0x2 | 215 | # define DP_SET_POWER_D3 0x2 |
| 171 | 216 | ||
| 217 | #define DP_PSR_ERROR_STATUS 0x2006 | ||
| 218 | # define DP_PSR_LINK_CRC_ERROR (1 << 0) | ||
| 219 | # define DP_PSR_RFB_STORAGE_ERROR (1 << 1) | ||
| 220 | |||
| 221 | #define DP_PSR_ESI 0x2007 | ||
| 222 | # define DP_PSR_CAPS_CHANGE (1 << 0) | ||
| 223 | |||
| 224 | #define DP_PSR_STATUS 0x2008 | ||
| 225 | # define DP_PSR_SINK_INACTIVE 0 | ||
| 226 | # define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1 | ||
| 227 | # define DP_PSR_SINK_ACTIVE_RFB 2 | ||
| 228 | # define DP_PSR_SINK_ACTIVE_SINK_SYNCED 3 | ||
| 229 | # define DP_PSR_SINK_ACTIVE_RESYNC 4 | ||
| 230 | # define DP_PSR_SINK_INTERNAL_ERROR 7 | ||
| 231 | # define DP_PSR_SINK_STATE_MASK 0x07 | ||
| 232 | |||
| 172 | #define MODE_I2C_START 1 | 233 | #define MODE_I2C_START 1 |
| 173 | #define MODE_I2C_WRITE 2 | 234 | #define MODE_I2C_WRITE 2 |
| 174 | #define MODE_I2C_READ 4 | 235 | #define MODE_I2C_READ 4 |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index eacb415b309a..74ce91684629 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
| @@ -230,4 +230,13 @@ struct edid { | |||
| 230 | 230 | ||
| 231 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) | 231 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) |
| 232 | 232 | ||
| 233 | struct drm_encoder; | ||
| 234 | struct drm_connector; | ||
| 235 | struct drm_display_mode; | ||
| 236 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); | ||
| 237 | int drm_av_sync_delay(struct drm_connector *connector, | ||
| 238 | struct drm_display_mode *mode); | ||
| 239 | struct drm_connector *drm_select_eld(struct drm_encoder *encoder, | ||
| 240 | struct drm_display_mode *mode); | ||
| 241 | |||
| 233 | #endif /* __DRM_EDID_H__ */ | 242 | #endif /* __DRM_EDID_H__ */ |
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h new file mode 100644 index 000000000000..874c4d271328 --- /dev/null +++ b/include/drm/exynos_drm.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* exynos_drm.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
| 4 | * Authors: | ||
| 5 | * Inki Dae <inki.dae@samsung.com> | ||
| 6 | * Joonyoung Shim <jy0922.shim@samsung.com> | ||
| 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> | ||
| 8 | * | ||
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 10 | * copy of this software and associated documentation files (the "Software"), | ||
| 11 | * to deal in the Software without restriction, including without limitation | ||
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 14 | * Software is furnished to do so, subject to the following conditions: | ||
| 15 | * | ||
| 16 | * The above copyright notice and this permission notice (including the next | ||
| 17 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 18 | * Software. | ||
| 19 | * | ||
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 23 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 26 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _EXYNOS_DRM_H_ | ||
| 30 | #define _EXYNOS_DRM_H_ | ||
| 31 | |||
| 32 | /** | ||
| 33 | * User-desired buffer creation information structure. | ||
| 34 | * | ||
| 35 | * @size: requested size for the object. | ||
| 36 | * - this size value would be page-aligned internally. | ||
| 37 | * @flags: user request for setting memory type or cache attributes. | ||
| 38 | * @handle: returned handle for the object. | ||
| 39 | */ | ||
| 40 | struct drm_exynos_gem_create { | ||
| 41 | unsigned int size; | ||
| 42 | unsigned int flags; | ||
| 43 | unsigned int handle; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * A structure for getting buffer offset. | ||
| 48 | * | ||
| 49 | * @handle: a pointer to gem object created. | ||
| 50 | * @pad: just padding to be 64-bit aligned. | ||
| 51 | * @offset: relatived offset value of the memory region allocated. | ||
| 52 | * - this value should be set by user. | ||
| 53 | */ | ||
| 54 | struct drm_exynos_gem_map_off { | ||
| 55 | unsigned int handle; | ||
| 56 | unsigned int pad; | ||
| 57 | uint64_t offset; | ||
| 58 | }; | ||
| 59 | |||
| 60 | /** | ||
| 61 | * A structure for mapping buffer. | ||
| 62 | * | ||
| 63 | * @handle: a handle to gem object created. | ||
| 64 | * @size: memory size to be mapped. | ||
| 65 | * @mapped: having user virtual address mmaped. | ||
| 66 | * - this variable would be filled by exynos gem module | ||
| 67 | * of kernel side with user virtual address which is allocated | ||
| 68 | * by do_mmap(). | ||
| 69 | */ | ||
| 70 | struct drm_exynos_gem_mmap { | ||
| 71 | unsigned int handle; | ||
| 72 | unsigned int size; | ||
| 73 | uint64_t mapped; | ||
| 74 | }; | ||
| 75 | |||
| 76 | #define DRM_EXYNOS_GEM_CREATE 0x00 | ||
| 77 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 | ||
| 78 | #define DRM_EXYNOS_GEM_MMAP 0x02 | ||
| 79 | |||
| 80 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 81 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) | ||
| 82 | |||
| 83 | #define DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 84 | DRM_EXYNOS_GEM_MAP_OFFSET, struct drm_exynos_gem_map_off) | ||
| 85 | |||
| 86 | #define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 87 | DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) | ||
| 88 | |||
| 89 | /** | ||
| 90 | * Platform Specific Structure for DRM based FIMD. | ||
| 91 | * | ||
| 92 | * @timing: default video mode for initializing | ||
| 93 | * @default_win: default window layer number to be used for UI. | ||
| 94 | * @bpp: default bit per pixel. | ||
| 95 | */ | ||
| 96 | struct exynos_drm_fimd_pdata { | ||
| 97 | struct fb_videomode timing; | ||
| 98 | u32 vidcon0; | ||
| 99 | u32 vidcon1; | ||
| 100 | unsigned int default_win; | ||
| 101 | unsigned int bpp; | ||
| 102 | }; | ||
| 103 | |||
| 104 | #endif | ||
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index 9e343c0998b4..b174620cc9b3 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h | |||
| @@ -13,6 +13,8 @@ const struct intel_gtt { | |||
| 13 | unsigned int gtt_mappable_entries; | 13 | unsigned int gtt_mappable_entries; |
| 14 | /* Whether i915 needs to use the dmar apis or not. */ | 14 | /* Whether i915 needs to use the dmar apis or not. */ |
| 15 | unsigned int needs_dmar : 1; | 15 | unsigned int needs_dmar : 1; |
| 16 | /* Whether we idle the gpu before mapping/unmapping */ | ||
| 17 | unsigned int do_idle_maps : 1; | ||
| 16 | } *intel_gtt_get(void); | 18 | } *intel_gtt_get(void); |
| 17 | 19 | ||
| 18 | void intel_gtt_chipset_flush(void); | 20 | void intel_gtt_chipset_flush(void); |
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h index 5c36432d9ce5..cd7cd8162ed6 100644 --- a/include/drm/vmwgfx_drm.h +++ b/include/drm/vmwgfx_drm.h | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #define DRM_VMW_MAX_SURFACE_FACES 6 | 31 | #define DRM_VMW_MAX_SURFACE_FACES 6 |
| 32 | #define DRM_VMW_MAX_MIP_LEVELS 24 | 32 | #define DRM_VMW_MAX_MIP_LEVELS 24 |
| 33 | 33 | ||
| 34 | #define DRM_VMW_EXT_NAME_LEN 128 | ||
| 35 | 34 | ||
| 36 | #define DRM_VMW_GET_PARAM 0 | 35 | #define DRM_VMW_GET_PARAM 0 |
| 37 | #define DRM_VMW_ALLOC_DMABUF 1 | 36 | #define DRM_VMW_ALLOC_DMABUF 1 |
| @@ -48,10 +47,13 @@ | |||
| 48 | #define DRM_VMW_UNREF_SURFACE 10 | 47 | #define DRM_VMW_UNREF_SURFACE 10 |
| 49 | #define DRM_VMW_REF_SURFACE 11 | 48 | #define DRM_VMW_REF_SURFACE 11 |
| 50 | #define DRM_VMW_EXECBUF 12 | 49 | #define DRM_VMW_EXECBUF 12 |
| 51 | #define DRM_VMW_FIFO_DEBUG 13 | 50 | #define DRM_VMW_GET_3D_CAP 13 |
| 52 | #define DRM_VMW_FENCE_WAIT 14 | 51 | #define DRM_VMW_FENCE_WAIT 14 |
| 53 | /* guarded by minor version >= 2 */ | 52 | #define DRM_VMW_FENCE_SIGNALED 15 |
| 54 | #define DRM_VMW_UPDATE_LAYOUT 15 | 53 | #define DRM_VMW_FENCE_UNREF 16 |
| 54 | #define DRM_VMW_FENCE_EVENT 17 | ||
| 55 | #define DRM_VMW_PRESENT 18 | ||
| 56 | #define DRM_VMW_PRESENT_READBACK 19 | ||
| 55 | 57 | ||
| 56 | 58 | ||
| 57 | /*************************************************************************/ | 59 | /*************************************************************************/ |
| @@ -69,10 +71,10 @@ | |||
| 69 | #define DRM_VMW_PARAM_NUM_STREAMS 0 | 71 | #define DRM_VMW_PARAM_NUM_STREAMS 0 |
| 70 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 | 72 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 |
| 71 | #define DRM_VMW_PARAM_3D 2 | 73 | #define DRM_VMW_PARAM_3D 2 |
| 72 | #define DRM_VMW_PARAM_FIFO_OFFSET 3 | 74 | #define DRM_VMW_PARAM_HW_CAPS 3 |
| 73 | #define DRM_VMW_PARAM_HW_CAPS 4 | 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 |
| 74 | #define DRM_VMW_PARAM_FIFO_CAPS 5 | 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 |
| 75 | #define DRM_VMW_PARAM_MAX_FB_SIZE 6 | 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 |
| 76 | 78 | ||
| 77 | /** | 79 | /** |
| 78 | * struct drm_vmw_getparam_arg | 80 | * struct drm_vmw_getparam_arg |
| @@ -91,49 +93,6 @@ struct drm_vmw_getparam_arg { | |||
| 91 | 93 | ||
| 92 | /*************************************************************************/ | 94 | /*************************************************************************/ |
| 93 | /** | 95 | /** |
| 94 | * DRM_VMW_EXTENSION - Query device extensions. | ||
| 95 | */ | ||
| 96 | |||
| 97 | /** | ||
| 98 | * struct drm_vmw_extension_rep | ||
| 99 | * | ||
| 100 | * @exists: The queried extension exists. | ||
| 101 | * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension. | ||
| 102 | * @driver_sarea_offset: Offset to any space in the DRI SAREA | ||
| 103 | * used by the extension. | ||
| 104 | * @major: Major version number of the extension. | ||
| 105 | * @minor: Minor version number of the extension. | ||
| 106 | * @pl: Patch level version number of the extension. | ||
| 107 | * | ||
| 108 | * Output argument to the DRM_VMW_EXTENSION Ioctl. | ||
| 109 | */ | ||
| 110 | |||
| 111 | struct drm_vmw_extension_rep { | ||
| 112 | int32_t exists; | ||
| 113 | uint32_t driver_ioctl_offset; | ||
| 114 | uint32_t driver_sarea_offset; | ||
| 115 | uint32_t major; | ||
| 116 | uint32_t minor; | ||
| 117 | uint32_t pl; | ||
| 118 | uint32_t pad64; | ||
| 119 | }; | ||
| 120 | |||
| 121 | /** | ||
| 122 | * union drm_vmw_extension_arg | ||
| 123 | * | ||
| 124 | * @extension - Ascii name of the extension to be queried. //In | ||
| 125 | * @rep - Reply as defined above. //Out | ||
| 126 | * | ||
| 127 | * Argument to the DRM_VMW_EXTENSION Ioctl. | ||
| 128 | */ | ||
| 129 | |||
| 130 | union drm_vmw_extension_arg { | ||
| 131 | char extension[DRM_VMW_EXT_NAME_LEN]; | ||
| 132 | struct drm_vmw_extension_rep rep; | ||
| 133 | }; | ||
| 134 | |||
| 135 | /*************************************************************************/ | ||
| 136 | /** | ||
| 137 | * DRM_VMW_CREATE_CONTEXT - Create a host context. | 96 | * DRM_VMW_CREATE_CONTEXT - Create a host context. |
| 138 | * | 97 | * |
| 139 | * Allocates a device unique context id, and queues a create context command | 98 | * Allocates a device unique context id, and queues a create context command |
| @@ -292,7 +251,7 @@ union drm_vmw_surface_reference_arg { | |||
| 292 | * DRM_VMW_EXECBUF | 251 | * DRM_VMW_EXECBUF |
| 293 | * | 252 | * |
| 294 | * Submit a command buffer for execution on the host, and return a | 253 | * Submit a command buffer for execution on the host, and return a |
| 295 | * fence sequence that when signaled, indicates that the command buffer has | 254 | * fence seqno that when signaled, indicates that the command buffer has |
| 296 | * executed. | 255 | * executed. |
| 297 | */ | 256 | */ |
| 298 | 257 | ||
| @@ -314,21 +273,30 @@ union drm_vmw_surface_reference_arg { | |||
| 314 | * Argument to the DRM_VMW_EXECBUF Ioctl. | 273 | * Argument to the DRM_VMW_EXECBUF Ioctl. |
| 315 | */ | 274 | */ |
| 316 | 275 | ||
| 317 | #define DRM_VMW_EXECBUF_VERSION 0 | 276 | #define DRM_VMW_EXECBUF_VERSION 1 |
| 318 | 277 | ||
| 319 | struct drm_vmw_execbuf_arg { | 278 | struct drm_vmw_execbuf_arg { |
| 320 | uint64_t commands; | 279 | uint64_t commands; |
| 321 | uint32_t command_size; | 280 | uint32_t command_size; |
| 322 | uint32_t throttle_us; | 281 | uint32_t throttle_us; |
| 323 | uint64_t fence_rep; | 282 | uint64_t fence_rep; |
| 324 | uint32_t version; | 283 | uint32_t version; |
| 325 | uint32_t flags; | 284 | uint32_t flags; |
| 326 | }; | 285 | }; |
| 327 | 286 | ||
| 328 | /** | 287 | /** |
| 329 | * struct drm_vmw_fence_rep | 288 | * struct drm_vmw_fence_rep |
| 330 | * | 289 | * |
| 331 | * @fence_seq: Fence sequence associated with a command submission. | 290 | * @handle: Fence object handle for fence associated with a command submission. |
| 291 | * @mask: Fence flags relevant for this fence object. | ||
| 292 | * @seqno: Fence sequence number in fifo. A fence object with a lower | ||
| 293 | * seqno will signal the EXEC flag before a fence object with a higher | ||
| 294 | * seqno. This can be used by user-space to avoid kernel calls to determine | ||
| 295 | * whether a fence has signaled the EXEC flag. Note that @seqno will | ||
| 296 | * wrap at 32-bit. | ||
| 297 | * @passed_seqno: The highest seqno number processed by the hardware | ||
| 298 | * so far. This can be used to mark user-space fence objects as signaled, and | ||
| 299 | * to determine whether a fence seqno might be stale. | ||
| 332 | * @error: This member should've been set to -EFAULT on submission. | 300 | * @error: This member should've been set to -EFAULT on submission. |
| 333 | * The following actions should be take on completion: | 301 | * The following actions should be take on completion: |
| 334 | * error == -EFAULT: Fence communication failed. The host is synchronized. | 302 | * error == -EFAULT: Fence communication failed. The host is synchronized. |
| @@ -342,9 +310,12 @@ struct drm_vmw_execbuf_arg { | |||
| 342 | */ | 310 | */ |
| 343 | 311 | ||
| 344 | struct drm_vmw_fence_rep { | 312 | struct drm_vmw_fence_rep { |
| 345 | uint64_t fence_seq; | 313 | uint32_t handle; |
| 346 | int32_t error; | 314 | uint32_t mask; |
| 315 | uint32_t seqno; | ||
| 316 | uint32_t passed_seqno; | ||
| 347 | uint32_t pad64; | 317 | uint32_t pad64; |
| 318 | int32_t error; | ||
| 348 | }; | 319 | }; |
| 349 | 320 | ||
| 350 | /*************************************************************************/ | 321 | /*************************************************************************/ |
| @@ -435,39 +406,6 @@ struct drm_vmw_unref_dmabuf_arg { | |||
| 435 | 406 | ||
| 436 | /*************************************************************************/ | 407 | /*************************************************************************/ |
| 437 | /** | 408 | /** |
| 438 | * DRM_VMW_FIFO_DEBUG - Get last FIFO submission. | ||
| 439 | * | ||
| 440 | * This IOCTL copies the last FIFO submission directly out of the FIFO buffer. | ||
| 441 | */ | ||
| 442 | |||
| 443 | /** | ||
| 444 | * struct drm_vmw_fifo_debug_arg | ||
| 445 | * | ||
| 446 | * @debug_buffer: User space address of a debug_buffer cast to an uint64_t //In | ||
| 447 | * @debug_buffer_size: Size in bytes of debug buffer //In | ||
| 448 | * @used_size: Number of bytes copied to the buffer // Out | ||
| 449 | * @did_not_fit: Boolean indicating that the fifo contents did not fit. //Out | ||
| 450 | * | ||
| 451 | * Argument to the DRM_VMW_FIFO_DEBUG Ioctl. | ||
| 452 | */ | ||
| 453 | |||
| 454 | struct drm_vmw_fifo_debug_arg { | ||
| 455 | uint64_t debug_buffer; | ||
| 456 | uint32_t debug_buffer_size; | ||
| 457 | uint32_t used_size; | ||
| 458 | int32_t did_not_fit; | ||
| 459 | uint32_t pad64; | ||
| 460 | }; | ||
| 461 | |||
| 462 | struct drm_vmw_fence_wait_arg { | ||
| 463 | uint64_t sequence; | ||
| 464 | uint64_t kernel_cookie; | ||
| 465 | int32_t cookie_valid; | ||
| 466 | int32_t pad64; | ||
| 467 | }; | ||
| 468 | |||
| 469 | /*************************************************************************/ | ||
| 470 | /** | ||
| 471 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. | 409 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. |
| 472 | * | 410 | * |
| 473 | * This IOCTL controls the overlay units of the svga device. | 411 | * This IOCTL controls the overlay units of the svga device. |
| @@ -590,6 +528,30 @@ struct drm_vmw_stream_arg { | |||
| 590 | 528 | ||
| 591 | /*************************************************************************/ | 529 | /*************************************************************************/ |
| 592 | /** | 530 | /** |
| 531 | * DRM_VMW_GET_3D_CAP | ||
| 532 | * | ||
| 533 | * Read 3D capabilities from the FIFO | ||
| 534 | * | ||
| 535 | */ | ||
| 536 | |||
| 537 | /** | ||
| 538 | * struct drm_vmw_get_3d_cap_arg | ||
| 539 | * | ||
| 540 | * @buffer: Pointer to a buffer for capability data, cast to an uint64_t | ||
| 541 | * @size: Max size to copy | ||
| 542 | * | ||
| 543 | * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL | ||
| 544 | * ioctls. | ||
| 545 | */ | ||
| 546 | |||
| 547 | struct drm_vmw_get_3d_cap_arg { | ||
| 548 | uint64_t buffer; | ||
| 549 | uint32_t max_size; | ||
| 550 | uint32_t pad64; | ||
| 551 | }; | ||
| 552 | |||
| 553 | /*************************************************************************/ | ||
| 554 | /** | ||
| 593 | * DRM_VMW_UPDATE_LAYOUT - Update layout | 555 | * DRM_VMW_UPDATE_LAYOUT - Update layout |
| 594 | * | 556 | * |
| 595 | * Updates the preferred modes and connection status for connectors. The | 557 | * Updates the preferred modes and connection status for connectors. The |
| @@ -612,4 +574,218 @@ struct drm_vmw_update_layout_arg { | |||
| 612 | uint64_t rects; | 574 | uint64_t rects; |
| 613 | }; | 575 | }; |
| 614 | 576 | ||
| 577 | |||
| 578 | /*************************************************************************/ | ||
| 579 | /** | ||
| 580 | * DRM_VMW_FENCE_WAIT | ||
| 581 | * | ||
| 582 | * Waits for a fence object to signal. The wait is interruptible, so that | ||
| 583 | * signals may be delivered during the interrupt. The wait may timeout, | ||
| 584 | * in which case the calls returns -EBUSY. If the wait is restarted, | ||
| 585 | * that is restarting without resetting @cookie_valid to zero, | ||
| 586 | * the timeout is computed from the first call. | ||
| 587 | * | ||
| 588 | * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait | ||
| 589 | * on: | ||
| 590 | * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command | ||
| 591 | * stream | ||
| 592 | * have executed. | ||
| 593 | * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish | ||
| 594 | * commands | ||
| 595 | * in the buffer given to the EXECBUF ioctl returning the fence object handle | ||
| 596 | * are available to user-space. | ||
| 597 | * | ||
| 598 | * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the | ||
| 599 | * fenc wait ioctl returns 0, the fence object has been unreferenced after | ||
| 600 | * the wait. | ||
| 601 | */ | ||
| 602 | |||
| 603 | #define DRM_VMW_FENCE_FLAG_EXEC (1 << 0) | ||
| 604 | #define DRM_VMW_FENCE_FLAG_QUERY (1 << 1) | ||
| 605 | |||
| 606 | #define DRM_VMW_WAIT_OPTION_UNREF (1 << 0) | ||
| 607 | |||
| 608 | /** | ||
| 609 | * struct drm_vmw_fence_wait_arg | ||
| 610 | * | ||
| 611 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 612 | * @cookie_valid: Must be reset to 0 on first call. Left alone on restart. | ||
| 613 | * @kernel_cookie: Set to 0 on first call. Left alone on restart. | ||
| 614 | * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout. | ||
| 615 | * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick | ||
| 616 | * before returning. | ||
| 617 | * @flags: Fence flags to wait on. | ||
| 618 | * @wait_options: Options that control the behaviour of the wait ioctl. | ||
| 619 | * | ||
| 620 | * Input argument to the DRM_VMW_FENCE_WAIT ioctl. | ||
| 621 | */ | ||
| 622 | |||
| 623 | struct drm_vmw_fence_wait_arg { | ||
| 624 | uint32_t handle; | ||
| 625 | int32_t cookie_valid; | ||
| 626 | uint64_t kernel_cookie; | ||
| 627 | uint64_t timeout_us; | ||
| 628 | int32_t lazy; | ||
| 629 | int32_t flags; | ||
| 630 | int32_t wait_options; | ||
| 631 | int32_t pad64; | ||
| 632 | }; | ||
| 633 | |||
| 634 | /*************************************************************************/ | ||
| 635 | /** | ||
| 636 | * DRM_VMW_FENCE_SIGNALED | ||
| 637 | * | ||
| 638 | * Checks if a fence object is signaled.. | ||
| 639 | */ | ||
| 640 | |||
| 641 | /** | ||
| 642 | * struct drm_vmw_fence_signaled_arg | ||
| 643 | * | ||
| 644 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 645 | * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl | ||
| 646 | * @signaled: Out: Flags signaled. | ||
| 647 | * @sequence: Out: Highest sequence passed so far. Can be used to signal the | ||
| 648 | * EXEC flag of user-space fence objects. | ||
| 649 | * | ||
| 650 | * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF | ||
| 651 | * ioctls. | ||
| 652 | */ | ||
| 653 | |||
| 654 | struct drm_vmw_fence_signaled_arg { | ||
| 655 | uint32_t handle; | ||
| 656 | uint32_t flags; | ||
| 657 | int32_t signaled; | ||
| 658 | uint32_t passed_seqno; | ||
| 659 | uint32_t signaled_flags; | ||
| 660 | uint32_t pad64; | ||
| 661 | }; | ||
| 662 | |||
| 663 | /*************************************************************************/ | ||
| 664 | /** | ||
| 665 | * DRM_VMW_FENCE_UNREF | ||
| 666 | * | ||
| 667 | * Unreferences a fence object, and causes it to be destroyed if there are no | ||
| 668 | * other references to it. | ||
| 669 | * | ||
| 670 | */ | ||
| 671 | |||
| 672 | /** | ||
| 673 | * struct drm_vmw_fence_arg | ||
| 674 | * | ||
| 675 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 676 | * | ||
| 677 | * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl.. | ||
| 678 | */ | ||
| 679 | |||
| 680 | struct drm_vmw_fence_arg { | ||
| 681 | uint32_t handle; | ||
| 682 | uint32_t pad64; | ||
| 683 | }; | ||
| 684 | |||
| 685 | |||
| 686 | /*************************************************************************/ | ||
| 687 | /** | ||
| 688 | * DRM_VMW_FENCE_EVENT | ||
| 689 | * | ||
| 690 | * Queues an event on a fence to be delivered on the drm character device | ||
| 691 | * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag. | ||
| 692 | * Optionally the approximate time when the fence signaled is | ||
| 693 | * given by the event. | ||
| 694 | */ | ||
| 695 | |||
| 696 | /* | ||
| 697 | * The event type | ||
| 698 | */ | ||
| 699 | #define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000 | ||
| 700 | |||
| 701 | struct drm_vmw_event_fence { | ||
| 702 | struct drm_event base; | ||
| 703 | uint64_t user_data; | ||
| 704 | uint32_t tv_sec; | ||
| 705 | uint32_t tv_usec; | ||
| 706 | }; | ||
| 707 | |||
| 708 | /* | ||
| 709 | * Flags that may be given to the command. | ||
| 710 | */ | ||
| 711 | /* Request fence signaled time on the event. */ | ||
| 712 | #define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0) | ||
| 713 | |||
| 714 | /** | ||
| 715 | * struct drm_vmw_fence_event_arg | ||
| 716 | * | ||
| 717 | * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if | ||
| 718 | * the fence is not supposed to be referenced by user-space. | ||
| 719 | * @user_info: Info to be delivered with the event. | ||
| 720 | * @handle: Attach the event to this fence only. | ||
| 721 | * @flags: A set of flags as defined above. | ||
| 722 | */ | ||
| 723 | struct drm_vmw_fence_event_arg { | ||
| 724 | uint64_t fence_rep; | ||
| 725 | uint64_t user_data; | ||
| 726 | uint32_t handle; | ||
| 727 | uint32_t flags; | ||
| 728 | }; | ||
| 729 | |||
| 730 | |||
| 731 | /*************************************************************************/ | ||
| 732 | /** | ||
| 733 | * DRM_VMW_PRESENT | ||
| 734 | * | ||
| 735 | * Executes an SVGA present on a given fb for a given surface. The surface | ||
| 736 | * is placed on the framebuffer. Cliprects are given relative to the given | ||
| 737 | * point (the point disignated by dest_{x|y}). | ||
| 738 | * | ||
| 739 | */ | ||
| 740 | |||
| 741 | /** | ||
| 742 | * struct drm_vmw_present_arg | ||
| 743 | * @fb_id: framebuffer id to present / read back from. | ||
| 744 | * @sid: Surface id to present from. | ||
| 745 | * @dest_x: X placement coordinate for surface. | ||
| 746 | * @dest_y: Y placement coordinate for surface. | ||
| 747 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
| 748 | * @num_clips: Number of cliprects given relative to the framebuffer origin, | ||
| 749 | * in the same coordinate space as the frame buffer. | ||
| 750 | * @pad64: Unused 64-bit padding. | ||
| 751 | * | ||
| 752 | * Input argument to the DRM_VMW_PRESENT ioctl. | ||
| 753 | */ | ||
| 754 | |||
| 755 | struct drm_vmw_present_arg { | ||
| 756 | uint32_t fb_id; | ||
| 757 | uint32_t sid; | ||
| 758 | int32_t dest_x; | ||
| 759 | int32_t dest_y; | ||
| 760 | uint64_t clips_ptr; | ||
| 761 | uint32_t num_clips; | ||
| 762 | uint32_t pad64; | ||
| 763 | }; | ||
| 764 | |||
| 765 | |||
| 766 | /*************************************************************************/ | ||
| 767 | /** | ||
| 768 | * DRM_VMW_PRESENT_READBACK | ||
| 769 | * | ||
| 770 | * Executes an SVGA present readback from a given fb to the dma buffer | ||
| 771 | * currently bound as the fb. If there is no dma buffer bound to the fb, | ||
| 772 | * an error will be returned. | ||
| 773 | * | ||
| 774 | */ | ||
| 775 | |||
| 776 | /** | ||
| 777 | * struct drm_vmw_present_arg | ||
| 778 | * @fb_id: fb_id to present / read back from. | ||
| 779 | * @num_clips: Number of cliprects. | ||
| 780 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
| 781 | * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t. | ||
| 782 | * If this member is NULL, then the ioctl should not return a fence. | ||
| 783 | */ | ||
| 784 | |||
| 785 | struct drm_vmw_present_readback_arg { | ||
| 786 | uint32_t fb_id; | ||
| 787 | uint32_t num_clips; | ||
| 788 | uint64_t clips_ptr; | ||
| 789 | uint64_t fence_rep; | ||
| 790 | }; | ||
| 615 | #endif | 791 | #endif |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h index 5ddd9ad4b19c..2412af944f1f 100644 --- a/include/linux/amba/pl061.h +++ b/include/linux/amba/pl061.h | |||
| @@ -7,8 +7,7 @@ struct pl061_platform_data { | |||
| 7 | unsigned gpio_base; | 7 | unsigned gpio_base; |
| 8 | 8 | ||
| 9 | /* number of the first IRQ. | 9 | /* number of the first IRQ. |
| 10 | * If the IRQ functionality in not desired this must be set to | 10 | * If the IRQ functionality in not desired this must be set to NO_IRQ. |
| 11 | * (unsigned) -1. | ||
| 12 | */ | 11 | */ |
| 13 | unsigned irq_base; | 12 | unsigned irq_base; |
| 14 | 13 | ||
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 3e09b345f4d6..4c7a4b2104bf 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __LINUX_ATMEL_MCI_H | 1 | #ifndef __LINUX_ATMEL_MCI_H |
| 2 | #define __LINUX_ATMEL_MCI_H | 2 | #define __LINUX_ATMEL_MCI_H |
| 3 | 3 | ||
| 4 | #define ATMEL_MCI_MAX_NR_SLOTS 2 | 4 | #define ATMCI_MAX_NR_SLOTS 2 |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * struct mci_slot_pdata - board-specific per-slot configuration | 7 | * struct mci_slot_pdata - board-specific per-slot configuration |
| @@ -33,7 +33,7 @@ struct mci_slot_pdata { | |||
| 33 | */ | 33 | */ |
| 34 | struct mci_platform_data { | 34 | struct mci_platform_data { |
| 35 | struct mci_dma_data *dma_slave; | 35 | struct mci_dma_data *dma_slave; |
| 36 | struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; | 36 | struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS]; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | #endif /* __LINUX_ATMEL_MCI_H */ | 39 | #endif /* __LINUX_ATMEL_MCI_H */ |
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h index 5058a31d2ce8..63499ce806ea 100644 --- a/include/linux/atmel_pdc.h +++ b/include/linux/atmel_pdc.h | |||
| @@ -33,4 +33,6 @@ | |||
| 33 | 33 | ||
| 34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ | 34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ |
| 35 | 35 | ||
| 36 | #define ATMEL_PDC_SCND_BUF_OFF 0x10 /* Offset between first and second buffer registers */ | ||
| 37 | |||
| 36 | #endif | 38 | #endif |
diff --git a/include/linux/bma150.h b/include/linux/bma150.h new file mode 100644 index 000000000000..7911fda23bb4 --- /dev/null +++ b/include/linux/bma150.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2011 Bosch Sensortec GmbH | ||
| 3 | * Copyright (c) 2011 Unixphere | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef _BMA150_H_ | ||
| 21 | #define _BMA150_H_ | ||
| 22 | |||
| 23 | #define BMA150_DRIVER "bma150" | ||
| 24 | |||
| 25 | struct bma150_cfg { | ||
| 26 | bool any_motion_int; /* Set to enable any-motion interrupt */ | ||
| 27 | bool hg_int; /* Set to enable high-G interrupt */ | ||
| 28 | bool lg_int; /* Set to enable low-G interrupt */ | ||
| 29 | unsigned char any_motion_dur; /* Any-motion duration */ | ||
| 30 | unsigned char any_motion_thres; /* Any-motion threshold */ | ||
| 31 | unsigned char hg_hyst; /* High-G hysterisis */ | ||
| 32 | unsigned char hg_dur; /* High-G duration */ | ||
| 33 | unsigned char hg_thres; /* High-G threshold */ | ||
| 34 | unsigned char lg_hyst; /* Low-G hysterisis */ | ||
| 35 | unsigned char lg_dur; /* Low-G duration */ | ||
| 36 | unsigned char lg_thres; /* Low-G threshold */ | ||
| 37 | unsigned char range; /* BMA0150_RANGE_xxx (in G) */ | ||
| 38 | unsigned char bandwidth; /* BMA0150_BW_xxx (in Hz) */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct bma150_platform_data { | ||
| 42 | struct bma150_cfg cfg; | ||
| 43 | int (*irq_gpio_cfg)(void); | ||
| 44 | }; | ||
| 45 | |||
| 46 | #endif /* _BMA150_H_ */ | ||
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 563755181c1e..95bd8502e715 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
| @@ -215,7 +215,9 @@ extern void ceph_destroy_options(struct ceph_options *opt); | |||
| 215 | extern int ceph_compare_options(struct ceph_options *new_opt, | 215 | extern int ceph_compare_options(struct ceph_options *new_opt, |
| 216 | struct ceph_client *client); | 216 | struct ceph_client *client); |
| 217 | extern struct ceph_client *ceph_create_client(struct ceph_options *opt, | 217 | extern struct ceph_client *ceph_create_client(struct ceph_options *opt, |
| 218 | void *private); | 218 | void *private, |
| 219 | unsigned supported_features, | ||
| 220 | unsigned required_features); | ||
| 219 | extern u64 ceph_client_id(struct ceph_client *client); | 221 | extern u64 ceph_client_id(struct ceph_client *client); |
| 220 | extern void ceph_destroy_client(struct ceph_client *client); | 222 | extern void ceph_destroy_client(struct ceph_client *client); |
| 221 | extern int __ceph_open_session(struct ceph_client *client, | 223 | extern int __ceph_open_session(struct ceph_client *client, |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index ca768ae729b4..ffbeb2c217b4 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
| @@ -237,7 +237,8 @@ extern void ceph_con_keepalive(struct ceph_connection *con); | |||
| 237 | extern struct ceph_connection *ceph_con_get(struct ceph_connection *con); | 237 | extern struct ceph_connection *ceph_con_get(struct ceph_connection *con); |
| 238 | extern void ceph_con_put(struct ceph_connection *con); | 238 | extern void ceph_con_put(struct ceph_connection *con); |
| 239 | 239 | ||
| 240 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags); | 240 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, |
| 241 | bool can_fail); | ||
| 241 | extern void ceph_msg_kfree(struct ceph_msg *m); | 242 | extern void ceph_msg_kfree(struct ceph_msg *m); |
| 242 | 243 | ||
| 243 | 244 | ||
diff --git a/include/linux/clk.h b/include/linux/clk.h index 1d37f42ac294..7213b52b2c0e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #ifndef __LINUX_CLK_H | 11 | #ifndef __LINUX_CLK_H |
| 12 | #define __LINUX_CLK_H | 12 | #define __LINUX_CLK_H |
| 13 | 13 | ||
| 14 | #include <linux/kernel.h> | ||
| 15 | |||
| 14 | struct device; | 16 | struct device; |
| 15 | 17 | ||
| 16 | /* | 18 | /* |
| @@ -41,11 +43,31 @@ struct clk; | |||
| 41 | struct clk *clk_get(struct device *dev, const char *id); | 43 | struct clk *clk_get(struct device *dev, const char *id); |
| 42 | 44 | ||
| 43 | /** | 45 | /** |
| 46 | * clk_prepare - prepare a clock source | ||
| 47 | * @clk: clock source | ||
| 48 | * | ||
| 49 | * This prepares the clock source for use. | ||
| 50 | * | ||
| 51 | * Must not be called from within atomic context. | ||
| 52 | */ | ||
| 53 | #ifdef CONFIG_HAVE_CLK_PREPARE | ||
| 54 | int clk_prepare(struct clk *clk); | ||
| 55 | #else | ||
| 56 | static inline int clk_prepare(struct clk *clk) | ||
| 57 | { | ||
| 58 | might_sleep(); | ||
| 59 | return 0; | ||
| 60 | } | ||
| 61 | #endif | ||
| 62 | |||
| 63 | /** | ||
| 44 | * clk_enable - inform the system when the clock source should be running. | 64 | * clk_enable - inform the system when the clock source should be running. |
| 45 | * @clk: clock source | 65 | * @clk: clock source |
| 46 | * | 66 | * |
| 47 | * If the clock can not be enabled/disabled, this should return success. | 67 | * If the clock can not be enabled/disabled, this should return success. |
| 48 | * | 68 | * |
| 69 | * May be called from atomic contexts. | ||
| 70 | * | ||
| 49 | * Returns success (0) or negative errno. | 71 | * Returns success (0) or negative errno. |
| 50 | */ | 72 | */ |
| 51 | int clk_enable(struct clk *clk); | 73 | int clk_enable(struct clk *clk); |
| @@ -57,6 +79,8 @@ int clk_enable(struct clk *clk); | |||
| 57 | * Inform the system that a clock source is no longer required by | 79 | * Inform the system that a clock source is no longer required by |
| 58 | * a driver and may be shut down. | 80 | * a driver and may be shut down. |
| 59 | * | 81 | * |
| 82 | * May be called from atomic contexts. | ||
| 83 | * | ||
| 60 | * Implementation detail: if the clock source is shared between | 84 | * Implementation detail: if the clock source is shared between |
| 61 | * multiple drivers, clk_enable() calls must be balanced by the | 85 | * multiple drivers, clk_enable() calls must be balanced by the |
| 62 | * same number of clk_disable() calls for the clock source to be | 86 | * same number of clk_disable() calls for the clock source to be |
| @@ -64,6 +88,25 @@ int clk_enable(struct clk *clk); | |||
| 64 | */ | 88 | */ |
| 65 | void clk_disable(struct clk *clk); | 89 | void clk_disable(struct clk *clk); |
| 66 | 90 | ||
| 91 | |||
| 92 | /** | ||
| 93 | * clk_unprepare - undo preparation of a clock source | ||
| 94 | * @clk: clock source | ||
| 95 | * | ||
| 96 | * This undoes a previously prepared clock. The caller must balance | ||
| 97 | * the number of prepare and unprepare calls. | ||
| 98 | * | ||
| 99 | * Must not be called from within atomic context. | ||
| 100 | */ | ||
| 101 | #ifdef CONFIG_HAVE_CLK_PREPARE | ||
| 102 | void clk_unprepare(struct clk *clk); | ||
| 103 | #else | ||
| 104 | static inline void clk_unprepare(struct clk *clk) | ||
| 105 | { | ||
| 106 | might_sleep(); | ||
| 107 | } | ||
| 108 | #endif | ||
| 109 | |||
| 67 | /** | 110 | /** |
| 68 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. | 111 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. |
| 69 | * This is only valid once the clock source has been enabled. | 112 | * This is only valid once the clock source has been enabled. |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index 457bcb0a310a..d9a4fd028c9d 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h | |||
| @@ -24,6 +24,13 @@ struct clk_lookup { | |||
| 24 | struct clk *clk; | 24 | struct clk *clk; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | #define CLKDEV_INIT(d, n, c) \ | ||
| 28 | { \ | ||
| 29 | .dev_id = d, \ | ||
| 30 | .con_id = n, \ | ||
| 31 | .clk = c, \ | ||
| 32 | } | ||
| 33 | |||
| 27 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 34 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, |
| 28 | const char *dev_fmt, ...); | 35 | const char *dev_fmt, ...); |
| 29 | 36 | ||
diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h new file mode 100644 index 000000000000..455b233dd3b1 --- /dev/null +++ b/include/linux/cpu_pm.h | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Google, Inc. | ||
| 3 | * | ||
| 4 | * Author: | ||
| 5 | * Colin Cross <ccross@android.com> | ||
| 6 | * | ||
| 7 | * This software is licensed under the terms of the GNU General Public | ||
| 8 | * License version 2, as published by the Free Software Foundation, and | ||
| 9 | * may be copied, distributed, and modified under those terms. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef _LINUX_CPU_PM_H | ||
| 19 | #define _LINUX_CPU_PM_H | ||
| 20 | |||
| 21 | #include <linux/kernel.h> | ||
| 22 | #include <linux/notifier.h> | ||
| 23 | |||
| 24 | /* | ||
| 25 | * When a CPU goes to a low power state that turns off power to the CPU's | ||
| 26 | * power domain, the contents of some blocks (floating point coprocessors, | ||
| 27 | * interrupt controllers, caches, timers) in the same power domain can | ||
| 28 | * be lost. The cpm_pm notifiers provide a method for platform idle, suspend, | ||
| 29 | * and hotplug implementations to notify the drivers for these blocks that | ||
| 30 | * they may be reset. | ||
| 31 | * | ||
| 32 | * All cpu_pm notifications must be called with interrupts disabled. | ||
| 33 | * | ||
| 34 | * The notifications are split into two classes: CPU notifications and CPU | ||
| 35 | * cluster notifications. | ||
| 36 | * | ||
| 37 | * CPU notifications apply to a single CPU and must be called on the affected | ||
| 38 | * CPU. They are used to save per-cpu context for affected blocks. | ||
| 39 | * | ||
| 40 | * CPU cluster notifications apply to all CPUs in a single power domain. They | ||
| 41 | * are used to save any global context for affected blocks, and must be called | ||
| 42 | * after all the CPUs in the power domain have been notified of the low power | ||
| 43 | * state. | ||
| 44 | */ | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Event codes passed as unsigned long val to notifier calls | ||
| 48 | */ | ||
| 49 | enum cpu_pm_event { | ||
| 50 | /* A single cpu is entering a low power state */ | ||
| 51 | CPU_PM_ENTER, | ||
| 52 | |||
| 53 | /* A single cpu failed to enter a low power state */ | ||
| 54 | CPU_PM_ENTER_FAILED, | ||
| 55 | |||
| 56 | /* A single cpu is exiting a low power state */ | ||
| 57 | CPU_PM_EXIT, | ||
| 58 | |||
| 59 | /* A cpu power domain is entering a low power state */ | ||
| 60 | CPU_CLUSTER_PM_ENTER, | ||
| 61 | |||
| 62 | /* A cpu power domain failed to enter a low power state */ | ||
| 63 | CPU_CLUSTER_PM_ENTER_FAILED, | ||
| 64 | |||
| 65 | /* A cpu power domain is exiting a low power state */ | ||
| 66 | CPU_CLUSTER_PM_EXIT, | ||
| 67 | }; | ||
| 68 | |||
| 69 | #ifdef CONFIG_CPU_PM | ||
| 70 | int cpu_pm_register_notifier(struct notifier_block *nb); | ||
| 71 | int cpu_pm_unregister_notifier(struct notifier_block *nb); | ||
| 72 | int cpu_pm_enter(void); | ||
| 73 | int cpu_pm_exit(void); | ||
| 74 | int cpu_cluster_pm_enter(void); | ||
| 75 | int cpu_cluster_pm_exit(void); | ||
| 76 | |||
| 77 | #else | ||
| 78 | |||
| 79 | static inline int cpu_pm_register_notifier(struct notifier_block *nb) | ||
| 80 | { | ||
| 81 | return 0; | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline int cpu_pm_unregister_notifier(struct notifier_block *nb) | ||
| 85 | { | ||
| 86 | return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | static inline int cpu_pm_enter(void) | ||
| 90 | { | ||
| 91 | return 0; | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline int cpu_pm_exit(void) | ||
| 95 | { | ||
| 96 | return 0; | ||
| 97 | } | ||
| 98 | |||
| 99 | static inline int cpu_cluster_pm_enter(void) | ||
| 100 | { | ||
| 101 | return 0; | ||
| 102 | } | ||
| 103 | |||
| 104 | static inline int cpu_cluster_pm_exit(void) | ||
| 105 | { | ||
| 106 | return 0; | ||
| 107 | } | ||
| 108 | #endif | ||
| 109 | #endif | ||
diff --git a/include/linux/device.h b/include/linux/device.h index bdcf361ca938..85e78fc7d7fd 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -33,6 +33,7 @@ struct class; | |||
| 33 | struct subsys_private; | 33 | struct subsys_private; |
| 34 | struct bus_type; | 34 | struct bus_type; |
| 35 | struct device_node; | 35 | struct device_node; |
| 36 | struct iommu_ops; | ||
| 36 | 37 | ||
| 37 | struct bus_attribute { | 38 | struct bus_attribute { |
| 38 | struct attribute attr; | 39 | struct attribute attr; |
| @@ -67,6 +68,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
| 67 | * @resume: Called to bring a device on this bus out of sleep mode. | 68 | * @resume: Called to bring a device on this bus out of sleep mode. |
| 68 | * @pm: Power management operations of this bus, callback the specific | 69 | * @pm: Power management operations of this bus, callback the specific |
| 69 | * device driver's pm-ops. | 70 | * device driver's pm-ops. |
| 71 | * @iommu_ops IOMMU specific operations for this bus, used to attach IOMMU | ||
| 72 | * driver implementations to a bus and allow the driver to do | ||
| 73 | * bus-specific setup | ||
| 70 | * @p: The private data of the driver core, only the driver core can | 74 | * @p: The private data of the driver core, only the driver core can |
| 71 | * touch this. | 75 | * touch this. |
| 72 | * | 76 | * |
| @@ -96,6 +100,8 @@ struct bus_type { | |||
| 96 | 100 | ||
| 97 | const struct dev_pm_ops *pm; | 101 | const struct dev_pm_ops *pm; |
| 98 | 102 | ||
| 103 | struct iommu_ops *iommu_ops; | ||
| 104 | |||
| 99 | struct subsys_private *p; | 105 | struct subsys_private *p; |
| 100 | }; | 106 | }; |
| 101 | 107 | ||
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index aa56cf31f7ff..a49b52934c55 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -135,10 +135,25 @@ static inline void set_freezable_with_signal(void) | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | /* | 137 | /* |
| 138 | * Freezer-friendly wrappers around wait_event_interruptible() and | 138 | * Freezer-friendly wrappers around wait_event_interruptible(), |
| 139 | * wait_event_interruptible_timeout(), originally defined in <linux/wait.h> | 139 | * wait_event_killable() and wait_event_interruptible_timeout(), originally |
| 140 | * defined in <linux/wait.h> | ||
| 140 | */ | 141 | */ |
| 141 | 142 | ||
| 143 | #define wait_event_freezekillable(wq, condition) \ | ||
| 144 | ({ \ | ||
| 145 | int __retval; \ | ||
| 146 | do { \ | ||
| 147 | __retval = wait_event_killable(wq, \ | ||
| 148 | (condition) || freezing(current)); \ | ||
| 149 | if (__retval && !freezing(current)) \ | ||
| 150 | break; \ | ||
| 151 | else if (!(condition)) \ | ||
| 152 | __retval = -ERESTARTSYS; \ | ||
| 153 | } while (try_to_freeze()); \ | ||
| 154 | __retval; \ | ||
| 155 | }) | ||
| 156 | |||
| 142 | #define wait_event_freezable(wq, condition) \ | 157 | #define wait_event_freezable(wq, condition) \ |
| 143 | ({ \ | 158 | ({ \ |
| 144 | int __retval; \ | 159 | int __retval; \ |
| @@ -190,6 +205,9 @@ static inline void set_freezable_with_signal(void) {} | |||
| 190 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 205 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
| 191 | wait_event_interruptible_timeout(wq, condition, timeout) | 206 | wait_event_interruptible_timeout(wq, condition, timeout) |
| 192 | 207 | ||
| 208 | #define wait_event_freezekillable(wq, condition) \ | ||
| 209 | wait_event_killable(wq, condition) | ||
| 210 | |||
| 193 | #endif /* !CONFIG_FREEZER */ | 211 | #endif /* !CONFIG_FREEZER */ |
| 194 | 212 | ||
| 195 | #endif /* FREEZER_H_INCLUDED */ | 213 | #endif /* FREEZER_H_INCLUDED */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ba98668a1826..14493a2d5a03 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -58,14 +58,15 @@ struct inodes_stat_t { | |||
| 58 | 58 | ||
| 59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ | 59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ |
| 60 | 60 | ||
| 61 | #define MAY_EXEC 1 | 61 | #define MAY_EXEC 0x00000001 |
| 62 | #define MAY_WRITE 2 | 62 | #define MAY_WRITE 0x00000002 |
| 63 | #define MAY_READ 4 | 63 | #define MAY_READ 0x00000004 |
| 64 | #define MAY_APPEND 8 | 64 | #define MAY_APPEND 0x00000008 |
| 65 | #define MAY_ACCESS 16 | 65 | #define MAY_ACCESS 0x00000010 |
| 66 | #define MAY_OPEN 32 | 66 | #define MAY_OPEN 0x00000020 |
| 67 | #define MAY_CHDIR 64 | 67 | #define MAY_CHDIR 0x00000040 |
| 68 | #define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */ | 68 | /* called from RCU mode, don't block */ |
| 69 | #define MAY_NOT_BLOCK 0x00000080 | ||
| 69 | 70 | ||
| 70 | /* | 71 | /* |
| 71 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 72 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
| @@ -963,7 +964,12 @@ struct file { | |||
| 963 | #define f_dentry f_path.dentry | 964 | #define f_dentry f_path.dentry |
| 964 | #define f_vfsmnt f_path.mnt | 965 | #define f_vfsmnt f_path.mnt |
| 965 | const struct file_operations *f_op; | 966 | const struct file_operations *f_op; |
| 966 | spinlock_t f_lock; /* f_ep_links, f_flags, no IRQ */ | 967 | |
| 968 | /* | ||
| 969 | * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR. | ||
| 970 | * Must not be taken from IRQ context. | ||
| 971 | */ | ||
| 972 | spinlock_t f_lock; | ||
| 967 | #ifdef CONFIG_SMP | 973 | #ifdef CONFIG_SMP |
| 968 | int f_sb_list_cpu; | 974 | int f_sb_list_cpu; |
| 969 | #endif | 975 | #endif |
| @@ -2401,8 +2407,8 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | |||
| 2401 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); | 2407 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); |
| 2402 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 2408 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
| 2403 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 2409 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
| 2404 | extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, | 2410 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
| 2405 | int origin); | 2411 | int origin, loff_t maxsize); |
| 2406 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2412 | extern int generic_file_open(struct inode * inode, struct file * filp); |
| 2407 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2413 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
| 2408 | 2414 | ||
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index daa9952d2174..11c16a1fb9e3 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -20,18 +20,8 @@ | |||
| 20 | #ifndef __FSL_DIU_FB_H__ | 20 | #ifndef __FSL_DIU_FB_H__ |
| 21 | #define __FSL_DIU_FB_H__ | 21 | #define __FSL_DIU_FB_H__ |
| 22 | 22 | ||
| 23 | /* Arbitrary threshold to determine the allocation method | ||
| 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | ||
| 25 | */ | ||
| 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | ||
| 27 | |||
| 28 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 29 | 24 | ||
| 30 | struct mfb_alpha { | ||
| 31 | int enable; | ||
| 32 | int alpha; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct mfb_chroma_key { | 25 | struct mfb_chroma_key { |
| 36 | int enable; | 26 | int enable; |
| 37 | __u8 red_max; | 27 | __u8 red_max; |
| @@ -43,25 +33,29 @@ struct mfb_chroma_key { | |||
| 43 | }; | 33 | }; |
| 44 | 34 | ||
| 45 | struct aoi_display_offset { | 35 | struct aoi_display_offset { |
| 46 | int x_aoi_d; | 36 | __s32 x_aoi_d; |
| 47 | int y_aoi_d; | 37 | __s32 y_aoi_d; |
| 48 | }; | 38 | }; |
| 49 | 39 | ||
| 50 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 40 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
| 51 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 41 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
| 42 | #define MFB_SET_ALPHA _IOW('M', 0, __u8) | ||
| 43 | #define MFB_GET_ALPHA _IOR('M', 0, __u8) | ||
| 44 | #define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset) | ||
| 45 | #define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset) | ||
| 46 | #define MFB_SET_PIXFMT _IOW('M', 8, __u32) | ||
| 47 | #define MFB_GET_PIXFMT _IOR('M', 8, __u32) | ||
| 52 | 48 | ||
| 53 | #define MFB_SET_ALPHA 0x80014d00 | 49 | /* |
| 54 | #define MFB_GET_ALPHA 0x40014d00 | 50 | * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the |
| 55 | #define MFB_SET_AOID 0x80084d04 | 51 | * wrong value for 'size' field of the ioctl. The current macros above use the |
| 56 | #define MFB_GET_AOID 0x40084d04 | 52 | * right size, but we still need to provide backwards compatibility, at least |
| 57 | #define MFB_SET_PIXFMT 0x80014d08 | 53 | * for a while. |
| 58 | #define MFB_GET_PIXFMT 0x40014d08 | 54 | */ |
| 59 | 55 | #define MFB_SET_PIXFMT_OLD 0x80014d08 | |
| 60 | #define FBIOGET_GWINFO 0x46E0 | 56 | #define MFB_GET_PIXFMT_OLD 0x40014d08 |
| 61 | #define FBIOPUT_GWINFO 0x46E1 | ||
| 62 | 57 | ||
| 63 | #ifdef __KERNEL__ | 58 | #ifdef __KERNEL__ |
| 64 | #include <linux/spinlock.h> | ||
| 65 | 59 | ||
| 66 | /* | 60 | /* |
| 67 | * These are the fields of area descriptor(in DDR memory) for every plane | 61 | * These are the fields of area descriptor(in DDR memory) for every plane |
| @@ -159,58 +153,12 @@ struct diu { | |||
| 159 | __be32 plut; | 153 | __be32 plut; |
| 160 | } __attribute__ ((packed)); | 154 | } __attribute__ ((packed)); |
| 161 | 155 | ||
| 162 | struct diu_hw { | 156 | /* |
| 163 | struct diu *diu_reg; | 157 | * Modes of operation of DIU. The DIU supports five different modes, but |
| 164 | spinlock_t reg_lock; | 158 | * the driver only supports modes 0 and 1. |
| 165 | 159 | */ | |
| 166 | __u32 mode; /* DIU operation mode */ | ||
| 167 | }; | ||
| 168 | |||
| 169 | struct diu_addr { | ||
| 170 | __u8 __iomem *vaddr; /* Virtual address */ | ||
| 171 | dma_addr_t paddr; /* Physical address */ | ||
| 172 | __u32 offset; | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct diu_pool { | ||
| 176 | struct diu_addr ad; | ||
| 177 | struct diu_addr gamma; | ||
| 178 | struct diu_addr pallete; | ||
| 179 | struct diu_addr cursor; | ||
| 180 | }; | ||
| 181 | |||
| 182 | #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */ | ||
| 183 | #define INT_LCDC 64 /* DIU interrupt number */ | ||
| 184 | |||
| 185 | #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */ | ||
| 186 | /* 1 for plane 0, 2 for plane 1&2 each */ | ||
| 187 | |||
| 188 | /* Minimum X and Y resolutions */ | ||
| 189 | #define MIN_XRES 64 | ||
| 190 | #define MIN_YRES 64 | ||
| 191 | |||
| 192 | /* HW cursor parameters */ | ||
| 193 | #define MAX_CURS 32 | ||
| 194 | |||
| 195 | /* Modes of operation of DIU */ | ||
| 196 | #define MFB_MODE0 0 /* DIU off */ | 160 | #define MFB_MODE0 0 /* DIU off */ |
| 197 | #define MFB_MODE1 1 /* All three planes output to display */ | 161 | #define MFB_MODE1 1 /* All three planes output to display */ |
| 198 | #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ | ||
| 199 | #define MFB_MODE3 3 /* All three planes written back to memory */ | ||
| 200 | #define MFB_MODE4 4 /* Color bar generation */ | ||
| 201 | |||
| 202 | /* INT_STATUS/INT_MASK field descriptions */ | ||
| 203 | #define INT_VSYNC 0x01 /* Vsync interrupt */ | ||
| 204 | #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */ | ||
| 205 | #define INT_UNDRUN 0x04 /* Under run exception interrupt */ | ||
| 206 | #define INT_PARERR 0x08 /* Display parameters error interrupt */ | ||
| 207 | #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ | ||
| 208 | |||
| 209 | /* Panels'operation modes */ | ||
| 210 | #define MFB_TYPE_OUTPUT 0 /* Panel output to display */ | ||
| 211 | #define MFB_TYPE_OFF 1 /* Panel off */ | ||
| 212 | #define MFB_TYPE_WB 2 /* Panel written back to memory */ | ||
| 213 | #define MFB_TYPE_TEST 3 /* Panel generate color bar */ | ||
| 214 | 162 | ||
| 215 | #endif /* __KERNEL__ */ | 163 | #endif /* __KERNEL__ */ |
| 216 | #endif /* __FSL_DIU_FB_H__ */ | 164 | #endif /* __FSL_DIU_FB_H__ */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 02fa4697a0e5..6957350e122f 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) | 21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) |
| 22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) | 22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) |
| 23 | #define part_to_dev(part) (&((part)->__dev)) | 23 | #define part_to_dev(part) (&((part)->__dev)) |
| 24 | #define alias_name(disk) ((disk)->alias ? (disk)->alias : \ | ||
| 25 | (disk)->disk_name) | ||
| 24 | 26 | ||
| 25 | extern struct device_type part_type; | 27 | extern struct device_type part_type; |
| 26 | extern struct kobject *block_depr; | 28 | extern struct kobject *block_depr; |
| @@ -58,6 +60,7 @@ enum { | |||
| 58 | 60 | ||
| 59 | #define DISK_MAX_PARTS 256 | 61 | #define DISK_MAX_PARTS 256 |
| 60 | #define DISK_NAME_LEN 32 | 62 | #define DISK_NAME_LEN 32 |
| 63 | #define ALIAS_LEN 256 | ||
| 61 | 64 | ||
| 62 | #include <linux/major.h> | 65 | #include <linux/major.h> |
| 63 | #include <linux/device.h> | 66 | #include <linux/device.h> |
| @@ -162,6 +165,7 @@ struct gendisk { | |||
| 162 | * disks that can't be partitioned. */ | 165 | * disks that can't be partitioned. */ |
| 163 | 166 | ||
| 164 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 167 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
| 168 | char *alias; /* alias name of disk */ | ||
| 165 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 169 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
| 166 | 170 | ||
| 167 | unsigned int events; /* supported events */ | 171 | unsigned int events; /* supported events */ |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 17b5a0d80e42..38ac48b7d3a8 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -14,6 +14,18 @@ | |||
| 14 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) | 14 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) |
| 15 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) | 15 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) |
| 16 | 16 | ||
| 17 | /** | ||
| 18 | * struct gpio - a structure describing a GPIO with configuration | ||
| 19 | * @gpio: the GPIO number | ||
| 20 | * @flags: GPIO configuration as specified by GPIOF_* | ||
| 21 | * @label: a literal description string of this GPIO | ||
| 22 | */ | ||
| 23 | struct gpio { | ||
| 24 | unsigned gpio; | ||
| 25 | unsigned long flags; | ||
| 26 | const char *label; | ||
| 27 | }; | ||
| 28 | |||
| 17 | #ifdef CONFIG_GENERIC_GPIO | 29 | #ifdef CONFIG_GENERIC_GPIO |
| 18 | #include <asm/gpio.h> | 30 | #include <asm/gpio.h> |
| 19 | 31 | ||
| @@ -24,18 +36,8 @@ | |||
| 24 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
| 25 | 37 | ||
| 26 | struct device; | 38 | struct device; |
| 27 | struct gpio; | ||
| 28 | struct gpio_chip; | 39 | struct gpio_chip; |
| 29 | 40 | ||
| 30 | /* | ||
| 31 | * Some platforms don't support the GPIO programming interface. | ||
| 32 | * | ||
| 33 | * In case some driver uses it anyway (it should normally have | ||
| 34 | * depended on GENERIC_GPIO), these routines help the compiler | ||
| 35 | * optimize out much GPIO-related code ... or trigger a runtime | ||
| 36 | * warning when something is wrongly called. | ||
| 37 | */ | ||
| 38 | |||
| 39 | static inline bool gpio_is_valid(int number) | 41 | static inline bool gpio_is_valid(int number) |
| 40 | { | 42 | { |
| 41 | return false; | 43 | return false; |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a6c652ef516d..38a21c3edd2c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/sched.h> /* for completion */ | 34 | #include <linux/sched.h> /* for completion */ |
| 35 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
| 36 | #include <linux/of.h> /* for struct device_node */ | 36 | #include <linux/of.h> /* for struct device_node */ |
| 37 | #include <linux/swab.h> /* for swab16 */ | ||
| 37 | 38 | ||
| 38 | extern struct bus_type i2c_bus_type; | 39 | extern struct bus_type i2c_bus_type; |
| 39 | extern struct device_type i2c_adapter_type; | 40 | extern struct device_type i2c_adapter_type; |
| @@ -88,6 +89,22 @@ extern s32 i2c_smbus_read_word_data(const struct i2c_client *client, | |||
| 88 | u8 command); | 89 | u8 command); |
| 89 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, | 90 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, |
| 90 | u8 command, u16 value); | 91 | u8 command, u16 value); |
| 92 | |||
| 93 | static inline s32 | ||
| 94 | i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command) | ||
| 95 | { | ||
| 96 | s32 value = i2c_smbus_read_word_data(client, command); | ||
| 97 | |||
| 98 | return (value < 0) ? value : swab16(value); | ||
| 99 | } | ||
| 100 | |||
| 101 | static inline s32 | ||
| 102 | i2c_smbus_write_word_swapped(const struct i2c_client *client, | ||
| 103 | u8 command, u16 value) | ||
| 104 | { | ||
| 105 | return i2c_smbus_write_word_data(client, command, swab16(value)); | ||
| 106 | } | ||
| 107 | |||
| 91 | /* Returns the number of read bytes */ | 108 | /* Returns the number of read bytes */ |
| 92 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, | 109 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, |
| 93 | u8 command, u8 *values); | 110 | u8 command, u8 *values); |
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h index 591427a63b06..506a9f7af51e 100644 --- a/include/linux/i2c/tsc2007.h +++ b/include/linux/i2c/tsc2007.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | struct tsc2007_platform_data { | 6 | struct tsc2007_platform_data { |
| 7 | u16 model; /* 2007. */ | 7 | u16 model; /* 2007. */ |
| 8 | u16 x_plate_ohms; | 8 | u16 x_plate_ohms; /* must be non-zero value */ |
| 9 | u16 max_rt; /* max. resistance above which samples are ignored */ | 9 | u16 max_rt; /* max. resistance above which samples are ignored */ |
| 10 | unsigned long poll_delay; /* delay (in ms) after pen-down event | 10 | unsigned long poll_delay; /* delay (in ms) after pen-down event |
| 11 | before polling starts */ | 11 | before polling starts */ |
diff --git a/include/linux/input.h b/include/linux/input.h index a637e7814334..3862e32c4eeb 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -505,6 +505,7 @@ struct input_keymap_entry { | |||
| 505 | #define BTN_TOOL_FINGER 0x145 | 505 | #define BTN_TOOL_FINGER 0x145 |
| 506 | #define BTN_TOOL_MOUSE 0x146 | 506 | #define BTN_TOOL_MOUSE 0x146 |
| 507 | #define BTN_TOOL_LENS 0x147 | 507 | #define BTN_TOOL_LENS 0x147 |
| 508 | #define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ | ||
| 508 | #define BTN_TOUCH 0x14a | 509 | #define BTN_TOUCH 0x14a |
| 509 | #define BTN_STYLUS 0x14b | 510 | #define BTN_STYLUS 0x14b |
| 510 | #define BTN_STYLUS2 0x14c | 511 | #define BTN_STYLUS2 0x14c |
| @@ -814,6 +815,7 @@ struct input_keymap_entry { | |||
| 814 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | 815 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ |
| 815 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 816 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
| 816 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 817 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
| 818 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | ||
| 817 | #define SW_MAX 0x0f | 819 | #define SW_MAX 0x0f |
| 818 | #define SW_CNT (SW_MAX+1) | 820 | #define SW_CNT (SW_MAX+1) |
| 819 | 821 | ||
| @@ -1609,7 +1611,7 @@ struct ff_device { | |||
| 1609 | struct file *effect_owners[]; | 1611 | struct file *effect_owners[]; |
| 1610 | }; | 1612 | }; |
| 1611 | 1613 | ||
| 1612 | int input_ff_create(struct input_dev *dev, int max_effects); | 1614 | int input_ff_create(struct input_dev *dev, unsigned int max_effects); |
| 1613 | void input_ff_destroy(struct input_dev *dev); | 1615 | void input_ff_destroy(struct input_dev *dev); |
| 1614 | 1616 | ||
| 1615 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 1617 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
diff --git a/include/linux/input/adp5589.h b/include/linux/input/adp5589.h index ef792ecfaabf..1a05eee15e67 100644 --- a/include/linux/input/adp5589.h +++ b/include/linux/input/adp5589.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Analog Devices ADP5589 I/O Expander and QWERTY Keypad Controller | 2 | * Analog Devices ADP5589/ADP5585 I/O Expander and QWERTY Keypad Controller |
| 3 | * | 3 | * |
| 4 | * Copyright 2010-2011 Analog Devices Inc. | 4 | * Copyright 2010-2011 Analog Devices Inc. |
| 5 | * | 5 | * |
| @@ -9,89 +9,9 @@ | |||
| 9 | #ifndef _ADP5589_H | 9 | #ifndef _ADP5589_H |
| 10 | #define _ADP5589_H | 10 | #define _ADP5589_H |
| 11 | 11 | ||
| 12 | #define ADP5589_ID 0x00 | 12 | /* |
| 13 | #define ADP5589_INT_STATUS 0x01 | 13 | * ADP5589 specific GPI and Keymap defines |
| 14 | #define ADP5589_STATUS 0x02 | 14 | */ |
| 15 | #define ADP5589_FIFO_1 0x03 | ||
| 16 | #define ADP5589_FIFO_2 0x04 | ||
| 17 | #define ADP5589_FIFO_3 0x05 | ||
| 18 | #define ADP5589_FIFO_4 0x06 | ||
| 19 | #define ADP5589_FIFO_5 0x07 | ||
| 20 | #define ADP5589_FIFO_6 0x08 | ||
| 21 | #define ADP5589_FIFO_7 0x09 | ||
| 22 | #define ADP5589_FIFO_8 0x0A | ||
| 23 | #define ADP5589_FIFO_9 0x0B | ||
| 24 | #define ADP5589_FIFO_10 0x0C | ||
| 25 | #define ADP5589_FIFO_11 0x0D | ||
| 26 | #define ADP5589_FIFO_12 0x0E | ||
| 27 | #define ADP5589_FIFO_13 0x0F | ||
| 28 | #define ADP5589_FIFO_14 0x10 | ||
| 29 | #define ADP5589_FIFO_15 0x11 | ||
| 30 | #define ADP5589_FIFO_16 0x12 | ||
| 31 | #define ADP5589_GPI_INT_STAT_A 0x13 | ||
| 32 | #define ADP5589_GPI_INT_STAT_B 0x14 | ||
| 33 | #define ADP5589_GPI_INT_STAT_C 0x15 | ||
| 34 | #define ADP5589_GPI_STATUS_A 0x16 | ||
| 35 | #define ADP5589_GPI_STATUS_B 0x17 | ||
| 36 | #define ADP5589_GPI_STATUS_C 0x18 | ||
| 37 | #define ADP5589_RPULL_CONFIG_A 0x19 | ||
| 38 | #define ADP5589_RPULL_CONFIG_B 0x1A | ||
| 39 | #define ADP5589_RPULL_CONFIG_C 0x1B | ||
| 40 | #define ADP5589_RPULL_CONFIG_D 0x1C | ||
| 41 | #define ADP5589_RPULL_CONFIG_E 0x1D | ||
| 42 | #define ADP5589_GPI_INT_LEVEL_A 0x1E | ||
| 43 | #define ADP5589_GPI_INT_LEVEL_B 0x1F | ||
| 44 | #define ADP5589_GPI_INT_LEVEL_C 0x20 | ||
| 45 | #define ADP5589_GPI_EVENT_EN_A 0x21 | ||
| 46 | #define ADP5589_GPI_EVENT_EN_B 0x22 | ||
| 47 | #define ADP5589_GPI_EVENT_EN_C 0x23 | ||
| 48 | #define ADP5589_GPI_INTERRUPT_EN_A 0x24 | ||
| 49 | #define ADP5589_GPI_INTERRUPT_EN_B 0x25 | ||
| 50 | #define ADP5589_GPI_INTERRUPT_EN_C 0x26 | ||
| 51 | #define ADP5589_DEBOUNCE_DIS_A 0x27 | ||
| 52 | #define ADP5589_DEBOUNCE_DIS_B 0x28 | ||
| 53 | #define ADP5589_DEBOUNCE_DIS_C 0x29 | ||
| 54 | #define ADP5589_GPO_DATA_OUT_A 0x2A | ||
| 55 | #define ADP5589_GPO_DATA_OUT_B 0x2B | ||
| 56 | #define ADP5589_GPO_DATA_OUT_C 0x2C | ||
| 57 | #define ADP5589_GPO_OUT_MODE_A 0x2D | ||
| 58 | #define ADP5589_GPO_OUT_MODE_B 0x2E | ||
| 59 | #define ADP5589_GPO_OUT_MODE_C 0x2F | ||
| 60 | #define ADP5589_GPIO_DIRECTION_A 0x30 | ||
| 61 | #define ADP5589_GPIO_DIRECTION_B 0x31 | ||
| 62 | #define ADP5589_GPIO_DIRECTION_C 0x32 | ||
| 63 | #define ADP5589_UNLOCK1 0x33 | ||
| 64 | #define ADP5589_UNLOCK2 0x34 | ||
| 65 | #define ADP5589_EXT_LOCK_EVENT 0x35 | ||
| 66 | #define ADP5589_UNLOCK_TIMERS 0x36 | ||
| 67 | #define ADP5589_LOCK_CFG 0x37 | ||
| 68 | #define ADP5589_RESET1_EVENT_A 0x38 | ||
| 69 | #define ADP5589_RESET1_EVENT_B 0x39 | ||
| 70 | #define ADP5589_RESET1_EVENT_C 0x3A | ||
| 71 | #define ADP5589_RESET2_EVENT_A 0x3B | ||
| 72 | #define ADP5589_RESET2_EVENT_B 0x3C | ||
| 73 | #define ADP5589_RESET_CFG 0x3D | ||
| 74 | #define ADP5589_PWM_OFFT_LOW 0x3E | ||
| 75 | #define ADP5589_PWM_OFFT_HIGH 0x3F | ||
| 76 | #define ADP5589_PWM_ONT_LOW 0x40 | ||
| 77 | #define ADP5589_PWM_ONT_HIGH 0x41 | ||
| 78 | #define ADP5589_PWM_CFG 0x42 | ||
| 79 | #define ADP5589_CLOCK_DIV_CFG 0x43 | ||
| 80 | #define ADP5589_LOGIC_1_CFG 0x44 | ||
| 81 | #define ADP5589_LOGIC_2_CFG 0x45 | ||
| 82 | #define ADP5589_LOGIC_FF_CFG 0x46 | ||
| 83 | #define ADP5589_LOGIC_INT_EVENT_EN 0x47 | ||
| 84 | #define ADP5589_POLL_PTIME_CFG 0x48 | ||
| 85 | #define ADP5589_PIN_CONFIG_A 0x49 | ||
| 86 | #define ADP5589_PIN_CONFIG_B 0x4A | ||
| 87 | #define ADP5589_PIN_CONFIG_C 0x4B | ||
| 88 | #define ADP5589_PIN_CONFIG_D 0x4C | ||
| 89 | #define ADP5589_GENERAL_CFG 0x4D | ||
| 90 | #define ADP5589_INT_EN 0x4E | ||
| 91 | |||
| 92 | #define ADP5589_DEVICE_ID_MASK 0xF | ||
| 93 | |||
| 94 | /* Put one of these structures in i2c_board_info platform_data */ | ||
| 95 | 15 | ||
| 96 | #define ADP5589_KEYMAPSIZE 88 | 16 | #define ADP5589_KEYMAPSIZE 88 |
| 97 | 17 | ||
| @@ -127,6 +47,35 @@ | |||
| 127 | 47 | ||
| 128 | #define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) | 48 | #define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) |
| 129 | 49 | ||
| 50 | /* | ||
| 51 | * ADP5585 specific GPI and Keymap defines | ||
| 52 | */ | ||
| 53 | |||
| 54 | #define ADP5585_KEYMAPSIZE 30 | ||
| 55 | |||
| 56 | #define ADP5585_GPI_PIN_ROW0 37 | ||
| 57 | #define ADP5585_GPI_PIN_ROW1 38 | ||
| 58 | #define ADP5585_GPI_PIN_ROW2 39 | ||
| 59 | #define ADP5585_GPI_PIN_ROW3 40 | ||
| 60 | #define ADP5585_GPI_PIN_ROW4 41 | ||
| 61 | #define ADP5585_GPI_PIN_ROW5 42 | ||
| 62 | #define ADP5585_GPI_PIN_COL0 43 | ||
| 63 | #define ADP5585_GPI_PIN_COL1 44 | ||
| 64 | #define ADP5585_GPI_PIN_COL2 45 | ||
| 65 | #define ADP5585_GPI_PIN_COL3 46 | ||
| 66 | #define ADP5585_GPI_PIN_COL4 47 | ||
| 67 | #define GPI_LOGIC 48 | ||
| 68 | |||
| 69 | #define ADP5585_GPI_PIN_ROW_BASE ADP5585_GPI_PIN_ROW0 | ||
| 70 | #define ADP5585_GPI_PIN_ROW_END ADP5585_GPI_PIN_ROW5 | ||
| 71 | #define ADP5585_GPI_PIN_COL_BASE ADP5585_GPI_PIN_COL0 | ||
| 72 | #define ADP5585_GPI_PIN_COL_END ADP5585_GPI_PIN_COL4 | ||
| 73 | |||
| 74 | #define ADP5585_GPI_PIN_BASE ADP5585_GPI_PIN_ROW_BASE | ||
| 75 | #define ADP5585_GPI_PIN_END ADP5585_GPI_PIN_COL_END | ||
| 76 | |||
| 77 | #define ADP5585_GPIMAPSIZE_MAX (ADP5585_GPI_PIN_END - ADP5585_GPI_PIN_BASE + 1) | ||
| 78 | |||
| 130 | struct adp5589_gpi_map { | 79 | struct adp5589_gpi_map { |
| 131 | unsigned short pin; | 80 | unsigned short pin; |
| 132 | unsigned short sw_evt; | 81 | unsigned short sw_evt; |
| @@ -159,7 +108,7 @@ struct adp5589_gpi_map { | |||
| 159 | #define RESET2_POL_HIGH (1 << 7) | 108 | #define RESET2_POL_HIGH (1 << 7) |
| 160 | #define RESET2_POL_LOW (0 << 7) | 109 | #define RESET2_POL_LOW (0 << 7) |
| 161 | 110 | ||
| 162 | /* Mask Bits: | 111 | /* ADP5589 Mask Bits: |
| 163 | * C C C C C C C C C C C | R R R R R R R R | 112 | * C C C C C C C C C C C | R R R R R R R R |
| 164 | * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 113 | * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 |
| 165 | * 0 | 114 | * 0 |
| @@ -168,18 +117,44 @@ struct adp5589_gpi_map { | |||
| 168 | * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 | 117 | * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 |
| 169 | */ | 118 | */ |
| 170 | 119 | ||
| 171 | #define ADP_ROW(x) (1 << (x)) | 120 | #define ADP_ROW(x) (1 << (x)) |
| 172 | #define ADP_COL(x) (1 << (x + 8)) | 121 | #define ADP_COL(x) (1 << (x + 8)) |
| 122 | #define ADP5589_ROW_MASK 0xFF | ||
| 123 | #define ADP5589_COL_MASK 0xFF | ||
| 124 | #define ADP5589_COL_SHIFT 8 | ||
| 125 | #define ADP5589_MAX_ROW_NUM 7 | ||
| 126 | #define ADP5589_MAX_COL_NUM 10 | ||
| 127 | |||
| 128 | /* ADP5585 Mask Bits: | ||
| 129 | * C C C C C | R R R R R R | ||
| 130 | * 4 3 2 1 0 | 5 4 3 2 1 0 | ||
| 131 | * | ||
| 132 | * ---- BIT -- ----------- | ||
| 133 | * 1 0 0 0 0 | 0 0 0 0 0 0 | ||
| 134 | * 0 9 8 7 6 | 5 4 3 2 1 0 | ||
| 135 | */ | ||
| 136 | |||
| 137 | #define ADP5585_ROW_MASK 0x3F | ||
| 138 | #define ADP5585_COL_MASK 0x1F | ||
| 139 | #define ADP5585_ROW_SHIFT 0 | ||
| 140 | #define ADP5585_COL_SHIFT 6 | ||
| 141 | #define ADP5585_MAX_ROW_NUM 5 | ||
| 142 | #define ADP5585_MAX_COL_NUM 4 | ||
| 143 | |||
| 144 | #define ADP5585_ROW(x) (1 << ((x) & ADP5585_ROW_MASK)) | ||
| 145 | #define ADP5585_COL(x) (1 << (((x) & ADP5585_COL_MASK) + ADP5585_COL_SHIFT)) | ||
| 146 | |||
| 147 | /* Put one of these structures in i2c_board_info platform_data */ | ||
| 173 | 148 | ||
| 174 | struct adp5589_kpad_platform_data { | 149 | struct adp5589_kpad_platform_data { |
| 175 | unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ | 150 | unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ |
| 176 | const unsigned short *keymap; /* Pointer to keymap */ | 151 | const unsigned short *keymap; /* Pointer to keymap */ |
| 177 | unsigned short keymapsize; /* Keymap size */ | 152 | unsigned short keymapsize; /* Keymap size */ |
| 178 | bool repeat; /* Enable key repeat */ | 153 | bool repeat; /* Enable key repeat */ |
| 179 | bool en_keylock; /* Enable key lock feature */ | 154 | bool en_keylock; /* Enable key lock feature (ADP5589 only)*/ |
| 180 | unsigned char unlock_key1; /* Unlock Key 1 */ | 155 | unsigned char unlock_key1; /* Unlock Key 1 (ADP5589 only) */ |
| 181 | unsigned char unlock_key2; /* Unlock Key 2 */ | 156 | unsigned char unlock_key2; /* Unlock Key 2 (ADP5589 only) */ |
| 182 | unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable */ | 157 | unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable (ADP5589 only) */ |
| 183 | unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ | 158 | unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ |
| 184 | unsigned char reset_cfg; /* Reset config */ | 159 | unsigned char reset_cfg; /* Reset config */ |
| 185 | unsigned short reset1_key_1; /* Reset Key 1 */ | 160 | unsigned short reset1_key_1; /* Reset Key 1 */ |
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h index df00d998a44a..57e01a7cb006 100644 --- a/include/linux/input/adxl34x.h +++ b/include/linux/input/adxl34x.h | |||
| @@ -30,8 +30,9 @@ struct adxl34x_platform_data { | |||
| 30 | * Y, or Z participation in Tap detection. A '0' excludes the | 30 | * Y, or Z participation in Tap detection. A '0' excludes the |
| 31 | * selected axis from participation in Tap detection. | 31 | * selected axis from participation in Tap detection. |
| 32 | * Setting the SUPPRESS bit suppresses Double Tap detection if | 32 | * Setting the SUPPRESS bit suppresses Double Tap detection if |
| 33 | * acceleration greater than tap_threshold is present between | 33 | * acceleration greater than tap_threshold is present during the |
| 34 | * taps. | 34 | * tap_latency period, i.e. after the first tap but before the |
| 35 | * opening of the second tap window. | ||
| 35 | */ | 36 | */ |
| 36 | 37 | ||
| 37 | #define ADXL_SUPPRESS (1 << 3) | 38 | #define ADXL_SUPPRESS (1 << 3) |
| @@ -226,13 +227,13 @@ struct adxl34x_platform_data { | |||
| 226 | * detection will begin and prevent the detection of activity. This | 227 | * detection will begin and prevent the detection of activity. This |
| 227 | * bit serially links the activity and inactivity functions. When '0' | 228 | * bit serially links the activity and inactivity functions. When '0' |
| 228 | * the inactivity and activity functions are concurrent. Additional | 229 | * the inactivity and activity functions are concurrent. Additional |
| 229 | * information can be found in the Application section under Link | 230 | * information can be found in the ADXL34x datasheet's Application |
| 230 | * Mode. | 231 | * section under Link Mode. |
| 231 | * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode | 232 | * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode |
| 232 | * when inactivity (acceleration has been below inactivity_threshold | 233 | * when inactivity (acceleration has been below inactivity_threshold |
| 233 | * for at least inactivity_time) is detected and the LINK bit is set. | 234 | * for at least inactivity_time) is detected and the LINK bit is set. |
| 234 | * A '0' disables automatic switching to Sleep Mode. See SLEEP | 235 | * A '0' disables automatic switching to Sleep Mode. See the |
| 235 | * for further description. | 236 | * Sleep Bit section of the ADXL34x datasheet for more information. |
| 236 | */ | 237 | */ |
| 237 | 238 | ||
| 238 | #define ADXL_LINK (1 << 5) | 239 | #define ADXL_LINK (1 << 5) |
| @@ -266,6 +267,12 @@ struct adxl34x_platform_data { | |||
| 266 | 267 | ||
| 267 | u8 watermark; | 268 | u8 watermark; |
| 268 | 269 | ||
| 270 | /* | ||
| 271 | * When acceleration measurements are received from the ADXL34x | ||
| 272 | * events are sent to the event subsystem. The following settings | ||
| 273 | * select the event type and event code for new x, y and z axis data | ||
| 274 | * respectively. | ||
| 275 | */ | ||
| 269 | u32 ev_type; /* EV_ABS or EV_REL */ | 276 | u32 ev_type; /* EV_ABS or EV_REL */ |
| 270 | 277 | ||
| 271 | u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ | 278 | u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ |
| @@ -289,7 +296,7 @@ struct adxl34x_platform_data { | |||
| 289 | u32 ev_code_act_inactivity; /* EV_KEY */ | 296 | u32 ev_code_act_inactivity; /* EV_KEY */ |
| 290 | 297 | ||
| 291 | /* | 298 | /* |
| 292 | * Use ADXL34x INT2 instead of INT1 | 299 | * Use ADXL34x INT2 pin instead of INT1 pin for interrupt output |
| 293 | */ | 300 | */ |
| 294 | u8 use_int2; | 301 | u8 use_int2; |
| 295 | 302 | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index c81ed2ac16bd..e44e84f0156c 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -117,6 +117,8 @@ io_mapping_unmap(void __iomem *vaddr) | |||
| 117 | 117 | ||
| 118 | #else | 118 | #else |
| 119 | 119 | ||
| 120 | #include <linux/uaccess.h> | ||
| 121 | |||
| 120 | /* this struct isn't actually defined anywhere */ | 122 | /* this struct isn't actually defined anywhere */ |
| 121 | struct io_mapping; | 123 | struct io_mapping; |
| 122 | 124 | ||
| @@ -138,12 +140,14 @@ static inline void __iomem * | |||
| 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 140 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 139 | unsigned long offset) | 141 | unsigned long offset) |
| 140 | { | 142 | { |
| 143 | pagefault_disable(); | ||
| 141 | return ((char __force __iomem *) mapping) + offset; | 144 | return ((char __force __iomem *) mapping) + offset; |
| 142 | } | 145 | } |
| 143 | 146 | ||
| 144 | static inline void | 147 | static inline void |
| 145 | io_mapping_unmap_atomic(void __iomem *vaddr) | 148 | io_mapping_unmap_atomic(void __iomem *vaddr) |
| 146 | { | 149 | { |
| 150 | pagefault_enable(); | ||
| 147 | } | 151 | } |
| 148 | 152 | ||
| 149 | /* Non-atomic map/unmap */ | 153 | /* Non-atomic map/unmap */ |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9940319d6f9d..432acc4c054d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -25,15 +25,29 @@ | |||
| 25 | #define IOMMU_WRITE (2) | 25 | #define IOMMU_WRITE (2) |
| 26 | #define IOMMU_CACHE (4) /* DMA cache coherency */ | 26 | #define IOMMU_CACHE (4) /* DMA cache coherency */ |
| 27 | 27 | ||
| 28 | struct iommu_ops; | ||
| 29 | struct bus_type; | ||
| 28 | struct device; | 30 | struct device; |
| 31 | struct iommu_domain; | ||
| 32 | |||
| 33 | /* iommu fault flags */ | ||
| 34 | #define IOMMU_FAULT_READ 0x0 | ||
| 35 | #define IOMMU_FAULT_WRITE 0x1 | ||
| 36 | |||
| 37 | typedef int (*iommu_fault_handler_t)(struct iommu_domain *, | ||
| 38 | struct device *, unsigned long, int); | ||
| 29 | 39 | ||
| 30 | struct iommu_domain { | 40 | struct iommu_domain { |
| 41 | struct iommu_ops *ops; | ||
| 31 | void *priv; | 42 | void *priv; |
| 43 | iommu_fault_handler_t handler; | ||
| 32 | }; | 44 | }; |
| 33 | 45 | ||
| 34 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 | 46 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 |
| 35 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 47 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
| 36 | 48 | ||
| 49 | #ifdef CONFIG_IOMMU_API | ||
| 50 | |||
| 37 | struct iommu_ops { | 51 | struct iommu_ops { |
| 38 | int (*domain_init)(struct iommu_domain *domain); | 52 | int (*domain_init)(struct iommu_domain *domain); |
| 39 | void (*domain_destroy)(struct iommu_domain *domain); | 53 | void (*domain_destroy)(struct iommu_domain *domain); |
| @@ -49,11 +63,9 @@ struct iommu_ops { | |||
| 49 | unsigned long cap); | 63 | unsigned long cap); |
| 50 | }; | 64 | }; |
| 51 | 65 | ||
| 52 | #ifdef CONFIG_IOMMU_API | 66 | extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); |
| 53 | 67 | extern bool iommu_present(struct bus_type *bus); | |
| 54 | extern void register_iommu(struct iommu_ops *ops); | 68 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); |
| 55 | extern bool iommu_found(void); | ||
| 56 | extern struct iommu_domain *iommu_domain_alloc(void); | ||
| 57 | extern void iommu_domain_free(struct iommu_domain *domain); | 69 | extern void iommu_domain_free(struct iommu_domain *domain); |
| 58 | extern int iommu_attach_device(struct iommu_domain *domain, | 70 | extern int iommu_attach_device(struct iommu_domain *domain, |
| 59 | struct device *dev); | 71 | struct device *dev); |
| @@ -67,19 +79,58 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | |||
| 67 | unsigned long iova); | 79 | unsigned long iova); |
| 68 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | 80 | extern int iommu_domain_has_cap(struct iommu_domain *domain, |
| 69 | unsigned long cap); | 81 | unsigned long cap); |
| 82 | extern void iommu_set_fault_handler(struct iommu_domain *domain, | ||
| 83 | iommu_fault_handler_t handler); | ||
| 84 | |||
| 85 | /** | ||
| 86 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | ||
| 87 | * @domain: the iommu domain where the fault has happened | ||
| 88 | * @dev: the device where the fault has happened | ||
| 89 | * @iova: the faulting address | ||
| 90 | * @flags: mmu fault flags (e.g. IOMMU_FAULT_READ/IOMMU_FAULT_WRITE/...) | ||
| 91 | * | ||
| 92 | * This function should be called by the low-level IOMMU implementations | ||
| 93 | * whenever IOMMU faults happen, to allow high-level users, that are | ||
| 94 | * interested in such events, to know about them. | ||
| 95 | * | ||
| 96 | * This event may be useful for several possible use cases: | ||
| 97 | * - mere logging of the event | ||
| 98 | * - dynamic TLB/PTE loading | ||
| 99 | * - if restarting of the faulting device is required | ||
| 100 | * | ||
| 101 | * Returns 0 on success and an appropriate error code otherwise (if dynamic | ||
| 102 | * PTE/TLB loading will one day be supported, implementations will be able | ||
| 103 | * to tell whether it succeeded or not according to this return value). | ||
| 104 | * | ||
| 105 | * Specifically, -ENOSYS is returned if a fault handler isn't installed | ||
| 106 | * (though fault handlers can also return -ENOSYS, in case they want to | ||
| 107 | * elicit the default behavior of the IOMMU drivers). | ||
| 108 | */ | ||
| 109 | static inline int report_iommu_fault(struct iommu_domain *domain, | ||
| 110 | struct device *dev, unsigned long iova, int flags) | ||
| 111 | { | ||
| 112 | int ret = -ENOSYS; | ||
| 70 | 113 | ||
| 71 | #else /* CONFIG_IOMMU_API */ | 114 | /* |
| 115 | * if upper layers showed interest and installed a fault handler, | ||
| 116 | * invoke it. | ||
| 117 | */ | ||
| 118 | if (domain->handler) | ||
| 119 | ret = domain->handler(domain, dev, iova, flags); | ||
| 72 | 120 | ||
| 73 | static inline void register_iommu(struct iommu_ops *ops) | 121 | return ret; |
| 74 | { | ||
| 75 | } | 122 | } |
| 76 | 123 | ||
| 77 | static inline bool iommu_found(void) | 124 | #else /* CONFIG_IOMMU_API */ |
| 125 | |||
| 126 | struct iommu_ops {}; | ||
| 127 | |||
| 128 | static inline bool iommu_present(struct bus_type *bus) | ||
| 78 | { | 129 | { |
| 79 | return false; | 130 | return false; |
| 80 | } | 131 | } |
| 81 | 132 | ||
| 82 | static inline struct iommu_domain *iommu_domain_alloc(void) | 133 | static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) |
| 83 | { | 134 | { |
| 84 | return NULL; | 135 | return NULL; |
| 85 | } | 136 | } |
| @@ -123,6 +174,11 @@ static inline int domain_has_cap(struct iommu_domain *domain, | |||
| 123 | return 0; | 174 | return 0; |
| 124 | } | 175 | } |
| 125 | 176 | ||
| 177 | static inline void iommu_set_fault_handler(struct iommu_domain *domain, | ||
| 178 | iommu_fault_handler_t handler) | ||
| 179 | { | ||
| 180 | } | ||
| 181 | |||
| 126 | #endif /* CONFIG_IOMMU_API */ | 182 | #endif /* CONFIG_IOMMU_API */ |
| 127 | 183 | ||
| 128 | #endif /* __LINUX_IOMMU_H */ | 184 | #endif /* __LINUX_IOMMU_H */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index aace6b8691a2..f47fcd30273d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -371,6 +371,7 @@ struct kvm_s390_psw { | |||
| 371 | #define KVM_S390_INT_VIRTIO 0xffff2603u | 371 | #define KVM_S390_INT_VIRTIO 0xffff2603u |
| 372 | #define KVM_S390_INT_SERVICE 0xffff2401u | 372 | #define KVM_S390_INT_SERVICE 0xffff2401u |
| 373 | #define KVM_S390_INT_EMERGENCY 0xffff1201u | 373 | #define KVM_S390_INT_EMERGENCY 0xffff1201u |
| 374 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u | ||
| 374 | 375 | ||
| 375 | struct kvm_s390_interrupt { | 376 | struct kvm_s390_interrupt { |
| 376 | __u32 type; | 377 | __u32 type; |
| @@ -463,7 +464,7 @@ struct kvm_ppc_pvinfo { | |||
| 463 | #define KVM_CAP_VAPIC 6 | 464 | #define KVM_CAP_VAPIC 6 |
| 464 | #define KVM_CAP_EXT_CPUID 7 | 465 | #define KVM_CAP_EXT_CPUID 7 |
| 465 | #define KVM_CAP_CLOCKSOURCE 8 | 466 | #define KVM_CAP_CLOCKSOURCE 8 |
| 466 | #define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */ | 467 | #define KVM_CAP_NR_VCPUS 9 /* returns recommended max vcpus per vm */ |
| 467 | #define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ | 468 | #define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ |
| 468 | #define KVM_CAP_PIT 11 | 469 | #define KVM_CAP_PIT 11 |
| 469 | #define KVM_CAP_NOP_IO_DELAY 12 | 470 | #define KVM_CAP_NOP_IO_DELAY 12 |
| @@ -553,6 +554,9 @@ struct kvm_ppc_pvinfo { | |||
| 553 | #define KVM_CAP_SPAPR_TCE 63 | 554 | #define KVM_CAP_SPAPR_TCE 63 |
| 554 | #define KVM_CAP_PPC_SMT 64 | 555 | #define KVM_CAP_PPC_SMT 64 |
| 555 | #define KVM_CAP_PPC_RMA 65 | 556 | #define KVM_CAP_PPC_RMA 65 |
| 557 | #define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */ | ||
| 558 | #define KVM_CAP_PPC_HIOR 67 | ||
| 559 | #define KVM_CAP_PPC_PAPR 68 | ||
| 556 | #define KVM_CAP_S390_GMAP 71 | 560 | #define KVM_CAP_S390_GMAP 71 |
| 557 | 561 | ||
| 558 | #ifdef KVM_CAP_IRQ_ROUTING | 562 | #ifdef KVM_CAP_IRQ_ROUTING |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index eabb21a30c34..d52623199978 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/rcupdate.h> | 20 | #include <linux/rcupdate.h> |
| 21 | #include <linux/ratelimit.h> | ||
| 21 | #include <asm/signal.h> | 22 | #include <asm/signal.h> |
| 22 | 23 | ||
| 23 | #include <linux/kvm.h> | 24 | #include <linux/kvm.h> |
| @@ -48,6 +49,7 @@ | |||
| 48 | #define KVM_REQ_EVENT 11 | 49 | #define KVM_REQ_EVENT 11 |
| 49 | #define KVM_REQ_APF_HALT 12 | 50 | #define KVM_REQ_APF_HALT 12 |
| 50 | #define KVM_REQ_STEAL_UPDATE 13 | 51 | #define KVM_REQ_STEAL_UPDATE 13 |
| 52 | #define KVM_REQ_NMI 14 | ||
| 51 | 53 | ||
| 52 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 54 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 53 | 55 | ||
| @@ -55,16 +57,16 @@ struct kvm; | |||
| 55 | struct kvm_vcpu; | 57 | struct kvm_vcpu; |
| 56 | extern struct kmem_cache *kvm_vcpu_cache; | 58 | extern struct kmem_cache *kvm_vcpu_cache; |
| 57 | 59 | ||
| 58 | /* | 60 | struct kvm_io_range { |
| 59 | * It would be nice to use something smarter than a linear search, TBD... | 61 | gpa_t addr; |
| 60 | * Thankfully we dont expect many devices to register (famous last words :), | 62 | int len; |
| 61 | * so until then it will suffice. At least its abstracted so we can change | 63 | struct kvm_io_device *dev; |
| 62 | * in one place. | 64 | }; |
| 63 | */ | 65 | |
| 64 | struct kvm_io_bus { | 66 | struct kvm_io_bus { |
| 65 | int dev_count; | 67 | int dev_count; |
| 66 | #define NR_IOBUS_DEVS 200 | 68 | #define NR_IOBUS_DEVS 300 |
| 67 | struct kvm_io_device *devs[NR_IOBUS_DEVS]; | 69 | struct kvm_io_range range[NR_IOBUS_DEVS]; |
| 68 | }; | 70 | }; |
| 69 | 71 | ||
| 70 | enum kvm_bus { | 72 | enum kvm_bus { |
| @@ -77,8 +79,8 @@ int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | |||
| 77 | int len, const void *val); | 79 | int len, const void *val); |
| 78 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, | 80 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, |
| 79 | void *val); | 81 | void *val); |
| 80 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 82 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, |
| 81 | struct kvm_io_device *dev); | 83 | int len, struct kvm_io_device *dev); |
| 82 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 84 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
| 83 | struct kvm_io_device *dev); | 85 | struct kvm_io_device *dev); |
| 84 | 86 | ||
| @@ -256,8 +258,9 @@ struct kvm { | |||
| 256 | struct kvm_arch arch; | 258 | struct kvm_arch arch; |
| 257 | atomic_t users_count; | 259 | atomic_t users_count; |
| 258 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | 260 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET |
| 259 | struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; | ||
| 260 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | 261 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; |
| 262 | spinlock_t ring_lock; | ||
| 263 | struct list_head coalesced_zones; | ||
| 261 | #endif | 264 | #endif |
| 262 | 265 | ||
| 263 | struct mutex irq_lock; | 266 | struct mutex irq_lock; |
| @@ -281,11 +284,8 @@ struct kvm { | |||
| 281 | 284 | ||
| 282 | /* The guest did something we don't support. */ | 285 | /* The guest did something we don't support. */ |
| 283 | #define pr_unimpl(vcpu, fmt, ...) \ | 286 | #define pr_unimpl(vcpu, fmt, ...) \ |
| 284 | do { \ | 287 | pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ |
| 285 | if (printk_ratelimit()) \ | 288 | current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) |
| 286 | printk(KERN_ERR "kvm: %i: cpu%i " fmt, \ | ||
| 287 | current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \ | ||
| 288 | } while (0) | ||
| 289 | 289 | ||
| 290 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) | 290 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) |
| 291 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) | 291 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index efd6f9800762..23fa829bf7a3 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); | |||
| 1052 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); | 1052 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); |
| 1053 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, | 1053 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
| 1054 | int queue_depth, int reason); | 1054 | int queue_depth, int reason); |
| 1055 | extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | ||
| 1056 | int queue_depth, int reason); | ||
| 1055 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | 1057 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); |
| 1056 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); | 1058 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); |
| 1057 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); | 1059 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index 4c806f6d663e..2463c2619596 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
| @@ -68,11 +68,6 @@ | |||
| 68 | #define TWL6040_REG_ACCCTL 0x2D | 68 | #define TWL6040_REG_ACCCTL 0x2D |
| 69 | #define TWL6040_REG_STATUS 0x2E | 69 | #define TWL6040_REG_STATUS 0x2E |
| 70 | 70 | ||
| 71 | #define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1) | ||
| 72 | |||
| 73 | #define TWL6040_VIOREGNUM 18 | ||
| 74 | #define TWL6040_VDDREGNUM 21 | ||
| 75 | |||
| 76 | /* INTID (0x03) fields */ | 71 | /* INTID (0x03) fields */ |
| 77 | 72 | ||
| 78 | #define TWL6040_THINT 0x01 | 73 | #define TWL6040_THINT 0x01 |
| @@ -125,34 +120,24 @@ | |||
| 125 | #define TWL6040_LPLLFIN 0x08 | 120 | #define TWL6040_LPLLFIN 0x08 |
| 126 | #define TWL6040_HPLLSEL 0x10 | 121 | #define TWL6040_HPLLSEL 0x10 |
| 127 | 122 | ||
| 128 | /* HSLCTL (0x10) fields */ | 123 | /* HSLCTL/R (0x10/0x11) fields */ |
| 129 | |||
| 130 | #define TWL6040_HSDACMODEL 0x02 | ||
| 131 | #define TWL6040_HSDRVMODEL 0x08 | ||
| 132 | |||
| 133 | /* HSRCTL (0x11) fields */ | ||
| 134 | 124 | ||
| 135 | #define TWL6040_HSDACMODER 0x02 | 125 | #define TWL6040_HSDACENA (1 << 0) |
| 136 | #define TWL6040_HSDRVMODER 0x08 | 126 | #define TWL6040_HSDACMODE (1 << 1) |
| 127 | #define TWL6040_HSDRVMODE (1 << 3) | ||
| 137 | 128 | ||
| 138 | /* VIBCTLL (0x18) fields */ | 129 | /* VIBCTLL/R (0x18/0x1A) fields */ |
| 139 | 130 | ||
| 140 | #define TWL6040_VIBENAL 0x01 | 131 | #define TWL6040_VIBENA (1 << 0) |
| 141 | #define TWL6040_VIBCTRLL 0x04 | 132 | #define TWL6040_VIBSEL (1 << 1) |
| 142 | #define TWL6040_VIBCTRLLP 0x08 | 133 | #define TWL6040_VIBCTRL (1 << 2) |
| 143 | #define TWL6040_VIBCTRLLN 0x10 | 134 | #define TWL6040_VIBCTRL_P (1 << 3) |
| 135 | #define TWL6040_VIBCTRL_N (1 << 4) | ||
| 144 | 136 | ||
| 145 | /* VIBDATL (0x19) fields */ | 137 | /* VIBDATL/R (0x19/0x1B) fields */ |
| 146 | 138 | ||
| 147 | #define TWL6040_VIBDAT_MAX 0x64 | 139 | #define TWL6040_VIBDAT_MAX 0x64 |
| 148 | 140 | ||
| 149 | /* VIBCTLR (0x1A) fields */ | ||
| 150 | |||
| 151 | #define TWL6040_VIBENAR 0x01 | ||
| 152 | #define TWL6040_VIBCTRLR 0x04 | ||
| 153 | #define TWL6040_VIBCTRLRP 0x08 | ||
| 154 | #define TWL6040_VIBCTRLRN 0x10 | ||
| 155 | |||
| 156 | /* GPOCTL (0x1E) fields */ | 141 | /* GPOCTL (0x1E) fields */ |
| 157 | 142 | ||
| 158 | #define TWL6040_GPO1 0x01 | 143 | #define TWL6040_GPO1 0x01 |
| @@ -200,6 +185,7 @@ struct twl6040 { | |||
| 200 | int audpwron; | 185 | int audpwron; |
| 201 | int power_count; | 186 | int power_count; |
| 202 | int rev; | 187 | int rev; |
| 188 | u8 vibra_ctrl_cache[2]; | ||
| 203 | 189 | ||
| 204 | int pll; | 190 | int pll; |
| 205 | unsigned int sysclk; | 191 | unsigned int sysclk; |
| @@ -224,5 +210,13 @@ int twl6040_get_pll(struct twl6040 *twl6040); | |||
| 224 | unsigned int twl6040_get_sysclk(struct twl6040 *twl6040); | 210 | unsigned int twl6040_get_sysclk(struct twl6040 *twl6040); |
| 225 | int twl6040_irq_init(struct twl6040 *twl6040); | 211 | int twl6040_irq_init(struct twl6040 *twl6040); |
| 226 | void twl6040_irq_exit(struct twl6040 *twl6040); | 212 | void twl6040_irq_exit(struct twl6040 *twl6040); |
| 213 | /* Get the combined status of the vibra control register */ | ||
| 214 | int twl6040_get_vibralr_status(struct twl6040 *twl6040); | ||
| 215 | |||
| 216 | static inline int twl6040_get_revid(struct twl6040 *twl6040) | ||
| 217 | { | ||
| 218 | return twl6040->rev; | ||
| 219 | } | ||
| 220 | |||
| 227 | 221 | ||
| 228 | #endif /* End of __TWL6040_CODEC_H__ */ | 222 | #endif /* End of __TWL6040_CODEC_H__ */ |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index 45df450d869f..626809147624 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | enum wm8994_type { | 20 | enum wm8994_type { |
| 21 | WM8994 = 0, | 21 | WM8994 = 0, |
| 22 | WM8958 = 1, | 22 | WM8958 = 1, |
| 23 | WM1811 = 2, | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | struct regulator_dev; | 26 | struct regulator_dev; |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index f3ee84284670..fae295048a8b 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | #define WM8994_DC_SERVO_2 0x55 | 72 | #define WM8994_DC_SERVO_2 0x55 |
| 73 | #define WM8994_DC_SERVO_4 0x57 | 73 | #define WM8994_DC_SERVO_4 0x57 |
| 74 | #define WM8994_DC_SERVO_READBACK 0x58 | 74 | #define WM8994_DC_SERVO_READBACK 0x58 |
| 75 | #define WM8994_DC_SERVO_4E 0x59 | ||
| 75 | #define WM8994_ANALOGUE_HP_1 0x60 | 76 | #define WM8994_ANALOGUE_HP_1 0x60 |
| 76 | #define WM8958_MIC_DETECT_1 0xD0 | 77 | #define WM8958_MIC_DETECT_1 0xD0 |
| 77 | #define WM8958_MIC_DETECT_2 0xD1 | 78 | #define WM8958_MIC_DETECT_2 0xD1 |
| @@ -133,6 +134,8 @@ | |||
| 133 | #define WM8994_AIF1_DAC1_FILTERS_2 0x421 | 134 | #define WM8994_AIF1_DAC1_FILTERS_2 0x421 |
| 134 | #define WM8994_AIF1_DAC2_FILTERS_1 0x422 | 135 | #define WM8994_AIF1_DAC2_FILTERS_1 0x422 |
| 135 | #define WM8994_AIF1_DAC2_FILTERS_2 0x423 | 136 | #define WM8994_AIF1_DAC2_FILTERS_2 0x423 |
| 137 | #define WM8958_AIF1_DAC1_NOISE_GATE 0x430 | ||
| 138 | #define WM8958_AIF1_DAC2_NOISE_GATE 0x431 | ||
| 136 | #define WM8994_AIF1_DRC1_1 0x440 | 139 | #define WM8994_AIF1_DRC1_1 0x440 |
| 137 | #define WM8994_AIF1_DRC1_2 0x441 | 140 | #define WM8994_AIF1_DRC1_2 0x441 |
| 138 | #define WM8994_AIF1_DRC1_3 0x442 | 141 | #define WM8994_AIF1_DRC1_3 0x442 |
| @@ -190,6 +193,7 @@ | |||
| 190 | #define WM8994_AIF2_ADC_FILTERS 0x510 | 193 | #define WM8994_AIF2_ADC_FILTERS 0x510 |
| 191 | #define WM8994_AIF2_DAC_FILTERS_1 0x520 | 194 | #define WM8994_AIF2_DAC_FILTERS_1 0x520 |
| 192 | #define WM8994_AIF2_DAC_FILTERS_2 0x521 | 195 | #define WM8994_AIF2_DAC_FILTERS_2 0x521 |
| 196 | #define WM8958_AIF2_DAC_NOISE_GATE 0x530 | ||
| 193 | #define WM8994_AIF2_DRC_1 0x540 | 197 | #define WM8994_AIF2_DRC_1 0x540 |
| 194 | #define WM8994_AIF2_DRC_2 0x541 | 198 | #define WM8994_AIF2_DRC_2 0x541 |
| 195 | #define WM8994_AIF2_DRC_3 0x542 | 199 | #define WM8994_AIF2_DRC_3 0x542 |
| @@ -1921,6 +1925,44 @@ | |||
| 1921 | #define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */ | 1925 | #define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */ |
| 1922 | 1926 | ||
| 1923 | /* | 1927 | /* |
| 1928 | * R61 (0x3D) - MICBIAS1 | ||
| 1929 | */ | ||
| 1930 | #define WM8958_MICB1_RATE 0x0020 /* MICB1_RATE */ | ||
| 1931 | #define WM8958_MICB1_RATE_MASK 0x0020 /* MICB1_RATE */ | ||
| 1932 | #define WM8958_MICB1_RATE_SHIFT 5 /* MICB1_RATE */ | ||
| 1933 | #define WM8958_MICB1_RATE_WIDTH 1 /* MICB1_RATE */ | ||
| 1934 | #define WM8958_MICB1_MODE 0x0010 /* MICB1_MODE */ | ||
| 1935 | #define WM8958_MICB1_MODE_MASK 0x0010 /* MICB1_MODE */ | ||
| 1936 | #define WM8958_MICB1_MODE_SHIFT 4 /* MICB1_MODE */ | ||
| 1937 | #define WM8958_MICB1_MODE_WIDTH 1 /* MICB1_MODE */ | ||
| 1938 | #define WM8958_MICB1_LVL_MASK 0x000E /* MICB1_LVL - [3:1] */ | ||
| 1939 | #define WM8958_MICB1_LVL_SHIFT 1 /* MICB1_LVL - [3:1] */ | ||
| 1940 | #define WM8958_MICB1_LVL_WIDTH 3 /* MICB1_LVL - [3:1] */ | ||
| 1941 | #define WM8958_MICB1_DISCH 0x0001 /* MICB1_DISCH */ | ||
| 1942 | #define WM8958_MICB1_DISCH_MASK 0x0001 /* MICB1_DISCH */ | ||
| 1943 | #define WM8958_MICB1_DISCH_SHIFT 0 /* MICB1_DISCH */ | ||
| 1944 | #define WM8958_MICB1_DISCH_WIDTH 1 /* MICB1_DISCH */ | ||
| 1945 | |||
| 1946 | /* | ||
| 1947 | * R62 (0x3E) - MICBIAS2 | ||
| 1948 | */ | ||
| 1949 | #define WM8958_MICB2_RATE 0x0020 /* MICB2_RATE */ | ||
| 1950 | #define WM8958_MICB2_RATE_MASK 0x0020 /* MICB2_RATE */ | ||
| 1951 | #define WM8958_MICB2_RATE_SHIFT 5 /* MICB2_RATE */ | ||
| 1952 | #define WM8958_MICB2_RATE_WIDTH 1 /* MICB2_RATE */ | ||
| 1953 | #define WM8958_MICB2_MODE 0x0010 /* MICB2_MODE */ | ||
| 1954 | #define WM8958_MICB2_MODE_MASK 0x0010 /* MICB2_MODE */ | ||
| 1955 | #define WM8958_MICB2_MODE_SHIFT 4 /* MICB2_MODE */ | ||
| 1956 | #define WM8958_MICB2_MODE_WIDTH 1 /* MICB2_MODE */ | ||
| 1957 | #define WM8958_MICB2_LVL_MASK 0x000E /* MICB2_LVL - [3:1] */ | ||
| 1958 | #define WM8958_MICB2_LVL_SHIFT 1 /* MICB2_LVL - [3:1] */ | ||
| 1959 | #define WM8958_MICB2_LVL_WIDTH 3 /* MICB2_LVL - [3:1] */ | ||
| 1960 | #define WM8958_MICB2_DISCH 0x0001 /* MICB2_DISCH */ | ||
| 1961 | #define WM8958_MICB2_DISCH_MASK 0x0001 /* MICB2_DISCH */ | ||
| 1962 | #define WM8958_MICB2_DISCH_SHIFT 0 /* MICB2_DISCH */ | ||
| 1963 | #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ | ||
| 1964 | |||
| 1965 | /* | ||
| 1924 | * R76 (0x4C) - Charge Pump (1) | 1966 | * R76 (0x4C) - Charge Pump (1) |
| 1925 | */ | 1967 | */ |
| 1926 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ | 1968 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ |
| @@ -2027,6 +2069,10 @@ | |||
| 2027 | /* | 2069 | /* |
| 2028 | * R96 (0x60) - Analogue HP (1) | 2070 | * R96 (0x60) - Analogue HP (1) |
| 2029 | */ | 2071 | */ |
| 2072 | #define WM1811_HPOUT1_ATTN 0x0100 /* HPOUT1_ATTN */ | ||
| 2073 | #define WM1811_HPOUT1_ATTN_MASK 0x0100 /* HPOUT1_ATTN */ | ||
| 2074 | #define WM1811_HPOUT1_ATTN_SHIFT 8 /* HPOUT1_ATTN */ | ||
| 2075 | #define WM1811_HPOUT1_ATTN_WIDTH 1 /* HPOUT1_ATTN */ | ||
| 2030 | #define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */ | 2076 | #define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */ |
| 2031 | #define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */ | 2077 | #define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */ |
| 2032 | #define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */ | 2078 | #define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */ |
| @@ -2949,6 +2995,34 @@ | |||
| 2949 | #define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */ | 2995 | #define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */ |
| 2950 | 2996 | ||
| 2951 | /* | 2997 | /* |
| 2998 | * R1072 (0x430) - AIF1 DAC1 Noise Gate | ||
| 2999 | */ | ||
| 3000 | #define WM8958_AIF1DAC1_NG_HLD_MASK 0x0060 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
| 3001 | #define WM8958_AIF1DAC1_NG_HLD_SHIFT 5 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
| 3002 | #define WM8958_AIF1DAC1_NG_HLD_WIDTH 2 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
| 3003 | #define WM8958_AIF1DAC1_NG_THR_MASK 0x000E /* AIF1DAC1_NG_THR - [3:1] */ | ||
| 3004 | #define WM8958_AIF1DAC1_NG_THR_SHIFT 1 /* AIF1DAC1_NG_THR - [3:1] */ | ||
| 3005 | #define WM8958_AIF1DAC1_NG_THR_WIDTH 3 /* AIF1DAC1_NG_THR - [3:1] */ | ||
| 3006 | #define WM8958_AIF1DAC1_NG_ENA 0x0001 /* AIF1DAC1_NG_ENA */ | ||
| 3007 | #define WM8958_AIF1DAC1_NG_ENA_MASK 0x0001 /* AIF1DAC1_NG_ENA */ | ||
| 3008 | #define WM8958_AIF1DAC1_NG_ENA_SHIFT 0 /* AIF1DAC1_NG_ENA */ | ||
| 3009 | #define WM8958_AIF1DAC1_NG_ENA_WIDTH 1 /* AIF1DAC1_NG_ENA */ | ||
| 3010 | |||
| 3011 | /* | ||
| 3012 | * R1073 (0x431) - AIF1 DAC2 Noise Gate | ||
| 3013 | */ | ||
| 3014 | #define WM8958_AIF1DAC2_NG_HLD_MASK 0x0060 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
| 3015 | #define WM8958_AIF1DAC2_NG_HLD_SHIFT 5 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
| 3016 | #define WM8958_AIF1DAC2_NG_HLD_WIDTH 2 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
| 3017 | #define WM8958_AIF1DAC2_NG_THR_MASK 0x000E /* AIF1DAC2_NG_THR - [3:1] */ | ||
| 3018 | #define WM8958_AIF1DAC2_NG_THR_SHIFT 1 /* AIF1DAC2_NG_THR - [3:1] */ | ||
| 3019 | #define WM8958_AIF1DAC2_NG_THR_WIDTH 3 /* AIF1DAC2_NG_THR - [3:1] */ | ||
| 3020 | #define WM8958_AIF1DAC2_NG_ENA 0x0001 /* AIF1DAC2_NG_ENA */ | ||
| 3021 | #define WM8958_AIF1DAC2_NG_ENA_MASK 0x0001 /* AIF1DAC2_NG_ENA */ | ||
| 3022 | #define WM8958_AIF1DAC2_NG_ENA_SHIFT 0 /* AIF1DAC2_NG_ENA */ | ||
| 3023 | #define WM8958_AIF1DAC2_NG_ENA_WIDTH 1 /* AIF1DAC2_NG_ENA */ | ||
| 3024 | |||
| 3025 | /* | ||
| 2952 | * R1088 (0x440) - AIF1 DRC1 (1) | 3026 | * R1088 (0x440) - AIF1 DRC1 (1) |
| 2953 | */ | 3027 | */ |
| 2954 | #define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ | 3028 | #define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ |
| @@ -3560,6 +3634,20 @@ | |||
| 3560 | #define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */ | 3634 | #define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */ |
| 3561 | 3635 | ||
| 3562 | /* | 3636 | /* |
| 3637 | * R1328 (0x530) - AIF2 DAC Noise Gate | ||
| 3638 | */ | ||
| 3639 | #define WM8958_AIF2DAC_NG_HLD_MASK 0x0060 /* AIF2DAC_NG_HLD - [6:5] */ | ||
| 3640 | #define WM8958_AIF2DAC_NG_HLD_SHIFT 5 /* AIF2DAC_NG_HLD - [6:5] */ | ||
| 3641 | #define WM8958_AIF2DAC_NG_HLD_WIDTH 2 /* AIF2DAC_NG_HLD - [6:5] */ | ||
| 3642 | #define WM8958_AIF2DAC_NG_THR_MASK 0x000E /* AIF2DAC_NG_THR - [3:1] */ | ||
| 3643 | #define WM8958_AIF2DAC_NG_THR_SHIFT 1 /* AIF2DAC_NG_THR - [3:1] */ | ||
| 3644 | #define WM8958_AIF2DAC_NG_THR_WIDTH 3 /* AIF2DAC_NG_THR - [3:1] */ | ||
| 3645 | #define WM8958_AIF2DAC_NG_ENA 0x0001 /* AIF2DAC_NG_ENA */ | ||
| 3646 | #define WM8958_AIF2DAC_NG_ENA_MASK 0x0001 /* AIF2DAC_NG_ENA */ | ||
| 3647 | #define WM8958_AIF2DAC_NG_ENA_SHIFT 0 /* AIF2DAC_NG_ENA */ | ||
| 3648 | #define WM8958_AIF2DAC_NG_ENA_WIDTH 1 /* AIF2DAC_NG_ENA */ | ||
| 3649 | |||
| 3650 | /* | ||
| 3563 | * R1344 (0x540) - AIF2 DRC (1) | 3651 | * R1344 (0x540) - AIF2 DRC (1) |
| 3564 | */ | 3652 | */ |
| 3565 | #define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */ | 3653 | #define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index b460fc2af8a1..415f2db414e1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -50,8 +50,12 @@ struct mmc_ext_csd { | |||
| 50 | u8 rel_sectors; | 50 | u8 rel_sectors; |
| 51 | u8 rel_param; | 51 | u8 rel_param; |
| 52 | u8 part_config; | 52 | u8 part_config; |
| 53 | u8 cache_ctrl; | ||
| 54 | u8 rst_n_function; | ||
| 53 | unsigned int part_time; /* Units: ms */ | 55 | unsigned int part_time; /* Units: ms */ |
| 54 | unsigned int sa_timeout; /* Units: 100ns */ | 56 | unsigned int sa_timeout; /* Units: 100ns */ |
| 57 | unsigned int generic_cmd6_time; /* Units: 10ms */ | ||
| 58 | unsigned int power_off_longtime; /* Units: ms */ | ||
| 55 | unsigned int hs_max_dtr; | 59 | unsigned int hs_max_dtr; |
| 56 | unsigned int sectors; | 60 | unsigned int sectors; |
| 57 | unsigned int card_type; | 61 | unsigned int card_type; |
| @@ -63,11 +67,15 @@ struct mmc_ext_csd { | |||
| 63 | bool enhanced_area_en; /* enable bit */ | 67 | bool enhanced_area_en; /* enable bit */ |
| 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 68 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
| 65 | unsigned int enhanced_area_size; /* Units: KB */ | 69 | unsigned int enhanced_area_size; /* Units: KB */ |
| 66 | unsigned int boot_size; /* in bytes */ | 70 | unsigned int cache_size; /* Units: KB */ |
| 71 | bool hpi_en; /* HPI enablebit */ | ||
| 72 | bool hpi; /* HPI support bit */ | ||
| 73 | unsigned int hpi_cmd; /* cmd used as HPI */ | ||
| 67 | u8 raw_partition_support; /* 160 */ | 74 | u8 raw_partition_support; /* 160 */ |
| 68 | u8 raw_erased_mem_count; /* 181 */ | 75 | u8 raw_erased_mem_count; /* 181 */ |
| 69 | u8 raw_ext_csd_structure; /* 194 */ | 76 | u8 raw_ext_csd_structure; /* 194 */ |
| 70 | u8 raw_card_type; /* 196 */ | 77 | u8 raw_card_type; /* 196 */ |
| 78 | u8 out_of_int_time; /* 198 */ | ||
| 71 | u8 raw_s_a_timeout; /* 217 */ | 79 | u8 raw_s_a_timeout; /* 217 */ |
| 72 | u8 raw_hc_erase_gap_size; /* 221 */ | 80 | u8 raw_hc_erase_gap_size; /* 221 */ |
| 73 | u8 raw_erase_timeout_mult; /* 223 */ | 81 | u8 raw_erase_timeout_mult; /* 223 */ |
| @@ -77,6 +85,9 @@ struct mmc_ext_csd { | |||
| 77 | u8 raw_sec_feature_support;/* 231 */ | 85 | u8 raw_sec_feature_support;/* 231 */ |
| 78 | u8 raw_trim_mult; /* 232 */ | 86 | u8 raw_trim_mult; /* 232 */ |
| 79 | u8 raw_sectors[4]; /* 212 - 4 bytes */ | 87 | u8 raw_sectors[4]; /* 212 - 4 bytes */ |
| 88 | |||
| 89 | unsigned int feature_support; | ||
| 90 | #define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */ | ||
| 80 | }; | 91 | }; |
| 81 | 92 | ||
| 82 | struct sd_scr { | 93 | struct sd_scr { |
| @@ -157,6 +168,24 @@ struct sdio_func_tuple; | |||
| 157 | 168 | ||
| 158 | #define SDIO_MAX_FUNCS 7 | 169 | #define SDIO_MAX_FUNCS 7 |
| 159 | 170 | ||
| 171 | /* The number of MMC physical partitions. These consist of: | ||
| 172 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | ||
| 173 | */ | ||
| 174 | #define MMC_NUM_BOOT_PARTITION 2 | ||
| 175 | #define MMC_NUM_GP_PARTITION 4 | ||
| 176 | #define MMC_NUM_PHY_PARTITION 6 | ||
| 177 | #define MAX_MMC_PART_NAME_LEN 20 | ||
| 178 | |||
| 179 | /* | ||
| 180 | * MMC Physical partitions | ||
| 181 | */ | ||
| 182 | struct mmc_part { | ||
| 183 | unsigned int size; /* partition size (in bytes) */ | ||
| 184 | unsigned int part_cfg; /* partition type */ | ||
| 185 | char name[MAX_MMC_PART_NAME_LEN]; | ||
| 186 | bool force_ro; /* to make boot parts RO by default */ | ||
| 187 | }; | ||
| 188 | |||
| 160 | /* | 189 | /* |
| 161 | * MMC device | 190 | * MMC device |
| 162 | */ | 191 | */ |
| @@ -188,6 +217,13 @@ struct mmc_card { | |||
| 188 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ | 217 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ |
| 189 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ | 218 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ |
| 190 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | 219 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ |
| 220 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ | ||
| 221 | /* byte mode */ | ||
| 222 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ | ||
| 223 | #define MMC_NO_POWER_NOTIFICATION 0 | ||
| 224 | #define MMC_POWERED_ON 1 | ||
| 225 | #define MMC_POWEROFF_SHORT 2 | ||
| 226 | #define MMC_POWEROFF_LONG 3 | ||
| 191 | 227 | ||
| 192 | unsigned int erase_size; /* erase size in sectors */ | 228 | unsigned int erase_size; /* erase size in sectors */ |
| 193 | unsigned int erase_shift; /* if erase unit is power 2 */ | 229 | unsigned int erase_shift; /* if erase unit is power 2 */ |
| @@ -216,9 +252,24 @@ struct mmc_card { | |||
| 216 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ | 252 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ |
| 217 | 253 | ||
| 218 | struct dentry *debugfs_root; | 254 | struct dentry *debugfs_root; |
| 255 | struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */ | ||
| 256 | unsigned int nr_parts; | ||
| 219 | }; | 257 | }; |
| 220 | 258 | ||
| 221 | /* | 259 | /* |
| 260 | * This function fill contents in mmc_part. | ||
| 261 | */ | ||
| 262 | static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | ||
| 263 | unsigned int part_cfg, char *name, int idx, bool ro) | ||
| 264 | { | ||
| 265 | card->part[card->nr_parts].size = size; | ||
| 266 | card->part[card->nr_parts].part_cfg = part_cfg; | ||
| 267 | sprintf(card->part[card->nr_parts].name, name, idx); | ||
| 268 | card->part[card->nr_parts].force_ro = ro; | ||
| 269 | card->nr_parts++; | ||
| 270 | } | ||
| 271 | |||
| 272 | /* | ||
| 222 | * The world is not perfect and supplies us with broken mmc/sdio devices. | 273 | * The world is not perfect and supplies us with broken mmc/sdio devices. |
| 223 | * For at least some of these bugs we need a work-around. | 274 | * For at least some of these bugs we need a work-around. |
| 224 | */ | 275 | */ |
| @@ -377,6 +428,11 @@ static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) | |||
| 377 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; | 428 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; |
| 378 | } | 429 | } |
| 379 | 430 | ||
| 431 | static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c) | ||
| 432 | { | ||
| 433 | return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512; | ||
| 434 | } | ||
| 435 | |||
| 380 | #define mmc_card_name(c) ((c)->cid.prod_name) | 436 | #define mmc_card_name(c) ((c)->cid.prod_name) |
| 381 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 437 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
| 382 | 438 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index b8b1b7a311f1..174a844a5dda 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -136,6 +136,7 @@ struct mmc_async_req; | |||
| 136 | 136 | ||
| 137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, | 137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, |
| 138 | struct mmc_async_req *, int *); | 138 | struct mmc_async_req *, int *); |
| 139 | extern int mmc_interrupt_hpi(struct mmc_card *); | ||
| 139 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 140 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
| 140 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 141 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
| 141 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | 142 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); |
| @@ -146,6 +147,7 @@ extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | |||
| 146 | #define MMC_ERASE_ARG 0x00000000 | 147 | #define MMC_ERASE_ARG 0x00000000 |
| 147 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 148 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
| 148 | #define MMC_TRIM_ARG 0x00000001 | 149 | #define MMC_TRIM_ARG 0x00000001 |
| 150 | #define MMC_DISCARD_ARG 0x00000003 | ||
| 149 | #define MMC_SECURE_TRIM1_ARG 0x80000001 | 151 | #define MMC_SECURE_TRIM1_ARG 0x80000001 |
| 150 | #define MMC_SECURE_TRIM2_ARG 0x80008000 | 152 | #define MMC_SECURE_TRIM2_ARG 0x80008000 |
| 151 | 153 | ||
| @@ -156,12 +158,17 @@ extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, | |||
| 156 | unsigned int arg); | 158 | unsigned int arg); |
| 157 | extern int mmc_can_erase(struct mmc_card *card); | 159 | extern int mmc_can_erase(struct mmc_card *card); |
| 158 | extern int mmc_can_trim(struct mmc_card *card); | 160 | extern int mmc_can_trim(struct mmc_card *card); |
| 161 | extern int mmc_can_discard(struct mmc_card *card); | ||
| 162 | extern int mmc_can_sanitize(struct mmc_card *card); | ||
| 159 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); | 163 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); |
| 160 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | 164 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, |
| 161 | unsigned int nr); | 165 | unsigned int nr); |
| 162 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | 166 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); |
| 163 | 167 | ||
| 164 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 168 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
| 169 | extern int mmc_hw_reset(struct mmc_host *host); | ||
| 170 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
| 171 | extern int mmc_can_reset(struct mmc_card *card); | ||
| 165 | 172 | ||
| 166 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 173 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
| 167 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | 174 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); |
| @@ -171,6 +178,8 @@ extern void mmc_release_host(struct mmc_host *host); | |||
| 171 | extern void mmc_do_release_host(struct mmc_host *host); | 178 | extern void mmc_do_release_host(struct mmc_host *host); |
| 172 | extern int mmc_try_claim_host(struct mmc_host *host); | 179 | extern int mmc_try_claim_host(struct mmc_host *host); |
| 173 | 180 | ||
| 181 | extern int mmc_flush_cache(struct mmc_card *); | ||
| 182 | |||
| 174 | /** | 183 | /** |
| 175 | * mmc_claim_host - exclusively claim a host | 184 | * mmc_claim_host - exclusively claim a host |
| 176 | * @host: mmc host to claim | 185 | * @host: mmc host to claim |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6b46819705d1..6dc9b80568a0 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -72,6 +72,8 @@ struct mmc_data; | |||
| 72 | * rate and timeout calculations. | 72 | * rate and timeout calculations. |
| 73 | * @current_speed: Configured rate of the controller. | 73 | * @current_speed: Configured rate of the controller. |
| 74 | * @num_slots: Number of slots available. | 74 | * @num_slots: Number of slots available. |
| 75 | * @verid: Denote Version ID. | ||
| 76 | * @data_offset: Set the offset of DATA register according to VERID. | ||
| 75 | * @pdev: Platform device associated with the MMC controller. | 77 | * @pdev: Platform device associated with the MMC controller. |
| 76 | * @pdata: Platform data associated with the MMC controller. | 78 | * @pdata: Platform data associated with the MMC controller. |
| 77 | * @slot: Slots sharing this MMC controller. | 79 | * @slot: Slots sharing this MMC controller. |
| @@ -147,6 +149,8 @@ struct dw_mci { | |||
| 147 | u32 current_speed; | 149 | u32 current_speed; |
| 148 | u32 num_slots; | 150 | u32 num_slots; |
| 149 | u32 fifoth_val; | 151 | u32 fifoth_val; |
| 152 | u16 verid; | ||
| 153 | u16 data_offset; | ||
| 150 | struct platform_device *pdev; | 154 | struct platform_device *pdev; |
| 151 | struct dw_mci_board *pdata; | 155 | struct dw_mci_board *pdata; |
| 152 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | 156 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1d09562ccf73..a3ac9c48e5de 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/fault-inject.h> | ||
| 15 | 16 | ||
| 16 | #include <linux/mmc/core.h> | 17 | #include <linux/mmc/core.h> |
| 17 | #include <linux/mmc/pm.h> | 18 | #include <linux/mmc/pm.h> |
| @@ -108,6 +109,9 @@ struct mmc_host_ops { | |||
| 108 | * It is optional for the host to implement pre_req and post_req in | 109 | * It is optional for the host to implement pre_req and post_req in |
| 109 | * order to support double buffering of requests (prepare one | 110 | * order to support double buffering of requests (prepare one |
| 110 | * request while another request is active). | 111 | * request while another request is active). |
| 112 | * pre_req() must always be followed by a post_req(). | ||
| 113 | * To undo a call made to pre_req(), call post_req() with | ||
| 114 | * a nonzero err condition. | ||
| 111 | */ | 115 | */ |
| 112 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | 116 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, |
| 113 | int err); | 117 | int err); |
| @@ -147,6 +151,7 @@ struct mmc_host_ops { | |||
| 147 | int (*execute_tuning)(struct mmc_host *host); | 151 | int (*execute_tuning)(struct mmc_host *host); |
| 148 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 152 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
| 149 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 153 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
| 154 | void (*hw_reset)(struct mmc_host *host); | ||
| 150 | }; | 155 | }; |
| 151 | 156 | ||
| 152 | struct mmc_card; | 157 | struct mmc_card; |
| @@ -229,8 +234,20 @@ struct mmc_host { | |||
| 229 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | 234 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ |
| 230 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | 235 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ |
| 231 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | 236 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ |
| 237 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ | ||
| 238 | |||
| 239 | unsigned int caps2; /* More host capabilities */ | ||
| 240 | |||
| 241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | ||
| 242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | ||
| 243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | ||
| 244 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | ||
| 232 | 245 | ||
| 233 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 246 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 247 | unsigned int power_notify_type; | ||
| 248 | #define MMC_HOST_PW_NOTIFY_NONE 0 | ||
| 249 | #define MMC_HOST_PW_NOTIFY_SHORT 1 | ||
| 250 | #define MMC_HOST_PW_NOTIFY_LONG 2 | ||
| 234 | 251 | ||
| 235 | #ifdef CONFIG_MMC_CLKGATE | 252 | #ifdef CONFIG_MMC_CLKGATE |
| 236 | int clk_requests; /* internal reference counter */ | 253 | int clk_requests; /* internal reference counter */ |
| @@ -302,6 +319,10 @@ struct mmc_host { | |||
| 302 | 319 | ||
| 303 | struct mmc_async_req *areq; /* active async req */ | 320 | struct mmc_async_req *areq; /* active async req */ |
| 304 | 321 | ||
| 322 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
| 323 | struct fault_attr fail_mmc_request; | ||
| 324 | #endif | ||
| 325 | |||
| 305 | unsigned long private[0] ____cacheline_aligned; | 326 | unsigned long private[0] ____cacheline_aligned; |
| 306 | }; | 327 | }; |
| 307 | 328 | ||
| @@ -330,6 +351,8 @@ extern int mmc_power_restore_host(struct mmc_host *host); | |||
| 330 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 351 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
| 331 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 352 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
| 332 | 353 | ||
| 354 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | ||
| 355 | |||
| 333 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 356 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
| 334 | { | 357 | { |
| 335 | host->ops->enable_sdio_irq(host, 0); | 358 | host->ops->enable_sdio_irq(host, 0); |
| @@ -394,4 +417,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
| 394 | { | 417 | { |
| 395 | return host->caps & MMC_CAP_CMD23; | 418 | return host->caps & MMC_CAP_CMD23; |
| 396 | } | 419 | } |
| 420 | |||
| 421 | static inline int mmc_boot_partition_access(struct mmc_host *host) | ||
| 422 | { | ||
| 423 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | ||
| 424 | } | ||
| 425 | |||
| 397 | #endif /* LINUX_MMC_HOST_H */ | 426 | #endif /* LINUX_MMC_HOST_H */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 5a794cb503ea..0e7135697d11 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -270,18 +270,31 @@ struct _mmc_csd { | |||
| 270 | * EXT_CSD fields | 270 | * EXT_CSD fields |
| 271 | */ | 271 | */ |
| 272 | 272 | ||
| 273 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ | ||
| 274 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ | ||
| 275 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | ||
| 276 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | ||
| 273 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 277 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
| 274 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 278 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
| 279 | #define EXT_CSD_HPI_MGMT 161 /* R/W */ | ||
| 280 | #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ | ||
| 281 | #define EXT_CSD_SANITIZE_START 165 /* W */ | ||
| 275 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 282 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
| 276 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 283 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
| 277 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 284 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
| 278 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 285 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
| 279 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 286 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
| 280 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | 287 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
| 288 | #define EXT_CSD_POWER_CLASS 187 /* R/W */ | ||
| 281 | #define EXT_CSD_REV 192 /* RO */ | 289 | #define EXT_CSD_REV 192 /* RO */ |
| 282 | #define EXT_CSD_STRUCTURE 194 /* RO */ | 290 | #define EXT_CSD_STRUCTURE 194 /* RO */ |
| 283 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 291 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
| 292 | #define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ | ||
| 284 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ | 293 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ |
| 294 | #define EXT_CSD_PWR_CL_52_195 200 /* RO */ | ||
| 295 | #define EXT_CSD_PWR_CL_26_195 201 /* RO */ | ||
| 296 | #define EXT_CSD_PWR_CL_52_360 202 /* RO */ | ||
| 297 | #define EXT_CSD_PWR_CL_26_360 203 /* RO */ | ||
| 285 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 298 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
| 286 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 299 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
| 287 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ | 300 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ |
| @@ -293,6 +306,14 @@ struct _mmc_csd { | |||
| 293 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ | 306 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ |
| 294 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ | 307 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ |
| 295 | #define EXT_CSD_TRIM_MULT 232 /* RO */ | 308 | #define EXT_CSD_TRIM_MULT 232 /* RO */ |
| 309 | #define EXT_CSD_PWR_CL_200_195 236 /* RO */ | ||
| 310 | #define EXT_CSD_PWR_CL_200_360 237 /* RO */ | ||
| 311 | #define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ | ||
| 312 | #define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ | ||
| 313 | #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ | ||
| 314 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ | ||
| 315 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | ||
| 316 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ | ||
| 296 | 317 | ||
| 297 | /* | 318 | /* |
| 298 | * EXT_CSD field definitions | 319 | * EXT_CSD field definitions |
| @@ -302,7 +323,9 @@ struct _mmc_csd { | |||
| 302 | 323 | ||
| 303 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 324 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
| 304 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 325 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
| 305 | #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) | 326 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
| 327 | |||
| 328 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | ||
| 306 | 329 | ||
| 307 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 330 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
| 308 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | 331 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
| @@ -327,7 +350,20 @@ struct _mmc_csd { | |||
| 327 | #define EXT_CSD_SEC_ER_EN BIT(0) | 350 | #define EXT_CSD_SEC_ER_EN BIT(0) |
| 328 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) | 351 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) |
| 329 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) | 352 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) |
| 353 | #define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */ | ||
| 354 | |||
| 355 | #define EXT_CSD_RST_N_EN_MASK 0x3 | ||
| 356 | #define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */ | ||
| 357 | |||
| 358 | #define EXT_CSD_NO_POWER_NOTIFICATION 0 | ||
| 359 | #define EXT_CSD_POWER_ON 1 | ||
| 360 | #define EXT_CSD_POWER_OFF_SHORT 2 | ||
| 361 | #define EXT_CSD_POWER_OFF_LONG 3 | ||
| 330 | 362 | ||
| 363 | #define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */ | ||
| 364 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ | ||
| 365 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 | ||
| 366 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 | ||
| 331 | /* | 367 | /* |
| 332 | * MMC_SWITCH access modes | 368 | * MMC_SWITCH access modes |
| 333 | */ | 369 | */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 5666f3abfab7..e4b69353678d 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -88,6 +88,10 @@ struct sdhci_host { | |||
| 88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ | 88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ |
| 89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) | 89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) |
| 90 | 90 | ||
| 91 | unsigned int quirks2; /* More deviations from spec. */ | ||
| 92 | |||
| 93 | #define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0) | ||
| 94 | |||
| 91 | int irq; /* Device IRQ */ | 95 | int irq; /* Device IRQ */ |
| 92 | void __iomem *ioaddr; /* Mapped address */ | 96 | void __iomem *ioaddr; /* Mapped address */ |
| 93 | 97 | ||
| @@ -115,6 +119,8 @@ struct sdhci_host { | |||
| 115 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ | 119 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ |
| 116 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ | 120 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ |
| 117 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | 121 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ |
| 122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | ||
| 123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | ||
| 118 | 124 | ||
| 119 | unsigned int version; /* SDHCI spec. version */ | 125 | unsigned int version; /* SDHCI spec. version */ |
| 120 | 126 | ||
| @@ -125,6 +131,8 @@ struct sdhci_host { | |||
| 125 | unsigned int clock; /* Current clock (MHz) */ | 131 | unsigned int clock; /* Current clock (MHz) */ |
| 126 | u8 pwr; /* Current voltage */ | 132 | u8 pwr; /* Current voltage */ |
| 127 | 133 | ||
| 134 | bool runtime_suspended; /* Host is runtime suspended */ | ||
| 135 | |||
| 128 | struct mmc_request *mrq; /* Current request */ | 136 | struct mmc_request *mrq; /* Current request */ |
| 129 | struct mmc_command *cmd; /* Current command */ | 137 | struct mmc_command *cmd; /* Current command */ |
| 130 | struct mmc_data *data; /* Current data request */ | 138 | struct mmc_data *data; /* Current data request */ |
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 2a2e9905a247..e0b1123497b9 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
| @@ -72,11 +72,13 @@ | |||
| 72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ | 72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ |
| 73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ | 73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ |
| 74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ | 74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ |
| 75 | #define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */ | ||
| 75 | 76 | ||
| 76 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ | 77 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ |
| 77 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ | 78 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ |
| 78 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ | 79 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ |
| 79 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ | 80 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ |
| 81 | #define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */ | ||
| 80 | 82 | ||
| 81 | #define SDIO_CCCR_SD 0x01 | 83 | #define SDIO_CCCR_SD 0x01 |
| 82 | 84 | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 0222cd8ebe76..04ff452bf5c3 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
| @@ -41,7 +41,9 @@ struct sh_mmcif_plat_data { | |||
| 41 | void (*set_pwr)(struct platform_device *pdev, int state); | 41 | void (*set_pwr)(struct platform_device *pdev, int state); |
| 42 | void (*down_pwr)(struct platform_device *pdev); | 42 | void (*down_pwr)(struct platform_device *pdev); |
| 43 | int (*get_cd)(struct platform_device *pdef); | 43 | int (*get_cd)(struct platform_device *pdef); |
| 44 | struct sh_mmcif_dma *dma; | 44 | struct sh_mmcif_dma *dma; /* Deprecated. Instead */ |
| 45 | unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */ | ||
| 46 | unsigned int slave_id_rx; | ||
| 45 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 47 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
| 46 | unsigned long caps; | 48 | unsigned long caps; |
| 47 | u32 ocr; | 49 | u32 ocr; |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index bd50b365167f..71b805451bd8 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -6,6 +6,10 @@ | |||
| 6 | struct platform_device; | 6 | struct platform_device; |
| 7 | struct tmio_mmc_data; | 7 | struct tmio_mmc_data; |
| 8 | 8 | ||
| 9 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | ||
| 10 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | ||
| 11 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | ||
| 12 | |||
| 9 | struct sh_mobile_sdhi_info { | 13 | struct sh_mobile_sdhi_info { |
| 10 | int dma_slave_tx; | 14 | int dma_slave_tx; |
| 11 | int dma_slave_rx; | 15 | int dma_slave_rx; |
diff --git a/include/linux/of.h b/include/linux/of.h index 9180dc5cb00b..5dbe263462a9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | */ | 17 | */ |
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
| 20 | #include <linux/errno.h> | ||
| 20 | #include <linux/kref.h> | 21 | #include <linux/kref.h> |
| 21 | #include <linux/mod_devicetable.h> | 22 | #include <linux/mod_devicetable.h> |
| 22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| @@ -68,6 +69,7 @@ struct device_node { | |||
| 68 | /* Pointer for first entry in chain of all nodes. */ | 69 | /* Pointer for first entry in chain of all nodes. */ |
| 69 | extern struct device_node *allnodes; | 70 | extern struct device_node *allnodes; |
| 70 | extern struct device_node *of_chosen; | 71 | extern struct device_node *of_chosen; |
| 72 | extern struct device_node *of_aliases; | ||
| 71 | extern rwlock_t devtree_lock; | 73 | extern rwlock_t devtree_lock; |
| 72 | 74 | ||
| 73 | static inline bool of_have_populated_dt(void) | 75 | static inline bool of_have_populated_dt(void) |
| @@ -199,6 +201,8 @@ extern int of_property_read_u32_array(const struct device_node *np, | |||
| 199 | const char *propname, | 201 | const char *propname, |
| 200 | u32 *out_values, | 202 | u32 *out_values, |
| 201 | size_t sz); | 203 | size_t sz); |
| 204 | extern int of_property_read_u64(const struct device_node *np, | ||
| 205 | const char *propname, u64 *out_value); | ||
| 202 | 206 | ||
| 203 | extern int of_property_read_string(struct device_node *np, | 207 | extern int of_property_read_string(struct device_node *np, |
| 204 | const char *propname, | 208 | const char *propname, |
| @@ -209,6 +213,9 @@ extern int of_device_is_available(const struct device_node *device); | |||
| 209 | extern const void *of_get_property(const struct device_node *node, | 213 | extern const void *of_get_property(const struct device_node *node, |
| 210 | const char *name, | 214 | const char *name, |
| 211 | int *lenp); | 215 | int *lenp); |
| 216 | #define for_each_property(pp, properties) \ | ||
| 217 | for (pp = properties; pp != NULL; pp = pp->next) | ||
| 218 | |||
| 212 | extern int of_n_addr_cells(struct device_node *np); | 219 | extern int of_n_addr_cells(struct device_node *np); |
| 213 | extern int of_n_size_cells(struct device_node *np); | 220 | extern int of_n_size_cells(struct device_node *np); |
| 214 | extern const struct of_device_id *of_match_node( | 221 | extern const struct of_device_id *of_match_node( |
| @@ -221,6 +228,9 @@ extern int of_parse_phandles_with_args(struct device_node *np, | |||
| 221 | const char *list_name, const char *cells_name, int index, | 228 | const char *list_name, const char *cells_name, int index, |
| 222 | struct device_node **out_node, const void **out_args); | 229 | struct device_node **out_node, const void **out_args); |
| 223 | 230 | ||
| 231 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); | ||
| 232 | extern int of_alias_get_id(struct device_node *np, const char *stem); | ||
| 233 | |||
| 224 | extern int of_machine_is_compatible(const char *compat); | 234 | extern int of_machine_is_compatible(const char *compat); |
| 225 | 235 | ||
| 226 | extern int prom_add_property(struct device_node* np, struct property* prop); | 236 | extern int prom_add_property(struct device_node* np, struct property* prop); |
| @@ -235,6 +245,7 @@ extern void of_attach_node(struct device_node *); | |||
| 235 | extern void of_detach_node(struct device_node *); | 245 | extern void of_detach_node(struct device_node *); |
| 236 | #endif | 246 | #endif |
| 237 | 247 | ||
| 248 | #define of_match_ptr(_ptr) (_ptr) | ||
| 238 | #else /* CONFIG_OF */ | 249 | #else /* CONFIG_OF */ |
| 239 | 250 | ||
| 240 | static inline bool of_have_populated_dt(void) | 251 | static inline bool of_have_populated_dt(void) |
| @@ -242,6 +253,22 @@ static inline bool of_have_populated_dt(void) | |||
| 242 | return false; | 253 | return false; |
| 243 | } | 254 | } |
| 244 | 255 | ||
| 256 | #define for_each_child_of_node(parent, child) \ | ||
| 257 | while (0) | ||
| 258 | |||
| 259 | static inline int of_device_is_compatible(const struct device_node *device, | ||
| 260 | const char *name) | ||
| 261 | { | ||
| 262 | return 0; | ||
| 263 | } | ||
| 264 | |||
| 265 | static inline struct property *of_find_property(const struct device_node *np, | ||
| 266 | const char *name, | ||
| 267 | int *lenp) | ||
| 268 | { | ||
| 269 | return NULL; | ||
| 270 | } | ||
| 271 | |||
| 245 | static inline int of_property_read_u32_array(const struct device_node *np, | 272 | static inline int of_property_read_u32_array(const struct device_node *np, |
| 246 | const char *propname, | 273 | const char *propname, |
| 247 | u32 *out_values, size_t sz) | 274 | u32 *out_values, size_t sz) |
| @@ -263,6 +290,21 @@ static inline const void *of_get_property(const struct device_node *node, | |||
| 263 | return NULL; | 290 | return NULL; |
| 264 | } | 291 | } |
| 265 | 292 | ||
| 293 | static inline int of_property_read_u64(const struct device_node *np, | ||
| 294 | const char *propname, u64 *out_value) | ||
| 295 | { | ||
| 296 | return -ENOSYS; | ||
| 297 | } | ||
| 298 | |||
| 299 | static inline struct device_node *of_parse_phandle(struct device_node *np, | ||
| 300 | const char *phandle_name, | ||
| 301 | int index) | ||
| 302 | { | ||
| 303 | return NULL; | ||
| 304 | } | ||
| 305 | |||
| 306 | #define of_match_ptr(_ptr) NULL | ||
| 307 | #define of_match_node(_matches, _node) NULL | ||
| 266 | #endif /* CONFIG_OF */ | 308 | #endif /* CONFIG_OF */ |
| 267 | 309 | ||
| 268 | static inline int of_property_read_u32(const struct device_node *np, | 310 | static inline int of_property_read_u32(const struct device_node *np, |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 655824fa4c76..e3d0b3890249 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef LINUX_PCI_ATS_H | 1 | #ifndef LINUX_PCI_ATS_H |
| 2 | #define LINUX_PCI_ATS_H | 2 | #define LINUX_PCI_ATS_H |
| 3 | 3 | ||
| 4 | #include <linux/pci.h> | ||
| 5 | |||
| 4 | /* Address Translation Service */ | 6 | /* Address Translation Service */ |
| 5 | struct pci_ats { | 7 | struct pci_ats { |
| 6 | int pos; /* capability position */ | 8 | int pos; /* capability position */ |
| @@ -15,6 +17,7 @@ struct pci_ats { | |||
| 15 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | 17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); |
| 16 | extern void pci_disable_ats(struct pci_dev *dev); | 18 | extern void pci_disable_ats(struct pci_dev *dev); |
| 17 | extern int pci_ats_queue_depth(struct pci_dev *dev); | 19 | extern int pci_ats_queue_depth(struct pci_dev *dev); |
| 20 | |||
| 18 | /** | 21 | /** |
| 19 | * pci_ats_enabled - query the ATS status | 22 | * pci_ats_enabled - query the ATS status |
| 20 | * @dev: the PCI device | 23 | * @dev: the PCI device |
| @@ -49,4 +52,76 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 49 | 52 | ||
| 50 | #endif /* CONFIG_PCI_IOV */ | 53 | #endif /* CONFIG_PCI_IOV */ |
| 51 | 54 | ||
| 55 | #ifdef CONFIG_PCI_PRI | ||
| 56 | |||
| 57 | extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | ||
| 58 | extern void pci_disable_pri(struct pci_dev *pdev); | ||
| 59 | extern bool pci_pri_enabled(struct pci_dev *pdev); | ||
| 60 | extern int pci_reset_pri(struct pci_dev *pdev); | ||
| 61 | extern bool pci_pri_stopped(struct pci_dev *pdev); | ||
| 62 | extern int pci_pri_status(struct pci_dev *pdev); | ||
| 63 | |||
| 64 | #else /* CONFIG_PCI_PRI */ | ||
| 65 | |||
| 66 | static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs) | ||
| 67 | { | ||
| 68 | return -ENODEV; | ||
| 69 | } | ||
| 70 | |||
| 71 | static inline void pci_disable_pri(struct pci_dev *pdev) | ||
| 72 | { | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
| 76 | { | ||
| 77 | return false; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int pci_reset_pri(struct pci_dev *pdev) | ||
| 81 | { | ||
| 82 | return -ENODEV; | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
| 86 | { | ||
| 87 | return true; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
| 91 | { | ||
| 92 | return -ENODEV; | ||
| 93 | } | ||
| 94 | #endif /* CONFIG_PCI_PRI */ | ||
| 95 | |||
| 96 | #ifdef CONFIG_PCI_PASID | ||
| 97 | |||
| 98 | extern int pci_enable_pasid(struct pci_dev *pdev, int features); | ||
| 99 | extern void pci_disable_pasid(struct pci_dev *pdev); | ||
| 100 | extern int pci_pasid_features(struct pci_dev *pdev); | ||
| 101 | extern int pci_max_pasids(struct pci_dev *pdev); | ||
| 102 | |||
| 103 | #else /* CONFIG_PCI_PASID */ | ||
| 104 | |||
| 105 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) | ||
| 106 | { | ||
| 107 | return -EINVAL; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline void pci_disable_pasid(struct pci_dev *pdev) | ||
| 111 | { | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline int pci_pasid_features(struct pci_dev *pdev) | ||
| 115 | { | ||
| 116 | return -EINVAL; | ||
| 117 | } | ||
| 118 | |||
| 119 | static inline int pci_max_pasids(struct pci_dev *pdev) | ||
| 120 | { | ||
| 121 | return -EINVAL; | ||
| 122 | } | ||
| 123 | |||
| 124 | #endif /* CONFIG_PCI_PASID */ | ||
| 125 | |||
| 126 | |||
| 52 | #endif /* LINUX_PCI_ATS_H*/ | 127 | #endif /* LINUX_PCI_ATS_H*/ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index f1b1ca1a09e1..337df0d5d5f7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -275,6 +275,7 @@ struct pci_dev { | |||
| 275 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 275 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
| 276 | can be generated */ | 276 | can be generated */ |
| 277 | unsigned int pme_interrupt:1; | 277 | unsigned int pme_interrupt:1; |
| 278 | unsigned int pme_poll:1; /* Poll device's PME status bit */ | ||
| 278 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 279 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
| 279 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 280 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
| 280 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 281 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
| @@ -957,6 +958,7 @@ void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | |||
| 957 | int pci_cfg_space_size_ext(struct pci_dev *dev); | 958 | int pci_cfg_space_size_ext(struct pci_dev *dev); |
| 958 | int pci_cfg_space_size(struct pci_dev *dev); | 959 | int pci_cfg_space_size(struct pci_dev *dev); |
| 959 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 960 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 961 | void pci_setup_bridge(struct pci_bus *bus); | ||
| 960 | 962 | ||
| 961 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) | 963 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) |
| 962 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) | 964 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae96bbe54518..1679ff6931f9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2302,6 +2302,11 @@ | |||
| 2302 | #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 | 2302 | #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 |
| 2303 | #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 | 2303 | #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 |
| 2304 | 2304 | ||
| 2305 | #define PCI_VENDOR_ID_SOLARFLARE 0x1924 | ||
| 2306 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0 0x0703 | ||
| 2307 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1 0x6703 | ||
| 2308 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000B 0x0710 | ||
| 2309 | |||
| 2305 | #define PCI_VENDOR_ID_TDI 0x192E | 2310 | #define PCI_VENDOR_ID_TDI 0x192E |
| 2306 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2311 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
| 2307 | 2312 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index e8840964aca1..b5d9657f3100 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -663,6 +663,26 @@ | |||
| 663 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ | 663 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ |
| 664 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | 664 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ |
| 665 | 665 | ||
| 666 | /* Page Request Interface */ | ||
| 667 | #define PCI_PRI_CAP 0x13 /* PRI capability ID */ | ||
| 668 | #define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */ | ||
| 669 | #define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */ | ||
| 670 | #define PCI_PRI_ENABLE 0x0001 /* Enable mask */ | ||
| 671 | #define PCI_PRI_RESET 0x0002 /* Reset bit mask */ | ||
| 672 | #define PCI_PRI_STATUS_RF 0x0001 /* Request Failure */ | ||
| 673 | #define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */ | ||
| 674 | #define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */ | ||
| 675 | #define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */ | ||
| 676 | #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ | ||
| 677 | |||
| 678 | /* PASID capability */ | ||
| 679 | #define PCI_PASID_CAP 0x1b /* PASID capability ID */ | ||
| 680 | #define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ | ||
| 681 | #define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ | ||
| 682 | #define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ | ||
| 683 | #define PCI_PASID_EXEC 0x02 /* Exec permissions Enable/Supported */ | ||
| 684 | #define PCI_PASID_PRIV 0x04 /* Priviledge Mode Enable/Support */ | ||
| 685 | |||
| 666 | /* Single Root I/O Virtualization */ | 686 | /* Single Root I/O Virtualization */ |
| 667 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 687 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
| 668 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | 688 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 651a066686ac..2a23f7d1a825 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -190,6 +190,23 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data | |||
| 190 | dev_set_drvdata(&pdev->dev, data); | 190 | dev_set_drvdata(&pdev->dev, data); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | /* module_platform_driver() - Helper macro for drivers that don't do | ||
| 194 | * anything special in module init/exit. This eliminates a lot of | ||
| 195 | * boilerplate. Each module may only use this macro once, and | ||
| 196 | * calling it replaces module_init() and module_exit() | ||
| 197 | */ | ||
| 198 | #define module_platform_driver(__platform_driver) \ | ||
| 199 | static int __init __platform_driver##_init(void) \ | ||
| 200 | { \ | ||
| 201 | return platform_driver_register(&(__platform_driver)); \ | ||
| 202 | } \ | ||
| 203 | module_init(__platform_driver##_init); \ | ||
| 204 | static void __exit __platform_driver##_exit(void) \ | ||
| 205 | { \ | ||
| 206 | platform_driver_unregister(&(__platform_driver)); \ | ||
| 207 | } \ | ||
| 208 | module_exit(__platform_driver##_exit); | ||
| 209 | |||
| 193 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 210 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
| 194 | int (*probe)(struct platform_device *), | 211 | int (*probe)(struct platform_device *), |
| 195 | struct resource *res, unsigned int n_res, | 212 | struct resource *res, unsigned int n_res, |
diff --git a/include/linux/random.h b/include/linux/random.h index d13059f3ea32..8f74538c96db 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
| @@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed) | |||
| 91 | state->s3 = __seed(i, 15); | 91 | state->s3 = __seed(i, 15); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | #ifdef CONFIG_ARCH_RANDOM | ||
| 95 | # include <asm/archrandom.h> | ||
| 96 | #else | ||
| 97 | static inline int arch_get_random_long(unsigned long *v) | ||
| 98 | { | ||
| 99 | return 0; | ||
| 100 | } | ||
| 101 | static inline int arch_get_random_int(unsigned int *v) | ||
| 102 | { | ||
| 103 | return 0; | ||
| 104 | } | ||
| 105 | #endif | ||
| 106 | |||
| 94 | #endif /* __KERNEL___ */ | 107 | #endif /* __KERNEL___ */ |
| 95 | 108 | ||
| 96 | #endif /* _LINUX_RANDOM_H */ | 109 | #endif /* _LINUX_RANDOM_H */ |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index b47771aa5718..f7756d146c61 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -141,6 +141,7 @@ int regulator_enable(struct regulator *regulator); | |||
| 141 | int regulator_disable(struct regulator *regulator); | 141 | int regulator_disable(struct regulator *regulator); |
| 142 | int regulator_force_disable(struct regulator *regulator); | 142 | int regulator_force_disable(struct regulator *regulator); |
| 143 | int regulator_is_enabled(struct regulator *regulator); | 143 | int regulator_is_enabled(struct regulator *regulator); |
| 144 | int regulator_disable_deferred(struct regulator *regulator, int ms); | ||
| 144 | 145 | ||
| 145 | int regulator_bulk_get(struct device *dev, int num_consumers, | 146 | int regulator_bulk_get(struct device *dev, int num_consumers, |
| 146 | struct regulator_bulk_data *consumers); | 147 | struct regulator_bulk_data *consumers); |
| @@ -211,6 +212,12 @@ static inline int regulator_disable(struct regulator *regulator) | |||
| 211 | return 0; | 212 | return 0; |
| 212 | } | 213 | } |
| 213 | 214 | ||
| 215 | static inline int regulator_disable_deferred(struct regulator *regulator, | ||
| 216 | int ms) | ||
| 217 | { | ||
| 218 | return 0; | ||
| 219 | } | ||
| 220 | |||
| 214 | static inline int regulator_is_enabled(struct regulator *regulator) | 221 | static inline int regulator_is_enabled(struct regulator *regulator) |
| 215 | { | 222 | { |
| 216 | return 1; | 223 | return 1; |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 1a80bc77517d..12a1aa04b720 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -199,6 +199,9 @@ struct regulator_dev { | |||
| 199 | struct regulation_constraints *constraints; | 199 | struct regulation_constraints *constraints; |
| 200 | struct regulator *supply; /* for tree */ | 200 | struct regulator *supply; /* for tree */ |
| 201 | 201 | ||
| 202 | struct delayed_work disable_work; | ||
| 203 | int deferred_disables; | ||
| 204 | |||
| 202 | void *reg_data; /* regulator_dev data */ | 205 | void *reg_data; /* regulator_dev data */ |
| 203 | 206 | ||
| 204 | #ifdef CONFIG_DEBUG_FS | 207 | #ifdef CONFIG_DEBUG_FS |
diff --git a/include/linux/serio.h b/include/linux/serio.h index e26f4788845f..be7dfb0f12d0 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
| @@ -199,5 +199,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
| 199 | #define SERIO_DYNAPRO 0x3a | 199 | #define SERIO_DYNAPRO 0x3a |
| 200 | #define SERIO_HAMPSHIRE 0x3b | 200 | #define SERIO_HAMPSHIRE 0x3b |
| 201 | #define SERIO_PS2MULT 0x3c | 201 | #define SERIO_PS2MULT 0x3c |
| 202 | #define SERIO_TSC40 0x3d | ||
| 202 | 203 | ||
| 203 | #endif | 204 | #endif |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index d28c726ede4f..2aa2881b0df9 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
| @@ -68,7 +68,7 @@ struct uinput_device { | |||
| 68 | unsigned char head; | 68 | unsigned char head; |
| 69 | unsigned char tail; | 69 | unsigned char tail; |
| 70 | struct input_event buff[UINPUT_BUFFER_SIZE]; | 70 | struct input_event buff[UINPUT_BUFFER_SIZE]; |
| 71 | int ff_effects_max; | 71 | unsigned int ff_effects_max; |
| 72 | 72 | ||
| 73 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; | 73 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; |
| 74 | wait_queue_head_t requests_waitq; | 74 | wait_queue_head_t requests_waitq; |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index f32a64e57f97..d5da6c68c250 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -383,12 +383,6 @@ struct usb_endpoint_descriptor { | |||
| 383 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | 383 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ |
| 384 | #define USB_ENDPOINT_DIR_MASK 0x80 | 384 | #define USB_ENDPOINT_DIR_MASK 0x80 |
| 385 | 385 | ||
| 386 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
| 387 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
| 388 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
| 389 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
| 390 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
| 391 | |||
| 392 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | 386 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ |
| 393 | #define USB_ENDPOINT_XFER_CONTROL 0 | 387 | #define USB_ENDPOINT_XFER_CONTROL 0 |
| 394 | #define USB_ENDPOINT_XFER_ISOC 1 | 388 | #define USB_ENDPOINT_XFER_ISOC 1 |
| @@ -396,6 +390,17 @@ struct usb_endpoint_descriptor { | |||
| 396 | #define USB_ENDPOINT_XFER_INT 3 | 390 | #define USB_ENDPOINT_XFER_INT 3 |
| 397 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 | 391 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 |
| 398 | 392 | ||
| 393 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
| 394 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
| 395 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
| 396 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
| 397 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
| 398 | |||
| 399 | #define USB_ENDPOINT_USAGE_MASK 0x30 | ||
| 400 | #define USB_ENDPOINT_USAGE_DATA 0x00 | ||
| 401 | #define USB_ENDPOINT_USAGE_FEEDBACK 0x10 | ||
| 402 | #define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */ | ||
| 403 | |||
| 399 | /*-------------------------------------------------------------------------*/ | 404 | /*-------------------------------------------------------------------------*/ |
| 400 | 405 | ||
| 401 | /** | 406 | /** |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index ddb04568a509..2703e3bedbf5 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -59,6 +59,7 @@ enum iscsi_uevent_e { | |||
| 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, | 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, |
| 60 | 60 | ||
| 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, |
| 62 | ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, | ||
| 62 | 63 | ||
| 63 | /* up events */ | 64 | /* up events */ |
| 64 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 65 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
| @@ -70,6 +71,7 @@ enum iscsi_uevent_e { | |||
| 70 | 71 | ||
| 71 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, | 72 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, |
| 72 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, | 73 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, |
| 74 | ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, | ||
| 73 | }; | 75 | }; |
| 74 | 76 | ||
| 75 | enum iscsi_tgt_dscvr { | 77 | enum iscsi_tgt_dscvr { |
| @@ -172,6 +174,10 @@ struct iscsi_uevent { | |||
| 172 | struct msg_set_path { | 174 | struct msg_set_path { |
| 173 | uint32_t host_no; | 175 | uint32_t host_no; |
| 174 | } set_path; | 176 | } set_path; |
| 177 | struct msg_set_iface_params { | ||
| 178 | uint32_t host_no; | ||
| 179 | uint32_t count; | ||
| 180 | } set_iface_params; | ||
| 175 | } u; | 181 | } u; |
| 176 | union { | 182 | union { |
| 177 | /* messages k -> u */ | 183 | /* messages k -> u */ |
| @@ -193,6 +199,11 @@ struct iscsi_uevent { | |||
| 193 | uint32_t cid; | 199 | uint32_t cid; |
| 194 | uint64_t recv_handle; | 200 | uint64_t recv_handle; |
| 195 | } recv_req; | 201 | } recv_req; |
| 202 | struct msg_conn_login { | ||
| 203 | uint32_t sid; | ||
| 204 | uint32_t cid; | ||
| 205 | uint32_t state; /* enum iscsi_conn_state */ | ||
| 206 | } conn_login; | ||
| 196 | struct msg_conn_error { | 207 | struct msg_conn_error { |
| 197 | uint32_t sid; | 208 | uint32_t sid; |
| 198 | uint32_t cid; | 209 | uint32_t cid; |
| @@ -214,6 +225,21 @@ struct iscsi_uevent { | |||
| 214 | } r; | 225 | } r; |
| 215 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 226 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
| 216 | 227 | ||
| 228 | enum iscsi_param_type { | ||
| 229 | ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ | ||
| 230 | ISCSI_HOST_PARAM, /* iscsi_host_param */ | ||
| 231 | ISCSI_NET_PARAM, /* iscsi_net_param */ | ||
| 232 | }; | ||
| 233 | |||
| 234 | struct iscsi_iface_param_info { | ||
| 235 | uint32_t iface_num; /* iface number, 0 - n */ | ||
| 236 | uint32_t len; /* Actual length of the param */ | ||
| 237 | uint16_t param; /* iscsi param value */ | ||
| 238 | uint8_t iface_type; /* IPv4 or IPv6 */ | ||
| 239 | uint8_t param_type; /* iscsi_param_type */ | ||
| 240 | uint8_t value[0]; /* length sized value follows */ | ||
| 241 | } __packed; | ||
| 242 | |||
| 217 | /* | 243 | /* |
| 218 | * To keep the struct iscsi_uevent size the same for userspace code | 244 | * To keep the struct iscsi_uevent size the same for userspace code |
| 219 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and | 245 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and |
| @@ -237,6 +263,71 @@ struct iscsi_path { | |||
| 237 | uint16_t pmtu; | 263 | uint16_t pmtu; |
| 238 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 264 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
| 239 | 265 | ||
| 266 | /* iscsi iface enabled/disabled setting */ | ||
| 267 | #define ISCSI_IFACE_DISABLE 0x01 | ||
| 268 | #define ISCSI_IFACE_ENABLE 0x02 | ||
| 269 | |||
| 270 | /* ipv4 bootproto */ | ||
| 271 | #define ISCSI_BOOTPROTO_STATIC 0x01 | ||
| 272 | #define ISCSI_BOOTPROTO_DHCP 0x02 | ||
| 273 | |||
| 274 | /* ipv6 addr autoconfig type */ | ||
| 275 | #define ISCSI_IPV6_AUTOCFG_DISABLE 0x01 | ||
| 276 | #define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02 | ||
| 277 | #define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03 | ||
| 278 | |||
| 279 | /* ipv6 link local addr type */ | ||
| 280 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01 | ||
| 281 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02 | ||
| 282 | |||
| 283 | /* ipv6 router addr type */ | ||
| 284 | #define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01 | ||
| 285 | #define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02 | ||
| 286 | |||
| 287 | #define ISCSI_IFACE_TYPE_IPV4 0x01 | ||
| 288 | #define ISCSI_IFACE_TYPE_IPV6 0x02 | ||
| 289 | |||
| 290 | #define ISCSI_MAX_VLAN_ID 4095 | ||
| 291 | #define ISCSI_MAX_VLAN_PRIORITY 7 | ||
| 292 | |||
| 293 | /* iscsi vlan enable/disabled setting */ | ||
| 294 | #define ISCSI_VLAN_DISABLE 0x01 | ||
| 295 | #define ISCSI_VLAN_ENABLE 0x02 | ||
| 296 | |||
| 297 | /* iSCSI network params */ | ||
| 298 | enum iscsi_net_param { | ||
| 299 | ISCSI_NET_PARAM_IPV4_ADDR = 1, | ||
| 300 | ISCSI_NET_PARAM_IPV4_SUBNET = 2, | ||
| 301 | ISCSI_NET_PARAM_IPV4_GW = 3, | ||
| 302 | ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, | ||
| 303 | ISCSI_NET_PARAM_MAC = 5, | ||
| 304 | ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, | ||
| 305 | ISCSI_NET_PARAM_IPV6_ADDR = 7, | ||
| 306 | ISCSI_NET_PARAM_IPV6_ROUTER = 8, | ||
| 307 | ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, | ||
| 308 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, | ||
| 309 | ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, | ||
| 310 | ISCSI_NET_PARAM_IFACE_ENABLE = 12, | ||
| 311 | ISCSI_NET_PARAM_VLAN_ID = 13, | ||
| 312 | ISCSI_NET_PARAM_VLAN_PRIORITY = 14, | ||
| 313 | ISCSI_NET_PARAM_VLAN_ENABLED = 15, | ||
| 314 | ISCSI_NET_PARAM_VLAN_TAG = 16, | ||
| 315 | ISCSI_NET_PARAM_IFACE_TYPE = 17, | ||
| 316 | ISCSI_NET_PARAM_IFACE_NAME = 18, | ||
| 317 | ISCSI_NET_PARAM_MTU = 19, | ||
| 318 | ISCSI_NET_PARAM_PORT = 20, | ||
| 319 | }; | ||
| 320 | |||
| 321 | enum iscsi_conn_state { | ||
| 322 | ISCSI_CONN_STATE_FREE, | ||
| 323 | ISCSI_CONN_STATE_XPT_WAIT, | ||
| 324 | ISCSI_CONN_STATE_IN_LOGIN, | ||
| 325 | ISCSI_CONN_STATE_LOGGED_IN, | ||
| 326 | ISCSI_CONN_STATE_IN_LOGOUT, | ||
| 327 | ISCSI_CONN_STATE_LOGOUT_REQUESTED, | ||
| 328 | ISCSI_CONN_STATE_CLEANUP_WAIT, | ||
| 329 | }; | ||
| 330 | |||
| 240 | /* | 331 | /* |
| 241 | * Common error codes | 332 | * Common error codes |
| 242 | */ | 333 | */ |
| @@ -319,44 +410,6 @@ enum iscsi_param { | |||
| 319 | ISCSI_PARAM_MAX, | 410 | ISCSI_PARAM_MAX, |
| 320 | }; | 411 | }; |
| 321 | 412 | ||
| 322 | #define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH) | ||
| 323 | #define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH) | ||
| 324 | #define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN) | ||
| 325 | #define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN) | ||
| 326 | #define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN) | ||
| 327 | #define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T) | ||
| 328 | #define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN) | ||
| 329 | #define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST) | ||
| 330 | #define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST) | ||
| 331 | #define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN) | ||
| 332 | #define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN) | ||
| 333 | #define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL) | ||
| 334 | #define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN) | ||
| 335 | #define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN) | ||
| 336 | #define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN) | ||
| 337 | #define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME) | ||
| 338 | #define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT) | ||
| 339 | #define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS) | ||
| 340 | #define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT) | ||
| 341 | #define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO) | ||
| 342 | #define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT) | ||
| 343 | #define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS) | ||
| 344 | #define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME) | ||
| 345 | #define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN) | ||
| 346 | #define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD) | ||
| 347 | #define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN) | ||
| 348 | #define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT) | ||
| 349 | #define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO) | ||
| 350 | #define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO) | ||
| 351 | #define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO) | ||
| 352 | #define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO) | ||
| 353 | #define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO) | ||
| 354 | #define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) | ||
| 355 | #define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) | ||
| 356 | #define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) | ||
| 357 | #define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO) | ||
| 358 | #define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS) | ||
| 359 | |||
| 360 | /* iSCSI HBA params */ | 413 | /* iSCSI HBA params */ |
| 361 | enum iscsi_host_param { | 414 | enum iscsi_host_param { |
| 362 | ISCSI_HOST_PARAM_HWADDRESS, | 415 | ISCSI_HOST_PARAM_HWADDRESS, |
| @@ -366,11 +419,6 @@ enum iscsi_host_param { | |||
| 366 | ISCSI_HOST_PARAM_MAX, | 419 | ISCSI_HOST_PARAM_MAX, |
| 367 | }; | 420 | }; |
| 368 | 421 | ||
| 369 | #define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS) | ||
| 370 | #define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME) | ||
| 371 | #define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME) | ||
| 372 | #define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS) | ||
| 373 | |||
| 374 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) | 422 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) |
| 375 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) | 423 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) |
| 376 | 424 | ||
| @@ -392,6 +440,7 @@ enum iscsi_host_param { | |||
| 392 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ | 440 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ |
| 393 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, | 441 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, |
| 394 | and verification */ | 442 | and verification */ |
| 443 | #define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */ | ||
| 395 | 444 | ||
| 396 | /* | 445 | /* |
| 397 | * These flags describes reason of stop_conn() call | 446 | * These flags describes reason of stop_conn() call |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 7d96829b0c00..5d1a758e0595 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -281,9 +281,6 @@ struct fc_seq_els_data { | |||
| 281 | * @timer: The command timer | 281 | * @timer: The command timer |
| 282 | * @tm_done: Completion indicator | 282 | * @tm_done: Completion indicator |
| 283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) | 283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) |
| 284 | * @start_time: Timestamp indicating the start of the I/O (in jiffies) | ||
| 285 | * @end_time: Timestamp indicating the end of the I/O (in jiffies) | ||
| 286 | * @last_pkt_time: Timestamp of the last frame received (in jiffies) | ||
| 287 | * @data_len: The length of the data | 284 | * @data_len: The length of the data |
| 288 | * @cdb_cmd: The CDB command | 285 | * @cdb_cmd: The CDB command |
| 289 | * @xfer_len: The transfer length | 286 | * @xfer_len: The transfer length |
| @@ -304,50 +301,46 @@ struct fc_seq_els_data { | |||
| 304 | * @recov_seq: The sequence for REC or SRR | 301 | * @recov_seq: The sequence for REC or SRR |
| 305 | */ | 302 | */ |
| 306 | struct fc_fcp_pkt { | 303 | struct fc_fcp_pkt { |
| 307 | /* Housekeeping information */ | ||
| 308 | struct fc_lport *lp; | ||
| 309 | u16 state; | ||
| 310 | atomic_t ref_cnt; | ||
| 311 | spinlock_t scsi_pkt_lock; | 304 | spinlock_t scsi_pkt_lock; |
| 305 | atomic_t ref_cnt; | ||
| 306 | |||
| 307 | /* SCSI command and data transfer information */ | ||
| 308 | u32 data_len; | ||
| 312 | 309 | ||
| 313 | /* SCSI I/O related information */ | 310 | /* SCSI I/O related information */ |
| 314 | struct scsi_cmnd *cmd; | 311 | struct scsi_cmnd *cmd; |
| 315 | struct list_head list; | 312 | struct list_head list; |
| 316 | 313 | ||
| 317 | /* Timeout related information */ | 314 | /* Housekeeping information */ |
| 318 | struct timer_list timer; | 315 | struct fc_lport *lp; |
| 319 | struct completion tm_done; | 316 | u8 state; |
| 320 | int wait_for_comp; | ||
| 321 | unsigned long start_time; | ||
| 322 | unsigned long end_time; | ||
| 323 | unsigned long last_pkt_time; | ||
| 324 | |||
| 325 | /* SCSI command and data transfer information */ | ||
| 326 | u32 data_len; | ||
| 327 | |||
| 328 | /* Transport related veriables */ | ||
| 329 | struct fcp_cmnd cdb_cmd; | ||
| 330 | size_t xfer_len; | ||
| 331 | u16 xfer_ddp; | ||
| 332 | u32 xfer_contig_end; | ||
| 333 | u16 max_payload; | ||
| 334 | 317 | ||
| 335 | /* SCSI/FCP return status */ | 318 | /* SCSI/FCP return status */ |
| 336 | u32 io_status; | ||
| 337 | u8 cdb_status; | 319 | u8 cdb_status; |
| 338 | u8 status_code; | 320 | u8 status_code; |
| 339 | u8 scsi_comp_flags; | 321 | u8 scsi_comp_flags; |
| 322 | u32 io_status; | ||
| 340 | u32 req_flags; | 323 | u32 req_flags; |
| 341 | u32 scsi_resid; | 324 | u32 scsi_resid; |
| 342 | 325 | ||
| 326 | /* Transport related veriables */ | ||
| 327 | size_t xfer_len; | ||
| 328 | struct fcp_cmnd cdb_cmd; | ||
| 329 | u32 xfer_contig_end; | ||
| 330 | u16 max_payload; | ||
| 331 | u16 xfer_ddp; | ||
| 332 | |||
| 343 | /* Associated structures */ | 333 | /* Associated structures */ |
| 344 | struct fc_rport *rport; | 334 | struct fc_rport *rport; |
| 345 | struct fc_seq *seq_ptr; | 335 | struct fc_seq *seq_ptr; |
| 346 | 336 | ||
| 347 | /* Error Processing information */ | 337 | /* Timeout/error related information */ |
| 348 | u8 recov_retry; | 338 | struct timer_list timer; |
| 339 | int wait_for_comp; | ||
| 340 | u32 recov_retry; | ||
| 349 | struct fc_seq *recov_seq; | 341 | struct fc_seq *recov_seq; |
| 350 | }; | 342 | struct completion tm_done; |
| 343 | } ____cacheline_aligned_in_smp; | ||
| 351 | 344 | ||
| 352 | /* | 345 | /* |
| 353 | * Structure and function definitions for managing Fibre Channel Exchanges | 346 | * Structure and function definitions for managing Fibre Channel Exchanges |
| @@ -413,35 +406,32 @@ struct fc_seq { | |||
| 413 | * sequence allocation | 406 | * sequence allocation |
| 414 | */ | 407 | */ |
| 415 | struct fc_exch { | 408 | struct fc_exch { |
| 409 | spinlock_t ex_lock; | ||
| 410 | atomic_t ex_refcnt; | ||
| 411 | enum fc_class class; | ||
| 416 | struct fc_exch_mgr *em; | 412 | struct fc_exch_mgr *em; |
| 417 | struct fc_exch_pool *pool; | 413 | struct fc_exch_pool *pool; |
| 418 | u32 state; | ||
| 419 | u16 xid; | ||
| 420 | struct list_head ex_list; | 414 | struct list_head ex_list; |
| 421 | spinlock_t ex_lock; | ||
| 422 | atomic_t ex_refcnt; | ||
| 423 | struct delayed_work timeout_work; | ||
| 424 | struct fc_lport *lp; | 415 | struct fc_lport *lp; |
| 416 | u32 esb_stat; | ||
| 417 | u8 state; | ||
| 418 | u8 fh_type; | ||
| 419 | u8 seq_id; | ||
| 420 | u8 encaps; | ||
| 421 | u16 xid; | ||
| 425 | u16 oxid; | 422 | u16 oxid; |
| 426 | u16 rxid; | 423 | u16 rxid; |
| 427 | u32 oid; | 424 | u32 oid; |
| 428 | u32 sid; | 425 | u32 sid; |
| 429 | u32 did; | 426 | u32 did; |
| 430 | u32 esb_stat; | ||
| 431 | u32 r_a_tov; | 427 | u32 r_a_tov; |
| 432 | u8 seq_id; | ||
| 433 | u8 encaps; | ||
| 434 | u32 f_ctl; | 428 | u32 f_ctl; |
| 435 | u8 fh_type; | 429 | struct fc_seq seq; |
| 436 | enum fc_class class; | ||
| 437 | struct fc_seq seq; | ||
| 438 | |||
| 439 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); | 430 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); |
| 440 | void *arg; | 431 | void *arg; |
| 441 | |||
| 442 | void (*destructor)(struct fc_seq *, void *); | 432 | void (*destructor)(struct fc_seq *, void *); |
| 443 | 433 | struct delayed_work timeout_work; | |
| 444 | }; | 434 | } ____cacheline_aligned_in_smp; |
| 445 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) | 435 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) |
| 446 | 436 | ||
| 447 | 437 | ||
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8c1638b8c28e..d1e95c6ac776 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
| @@ -229,6 +229,11 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, | |||
| 229 | const struct libfc_function_template *, int init_fcp); | 229 | const struct libfc_function_template *, int init_fcp); |
| 230 | u32 fcoe_fc_crc(struct fc_frame *fp); | 230 | u32 fcoe_fc_crc(struct fc_frame *fp); |
| 231 | int fcoe_start_io(struct sk_buff *skb); | 231 | int fcoe_start_io(struct sk_buff *skb); |
| 232 | int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); | ||
| 233 | void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb, | ||
| 234 | struct net_device *netdev); | ||
| 235 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); | ||
| 236 | int fcoe_validate_vport_create(struct fc_vport *vport); | ||
| 232 | 237 | ||
| 233 | /** | 238 | /** |
| 234 | * is_fip_mode() - returns true if FIP mode selected. | 239 | * is_fip_mode() - returns true if FIP mode selected. |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ee866060f8a4..6a308d42d98f 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
| @@ -142,8 +142,11 @@ struct expander_device { | |||
| 142 | u16 ex_change_count; | 142 | u16 ex_change_count; |
| 143 | u16 max_route_indexes; | 143 | u16 max_route_indexes; |
| 144 | u8 num_phys; | 144 | u8 num_phys; |
| 145 | |||
| 146 | u8 t2t_supp:1; | ||
| 145 | u8 configuring:1; | 147 | u8 configuring:1; |
| 146 | u8 conf_route_table:1; | 148 | u8 conf_route_table:1; |
| 149 | |||
| 147 | u8 enclosure_logical_id[8]; | 150 | u8 enclosure_logical_id[8]; |
| 148 | 151 | ||
| 149 | struct ex_phy *ex_phy; | 152 | struct ex_phy *ex_phy; |
| @@ -386,6 +389,11 @@ sdev_to_domain_dev(struct scsi_device *sdev) { | |||
| 386 | return starget_to_domain_dev(sdev->sdev_target); | 389 | return starget_to_domain_dev(sdev->sdev_target); |
| 387 | } | 390 | } |
| 388 | 391 | ||
| 392 | static inline struct ata_device *sas_to_ata_dev(struct domain_device *dev) | ||
| 393 | { | ||
| 394 | return &dev->sata_dev.ap->link.device[0]; | ||
| 395 | } | ||
| 396 | |||
| 389 | static inline struct domain_device * | 397 | static inline struct domain_device * |
| 390 | cmd_to_domain_dev(struct scsi_cmnd *cmd) | 398 | cmd_to_domain_dev(struct scsi_cmnd *cmd) |
| 391 | { | 399 | { |
| @@ -405,6 +413,20 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy) | |||
| 405 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; | 413 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; |
| 406 | } | 414 | } |
| 407 | 415 | ||
| 416 | static inline unsigned int to_sas_gpio_od(int device, int bit) | ||
| 417 | { | ||
| 418 | return 3 * device + bit; | ||
| 419 | } | ||
| 420 | |||
| 421 | #ifdef CONFIG_SCSI_SAS_HOST_SMP | ||
| 422 | int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count); | ||
| 423 | #else | ||
| 424 | static inline int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count) | ||
| 425 | { | ||
| 426 | return -1; | ||
| 427 | } | ||
| 428 | #endif | ||
| 429 | |||
| 408 | /* ---------- Tasks ---------- */ | 430 | /* ---------- Tasks ---------- */ |
| 409 | /* | 431 | /* |
| 410 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | | 432 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | |
| @@ -555,36 +577,14 @@ struct sas_task { | |||
| 555 | struct work_struct abort_work; | 577 | struct work_struct abort_work; |
| 556 | }; | 578 | }; |
| 557 | 579 | ||
| 558 | extern struct kmem_cache *sas_task_cache; | ||
| 559 | |||
| 560 | #define SAS_TASK_STATE_PENDING 1 | 580 | #define SAS_TASK_STATE_PENDING 1 |
| 561 | #define SAS_TASK_STATE_DONE 2 | 581 | #define SAS_TASK_STATE_DONE 2 |
| 562 | #define SAS_TASK_STATE_ABORTED 4 | 582 | #define SAS_TASK_STATE_ABORTED 4 |
| 563 | #define SAS_TASK_NEED_DEV_RESET 8 | 583 | #define SAS_TASK_NEED_DEV_RESET 8 |
| 564 | #define SAS_TASK_AT_INITIATOR 16 | 584 | #define SAS_TASK_AT_INITIATOR 16 |
| 565 | 585 | ||
| 566 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 586 | extern struct sas_task *sas_alloc_task(gfp_t flags); |
| 567 | { | 587 | extern void sas_free_task(struct sas_task *task); |
| 568 | struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); | ||
| 569 | |||
| 570 | if (task) { | ||
| 571 | INIT_LIST_HEAD(&task->list); | ||
| 572 | spin_lock_init(&task->task_state_lock); | ||
| 573 | task->task_state_flags = SAS_TASK_STATE_PENDING; | ||
| 574 | init_timer(&task->timer); | ||
| 575 | init_completion(&task->completion); | ||
| 576 | } | ||
| 577 | |||
| 578 | return task; | ||
| 579 | } | ||
| 580 | |||
| 581 | static inline void sas_free_task(struct sas_task *task) | ||
| 582 | { | ||
| 583 | if (task) { | ||
| 584 | BUG_ON(!list_empty(&task->list)); | ||
| 585 | kmem_cache_free(sas_task_cache, task); | ||
| 586 | } | ||
| 587 | } | ||
| 588 | 588 | ||
| 589 | struct sas_domain_function_template { | 589 | struct sas_domain_function_template { |
| 590 | /* The class calls these to notify the LLDD of an event. */ | 590 | /* The class calls these to notify the LLDD of an event. */ |
| @@ -614,6 +614,10 @@ struct sas_domain_function_template { | |||
| 614 | 614 | ||
| 615 | /* Phy management */ | 615 | /* Phy management */ |
| 616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); | 616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); |
| 617 | |||
| 618 | /* GPIO support */ | ||
| 619 | int (*lldd_write_gpio)(struct sas_ha_struct *, u8 reg_type, | ||
| 620 | u8 reg_index, u8 reg_count, u8 *write_data); | ||
| 617 | }; | 621 | }; |
| 618 | 622 | ||
| 619 | extern int sas_register_ha(struct sas_ha_struct *); | 623 | extern int sas_register_ha(struct sas_ha_struct *); |
| @@ -652,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev); | |||
| 652 | int sas_discover_sata(struct domain_device *); | 656 | int sas_discover_sata(struct domain_device *); |
| 653 | int sas_discover_end_dev(struct domain_device *); | 657 | int sas_discover_end_dev(struct domain_device *); |
| 654 | 658 | ||
| 655 | void sas_unregister_dev(struct domain_device *); | 659 | void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); |
| 656 | 660 | ||
| 657 | void sas_init_dev(struct domain_device *); | 661 | void sas_init_dev(struct domain_device *); |
| 658 | 662 | ||
diff --git a/include/scsi/sas.h b/include/scsi/sas.h index e9fd02281381..3673d685e6ad 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h | |||
| @@ -108,6 +108,7 @@ enum sas_protocol { | |||
| 108 | SAS_PROTOCOL_STP = 0x04, | 108 | SAS_PROTOCOL_STP = 0x04, |
| 109 | SAS_PROTOCOL_SSP = 0x08, | 109 | SAS_PROTOCOL_SSP = 0x08, |
| 110 | SAS_PROTOCOL_ALL = 0x0E, | 110 | SAS_PROTOCOL_ALL = 0x0E, |
| 111 | SAS_PROTOCOL_STP_ALL = SAS_PROTOCOL_STP|SAS_PROTOCOL_SATA, | ||
| 111 | }; | 112 | }; |
| 112 | 113 | ||
| 113 | /* From the spec; local phys only */ | 114 | /* From the spec; local phys only */ |
| @@ -121,6 +122,7 @@ enum phy_func { | |||
| 121 | PHY_FUNC_TX_SATA_PS_SIGNAL, | 122 | PHY_FUNC_TX_SATA_PS_SIGNAL, |
| 122 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ | 123 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ |
| 123 | PHY_FUNC_SET_LINK_RATE, | 124 | PHY_FUNC_SET_LINK_RATE, |
| 125 | PHY_FUNC_GET_EVENTS, | ||
| 124 | }; | 126 | }; |
| 125 | 127 | ||
| 126 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. | 128 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. |
| @@ -195,6 +197,14 @@ enum sas_open_rej_reason { | |||
| 195 | SAS_OREJ_RSVD_RETRY = 18, | 197 | SAS_OREJ_RSVD_RETRY = 18, |
| 196 | }; | 198 | }; |
| 197 | 199 | ||
| 200 | enum sas_gpio_reg_type { | ||
| 201 | SAS_GPIO_REG_CFG = 0, | ||
| 202 | SAS_GPIO_REG_RX = 1, | ||
| 203 | SAS_GPIO_REG_RX_GP = 2, | ||
| 204 | SAS_GPIO_REG_TX = 3, | ||
| 205 | SAS_GPIO_REG_TX_GP = 4, | ||
| 206 | }; | ||
| 207 | |||
| 198 | struct dev_to_host_fis { | 208 | struct dev_to_host_fis { |
| 199 | u8 fis_type; /* 0x34 */ | 209 | u8 fis_type; /* 0x34 */ |
| 200 | u8 flags; | 210 | u8 flags; |
| @@ -341,7 +351,12 @@ struct report_general_resp { | |||
| 341 | 351 | ||
| 342 | u8 conf_route_table:1; | 352 | u8 conf_route_table:1; |
| 343 | u8 configuring:1; | 353 | u8 configuring:1; |
| 344 | u8 _r_b:6; | 354 | u8 config_others:1; |
| 355 | u8 orej_retry_supp:1; | ||
| 356 | u8 stp_cont_awt:1; | ||
| 357 | u8 self_config:1; | ||
| 358 | u8 zone_config:1; | ||
| 359 | u8 t2t_supp:1; | ||
| 345 | 360 | ||
| 346 | u8 _r_c; | 361 | u8 _r_c; |
| 347 | 362 | ||
| @@ -528,7 +543,12 @@ struct report_general_resp { | |||
| 528 | u8 _r_a; | 543 | u8 _r_a; |
| 529 | u8 num_phys; | 544 | u8 num_phys; |
| 530 | 545 | ||
| 531 | u8 _r_b:6; | 546 | u8 t2t_supp:1; |
| 547 | u8 zone_config:1; | ||
| 548 | u8 self_config:1; | ||
| 549 | u8 stp_cont_awt:1; | ||
| 550 | u8 orej_retry_supp:1; | ||
| 551 | u8 config_others:1; | ||
| 532 | u8 configuring:1; | 552 | u8 configuring:1; |
| 533 | u8 conf_route_table:1; | 553 | u8 conf_route_table:1; |
| 534 | 554 | ||
diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h new file mode 100644 index 000000000000..fd5689d4c052 --- /dev/null +++ b/include/scsi/scsi_bsg_iscsi.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | /* | ||
| 2 | * iSCSI Transport BSG Interface | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 James Smart, Emulex Corporation | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef SCSI_BSG_ISCSI_H | ||
| 23 | #define SCSI_BSG_ISCSI_H | ||
| 24 | |||
| 25 | /* | ||
| 26 | * This file intended to be included by both kernel and user space | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <scsi/scsi.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * iSCSI Transport SGIO v4 BSG Message Support | ||
| 33 | */ | ||
| 34 | |||
| 35 | /* Default BSG request timeout (in seconds) */ | ||
| 36 | #define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ) | ||
| 37 | |||
| 38 | |||
| 39 | /* | ||
| 40 | * Request Message Codes supported by the iSCSI Transport | ||
| 41 | */ | ||
| 42 | |||
| 43 | /* define the class masks for the message codes */ | ||
| 44 | #define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */ | ||
| 45 | #define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */ | ||
| 46 | |||
| 47 | /* iscsi host Message Codes */ | ||
| 48 | #define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF) | ||
| 49 | |||
| 50 | |||
| 51 | /* | ||
| 52 | * iSCSI Host Messages | ||
| 53 | */ | ||
| 54 | |||
| 55 | /* ISCSI_BSG_HST_VENDOR : */ | ||
| 56 | |||
| 57 | /* Request: | ||
| 58 | * Note: When specifying vendor_id, be sure to read the Vendor Type and ID | ||
| 59 | * formatting requirements specified in scsi_netlink.h | ||
| 60 | */ | ||
| 61 | struct iscsi_bsg_host_vendor { | ||
| 62 | /* | ||
| 63 | * Identifies the vendor that the message is formatted for. This | ||
| 64 | * should be the recipient of the message. | ||
| 65 | */ | ||
| 66 | uint64_t vendor_id; | ||
| 67 | |||
| 68 | /* start of vendor command area */ | ||
| 69 | uint32_t vendor_cmd[0]; | ||
| 70 | }; | ||
| 71 | |||
| 72 | /* Response: | ||
| 73 | */ | ||
| 74 | struct iscsi_bsg_host_vendor_reply { | ||
| 75 | /* start of vendor response area */ | ||
| 76 | uint32_t vendor_rsp[0]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | |||
| 80 | /* request (CDB) structure of the sg_io_v4 */ | ||
| 81 | struct iscsi_bsg_request { | ||
| 82 | uint32_t msgcode; | ||
| 83 | union { | ||
| 84 | struct iscsi_bsg_host_vendor h_vendor; | ||
| 85 | } rqst_data; | ||
| 86 | } __attribute__((packed)); | ||
| 87 | |||
| 88 | |||
| 89 | /* response (request sense data) structure of the sg_io_v4 */ | ||
| 90 | struct iscsi_bsg_reply { | ||
| 91 | /* | ||
| 92 | * The completion result. Result exists in two forms: | ||
| 93 | * if negative, it is an -Exxx system errno value. There will | ||
| 94 | * be no further reply information supplied. | ||
| 95 | * else, it's the 4-byte scsi error result, with driver, host, | ||
| 96 | * msg and status fields. The per-msgcode reply structure | ||
| 97 | * will contain valid data. | ||
| 98 | */ | ||
| 99 | uint32_t result; | ||
| 100 | |||
| 101 | /* If there was reply_payload, how much was recevied ? */ | ||
| 102 | uint32_t reply_payload_rcv_len; | ||
| 103 | |||
| 104 | union { | ||
| 105 | struct iscsi_bsg_host_vendor_reply vendor_reply; | ||
| 106 | } reply_data; | ||
| 107 | }; | ||
| 108 | |||
| 109 | |||
| 110 | #endif /* SCSI_BSG_ISCSI_H */ | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3ca90c3..5591ed54dc93 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -197,6 +197,7 @@ struct scsi_device_handler { | |||
| 197 | int (*activate)(struct scsi_device *, activate_complete, void *); | 197 | int (*activate)(struct scsi_device *, activate_complete, void *); |
| 198 | int (*prep_fn)(struct scsi_device *, struct request *); | 198 | int (*prep_fn)(struct scsi_device *, struct request *); |
| 199 | int (*set_params)(struct scsi_device *, const char *); | 199 | int (*set_params)(struct scsi_device *, const char *); |
| 200 | bool (*match)(struct scsi_device *); | ||
| 200 | }; | 201 | }; |
| 201 | 202 | ||
| 202 | struct scsi_dh_data { | 203 | struct scsi_dh_data { |
| @@ -471,6 +472,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev) | |||
| 471 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); | 472 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
| 472 | } | 473 | } |
| 473 | 474 | ||
| 475 | static inline int scsi_device_tpgs(struct scsi_device *sdev) | ||
| 476 | { | ||
| 477 | return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; | ||
| 478 | } | ||
| 479 | |||
| 474 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ | 480 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ |
| 475 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") | 481 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") |
| 476 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" | 482 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index f1f2644137b8..50266c9405fc 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -355,6 +355,19 @@ struct scsi_host_template { | |||
| 355 | */ | 355 | */ |
| 356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); | 356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); |
| 357 | 357 | ||
| 358 | /* This is an optional routine that allows transport to initiate | ||
| 359 | * LLD adapter or firmware reset using sysfs attribute. | ||
| 360 | * | ||
| 361 | * Return values: 0 on success, -ve value on failure. | ||
| 362 | * | ||
| 363 | * Status: OPTIONAL | ||
| 364 | */ | ||
| 365 | |||
| 366 | int (*host_reset)(struct Scsi_Host *shost, int reset_type); | ||
| 367 | #define SCSI_ADAPTER_RESET 1 | ||
| 368 | #define SCSI_FIRMWARE_RESET 2 | ||
| 369 | |||
| 370 | |||
| 358 | /* | 371 | /* |
| 359 | * Name of proc directory | 372 | * Name of proc directory |
| 360 | */ | 373 | */ |
| @@ -791,7 +804,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) | |||
| 791 | **/ | 804 | **/ |
| 792 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) | 805 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) |
| 793 | { | 806 | { |
| 794 | return shost->shost_state == SHOST_RUNNING; | 807 | return shost->shost_state == SHOST_RUNNING || |
| 808 | shost->shost_state == SHOST_RECOVERY; | ||
| 795 | } | 809 | } |
| 796 | 810 | ||
| 797 | extern void scsi_unblock_requests(struct Scsi_Host *); | 811 | extern void scsi_unblock_requests(struct Scsi_Host *); |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index bf8f52965675..5994bcc1b017 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
| @@ -37,6 +37,8 @@ struct iscsi_cls_conn; | |||
| 37 | struct iscsi_conn; | 37 | struct iscsi_conn; |
| 38 | struct iscsi_task; | 38 | struct iscsi_task; |
| 39 | struct sockaddr; | 39 | struct sockaddr; |
| 40 | struct iscsi_iface; | ||
| 41 | struct bsg_job; | ||
| 40 | 42 | ||
| 41 | /** | 43 | /** |
| 42 | * struct iscsi_transport - iSCSI Transport template | 44 | * struct iscsi_transport - iSCSI Transport template |
| @@ -84,9 +86,7 @@ struct iscsi_transport { | |||
| 84 | struct module *owner; | 86 | struct module *owner; |
| 85 | char *name; | 87 | char *name; |
| 86 | unsigned int caps; | 88 | unsigned int caps; |
| 87 | /* LLD sets this to indicate what values it can export to sysfs */ | 89 | |
| 88 | uint64_t param_mask; | ||
| 89 | uint64_t host_param_mask; | ||
| 90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, | 90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, |
| 91 | uint16_t cmds_max, uint16_t qdepth, | 91 | uint16_t cmds_max, uint16_t qdepth, |
| 92 | uint32_t sn); | 92 | uint32_t sn); |
| @@ -137,6 +137,13 @@ struct iscsi_transport { | |||
| 137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, | 137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, |
| 138 | uint32_t enable, struct sockaddr *dst_addr); | 138 | uint32_t enable, struct sockaddr *dst_addr); |
| 139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); | 139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); |
| 140 | int (*set_iface_param) (struct Scsi_Host *shost, void *data, | ||
| 141 | uint32_t len); | ||
| 142 | int (*get_iface_param) (struct iscsi_iface *iface, | ||
| 143 | enum iscsi_param_type param_type, | ||
| 144 | int param, char *buf); | ||
| 145 | mode_t (*attr_is_visible)(int param_type, int param); | ||
| 146 | int (*bsg_request)(struct bsg_job *job); | ||
| 140 | }; | 147 | }; |
| 141 | 148 | ||
| 142 | /* | 149 | /* |
| @@ -150,6 +157,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); | |||
| 150 | */ | 157 | */ |
| 151 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, | 158 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, |
| 152 | enum iscsi_err error); | 159 | enum iscsi_err error); |
| 160 | extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn, | ||
| 161 | enum iscsi_conn_state state); | ||
| 153 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 162 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
| 154 | char *data, uint32_t data_size); | 163 | char *data, uint32_t data_size); |
| 155 | 164 | ||
| @@ -171,6 +180,9 @@ struct iscsi_cls_conn { | |||
| 171 | #define iscsi_dev_to_conn(_dev) \ | 180 | #define iscsi_dev_to_conn(_dev) \ |
| 172 | container_of(_dev, struct iscsi_cls_conn, dev) | 181 | container_of(_dev, struct iscsi_cls_conn, dev) |
| 173 | 182 | ||
| 183 | #define transport_class_to_conn(_cdev) \ | ||
| 184 | iscsi_dev_to_conn(_cdev->parent) | ||
| 185 | |||
| 174 | #define iscsi_conn_to_session(_conn) \ | 186 | #define iscsi_conn_to_session(_conn) \ |
| 175 | iscsi_dev_to_session(_conn->dev.parent) | 187 | iscsi_dev_to_session(_conn->dev.parent) |
| 176 | 188 | ||
| @@ -197,6 +209,7 @@ struct iscsi_cls_session { | |||
| 197 | struct delayed_work recovery_work; | 209 | struct delayed_work recovery_work; |
| 198 | 210 | ||
| 199 | unsigned int target_id; | 211 | unsigned int target_id; |
| 212 | bool ida_used; | ||
| 200 | 213 | ||
| 201 | int state; | 214 | int state; |
| 202 | int sid; /* session id */ | 215 | int sid; /* session id */ |
| @@ -207,6 +220,9 @@ struct iscsi_cls_session { | |||
| 207 | #define iscsi_dev_to_session(_dev) \ | 220 | #define iscsi_dev_to_session(_dev) \ |
| 208 | container_of(_dev, struct iscsi_cls_session, dev) | 221 | container_of(_dev, struct iscsi_cls_session, dev) |
| 209 | 222 | ||
| 223 | #define transport_class_to_session(_cdev) \ | ||
| 224 | iscsi_dev_to_session(_cdev->parent) | ||
| 225 | |||
| 210 | #define iscsi_session_to_shost(_session) \ | 226 | #define iscsi_session_to_shost(_session) \ |
| 211 | dev_to_shost(_session->dev.parent) | 227 | dev_to_shost(_session->dev.parent) |
| 212 | 228 | ||
| @@ -216,8 +232,12 @@ struct iscsi_cls_session { | |||
| 216 | struct iscsi_cls_host { | 232 | struct iscsi_cls_host { |
| 217 | atomic_t nr_scans; | 233 | atomic_t nr_scans; |
| 218 | struct mutex mutex; | 234 | struct mutex mutex; |
| 235 | struct request_queue *bsg_q; | ||
| 219 | }; | 236 | }; |
| 220 | 237 | ||
| 238 | #define iscsi_job_to_shost(_job) \ | ||
| 239 | dev_to_shost(_job->dev) | ||
| 240 | |||
| 221 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, | 241 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, |
| 222 | void (*fn)(struct iscsi_cls_session *)); | 242 | void (*fn)(struct iscsi_cls_session *)); |
| 223 | 243 | ||
| @@ -228,6 +248,20 @@ struct iscsi_endpoint { | |||
| 228 | struct iscsi_cls_conn *conn; | 248 | struct iscsi_cls_conn *conn; |
| 229 | }; | 249 | }; |
| 230 | 250 | ||
| 251 | struct iscsi_iface { | ||
| 252 | struct device dev; | ||
| 253 | struct iscsi_transport *transport; | ||
| 254 | uint32_t iface_type; /* IPv4 or IPv6 */ | ||
| 255 | uint32_t iface_num; /* iface number, 0 - n */ | ||
| 256 | void *dd_data; /* LLD private data */ | ||
| 257 | }; | ||
| 258 | |||
| 259 | #define iscsi_dev_to_iface(_dev) \ | ||
| 260 | container_of(_dev, struct iscsi_iface, dev) | ||
| 261 | |||
| 262 | #define iscsi_iface_to_shost(_iface) \ | ||
| 263 | dev_to_shost(_iface->dev.parent) | ||
| 264 | |||
| 231 | /* | 265 | /* |
| 232 | * session and connection functions that can be used by HW iSCSI LLDs | 266 | * session and connection functions that can be used by HW iSCSI LLDs |
| 233 | */ | 267 | */ |
| @@ -238,6 +272,7 @@ struct iscsi_endpoint { | |||
| 238 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) | 272 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) |
| 239 | 273 | ||
| 240 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); | 274 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); |
| 275 | extern int iscsi_is_session_online(struct iscsi_cls_session *session); | ||
| 241 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | 276 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, |
| 242 | struct iscsi_transport *transport, int dd_size); | 277 | struct iscsi_transport *transport, int dd_size); |
| 243 | extern int iscsi_add_session(struct iscsi_cls_session *session, | 278 | extern int iscsi_add_session(struct iscsi_cls_session *session, |
| @@ -261,5 +296,11 @@ extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); | |||
| 261 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); | 296 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); |
| 262 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); | 297 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); |
| 263 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); | 298 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); |
| 299 | extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost, | ||
| 300 | struct iscsi_transport *t, | ||
| 301 | uint32_t iface_type, | ||
| 302 | uint32_t iface_num, int dd_size); | ||
| 303 | extern void iscsi_destroy_iface(struct iscsi_iface *iface); | ||
| 304 | extern struct iscsi_iface *iscsi_lookup_iface(int handle); | ||
| 264 | 305 | ||
| 265 | #endif | 306 | #endif |
diff --git a/include/sound/adau1373.h b/include/sound/adau1373.h new file mode 100644 index 000000000000..1b19c7666574 --- /dev/null +++ b/include/sound/adau1373.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Analog Devices ADAU1373 Audio Codec drive | ||
| 3 | * | ||
| 4 | * Copyright 2011 Analog Devices Inc. | ||
| 5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2 or later. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __SOUND_ADAU1373_H__ | ||
| 11 | #define __SOUND_ADAU1373_H__ | ||
| 12 | |||
| 13 | enum adau1373_micbias_voltage { | ||
| 14 | ADAU1373_MICBIAS_2_9V = 0, | ||
| 15 | ADAU1373_MICBIAS_2_2V = 1, | ||
| 16 | ADAU1373_MICBIAS_2_6V = 2, | ||
| 17 | ADAU1373_MICBIAS_1_8V = 3, | ||
| 18 | }; | ||
| 19 | |||
| 20 | #define ADAU1373_DRC_SIZE 13 | ||
| 21 | |||
| 22 | struct adau1373_platform_data { | ||
| 23 | bool input_differential[4]; | ||
| 24 | bool lineout_differential; | ||
| 25 | bool lineout_ground_sense; | ||
| 26 | |||
| 27 | unsigned int num_drc; | ||
| 28 | uint8_t drc_setting[3][ADAU1373_DRC_SIZE]; | ||
| 29 | |||
| 30 | enum adau1373_micbias_voltage micbias1; | ||
| 31 | enum adau1373_micbias_voltage micbias2; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/sound/asound.h b/include/sound/asound.h index 5d6074faa279..a2e4ff5ba9e9 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -706,7 +706,7 @@ struct snd_timer_tread { | |||
| 706 | * * | 706 | * * |
| 707 | ****************************************************************************/ | 707 | ****************************************************************************/ |
| 708 | 708 | ||
| 709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) | 709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) |
| 710 | 710 | ||
| 711 | struct snd_ctl_card_info { | 711 | struct snd_ctl_card_info { |
| 712 | int card; /* card number */ | 712 | int card; /* card number */ |
| @@ -803,6 +803,8 @@ struct snd_ctl_elem_info { | |||
| 803 | unsigned int items; /* R: number of items */ | 803 | unsigned int items; /* R: number of items */ |
| 804 | unsigned int item; /* W: item number */ | 804 | unsigned int item; /* W: item number */ |
| 805 | char name[64]; /* R: value name */ | 805 | char name[64]; /* R: value name */ |
| 806 | __u64 names_ptr; /* W: names list (ELEM_ADD only) */ | ||
| 807 | unsigned int names_length; | ||
| 806 | } enumerated; | 808 | } enumerated; |
| 807 | unsigned char reserved[128]; | 809 | unsigned char reserved[128]; |
| 808 | } value; | 810 | } value; |
diff --git a/include/sound/initval.h b/include/sound/initval.h index 1daa6dff8297..f99a0d2ddfe7 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h | |||
| @@ -62,7 +62,7 @@ static int snd_legacy_find_free_irq(int *irq_table) | |||
| 62 | { | 62 | { |
| 63 | while (*irq_table != -1) { | 63 | while (*irq_table != -1) { |
| 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, | 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, |
| 65 | IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", | 65 | IRQF_PROBE_SHARED, "ALSA Test IRQ", |
| 66 | (void *) irq_table)) { | 66 | (void *) irq_table)) { |
| 67 | free_irq(*irq_table, (void *) irq_table); | 67 | free_irq(*irq_table, (void *) irq_table); |
| 68 | return *irq_table; | 68 | return *irq_table; |
diff --git a/include/sound/jack.h b/include/sound/jack.h index c140fc7cbd3f..63c790742db4 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h | |||
| @@ -42,6 +42,7 @@ enum snd_jack_types { | |||
| 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ | 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ |
| 43 | SND_JACK_VIDEOOUT = 0x0010, | 43 | SND_JACK_VIDEOOUT = 0x0010, |
| 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, | 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, |
| 45 | SND_JACK_LINEIN = 0x0020, | ||
| 45 | 46 | ||
| 46 | /* Kept separate from switches to facilitate implementation */ | 47 | /* Kept separate from switches to facilitate implementation */ |
| 47 | SND_JACK_BTN_0 = 0x4000, | 48 | SND_JACK_BTN_0 = 0x4000, |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 1f1d53f8830b..20230db00ef1 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
| @@ -50,7 +50,10 @@ | |||
| 50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ | 50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ |
| 51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ | 51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ |
| 52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ | 52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ |
| 53 | #define MPU401_INFO_IRQ_HOOK (1 << 5) /* mpu401 irq handler is called | ||
| 54 | from driver irq handler */ | ||
| 53 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ | 55 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ |
| 56 | #define MPU401_INFO_USE_TIMER (1 << 15) /* internal */ | ||
| 54 | 57 | ||
| 55 | #define MPU401_MODE_BIT_INPUT 0 | 58 | #define MPU401_MODE_BIT_INPUT 0 |
| 56 | #define MPU401_MODE_BIT_OUTPUT 1 | 59 | #define MPU401_MODE_BIT_OUTPUT 1 |
| @@ -73,8 +76,7 @@ struct snd_mpu401 { | |||
| 73 | unsigned long port; /* base port of MPU-401 chip */ | 76 | unsigned long port; /* base port of MPU-401 chip */ |
| 74 | unsigned long cport; /* port + 1 (usually) */ | 77 | unsigned long cport; /* port + 1 (usually) */ |
| 75 | struct resource *res; /* port resource */ | 78 | struct resource *res; /* port resource */ |
| 76 | int irq; /* IRQ number of MPU-401 chip (-1 = poll) */ | 79 | int irq; /* IRQ number of MPU-401 chip */ |
| 77 | int irq_flags; | ||
| 78 | 80 | ||
| 79 | unsigned long mode; /* MPU401_MODE_XXXX */ | 81 | unsigned long mode; /* MPU401_MODE_XXXX */ |
| 80 | int timer_invoked; | 82 | int timer_invoked; |
| @@ -131,7 +133,6 @@ int snd_mpu401_uart_new(struct snd_card *card, | |||
| 131 | unsigned long port, | 133 | unsigned long port, |
| 132 | unsigned int info_flags, | 134 | unsigned int info_flags, |
| 133 | int irq, | 135 | int irq, |
| 134 | int irq_flags, | ||
| 135 | struct snd_rawmidi ** rrawmidi); | 136 | struct snd_rawmidi ** rrawmidi); |
| 136 | 137 | ||
| 137 | #endif /* __SOUND_MPU401_H */ | 138 | #endif /* __SOUND_MPU401_H */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 54cb079b7bf1..0cf91b2f08ca 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -825,6 +825,8 @@ int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, | |||
| 825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, | 825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
| 826 | unsigned int cond, | 826 | unsigned int cond, |
| 827 | snd_pcm_hw_param_t var); | 827 | snd_pcm_hw_param_t var); |
| 828 | int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, | ||
| 829 | unsigned int base_rate); | ||
| 828 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, | 830 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, |
| 829 | unsigned int cond, | 831 | unsigned int cond, |
| 830 | int var, | 832 | int var, |
| @@ -1035,6 +1037,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | |||
| 1035 | atomic_dec(&substream->mmap_count); | 1037 | atomic_dec(&substream->mmap_count); |
| 1036 | } | 1038 | } |
| 1037 | 1039 | ||
| 1040 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, | ||
| 1041 | struct vm_area_struct *area); | ||
| 1038 | /* mmap for io-memory area */ | 1042 | /* mmap for io-memory area */ |
| 1039 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 1043 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
| 1040 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 1044 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
diff --git a/include/sound/saif.h b/include/sound/saif.h new file mode 100644 index 000000000000..d0e0de7984ec --- /dev/null +++ b/include/sound/saif.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
| 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 | |||
| 9 | #ifndef __SOUND_SAIF_H__ | ||
| 10 | #define __SOUND_SAIF_H__ | ||
| 11 | |||
| 12 | struct mxs_saif_platform_data { | ||
| 13 | int (*init) (void); | ||
| 14 | int (*get_master_id) (unsigned int saif_id); | ||
| 15 | }; | ||
| 16 | #endif | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 5ad5f3a50c68..2413acc54883 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -24,13 +24,13 @@ struct snd_pcm_substream; | |||
| 24 | * Describes the physical PCM data formating and clocking. Add new formats | 24 | * Describes the physical PCM data formating and clocking. Add new formats |
| 25 | * to the end. | 25 | * to the end. |
| 26 | */ | 26 | */ |
| 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 1 /* I2S mode */ |
| 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 2 /* Right Justified mode */ |
| 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 3 /* Left Justified mode */ |
| 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 4 /* L data MSB after FRM LRC */ |
| 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ |
| 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ |
| 33 | #define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ | 33 | #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ |
| 34 | 34 | ||
| 35 | /* left and right justified also known as MSB and LSB respectively */ | 35 | /* left and right justified also known as MSB and LSB respectively */ |
| 36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | 36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J |
| @@ -42,8 +42,8 @@ struct snd_pcm_substream; | |||
| 42 | * DAI bit clocks can be be gated (disabled) when the DAI is not | 42 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
| 43 | * sending or receiving PCM data in a frame. This can be used to save power. | 43 | * sending or receiving PCM data in a frame. This can be used to save power. |
| 44 | */ | 44 | */ |
| 45 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 45 | #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ |
| 46 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 46 | #define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */ |
| 47 | 47 | ||
| 48 | /* | 48 | /* |
| 49 | * DAI hardware signal inversions. | 49 | * DAI hardware signal inversions. |
| @@ -51,10 +51,10 @@ struct snd_pcm_substream; | |||
| 51 | * Specifies whether the DAI can also support inverted clocks for the specified | 51 | * Specifies whether the DAI can also support inverted clocks for the specified |
| 52 | * format. | 52 | * format. |
| 53 | */ | 53 | */ |
| 54 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 54 | #define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */ |
| 55 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ | 55 | #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ |
| 56 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ | 56 | #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ |
| 57 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ | 57 | #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ |
| 58 | 58 | ||
| 59 | /* | 59 | /* |
| 60 | * DAI hardware clock masters. | 60 | * DAI hardware clock masters. |
| @@ -63,10 +63,10 @@ struct snd_pcm_substream; | |||
| 63 | * i.e. if the codec is clk and FRM master then the interface is | 63 | * i.e. if the codec is clk and FRM master then the interface is |
| 64 | * clk and frame slave. | 64 | * clk and frame slave. |
| 65 | */ | 65 | */ |
| 66 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ | 66 | #define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */ |
| 67 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ | 67 | #define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */ |
| 68 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 68 | #define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */ |
| 69 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ | 69 | #define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */ |
| 70 | 70 | ||
| 71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
| 72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
| @@ -242,6 +242,9 @@ struct snd_soc_dai { | |||
| 242 | void *playback_dma_data; | 242 | void *playback_dma_data; |
| 243 | void *capture_dma_data; | 243 | void *capture_dma_data; |
| 244 | 244 | ||
| 245 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
| 246 | unsigned int rate; | ||
| 247 | |||
| 245 | /* parent platform/codec */ | 248 | /* parent platform/codec */ |
| 246 | union { | 249 | union { |
| 247 | struct snd_soc_platform *platform; | 250 | struct snd_soc_platform *platform; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e0583b7769cb..17a4c17f19f5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -381,6 +381,9 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | |||
| 381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
| 382 | const char *pin); | 382 | const char *pin); |
| 383 | 383 | ||
| 384 | /* Mostly internal - should not normally be used */ | ||
| 385 | void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); | ||
| 386 | |||
| 384 | /* dapm widget types */ | 387 | /* dapm widget types */ |
| 385 | enum snd_soc_dapm_type { | 388 | enum snd_soc_dapm_type { |
| 386 | snd_soc_dapm_input = 0, /* input pin */ | 389 | snd_soc_dapm_input = 0, /* input pin */ |
| @@ -473,6 +476,8 @@ struct snd_soc_dapm_widget { | |||
| 473 | unsigned char ext:1; /* has external widgets */ | 476 | unsigned char ext:1; /* has external widgets */ |
| 474 | unsigned char force:1; /* force state */ | 477 | unsigned char force:1; /* force state */ |
| 475 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ | 478 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
| 479 | unsigned char new_power:1; /* power from this run */ | ||
| 480 | unsigned char power_checked:1; /* power checked this run */ | ||
| 476 | int subseq; /* sort within widget type */ | 481 | int subseq; /* sort within widget type */ |
| 477 | 482 | ||
| 478 | int (*power_check)(struct snd_soc_dapm_widget *w); | 483 | int (*power_check)(struct snd_soc_dapm_widget *w); |
| @@ -492,6 +497,9 @@ struct snd_soc_dapm_widget { | |||
| 492 | 497 | ||
| 493 | /* used during DAPM updates */ | 498 | /* used during DAPM updates */ |
| 494 | struct list_head power_list; | 499 | struct list_head power_list; |
| 500 | struct list_head dirty; | ||
| 501 | int inputs; | ||
| 502 | int outputs; | ||
| 495 | }; | 503 | }; |
| 496 | 504 | ||
| 497 | struct snd_soc_dapm_update { | 505 | struct snd_soc_dapm_update { |
| @@ -524,6 +532,8 @@ struct snd_soc_dapm_context { | |||
| 524 | enum snd_soc_bias_level target_bias_level; | 532 | enum snd_soc_bias_level target_bias_level; |
| 525 | struct list_head list; | 533 | struct list_head list; |
| 526 | 534 | ||
| 535 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
| 536 | |||
| 527 | #ifdef CONFIG_DEBUG_FS | 537 | #ifdef CONFIG_DEBUG_FS |
| 528 | struct dentry *debugfs_dapm; | 538 | struct dentry *debugfs_dapm; |
| 529 | #endif | 539 | #endif |
| @@ -535,4 +545,10 @@ struct snd_soc_dapm_widget_list { | |||
| 535 | struct snd_soc_dapm_widget *widgets[0]; | 545 | struct snd_soc_dapm_widget *widgets[0]; |
| 536 | }; | 546 | }; |
| 537 | 547 | ||
| 548 | struct snd_soc_dapm_stats { | ||
| 549 | int power_checks; | ||
| 550 | int path_checks; | ||
| 551 | int neighbour_checks; | ||
| 552 | }; | ||
| 553 | |||
| 538 | #endif | 554 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index aa19f5a32ba8..11cfb5953e06 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/regmap.h> | ||
| 22 | #include <sound/core.h> | 23 | #include <sound/core.h> |
| 23 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
| 24 | #include <sound/control.h> | 25 | #include <sound/control.h> |
| @@ -27,13 +28,20 @@ | |||
| 27 | /* | 28 | /* |
| 28 | * Convenience kcontrol builders | 29 | * Convenience kcontrol builders |
| 29 | */ | 30 | */ |
| 30 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 31 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ |
| 31 | ((unsigned long)&(struct soc_mixer_control) \ | 32 | ((unsigned long)&(struct soc_mixer_control) \ |
| 32 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | 33 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
| 33 | .platform_max = xmax, .invert = xinvert}) | 34 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
| 35 | .invert = xinvert}) | ||
| 36 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | ||
| 37 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) | ||
| 34 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 38 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
| 35 | ((unsigned long)&(struct soc_mixer_control) \ | 39 | ((unsigned long)&(struct soc_mixer_control) \ |
| 36 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 40 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
| 41 | #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ | ||
| 42 | ((unsigned long)&(struct soc_mixer_control) \ | ||
| 43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
| 44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
| 37 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 45 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
| 38 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 39 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
| @@ -47,40 +55,36 @@ | |||
| 47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 55 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
| 48 | .put = snd_soc_put_volsw, \ | 56 | .put = snd_soc_put_volsw, \ |
| 49 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 57 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
| 50 | #define SOC_DOUBLE(xname, xreg, shift_left, shift_right, xmax, xinvert) \ | 58 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ |
| 51 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 59 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 52 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 60 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
| 53 | .put = snd_soc_put_volsw, \ | 61 | .put = snd_soc_put_volsw, \ |
| 54 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 62 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
| 55 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 63 | max, invert) } |
| 56 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 57 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 64 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
| 58 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 59 | .info = snd_soc_info_volsw_2r, \ | 66 | .info = snd_soc_info_volsw, \ |
| 60 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 67 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
| 61 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 68 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
| 62 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 69 | xmax, xinvert) } |
| 63 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | 70 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
| 64 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ | ||
| 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 66 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 72 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| 67 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 73 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
| 68 | .tlv.p = (tlv_array), \ | 74 | .tlv.p = (tlv_array), \ |
| 69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 75 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
| 70 | .put = snd_soc_put_volsw, \ | 76 | .put = snd_soc_put_volsw, \ |
| 71 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 77 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
| 72 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ | 78 | max, invert) } |
| 73 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 74 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 79 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
| 75 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 80 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 76 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 81 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| 77 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 82 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
| 78 | .tlv.p = (tlv_array), \ | 83 | .tlv.p = (tlv_array), \ |
| 79 | .info = snd_soc_info_volsw_2r, \ | 84 | .info = snd_soc_info_volsw, \ |
| 80 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 85 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
| 81 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 86 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
| 82 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 87 | xmax, xinvert) } |
| 83 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 84 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 88 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
| 85 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 89 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 86 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 90 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
| @@ -120,14 +124,13 @@ | |||
| 120 | .info = snd_soc_info_volsw, \ | 124 | .info = snd_soc_info_volsw, \ |
| 121 | .get = xhandler_get, .put = xhandler_put, \ | 125 | .get = xhandler_get, .put = xhandler_put, \ |
| 122 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 126 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
| 123 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | 127 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ |
| 124 | xhandler_get, xhandler_put) \ | 128 | xhandler_get, xhandler_put) \ |
| 125 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 129 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 126 | .info = snd_soc_info_volsw, \ | 130 | .info = snd_soc_info_volsw, \ |
| 127 | .get = xhandler_get, .put = xhandler_put, \ | 131 | .get = xhandler_get, .put = xhandler_put, \ |
| 128 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 132 | .private_value = \ |
| 129 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 133 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } |
| 130 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 131 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 134 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
| 132 | xhandler_get, xhandler_put, tlv_array) \ | 135 | xhandler_get, xhandler_put, tlv_array) \ |
| 133 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 136 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -145,20 +148,18 @@ | |||
| 145 | .tlv.p = (tlv_array), \ | 148 | .tlv.p = (tlv_array), \ |
| 146 | .info = snd_soc_info_volsw, \ | 149 | .info = snd_soc_info_volsw, \ |
| 147 | .get = xhandler_get, .put = xhandler_put, \ | 150 | .get = xhandler_get, .put = xhandler_put, \ |
| 148 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 151 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ |
| 149 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 152 | xmax, xinvert) } |
| 150 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 151 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 153 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
| 152 | xhandler_get, xhandler_put, tlv_array) \ | 154 | xhandler_get, xhandler_put, tlv_array) \ |
| 153 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 155 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 154 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 156 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
| 155 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | 157 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
| 156 | .tlv.p = (tlv_array), \ | 158 | .tlv.p = (tlv_array), \ |
| 157 | .info = snd_soc_info_volsw_2r, \ | 159 | .info = snd_soc_info_volsw, \ |
| 158 | .get = xhandler_get, .put = xhandler_put, \ | 160 | .get = xhandler_get, .put = xhandler_put, \ |
| 159 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 161 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
| 160 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 162 | xmax, xinvert) } |
| 161 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 163 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
| 163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 164 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 164 | .info = snd_soc_info_bool_ext, \ | 165 | .info = snd_soc_info_bool_ext, \ |
| @@ -260,6 +261,7 @@ extern struct snd_ac97_bus_ops soc_ac97_ops; | |||
| 260 | enum snd_soc_control_type { | 261 | enum snd_soc_control_type { |
| 261 | SND_SOC_I2C = 1, | 262 | SND_SOC_I2C = 1, |
| 262 | SND_SOC_SPI, | 263 | SND_SOC_SPI, |
| 264 | SND_SOC_REGMAP, | ||
| 263 | }; | 265 | }; |
| 264 | 266 | ||
| 265 | enum snd_soc_compress_type { | 267 | enum snd_soc_compress_type { |
| @@ -274,7 +276,7 @@ enum snd_soc_pcm_subclass { | |||
| 274 | }; | 276 | }; |
| 275 | 277 | ||
| 276 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, | 278 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, |
| 277 | unsigned int freq, int dir); | 279 | int source, unsigned int freq, int dir); |
| 278 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, | 280 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, |
| 279 | unsigned int freq_in, unsigned int freq_out); | 281 | unsigned int freq_in, unsigned int freq_out); |
| 280 | 282 | ||
| @@ -391,12 +393,8 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, | |||
| 391 | struct snd_ctl_elem_value *ucontrol); | 393 | struct snd_ctl_elem_value *ucontrol); |
| 392 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, | 394 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, |
| 393 | struct snd_ctl_elem_value *ucontrol); | 395 | struct snd_ctl_elem_value *ucontrol); |
| 394 | int snd_soc_info_volsw_2r(struct snd_kcontrol *kcontrol, | 396 | #define snd_soc_get_volsw_2r snd_soc_get_volsw |
| 395 | struct snd_ctl_elem_info *uinfo); | 397 | #define snd_soc_put_volsw_2r snd_soc_put_volsw |
| 396 | int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol, | ||
| 397 | struct snd_ctl_elem_value *ucontrol); | ||
| 398 | int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol, | ||
| 399 | struct snd_ctl_elem_value *ucontrol); | ||
| 400 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, | 398 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, |
| 401 | struct snd_ctl_elem_info *uinfo); | 399 | struct snd_ctl_elem_info *uinfo); |
| 402 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | 400 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, |
| @@ -576,9 +574,11 @@ struct snd_soc_codec { | |||
| 576 | const void *reg_def_copy; | 574 | const void *reg_def_copy; |
| 577 | const struct snd_soc_cache_ops *cache_ops; | 575 | const struct snd_soc_cache_ops *cache_ops; |
| 578 | struct mutex cache_rw_mutex; | 576 | struct mutex cache_rw_mutex; |
| 577 | int val_bytes; | ||
| 579 | 578 | ||
| 580 | /* dapm */ | 579 | /* dapm */ |
| 581 | struct snd_soc_dapm_context dapm; | 580 | struct snd_soc_dapm_context dapm; |
| 581 | unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ | ||
| 582 | 582 | ||
| 583 | #ifdef CONFIG_DEBUG_FS | 583 | #ifdef CONFIG_DEBUG_FS |
| 584 | struct dentry *debugfs_codec_root; | 584 | struct dentry *debugfs_codec_root; |
| @@ -607,7 +607,7 @@ struct snd_soc_codec_driver { | |||
| 607 | 607 | ||
| 608 | /* codec wide operations */ | 608 | /* codec wide operations */ |
| 609 | int (*set_sysclk)(struct snd_soc_codec *codec, | 609 | int (*set_sysclk)(struct snd_soc_codec *codec, |
| 610 | int clk_id, unsigned int freq, int dir); | 610 | int clk_id, int source, unsigned int freq, int dir); |
| 611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, | 611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, |
| 612 | unsigned int freq_in, unsigned int freq_out); | 612 | unsigned int freq_in, unsigned int freq_out); |
| 613 | 613 | ||
| @@ -619,7 +619,7 @@ struct snd_soc_codec_driver { | |||
| 619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
| 620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
| 621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | 621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); |
| 622 | short reg_cache_size; | 622 | unsigned int reg_cache_size; |
| 623 | short reg_cache_step; | 623 | short reg_cache_step; |
| 624 | short reg_word_size; | 624 | short reg_word_size; |
| 625 | const void *reg_cache_default; | 625 | const void *reg_cache_default; |
| @@ -630,10 +630,14 @@ struct snd_soc_codec_driver { | |||
| 630 | /* codec bias level */ | 630 | /* codec bias level */ |
| 631 | int (*set_bias_level)(struct snd_soc_codec *, | 631 | int (*set_bias_level)(struct snd_soc_codec *, |
| 632 | enum snd_soc_bias_level level); | 632 | enum snd_soc_bias_level level); |
| 633 | bool idle_bias_off; | ||
| 633 | 634 | ||
| 634 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 635 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
| 635 | enum snd_soc_dapm_type, int); | 636 | enum snd_soc_dapm_type, int); |
| 636 | 637 | ||
| 638 | /* codec stream completion event */ | ||
| 639 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
| 640 | |||
| 637 | /* probe ordering - for components with runtime dependencies */ | 641 | /* probe ordering - for components with runtime dependencies */ |
| 638 | int probe_order; | 642 | int probe_order; |
| 639 | int remove_order; | 643 | int remove_order; |
| @@ -669,6 +673,9 @@ struct snd_soc_platform_driver { | |||
| 669 | /* platform stream ops */ | 673 | /* platform stream ops */ |
| 670 | struct snd_pcm_ops *ops; | 674 | struct snd_pcm_ops *ops; |
| 671 | 675 | ||
| 676 | /* platform stream completion event */ | ||
| 677 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
| 678 | |||
| 672 | /* probe ordering - for components with runtime dependencies */ | 679 | /* probe ordering - for components with runtime dependencies */ |
| 673 | int probe_order; | 680 | int probe_order; |
| 674 | int remove_order; | 681 | int remove_order; |
| @@ -703,6 +710,8 @@ struct snd_soc_dai_link { | |||
| 703 | const char *cpu_dai_name; | 710 | const char *cpu_dai_name; |
| 704 | const char *codec_dai_name; | 711 | const char *codec_dai_name; |
| 705 | 712 | ||
| 713 | unsigned int dai_fmt; /* format to set on init */ | ||
| 714 | |||
| 706 | /* Keep DAI active over suspend */ | 715 | /* Keep DAI active over suspend */ |
| 707 | unsigned int ignore_suspend:1; | 716 | unsigned int ignore_suspend:1; |
| 708 | 717 | ||
| @@ -815,9 +824,11 @@ struct snd_soc_card { | |||
| 815 | struct list_head widgets; | 824 | struct list_head widgets; |
| 816 | struct list_head paths; | 825 | struct list_head paths; |
| 817 | struct list_head dapm_list; | 826 | struct list_head dapm_list; |
| 827 | struct list_head dapm_dirty; | ||
| 818 | 828 | ||
| 819 | /* Generic DAPM context for the card */ | 829 | /* Generic DAPM context for the card */ |
| 820 | struct snd_soc_dapm_context dapm; | 830 | struct snd_soc_dapm_context dapm; |
| 831 | struct snd_soc_dapm_stats dapm_stats; | ||
| 821 | 832 | ||
| 822 | #ifdef CONFIG_DEBUG_FS | 833 | #ifdef CONFIG_DEBUG_FS |
| 823 | struct dentry *debugfs_card_root; | 834 | struct dentry *debugfs_card_root; |
| @@ -840,8 +851,6 @@ struct snd_soc_pcm_runtime { | |||
| 840 | unsigned int complete:1; | 851 | unsigned int complete:1; |
| 841 | unsigned int dev_registered:1; | 852 | unsigned int dev_registered:1; |
| 842 | 853 | ||
| 843 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
| 844 | unsigned int rate; | ||
| 845 | long pmdown_time; | 854 | long pmdown_time; |
| 846 | 855 | ||
| 847 | /* runtime devices */ | 856 | /* runtime devices */ |
| @@ -936,6 +945,18 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
| 936 | INIT_LIST_HEAD(&card->dapm_list); | 945 | INIT_LIST_HEAD(&card->dapm_list); |
| 937 | } | 946 | } |
| 938 | 947 | ||
| 948 | static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) | ||
| 949 | { | ||
| 950 | if (mc->reg == mc->rreg && mc->shift == mc->rshift) | ||
| 951 | return 0; | ||
| 952 | /* | ||
| 953 | * mc->reg == mc->rreg && mc->shift != mc->rshift, or | ||
| 954 | * mc->reg != mc->rreg means that the control is | ||
| 955 | * stereo (bits in one register or in two registers) | ||
| 956 | */ | ||
| 957 | return 1; | ||
| 958 | } | ||
| 959 | |||
| 939 | int snd_soc_util_init(void); | 960 | int snd_soc_util_init(void); |
| 940 | void snd_soc_util_exit(void); | 961 | void snd_soc_util_exit(void); |
| 941 | 962 | ||
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index 89beccb57edd..4cc1093844c8 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h | |||
| @@ -23,13 +23,7 @@ | |||
| 23 | #ifndef TPA6130A2_PLAT_H | 23 | #ifndef TPA6130A2_PLAT_H |
| 24 | #define TPA6130A2_PLAT_H | 24 | #define TPA6130A2_PLAT_H |
| 25 | 25 | ||
| 26 | enum tpa_model { | ||
| 27 | TPA6130A2, | ||
| 28 | TPA6140A2, | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct tpa6130a2_platform_data { | 26 | struct tpa6130a2_platform_data { |
| 32 | enum tpa_model id; | ||
| 33 | int power_gpio; | 27 | int power_gpio; |
| 34 | }; | 28 | }; |
| 35 | 29 | ||
diff --git a/include/sound/wm1250-ev1.h b/include/sound/wm1250-ev1.h new file mode 100644 index 000000000000..7dff82834123 --- /dev/null +++ b/include/sound/wm1250-ev1.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm1250-ev1.h - Platform data for WM1250-EV1 | ||
| 3 | * | ||
| 4 | * Copyright 2011 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 version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_WM1250_EV1_H | ||
| 12 | #define __LINUX_SND_WM1250_EV1_H | ||
| 13 | |||
| 14 | #define WM1250_EV1_NUM_GPIOS 5 | ||
| 15 | |||
| 16 | #define WM1250_EV1_GPIO_CLK_ENA 0 | ||
| 17 | #define WM1250_EV1_GPIO_CLK_SEL0 1 | ||
| 18 | #define WM1250_EV1_GPIO_CLK_SEL1 2 | ||
| 19 | #define WM1250_EV1_GPIO_OSR 3 | ||
| 20 | #define WM1250_EV1_GPIO_MASTER 4 | ||
| 21 | |||
| 22 | |||
| 23 | struct wm1250_ev1_pdata { | ||
| 24 | int gpios[WM1250_EV1_NUM_GPIOS]; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif | ||
diff --git a/include/sound/wm5100.h b/include/sound/wm5100.h new file mode 100644 index 000000000000..617d0c4a159f --- /dev/null +++ b/include/sound/wm5100.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm5100.h -- Platform data for WM5100 | ||
| 3 | * | ||
| 4 | * Copyright 2011 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 version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_WM5100_H | ||
| 12 | #define __LINUX_SND_WM5100_H | ||
| 13 | |||
| 14 | enum wm5100_in_mode { | ||
| 15 | WM5100_IN_SE = 0, | ||
| 16 | WM5100_IN_DIFF = 1, | ||
| 17 | WM5100_IN_DMIC = 2, | ||
| 18 | }; | ||
| 19 | |||
| 20 | enum wm5100_dmic_sup { | ||
| 21 | WM5100_DMIC_SUP_MICVDD = 0, | ||
| 22 | WM5100_DMIC_SUP_MICBIAS1 = 1, | ||
| 23 | WM5100_DMIC_SUP_MICBIAS2 = 2, | ||
| 24 | WM5100_DMIC_SUP_MICBIAS3 = 3, | ||
| 25 | }; | ||
| 26 | |||
| 27 | enum wm5100_micdet_bias { | ||
| 28 | WM5100_MICDET_MICBIAS1 = 0, | ||
| 29 | WM5100_MICDET_MICBIAS2 = 1, | ||
| 30 | WM5100_MICDET_MICBIAS3 = 2, | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct wm5100_jack_mode { | ||
| 34 | enum wm5100_micdet_bias bias; | ||
| 35 | int hp_pol; | ||
| 36 | int micd_src; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #define WM5100_GPIO_SET 0x10000 | ||
| 40 | |||
| 41 | struct wm5100_pdata { | ||
| 42 | int reset; /** GPIO controlling /RESET, if any */ | ||
| 43 | int ldo_ena; /** GPIO controlling LODENA, if any */ | ||
| 44 | int hp_pol; /** GPIO controlling headset polarity, if any */ | ||
| 45 | int irq_flags; | ||
| 46 | int gpio_base; | ||
| 47 | |||
| 48 | struct wm5100_jack_mode jack_modes[2]; | ||
| 49 | |||
| 50 | /* Input pin mode selection */ | ||
| 51 | enum wm5100_in_mode in_mode[4]; | ||
| 52 | |||
| 53 | /* DMIC supply selection */ | ||
| 54 | enum wm5100_dmic_sup dmic_sup[4]; | ||
| 55 | |||
| 56 | int gpio_defaults[6]; | ||
| 57 | }; | ||
| 58 | |||
| 59 | #endif | ||
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 603f5a0f0365..ab26f8aa3c78 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
| @@ -216,6 +216,31 @@ DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, | |||
| 216 | 216 | ||
| 217 | ); | 217 | ); |
| 218 | 218 | ||
| 219 | TRACE_EVENT(snd_soc_dapm_walk_done, | ||
| 220 | |||
| 221 | TP_PROTO(struct snd_soc_card *card), | ||
| 222 | |||
| 223 | TP_ARGS(card), | ||
| 224 | |||
| 225 | TP_STRUCT__entry( | ||
| 226 | __string( name, card->name ) | ||
| 227 | __field( int, power_checks ) | ||
| 228 | __field( int, path_checks ) | ||
| 229 | __field( int, neighbour_checks ) | ||
| 230 | ), | ||
| 231 | |||
| 232 | TP_fast_assign( | ||
| 233 | __assign_str(name, card->name); | ||
| 234 | __entry->power_checks = card->dapm_stats.power_checks; | ||
| 235 | __entry->path_checks = card->dapm_stats.path_checks; | ||
| 236 | __entry->neighbour_checks = card->dapm_stats.neighbour_checks; | ||
| 237 | ), | ||
| 238 | |||
| 239 | TP_printk("%s: checks %d power, %d path, %d neighbour", | ||
| 240 | __get_str(name), (int)__entry->power_checks, | ||
| 241 | (int)__entry->path_checks, (int)__entry->neighbour_checks) | ||
| 242 | ); | ||
| 243 | |||
| 219 | TRACE_EVENT(snd_soc_jack_irq, | 244 | TRACE_EVENT(snd_soc_jack_irq, |
| 220 | 245 | ||
| 221 | TP_PROTO(const char *name), | 246 | TP_PROTO(const char *name), |
diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h new file mode 100644 index 000000000000..87ad567b4229 --- /dev/null +++ b/include/video/omap-panel-dvi.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | * Header for DVI output driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Instruments Inc | ||
| 5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License version 2 as published by | ||
| 9 | * the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along with | ||
| 17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __OMAP_PANEL_DVI_H | ||
| 21 | #define __OMAP_PANEL_DVI_H | ||
| 22 | |||
| 23 | struct omap_dss_device; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct panel_dvi_platform_data - panel driver configuration data | ||
| 27 | * @platform_enable: platform specific panel enable function | ||
| 28 | * @platform_disable: platform specific panel disable function | ||
| 29 | * @i2c_bus_num: i2c bus id for the panel | ||
| 30 | */ | ||
| 31 | struct panel_dvi_platform_data { | ||
| 32 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
| 33 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
| 34 | u16 i2c_bus_num; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #endif /* __OMAP_PANEL_DVI_H */ | ||
diff --git a/include/video/omap-panel-n8x0.h b/include/video/omap-panel-n8x0.h new file mode 100644 index 000000000000..50a1302e2cfd --- /dev/null +++ b/include/video/omap-panel-n8x0.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef __OMAP_PANEL_N8X0_H | ||
| 2 | #define __OMAP_PANEL_N8X0_H | ||
| 3 | |||
| 4 | struct omap_dss_device; | ||
| 5 | |||
| 6 | struct panel_n8x0_data { | ||
| 7 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
| 8 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
| 9 | int panel_reset; | ||
| 10 | int ctrl_pwrdown; | ||
| 11 | |||
| 12 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h index 921ae9327228..7dc71f9c13e6 100644 --- a/include/video/omap-panel-nokia-dsi.h +++ b/include/video/omap-panel-nokia-dsi.h | |||
| @@ -10,9 +10,7 @@ struct omap_dss_device; | |||
| 10 | * @ext_te_gpio: external TE GPIO | 10 | * @ext_te_gpio: external TE GPIO |
| 11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) | 11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) |
| 12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) | 12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) |
| 13 | * @max_backlight_level: maximum backlight level | 13 | * @use_dsi_backlight: true if panel uses DSI command to control backlight |
| 14 | * @set_backlight: pointer to backlight set function | ||
| 15 | * @get_backlight: pointer to backlight get function | ||
| 16 | */ | 14 | */ |
| 17 | struct nokia_dsi_panel_data { | 15 | struct nokia_dsi_panel_data { |
| 18 | const char *name; | 16 | const char *name; |
| @@ -25,9 +23,7 @@ struct nokia_dsi_panel_data { | |||
| 25 | unsigned esd_interval; | 23 | unsigned esd_interval; |
| 26 | unsigned ulps_timeout; | 24 | unsigned ulps_timeout; |
| 27 | 25 | ||
| 28 | int max_backlight_level; | 26 | bool use_dsi_backlight; |
| 29 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
| 30 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
| 31 | }; | 27 | }; |
| 32 | 28 | ||
| 33 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ | 29 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ |
diff --git a/include/video/omap-panel-picodlp.h b/include/video/omap-panel-picodlp.h new file mode 100644 index 000000000000..1c342ef6f3a1 --- /dev/null +++ b/include/video/omap-panel-picodlp.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 2 | * panel data for picodlp panel | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Mayuresh Janorkar <mayur@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | #ifndef __PANEL_PICODLP_H | ||
| 13 | #define __PANEL_PICODLP_H | ||
| 14 | /** | ||
| 15 | * struct : picodlp panel data | ||
| 16 | * picodlp_adapter_id: i2c_adapter number for picodlp | ||
| 17 | */ | ||
| 18 | struct picodlp_panel_data { | ||
| 19 | int picodlp_adapter_id; | ||
| 20 | int emu_done_gpio; | ||
| 21 | int pwrgood_gpio; | ||
| 22 | }; | ||
| 23 | #endif /* __PANEL_PICODLP_H */ | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3b55ef22f8db..b66ebb2032c6 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
| @@ -41,8 +41,13 @@ | |||
| 41 | #define DISPC_IRQ_WAKEUP (1 << 16) | 41 | #define DISPC_IRQ_WAKEUP (1 << 16) |
| 42 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) | 42 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) |
| 43 | #define DISPC_IRQ_VSYNC2 (1 << 18) | 43 | #define DISPC_IRQ_VSYNC2 (1 << 18) |
| 44 | #define DISPC_IRQ_VID3_END_WIN (1 << 19) | ||
| 45 | #define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1 << 20) | ||
| 44 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) | 46 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) |
| 45 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) | 47 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) |
| 48 | #define DISPC_IRQ_FRAMEDONEWB (1 << 23) | ||
| 49 | #define DISPC_IRQ_FRAMEDONETV (1 << 24) | ||
| 50 | #define DISPC_IRQ_WBBUFFEROVERFLOW (1 << 25) | ||
| 46 | 51 | ||
| 47 | struct omap_dss_device; | 52 | struct omap_dss_device; |
| 48 | struct omap_overlay_manager; | 53 | struct omap_overlay_manager; |
| @@ -60,7 +65,8 @@ enum omap_display_type { | |||
| 60 | enum omap_plane { | 65 | enum omap_plane { |
| 61 | OMAP_DSS_GFX = 0, | 66 | OMAP_DSS_GFX = 0, |
| 62 | OMAP_DSS_VIDEO1 = 1, | 67 | OMAP_DSS_VIDEO1 = 1, |
| 63 | OMAP_DSS_VIDEO2 = 2 | 68 | OMAP_DSS_VIDEO2 = 2, |
| 69 | OMAP_DSS_VIDEO3 = 3, | ||
| 64 | }; | 70 | }; |
| 65 | 71 | ||
| 66 | enum omap_channel { | 72 | enum omap_channel { |
| @@ -129,6 +135,18 @@ enum omap_dss_venc_type { | |||
| 129 | OMAP_DSS_VENC_TYPE_SVIDEO, | 135 | OMAP_DSS_VENC_TYPE_SVIDEO, |
| 130 | }; | 136 | }; |
| 131 | 137 | ||
| 138 | enum omap_dss_dsi_pixel_format { | ||
| 139 | OMAP_DSS_DSI_FMT_RGB888, | ||
| 140 | OMAP_DSS_DSI_FMT_RGB666, | ||
| 141 | OMAP_DSS_DSI_FMT_RGB666_PACKED, | ||
| 142 | OMAP_DSS_DSI_FMT_RGB565, | ||
| 143 | }; | ||
| 144 | |||
| 145 | enum omap_dss_dsi_mode { | ||
| 146 | OMAP_DSS_DSI_CMD_MODE = 0, | ||
| 147 | OMAP_DSS_DSI_VIDEO_MODE, | ||
| 148 | }; | ||
| 149 | |||
| 132 | enum omap_display_caps { | 150 | enum omap_display_caps { |
| 133 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, | 151 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, |
| 134 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, | 152 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, |
| @@ -162,11 +180,13 @@ enum omap_dss_rotation_angle { | |||
| 162 | 180 | ||
| 163 | enum omap_overlay_caps { | 181 | enum omap_overlay_caps { |
| 164 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, | 182 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, |
| 165 | OMAP_DSS_OVL_CAP_DISPC = 1 << 1, | 183 | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1, |
| 184 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2, | ||
| 185 | OMAP_DSS_OVL_CAP_ZORDER = 1 << 3, | ||
| 166 | }; | 186 | }; |
| 167 | 187 | ||
| 168 | enum omap_overlay_manager_caps { | 188 | enum omap_overlay_manager_caps { |
| 169 | OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, | 189 | OMAP_DSS_DUMMY_VALUE, /* add a dummy value to prevent compiler error */ |
| 170 | }; | 190 | }; |
| 171 | 191 | ||
| 172 | enum omap_dss_clk_source { | 192 | enum omap_dss_clk_source { |
| @@ -215,26 +235,67 @@ void rfbi_bus_lock(void); | |||
| 215 | void rfbi_bus_unlock(void); | 235 | void rfbi_bus_unlock(void); |
| 216 | 236 | ||
| 217 | /* DSI */ | 237 | /* DSI */ |
| 238 | |||
| 239 | struct omap_dss_dsi_videomode_data { | ||
| 240 | /* DSI video mode blanking data */ | ||
| 241 | /* Unit: byte clock cycles */ | ||
| 242 | u16 hsa; | ||
| 243 | u16 hfp; | ||
| 244 | u16 hbp; | ||
| 245 | /* Unit: line clocks */ | ||
| 246 | u16 vsa; | ||
| 247 | u16 vfp; | ||
| 248 | u16 vbp; | ||
| 249 | |||
| 250 | /* DSI blanking modes */ | ||
| 251 | int blanking_mode; | ||
| 252 | int hsa_blanking_mode; | ||
| 253 | int hbp_blanking_mode; | ||
| 254 | int hfp_blanking_mode; | ||
| 255 | |||
| 256 | /* Video port sync events */ | ||
| 257 | int vp_de_pol; | ||
| 258 | int vp_hsync_pol; | ||
| 259 | int vp_vsync_pol; | ||
| 260 | bool vp_vsync_end; | ||
| 261 | bool vp_hsync_end; | ||
| 262 | |||
| 263 | bool ddr_clk_always_on; | ||
| 264 | int window_sync; | ||
| 265 | }; | ||
| 266 | |||
| 218 | void dsi_bus_lock(struct omap_dss_device *dssdev); | 267 | void dsi_bus_lock(struct omap_dss_device *dssdev); |
| 219 | void dsi_bus_unlock(struct omap_dss_device *dssdev); | 268 | void dsi_bus_unlock(struct omap_dss_device *dssdev); |
| 220 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, | 269 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, |
| 221 | int len); | 270 | int len); |
| 222 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, | 271 | int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, |
| 223 | u8 dcs_cmd); | 272 | int len); |
| 273 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd); | ||
| 274 | int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel); | ||
| 224 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 275 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, |
| 225 | u8 param); | 276 | u8 param); |
| 277 | int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel, | ||
| 278 | u8 param); | ||
| 279 | int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel, | ||
| 280 | u8 param1, u8 param2); | ||
| 226 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, | 281 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, |
| 227 | u8 *data, int len); | 282 | u8 *data, int len); |
| 283 | int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, | ||
| 284 | u8 *data, int len); | ||
| 228 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 285 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, |
| 229 | u8 *buf, int buflen); | 286 | u8 *buf, int buflen); |
| 230 | int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 287 | int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf, |
| 231 | u8 *data); | 288 | int buflen); |
| 232 | int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 289 | int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param, |
| 233 | u8 *data1, u8 *data2); | 290 | u8 *buf, int buflen); |
| 291 | int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel, | ||
| 292 | u8 param1, u8 param2, u8 *buf, int buflen); | ||
| 234 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, | 293 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, |
| 235 | u16 len); | 294 | u16 len); |
| 236 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); | 295 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); |
| 237 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); | 296 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); |
| 297 | int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel); | ||
| 298 | void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel); | ||
| 238 | 299 | ||
| 239 | /* Board specific data */ | 300 | /* Board specific data */ |
| 240 | struct omap_dss_board_info { | 301 | struct omap_dss_board_info { |
| @@ -242,7 +303,8 @@ struct omap_dss_board_info { | |||
| 242 | int num_devices; | 303 | int num_devices; |
| 243 | struct omap_dss_device **devices; | 304 | struct omap_dss_device **devices; |
| 244 | struct omap_dss_device *default_device; | 305 | struct omap_dss_device *default_device; |
| 245 | void (*dsi_mux_pads)(bool enable); | 306 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); |
| 307 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); | ||
| 246 | }; | 308 | }; |
| 247 | 309 | ||
| 248 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | 310 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) |
| @@ -300,7 +362,6 @@ struct omap_overlay_info { | |||
| 300 | bool enabled; | 362 | bool enabled; |
| 301 | 363 | ||
| 302 | u32 paddr; | 364 | u32 paddr; |
| 303 | void __iomem *vaddr; | ||
| 304 | u32 p_uv_addr; /* for NV12 format */ | 365 | u32 p_uv_addr; /* for NV12 format */ |
| 305 | u16 screen_width; | 366 | u16 screen_width; |
| 306 | u16 width; | 367 | u16 width; |
| @@ -316,6 +377,7 @@ struct omap_overlay_info { | |||
| 316 | u16 out_height; /* if 0, out_height == height */ | 377 | u16 out_height; /* if 0, out_height == height */ |
| 317 | u8 global_alpha; | 378 | u8 global_alpha; |
| 318 | u8 pre_mult_alpha; | 379 | u8 pre_mult_alpha; |
| 380 | u8 zorder; | ||
| 319 | }; | 381 | }; |
| 320 | 382 | ||
| 321 | struct omap_overlay { | 383 | struct omap_overlay { |
| @@ -324,7 +386,7 @@ struct omap_overlay { | |||
| 324 | 386 | ||
| 325 | /* static fields */ | 387 | /* static fields */ |
| 326 | const char *name; | 388 | const char *name; |
| 327 | int id; | 389 | enum omap_plane id; |
| 328 | enum omap_color_mode supported_modes; | 390 | enum omap_color_mode supported_modes; |
| 329 | enum omap_overlay_caps caps; | 391 | enum omap_overlay_caps caps; |
| 330 | 392 | ||
| @@ -332,6 +394,7 @@ struct omap_overlay { | |||
| 332 | struct omap_overlay_manager *manager; | 394 | struct omap_overlay_manager *manager; |
| 333 | struct omap_overlay_info info; | 395 | struct omap_overlay_info info; |
| 334 | 396 | ||
| 397 | bool manager_changed; | ||
| 335 | /* if true, info has been changed, but not applied() yet */ | 398 | /* if true, info has been changed, but not applied() yet */ |
| 336 | bool info_dirty; | 399 | bool info_dirty; |
| 337 | 400 | ||
| @@ -354,7 +417,7 @@ struct omap_overlay_manager_info { | |||
| 354 | u32 trans_key; | 417 | u32 trans_key; |
| 355 | bool trans_enabled; | 418 | bool trans_enabled; |
| 356 | 419 | ||
| 357 | bool alpha_enabled; | 420 | bool partial_alpha_enabled; |
| 358 | 421 | ||
| 359 | bool cpr_enable; | 422 | bool cpr_enable; |
| 360 | struct omap_dss_cpr_coefs cpr_coefs; | 423 | struct omap_dss_cpr_coefs cpr_coefs; |
| @@ -366,7 +429,7 @@ struct omap_overlay_manager { | |||
| 366 | 429 | ||
| 367 | /* static fields */ | 430 | /* static fields */ |
| 368 | const char *name; | 431 | const char *name; |
| 369 | int id; | 432 | enum omap_channel id; |
| 370 | enum omap_overlay_manager_caps caps; | 433 | enum omap_overlay_manager_caps caps; |
| 371 | int num_overlays; | 434 | int num_overlays; |
| 372 | struct omap_overlay **overlays; | 435 | struct omap_overlay **overlays; |
| @@ -454,6 +517,7 @@ struct omap_dss_device { | |||
| 454 | } dispc; | 517 | } dispc; |
| 455 | 518 | ||
| 456 | struct { | 519 | struct { |
| 520 | /* regn is one greater than TRM's REGN value */ | ||
| 457 | u16 regn; | 521 | u16 regn; |
| 458 | u16 regm; | 522 | u16 regm; |
| 459 | u16 regm_dispc; | 523 | u16 regm_dispc; |
| @@ -464,6 +528,7 @@ struct omap_dss_device { | |||
| 464 | } dsi; | 528 | } dsi; |
| 465 | 529 | ||
| 466 | struct { | 530 | struct { |
| 531 | /* regn is one greater than TRM's REGN value */ | ||
| 467 | u16 regn; | 532 | u16 regn; |
| 468 | u16 regm2; | 533 | u16 regm2; |
| 469 | } hdmi; | 534 | } hdmi; |
| @@ -477,6 +542,10 @@ struct omap_dss_device { | |||
| 477 | int acb; /* ac-bias pin frequency */ | 542 | int acb; /* ac-bias pin frequency */ |
| 478 | 543 | ||
| 479 | enum omap_panel_config config; | 544 | enum omap_panel_config config; |
| 545 | |||
| 546 | enum omap_dss_dsi_pixel_format dsi_pix_fmt; | ||
| 547 | enum omap_dss_dsi_mode dsi_mode; | ||
| 548 | struct omap_dss_dsi_videomode_data dsi_vm_data; | ||
| 480 | } panel; | 549 | } panel; |
| 481 | 550 | ||
| 482 | struct { | 551 | struct { |
| @@ -557,6 +626,9 @@ struct omap_dss_driver { | |||
| 557 | 626 | ||
| 558 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); | 627 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); |
| 559 | u32 (*get_wss)(struct omap_dss_device *dssdev); | 628 | u32 (*get_wss)(struct omap_dss_device *dssdev); |
| 629 | |||
| 630 | int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); | ||
| 631 | bool (*detect)(struct omap_dss_device *dssdev); | ||
| 560 | }; | 632 | }; |
| 561 | 633 | ||
| 562 | int omap_dss_register_driver(struct omap_dss_driver *); | 634 | int omap_dss_register_driver(struct omap_dss_driver *); |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index d964e68fc61d..8101b726b48a 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
| @@ -4,26 +4,123 @@ | |||
| 4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
| 5 | #include <video/sh_mobile_meram.h> | 5 | #include <video/sh_mobile_meram.h> |
| 6 | 6 | ||
| 7 | /* Register definitions */ | ||
| 8 | #define _LDDCKR 0x410 | ||
| 9 | #define LDDCKR_ICKSEL_BUS (0 << 16) | ||
| 10 | #define LDDCKR_ICKSEL_MIPI (1 << 16) | ||
| 11 | #define LDDCKR_ICKSEL_HDMI (2 << 16) | ||
| 12 | #define LDDCKR_ICKSEL_EXT (3 << 16) | ||
| 13 | #define LDDCKR_ICKSEL_MASK (7 << 16) | ||
| 14 | #define LDDCKR_MOSEL (1 << 6) | ||
| 15 | #define _LDDCKSTPR 0x414 | ||
| 16 | #define _LDINTR 0x468 | ||
| 17 | #define LDINTR_FE (1 << 10) | ||
| 18 | #define LDINTR_VSE (1 << 9) | ||
| 19 | #define LDINTR_VEE (1 << 8) | ||
| 20 | #define LDINTR_FS (1 << 2) | ||
| 21 | #define LDINTR_VSS (1 << 1) | ||
| 22 | #define LDINTR_VES (1 << 0) | ||
| 23 | #define LDINTR_STATUS_MASK (0xff << 0) | ||
| 24 | #define _LDSR 0x46c | ||
| 25 | #define LDSR_MSS (1 << 10) | ||
| 26 | #define LDSR_MRS (1 << 8) | ||
| 27 | #define LDSR_AS (1 << 1) | ||
| 28 | #define _LDCNT1R 0x470 | ||
| 29 | #define LDCNT1R_DE (1 << 0) | ||
| 30 | #define _LDCNT2R 0x474 | ||
| 31 | #define LDCNT2R_BR (1 << 8) | ||
| 32 | #define LDCNT2R_MD (1 << 3) | ||
| 33 | #define LDCNT2R_SE (1 << 2) | ||
| 34 | #define LDCNT2R_ME (1 << 1) | ||
| 35 | #define LDCNT2R_DO (1 << 0) | ||
| 36 | #define _LDRCNTR 0x478 | ||
| 37 | #define LDRCNTR_SRS (1 << 17) | ||
| 38 | #define LDRCNTR_SRC (1 << 16) | ||
| 39 | #define LDRCNTR_MRS (1 << 1) | ||
| 40 | #define LDRCNTR_MRC (1 << 0) | ||
| 41 | #define _LDDDSR 0x47c | ||
| 42 | #define LDDDSR_LS (1 << 2) | ||
| 43 | #define LDDDSR_WS (1 << 1) | ||
| 44 | #define LDDDSR_BS (1 << 0) | ||
| 45 | |||
| 46 | #define LDMT1R_VPOL (1 << 28) | ||
| 47 | #define LDMT1R_HPOL (1 << 27) | ||
| 48 | #define LDMT1R_DWPOL (1 << 26) | ||
| 49 | #define LDMT1R_DIPOL (1 << 25) | ||
| 50 | #define LDMT1R_DAPOL (1 << 24) | ||
| 51 | #define LDMT1R_HSCNT (1 << 17) | ||
| 52 | #define LDMT1R_DWCNT (1 << 16) | ||
| 53 | #define LDMT1R_IFM (1 << 12) | ||
| 54 | #define LDMT1R_MIFTYP_RGB8 (0x0 << 0) | ||
| 55 | #define LDMT1R_MIFTYP_RGB9 (0x4 << 0) | ||
| 56 | #define LDMT1R_MIFTYP_RGB12A (0x5 << 0) | ||
| 57 | #define LDMT1R_MIFTYP_RGB12B (0x6 << 0) | ||
| 58 | #define LDMT1R_MIFTYP_RGB16 (0x7 << 0) | ||
| 59 | #define LDMT1R_MIFTYP_RGB18 (0xa << 0) | ||
| 60 | #define LDMT1R_MIFTYP_RGB24 (0xb << 0) | ||
| 61 | #define LDMT1R_MIFTYP_YCBCR (0xf << 0) | ||
| 62 | #define LDMT1R_MIFTYP_SYS8A (0x0 << 0) | ||
| 63 | #define LDMT1R_MIFTYP_SYS8B (0x1 << 0) | ||
| 64 | #define LDMT1R_MIFTYP_SYS8C (0x2 << 0) | ||
| 65 | #define LDMT1R_MIFTYP_SYS8D (0x3 << 0) | ||
| 66 | #define LDMT1R_MIFTYP_SYS9 (0x4 << 0) | ||
| 67 | #define LDMT1R_MIFTYP_SYS12 (0x5 << 0) | ||
| 68 | #define LDMT1R_MIFTYP_SYS16A (0x7 << 0) | ||
| 69 | #define LDMT1R_MIFTYP_SYS16B (0x8 << 0) | ||
| 70 | #define LDMT1R_MIFTYP_SYS16C (0x9 << 0) | ||
| 71 | #define LDMT1R_MIFTYP_SYS18 (0xa << 0) | ||
| 72 | #define LDMT1R_MIFTYP_SYS24 (0xb << 0) | ||
| 73 | #define LDMT1R_MIFTYP_MASK (0xf << 0) | ||
| 74 | |||
| 75 | #define LDDFR_CF1 (1 << 18) | ||
| 76 | #define LDDFR_CF0 (1 << 17) | ||
| 77 | #define LDDFR_CC (1 << 16) | ||
| 78 | #define LDDFR_YF_420 (0 << 8) | ||
| 79 | #define LDDFR_YF_422 (1 << 8) | ||
| 80 | #define LDDFR_YF_444 (2 << 8) | ||
| 81 | #define LDDFR_YF_MASK (3 << 8) | ||
| 82 | #define LDDFR_PKF_ARGB32 (0x00 << 0) | ||
| 83 | #define LDDFR_PKF_RGB16 (0x03 << 0) | ||
| 84 | #define LDDFR_PKF_RGB24 (0x0b << 0) | ||
| 85 | #define LDDFR_PKF_MASK (0x1f << 0) | ||
| 86 | |||
| 87 | #define LDSM1R_OS (1 << 0) | ||
| 88 | |||
| 89 | #define LDSM2R_OSTRG (1 << 0) | ||
| 90 | |||
| 91 | #define LDPMR_LPS (3 << 0) | ||
| 92 | |||
| 93 | #define _LDDWD0R 0x800 | ||
| 94 | #define LDDWDxR_WDACT (1 << 28) | ||
| 95 | #define LDDWDxR_RSW (1 << 24) | ||
| 96 | #define _LDDRDR 0x840 | ||
| 97 | #define LDDRDR_RSR (1 << 24) | ||
| 98 | #define LDDRDR_DRD_MASK (0x3ffff << 0) | ||
| 99 | #define _LDDWAR 0x900 | ||
| 100 | #define LDDWAR_WA (1 << 0) | ||
| 101 | #define _LDDRAR 0x904 | ||
| 102 | #define LDDRAR_RA (1 << 0) | ||
| 103 | |||
| 7 | enum { | 104 | enum { |
| 8 | RGB8, /* 24bpp, 8:8:8 */ | 105 | RGB8 = LDMT1R_MIFTYP_RGB8, /* 24bpp, 8:8:8 */ |
| 9 | RGB9, /* 18bpp, 9:9 */ | 106 | RGB9 = LDMT1R_MIFTYP_RGB9, /* 18bpp, 9:9 */ |
| 10 | RGB12A, /* 24bpp, 12:12 */ | 107 | RGB12A = LDMT1R_MIFTYP_RGB12A, /* 24bpp, 12:12 */ |
| 11 | RGB12B, /* 12bpp */ | 108 | RGB12B = LDMT1R_MIFTYP_RGB12B, /* 12bpp */ |
| 12 | RGB16, /* 16bpp */ | 109 | RGB16 = LDMT1R_MIFTYP_RGB16, /* 16bpp */ |
| 13 | RGB18, /* 18bpp */ | 110 | RGB18 = LDMT1R_MIFTYP_RGB18, /* 18bpp */ |
| 14 | RGB24, /* 24bpp */ | 111 | RGB24 = LDMT1R_MIFTYP_RGB24, /* 24bpp */ |
| 15 | YUV422, /* 16bpp */ | 112 | YUV422 = LDMT1R_MIFTYP_YCBCR, /* 16bpp */ |
| 16 | SYS8A, /* 24bpp, 8:8:8 */ | 113 | SYS8A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8A, /* 24bpp, 8:8:8 */ |
| 17 | SYS8B, /* 18bpp, 8:8:2 */ | 114 | SYS8B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8B, /* 18bpp, 8:8:2 */ |
| 18 | SYS8C, /* 18bpp, 2:8:8 */ | 115 | SYS8C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8C, /* 18bpp, 2:8:8 */ |
| 19 | SYS8D, /* 16bpp, 8:8 */ | 116 | SYS8D = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8D, /* 16bpp, 8:8 */ |
| 20 | SYS9, /* 18bpp, 9:9 */ | 117 | SYS9 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS9, /* 18bpp, 9:9 */ |
| 21 | SYS12, /* 24bpp, 12:12 */ | 118 | SYS12 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS12, /* 24bpp, 12:12 */ |
| 22 | SYS16A, /* 16bpp */ | 119 | SYS16A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16A, /* 16bpp */ |
| 23 | SYS16B, /* 18bpp, 16:2 */ | 120 | SYS16B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16B, /* 18bpp, 16:2 */ |
| 24 | SYS16C, /* 18bpp, 2:16 */ | 121 | SYS16C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16C, /* 18bpp, 2:16 */ |
| 25 | SYS18, /* 18bpp */ | 122 | SYS18 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS18, /* 18bpp */ |
| 26 | SYS24, /* 24bpp */ | 123 | SYS24 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS24, /* 24bpp */ |
| 27 | }; | 124 | }; |
| 28 | 125 | ||
| 29 | enum { LCDC_CHAN_DISABLED = 0, | 126 | enum { LCDC_CHAN_DISABLED = 0, |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h index 69d485a4a026..c41f308c9636 100644 --- a/include/video/udlfb.h +++ b/include/video/udlfb.h | |||
| @@ -50,6 +50,7 @@ struct dlfb_data { | |||
| 50 | int base16; | 50 | int base16; |
| 51 | int base8; | 51 | int base8; |
| 52 | u32 pseudo_palette[256]; | 52 | u32 pseudo_palette[256]; |
| 53 | int blank_mode; /*one of FB_BLANK_ */ | ||
| 53 | /* blit-only rendering path metrics, exposed through sysfs */ | 54 | /* blit-only rendering path metrics, exposed through sysfs */ |
| 54 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | 55 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ |
| 55 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | 56 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ |
