Loading drivers/soundwire/soundwire.c +41 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,47 @@ err_out: } EXPORT_SYMBOL(swr_new_device); /** * swr_startup_devices - perform additional initialization for child devices * * @swr_dev: pointer to soundwire slave device * * Performs any additional initialization needed for a soundwire slave device. * This is a optional functionality defined by slave devices. * Removes the slave node from the list, in case there is any failure. */ int swr_startup_devices(struct swr_device *swr_dev) { struct swr_driver *swr_drv; struct device *dev; int ret = 0; if (!swr_dev) return -EINVAL; dev = &swr_dev->dev; if (!dev) return -EINVAL; swr_drv = to_swr_driver(dev->driver); if (!swr_drv) return -EINVAL; if (swr_drv->startup) { ret = swr_drv->startup(swr_dev); if (ret) goto out; dev_dbg(&swr_dev->dev, "%s: startup complete for device %lx\n", __func__, swr_dev->addr); } out: return ret; } EXPORT_SYMBOL(swr_startup_devices); /** * of_register_swr_devices - register child devices on to the soundwire bus * @master: pointer to soundwire master device Loading include/linux/soundwire/soundwire.h +4 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ static inline struct swr_device *to_swr_device(struct device *dev) * @shutdown: standard shutdown callback used during power down/halt * @suspend: standard suspend callback used during system suspend * @resume: standard resume callback used during system resume * @startup: additional init operation for slave devices * @driver: soundwire device drivers should initialize name and * owner field of this structure * @id_table: list of soundwire devices supported by this driver Loading @@ -193,6 +194,7 @@ struct swr_driver { int (*device_up)(struct swr_device *swr); int (*device_down)(struct swr_device *swr); int (*reset_device)(struct swr_device *swr); int (*startup)(struct swr_device *swr); struct device_driver driver; const struct swr_device_id *id_table; }; Loading Loading @@ -239,6 +241,8 @@ static inline void swr_set_dev_data(struct swr_device *dev, void *data) dev_set_drvdata(&dev->dev, data); } extern int swr_startup_devices(struct swr_device *swr_dev); extern struct swr_device *swr_new_device(struct swr_master *master, struct swr_boardinfo const *info); Loading include/sound/soc.h +2 −0 Original line number Diff line number Diff line Loading @@ -1341,6 +1341,8 @@ int snd_soc_component_update_bits_async(struct snd_soc_component *component, void snd_soc_component_async_complete(struct snd_soc_component *component); int snd_soc_component_test_bits(struct snd_soc_component *component, unsigned int reg, unsigned int mask, unsigned int value); struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name); /* device driver data */ Loading sound/soc/soc-core.c +12 −1 Original line number Diff line number Diff line Loading @@ -864,7 +864,17 @@ EXPORT_SYMBOL_GPL(snd_soc_resume); static const struct snd_soc_dai_ops null_dai_ops = { }; static struct snd_soc_component *soc_find_component( /** * soc_find_component: find a component from component_list in ASoC core * * @of_node: of_node of the component to query. * @name: name of the component to query. * * function to find out if a component is already registered with ASoC core. * * Returns component handle for success, else NULL error. */ struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name) { struct snd_soc_component *component; Loading @@ -880,6 +890,7 @@ static struct snd_soc_component *soc_find_component( return NULL; } EXPORT_SYMBOL(soc_find_component); static struct snd_soc_dai *snd_soc_find_dai( const struct snd_soc_dai_link_component *dlc) Loading Loading
drivers/soundwire/soundwire.c +41 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,47 @@ err_out: } EXPORT_SYMBOL(swr_new_device); /** * swr_startup_devices - perform additional initialization for child devices * * @swr_dev: pointer to soundwire slave device * * Performs any additional initialization needed for a soundwire slave device. * This is a optional functionality defined by slave devices. * Removes the slave node from the list, in case there is any failure. */ int swr_startup_devices(struct swr_device *swr_dev) { struct swr_driver *swr_drv; struct device *dev; int ret = 0; if (!swr_dev) return -EINVAL; dev = &swr_dev->dev; if (!dev) return -EINVAL; swr_drv = to_swr_driver(dev->driver); if (!swr_drv) return -EINVAL; if (swr_drv->startup) { ret = swr_drv->startup(swr_dev); if (ret) goto out; dev_dbg(&swr_dev->dev, "%s: startup complete for device %lx\n", __func__, swr_dev->addr); } out: return ret; } EXPORT_SYMBOL(swr_startup_devices); /** * of_register_swr_devices - register child devices on to the soundwire bus * @master: pointer to soundwire master device Loading
include/linux/soundwire/soundwire.h +4 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ static inline struct swr_device *to_swr_device(struct device *dev) * @shutdown: standard shutdown callback used during power down/halt * @suspend: standard suspend callback used during system suspend * @resume: standard resume callback used during system resume * @startup: additional init operation for slave devices * @driver: soundwire device drivers should initialize name and * owner field of this structure * @id_table: list of soundwire devices supported by this driver Loading @@ -193,6 +194,7 @@ struct swr_driver { int (*device_up)(struct swr_device *swr); int (*device_down)(struct swr_device *swr); int (*reset_device)(struct swr_device *swr); int (*startup)(struct swr_device *swr); struct device_driver driver; const struct swr_device_id *id_table; }; Loading Loading @@ -239,6 +241,8 @@ static inline void swr_set_dev_data(struct swr_device *dev, void *data) dev_set_drvdata(&dev->dev, data); } extern int swr_startup_devices(struct swr_device *swr_dev); extern struct swr_device *swr_new_device(struct swr_master *master, struct swr_boardinfo const *info); Loading
include/sound/soc.h +2 −0 Original line number Diff line number Diff line Loading @@ -1341,6 +1341,8 @@ int snd_soc_component_update_bits_async(struct snd_soc_component *component, void snd_soc_component_async_complete(struct snd_soc_component *component); int snd_soc_component_test_bits(struct snd_soc_component *component, unsigned int reg, unsigned int mask, unsigned int value); struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name); /* device driver data */ Loading
sound/soc/soc-core.c +12 −1 Original line number Diff line number Diff line Loading @@ -864,7 +864,17 @@ EXPORT_SYMBOL_GPL(snd_soc_resume); static const struct snd_soc_dai_ops null_dai_ops = { }; static struct snd_soc_component *soc_find_component( /** * soc_find_component: find a component from component_list in ASoC core * * @of_node: of_node of the component to query. * @name: name of the component to query. * * function to find out if a component is already registered with ASoC core. * * Returns component handle for success, else NULL error. */ struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name) { struct snd_soc_component *component; Loading @@ -880,6 +890,7 @@ static struct snd_soc_component *soc_find_component( return NULL; } EXPORT_SYMBOL(soc_find_component); static struct snd_soc_dai *snd_soc_find_dai( const struct snd_soc_dai_link_component *dlc) Loading