Skip to content

Commit

Permalink
Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/…
Browse files Browse the repository at this point in the history
…wsa/linux

Pull embedded i2c changes from Wolfram Sang:
 "Changes for the "embedded" part of the I2C subsystem:

   - lots of devicetree conversions of drivers (and preparations for
     that)
   - big cleanups for drivers for OMAP, Tegra, Nomadik, Blackfin
   - Rafael's struct dev_pm_ops conversion patches for I2C
   - usual driver cleanups and fixes

  All patches have been in linux-next for an apropriate time and all
  patches touching files outside of i2c-folders should have proper acks
  from the maintainers."

* 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux: (60 commits)
  Revert "i2c: tegra: convert normal suspend/resume to *_noirq"
  I2C: MV64XYZ: Add Device Tree support
  i2c: stu300: use devm managed resources
  i2c: i2c-ocores: support for 16bit and 32bit IO
  V4L/DVB: mfd: use reg_shift instead of regstep
  i2c: i2c-ocores: Use reg-shift property
  i2c: i2c-ocores: DT bindings and minor fixes.
  i2c: mv64xxxx: remove EXPERIMENTAL tag
  i2c-s3c2410: Use plain pm_runtime_put()
  i2c: s3c2410: Fix pointer type passed to of_match_node()
  i2c: mxs: Set I2C timing registers for mxs-i2c
  i2c: i2c-bfin-twi: Move blackfin TWI register access Macro to head file.
  i2c: i2c-bfin-twi: Move TWI peripheral pin request array to platform data.
  i2c:i2c-bfin-twi: include twi head file
  i2c:i2c-bfin-twi: TWI fails to restart next transfer in high system load.
  i2c: i2c-bfin-twi: Tighten condition when failing I2C transfer if MEN bit is reset unexpectedly.
  i2c: i2c-bfin-twi: Break dead waiting loop if i2c device misbehaves.
  i2c: i2c-bfin-twi: Improve the patch for bug "Illegal i2c bus lock upon certain transfer scenarios".
  i2c: i2c-bfin-twi: Illegal i2c bus lock upon certain transfer scenarios.
  i2c-mv64xxxx: allow more than one driver instance
  ...

Conflicts:
	drivers/i2c/busses/i2c-nomadik.c
  • Loading branch information
Linus Torvalds committed Jul 28, 2012
2 parents f7da9cd + 5db20c4 commit a410963
Show file tree
Hide file tree
Showing 25 changed files with 693 additions and 567 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/i2c/i2c-mxs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Required properties:
- compatible: Should be "fsl,<chip>-i2c"
- reg: Should contain registers location and length
- interrupts: Should contain ERROR and DMA interrupts
- clock-frequency: Desired I2C bus clock frequency in Hz.
Only 100000Hz and 400000Hz modes are supported.

Examples:

Expand All @@ -13,4 +15,5 @@ i2c0: i2c@80058000 {
compatible = "fsl,imx28-i2c";
reg = <0x80058000 2000>;
interrupts = <111 68>;
clock-frequency = <100000>;
};
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/i2c/i2c-ocores.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Device tree configuration for i2c-ocores

Required properties:
- compatible : "opencores,i2c-ocores"
- reg : bus address start and address range size of device
- interrupts : interrupt number
- clock-frequency : frequency of bus clock in Hz
- #address-cells : should be <1>
- #size-cells : should be <0>

Optional properties:
- reg-shift : device register offsets are shifted by this value
- reg-io-width : io register width in bytes (1, 2 or 4)
- regstep : deprecated, use reg-shift above

Example:

i2c0: ocores@a0000000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "opencores,i2c-ocores";
reg = <0xa0000000 0x8>;
interrupts = <10>;
clock-frequency = <20000000>;

reg-shift = <0>; /* 8 bit registers */
reg-io-width = <1>; /* 8 bit read/write */

dummy@60 {
compatible = "dummy";
reg = <0x60>;
};
};
19 changes: 18 additions & 1 deletion Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* I2C
* Marvell MMP I2C controller

Required properties :

Expand Down Expand Up @@ -32,3 +32,20 @@ Examples:
interrupts = <58>;
};

* Marvell MV64XXX I2C controller

Required properties :

- reg : Offset and length of the register set for the device
- compatible : Should be "marvell,mv64xxx-i2c"
- interrupts : The interrupt number
- clock-frequency : Desired I2C bus clock frequency in Hz.

Examples:

