mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
90acca1d54
this is a preparatory patch before the introduction of the sdw_master_type. The SoundWire slave support is slightly modified with the use of a sdw_slave_type, and the uevent handling move to slave.c (since it's not necessary for the master). No functionality change other than moving code around. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Acked-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20200518174322.31561-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright(c) 2015-17 Intel Corporation. */
|
|
|
|
#ifndef __SOUNDWIRE_TYPES_H
|
|
#define __SOUNDWIRE_TYPES_H
|
|
|
|
extern struct bus_type sdw_bus_type;
|
|
extern struct device_type sdw_slave_type;
|
|
extern struct device_type sdw_master_type;
|
|
|
|
static inline int is_sdw_slave(const struct device *dev)
|
|
{
|
|
return dev->type == &sdw_slave_type;
|
|
}
|
|
|
|
#define drv_to_sdw_driver(_drv) container_of(_drv, struct sdw_driver, driver)
|
|
|
|
#define sdw_register_driver(drv) \
|
|
__sdw_register_driver(drv, THIS_MODULE)
|
|
|
|
int __sdw_register_driver(struct sdw_driver *drv, struct module *owner);
|
|
void sdw_unregister_driver(struct sdw_driver *drv);
|
|
|
|
int sdw_slave_uevent(struct device *dev, struct kobj_uevent_env *env);
|
|
|
|
/**
|
|
* module_sdw_driver() - Helper macro for registering a Soundwire driver
|
|
* @__sdw_driver: soundwire slave driver struct
|
|
*
|
|
* Helper macro for Soundwire drivers which do not do anything special in
|
|
* module init/exit. This eliminates a lot of boilerplate. Each module may only
|
|
* use this macro once, and calling it replaces module_init() and module_exit()
|
|
*/
|
|
#define module_sdw_driver(__sdw_driver) \
|
|
module_driver(__sdw_driver, sdw_register_driver, \
|
|
sdw_unregister_driver)
|
|
#endif /* __SOUNDWIRE_TYPES_H */
|