20 Nov
2012
20 Nov
'12
12:14 p.m.
On Tue, Nov 20, 2012 at 02:00:54AM -0800, Kuninori Morimoto wrote:
Overall this looks pretty good, a few issues below mostly to do with updating to more current kernel APIs.
+/* RESET / STATUS / INTERRUPT REGISTERS */ +#define M98090_0x00_SW_RESET 0x00
The standard for Maxim drivers is to use MAX as the prefix rather than M.
+static const u8 max98090_reg[] = {
- 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, /* 0x00 - 0x07 */
Use regmap for register I/O please.
- snd_soc_write(codec, M98090_0x06_DAI_IF, val);
More idiomatic is snd_soc_update_bits() so we don't do the write if there's no change (as is very common).
- ret = snd_soc_read(codec, M98090_0xFF_REV_ID);
- if (ret < 0) {
dev_err(dev, "Failed to read device revision: %d\n", ret);
return ret;
- }
- dev_info(dev, "revision 0x%02x\n", ret);
With regmap this should be moved to the I2C level probe.
- snd_soc_add_codec_controls(codec, max98090_snd_controls,
ARRAY_SIZE(max98090_snd_controls));
Initialise these from the snd_soc_codec_driver.