History

Merge tag 'soundwire-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next

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

Greg Kroah-Hartman committed 7 years ago

Commit 2f4281f2 parents 996cdfa 2aeac9510 files · +162 −64Browse files

Showing the changes to include/linux (2 of 10 files). Show all

Unified · Split

2 files
  1. include/linux/soundwire/sdw.h +69 −19
  2. include/linux/soundwire/sdw_type.h +11 −0
include/linux/soundwire/sdw.h+69−19
@@ -41,6 +41,31 @@ struct sdw_slave; · 40 unmodified lines
4141 #define SDW_DAI_ID_RANGE_START 100
4242 #define SDW_DAI_ID_RANGE_END 200
4343
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+
4469 /**
4570 * enum sdw_slave_status - Slave status
4671 * @SDW_SLAVE_UNATTACHED: Slave is not attached with the bus.
@@ -76,6 +101,14 @@ enum sdw_command_response { · 29 unmodified lines
76101 SDW_CMD_FAIL_OTHER = 4,
77102 };
78103
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+
79112 /**
80113 * enum sdw_stream_type: data stream type
81114 *
@@ -100,6 +133,26 @@ enum sdw_data_direction { · 18 unmodified lines
100133 SDW_DATA_DIR_TX = 1,
101134 };
102135
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+
103156 /*
104157 * SDW properties, defined in MIPI DisCo spec v1.0
105158 */
@@ -153,10 +206,11 @@ enum sdw_clk_stop_mode { · 47 unmodified lines
153206 * (inclusive)
154207 * @num_words: number of wordlengths supported
155208 * @words: wordlengths supported
156− * @flow_controlled: Slave implementation results in an OK_NotReady
209+ * @BRA_flow_controlled: Slave implementation results in an OK_NotReady
157210 * response
158211 * @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
160214 *
161215 * The wordlengths are specified by Spec as max, min AND number of
162216 * discrete values, implementation can define based on the wordlengths they
@@ -167,9 +221,9 @@ struct sdw_dp0_prop { · 4 unmodified lines
167221 u32 min_word;
168222 u32 num_words;
169223 u32 *words;
170− bool flow_controlled;
224+ bool BRA_flow_controlled;
171225 bool simple_ch_prep_sm;
172− bool device_interrupts;
226+ bool imp_def_interrupts;
173227 };
174228
175229 /**
@@ -219,7 +273,7 @@ struct sdw_dpn_audio_mode { · 43 unmodified lines
219273 * @simple_ch_prep_sm: If the port supports simplified channel prepare state
220274 * machine
221275 * @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
223277 * implementation-defined interrupts
224278 * @max_ch: Maximum channels supported
225279 * @min_ch: Minimum channels supported
@@ -244,7 +298,7 @@ struct sdw_dpn_prop { · 18 unmodified lines
244298 u32 max_grouping;
245299 bool simple_ch_prep_sm;
246300 u32 ch_prep_timeout;
247− u32 device_interrupts;
301+ u32 imp_def_interrupts;
248302 u32 max_ch;
249303 u32 min_ch;
250304 u32 num_ch;
@@ -311,36 +365,32 @@ struct sdw_slave_prop { · 60 unmodified lines
311365 /**
312366 * struct sdw_master_prop - Master properties
313367 * @revision: MIPI spec version of the implementation
314− * @master_count: Number of masters
315− * @clk_stop_mode: Bitmap for Clock Stop modes supported
316− * @max_freq: Maximum Bus clock frequency, in Hz
368+ * @clk_stop_modes: Bitmap, bit N set when clock-stop-modeN supported
369+ * @max_clk_freq: Maximum Bus clock frequency, in Hz
317370 * @num_clk_gears: Number of clock gears supported
318371 * @clk_gears: Clock gears supported
319− * @num_freq: Number of clock frequencies supported, in Hz
320− * @freq: Clock frequencies supported, in Hz
372+ * @num_clk_freq: Number of clock frequencies supported, in Hz
373+ * @clk_freq: Clock frequencies supported, in Hz
321374 * @default_frame_rate: Controller default Frame rate, in Hz
322375 * @default_row: Number of rows
323376 * @default_col: Number of columns
324− * @dynamic_frame: Dynamic frame supported
377+ * @dynamic_frame: Dynamic frame shape supported
325378 * @err_threshold: Number of times that software may retry sending a single
326379 * command
327− * @dpn_prop: Data Port N properties
328380 */
329381 struct sdw_master_prop {
330382 u32 revision;
331− u32 master_count;
332− enum sdw_clk_stop_mode clk_stop_mode;
333− u32 max_freq;
383+ u32 clk_stop_modes;
384+ u32 max_clk_freq;
334385 u32 num_clk_gears;
335386 u32 *clk_gears;
336− u32 num_freq;
337− u32 *freq;
387+ u32 num_clk_freq;
388+ u32 *clk_freq;
338389 u32 default_frame_rate;
339390 u32 default_row;
340391 u32 default_col;
341392 bool dynamic_frame;
342393 u32 err_threshold;
343− struct sdw_dpn_prop *dpn_prop;
344394 };
345395
346396 int sdw_master_read_prop(struct sdw_bus *bus);
include/linux/soundwire/sdw_type.h+11−0
@@ -16,4 +16,15 @@ void sdw_unregister_driver(struct sdw_driver *drv); · 15 unmodified lines
1616
1717 int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
1818
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)
1930 #endif /* __SOUNDWIRE_TYPES_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t