Skip to content

Commit

Permalink
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/wsa/linux

Pull i2c updates from Wolfram Sang:
 "Highlights:

   - OF and ACPI helpers are now included in the core, and not in
     external files anymore.  This removes dependency problems for
     modules and is cleaner, in general.
   - mv64xxx-driver gains fifo usage to support mv78230
   - imx-driver overhaul to support VF610
   - various cleanups, most notably related to devm_* and CONFIG_PM
     usage
   - driver bugfixes and smaller feature additions"

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (51 commits)
  i2c: rcar: add rcar-H2 support
  i2c: sirf: retry 3 times as sometimes we get random noack and timeout
  i2c: sirf: support reverse direction of address
  i2c: sirf: fix the typo for setting bitrate to less than 100k
  i2c: sirf: we need to wait I2C_RESET status in resume
  i2c: sirf: reset i2c controller early after we get a noack
  i2c: designware: get SDA hold time, HCNT and LCNT configuration from ACPI
  i2c: designware: make HCNT/LCNT values configurable
  i2c: mpc: cleanup clock API use
  i2c: pnx: fix error return code in i2c_pnx_probe()
  i2c: ismt: add error return code in probe()
  i2c: mv64xxx: fix typo in binding documentation
  i2c: imx: use exact SoC revision to document binding
  i2c: move ACPI helpers into the core
  i2c: move OF helpers into the core
  i2c: mv64xxx: Fix timing issue on Armada XP (errata FE-8471889)
  i2c: mv64xxx: Add I2C Transaction Generator support
  i2c: powermac: fix return path on error
  Documentation: i2c: Fix example in instantiating-devices
  i2c: tiny-usb: do not use stack as URB transfer_buffer
  ...
  • Loading branch information
Linus Torvalds committed Sep 5, 2013
2 parents 45d9a22 + b720423 commit 00341b5
Show file tree
Hide file tree
Showing 72 changed files with 1,060 additions and 610 deletions.
16 changes: 3 additions & 13 deletions Documentation/acpi/enumeration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,9 @@ ACPI handle like:
I2C serial bus support
~~~~~~~~~~~~~~~~~~~~~~
The slaves behind I2C bus controller only need to add the ACPI IDs like
with the platform and SPI drivers. However the I2C bus controller driver
needs to call acpi_i2c_register_devices() after it has added the adapter.

An I2C bus (controller) driver does:

...
ret = i2c_add_numbered_adapter(adapter);
if (ret)
/* handle error */

of_i2c_register_devices(adapter);
/* Enumerate the slave devices behind this bus via ACPI */
acpi_i2c_register_devices(adapter);
with the platform and SPI drivers. The I2C core automatically enumerates
any slave devices behind the controller device once the adapter is
registered.

Below is an example of how to add ACPI support to the existing mpu3050
input driver:
Expand Down
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/i2c/i2c-imx.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
* Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX

Required properties:
- compatible : Should be "fsl,<chip>-i2c"
- compatible :
- "fsl,imx1-i2c" for I2C compatible with the one integrated on i.MX1 SoC
- "fsl,imx21-i2c" for I2C compatible with the one integrated on i.MX21 SoC
- "fsl,vf610-i2c" for I2C compatible with the one integrated on Vybrid vf610 SoC
- reg : Should contain I2C/HS-I2C registers location and length
- interrupts : Should contain I2C/HS-I2C interrupt

Expand Down
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Required properties :

- reg : Offset and length of the register set for the device
- compatible : Should be "marvell,mv64xxx-i2c" or "allwinner,sun4i-i2c"
or "marvell,mv78230-i2c"
- interrupts : The interrupt number

Optional properties :
Expand All @@ -20,3 +21,12 @@ Examples:
interrupts = <29>;
clock-frequency = <100000>;
};

For the Armada XP:

i2c@11000 {
compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
reg = <0x11000 0x100>;
interrupts = <29>;
clock-frequency = <100000>;
};
7 changes: 4 additions & 3 deletions Documentation/i2c/busses/i2c-piix4
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ this driver on those mainboards.
The ServerWorks Southbridges, the Intel 440MX, and the Victory66 are
identical to the PIIX4 in I2C/SMBus support.

