Re: [PATCH v2] ASoC: rt1318: Add RT1318 audio amplifier driver

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

 



On Wed, Jun 05, 2024 at 10:20:41AM +0000, Jack Yu wrote:
> This is the initial i2s-based amplifier driver for rt1318.

This breaks an x86 allmodconfig build:

/build/stage/linux/sound/soc/codecs/rt1318.c:785:5: error: no previous prototype
 for ‘rt1318_pll_calc’ [-Werror=missing-prototypes]
  785 | int rt1318_pll_calc(const unsigned int freq_in,
      |     ^~~~~~~~~~~~~~~
/build/stage/linux/sound/soc/codecs/rt1318.c:1340:10: error: ‘struct i2c_driver’
 has no member named ‘probe_new’
 1340 |         .probe_new = rt1318_i2c_probe,
      |          ^~~~~~~~~
/build/stage/linux/sound/soc/codecs/rt1318.c:1340:22: error: initialization of ‘
const struct i2c_device_id *’ from incompatible pointer type ‘int (*)(struct i2c
_client *)’ [-Werror=incompatible-pointer-types]
 1340 |         .probe_new = rt1318_i2c_probe,
      |                      ^~~~~~~~~~~~~~~~
/build/stage/linux/sound/soc/codecs/rt1318.c:1340:22: note: (near initialization for ‘rt1318_i2c_driver.id_table’)
cc1: all warnings being treated as errors

> +	if (lrclk == RT1318_LRCLK_48000 || lrclk == RT1318_LRCLK_44100 ||
> +		lrclk == RT1318_LRCLK_16000)
> +		regmap_update_bits(rt1318->regmap, RT1318_SRC_TCON,
> +				RT1318_SRCIN_F12288_MASK | RT1318_SRCIN_DACLK_MASK,
> +				RT1318_SRCIN_TCON4 | RT1318_DACLK_TCON4);
> +	else if (lrclk == RT1318_LRCLK_96000)
> +		regmap_update_bits(rt1318->regmap, RT1318_SRC_TCON,
> +				RT1318_SRCIN_F12288_MASK | RT1318_SRCIN_DACLK_MASK,
> +				RT1318_SRCIN_TCON4 | RT1318_DACLK_TCON2);
> +	else if (lrclk == RT1318_LRCLK_192000)
> +		regmap_update_bits(rt1318->regmap, RT1318_SRC_TCON,
> +				RT1318_SRCIN_F12288_MASK | RT1318_SRCIN_DACLK_MASK,
> +				RT1318_SRCIN_TCON4 | RT1318_DACLK_TCON1);
> +	else
> +		return -EINVAL;

This would be more clearly written as a switch statement.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux