Re: [PATCH V1 3/3] ASoC: codecs: Add aw88399 amplifier driver

From: Mark Brown
Date: Fri Oct 13 2023 - 10:11:05 EST


On Fri, Oct 13, 2023 at 06:42:20PM +0800, wangweidong.a@xxxxxxxxxx wrote:

This looks good - some *very* minor comments below.

> +static const struct regmap_config aw88399_remap_config = {
> + .val_bits = 16,
> + .reg_bits = 8,
> + .max_register = AW88399_REG_MAX - 1,

I see this is already the case for the aw88261 driver but it is a bit
weird that _REG_MAX isn't the maximum register - it looks like it should
probably be _NUM_REG. Not the end of the world though.

> +static int aw_dev_dsp_update_container(struct aw_device *aw_dev,
> + unsigned char *data, unsigned int len, unsigned short base)
> +{
> + int i, ret;
> +
> +#ifdef AW88399_DSP_I2C_WRITES
> + u32 tmp_len;

This looks like debug code which can hopefully be removed in favour of
the regmap implementation?

> +static int aw88399_codec_probe(struct snd_soc_component *component)
> +{
> + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
> + struct aw88399 *aw88399 = snd_soc_component_get_drvdata(component);
> + int ret;
> +
> + ret = aw88399_request_firmware_file(aw88399);
> + if (ret < 0) {
> + dev_err(aw88399->aw_pa->dev, "%s failed\n", __func__);
> + return ret;
> + }
> +
> + INIT_DELAYED_WORK(&aw88399->start_work, aw88399_startup_work);
> +
> + /* add widgets */
> + ret = snd_soc_dapm_new_controls(dapm, aw88399_dapm_widgets,
> + ARRAY_SIZE(aw88399_dapm_widgets));
> + if (ret < 0)
> + return ret;
> +
> + /* add route */
> + ret = snd_soc_dapm_add_routes(dapm, aw88399_audio_map,
> + ARRAY_SIZE(aw88399_audio_map));
> + if (ret < 0)
> + return ret;
> +
> + ret = snd_soc_add_component_controls(component, aw88399_controls,
> + ARRAY_SIZE(aw88399_controls));

You should just be able to pass these arrays in the component strucutre?

Attachment: signature.asc
Description: PGP signature