The AMD SB700 and SP5100 chipsets implement two PIIX4-compatible SMBus
controllers. If your BIOS initializes the secondary controller, it will
be detected by this driver as an "Auxiliary SMBus Host Controller".
The AMD SB700, SB800, SP5100 and Hudson-2 chipsets implement two
PIIX4-compatible SMBus controllers. If your BIOS initializes the
secondary controller, it will be detected by this driver as
an "Auxiliary SMBus Host Controller".

If you own Force CPCI735 motherboard or other OSB4 based systems you may need
to change the SMBus Interrupt Select register so the SMBus controller uses
Expand Down
2 changes: 1 addition & 1 deletion Documentation/i2c/instantiating-devices
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ i2c_board_info which is registered by calling i2c_register_board_info().

Example (from omap2 h4):

static struct i2c_board_info __initdata h4_i2c_board_info[] = {
static struct i2c_board_info h4_i2c_board_info[] __initdata = {
{
I2C_BOARD_INFO("isp1301_omap", 0x2d),
.irq = OMAP_GPIO_IRQ(125),
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/44x/warp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/of_gpio.h>
#include <linux/of_i2c.h>
#include <linux/slab.h>
#include <linux/export.h>

Expand Down
6 changes: 0 additions & 6 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ config ACPI_DOCK
This driver supports ACPI-controlled docking stations and removable
drive bays such as the IBM Ultrabay and the Dell Module Bay.

config ACPI_I2C
def_tristate I2C
depends on I2C
help
ACPI I2C enumeration support.

config ACPI_PROCESSOR
tristate "Processor"
select THERMAL
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ obj-$(CONFIG_ACPI_HED) += hed.o
obj-$(CONFIG_ACPI_EC_DEBUGFS) += ec_sys.o
obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
obj-$(CONFIG_ACPI_BGRT) += bgrt.o
obj-$(CONFIG_ACPI_I2C) += acpi_i2c.o

# processor has its own "processor." module_param namespace
processor-y := processor_driver.o processor_throttling.o
Expand Down
103 changes: 0 additions & 103 deletions drivers/acpi/acpi_i2c.c

This file was deleted.

1 change: 0 additions & 1 deletion drivers/gpu/drm/tilcdc/tilcdc_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

#include <linux/i2c.h>
#include <linux/of_i2c.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/consumer.h>
#include <drm/drm_encoder_slave.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

#include <linux/i2c.h>
#include <linux/of_i2c.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/pinctrl/pinmux.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/host1x/drm/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <linux/module.h>
#include <linux/of_gpio.h>
#include <linux/of_i2c.h>
#include <linux/i2c.h>

#include "drm.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ config I2C_CPM

config I2C_DAVINCI
tristate "DaVinci I2C driver"
depends on ARCH_DAVINCI
depends on ARCH_DAVINCI || ARCH_KEYSTONE
help
Support for TI DaVinci I2C controller driver.

Expand Down
3 changes: 0 additions & 3 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_i2c.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/platform_data/dma-atmel.h>
Expand Down Expand Up @@ -775,8 +774,6 @@ static int at91_twi_probe(struct platform_device *pdev)
return rc;
}

of_i2c_register_devices(&dev->adapter);

dev_info(dev->dev, "AT91 i2c bus driver.\n");
return 0;
}
Expand Down
16 changes: 11 additions & 5 deletions drivers/i2c/busses/i2c-bfin-twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ static struct i2c_algorithm bfin_twi_algorithm = {
.functionality = bfin_twi_functionality,
};

#ifdef CONFIG_PM_SLEEP
static int i2c_bfin_twi_suspend(struct device *dev)
{
struct bfin_twi_iface *iface = dev_get_drvdata(dev);
Expand Down Expand Up @@ -619,6 +620,10 @@ static int i2c_bfin_twi_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(i2c_bfin_twi_pm,
i2c_bfin_twi_suspend, i2c_bfin_twi_resume);
#define I2C_BFIN_TWI_PM_OPS (&i2c_bfin_twi_pm)
#else
#define I2C_BFIN_TWI_PM_OPS NULL
#endif

static int i2c_bfin_twi_probe(struct platform_device *pdev)
{
Expand Down Expand Up @@ -669,8 +674,9 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
p_adap->timeout = 5 * HZ;
p_adap->retries = 3;

rc = peripheral_request_list((unsigned short *)pdev->dev.platform_data,
"i2c-bfin-twi");
rc = peripheral_request_list(
(unsigned short *)dev_get_platdata(&pdev->dev),
"i2c-bfin-twi");
if (rc) {
dev_err(&pdev->dev, "Can't setup pin mux!\n");
goto out_error_pin_mux;
Expand Down Expand Up @@ -717,7 +723,7 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
free_irq(iface->irq, iface);
out_error_req_irq:
out_error_no_irq:
peripheral_free_list((unsigned short *)pdev->dev.platform_data);
peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev));
out_error_pin_mux:
iounmap(iface->regs_base);
out_error_ioremap:
Expand All @@ -733,7 +739,7 @@ static int i2c_bfin_twi_remove(struct platform_device *pdev)

i2c_del_adapter(&(iface->adap));
free_irq(iface->irq, iface);
peripheral_free_list((unsigned short *)pdev->dev.platform_data);
peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev));
iounmap(iface->regs_base);
kfree(iface);

