File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,16 +39,24 @@ struct sdca_device_data {
3939 struct sdca_function_desc sdca_func [SDCA_MAX_FUNCTION_COUNT ];
4040};
4141
42+ enum sdca_quirk {
43+ SDCA_QUIRKS_RT712_VB ,
44+ };
45+
4246#if IS_ENABLED (CONFIG_ACPI ) && IS_ENABLED (CONFIG_SND_SOC_SDCA )
4347
4448void sdca_lookup_functions (struct sdw_slave * slave );
4549void sdca_lookup_interface_revision (struct sdw_slave * slave );
50+ bool sdca_device_quirk_match (struct sdw_slave * slave , enum sdca_quirk quirk );
4651
4752#else
4853
4954static inline void sdca_lookup_functions (struct sdw_slave * slave ) {}
5055static inline void sdca_lookup_interface_revision (struct sdw_slave * slave ) {}
51-
56+ static inline bool sdca_device_quirk_match (struct sdw_slave * slave , enum sdca_quirk quirk )
57+ {
58+ return false;
59+ }
5260#endif
5361
5462#endif
Original file line number Diff line number Diff line change 99#include <linux/acpi.h>
1010#include <linux/soundwire/sdw.h>
1111#include <sound/sdca.h>
12+ #include <sound/sdca_function.h>
1213
1314void sdca_lookup_interface_revision (struct sdw_slave * slave )
1415{
@@ -22,3 +23,45 @@ void sdca_lookup_interface_revision(struct sdw_slave *slave)
2223 & slave -> sdca_data .interface_revision );
2324}
2425EXPORT_SYMBOL_NS (sdca_lookup_interface_revision , SND_SOC_SDCA );
26+
27+ static bool sdca_device_quirk_rt712_vb (struct sdw_slave * slave )
28+ {
29+ struct sdw_slave_id * id = & slave -> id ;
30+ int i ;
31+
32+ /*
33+ * The RT712_VA relies on the v06r04 draft, and the
34+ * RT712_VB on a more recent v08r01 draft.
35+ */
36+ if (slave -> sdca_data .interface_revision < 0x0801 )
37+ return false;
38+
39+ if (id -> mfg_id != 0x025d )
40+ return false;
41+
42+ if (id -> part_id != 0x712 &&
43+ id -> part_id != 0x713 &&
44+ id -> part_id != 0x716 &&
45+ id -> part_id != 0x717 )
46+ return false;
47+
48+ for (i = 0 ; i < slave -> sdca_data .num_functions ; i ++ ) {
49+ if (slave -> sdca_data .sdca_func [i ].type ==
50+ SDCA_FUNCTION_TYPE_SMART_MIC )
51+ return true;
52+ }
53+
54+ return false;
55+ }
56+
57+ bool sdca_device_quirk_match (struct sdw_slave * slave , enum sdca_quirk quirk )
58+ {
59+ switch (quirk ) {
60+ case SDCA_QUIRKS_RT712_VB :
61+ return sdca_device_quirk_rt712_vb (slave );
62+ default :
63+ break ;
64+ }
65+ return false;
66+ }
67+ EXPORT_SYMBOL_NS (sdca_device_quirk_match , SND_SOC_SDCA );
You can’t perform that action at this time.
0 commit comments