sound/soc/sdca/sdca_class_function.c

Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_class_function.c

File Facts

System
Linux kernel
Corpus path
sound/soc/sdca/sdca_class_function.c
Extension
.c
Size
15169 bytes
Lines
574
Domain
Driver Families
Bucket
sound/soc
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct class_function_drv {
	struct device *dev;
	struct regmap *regmap;
	struct sdca_class_drv *core;

	struct sdca_function_data *function;
	bool suspended;
};

static void class_function_regmap_lock(void *data)
{
	struct mutex *lock = data;

	mutex_lock(lock);
}

static void class_function_regmap_unlock(void *data)
{
	struct mutex *lock = data;

	mutex_unlock(lock);
}

static bool class_function_regmap_writeable(struct device *dev, unsigned int reg)
{
	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);

	return sdca_regmap_writeable(drv->function, reg);
}

static bool class_function_regmap_readable(struct device *dev, unsigned int reg)
{
	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);

	return sdca_regmap_readable(drv->function, reg);
}

static bool class_function_regmap_volatile(struct device *dev, unsigned int reg)
{
	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);

	return sdca_regmap_volatile(drv->function, reg);
}

static const struct regmap_config class_function_regmap_config = {
	.name			= "sdca",
	.reg_bits		= 32,
	.val_bits		= 32,
	.reg_format_endian	= REGMAP_ENDIAN_LITTLE,
	.val_format_endian	= REGMAP_ENDIAN_LITTLE,

	.max_register		= SDW_SDCA_MAX_REGISTER,
	.readable_reg		= class_function_regmap_readable,
	.writeable_reg		= class_function_regmap_writeable,
	.volatile_reg		= class_function_regmap_volatile,

	.cache_type		= REGCACHE_MAPLE,

	.lock			= class_function_regmap_lock,
	.unlock			= class_function_regmap_unlock,
};

static int class_function_regmap_mbq_size(struct device *dev, unsigned int reg)
{
	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);

	return sdca_regmap_mbq_size(drv->function, reg);
}

static bool class_function_regmap_deferrable(struct device *dev, unsigned int reg)
{
	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);

	return sdca_regmap_deferrable(drv->function, reg);
}

static const struct regmap_sdw_mbq_cfg class_function_mbq_config = {
	.mbq_size		= class_function_regmap_mbq_size,
	.deferrable		= class_function_regmap_deferrable,
	.retry_us		= 1000,
	.timeout_us		= 10000,
};

static int class_function_startup(struct snd_pcm_substream *substream,
				  struct snd_soc_dai *dai)

Annotation

Implementation Notes