Expand All @@ -746,7 +752,7 @@ static struct platform_driver i2c_bfin_twi_driver = {
.driver = {
.name = "i2c-bfin-twi",
.owner = THIS_MODULE,
.pm = &i2c_bfin_twi_pm,
.pm = I2C_BFIN_TWI_PM_OPS,
},
};

Expand Down
5 changes: 3 additions & 2 deletions drivers/i2c/busses/i2c-cbus-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ static int cbus_i2c_probe(struct platform_device *pdev)
chost->clk_gpio = of_get_gpio(dnode, 0);
chost->dat_gpio = of_get_gpio(dnode, 1);
chost->sel_gpio = of_get_gpio(dnode, 2);
} else if (pdev->dev.platform_data) {
struct i2c_cbus_platform_data *pdata = pdev->dev.platform_data;
} else if (dev_get_platdata(&pdev->dev)) {
struct i2c_cbus_platform_data *pdata =
dev_get_platdata(&pdev->dev);
chost->clk_gpio = pdata->clk_gpio;
chost->dat_gpio = pdata->dat_gpio;
chost->sel_gpio = pdata->sel_gpio;
Expand Down
6 changes: 0 additions & 6 deletions drivers/i2c/busses/i2c-cpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <linux/dma-mapping.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/of_i2c.h>
#include <sysdev/fsl_soc.h>
#include <asm/cpm.h>

Expand Down Expand Up @@ -681,11 +680,6 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
dev_dbg(&ofdev->dev, "hw routines for %s registered.\n",
cpm->adap.name);

/*
* register OF I2C devices
*/
of_i2c_register_devices(&cpm->adap);

return 0;
out_shut:
cpm_i2c_shutdown(cpm);
Expand Down
6 changes: 1 addition & 5 deletions drivers/i2c/busses/i2c-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
#include <linux/slab.h>
#include <linux/cpufreq.h>
#include <linux/gpio.h>
#include <linux/of_i2c.h>
#include <linux/of_device.h>

#include <mach/hardware.h>
#include <linux/platform_data/i2c-davinci.h>

/* ----- global defines ----------------------------------------------- */
Expand Down Expand Up @@ -665,7 +662,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
#endif
dev->dev = &pdev->dev;
dev->irq = irq->start;
dev->pdata = dev->dev->platform_data;
dev->pdata = dev_get_platdata(&dev->dev);
platform_set_drvdata(pdev, dev);

if (!dev->pdata && pdev->dev.of_node) {
Expand Down Expand Up @@ -728,7 +725,6 @@ static int davinci_i2c_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failure adding adapter\n");
goto err_unuse_clocks;
}
of_i2c_register_devices(adap);

return 0;

Expand Down
Loading

0 comments on commit 00341b5

Please sign in to comment.