diff options
author | Greg Kroah-Hartman | 2020-05-22 09:25:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2020-05-22 09:25:25 +0200 |
commit | ddc0aef01a90ee8431f1a47f7b35e84d36ab8913 (patch) | |
tree | e0fd502efbaa74c955d271ea170d9e3268433874 /include | |
parent | c9cf27d9dee20193660b6582e4e6d6b315bff217 (diff) | |
parent | fcbcf1f7b56855ffe1cec768cb1013c5a4c854c3 (diff) |
Merge tag 'soundwire-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next
Vinod writes:
soundwire updates for v5.8-rc1
This contains sdw_master_device patches and other updates done by Intel
folks.
Details:
- sdw_master_device to represent the master instances.
- sysfs properties for sdw_master_device and sdw_slave.
- Documentation update for TDM modes.
- some code cleanup patches and odd updates.
* tag 'soundwire-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: intel: use a single module
soundwire: fix spelling mistake
soundwire: fix trailing line in sysfs_slave.c
soundwire: add Slave sysfs support
soundwire: master: add sysfs support
soundwire: disco: s/ch/channels/
soundwire: master: add runtime pm support
soundwire: bus_type: add sdw_master_device support
soundwire: bus: add unique bus id
soundwire: bus_type: introduce sdw_slave_type and sdw_master_type
soundwire: bus: rename sdw_bus_master_add/delete, add arguments
soundwire: intel: (cosmetic) remove multiple superfluous "else" statements
soundwire: (cosmetic) remove multiple superfluous "else" statements
soundwire: qcom: Use IRQF_ONESHOT
soundwire: bus: reduce verbosity on enumeration
soundwire: debugfs: clarify SDPX license with GPL-2.0-only
soundwire: slave: don't init debugfs on device registration error
Documentation: SoundWire: clarify TDM mode support
soundwire: qcom: fix error handling in probe
soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/soundwire/sdw.h | 32 | ||||
-rw-r--r-- | include/linux/soundwire/sdw_type.h | 9 |
2 files changed, 33 insertions, 8 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 00f5826092e3..9c27a32df9bb 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -291,8 +291,8 @@ struct sdw_dpn_audio_mode { * implementation-defined interrupts * @max_ch: Maximum channels supported * @min_ch: Minimum channels supported - * @num_ch: Number of discrete channels supported - * @ch: Discrete channels supported + * @num_channels: Number of discrete channels supported + * @channels: Discrete channels supported * @num_ch_combinations: Number of channel combinations supported * @ch_combinations: Channel combinations supported * @modes: SDW mode supported @@ -316,8 +316,8 @@ struct sdw_dpn_prop { u32 imp_def_interrupts; u32 max_ch; u32 min_ch; - u32 num_ch; - u32 *ch; + u32 num_channels; + u32 *channels; u32 num_ch_combinations; u32 *ch_combinations; u32 modes; @@ -632,6 +632,19 @@ struct sdw_slave { #define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev) +/** + * struct sdw_master_device - SoundWire 'Master Device' representation + * @dev: Linux device for this Master + * @bus: Bus handle shortcut + */ +struct sdw_master_device { + struct device dev; + struct sdw_bus *bus; +}; + +#define dev_to_sdw_master_device(d) \ + container_of(d, struct sdw_master_device, dev) + struct sdw_driver { const char *name; @@ -787,8 +800,10 @@ struct sdw_master_ops { /** * struct sdw_bus - SoundWire bus - * @dev: Master linux device + * @dev: Shortcut to &bus->md->dev to avoid changing the entire code. + * @md: Master device * @link_id: Link id number, can be 0 to N, unique for each Master + * @id: bus system-wide unique id * @slaves: list of Slaves on this bus * @assigned: Bitmap for Slave device numbers. * Bit set implies used number, bit clear implies unused number. @@ -812,7 +827,9 @@ struct sdw_master_ops { */ struct sdw_bus { struct device *dev; + struct sdw_master_device *md; unsigned int link_id; + int id; struct list_head slaves; DECLARE_BITMAP(assigned, SDW_MAX_DEVICES); struct mutex bus_lock; @@ -832,8 +849,9 @@ struct sdw_bus { bool multi_link; }; -int sdw_add_bus_master(struct sdw_bus *bus); -void sdw_delete_bus_master(struct sdw_bus *bus); +int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent, + struct fwnode_handle *fwnode); +void sdw_bus_master_delete(struct sdw_bus *bus); /** * sdw_port_config: Master or Slave Port configuration diff --git a/include/linux/soundwire/sdw_type.h b/include/linux/soundwire/sdw_type.h index aaa7f4267c14..52eb66cd11bc 100644 --- a/include/linux/soundwire/sdw_type.h +++ b/include/linux/soundwire/sdw_type.h @@ -5,6 +5,13 @@ #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) @@ -14,7 +21,7 @@ extern struct bus_type sdw_bus_type; int __sdw_register_driver(struct sdw_driver *drv, struct module *owner); void sdw_unregister_driver(struct sdw_driver *drv); -int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); +int sdw_slave_uevent(struct device *dev, struct kobj_uevent_env *env); /** * module_sdw_driver() - Helper macro for registering a Soundwire driver |