11 Feb
2015
11 Feb
'15
6:41 a.m.
On Tue, Feb 10, 2015 at 06:14:34PM +0800, Oder Chiou wrote:
if (rt5677->type == RT5677) {
regmap_update_bits(rt5677->regmap, RT5677_GLB_CLK1,
RT5677_MCLK_SRC_MASK, RT5677_MCLK2_SRC);
regmap_update_bits(rt5677->regmap, RT5677_GLB_CLK2,
RT5677_PLL2_PR_SRC_MASK |
RT5677_DSP_CLK_SRC_MASK,
RT5677_PLL2_PR_SRC_MCLK2 |
RT5677_DSP_CLK_SRC_BYPASS);
} else {
regmap_update_bits(rt5677->regmap, RT5677_GLB_CLK2,
RT5677_DSP_CLK_SRC_MASK,
RT5677_DSP_CLK_SRC_BYPASS);
}
This change looks good except for the above which is better written as a switch statement - it's best to write choices between chip types like that so that if a new variant comes up then it's easy to slot in.