diff options
author | Anton Staaf <robotboy@chromium.org> | 2011-07-06 13:19:44 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:58:57 -0700 |
commit | e8dec207c28ddd16877d2c04ad725b9f3d944854 (patch) | |
tree | 8fae67ef3265c2cb9353873f88aea2a3727dbdac /include/fdt_decode.h | |
parent | 95a1fba652775984d27fe8ec632147f588b556b6 (diff) |
i2c: Add FDT support
BUG=chromium-os:17064
TEST=Build U-Boot
Run "i2c probe" for each i2c bus on Seaboard, Kaen and Aebl
Change-Id: I1528a6c08d500c001a1210f9947c494b7ffc81f6
Reviewed-on: http://gerrit.chromium.org/gerrit/4049
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdt_decode.h')
-rw-r--r-- | include/fdt_decode.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/fdt_decode.h b/include/fdt_decode.h index 15236156f84..45072df9bc7 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -54,6 +54,7 @@ enum fdt_compat_id { COMPAT_NVIDIA_TEGRA250_USB, /* Tegra 250 USB port */ COMPAT_NVIDIA_TEGRA250_SDMMC, /* Tegra 250 SDMMC port */ COMPAT_NVIDIA_TEGRA250_KBC, /* Tegra 250 Keyboard */ + COMPAT_NVIDIA_TEGRA250_I2C, /* Tegra 250 i2c */ COMPAT_COUNT, }; @@ -190,6 +191,14 @@ struct fdt_kbc { u8 ctrl_keycode[FDT_KBC_KEY_COUNT]; }; +/* Information about i2c controller */ +struct fdt_i2c { + struct i2c_ctlr *reg; + int pinmux; + u32 speed; + enum periph_id periph_id; +}; + /** * Return information from the FDT about the console UART. This looks for * an alias node called 'console' which must point to a UART. It then reads @@ -398,6 +407,25 @@ int fdt_decode_get_config_int(const void *blob, const char *prop_name, int default_val); /** + * Returns information from the FDT about an i2c controler. This function reads + * out the following attributes: + * + * reg + * 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); + +/** * Returns information from the FDT about the keboard controler. This function * reads out the following attributes: * |