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
@@ -1023,15 +1024,8 @@ int sdw_stream_add_master(struct sdw_bus *bus,
1023
1024
struct sdw_port_config * port_config ,
1024
1025
unsigned int num_ports ,
1025
1026
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
1027
int sdw_stream_remove_master (struct sdw_bus * bus ,
1032
1028
struct sdw_stream_runtime * stream );
1033
- int sdw_stream_remove_slave (struct sdw_slave * slave ,
1034
- struct sdw_stream_runtime * stream );
1035
1029
int sdw_startup_stream (void * sdw_substream );
1036
1030
int sdw_prepare_stream (struct sdw_stream_runtime * stream );
1037
1031
int sdw_enable_stream (struct sdw_stream_runtime * stream );
@@ -1042,8 +1036,20 @@ int sdw_bus_prep_clk_stop(struct sdw_bus *bus);
1042
1036
int sdw_bus_clk_stop (struct sdw_bus * bus );
1043
1037
int sdw_bus_exit_clk_stop (struct sdw_bus * bus );
1044
1038
1045
- /* messaging and data APIs */
1039
+ int sdw_compare_devid (struct sdw_slave * slave , struct sdw_slave_id id );
1040
+ void sdw_extract_slave_id (struct sdw_bus * bus , u64 addr , struct sdw_slave_id * id );
1046
1041
1042
+ #if IS_ENABLED (CONFIG_SOUNDWIRE )
1043
+
1044
+ int sdw_stream_add_slave (struct sdw_slave * slave ,
1045
+ struct sdw_stream_config * stream_config ,
1046
+ struct sdw_port_config * port_config ,
1047
+ unsigned int num_ports ,
1048
+ struct sdw_stream_runtime * stream );
1049
+ int sdw_stream_remove_slave (struct sdw_slave * slave ,
1050
+ struct sdw_stream_runtime * stream );
1051
+
1052
+ /* messaging and data APIs */
1047
1053
int sdw_read (struct sdw_slave * slave , u32 addr );
1048
1054
int sdw_write (struct sdw_slave * slave , u32 addr , u8 value );
1049
1055
int sdw_write_no_pm (struct sdw_slave * slave , u32 addr , u8 value );
@@ -1055,7 +1061,86 @@ int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *
1055
1061
int sdw_update (struct sdw_slave * slave , u32 addr , u8 mask , u8 val );
1056
1062
int sdw_update_no_pm (struct sdw_slave * slave , u32 addr , u8 mask , u8 val );
1057
1063
1058
- int sdw_compare_devid (struct sdw_slave * slave , struct sdw_slave_id id );
1059
- void sdw_extract_slave_id (struct sdw_bus * bus , u64 addr , struct sdw_slave_id * id );
1064
+ #else
1065
+
1066
+ static inline int sdw_stream_add_slave (struct sdw_slave * slave ,
1067
+ struct sdw_stream_config * stream_config ,
1068
+ struct sdw_port_config * port_config ,
1069
+ unsigned int num_ports ,
1070
+ struct sdw_stream_runtime * stream )
1071
+ {
1072
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1073
+ return - EINVAL ;
1074
+ }
1075
+
1076
+ static inline int sdw_stream_remove_slave (struct sdw_slave * slave ,
1077
+ struct sdw_stream_runtime * stream )
1078
+ {
1079
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1080
+ return - EINVAL ;
1081
+ }
1082
+
1083
+ /* messaging and data APIs */
1084
+ static inline int sdw_read (struct sdw_slave * slave , u32 addr )
1085
+ {
1086
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1087
+ return - EINVAL ;
1088
+ }
1089
+
1090
+ static inline int sdw_write (struct sdw_slave * slave , u32 addr , u8 value )
1091
+ {
1092
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1093
+ return - EINVAL ;
1094
+ }
1095
+
1096
+ static inline int sdw_write_no_pm (struct sdw_slave * slave , u32 addr , u8 value )
1097
+ {
1098
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1099
+ return - EINVAL ;
1100
+ }
1101
+
1102
+ static inline int sdw_read_no_pm (struct sdw_slave * slave , u32 addr )
1103
+ {
1104
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1105
+ return - EINVAL ;
1106
+ }
1107
+
1108
+ static inline int sdw_nread (struct sdw_slave * slave , u32 addr , size_t count , u8 * val )
1109
+ {
1110
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1111
+ return - EINVAL ;
1112
+ }
1113
+
1114
+ static inline int sdw_nread_no_pm (struct sdw_slave * slave , u32 addr , size_t count , u8 * val )
1115
+ {
1116
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1117
+ return - EINVAL ;
1118
+ }
1119
+
1120
+ static inline int sdw_nwrite (struct sdw_slave * slave , u32 addr , size_t count , const u8 * val )
1121
+ {
1122
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1123
+ return - EINVAL ;
1124
+ }
1125
+
1126
+ static inline int sdw_nwrite_no_pm (struct sdw_slave * slave , u32 addr , size_t count , const u8 * val )
1127
+ {
1128
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1129
+ return - EINVAL ;
1130
+ }
1131
+
1132
+ static inline int sdw_update (struct sdw_slave * slave , u32 addr , u8 mask , u8 val )
1133
+ {
1134
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1135
+ return - EINVAL ;
1136
+ }
1137
+
1138
+ static inline int sdw_update_no_pm (struct sdw_slave * slave , u32 addr , u8 mask , u8 val )
1139
+ {
1140
+ WARN_ONCE (1 , "SoundWire API is disabled" );
1141
+ return - EINVAL ;
1142
+ }
1143
+
1144
+ #endif /* CONFIG_SOUNDWIRE */
1060
1145
1061
1146
#endif /* __SOUNDWIRE_H */
0 commit comments