Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b913adf authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soundwire: add new function to enumerate slave devices"

parents ff03d8c3 8be2ac44
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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
@@ -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;
};
@@ -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);

+2 −0
Original line number Diff line number Diff line
@@ -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 */

+12 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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)