u-boot-brain/drivers/i2c
Peng Fan 71204e95ce i2c: mxc: refactor i2c driver and support dm
1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
   used for non-DM and DM.
2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
   registers based on `base` entry of `struct mxc_i2c_bus`.
3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
   flags. A new flag is introduced, I2C_QUIRK_FLAG.
4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
   Make most functions common to DM and non-DM, try to avoid duplicated code.
5. Support DM, but pinctrl is not included. Pinmux setting is still set
   by setup_i2c, but we do not need bus_i2c_init for DM.
6. struct i2c_parms and struct sram_data are removed.
7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
   paramter of bus_i2c_init is modified to i2c index. Add new prototype
   i2c_idle_bus and force_bus_idle. Since bus_i2c_init is not good for
   DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus.
   Board file take the responsibility to implement this function, like this:
   "
   int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
   {
	   if (i2c_bus->index == 0)
		   force_bus_idle(i2c_pads_info0);
	   else if (i2c_bus->index == 1)
		   force_bus_idle(i2c_pads_info1);
	   else
		   xxxxxx
   }
   "
8. Introduce a weak function, enable_i2c_clk
9. Tested on an i.MX7 platform. Log info:
 => dm tree
 Class       Probed   Name
 ----------------------------------------
 root        [ + ]    root_driver
 simple_bus  [   ]    |-- soc
 simple_bus  [   ]    |   |-- aips-bus@30000000
 simple_bus  [   ]    |   |   |-- anatop@30360000
 simple_bus  [   ]    |   |   `-- snvs@30370000
 simple_bus  [   ]    |   |-- aips-bus@30400000
 simple_bus  [   ]    |   `-- aips-bus@30800000
 i2c         [   ]    |       |-- i2c@30a20000
 i2c         [   ]    |       `-- i2c@30a40000
 simple_bus  [   ]    `-- regulators
 => i2c dev 0
 Setting bus to 0
 => i2c probe
 Valid chip addresses: 08 50
 => i2c md 8 31
 0031: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-14 18:49:36 -06:00
..
adi_i2c.c dm: i2c: Make API accessible even without CONFIG_DM 2015-02-12 10:35:33 -07:00
davinci_i2c.c i2c, davinci: convert driver to new mutlibus/mutliadapter framework 2014-04-17 17:24:38 -04:00
davinci_i2c.h i2c, davinci: convert driver to new mutlibus/mutliadapter framework 2014-04-17 17:24:38 -04:00
designware_i2c.c i2c: designware: Convert driver to multibus/multiadapter framework 2014-10-29 08:56:23 +01:00
designware_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
fsl_i2c.c linux/kernel.h: sync min, max, min3, max3 macros with Linux 2014-11-23 06:48:30 -05:00
fti2c010.c i2c: fti2c010: fix compiler warning on paddr[] 2014-01-13 08:18:38 +01:00
fti2c010.h drivers/i2c: Update fti2c010.[ch], i2c_core.c to use SPDX identifiers 2013-07-25 08:51:42 -04:00
i2c_core.c i2c: Correct spelling error 2014-12-08 07:27:22 +01:00
i2c-emul-uclass.c dm: i2c: Add I2C emulation driver for sandbox 2014-12-11 13:18:42 -07:00
i2c-gpio.c dm: i2c-gpio: Remove redundant dm_gpio_set_value() call 2015-05-05 20:58:41 -06:00
i2c-uclass-compat.c dm: i2c: Add two more I2C init functions to the compatibility layer 2015-01-29 17:10:01 -07:00
i2c-uclass.c dm: i2c: Add a function to find out the chip offset length 2015-05-14 18:49:33 -06:00
i2c-uniphier-f.c common: Make sure arch-specific map_sysmem() is defined 2015-04-18 11:11:09 -06:00
i2c-uniphier.c common: Make sure arch-specific map_sysmem() is defined 2015-04-18 11:11:09 -06:00
ihs_i2c.c cosmetic: replace MIN, MAX with min, max 2014-09-24 18:30:29 -04:00
Kconfig sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig 2015-04-18 11:11:38 -06:00
kona_i2c.c dm: i2c: Make API accessible even without CONFIG_DM 2015-02-12 10:35:33 -07:00
lpc32xx_i2c.c lpc32xx: i2c: add LPC32xx I2C interface support 2015-04-10 14:23:07 +02:00
Makefile dm: i2c: add i2c-gpio driver 2015-04-18 11:11:17 -06:00
mv_i2c.c mv_i2c: fix warnings on 64-bit builds 2015-03-18 09:13:17 +01:00
mv_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
mvtwsi.c i2c: mvtwsi: Support for up to 4 different controllers 2015-04-15 16:33:17 +02:00
mxc_i2c.c i2c: mxc: refactor i2c driver and support dm 2015-05-14 18:49:36 -06:00
mxs_i2c.c i2c: mxs: Add support for I2C 1 on i.MX28 2014-10-29 08:56:07 +01:00
omap24xx_i2c.c i2c, omap24xx: add i2c deblock sequenz 2014-07-16 05:18:55 +02:00
omap24xx_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pca9564_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ppc4xx_i2c.c ppc4xx: Handle i2c stuck on combined xfer 2014-11-10 06:44:30 +01:00
rcar_i2c.c i2c: rcar_i2c: Fix order of restart and clear status 2014-11-10 06:47:37 +01:00
s3c24x0_i2c.c dm: core: Rename driver data function to dev_get_driver_data() 2015-04-18 11:11:19 -06:00
s3c24x0_i2c.h i2c: s3c24xx: add hsi2c controller support 2013-10-17 07:20:26 +02:00
sandbox_i2c.c dm: i2c: Add an explicit test mode to the sandbox I2C driver 2015-05-05 20:58:19 -06:00
sh_i2c.c i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 17:41:48 +09:00
sh_sh7734_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
soft_i2c.c ARM: IXP: Remove the IXP architecture support 2014-02-06 02:51:52 +01:00
tegra_i2c.c dm: core: Rename driver data function to dev_get_driver_data() 2015-04-18 11:11:19 -06:00
tsi108_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
u8500_i2c.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
u8500_i2c.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
zynq_i2c.c i2c: zynq: Fixed compilation errors when using DEBUG 2014-05-08 07:03:37 +02:00