Pull soundwire updates from Vinod Koul: "This is a small update which features a bit of core changes and driver updates in Intel and cadence driver. Core: - sdw_transfer_defer() API change to drop an argument - Reset page address rework - Export sdw_nwrite_no_pm and sdw_nread_no_pm APIs Drivers: - Cadence and related intel driver updates for FIFO handling and low level msg transfers" * tag 'soundwire-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: cadence: further simplify low-level xfer_msg_defer() callback soundwire: cadence: use directly bus sdw_defer structure soundwire: bus: remove sdw_defer argument in sdw_transfer_defer() soundwire: stream: use consistent pattern for freeing buffers soundwire: bus: Remove unused reset_page_addr() callback soundwire: bus: Don't zero page registers after every transaction soundwire: bus_type: Avoid lockdep assert in sdw_drv_probe() soundwire: stream: Move remaining register accesses over to no_pm soundwire: debugfs: Switch to sdw_read_no_pm soundwire: Provide build stubs for common functions soundwire: bus: export sdw_nwrite_no_pm and sdw_nread_no_pm functions soundwire: cadence: remove unused sdw_cdns_master_ops declaration soundwire: enable optional clock registers for SoundWire 1.2 devices ASoC/soundwire: remove is_sdca boolean property soundwire: cadence: Drain the RX FIFO after an IO timeout soundwire: cadence: Remove wasted space in response_buf soundwire: cadence: Don't overflow the command FIFOs soundwire: intel: remove DAI startup/shutdown
Showing the changes to include (1 of 13 files). Show all
Unified · Split
| @@ -4,6 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | #ifndef __SOUNDWIRE_H |
| 5 | 5 | #define __SOUNDWIRE_H |
| 6 | 6 | |
| 7 | +#include <linux/bug.h> | |
| 7 | 8 | #include <linux/mod_devicetable.h> |
| 8 | 9 | #include <linux/bitfield.h> |
| 9 | 10 | |
| @@ -365,7 +366,9 @@ struct sdw_dpn_prop { · 355 unmodified lines | ||
| 365 | 366 | * @sink_dpn_prop: Sink Data Port N properties |
| 366 | 367 | * @scp_int1_mask: SCP_INT1_MASK desired settings |
| 367 | 368 | * @quirks: bitmask identifying deltas from the MIPI specification |
| 368 | − * @is_sdca: the Slave supports the SDCA specification | |
| 369 | + * @clock_reg_supported: the Peripheral implements the clock base and scale | |
| 370 | + * registers introduced with the SoundWire 1.2 specification. SDCA devices | |
| 371 | + * do not need to set this boolean property as the registers are required. | |
| 369 | 372 | */ |
| 370 | 373 | struct sdw_slave_prop { |
| 371 | 374 | u32 mipi_revision; |
| @@ -389,7 +392,7 @@ struct sdw_slave_prop { · 17 unmodified lines | ||
| 389 | 392 | struct sdw_dpn_prop *sink_dpn_prop; |
| 390 | 393 | u8 scp_int1_mask; |
| 391 | 394 | u32 quirks; |
| 392 | − bool is_sdca; | |
| 395 | + bool clock_reg_supported; | |
| 393 | 396 | }; |
| 394 | 397 | |
| 395 | 398 | #define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0) |
| @@ -836,8 +839,8 @@ struct sdw_defer { · 440 unmodified lines | ||
| 836 | 839 | * @read_prop: Read Master properties |
| 837 | 840 | * @override_adr: Override value read from firmware (quirk for buggy firmware) |
| 838 | 841 | * @xfer_msg: Transfer message callback |
| 839 | − * @xfer_msg_defer: Defer version of transfer message callback | |
| 840 | − * @reset_page_addr: Reset the SCP page address registers | |
| 842 | + * @xfer_msg_defer: Defer version of transfer message callback. The message is handled with the | |
| 843 | + * bus struct @sdw_defer | |
| 841 | 844 | * @set_bus_conf: Set the bus configuration |
| 842 | 845 | * @pre_bank_switch: Callback for pre bank switch |
| 843 | 846 | * @post_bank_switch: Callback for post bank switch |
| @@ -851,10 +854,7 @@ struct sdw_master_ops { · 7 unmodified lines | ||
| 851 | 854 | enum sdw_command_response (*xfer_msg) |
| 852 | 855 | (struct sdw_bus *bus, struct sdw_msg *msg); |
| 853 | 856 | enum sdw_command_response (*xfer_msg_defer) |
| 854 | − (struct sdw_bus *bus, struct sdw_msg *msg, | |
| 855 | − struct sdw_defer *defer); | |
| 856 | − enum sdw_command_response (*reset_page_addr) | |
| 857 | − (struct sdw_bus *bus, unsigned int dev_num); | |
| 857 | + (struct sdw_bus *bus); | |
| 858 | 858 | int (*set_bus_conf)(struct sdw_bus *bus, |
| 859 | 859 | struct sdw_bus_params *params); |
| 860 | 860 | int (*pre_bank_switch)(struct sdw_bus *bus); |
| @@ -1023,15 +1023,8 @@ int sdw_stream_add_master(struct sdw_bus *bus, · 162 unmodified lines | ||
| 1023 | 1023 | struct sdw_port_config *port_config, |
| 1024 | 1024 | unsigned int num_ports, |
| 1025 | 1025 | struct sdw_stream_runtime *stream); |
| 1026 | −int sdw_stream_add_slave(struct sdw_slave *slave, | |
| 1027 | − struct sdw_stream_config *stream_config, | |
| 1028 | − struct sdw_port_config *port_config, | |
| 1029 | − unsigned int num_ports, | |
| 1030 | − struct sdw_stream_runtime *stream); | |
| 1031 | 1026 | int sdw_stream_remove_master(struct sdw_bus *bus, |
| 1032 | 1027 | struct sdw_stream_runtime *stream); |
| 1033 | −int sdw_stream_remove_slave(struct sdw_slave *slave, | |
| 1034 | − struct sdw_stream_runtime *stream); | |
| 1035 | 1028 | int sdw_startup_stream(void *sdw_substream); |
| 1036 | 1029 | int sdw_prepare_stream(struct sdw_stream_runtime *stream); |
| 1037 | 1030 | int sdw_enable_stream(struct sdw_stream_runtime *stream); |
| @@ -1042,18 +1035,111 @@ int sdw_bus_prep_clk_stop(struct sdw_bus *bus); · 4 unmodified lines | ||
| 1042 | 1035 | int sdw_bus_clk_stop(struct sdw_bus *bus); |
| 1043 | 1036 | int sdw_bus_exit_clk_stop(struct sdw_bus *bus); |
| 1044 | 1037 | |
| 1045 | −/* messaging and data APIs */ | |
| 1038 | +int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id); | |
| 1039 | +void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id); | |
| 1046 | 1040 | |
| 1041 | +#if IS_ENABLED(CONFIG_SOUNDWIRE) | |
| 1042 | + | |
| 1043 | +int sdw_stream_add_slave(struct sdw_slave *slave, | |
| 1044 | + struct sdw_stream_config *stream_config, | |
| 1045 | + struct sdw_port_config *port_config, | |
| 1046 | + unsigned int num_ports, | |
| 1047 | + struct sdw_stream_runtime *stream); | |
| 1048 | +int sdw_stream_remove_slave(struct sdw_slave *slave, | |
| 1049 | + struct sdw_stream_runtime *stream); | |
| 1050 | + | |
| 1051 | +/* messaging and data APIs */ | |
| 1047 | 1052 | int sdw_read(struct sdw_slave *slave, u32 addr); |
| 1048 | 1053 | int sdw_write(struct sdw_slave *slave, u32 addr, u8 value); |
| 1049 | 1054 | int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value); |
| 1050 | 1055 | int sdw_read_no_pm(struct sdw_slave *slave, u32 addr); |
| 1051 | 1056 | int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); |
| 1057 | +int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); | |
| 1052 | 1058 | int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val); |
| 1059 | +int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val); | |
| 1053 | 1060 | int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val); |
| 1054 | 1061 | int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val); |
| 1055 | 1062 | |
| 1056 | −int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id); | |
| 1057 | −void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id); | |
| 1063 | +#else | |
| 1064 | + | |
| 1065 | +static inline int sdw_stream_add_slave(struct sdw_slave *slave, | |
| 1066 | + struct sdw_stream_config *stream_config, | |
| 1067 | + struct sdw_port_config *port_config, | |
| 1068 | + unsigned int num_ports, | |
| 1069 | + struct sdw_stream_runtime *stream) | |
| 1070 | +{ | |
| 1071 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1072 | + return -EINVAL; | |
| 1073 | +} | |
| 1074 | + | |
| 1075 | +static inline int sdw_stream_remove_slave(struct sdw_slave *slave, | |
| 1076 | + struct sdw_stream_runtime *stream) | |
| 1077 | +{ | |
| 1078 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1079 | + return -EINVAL; | |
| 1080 | +} | |
| 1081 | + | |
| 1082 | +/* messaging and data APIs */ | |
| 1083 | +static inline int sdw_read(struct sdw_slave *slave, u32 addr) | |
| 1084 | +{ | |
| 1085 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1086 | + return -EINVAL; | |
| 1087 | +} | |
| 1088 | + | |
| 1089 | +static inline int sdw_write(struct sdw_slave *slave, u32 addr, u8 value) | |
| 1090 | +{ | |
| 1091 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1092 | + return -EINVAL; | |
| 1093 | +} | |
| 1094 | + | |
| 1095 | +static inline int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value) | |
| 1096 | +{ | |
| 1097 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1098 | + return -EINVAL; | |
| 1099 | +} | |
| 1100 | + | |
| 1101 | +static inline int sdw_read_no_pm(struct sdw_slave *slave, u32 addr) | |
| 1102 | +{ | |
| 1103 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1104 | + return -EINVAL; | |
| 1105 | +} | |
| 1106 | + | |
| 1107 | +static inline int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) | |
| 1108 | +{ | |
| 1109 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1110 | + return -EINVAL; | |
| 1111 | +} | |
| 1112 | + | |
| 1113 | +static inline int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) | |
| 1114 | +{ | |
| 1115 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1116 | + return -EINVAL; | |
| 1117 | +} | |
| 1118 | + | |
| 1119 | +static inline int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) | |
| 1120 | +{ | |
| 1121 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1122 | + return -EINVAL; | |
| 1123 | +} | |
| 1124 | + | |
| 1125 | +static inline int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) | |
| 1126 | +{ | |
| 1127 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1128 | + return -EINVAL; | |
| 1129 | +} | |
| 1130 | + | |
| 1131 | +static inline int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) | |
| 1132 | +{ | |
| 1133 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1134 | + return -EINVAL; | |
| 1135 | +} | |
| 1136 | + | |
| 1137 | +static inline int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) | |
| 1138 | +{ | |
| 1139 | + WARN_ONCE(1, "SoundWire API is disabled"); | |
| 1140 | + return -EINVAL; | |
| 1141 | +} | |
| 1142 | + | |
| 1143 | +#endif /* CONFIG_SOUNDWIRE */ | |
| 1058 | 1144 | |
| 1059 | 1145 | #endif /* __SOUNDWIRE_H */ |