drivers: i2c: added I2C basics.

i2c-msg:
Describes a message which is to be sent over an I2C interface.

i2c-bus:
Description of the I2C interface (aka the bus).

i2c-client:
Representation of the receiving chip and its I2C interface.

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'master' into i2c

Signed-off-by: Michel Megens <dev@michelmegens.net>

Conflicts:
	drivers/Kconfig
	drivers/Makefile
i2c: client: added a client to bus attatch.

i2c_add_client is used add a new client to a bus. Please note that
clients should not be added more than once to a bus.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: bus: added single message xfer functions.

Added the API functions:

i2c_master_send:
	Send a single I2C message of a given length to an I2C client.

i2c_master_rcv:
	Receive a single I2C message of a given length from an I2C
	client.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: bus: implemented API transfer function

i2c_bus_transfer is the API function to transfer multiple I2C messages
using the repeated start functionality in the I2C standard.

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'master' into i2c
i2c: core: implemented the backend for I2C xfers

__i2c_transfer:
	Backend I2C transmission function. This function handles an
	of messages to the I2C bus driver. If the transmission fails
	and a retry is requested, it will retry the transmission for a
	maximum of i2c_bus::retries amount of times or untill the
	transmission received a timeout (i2c_bus::timeout).

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'sched'

	* FIFO scheduler
i2c: atmega: added a setup for the ATmega I2C bus.

Added a bus structure and basic I/O definitions for the I2C bus. The
core bus needs some extra features before the actual bus can be
implemented. Requirements:

	* Set the bus speed
	* Time out handling
	* Retry setting/handling

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: wrote an initial init function.

atmega_i2c_init:
	Wrote an initial version of the ATMega I2C bus init. The bus is
	almost fully initialised after calling this function. Only the
	bus speed configuration has to be added to fully complete the
	initialisation.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: implemented the a speed configurator

The speed of the ATmega AVR I2C bus can be changed and configured using
atmega_i2c_setspeed. Other drivers (i2c clients) can use
bus::ctrl(bus, I2C_SET_SPEED, &speed). The speed argument is given in
Hertz. The default SCL frequency (set on initialise) is 100KHz.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: implemented master xfer start

atmega_i2c_xfer:
	This function prepares the bus to start an I2C master
	transmission. It sets up all the (file) global variables which a
	typical master-to-slave transmission needs. As soon as the I2C START
	bit has been generated on the bus, the executing thread will be
	placed on a waiting queue, if the scheduler is enabled, untill the
	entire transmission is done. If the scheduler is not enabled,
	atmega_i2c_xfer will do NOP's untill the transmission has completed.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: client: added client factory.

Added a factory function for i2c_client's.

i2c_new_device:
	Create a new i2c_client for a device driver. Takes a pointer to
	a i2c_device_info structure as an argument. The i2c_device_info
	structure describes the layout of a chip using the I2C protocol.
	It includes a device name, end point address (I2C address), a
	bus (if not using the standard) and device file operations.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: added the ATmega I2C IRQ

Added the I2C STC (Serial Transfer Complete) interrupt vector to the
kernel. It is setup during the ATmega I2C driver initialisation using
irq_request.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: implemented the master transmitter

Implemented the master transmission code for the ATmega I2C bus.
Transmissions are handled in an IRQ handled (which cannot EVER be
threaded!). All cases for master transmission are implemented now.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: atmega: implemented the master receiver

Implemented all cases concerning the I2C master receiver. This means
that the entire master I2C protocol has been implemented for the ATmega
I2C (TWI) bus.

Signed-off-by: Michel Megens <dev@michelmegens.net>
i2c: core: fixed a bug in the transfer init

__i2c_transfer:
	Fixed a bug that would setup a faulty transfer by passing the
	wrong amount messages to the I2C bus transfer routine
	(i2c_bus::xfer).

init:
	Fixed an I2C initialisation bug for AVR chips. The ATmega I2C
	bus would never be initialised due to a spelling error in the
	preprocessor checking whether I2C has been configured for building
	or not.

Signed-off-by: Michel Megens <dev@michelmegens.net>
Merge branch 'i2c'

	* I2C core
	* ATmega I2C bus
i2c: eeprom: added an I2C eeprom chip driver

Added a driver for the 24C02 I2C EEPROM chip, developed by Atmel. The
driver currently only supports read and write byte operations. A device
interface should be included in the next version.

Signed-off-by: Michel Megens <dev@michelmegens.net>
ETA/OS 1.1.0-rc1

Signed-off-by: Michel Megens <dev@michelmegens.net>