[U-Boot,RFC,1/4,v1] fdt: remove i2c example code.

Submitted by u-boot@lakedaemon.net on Sept. 15, 2011, 1:54 p.m.

Details

Message ID fc485a98c1f534c66a5a6a7908b44f30aa4eebf7.1316092940.git.u-boot@lakedaemon.net
State RFC
Headers show

Commit Message

u-boot@lakedaemon.net Sept. 15, 2011, 1:54 p.m.
Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
---
 common/fdt_decode.c  |   14 --------------
 include/fdt_decode.h |   32 --------------------------------
 2 files changed, 0 insertions(+), 46 deletions(-)

Comments

Kumar Gala Sept. 16, 2011, 7:31 a.m.
On Sep 15, 2011, at 8:54 AM, Jason Cooper wrote:

> 
> Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
> ---
> common/fdt_decode.c  |   14 --------------
> include/fdt_decode.h |   32 --------------------------------
> 2 files changed, 0 insertions(+), 46 deletions(-)

Did I miss where these files were added to u-boot?

Probably good in general to have some commit message so someone in the future has some idea why this change was made.

- k
u-boot@lakedaemon.net Sept. 16, 2011, noon
Kumar,

On Fri, Sep 16, 2011 at 02:31:32AM -0500, Kumar Gala wrote:
> On Sep 15, 2011, at 8:54 AM, Jason Cooper wrote:
> > 
> > Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
> > ---
> > common/fdt_decode.c  |   14 --------------
> > include/fdt_decode.h |   32 --------------------------------
> > 2 files changed, 0 insertions(+), 46 deletions(-)
> 
> Did I miss where these files were added to u-boot?

No, I sent this series in-reply-to Simon Glass' RFC series adding
fdt_decode.{c,h}.  My cover letter details how I got to here.

> Probably good in general to have some commit message so someone in the
> future has some idea why this change was made.

Very true, this code is _way_ too early to consider committing (both
Simon's and mine).  Once we remove RFC, I'll make sure to have full
commit logs.  This series will most likely get squashed into one patch
with one or two of them being merged into Simon's series.

hth,

Jason.

Patch hide | download patch | download mbox

diff --git a/common/fdt_decode.c b/common/fdt_decode.c
index 9e8cf4d..cd7a071 100644
--- a/common/fdt_decode.c
+++ b/common/fdt_decode.c
@@ -34,7 +34,6 @@ 
  */
 #define COMPAT(id, name) name
 static const char *compat_names[COMPAT_COUNT] = {
-	COMPAT(NVIDIA_TEGRA250_I2C, "nvidia,tegra250-i2c"),
 };
 
 /**
@@ -162,16 +161,3 @@  int fdt_decode_next_alias(const void *blob, const char *name,
 	return err ? -FDT_ERR_MISSING : node;
 }
 
-int fdt_decode_i2c(const void *blob, int node, struct fdt_i2c *config)
-{
-	config->reg = (struct i2c_ctlr *)get_addr(blob, node, "reg");
-	config->pinmux = get_int(blob, node, "pinmux", 0);
-	config->speed = get_int(blob, node, "speed", 0);
-	config->periph_id = get_int(blob, node, "periph-id", -1);
-	config->enabled = get_is_enabled(blob, node, 0);
-
-	if (config->periph_id == -1)
-		return -FDT_ERR_MISSING;
-
-	return 0;
-}
diff --git a/include/fdt_decode.h b/include/fdt_decode.h
index bdcdbba..ba3c15b 100644
--- a/include/fdt_decode.h
+++ b/include/fdt_decode.h
@@ -28,9 +28,6 @@ 
  * changes to support FDT are minimized.
  */
 
-#include <ns16550.h>
-#include <asm/arch/clock.h>
-
 /* A typedef for a physical address. We should move it to a generic place */
 #ifdef CONFIG_PHYS_64BIT
 typedef u64 addr_t;
@@ -55,36 +52,7 @@  struct fdt_memory {
  */
 enum fdt_compat_id {
 	COMPAT_UNKNOWN,
-	COMPAT_NVIDIA_TEGRA250_I2C,	/* Tegra 250 i2c */
-
 	COMPAT_COUNT,
 };
 
-/* Information about i2c controller */
-struct fdt_i2c {
-	struct i2c_ctlr *reg;		/* Address of controller registers */
-	int pinmux;			/* Which pin mux setting to use */
-	u32 speed;			/* Speed in KHz */
-	enum periph_id periph_id;	/* Peripheral ID for clock/pinmux */
-	int enabled;			/* 1 if enabled, 0 if disabled */
-};
 
-/**
- * Returns information from the FDT about an i2c controler. This function reads
- * out the following attributes:
- *
- *	reg
- *      enabled
- *	pinmux
- *	speed
- *	periph-id
- *
- * @param blob		FDT blob to use
- * @param node		Node to read from
- * @param config	structure to use to return information
- * @returns 0 on success, -ve on error, in which case config may or may not be
- *			unchanged. If the node is present but expected data is
- *			missing then this will generally return
- *			-FDT_ERR_MISSING.
- */
-int fdt_decode_i2c(const void *blob, int node, struct fdt_i2c *config);