From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 8 Jan 2012 10:16:28 -0800 Subject: [U-Boot] [PATCH 4/7] tegra: Add I2C driver In-Reply-To: <201201081806.39688.marek.vasut@gmail.com> References: <1324923111-340-1-git-send-email-sjg@chromium.org> <201112262015.47381.marek.vasut@gmail.com> <201201081806.39688.marek.vasut@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On Sun, Jan 8, 2012 at 9:06 AM, Marek Vasut wrote: >> Hi Marek, [snip] >> >> + >> >> +int i2c_set_bus_num(unsigned int bus) >> >> +{ >> >> + ? ? if (bus >= CONFIG_SYS_MAX_I2C_BUS) >> >> + ? ? ? ? ? ? return -1; >> >> + ? ? i2c_bus_num = bus; >> >> + >> >> + ? ? return 0; >> >> +} >> >> +#endif >> > >> > get/set_speed missing ? >> >> This was done during init, so hoping we don't have to do it every time? > > No, but you can use those functions to adjust the speed on the fly (there's i2c > speed ... command in uboot) OK I see. I will take a look at implementing i2c_set_bus_speed() and i2c_get_bus_speed(). Regards, Simon >> >> >> diff --git a/include/fdtdec.h b/include/fdtdec.h >> >> index a8911b5..5547676 100644 >> >> --- a/include/fdtdec.h >> >> +++ b/include/fdtdec.h >> >> @@ -58,6 +58,7 @@ struct fdt_memory { >> >> ?enum fdt_compat_id { >> >> ? ? ? COMPAT_UNKNOWN, >> >> ? ? ? COMPAT_NVIDIA_TEGRA20_USB, ? ? ?/* Tegra2 USB port */ >> >> + ? ? COMPAT_NVIDIA_TEGRA20_I2C, ? ? ?/* Tegra2 i2c */ >> >> >> >> ? ? ? COMPAT_COUNT, >> >> ?}; >> >> diff --git a/lib/fdtdec.c b/lib/fdtdec.c >> >> index 931b4ce..fb3d79d 100644 >> >> --- a/lib/fdtdec.c >> >> +++ b/lib/fdtdec.c >> >> @@ -38,6 +38,7 @@ DECLARE_GLOBAL_DATA_PTR; >> >> ?static const char * const compat_names[COMPAT_COUNT] = { >> >> ? ? ? COMPAT(UNKNOWN, ""), >> >> ? ? ? COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"), >> >> + ? ? COMPAT(NVIDIA_TEGRA20_I2C, "nvidia,tegra20-i2c"), >> >> ?}; >> >> >> >> ?/** >> > >> > M >> >> Regards, >> Simon