Vinod writes: soundwire updates for v5.3-rc1 Updates for 5.3 include: - module_sdw_driver macro for drivers - Documentation updates for code-blocks - Improvement from Pierre on intel and cadence driver - Clarification of DisCo properties and updates * tag 'soundwire-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: add module_sdw_driver helper macro docs: soundwire: locking: fix tags for a code-block soundwire: intel_init: add checks on link numbers soundwire: fix typo in comments soundwire: Intel: add log for number of PCM and PDM PDIs soundwire: cadence_master: check the number of bidir PDIs soundwire: cadence_master: log Slave status mask on errors soundwire: cadence_master: use rate_limited dynamic debug soundwire: rename/clarify MIPI DisCo properties soundwire: clarify comment soundwire: mipi-disco: fix clock stop modes soundwire: rename 'freq' fields soundwire: mipi-disco: remove master_count property for masters soundwire: remove master data port properties soundwire: add port-related definitions soundwire: mipi_disco: fix master/link error soundwire: intel: filter SoundWire controller device search soundwire: cdns: Fix compilation error on arm64
Showing the changes to include/linux (2 of 10 files). Show all
Unified · Split
| @@ -41,6 +41,31 @@ struct sdw_slave; · 40 unmodified lines | |||
| 41 | #define SDW_DAI_ID_RANGE_START 100 | 41 | #define SDW_DAI_ID_RANGE_START 100 |
| 42 | #define SDW_DAI_ID_RANGE_END 200 | 42 | #define SDW_DAI_ID_RANGE_END 200 |
| 43 | 43 | ||
| 44 | enum { | ||
| 45 | SDW_PORT_DIRN_SINK = 0, | ||
| 46 | SDW_PORT_DIRN_SOURCE, | ||
| 47 | SDW_PORT_DIRN_MAX, | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* | ||
| 51 | * constants for flow control, ports and transport | ||
| 52 | * | ||
| 53 | * these are bit masks as devices can have multiple capabilities | ||
| 54 | */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * flow modes for SDW port. These can be isochronous, tx controlled, | ||
| 58 | * rx controlled or async | ||
| 59 | */ | ||
| 60 | #define SDW_PORT_FLOW_MODE_ISOCH 0 | ||
| 61 | #define SDW_PORT_FLOW_MODE_TX_CNTRL BIT(0) | ||
| 62 | #define SDW_PORT_FLOW_MODE_RX_CNTRL BIT(1) | ||
| 63 | #define SDW_PORT_FLOW_MODE_ASYNC GENMASK(1, 0) | ||
| 64 | |||
| 65 | /* sample packaging for block. It can be per port or per channel */ | ||
| 66 | #define SDW_BLOCK_PACKG_PER_PORT BIT(0) | ||
| 67 | #define SDW_BLOCK_PACKG_PER_CH BIT(1) | ||
| 68 | |||
| 44 | /** | 69 | /** |
| 45 | * enum sdw_slave_status - Slave status | 70 | * enum sdw_slave_status - Slave status |
| 46 | * @SDW_SLAVE_UNATTACHED: Slave is not attached with the bus. | 71 | * @SDW_SLAVE_UNATTACHED: Slave is not attached with the bus. |
| @@ -76,6 +101,14 @@ enum sdw_command_response { · 29 unmodified lines | |||
| 76 | SDW_CMD_FAIL_OTHER = 4, | 101 | SDW_CMD_FAIL_OTHER = 4, |
| 77 | }; | 102 | }; |
| 78 | 103 | ||
| 104 | /* block group count enum */ | ||
| 105 | enum sdw_dpn_grouping { | ||
| 106 | SDW_BLK_GRP_CNT_1 = 0, | ||
| 107 | SDW_BLK_GRP_CNT_2 = 1, | ||
| 108 | SDW_BLK_GRP_CNT_3 = 2, | ||
| 109 | SDW_BLK_GRP_CNT_4 = 3, | ||
| 110 | }; | ||
| 111 | |||
| 79 | /** | 112 | /** |
| 80 | * enum sdw_stream_type: data stream type | 113 | * enum sdw_stream_type: data stream type |
| 81 | * | 114 | * |
| @@ -100,6 +133,26 @@ enum sdw_data_direction { · 18 unmodified lines | |||
| 100 | SDW_DATA_DIR_TX = 1, | 133 | SDW_DATA_DIR_TX = 1, |
| 101 | }; | 134 | }; |
| 102 | 135 | ||
| 136 | /** | ||
| 137 | * enum sdw_port_data_mode: Data Port mode | ||
| 138 | * | ||
| 139 | * @SDW_PORT_DATA_MODE_NORMAL: Normal data mode where audio data is received | ||
| 140 | * and transmitted. | ||
| 141 | * @SDW_PORT_DATA_MODE_STATIC_1: Simple test mode which uses static value of | ||
| 142 | * logic 1. The encoding will result in signal transitions at every bitslot | ||
| 143 | * owned by this Port | ||
| 144 | * @SDW_PORT_DATA_MODE_STATIC_0: Simple test mode which uses static value of | ||
| 145 | * logic 0. The encoding will result in no signal transitions | ||
| 146 | * @SDW_PORT_DATA_MODE_PRBS: Test mode which uses a PRBS generator to produce | ||
| 147 | * a pseudo random data pattern that is transferred | ||
| 148 | */ | ||
| 149 | enum sdw_port_data_mode { | ||
| 150 | SDW_PORT_DATA_MODE_NORMAL = 0, | ||
| 151 | SDW_PORT_DATA_MODE_STATIC_1 = 1, | ||
| 152 | SDW_PORT_DATA_MODE_STATIC_0 = 2, | ||
| 153 | SDW_PORT_DATA_MODE_PRBS = 3, | ||
| 154 | }; | ||
| 155 | |||
| 103 | /* | 156 | /* |
| 104 | * SDW properties, defined in MIPI DisCo spec v1.0 | 157 | * SDW properties, defined in MIPI DisCo spec v1.0 |
| 105 | */ | 158 | */ |
| @@ -153,10 +206,11 @@ enum sdw_clk_stop_mode { · 47 unmodified lines | |||
| 153 | * (inclusive) | 206 | * (inclusive) |
| 154 | * @num_words: number of wordlengths supported | 207 | * @num_words: number of wordlengths supported |
| 155 | * @words: wordlengths supported | 208 | * @words: wordlengths supported |
| 156 | * @flow_controlled: Slave implementation results in an OK_NotReady | 209 | * @BRA_flow_controlled: Slave implementation results in an OK_NotReady |
| 157 | * response | 210 | * response |
| 158 | * @simple_ch_prep_sm: If channel prepare sequence is required | 211 | * @simple_ch_prep_sm: If channel prepare sequence is required |
| 159 | * @device_interrupts: If implementation-defined interrupts are supported | 212 | * @imp_def_interrupts: If set, each bit corresponds to support for |
| 213 | * implementation-defined interrupts | ||
| 160 | * | 214 | * |
| 161 | * The wordlengths are specified by Spec as max, min AND number of | 215 | * The wordlengths are specified by Spec as max, min AND number of |
| 162 | * discrete values, implementation can define based on the wordlengths they | 216 | * discrete values, implementation can define based on the wordlengths they |
| @@ -167,9 +221,9 @@ struct sdw_dp0_prop { · 4 unmodified lines | |||
| 167 | u32 min_word; | 221 | u32 min_word; |
| 168 | u32 num_words; | 222 | u32 num_words; |
| 169 | u32 *words; | 223 | u32 *words; |
| 170 | bool flow_controlled; | 224 | bool BRA_flow_controlled; |
| 171 | bool simple_ch_prep_sm; | 225 | bool simple_ch_prep_sm; |
| 172 | bool device_interrupts; | 226 | bool imp_def_interrupts; |
| 173 | }; | 227 | }; |
| 174 | 228 | ||
| 175 | /** | 229 | /** |
| @@ -219,7 +273,7 @@ struct sdw_dpn_audio_mode { · 43 unmodified lines | |||
| 219 | * @simple_ch_prep_sm: If the port supports simplified channel prepare state | 273 | * @simple_ch_prep_sm: If the port supports simplified channel prepare state |
| 220 | * machine | 274 | * machine |
| 221 | * @ch_prep_timeout: Port-specific timeout value, in milliseconds | 275 | * @ch_prep_timeout: Port-specific timeout value, in milliseconds |
| 222 | * @device_interrupts: If set, each bit corresponds to support for | 276 | * @imp_def_interrupts: If set, each bit corresponds to support for |
| 223 | * implementation-defined interrupts | 277 | * implementation-defined interrupts |
| 224 | * @max_ch: Maximum channels supported | 278 | * @max_ch: Maximum channels supported |
| 225 | * @min_ch: Minimum channels supported | 279 | * @min_ch: Minimum channels supported |
| @@ -244,7 +298,7 @@ struct sdw_dpn_prop { · 18 unmodified lines | |||
| 244 | u32 max_grouping; | 298 | u32 max_grouping; |
| 245 | bool simple_ch_prep_sm; | 299 | bool simple_ch_prep_sm; |
| 246 | u32 ch_prep_timeout; | 300 | u32 ch_prep_timeout; |
| 247 | u32 device_interrupts; | 301 | u32 imp_def_interrupts; |
| 248 | u32 max_ch; | 302 | u32 max_ch; |
| 249 | u32 min_ch; | 303 | u32 min_ch; |
| 250 | u32 num_ch; | 304 | u32 num_ch; |
| @@ -311,36 +365,32 @@ struct sdw_slave_prop { · 60 unmodified lines | |||
| 311 | /** | 365 | /** |
| 312 | * struct sdw_master_prop - Master properties | 366 | * struct sdw_master_prop - Master properties |
| 313 | * @revision: MIPI spec version of the implementation | 367 | * @revision: MIPI spec version of the implementation |
| 314 | * @master_count: Number of masters | 368 | * @clk_stop_modes: Bitmap, bit N set when clock-stop-modeN supported |
| 315 | * @clk_stop_mode: Bitmap for Clock Stop modes supported | 369 | * @max_clk_freq: Maximum Bus clock frequency, in Hz |
| 316 | * @max_freq: Maximum Bus clock frequency, in Hz | ||
| 317 | * @num_clk_gears: Number of clock gears supported | 370 | * @num_clk_gears: Number of clock gears supported |
| 318 | * @clk_gears: Clock gears supported | 371 | * @clk_gears: Clock gears supported |
| 319 | * @num_freq: Number of clock frequencies supported, in Hz | 372 | * @num_clk_freq: Number of clock frequencies supported, in Hz |
| 320 | * @freq: Clock frequencies supported, in Hz | 373 | * @clk_freq: Clock frequencies supported, in Hz |
| 321 | * @default_frame_rate: Controller default Frame rate, in Hz | 374 | * @default_frame_rate: Controller default Frame rate, in Hz |
| 322 | * @default_row: Number of rows | 375 | * @default_row: Number of rows |
| 323 | * @default_col: Number of columns | 376 | * @default_col: Number of columns |
| 324 | * @dynamic_frame: Dynamic frame supported | 377 | * @dynamic_frame: Dynamic frame shape supported |
| 325 | * @err_threshold: Number of times that software may retry sending a single | 378 | * @err_threshold: Number of times that software may retry sending a single |
| 326 | * command | 379 | * command |
| 327 | * @dpn_prop: Data Port N properties | ||
| 328 | */ | 380 | */ |
| 329 | struct sdw_master_prop { | 381 | struct sdw_master_prop { |
| 330 | u32 revision; | 382 | u32 revision; |
| 331 | u32 master_count; | 383 | u32 clk_stop_modes; |
| 332 | enum sdw_clk_stop_mode clk_stop_mode; | 384 | u32 max_clk_freq; |
| 333 | u32 max_freq; | ||
| 334 | u32 num_clk_gears; | 385 | u32 num_clk_gears; |
| 335 | u32 *clk_gears; | 386 | u32 *clk_gears; |
| 336 | u32 num_freq; | 387 | u32 num_clk_freq; |
| 337 | u32 *freq; | 388 | u32 *clk_freq; |
| 338 | u32 default_frame_rate; | 389 | u32 default_frame_rate; |
| 339 | u32 default_row; | 390 | u32 default_row; |
| 340 | u32 default_col; | 391 | u32 default_col; |
| 341 | bool dynamic_frame; | 392 | bool dynamic_frame; |
| 342 | u32 err_threshold; | 393 | u32 err_threshold; |
| 343 | struct sdw_dpn_prop *dpn_prop; | ||
| 344 | }; | 394 | }; |
| 345 | 395 | ||
| 346 | int sdw_master_read_prop(struct sdw_bus *bus); | 396 | int sdw_master_read_prop(struct sdw_bus *bus); |
| @@ -16,4 +16,15 @@ void sdw_unregister_driver(struct sdw_driver *drv); · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); | 17 | int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); |
| 18 | 18 | ||
| 19 | /** | ||
| 20 | * module_sdw_driver() - Helper macro for registering a Soundwire driver | ||
| 21 | * @__sdw_driver: soundwire slave driver struct | ||
| 22 | * | ||
| 23 | * Helper macro for Soundwire drivers which do not do anything special in | ||
| 24 | * module init/exit. This eliminates a lot of boilerplate. Each module may only | ||
| 25 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
| 26 | */ | ||
| 27 | #define module_sdw_driver(__sdw_driver) \ | ||
| 28 | module_driver(__sdw_driver, sdw_register_driver, \ | ||
| 29 | sdw_unregister_driver) | ||
| 19 | #endif /* __SOUNDWIRE_TYPES_H */ | 30 | #endif /* __SOUNDWIRE_TYPES_H */ |