Skip to content

Commit

Permalink
[PATCH] 2/5 powerpc: Rework PowerMac i2c part 2
Browse files Browse the repository at this point in the history
This is the continuation of the previous patch. This one removes the old
PowerMac i2c drivers (i2c-keywest and i2c-pmac-smu) and replaces them
both with a single stub driver that uses the new PowerMac low i2c layer.

Now that i2c-keywest is gone, the low-i2c code is extended to support
interrupt driver transfers. All i2c busses now appear as platform
devices. Compatibility with existing drivers should be maintained as the
i2c bus names have been kept identical, except for the SMU bus but in
that later case, all users has been fixed.

With that patch added, matching a device node to an i2c_adapter becomes
trivial.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Jan 9, 2006
1 parent 730745a commit a28d3af
Show file tree
Hide file tree
Showing 12 changed files with 563 additions and 1,364 deletions.
318 changes: 246 additions & 72 deletions arch/powerpc/platforms/powermac/low_i2c.c

Large diffs are not rendered by default.

18 changes: 1 addition & 17 deletions arch/powerpc/platforms/powermac/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,30 +650,14 @@ static int pmac_check_legacy_ioport(unsigned int baseport)

static int __init pmac_declare_of_platform_devices(void)
{
struct device_node *np, *npp;
struct device_node *np;

np = of_find_node_by_name(NULL, "valkyrie");
if (np)
of_platform_device_create(np, "valkyrie", NULL);
np = of_find_node_by_name(NULL, "platinum");
if (np)
of_platform_device_create(np, "platinum", NULL);
npp = of_find_node_by_name(NULL, "uni-n");
if (npp == NULL)
npp = of_find_node_by_name(NULL, "u3");
if (npp == NULL)
npp = of_find_node_by_name(NULL, "u4");
if (npp) {
for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) {
if (strncmp(np->name, "i2c", 3) == 0) {
of_platform_device_create(np, "uni-n-i2c",
NULL);
of_node_put(np);
break;
}
}
of_node_put(npp);
}
np = of_find_node_by_type(NULL, "smu");
if (np) {
of_platform_device_create(np, "smu", NULL);
Expand Down
24 changes: 7 additions & 17 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,17 @@ config I2C_IXP2000
This support is also available as a module. If so, the module
will be called i2c-ixp2000.

config I2C_KEYWEST
tristate "Powermac Keywest I2C interface"
config I2C_POWERMAC
tristate "Powermac I2C interface"
depends on I2C && PPC_PMAC
default y
help
This supports the use of the I2C interface in the combo-I/O
chip on recent Apple machines. Say Y if you have such a machine.

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

config I2C_PMAC_SMU
tristate "Powermac SMU I2C interface"
depends on I2C && PMAC_SMU
help
This supports the use of the I2C interface in the SMU
chip on recent Apple machines like the iMac G5. It is used
among others by the thermal control driver for those machines.
Say Y if you have such a machine.
This exposes the various PowerMac i2c interfaces to the linux i2c
layer and to userland. It is used by various drivers on the powemac
platform, thus should generally be enabled.

This support is also available as a module. If so, the module
will be called i2c-pmac-smu.
will be called i2c-powermac.

config I2C_MPC
tristate "MPC107/824x/85xx/52xx"
Expand Down
3 changes: 1 addition & 2 deletions drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ obj-$(CONFIG_I2C_ISA) += i2c-isa.o
obj-$(CONFIG_I2C_ITE) += i2c-ite.o
obj-$(CONFIG_I2C_IXP2000) += i2c-ixp2000.o
obj-$(CONFIG_I2C_IXP4XX) += i2c-ixp4xx.o
obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o
obj-$(CONFIG_I2C_PMAC_SMU) += i2c-pmac-smu.o
obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
obj-$(CONFIG_I2C_MPC) += i2c-mpc.o
obj-$(CONFIG_I2C_MV64XXX) += i2c-mv64xxx.o
obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
Expand Down
Loading

0 comments on commit a28d3af

Please sign in to comment.