A bit too basic in some ways. Here are a couple of suggestions for
improvement:
1. Make i2c_attach_device and i2c_register_bus call i2c_write instead
of the the i2c_start, i2c_sendbyte, i2c_stop sequence. This allows
the bus driver to take control of any line waggling that needs to be
done.
2. Implement variations of the i2c_read and i2c_write functions and the
corresponding bus driver vectors that can deal with messages of
arbitrary length.
The main problem with 2 is that it is blocking. There is hardware that
allow sending and receiving of messages over an I2C bus using DMA and
interrupts (e.g. the MPC8xx PowerPC chips). It would be nice if this
sort of thing could be supported by a generic kernel I2C interface.
-- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/