diff options
author | Simon Glass <sjg@chromium.org> | 2011-09-30 14:28:33 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-10-04 14:53:26 -0700 |
commit | 6e70feeabbce4649c5e089e83a1a94d7fa06e91a (patch) | |
tree | d53b047f9ab3cf73d431eddba70b39db5ac45592 /drivers | |
parent | e1a5c912f08e82345f697c0b57eb34f7051dbd87 (diff) |
tegra: Make i2c driver common
The T20 and T30 i2c peripherals can use the same driver. This renames the
driver and puts the header file into the common arch-tegra directory.
BUG=chromium-os:19004
TEST=build and boot on seaboard
Change-Id: Iec76bb27340db037fdc67b3509fd35f7b5aaeb34
Reviewed-on: http://gerrit.chromium.org/gerrit/8643
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/Makefile | 2 | ||||
-rw-r--r-- | drivers/i2c/tegra_i2c.c (renamed from drivers/i2c/tegra2_i2c.c) | 14 | ||||
-rw-r--r-- | drivers/tpm/slb9635_i2c/tpm_proto.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile index d3db8dc5e0..17624cd6cd 100644 --- a/drivers/i2c/Makefile +++ b/drivers/i2c/Makefile @@ -42,7 +42,7 @@ COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o COBJS-$(CONFIG_SPEAR_I2C) += spr_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o -COBJS-$(CONFIG_TEGRA2_I2C) += tegra2_i2c.o +COBJS-$(CONFIG_TEGRA_I2C) += tegra_i2c.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/i2c/tegra2_i2c.c b/drivers/i2c/tegra_i2c.c index 2d290872dd..c51dd90692 100644 --- a/drivers/i2c/tegra2_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -26,10 +26,10 @@ #include <asm/io.h> #include <asm/arch-tegra/bitfield.h> #include <asm/arch-tegra/clk_rst.h> +#include <asm/arch-tegra/i2c.h> #include <asm/arch/clock.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> -#include <asm/arch/tegra2_i2c.h> #include <fdt_decode.h> DECLARE_GLOBAL_DATA_PTR; @@ -348,7 +348,7 @@ exit: return error; } -static int tegra2_i2c_write_data(u32 addr, u8 *data, u32 len) +static int tegra_i2c_write_data(u32 addr, u8 *data, u32 len) { int error; struct i2c_trans_info trans_info; @@ -361,12 +361,12 @@ static int tegra2_i2c_write_data(u32 addr, u8 *data, u32 len) error = send_recv_packets(&i2c_controllers[i2c_bus_num], &trans_info); if (error) - debug("tegra2_i2c_write_data: Error (%d) !!!\n", error); + debug("tegra_i2c_write_data: Error (%d) !!!\n", error); return error; } -static int tegra2_i2c_read_data(u32 addr, u8 *data, u32 len) +static int tegra_i2c_read_data(u32 addr, u8 *data, u32 len) { int error; struct i2c_trans_info trans_info; @@ -379,7 +379,7 @@ static int tegra2_i2c_read_data(u32 addr, u8 *data, u32 len) error = send_recv_packets(&i2c_controllers[i2c_bus_num], &trans_info); if (error) - debug("tegra2_i2c_read_data: Error (%d) !!!\n", error); + debug("tegra_i2c_read_data: Error (%d) !!!\n", error); return error; } @@ -489,7 +489,7 @@ int i2c_write_data(uchar chip, uchar *buffer, int len) debug(" 0x%02x", buffer[rc]); debug("\n"); - rc = tegra2_i2c_write_data(I2C_ADDR_ON_BUS(chip), buffer, len); + rc = tegra_i2c_write_data(I2C_ADDR_ON_BUS(chip), buffer, len); if (rc) debug("i2c_write_data(): rc=%d\n", rc); @@ -502,7 +502,7 @@ int i2c_read_data(uchar chip, uchar *buffer, int len) int rc; debug("inside i2c_read_data():\n"); - rc = tegra2_i2c_read_data(I2C_ADDR_ON_BUS(chip), buffer, len); + rc = tegra_i2c_read_data(I2C_ADDR_ON_BUS(chip), buffer, len); if (rc) { debug("i2c_read_data(): rc=%d\n", rc); return rc; diff --git a/drivers/tpm/slb9635_i2c/tpm_proto.c b/drivers/tpm/slb9635_i2c/tpm_proto.c index ab750a812d..1e68633413 100644 --- a/drivers/tpm/slb9635_i2c/tpm_proto.c +++ b/drivers/tpm/slb9635_i2c/tpm_proto.c @@ -81,8 +81,8 @@ enum { #define TPM_TRANSPORT_CTRL_E_BIT (1u << 5) #define TPM_TRANSPORT_CTRL_D_BIT (1u << 2) -/* FIXME: (should modify drivers/i2c/tegra2_i2c.c) - * following two functions only exist in i2c_tegra2.c driver +/* FIXME: (should modify drivers/i2c/tegra_i2c.c) + * following two functions only exist in tegra_i2c.c driver * the impl should be what defined in u-boot header file * int i2c_read(chip, addr_ignore, 0, *buffer, length); */ |