Skip to content

Commit

Permalink
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare…
Browse files Browse the repository at this point in the history
…-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c: Fix OMAP clock prescaler to match the comment
  i2c: Refactor a kfree in i2c-dev
  i2c: Fix return value check in i2c-dev
  i2c: Enable PEC on more i2c-i801 devices
  i2c: Discard the i2c algo del_bus wrappers
  i2c: New ARM Versatile/Realview bus driver
  i2c: fix broken ds1337 initialization
  i2c: i2c-i801 documentation update
  i2c: Use the __ATTR macro where possible
  i2c: Whitespace cleanups
  i2c: Use put_user instead of copy_to_user where possible
  i2c: New Atmel AT91 bus driver
  i2c: Add support for nested i2c bus locking
  i2c: Cleanups to the i2c-nforce2 bus driver
  i2c: Add request/release_mem_region to i2c-ibm_iic bus driver
  i2c: New Philips PNX bus driver
  i2c: Delete the broken i2c-ite bus driver
  i2c: Update the list of driver IDs
  i2c: Fix documentation typos
  • Loading branch information
Linus Torvalds committed Dec 12, 2006
2 parents 3640543 + d7aef13 commit 659dba3
Show file tree
Hide file tree
Showing 68 changed files with 1,730 additions and 1,590 deletions.
11 changes: 0 additions & 11 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>

---------------------------

What: i2c-ite and i2c-algo-ite drivers
When: September 2006
Why: These drivers never compiled since they were added to the kernel
tree 5 years ago. This feature removal can be reevaluated if
someone shows interest in the drivers, fixes them and takes over
maintenance.
http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
Who: Jean Delvare <khali@linux-fr.org>

---------------------------

What: Bridge netfilter deferred IPv4/IPv6 output hook calling
When: January 2007
Why: The deferred output hooks are a layering violation causing unusual
Expand Down
2 changes: 1 addition & 1 deletion Documentation/i2c/busses/i2c-amd8111
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Supported adapters:

Datasheets:
AMD datasheet not yet available, but almost everything can be found
in publically available ACPI 2.0 specification, which the adapter
in the publicly available ACPI 2.0 specification, which the adapter
follows.

Author: Vojtech Pavlik <vojtech@suse.cz>
Expand Down
5 changes: 4 additions & 1 deletion Documentation/i2c/busses/i2c-i801
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Supported adapters:
* Intel 82801EB/ER (ICH5) (HW PEC supported, 32 byte buffer not supported)
* Intel 6300ESB
* Intel 82801FB/FR/FW/FRW (ICH6)
* Intel ICH7
* Intel 82801G (ICH7)
* Intel 631xESB/632xESB (ESB2)
* Intel 82801H (ICH8)
* Intel ICH9
Datasheets: Publicly available at the Intel website

Authors:
Expand Down
6 changes: 3 additions & 3 deletions Documentation/i2c/busses/i2c-nforce2
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Supported adapters:
* nForce4 MCP51 10de:0264
* nForce4 MCP55 10de:0368

Datasheet: not publically available, but seems to be similar to the
Datasheet: not publicly available, but seems to be similar to the
AMD-8111 SMBus 2.0 adapter.

Authors:
Hans-Frieder Vogt <hfvogt@arcor.de>,
Hans-Frieder Vogt <hfvogt@gmx.net>,
Thomas Leibold <thomas@plx.com>,
Patrick Dreker <patrick@dreker.de>

Expand All @@ -38,7 +38,7 @@ Notes
-----

The SMBus adapter in the nForce2 chipset seems to be very similar to the
SMBus 2.0 adapter in the AMD-8111 southbridge. However, I could only get
SMBus 2.0 adapter in the AMD-8111 south bridge. However, I could only get
the driver to work with direct I/O access, which is different to the EC
interface of the AMD-8111. Tested on Asus A7N8X. The ACPI DSDT table of the
Asus A7N8X lists two SMBuses, both of which are supported by this driver.
2 changes: 1 addition & 1 deletion arch/arm/mach-pnx4008/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#

