Re: [PATCH 1/2] ASoC: Add ak4619 codec support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/06/2024 02:30, Kuninori Morimoto wrote:
> From: Khanh Le <khanh.le.xr@xxxxxxxxxxx>
> 
> This patch adds support for the Asahi Kasei AK4619 audio codec.
> 
> [Kuninori cleanuped and adjusted to upstream code]


...

> +	/*
> +	 * Select below from Sound Card, not here
> +	 *	SND_SOC_DAIFMT_CBC_CFC
> +	 *	SND_SOC_DAIFMT_CBP_CFP
> +	 */
> +
> +	/* First Priority */
> +	SND_SOC_POSSIBLE_DAIFMT_I2S	|
> +	SND_SOC_POSSIBLE_DAIFMT_LEFT_J,
> +
> +	/* Second Priority */
> +	SND_SOC_POSSIBLE_DAIFMT_DSP_A	|
> +	SND_SOC_POSSIBLE_DAIFMT_DSP_B,
> +};
> +
> +static struct snd_soc_dai_ops ak4619_dai_ops = {

Missing const

> +	.startup			= ak4619_dai_startup,
> +	.set_sysclk			= ak4619_dai_set_sysclk,
> +	.set_fmt			= ak4619_dai_set_fmt,
> +	.hw_params			= ak4619_dai_hw_params,
> +	.mute_stream			= ak4619_dai_mute,
> +	.auto_selectable_formats	= ak4619_dai_formats,
> +	.num_auto_selectable_formats	= ARRAY_SIZE(ak4619_dai_formats),
> +};
> +
> +static const struct snd_soc_component_driver soc_component_dev_ak4619 = {
> +	.set_bias_level		= ak4619_set_bias_level,
> +	.controls		= ak4619_snd_controls,
> +	.num_controls		= ARRAY_SIZE(ak4619_snd_controls),
> +	.dapm_widgets		= ak4619_dapm_widgets,
> +	.num_dapm_widgets	= ARRAY_SIZE(ak4619_dapm_widgets),
> +	.dapm_routes		= ak4619_intercon,
> +	.num_dapm_routes	= ARRAY_SIZE(ak4619_intercon),
> +	.idle_bias_on		= 1,
> +	.endianness		= 1,
> +};
> +
> +static const struct regmap_config ak4619_regmap_cfg = {
> +	.reg_bits		= 8,
> +	.val_bits		= 8,
> +	.max_register		= 0x14,
> +	.reg_defaults		= ak4619_reg_defaults,
> +	.num_reg_defaults	= ARRAY_SIZE(ak4619_reg_defaults),
> +	.cache_type		= REGCACHE_RBTREE,
> +};
> +

> +static int ak4619_i2c_probe(struct i2c_client *i2c)
> +{
> +	struct device *dev = &i2c->dev;
> +	struct ak4619_priv *ak4619;
> +	int ret;
> +
> +	ak4619 = devm_kzalloc(dev, sizeof(struct ak4619_priv), GFP_KERNEL);

sizeof(*)

> +	if (!ak4619)
> +		return -ENOMEM;
> +
> +	i2c_set_clientdata(i2c, ak4619);
> +
> +	ak4619->regmap = devm_regmap_init_i2c(i2c, &ak4619_regmap_cfg);
> +	if (IS_ERR(ak4619->regmap)) {
> +		ret = PTR_ERR(ak4619->regmap);
> +		dev_err(dev, "regmap_init() failed: %d\n", ret);
> +		return ret;
> +	}
> +


Best regards,
Krzysztof





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux