File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -1423,6 +1423,9 @@ static int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
1423
1423
}
1424
1424
1425
1425
const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops = {
1426
+ .debugfs_init = intel_debugfs_init ,
1427
+ .debugfs_exit = intel_debugfs_exit ,
1428
+
1426
1429
.pre_bank_switch = intel_pre_bank_switch ,
1427
1430
.post_bank_switch = intel_post_bank_switch ,
1428
1431
};
@@ -1614,7 +1617,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
1614
1617
goto err_power_up ;
1615
1618
}
1616
1619
1617
- intel_debugfs_init (sdw );
1620
+ sdw_intel_debugfs_init (sdw );
1618
1621
1619
1622
/* start bus */
1620
1623
ret = intel_start_bus (sdw );
@@ -1685,7 +1688,7 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
1685
1688
* SDW_INTEL_CLK_STOP_NOT_ALLOWED
1686
1689
*/
1687
1690
if (!bus -> prop .hw_disabled ) {
1688
- intel_debugfs_exit (sdw );
1691
+ sdw_intel_debugfs_exit (sdw );
1689
1692
sdw_cdns_enable_interrupt (cdns , false);
1690
1693
}
1691
1694
sdw_bus_master_delete (bus );
Original file line number Diff line number Diff line change @@ -61,4 +61,20 @@ struct sdw_intel_link_dev {
61
61
#define auxiliary_dev_to_sdw_intel_link_dev (auxiliary_dev ) \
62
62
container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev)
63
63
64
+ #define SDW_INTEL_CHECK_OPS (sdw , cb ) ((sdw) && (sdw)->link_res && (sdw)->link_res->hw_ops && \
65
+ (sdw)->link_res->hw_ops->cb)
66
+ #define SDW_INTEL_OPS (sdw , cb ) ((sdw)->link_res->hw_ops->cb)
67
+
68
+ static inline void sdw_intel_debugfs_init (struct sdw_intel * sdw )
69
+ {
70
+ if (SDW_INTEL_CHECK_OPS (sdw , debugfs_init ))
71
+ SDW_INTEL_OPS (sdw , debugfs_init )(sdw );
72
+ }
73
+
74
+ static inline void sdw_intel_debugfs_exit (struct sdw_intel * sdw )
75
+ {
76
+ if (SDW_INTEL_CHECK_OPS (sdw , debugfs_exit ))
77
+ SDW_INTEL_OPS (sdw , debugfs_exit )(sdw );
78
+ }
79
+
64
80
#endif /* __SDW_INTEL_LOCAL_H */
Original file line number Diff line number Diff line change @@ -297,10 +297,15 @@ irqreturn_t sdw_intel_thread(int irq, void *dev_id);
297
297
struct sdw_intel ;
298
298
299
299
/* struct intel_sdw_hw_ops - SoundWire ops for Intel platforms.
300
+ * @debugfs_init: initialize all debugfs capabilities
301
+ * @debugfs_exit: close and cleanup debugfs capabilities
300
302
* @pre_bank_switch: helper for bus management
301
303
* @post_bank_switch: helper for bus management
302
304
*/
303
305
struct sdw_intel_hw_ops {
306
+ void (* debugfs_init )(struct sdw_intel * sdw );
307
+ void (* debugfs_exit )(struct sdw_intel * sdw );
308
+
304
309
int (* pre_bank_switch )(struct sdw_intel * sdw );
305
310
int (* post_bank_switch )(struct sdw_intel * sdw );
306
311
};
You can’t perform that action at this time.
0 commit comments