obj-y := core.o irq.o time.o clock.o gpio.o serial.o dma.o
obj-y := core.o irq.o time.o clock.o gpio.o serial.o dma.o i2c.o
obj-m :=
obj-n :=
obj- :=
Expand Down
167 changes: 167 additions & 0 deletions arch/arm/mach-pnx4008/i2c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/*
* I2C initialization for PNX4008.
*
* Author: Vitaly Wool <vitalywool@gmail.com>
*
* 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/

#include <linux/clk.h>
#include <linux/i2c.h>
#include <linux/i2c-pnx.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <asm/arch/platform.h>
#include <asm/arch/i2c.h>

static int set_clock_run(struct platform_device *pdev)
{
struct clk *clk;
char name[10];
int retval = 0;

snprintf(name, 10, "i2c%d_ck", pdev->id);
clk = clk_get(&pdev->dev, name);
if (!IS_ERR(clk)) {
clk_set_rate(clk, 1);
clk_put(clk);
} else
retval = -ENOENT;

return retval;
}

static int set_clock_stop(struct platform_device *pdev)
{
struct clk *clk;
char name[10];
int retval = 0;

snprintf(name, 10, "i2c%d_ck", pdev->id);
clk = clk_get(&pdev->dev, name);
if (!IS_ERR(clk)) {
clk_set_rate(clk, 0);
clk_put(clk);
} else
retval = -ENOENT;

return retval;
}

static int i2c_pnx_suspend(struct platform_device *pdev, pm_message_t state)
{
int retval = 0;
#ifdef CONFIG_PM
retval = set_clock_run(pdev);
#endif
return retval;
}

static int i2c_pnx_resume(struct platform_device *pdev)
{
int retval = 0;
#ifdef CONFIG_PM
retval = set_clock_run(pdev);
#endif
return retval;
}

static u32 calculate_input_freq(struct platform_device *pdev)
{
return HCLK_MHZ;
}


static struct i2c_pnx_algo_data pnx_algo_data0 = {
.base = PNX4008_I2C1_BASE,
.irq = I2C_1_INT,
};

static struct i2c_pnx_algo_data pnx_algo_data1 = {
.base = PNX4008_I2C2_BASE,
.irq = I2C_2_INT,
};

static struct i2c_pnx_algo_data pnx_algo_data2 = {
.base = (PNX4008_USB_CONFIG_BASE + 0x300),
.irq = USB_I2C_INT,
};

static struct i2c_adapter pnx_adapter0 = {
.name = I2C_CHIP_NAME "0",
.algo_data = &pnx_algo_data0,
};
static struct i2c_adapter pnx_adapter1 = {
.name = I2C_CHIP_NAME "1",
.algo_data = &pnx_algo_data1,
};

static struct i2c_adapter pnx_adapter2 = {
.name = "USB-I2C",
.algo_data = &pnx_algo_data2,
};

static struct i2c_pnx_data i2c0_data = {
.suspend = i2c_pnx_suspend,
.resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
.adapter = &pnx_adapter0,
};

static struct i2c_pnx_data i2c1_data = {
.suspend = i2c_pnx_suspend,
.resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
.adapter = &pnx_adapter1,
};

static struct i2c_pnx_data i2c2_data = {
.suspend = i2c_pnx_suspend,
.resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
.adapter = &pnx_adapter2,
};

static struct platform_device i2c0_device = {
.name = "pnx-i2c",
.id = 0,
.dev = {
.platform_data = &i2c0_data,
},
};

static struct platform_device i2c1_device = {
.name = "pnx-i2c",
.id = 1,
.dev = {
.platform_data = &i2c1_data,
},
};

static struct platform_device i2c2_device = {
.name = "pnx-i2c",
.id = 2,
.dev = {
.platform_data = &i2c2_data,
},
};

static struct platform_device *devices[] __initdata = {
&i2c0_device,
&i2c1_device,
&i2c2_device,
};

void __init pnx4008_register_i2c_devices(void)
{
platform_add_devices(devices, ARRAY_SIZE(devices));
}
13 changes: 13 additions & 0 deletions arch/arm/mach-realview/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ struct platform_device realview_smc91x_device = {
.resource = realview_smc91x_resources,
};

static struct resource realview_i2c_resource = {
.start = REALVIEW_I2C_BASE,
.end = REALVIEW_I2C_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
};

struct platform_device realview_i2c_device = {
.name = "versatile-i2c",
.id = -1,
.num_resources = 1,
.resource = &realview_i2c_resource,
};

#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)

static unsigned int realview_mmc_status(struct device *dev)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-realview/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static struct amba_device name##_device = { \

extern struct platform_device realview_flash_device;
extern struct platform_device realview_smc91x_device;
extern struct platform_device realview_i2c_device;
extern struct mmc_platform_data realview_mmc0_plat_data;
extern struct mmc_platform_data realview_mmc1_plat_data;
extern struct clk realview_clcd_clk;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-realview/realview_eb.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static void __init realview_eb_init(void)

platform_device_register(&realview_flash_device);
platform_device_register(&realview_smc91x_device);
platform_device_register(&realview_i2c_device);

for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/mach-versatile/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,19 @@ static struct platform_device smc91x_device = {
.resource = smc91x_resources,
};

static struct resource versatile_i2c_resource = {
.start = VERSATILE_I2C_BASE,
.end = VERSATILE_I2C_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
};

static struct platform_device versatile_i2c_device = {
.name = "versatile-i2c",
.id = -1,
.num_resources = 1,
.resource = &versatile_i2c_resource,
};

#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)

unsigned int mmc_status(struct device *dev)
Expand Down Expand Up @@ -775,6 +788,7 @@ void __init versatile_init(void)
clk_register(&versatile_clcd_clk);

platform_device_register(&versatile_flash_device);
platform_device_register(&versatile_i2c_device);
platform_device_register(&smc91x_device);

for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acorn/char/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static int __init i2c_ioc_init(void)
if (ret >= 0){
ret = misc_register(&rtc_dev);
if(ret < 0)
i2c_bit_del_bus(&ioc_ops);
i2c_del_adapter(&ioc_ops);
}

return ret;
Expand Down
11 changes: 0 additions & 11 deletions drivers/i2c/algos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ config I2C_ALGOPCA
This support is also available as a module. If so, the module
will be called i2c-algo-pca.

config I2C_ALGOITE
tristate "ITE I2C Algorithm"
depends on MIPS_ITE8172 && I2C
help
This supports the use of the ITE8172 I2C interface found on some MIPS
systems. Say Y if you have one of these. You should also say Y for
the ITE I2C peripheral driver support below.

This support is also available as a module. If so, the module
will be called i2c-algo-ite.

config I2C_ALGO8XX
tristate "MPC8xx CPM I2C interface"
depends on 8xx && I2C
Expand Down
1 change: 0 additions & 1 deletion drivers/i2c/algos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
obj-$(CONFIG_I2C_ALGOBIT) += i2c-algo-bit.o
obj-$(CONFIG_I2C_ALGOPCF) += i2c-algo-pcf.o
obj-$(CONFIG_I2C_ALGOPCA) += i2c-algo-pca.o
obj-$(CONFIG_I2C_ALGOITE) += i2c-algo-ite.o
obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o

ifeq ($(CONFIG_I2C_DEBUG_ALGO),y)
Expand Down
8 changes: 0 additions & 8 deletions drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)

return i2c_add_adapter(adap);
}


int i2c_bit_del_bus(struct i2c_adapter *adap)
{
return i2c_del_adapter(adap);
}

EXPORT_SYMBOL(i2c_bit_add_bus);
EXPORT_SYMBOL(i2c_bit_del_bus);

MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
Expand Down
Loading

0 comments on commit 659dba3

Please sign in to comment.