Re: [PATCH v8 08/10] ASoC: mediatek: mt8196: add platform driver
From: Mark Brown
Date: Fri Apr 03 2026 - 10:07:51 EST
On Tue, Mar 24, 2026 at 09:56:49AM +0800, Cyril Chao wrote:
> +static int mt8196_set_cm(struct mtk_base_afe *afe, int id,
> + bool update, bool swap, unsigned int ch)
> +{
> + struct mt8196_afe_private *afe_priv = afe->platform_priv;
> + unsigned int rate = afe_priv->cm_rate[id];
> + unsigned int rate_val = mt8196_rate_transform(afe->dev, rate);
> + unsigned int update_val = update ? ((((26000000 / rate) - 10) / (ch / 2)) - 1) : 0x64;
> + int reg = AFE_CM0_CON0 + 0x10 * id;
The driver looks like it supports mono so won't this trigger divide by
zero?
Also please write normal conditional statements, it's much more
leigible.
Attachment:
signature.asc
Description: PGP signature