1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright(c) 2015-17 Intel Corporation. */ 3 4#ifndef __SOUNDWIRE_TYPES_H 5#define __SOUNDWIRE_TYPES_H 6 7extern struct bus_type sdw_bus_type; 8 9#define drv_to_sdw_driver(_drv) container_of(_drv, struct sdw_driver, driver) 10 11#define sdw_register_driver(drv) \ 12 __sdw_register_driver(drv, THIS_MODULE) 13 14int __sdw_register_driver(struct sdw_driver *drv, struct module *owner); 15void sdw_unregister_driver(struct sdw_driver *drv); 16 17int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); 18 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) 30#endif /* __SOUNDWIRE_TYPES_H */ 31