3

I'm trying to understand audio codec, while going through different audio codec source code i came across register of codec in two different ways struct platform_driver and struct i2c_driver.

In audio codec aic3101 module_i2c_driver is used for registering audio codec,

http://lxr.free-electrons.com/source/sound/soc/codecs/tlv320aic3x.c?v=3.14#L1613

and whereas for ac97 module_platform_driver is used,

http://lxr.free-electrons.com/source/sound/soc/codecs/ac97.c?v=3.14#L149

Both are i2c devices but they are register in two different way. Can anybody help me to understand why so.

regards, GBiradar

GBiradar
  • 161
  • 1
  • 11
  • At the first glance, it looks like AC97 driver just missing Device Tree support, probably noone wanted to add it. But I'm not an expert in sound subsystem, maybe there are actual reasons behind it. – Sam Protsenko Feb 15 '17 at 09:25
  • From the code of AC97 it's not obvious that it is an I2C device always. Moreover, I2C device assumes that I2C host controller is visible to OS as a separate device. In case of private codec, even if it uses I2C bus, it's not true. @SamProtsenko, I have a theory, see above. – 0andriy Feb 15 '17 at 22:57
  • both audio codec are controlled by i2c and dataflow happen by i2s. then what is actual difference between module_platform_driver vs module_i2c_driver registeration? – GBiradar Feb 16 '17 at 06:01

0 Answers0