* Samsung's I2C controller

The Samsung's I2C controller is used to interface with I2C devices.

Required properties:
  - compatible: value should be either of the following.
      (a) "samsung, s3c2410-i2c", for i2c compatible with s3c2410 i2c.
      (b) "samsung, s3c2440-i2c", for i2c compatible with s3c2440 i2c.
      (c) "samsung, s3c2440-hdmiphy-i2c", for s3c2440-like i2c used
          inside HDMIPHY block found on several samsung SoCs
  - reg: physical base address of the controller and length of memory mapped
    region.
  - interrupts: interrupt number to the cpu.
  - samsung,i2c-sda-delay: Delay (in ns) applied to data line (SDA) edges.

Optional properties:
  - gpios: The order of the gpios should be the following: <SDA, SCL>.
    The gpio specifier depends on the gpio controller. Required in all
    cases except for "samsung,s3c2440-hdmiphy-i2c" whose input/output
    lines are permanently wired to the respective client
  - samsung,i2c-slave-addr: Slave address in multi-master enviroment. If not
    specified, default value is 0.
  - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not
    specified, the default value in Hz is 100000.
  - samsung,arbitration-gpios : Two GPIOs to use with the GPIO-based bus
    arbitration protocol (see below). The first should be an output, and is
    used to claim the I2C bus, the second should be an input, and signals that
    the other side wants to claim the bus. This allows two masters to share
    the same I2C bus.

Example:

	i2c@13870000 {
		compatible = "samsung,s3c2440-i2c";
		reg = <0x13870000 0x100>;
		interrupts = <345>;
		samsung,i2c-sda-delay = <100>;
		samsung,i2c-max-bus-freq = <100000>;
		gpios = <&gpd1 2 0 /* SDA */
			 &gpd1 3 0 /* SCL */>;
		#address-cells = <1>;
		#size-cells = <0>;

		wm8994@1a {
			compatible = "wlf,wm8994";
			reg = <0x1a>;
		};

		/* If you want GPIO-based bus arbitration */
		samsung,arbitration-gpios = <&gpf0 3 1 0 0>,	/* AP_CLAIM */
			<&gpe0 4 0 3 0>;			/* EC_CLAIM */
	};


GPIO-based Arbitration
======================
(documented here for want of a better place - an implementation is in the
exynos I2C driver)

This uses GPIO lines between the AP (Exynos) and an attached EC (embedded
controller) which both want to talk on the same I2C bus as master.

The AP and EC each have a 'bus claim' line, which is an output that the
other can see. These are both active low, with pull-ups enabled.

- AP_CLAIM: output from AP, signalling to the EC that the AP wants the bus
- EC_CLAIM: output from EC, signalling to the AP that the EC wants the bus


Algorithm
---------
The basic algorithm is to assert your line when you want the bus, then make
sure that the other side doesn't want it also. A detailed explanation is best
done with an example.

Let's say the AP wants to claim the bus. It:
1. Asserts AP_CLAIM
2. Waits a little bit for the other side to notice (slew time, say 10
microseconds)
3. Checks EC_CLAIM. If this is not asserted, then the AP has the bus, and
we are done
4. Otherwise, wait for a few milliseconds and see if EC_CLAIM is released
5. If not, back off, release the claim and wait for a few more milliseconds
6. Go back to 1 (until retry time has expired)

To release the bus, just de-assert the claim line. If the other wants the bus
it will notice soon enough.

The same algorithm applies on the EC side.
