[alsa-devel] CS4279 and hw_read_t/hw_write_t
_From soc/codecs/cs4270.c...
* * Note that we don't use the hw_write function pointer of snd_soc_codec. * That's because it's too clunky: the hw_write_t prototype does not match * i2c_smbus_write_byte_data(), and it's just another layer of overhead. */
The prototype doesn't match because you are using i2c_smbus_write_byte_data() instead of i2c_master_send()/i2c_master_recv().
Jon Smirl wrote:
From soc/codecs/cs4270.c...
- Note that we don't use the hw_write function pointer of snd_soc_codec.
- That's because it's too clunky: the hw_write_t prototype does not match
- i2c_smbus_write_byte_data(), and it's just another layer of overhead.
*/
The prototype doesn't match because you are using i2c_smbus_write_byte_data() instead of i2c_master_send()/i2c_master_recv().
Should I be using i2c_master_send() instead? I remember reading somewhere that I should be using the i2c smbus functions if possible.
On 7/21/08, Timur Tabi timur@freescale.com wrote:
Jon Smirl wrote:
From soc/codecs/cs4270.c...
- Note that we don't use the hw_write function pointer of snd_soc_codec.
- That's because it's too clunky: the hw_write_t prototype does not match
- i2c_smbus_write_byte_data(), and it's just another layer of overhead.
*/
The prototype doesn't match because you are using i2c_smbus_write_byte_data() instead of i2c_master_send()/i2c_master_recv().
Should I be using i2c_master_send() instead? I remember reading somewhere that I should be using the i2c smbus functions if possible.
i2c_smbus... will work with either a smbus controller or an i2c controller. Inside the routine it decides which type of controller and then ends up calling i2c_master....
You're on an i2c bus, no need to the overhead.
You'd have to read the CS4270 datasheet in detail to see if can even be hooked up to an smbus controller. smbus is a subset of full i2c.
-- Timur Tabi Linux kernel developer at Freescale
Jon Smirl wrote:
You'd have to read the CS4270 datasheet in detail to see if can even be hooked up to an smbus controller. smbus is a subset of full i2c.
There's no mention of SM Bus anywhere in the CS4270 datasheet. Can I assume that it won't work?
I remember now trying to use a standard I2C-only function and it didn't work, but that was a long time ago before I knew much about the hardware. I'll have to try it again.
On 7/21/08, Timur Tabi timur@freescale.com wrote:
Jon Smirl wrote:
You'd have to read the CS4270 datasheet in detail to see if can even be hooked up to an smbus controller. smbus is a subset of full i2c.
There's no mention of SM Bus anywhere in the CS4270 datasheet. Can I ass=
ume
that it won't work?
SMBus devices will work on an i2c controller. But i2c devices won't always work on a smbus controller. i2c is a superset of smbus, it can do things smbus can't.
SMbus (system management bus) is usually used for simple things like fan and temperature monitors.
_From wikipedia on i2c: "Pure I=B2C systems support arbitrary message structures. SMBus is restricted to nine of those structures, such as "read word N" and "write word N", involving a single slave."
I remember now trying to use a standard I2C-only function and it didn't =
work,
but that was a long time ago before I knew much about the hardware. I'l=
l have
to try it again.
--
Timur Tabi Linux kernel developer at Freescale
--=20 Jon Smirl jonsmirl@gmail.com
participants (2)
-
Jon Smirl
-
Timur Tabi