i2c@11000 {
compatible = "marvell,mv64xxx-i2c";
reg = <0x11000 0x20>;
interrupts = <29>;
clock-frequency = <100000>;
};
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/imx28.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@
compatible = "fsl,imx28-i2c";
reg = <0x80058000 2000>;
interrupts = <111 68>;
clock-frequency = <100000>;
status = "disabled";
};

Expand All @@ -669,6 +670,7 @@
compatible = "fsl,imx28-i2c";
reg = <0x8005a000 2000>;
interrupts = <110 69>;
clock-frequency = <100000>;
status = "disabled";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/platform_data/i2c-nomadik.h>
#include <linux/gpio.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl022.h>
Expand All @@ -40,7 +41,6 @@
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>

#include <plat/i2c.h>
#include <plat/ste_dma40.h>
#include <plat/gpio-nomadik.h>

Expand Down
24 changes: 6 additions & 18 deletions arch/arm/mach-ux500/devices-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <linux/dma-mapping.h>
#include <linux/sys_soc.h>
#include <linux/amba/bus.h>
#include <plat/i2c.h>
#include <linux/platform_data/i2c-nomadik.h>
#include <mach/crypto-ux500.h>

struct spi_master_cntlr;
Expand Down Expand Up @@ -56,27 +56,15 @@ dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,

struct nmk_i2c_controller;

static inline struct platform_device *
static inline struct amba_device *
dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
struct nmk_i2c_controller *data)
{
struct resource res[] = {
DEFINE_RES_MEM(base, SZ_4K),
DEFINE_RES_IRQ(irq),
};
/* Conjure a name similar to what the platform device used to have */
char name[16];

struct platform_device_info pdevinfo = {
.parent = parent,
.name = "nmk-i2c",
.id = id,
.res = res,
.num_res = ARRAY_SIZE(res),
.data = data,
.size_data = sizeof(*data),
.dma_mask = DMA_BIT_MASK(32),
};

return platform_device_register_full(&pdevinfo);
snprintf(name, sizeof(name), "nmk-i2c.%d", id);
return amba_apb_device_add(parent, name, base, SZ_4K, irq, 0, data, 0);
}

static inline struct amba_device *
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-mxc/include/mach/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
**/
struct imxi2c_platform_data {
int bitrate;
u32 bitrate;
};

#endif /* __ASM_ARCH_I2C_H_ */
7 changes: 4 additions & 3 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ config I2C_MPC

config I2C_MV64XXX
tristate "Marvell mv64xxx I2C Controller"
depends on (MV64X60 || PLAT_ORION) && EXPERIMENTAL
depends on (MV64X60 || PLAT_ORION)
help
If you say yes to this option, support will be included for the
built-in I2C interface on the Marvell 64xxx line of host bridges.
Expand All @@ -483,10 +483,11 @@ config I2C_MXS

config I2C_NOMADIK
tristate "ST-Ericsson Nomadik/Ux500 I2C Controller"
depends on PLAT_NOMADIK
depends on ARM_AMBA
help
If you say yes to this option, support will be included for the
I2C interface from ST-Ericsson's Nomadik and Ux500 architectures.
I2C interface from ST-Ericsson's Nomadik and Ux500 architectures,
as well as the STA2X11 PCIe I/O HUB.

config I2C_NUC900
tristate "NUC900 I2C Driver"
Expand Down
13 changes: 7 additions & 6 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,30 +279,31 @@ static int __devexit at91_i2c_remove(struct platform_device *pdev)

/* NOTE: could save a few mA by keeping clock off outside of at91_xfer... */

static int at91_i2c_suspend(struct platform_device *pdev, pm_message_t mesg)
static int at91_i2c_suspend(struct device *dev)
{
clk_disable(twi_clk);
return 0;
}

static int at91_i2c_resume(struct platform_device *pdev)
static int at91_i2c_resume(struct device *dev)
{
return clk_enable(twi_clk);
}

static SIMPLE_DEV_PM_OPS(at91_i2c_pm, at91_i2c_suspend, at91_i2c_resume);
#define AT91_I2C_PM (&at91_i2c_pm)

#else
#define at91_i2c_suspend NULL
#define at91_i2c_resume NULL
#define AT91_I2C_PM NULL
#endif

static struct platform_driver at91_i2c_driver = {
.probe = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove),
.suspend = at91_i2c_suspend,
.resume = at91_i2c_resume,
.driver = {
.name = "at91_i2c",
.owner = THIS_MODULE,
.pm = AT91_I2C_PM,
},
};

Expand Down
Loading

0 comments on commit a410963

Please sign in to comment.