Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446833

Re: [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio driver

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio driver
Date 2016-07-20 02:30 +0200
Message-ID <rWNyF-2yx-7@gated-at.bofh.it> (permalink)
References <rWMCB-1Wj-3@gated-at.bofh.it> <rWMCC-1Wj-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, Jul 19, 2016 at 04:22:43PM -0700, John Stultz wrote:

>  sound/soc/Kconfig                |   1 +
>  sound/soc/Makefile               |   1 +
>  sound/soc/hisilicon/Kconfig      |   5 +
>  sound/soc/hisilicon/Makefile     |   1 +
>  sound/soc/hisilicon/hi6210-i2s.c | 678 +++++++++++++++++++++++++++++++++++++++
>  sound/soc/hisilicon/hi6210-i2s.h | 276 ++++++++++++++++
>  6 files changed, 962 insertions(+)

This is adding a new binding without documenting it and still looks like
it's far more than an I2S controller.

> +	switch (params_rate(params)) {
> +	default:
> +		dev_err(cpu_dai->dev, "Bad rate\n");
> +		return -EINVAL;

We should tell the user what rate.

> +	if (bits == HII2S_BITS_24) {
> +		i2s->bits = 32;
> +		dma_data->addr_width = 3;
> +	} else {
> +		i2s->bits = 16;
> +		dma_data->addr_width = 2;
> +	}

This looks like it should be a switch statement, there's some similar
stuff for the channels.

> +	_hi6210_i2s_set_fmt(i2s, substream);

Why is this not in line given that this is the only user?

> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res) {
> +		ret = -ENODEV;
> +		goto err2;
> +	}
> +
> +	i2s->base = devm_ioremap_resource(dev, res);

devm_ioremap_resource() will check the error.

> +err3:
> +	while (--i2s->clocks)
> +		clk_put(i2s->clk[i2s->clocks]);
> +
> +err2:
> +	kfree(i2s);

You switched to using devm_ but left the error handling.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 00/10 v2] Add HDMI audio support for HiKey John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 02/10 v2] k3dma: Fix dma err offsets John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 06/10 v2] ASoC: add hi6210-i2s  DT bindings John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 01/10 v2] k3dma: Fix hisi burst clipping John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 09/10 v2] ASoC: hisilicon: Add hi6210 hdmi codec driver John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
    Re: [RFC][PATCH 09/10 v2] ASoC: hisilicon: Add hi6210 hdmi codec  driver Mark Brown <broonie@kernel.org> - 2016-07-20 02:40 +0200
  [RFC][PATCH 03/10 v2] k3dma: Fix "nobody cared" message seen on any error John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 04/10 v2] k3dma: Add cyclic mode for audio John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 08/10 v2] ASoC: add hi6210-hdmi-audio-codec DT bindings John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 10/10 v2] dts: hi6220: Add k3-dma and i2s/hdmi audio support John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
  [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio driver John Stultz <john.stultz@linaro.org> - 2016-07-20 01:30 +0200
    Re: [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio  driver Mark Brown <broonie@kernel.org> - 2016-07-20 02:30 +0200
      Re: [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio driver John Stultz <john.stultz@linaro.org> - 2016-07-20 19:00 +0200
        Re: [RFC][PATCH 07/10 v2] ASoC: hisilicon: Add hi6210 i2s audio  driver Mark Brown <broonie@kernel.org> - 2016-07-20 19:10 +0200
  Re: [RFC][PATCH 00/10 v2] Add HDMI audio support for HiKey Mark Brown <broonie@kernel.org> - 2016-07-20 02:30 +0200

csiph-web