* [PATCH 0/3] Tegra i2c board changes + defconfig update
@ 2011-03-07 8:26 Olof Johansson
2011-03-07 8:26 ` [PATCH 1/3] ARM: tegra: seaboard: register i2c devices Olof Johansson
` (3 more replies)
0 siblings, 4 replies; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 8:26 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Here is a short series of i2c patches to configure the i2c-tegra driver
for the boards in the tree, and to register some of the devices.
It also includes a defconfig update that enables the new drivers, enables
TRIMSLICE by default since the pcie fix makes it possible and also turns
on a few more config options that are useful (i.e. EFI partition tables
and some common board devices).
Since these patches rely on drivers that will be merged during the
upcoming window, this is my plan:
* Check them into boards-for-next together with Stephen W's
other late-merge board patches in a day or two
* Ask sfr to add said branch to linux-next (towards the end of list of trees)
* Sit on them until merge window is open and base tegra, i2c and asoc have
all been merged
* Rebase to current upstream when said trees are in, let it sit for 1
day for a linux-next cycle for sanity-check
* Send pull request
-Olof
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: tegra: seaboard: register i2c devices
2011-03-07 8:26 [PATCH 0/3] Tegra i2c board changes + defconfig update Olof Johansson
@ 2011-03-07 8:26 ` Olof Johansson
2011-03-07 17:24 ` Stephen Warren
2011-03-07 8:26 ` [PATCH 2/3] ARM: tegra: harmony: " Olof Johansson
` (2 subsequent siblings)
3 siblings, 1 reply; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 8:26 UTC (permalink / raw)
To: linux-arm-kernel
Register the base i2c devices on seaboard. A few more are pending,
but it's a start.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/arm/mach-tegra/board-seaboard-pinmux.c | 1 +
arch/arm/mach-tegra/board-seaboard.c | 83 +++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
index 7e96d49..d84d1dd 100644
--- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -166,6 +166,7 @@ static struct tegra_gpio_table gpio_table[] = {
{ .gpio = TEGRA_GPIO_SD2_POWER, .enable = true },
{ .gpio = TEGRA_GPIO_LIDSWITCH, .enable = true },
{ .gpio = TEGRA_GPIO_POWERKEY, .enable = true },
+ { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true },
};
void __init seaboard_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index eb28dbd..afc972f 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -18,9 +18,12 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
+#include <linux/i2c.h>
+#include <linux/i2c-tegra.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/io.h>
+#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <mach/iomap.h>
@@ -63,6 +66,22 @@ static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
{ NULL, NULL, 0, 0},
};
+static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
+ .bus_clk_rate = 400000.
+};
+
+static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
{
.code = SW_LID,
@@ -124,6 +143,64 @@ static struct platform_device *seaboard_devices[] __initdata = {
&seaboard_gpio_keys_device,
};
+static struct i2c_board_info __initdata isl29018_device = {
+ I2C_BOARD_INFO("isl29018", 0x44),
+ .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_ISL29018_IRQ),
+};
+
+static struct i2c_board_info __initdata adt7461_device = {
+ I2C_BOARD_INFO("adt7461", 0x4c),
+};
+
+static void __init common_i2c_init(void)
+{
+ tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
+ tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
+ tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
+ tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
+
+ platform_device_register(&tegra_i2c_device1);
+ platform_device_register(&tegra_i2c_device2);
+ platform_device_register(&tegra_i2c_device3);
+ platform_device_register(&tegra_i2c_device4);
+}
+
+static void __init seaboard_i2c_init(void)
+{
+ gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
+ gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
+
+ i2c_register_board_info(0, &isl29018_device, 1);
+
+ i2c_register_board_info(4, &adt7461_device, 1);
+
+ common_i2c_init();
+}
+
+static void __init kaen_i2c_init(void)
+{
+ gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
+ gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
+
+ i2c_register_board_info(0, &isl29018_device, 1);
+
+ i2c_register_board_info(4, &adt7461_device, 1);
+
+ common_i2c_init();
+}
+
+static void __init wario_i2c_init(void)
+{
+ gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
+ gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
+
+ i2c_register_board_info(0, &isl29018_device, 1);
+
+ i2c_register_board_info(4, &adt7461_device, 1);
+
+ common_i2c_init();
+}
+
static void __init __tegra_seaboard_init(void)
{
seaboard_pinmux_init();
@@ -145,6 +222,8 @@ static void __init tegra_seaboard_init(void)
debug_uart_platform_data[0].irq = INT_UARTD;
__tegra_seaboard_init();
+
+ seaboard_i2c_init();
}
static void __init tegra_kaen_init(void)
@@ -155,6 +234,8 @@ static void __init tegra_kaen_init(void)
debug_uart_platform_data[0].irq = INT_UARTB;
__tegra_seaboard_init();
+
+ kaen_i2c_init();
}
static void __init tegra_wario_init(void)
@@ -165,6 +246,8 @@ static void __init tegra_wario_init(void)
debug_uart_platform_data[0].irq = INT_UARTB;
__tegra_seaboard_init();
+
+ wario_i2c_init();
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: tegra: harmony: register i2c devices
2011-03-07 8:26 [PATCH 0/3] Tegra i2c board changes + defconfig update Olof Johansson
2011-03-07 8:26 ` [PATCH 1/3] ARM: tegra: seaboard: register i2c devices Olof Johansson
@ 2011-03-07 8:26 ` Olof Johansson
2011-03-07 15:43 ` Sergei Shtylyov
2011-03-07 17:29 ` Stephen Warren
2011-03-07 8:26 ` [PATCH 3/3] ARM: tegra: enable new drivers in defconfig Olof Johansson
2011-03-07 19:59 ` [PATCH 0/3] Tegra i2c board changes + defconfig update Colin Cross
3 siblings, 2 replies; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 8:26 UTC (permalink / raw)
To: linux-arm-kernel
Register the base i2c busses on harmony. Devices coming at a later date,
but this allows for hand-probing of some of them at least.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/arm/mach-tegra/board-harmony.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 38c2ab8..d46268d 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -24,6 +24,8 @@
#include <linux/pda_power.h>
#include <linux/io.h>
#include <linux/gpio.h>
+#include <linux/i2c.h>
+#include <linux/i2c-tegra.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -78,6 +80,35 @@ static struct platform_device harmony_audio_device = {
},
};
+static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static struct tegra_i2c_platform_data harmony_i2c2_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static struct tegra_i2c_platform_data harmony_i2c3_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
+ .bus_clk_rate = 400000,
+};
+
+static void harmony_i2c_init(void)
+{
+ tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data;
+ tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data;
+ tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data;
+ tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data;
+
+ platform_device_register(&tegra_i2c_device1);
+ platform_device_register(&tegra_i2c_device2);
+ platform_device_register(&tegra_i2c_device3);
+ platform_device_register(&tegra_i2c_device4);
+}
+
static struct platform_device *harmony_devices[] __initdata = {
&debug_uart,
&tegra_sdhci_device1,
@@ -140,6 +171,7 @@ static void __init tegra_harmony_init(void)
tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
+ harmony_i2c_init();
}
MACHINE_START(HARMONY, "harmony")
--
1.7.0.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: tegra: enable new drivers in defconfig
2011-03-07 8:26 [PATCH 0/3] Tegra i2c board changes + defconfig update Olof Johansson
2011-03-07 8:26 ` [PATCH 1/3] ARM: tegra: seaboard: register i2c devices Olof Johansson
2011-03-07 8:26 ` [PATCH 2/3] ARM: tegra: harmony: " Olof Johansson
@ 2011-03-07 8:26 ` Olof Johansson
2011-03-07 17:34 ` Stephen Warren
2011-03-07 19:59 ` [PATCH 0/3] Tegra i2c board changes + defconfig update Colin Cross
3 siblings, 1 reply; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 8:26 UTC (permalink / raw)
To: linux-arm-kernel
Enable new platforms and tegra drivers in tegra_defconfig. Also enable
some of the common devices several platforms, and GUID partition tables
to make it possible to boot a tegra_defconfig kernel with a ChromiumOS
filesystem.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/arm/configs/tegra_defconfig | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index 7a9267e..766e7e8 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -21,6 +21,9 @@ CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_IOSCHED_CFQ is not set
CONFIG_ARCH_TEGRA=y
CONFIG_MACH_HARMONY=y
+CONFIG_MACH_KAEN=y
+CONFIG_MACH_TRIMSLICE=y
+CONFIG_MACH_WARIO=y
CONFIG_TEGRA_DEBUG_UARTD=y
CONFIG_ARM_ERRATA_742230=y
CONFIG_NO_HZ=y
@@ -78,12 +81,21 @@ CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_HW_RANDOM is not set
CONFIG_I2C=y
-# CONFIG_HWMON is not set
+# CONFIG_I2C_COMPAT is not set
+# CONFIG_I2C_HELPER_AUTO is not set
+CONFIG_I2C_TEGRA=y
+CONFIG_SENSORS_LM90=y
# CONFIG_MFD_SUPPORT is not set
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_TEGRA=y
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+CONFIG_IIO=y
+CONFIG_SENSORS_ISL29018=y
+CONFIG_SENSORS_AK8975=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -95,6 +107,8 @@ CONFIG_EXT3_FS_SECURITY=y
# CONFIG_DNOTIFY is not set
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
--
1.7.0.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: tegra: harmony: register i2c devices
2011-03-07 8:26 ` [PATCH 2/3] ARM: tegra: harmony: " Olof Johansson
@ 2011-03-07 15:43 ` Sergei Shtylyov
2011-03-07 17:29 ` Stephen Warren
1 sibling, 0 replies; 17+ messages in thread
From: Sergei Shtylyov @ 2011-03-07 15:43 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 07-03-2011 11:26, Olof Johansson wrote:
> Register the base i2c busses on harmony. Devices coming at a later date,
> but this allows for hand-probing of some of them at least.
> Signed-off-by: Olof Johansson<olof@lixom.net>
> ---
> arch/arm/mach-tegra/board-harmony.c | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
> diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
> index 38c2ab8..d46268d 100644
> --- a/arch/arm/mach-tegra/board-harmony.c
> +++ b/arch/arm/mach-tegra/board-harmony.c
[...]
> @@ -78,6 +80,35 @@ static struct platform_device harmony_audio_device = {
> },
> };
>
> +static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> +static struct tegra_i2c_platform_data harmony_i2c2_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> +static struct tegra_i2c_platform_data harmony_i2c3_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> +static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
> + .bus_clk_rate = 400000,
> +};
Why not share the paltform data between devices if it's the same anyway?
WBR, Sergei
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: tegra: seaboard: register i2c devices
2011-03-07 8:26 ` [PATCH 1/3] ARM: tegra: seaboard: register i2c devices Olof Johansson
@ 2011-03-07 17:24 ` Stephen Warren
2011-03-07 19:29 ` Olof Johansson
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Warren @ 2011-03-07 17:24 UTC (permalink / raw)
To: linux-arm-kernel
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
> Register the base i2c devices on seaboard. A few more are pending,
> but it's a start.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> arch/arm/mach-tegra/board-seaboard-pinmux.c | 1 +
> arch/arm/mach-tegra/board-seaboard.c | 83
> +++++++++++++++++++++++++++
> 2 files changed, 84 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-
> tegra/board-seaboard-pinmux.c
> index 7e96d49..d84d1dd 100644
> --- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
> +++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
> @@ -166,6 +166,7 @@ static struct tegra_gpio_table gpio_table[] = {
> { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true },
> { .gpio = TEGRA_GPIO_LIDSWITCH, .enable = true },
> { .gpio = TEGRA_GPIO_POWERKEY, .enable = true },
> + { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true },
The indentation between fields looks different there.
> };
>
> void __init seaboard_pinmux_init(void)
> diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-
> tegra/board-seaboard.c
> index eb28dbd..afc972f 100644
> --- a/arch/arm/mach-tegra/board-seaboard.c
> +++ b/arch/arm/mach-tegra/board-seaboard.c
> @@ -18,9 +18,12 @@
> #include <linux/init.h>
> #include <linux/platform_device.h>
> #include <linux/serial_8250.h>
> +#include <linux/i2c.h>
> +#include <linux/i2c-tegra.h>
> #include <linux/delay.h>
> #include <linux/input.h>
> #include <linux/io.h>
> +#include <linux/gpio.h>
> #include <linux/gpio_keys.h>
>
> #include <mach/iomap.h>
> @@ -63,6 +66,22 @@ static __initdata struct tegra_clk_init_table
> seaboard_clk_init_table[] = {
> { NULL, NULL, 0, 0},
> };
>
> +static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
> + .bus_clk_rate = 400000.
> +};
> +
> +static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> +static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> +static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
> + .bus_clk_rate = 400000,
> +};
> +
> static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
> {
> .code = SW_LID,
> @@ -124,6 +143,64 @@ static struct platform_device *seaboard_devices[]
> __initdata = {
> &seaboard_gpio_keys_device,
> };
>
> +static struct i2c_board_info __initdata isl29018_device = {
> + I2C_BOARD_INFO("isl29018", 0x44),
> + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_ISL29018_IRQ),
> +};
> +
> +static struct i2c_board_info __initdata adt7461_device = {
> + I2C_BOARD_INFO("adt7461", 0x4c),
> +};
> +
> +static void __init common_i2c_init(void)
> +{
> + tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
> + tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
> + tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
> + tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
> +
> + platform_device_register(&tegra_i2c_device1);
> + platform_device_register(&tegra_i2c_device2);
> + platform_device_register(&tegra_i2c_device3);
> + platform_device_register(&tegra_i2c_device4);
> +}
> +
> +static void __init seaboard_i2c_init(void)
> +{
> + gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
> + gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
Hmm. For some reason I thought drivers did this themselves, or IRQ
registration did this for them. However, I looked and that's not true. I
think I was remembering snd_soc_jack_add_gpios instead.
So, this code looks fine, but I guess equivalent calls are missing for the
WM8903 IRQ in my patches?
> + i2c_register_board_info(0, &isl29018_device, 1);
> +
> + i2c_register_board_info(4, &adt7461_device, 1);
> +
> + common_i2c_init();
> +}
> +
> +static void __init kaen_i2c_init(void)
> +{
{seaboard,kaen,wario}_i2c_init seem identical. Should this be a single shared
function, and only the board-specific bits in the non-common functions? Also,
see below.
> + gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
> + gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
> +
> + i2c_register_board_info(0, &isl29018_device, 1);
> +
> + i2c_register_board_info(4, &adt7461_device, 1);
> +
> + common_i2c_init();
> +}
> +
> +static void __init wario_i2c_init(void)
> +{
> + gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
> + gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
> +
> + i2c_register_board_info(0, &isl29018_device, 1);
> +
> + i2c_register_board_info(4, &adt7461_device, 1);
> +
> + common_i2c_init();
> +}
> +
> static void __init __tegra_seaboard_init(void)
> {
> seaboard_pinmux_init();
> @@ -145,6 +222,8 @@ static void __init tegra_seaboard_init(void)
> debug_uart_platform_data[0].irq = INT_UARTD;
>
> __tegra_seaboard_init();
> +
> + seaboard_i2c_init();
> }
>
> static void __init tegra_kaen_init(void)
> @@ -155,6 +234,8 @@ static void __init tegra_kaen_init(void)
> debug_uart_platform_data[0].irq = INT_UARTB;
>
> __tegra_seaboard_init();
__tegra_seaboard_init calls seaboard_i2c_init.
> +
> + kaen_i2c_init();
kaen_i2c_init is the same as seaboard_i2c_init.
So, all the registration happens twice?
> }
>
> static void __init tegra_wario_init(void)
> @@ -165,6 +246,8 @@ static void __init tegra_wario_init(void)
> debug_uart_platform_data[0].irq = INT_UARTB;
>
> __tegra_seaboard_init();
> +
> + wario_i2c_init();
> }
>
> --
> 1.7.0.4
--
nvpublic
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: tegra: harmony: register i2c devices
2011-03-07 8:26 ` [PATCH 2/3] ARM: tegra: harmony: " Olof Johansson
2011-03-07 15:43 ` Sergei Shtylyov
@ 2011-03-07 17:29 ` Stephen Warren
1 sibling, 0 replies; 17+ messages in thread
From: Stephen Warren @ 2011-03-07 17:29 UTC (permalink / raw)
To: linux-arm-kernel
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
> Register the base i2c busses on harmony. Devices coming at a later date,
> but this allows for hand-probing of some of them at least.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
This looks OK to me.
Addressing Sergei's comments:
> > +static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
> > + .bus_clk_rate = 400000,
> > +};
>
> Why not share the paltform data between devices if it's the same anyway?
Right now, the upstream tegra_i2c_platform_data has fewer fields than some
changes that I imagine are coming down the pipe from ChromeOS. i.e. the
content of those 3 platform data will probably be different in the future.
For this reason, it seems reasonable to keep them separate from the start.
But, unifying them for now and separating in a future patch would be fine by
me too.
Acked-by: Stephen Warren <swarren@nvidia.com>
--
nvpublic
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: tegra: enable new drivers in defconfig
2011-03-07 8:26 ` [PATCH 3/3] ARM: tegra: enable new drivers in defconfig Olof Johansson
@ 2011-03-07 17:34 ` Stephen Warren
2011-03-07 19:18 ` Olof Johansson
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Warren @ 2011-03-07 17:34 UTC (permalink / raw)
To: linux-arm-kernel
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
> Enable new platforms and tegra drivers in tegra_defconfig. Also enable
> some of the common devices several platforms, and GUID partition tables
> to make it possible to boot a tegra_defconfig kernel with a ChromiumOS
> filesystem.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
>...
> @@ -78,12 +81,21 @@ CONFIG_SERIAL_8250_CONSOLE=y
> # CONFIG_LEGACY_PTYS is not set
> # CONFIG_HW_RANDOM is not set
> CONFIG_I2C=y
> -# CONFIG_HWMON is not set
> +# CONFIG_I2C_COMPAT is not set
> +# CONFIG_I2C_HELPER_AUTO is not set
> +CONFIG_I2C_TEGRA=y
> +CONFIG_SENSORS_LM90=y
I'm not sure why the LM90 is needed?
--
nvpublic
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: tegra: enable new drivers in defconfig
2011-03-07 17:34 ` Stephen Warren
@ 2011-03-07 19:18 ` Olof Johansson
2011-03-07 19:24 ` Stephen Warren
0 siblings, 1 reply; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 19:18 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 7, 2011 at 9:34 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
>> Enable new platforms and tegra drivers in tegra_defconfig. Also enable
>> some of the common devices several platforms, and GUID partition tables
>> to make it possible to boot a tegra_defconfig kernel with a ChromiumOS
>> filesystem.
>>
>> Signed-off-by: Olof Johansson <olof@lixom.net>
>>...
>> @@ -78,12 +81,21 @@ CONFIG_SERIAL_8250_CONSOLE=y
>> ?# CONFIG_LEGACY_PTYS is not set
>> ?# CONFIG_HW_RANDOM is not set
>> ?CONFIG_I2C=y
>> -# CONFIG_HWMON is not set
>> +# CONFIG_I2C_COMPAT is not set
>> +# CONFIG_I2C_HELPER_AUTO is not set
>> +CONFIG_I2C_TEGRA=y
>> +CONFIG_SENSORS_LM90=y
>
> I'm not sure why the LM90 is needed?
LM90 == adt7461 temp sensor, registered and used on seaboard.
-Olof
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: tegra: enable new drivers in defconfig
2011-03-07 19:18 ` Olof Johansson
@ 2011-03-07 19:24 ` Stephen Warren
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Warren @ 2011-03-07 19:24 UTC (permalink / raw)
To: linux-arm-kernel
Olof Johansson wrote at Monday, March 07, 2011 12:19 PM:
> On Mon, Mar 7, 2011 at 9:34 AM, Stephen Warren <swarren@nvidia.com> wrote:
> > Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
> >> Enable new platforms and tegra drivers in tegra_defconfig. Also enable
> >> some of the common devices several platforms, and GUID partition tables
> >> to make it possible to boot a tegra_defconfig kernel with a ChromiumOS
> >> filesystem.
> >>
> >> Signed-off-by: Olof Johansson <olof@lixom.net>
> >>...
> >> @@ -78,12 +81,21 @@ CONFIG_SERIAL_8250_CONSOLE=y
> >> ?# CONFIG_LEGACY_PTYS is not set
> >> ?# CONFIG_HW_RANDOM is not set
> >> ?CONFIG_I2C=y
> >> -# CONFIG_HWMON is not set
> >> +# CONFIG_I2C_COMPAT is not set
> >> +# CONFIG_I2C_HELPER_AUTO is not set
> >> +CONFIG_I2C_TEGRA=y
> >> +CONFIG_SENSORS_LM90=y
> >
> > I'm not sure why the LM90 is needed?
>
> LM90 == adt7461 temp sensor, registered and used on seaboard.
Ah, it's a compatible device. In that case,
Acked-by: Stephen Warren <swarren@nvidia.com>
--
nvpublic
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: tegra: seaboard: register i2c devices
2011-03-07 17:24 ` Stephen Warren
@ 2011-03-07 19:29 ` Olof Johansson
2011-03-07 19:39 ` Stephen Warren
0 siblings, 1 reply; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 19:29 UTC (permalink / raw)
To: linux-arm-kernel
[oops, missed reply-all]
Hi,
On Mon, Mar 7, 2011 at 9:24 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
>> Register the base i2c devices on seaboard. A few more are pending,
>> but it's a start.
>>
>> Signed-off-by: Olof Johansson <olof@lixom.net>
>> ---
>> ?arch/arm/mach-tegra/board-seaboard-pinmux.c | ? ?1 +
>> ?arch/arm/mach-tegra/board-seaboard.c ? ? ? ?| ? 83
>> +++++++++++++++++++++++++++
>> ?2 files changed, 84 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-
>> tegra/board-seaboard-pinmux.c
>> index 7e96d49..d84d1dd 100644
>> --- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
>> +++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
>> @@ -166,6 +166,7 @@ static struct tegra_gpio_table gpio_table[] = {
>> ? ? ? { .gpio = TEGRA_GPIO_SD2_POWER, ? ? ? ? .enable = true },
>> ? ? ? { .gpio = TEGRA_GPIO_LIDSWITCH, ? ? ? ? .enable = true },
>> ? ? ? { .gpio = TEGRA_GPIO_POWERKEY, ? ? ? ? ?.enable = true },
>> + ? ? { .gpio = TEGRA_GPIO_ISL29018_IRQ, ? ? ?.enable = true },
>
> The indentation between fields looks different there.
No, shouldn't be? I just checked the code, it uses the same whitespace
(tabs/spaces).
[...]
[...]
>> +static void __init seaboard_i2c_init(void)
>> +{
>> + ? ? gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
>> + ? ? gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
>
> Hmm. For some reason I thought drivers did this themselves, or IRQ
> registration did this for them. However, I looked and that's not true. I
> think I was remembering snd_soc_jack_add_gpios instead.
>
> So, this code looks fine, but I guess equivalent calls are missing for the
> WM8903 IRQ in my patches?
Yeah, probably.
>> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
>> +
>> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
>> +
>> + ? ? common_i2c_init();
>> +}
>> +
>> +static void __init kaen_i2c_init(void)
>> +{
>
> {seaboard,kaen,wario}_i2c_init seem identical. Should this be a single shared
> function, and only the board-specific bits in the non-common functions? Also,
> see below.
They are now -- they weren't when all i2c devices were registered. I
can re-join them and split them when devices are re-introduced later.
>
>> + ? ? gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
>> + ? ? gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
>> +
>> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
>> +
>> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
>> +
>> + ? ? common_i2c_init();
>> +}
>> +
>> +static void __init wario_i2c_init(void)
>> +{
>> + ? ? gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
>> + ? ? gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
>> +
>> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
>> +
>> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
>> +
>> + ? ? common_i2c_init();
>> +}
>> +
>> ?static void __init __tegra_seaboard_init(void)
>> ?{
>> ? ? ? seaboard_pinmux_init();
>> @@ -145,6 +222,8 @@ static void __init tegra_seaboard_init(void)
>> ? ? ? debug_uart_platform_data[0].irq = INT_UARTD;
>>
>> ? ? ? __tegra_seaboard_init();
>> +
>> + ? ? seaboard_i2c_init();
>> ?}
>>
>> ?static void __init tegra_kaen_init(void)
>> @@ -155,6 +234,8 @@ static void __init tegra_kaen_init(void)
>> ? ? ? debug_uart_platform_data[0].irq = INT_UARTB;
>>
>> ? ? ? __tegra_seaboard_init();
>
> __tegra_seaboard_init calls seaboard_i2c_init.
It shouldn't be (note __tegra* vs tegra*). Maybe I should rename
__tegra_seaboard_init to something less alike.
>
>> +
>> + ? ? kaen_i2c_init();
>
> kaen_i2c_init is the same as seaboard_i2c_init.
>
> So, all the registration happens twice?
Shouldn't be. The code I am looking at doesn't, so please check your side again?
-Olof
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: tegra: seaboard: register i2c devices
2011-03-07 19:29 ` Olof Johansson
@ 2011-03-07 19:39 ` Stephen Warren
2011-03-07 23:26 ` Olof Johansson
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Warren @ 2011-03-07 19:39 UTC (permalink / raw)
To: linux-arm-kernel
Olof Johansson wrote at Monday, March 07, 2011 12:30 PM:
> [oops, missed reply-all]
>
> Hi,
>
> On Mon, Mar 7, 2011 at 9:24 AM, Stephen Warren <swarren@nvidia.com> wrote:
> > Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
> >> Register the base i2c devices on seaboard. A few more are pending,
> >> but it's a start.
> >>
> >> Signed-off-by: Olof Johansson <olof@lixom.net>
> >> ---
> >> ?arch/arm/mach-tegra/board-seaboard-pinmux.c | ? ?1 +
> >> ?arch/arm/mach-tegra/board-seaboard.c ? ? ? ?| ? 83
> >> +++++++++++++++++++++++++++
> >> ?2 files changed, 84 insertions(+), 0 deletions(-)
>...
> >> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
> >> +
> >> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
> >> +
> >> + ? ? common_i2c_init();
> >> +}
> >> +
> >> +static void __init kaen_i2c_init(void)
> >> +{
> >
> > {seaboard,kaen,wario}_i2c_init seem identical. Should this be a single
> > shared function, and only the board-specific bits in the non-common
> > functions? Also, see below.
>
> They are now -- they weren't when all i2c devices were registered. I
> can re-join them and split them when devices are re-introduced later.
Perhaps move the common code into common_i2c_init, then put only the
differences in ${boardname}_i2c_init(), which would currently be empty
except to call the common function?
> >> + ? ? gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
> >> + ? ? gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
> >> +
> >> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
> >> +
> >> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
> >> +
> >> + ? ? common_i2c_init();
> >> +}
> >> +
> >> +static void __init wario_i2c_init(void)
> >> +{
> >> + ? ? gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
> >> + ? ? gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
> >> +
> >> + ? ? i2c_register_board_info(0, &isl29018_device, 1);
> >> +
> >> + ? ? i2c_register_board_info(4, &adt7461_device, 1);
> >> +
> >> + ? ? common_i2c_init();
> >> +}
> >> +
> >> ?static void __init __tegra_seaboard_init(void)
> >> ?{
> >> ? ? ? seaboard_pinmux_init();
> >> @@ -145,6 +222,8 @@ static void __init tegra_seaboard_init(void)
> >> ? ? ? debug_uart_platform_data[0].irq = INT_UARTD;
> >>
> >> ? ? ? __tegra_seaboard_init();
> >> +
> >> + ? ? seaboard_i2c_init();
> >> ?}
> >>
> >> ?static void __init tegra_kaen_init(void)
> >> @@ -155,6 +234,8 @@ static void __init tegra_kaen_init(void)
> >> ? ? ? debug_uart_platform_data[0].irq = INT_UARTB;
> >>
> >> ? ? ? __tegra_seaboard_init();
> >
> > __tegra_seaboard_init calls seaboard_i2c_init.
>
> It shouldn't be (note __tegra* vs tegra*). Maybe I should rename
> __tegra_seaboard_init to something less alike.
Oh right. I double-checked that, but made the same reading mistake
both times; the __ version appeared right above the diff, so I
must have skipped reading the @@ line.
> >
> >> +
> >> + ? ? kaen_i2c_init();
> >
> > kaen_i2c_init is the same as seaboard_i2c_init.
> >
> > So, all the registration happens twice?
>
> Shouldn't be. The code I am looking at doesn't, so please check your side
> again?
Yes, it looks functionally OK when read correctly.
If you want, I can ack this, but perhaps reworking the code duplication
and making that __tegra_seaboard_init rename would make sense;
common_seaboard_init or common_board_init?
--
nvpublic
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/3] Tegra i2c board changes + defconfig update
2011-03-07 8:26 [PATCH 0/3] Tegra i2c board changes + defconfig update Olof Johansson
` (2 preceding siblings ...)
2011-03-07 8:26 ` [PATCH 3/3] ARM: tegra: enable new drivers in defconfig Olof Johansson
@ 2011-03-07 19:59 ` Colin Cross
2011-03-07 20:04 ` Mark Brown
3 siblings, 1 reply; 17+ messages in thread
From: Colin Cross @ 2011-03-07 19:59 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 7, 2011 at 12:26 AM, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> Here is a short series of i2c patches to configure the i2c-tegra driver
> for the boards in the tree, and to register some of the devices.
>
> It also includes a defconfig update that enables the new drivers, enables
> TRIMSLICE by default since the pcie fix makes it possible and also turns
> on a few more config options that are useful (i.e. EFI partition tables
> and some common board devices).
>
> Since these patches rely on drivers that will be merged during the
> upcoming window, this is my plan:
>
> * Check them into boards-for-next together with Stephen W's
> ?other late-merge board patches in a day or two
> * Ask sfr to add said branch to linux-next (towards the end of list of trees)
> * Sit on them until merge window is open and base tegra, i2c and asoc have
> ?all been merged
> * Rebase to current upstream when said trees are in, let it sit for 1
> ?day for a linux-next cycle for sanity-check
> * Send pull request
>
>
> -Olof
Do we need two branches in linux-next? I think we should just push
all of this to Tegra's for-next branch, and keep a for-linus branch
that points to the last change that will build without merging with
linux-next. There shouldn't be any conflicts with linux-next, and
there is no need for linux-next to build after merging some of its
branches.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/3] Tegra i2c board changes + defconfig update
2011-03-07 19:59 ` [PATCH 0/3] Tegra i2c board changes + defconfig update Colin Cross
@ 2011-03-07 20:04 ` Mark Brown
2011-03-07 20:07 ` Colin Cross
0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2011-03-07 20:04 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 07, 2011 at 11:59:02AM -0800, Colin Cross wrote:
> linux-next. There shouldn't be any conflicts with linux-next, and
> there is no need for linux-next to build after merging some of its
> branches.
-next gets built after each merge so the tree does need to merge without
the trees that get merged later on.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/3] Tegra i2c board changes + defconfig update
2011-03-07 20:04 ` Mark Brown
@ 2011-03-07 20:07 ` Colin Cross
2011-03-07 23:13 ` Olof Johansson
0 siblings, 1 reply; 17+ messages in thread
From: Colin Cross @ 2011-03-07 20:07 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 7, 2011 at 12:04 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Mon, Mar 07, 2011 at 11:59:02AM -0800, Colin Cross wrote:
>
>> linux-next. ?There shouldn't be any conflicts with linux-next, and
>> there is no need for linux-next to build after merging some of its
>> branches.
>
> -next gets built after each merge so the tree does need to merge without
> the trees that get merged later on.
Ok, we can make sure Tegra is merged after i2c and asoc, in which case
it should build fine.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 0/3] Tegra i2c board changes + defconfig update
2011-03-07 20:07 ` Colin Cross
@ 2011-03-07 23:13 ` Olof Johansson
0 siblings, 0 replies; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 23:13 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 7, 2011 at 12:07 PM, Colin Cross <ccross@android.com> wrote:
> On Mon, Mar 7, 2011 at 12:04 PM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> On Mon, Mar 07, 2011 at 11:59:02AM -0800, Colin Cross wrote:
>>
>>> linux-next. ?There shouldn't be any conflicts with linux-next, and
>>> there is no need for linux-next to build after merging some of its
>>> branches.
>>
>> -next gets built after each merge so the tree does need to merge without
>> the trees that get merged later on.
>
> Ok, we can make sure Tegra is merged after i2c and asoc, in which case
> it should build fine.
Main drawback is that the tegra main for-next branch doesn't build on
its own then. Not a big deal, especially not this close to the merge
window, IMHO.
I'll send a new pull request picking up the recently posted patches
then. I'm actually OK with the paz00 patches going in .39 myself,
since they don't impact any of the existing code, so nothing can
regress because of them.
New pull request in a bit.
-Olof
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: tegra: seaboard: register i2c devices
2011-03-07 19:39 ` Stephen Warren
@ 2011-03-07 23:26 ` Olof Johansson
0 siblings, 0 replies; 17+ messages in thread
From: Olof Johansson @ 2011-03-07 23:26 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Mon, Mar 7, 2011 at 11:39 AM, Stephen Warren <swarren@nvidia.com> wrote:
>> They are now -- they weren't when all i2c devices were registered. I
>> can re-join them and split them when devices are re-introduced later.
>
> Perhaps move the common code into common_i2c_init, then put only the
> differences in ${boardname}_i2c_init(), which would currently be empty
> except to call the common function?
I'll split up again when the need arises, i.e. when the
differentiating drivers are introduced for now, I just made a common
seaboard_i2c_init that's called from the common init function, i.e.
undid the per-board split.
-Olof
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2011-03-07 23:26 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07 8:26 [PATCH 0/3] Tegra i2c board changes + defconfig update Olof Johansson
2011-03-07 8:26 ` [PATCH 1/3] ARM: tegra: seaboard: register i2c devices Olof Johansson
2011-03-07 17:24 ` Stephen Warren
2011-03-07 19:29 ` Olof Johansson
2011-03-07 19:39 ` Stephen Warren
2011-03-07 23:26 ` Olof Johansson
2011-03-07 8:26 ` [PATCH 2/3] ARM: tegra: harmony: " Olof Johansson
2011-03-07 15:43 ` Sergei Shtylyov
2011-03-07 17:29 ` Stephen Warren
2011-03-07 8:26 ` [PATCH 3/3] ARM: tegra: enable new drivers in defconfig Olof Johansson
2011-03-07 17:34 ` Stephen Warren
2011-03-07 19:18 ` Olof Johansson
2011-03-07 19:24 ` Stephen Warren
2011-03-07 19:59 ` [PATCH 0/3] Tegra i2c board changes + defconfig update Colin Cross
2011-03-07 20:04 ` Mark Brown
2011-03-07 20:07 ` Colin Cross
2011-03-07 23:13 ` Olof Johansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).