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.