lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <54FAB510.90304@metafoo.de>
Date:	Sat, 07 Mar 2015 09:21:36 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>,
	broonie@...nel.org, lgirdwood@...il.com
CC:	linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH] ASoC: jz4740: Add jz4780 support

On 03/06/2015 04:33 PM, Zubair Lutfullah Kakakhel wrote:
> The jz4780 and jz4740 have very similar i2s blocks.
>
> The slight difference is in Rx/Tx fifos.
> And the bitclocks for input/output are different.
>
> This patch adds jz4780 support to the driver
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>

Looks mostly good.
[...]
>   static inline uint32_t jz4740_i2s_read(const struct jz4740_i2s *i2s,
> @@ -267,13 +283,22 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
>   			ctrl |= JZ_AIC_CTRL_MONO_TO_STEREO;
>   		else
>   			ctrl &= ~JZ_AIC_CTRL_MONO_TO_STEREO;
> +
> +		div_reg &= ~I2SDIV_DV_MASK;
> +		div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
>   	} else {
>   		ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK;
>   		ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET;
> +
> +		if (i2s->version >= JZ_I2S_JZ4780) {
> +			div_reg &= ~I2SDIV_IDV_MASK;
> +			div_reg |= (div - 1) << I2SDIV_IDV_SHIFT;
> +		} else {
> +			div_reg &= ~I2SDIV_DV_MASK;
> +			div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
> +		}
>   	}

Given that the JZ4780 supports different rates for TX and RX in this 
configuration you can also remove the symmetric_rates flag from the DAI 
struct, so applications can actually make use of it.

>
> -	div_reg &= ~I2SDIV_DV_MASK;
> -	div_reg |= (div - 1) << I2SDIV_DV_SHIFT;
>   	jz4740_i2s_write(i2s, JZ_REG_AIC_CTRL, ctrl);
>   	jz4740_i2s_write(i2s, JZ_REG_AIC_CLK_DIV, div_reg);
>
[...]
> +	if (i2s->version >= JZ_I2S_JZ4780)
> +		return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL,
> +			SND_DMAENGINE_PCM_FLAG_NO_RESIDUE);

We should not be adding new users of SND_DMAENGINE_PCM_FLAG_NO_RESIDUE, this 
is a property of the DMA controller/driver and the DMAengine framework now 
has the capabilities to report on whether it supports residue reporting or not.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