[PATCH 0/3] Tegra i2c board changes + defconfig update

STALE5640d

Revision v1 of 2 in this series.

17 messages, 5 authors, 2011-03-07 · open the first message on its own page

[PATCH 0/3] Tegra i2c board changes + defconfig update

From: Olof Johansson <hidden>
Date: 2011-03-07 08:26:36

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

[PATCH 1/3] ARM: tegra: seaboard: register i2c devices

From: Olof Johansson <hidden>
Date: 2011-03-07 08:26:37

Register the base i2c devices on seaboard. A few more are pending,
but it's a start.

Signed-off-by: Olof Johansson <redacted>
---
 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

[PATCH 2/3] ARM: tegra: harmony: register i2c devices

From: Olof Johansson <hidden>
Date: 2011-03-07 08:26:38

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 <redacted>
---
 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

[PATCH 3/3] ARM: tegra: enable new drivers in defconfig

From: Olof Johansson <hidden>
Date: 2011-03-07 08:26:39

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 <redacted>
---
 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

[PATCH 2/3] ARM: tegra: harmony: register i2c devices

From: Sergei Shtylyov <hidden>
Date: 2011-03-07 15:43:44

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<redacted>
---
  arch/arm/mach-tegra/board-harmony.c |   32 ++++++++++++++++++++++++++++++++
  1 files changed, 32 insertions(+), 0 deletions(-)
quoted hunk
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
[...]
quoted hunk
@@ -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

[PATCH 1/3] ARM: tegra: seaboard: register i2c devices

From: Stephen Warren <hidden>
Date: 2011-03-07 17:24:00

Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted hunk
Register the base i2c devices on seaboard. A few more are pending,
but it's a start.

Signed-off-by: Olof Johansson <redacted>
---
 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.
quoted hunk
 };

 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.
quoted hunk
+	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?
quoted hunk
 }

 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

[PATCH 2/3] ARM: tegra: harmony: register i2c devices

From: Stephen Warren <hidden>
Date: 2011-03-07 17:29:26

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 <redacted>
This looks OK to me.

Addressing Sergei's comments:
quoted
+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 <redacted>

-- 
nvpublic

[PATCH 3/3] ARM: tegra: enable new drivers in defconfig

From: Stephen Warren <hidden>
Date: 2011-03-07 17:34:38

Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted hunk
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 <redacted>
...
@@ -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

[PATCH 3/3] ARM: tegra: enable new drivers in defconfig

From: Olof Johansson <hidden>
Date: 2011-03-07 19:18:50

On Mon, Mar 7, 2011 at 9:34 AM, Stephen Warren [off-list ref] wrote:
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted
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 <redacted>
...
@@ -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

[PATCH 3/3] ARM: tegra: enable new drivers in defconfig

From: Stephen Warren <hidden>
Date: 2011-03-07 19:24:56

Olof Johansson wrote at Monday, March 07, 2011 12:19 PM:
On Mon, Mar 7, 2011 at 9:34 AM, Stephen Warren [off-list ref] wrote:
quoted
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted
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 <redacted>
...
@@ -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 <redacted>

-- 
nvpublic

[PATCH 1/3] ARM: tegra: seaboard: register i2c devices

From: Olof Johansson <hidden>
Date: 2011-03-07 19:29:53

[oops, missed reply-all]

Hi,

On Mon, Mar 7, 2011 at 9:24 AM, Stephen Warren [off-list ref] wrote:
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted
Register the base i2c devices on seaboard. A few more are pending,
but it's a start.

Signed-off-by: Olof Johansson <redacted>
---
?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).
[...]

[...]
quoted
+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.
quoted
+ ? ? 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.


quoted
+ ? ? 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.
quoted
+
+ ? ? 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

[PATCH 1/3] ARM: tegra: seaboard: register i2c devices

From: Stephen Warren <hidden>
Date: 2011-03-07 19:39:31

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 [off-list ref] wrote:
quoted
Olof Johansson wrote at Monday, March 07, 2011 1:27 AM:
quoted
Register the base i2c devices on seaboard. A few more are pending,
but it's a start.

Signed-off-by: Olof Johansson <redacted>
---
?arch/arm/mach-tegra/board-seaboard-pinmux.c | ? ?1 +
?arch/arm/mach-tegra/board-seaboard.c ? ? ? ?| ? 83
+++++++++++++++++++++++++++
?2 files changed, 84 insertions(+), 0 deletions(-)
...
quoted
quoted
+ ? ? 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?
quoted
quoted
+ ? ? 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.
quoted
quoted
+
+ ? ? 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

[PATCH 0/3] Tegra i2c board changes + defconfig update

From: Colin Cross <hidden>
Date: 2011-03-07 19:59:02

On Mon, Mar 7, 2011 at 12:26 AM, Olof Johansson [off-list ref] 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.

[PATCH 0/3] Tegra i2c board changes + defconfig update

From: Mark Brown <hidden>
Date: 2011-03-07 20:04:52

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.

[PATCH 0/3] Tegra i2c board changes + defconfig update

From: Colin Cross <hidden>
Date: 2011-03-07 20:07:08

On Mon, Mar 7, 2011 at 12:04 PM, Mark Brown
[off-list ref] wrote:
On Mon, Mar 07, 2011 at 11:59:02AM -0800, Colin Cross wrote:
quoted
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.

[PATCH 0/3] Tegra i2c board changes + defconfig update

From: Olof Johansson <hidden>
Date: 2011-03-07 23:13:49

On Mon, Mar 7, 2011 at 12:07 PM, Colin Cross [off-list ref] wrote:
On Mon, Mar 7, 2011 at 12:04 PM, Mark Brown
[off-list ref] wrote:
quoted
On Mon, Mar 07, 2011 at 11:59:02AM -0800, Colin Cross wrote:
quoted
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

[PATCH 1/3] ARM: tegra: seaboard: register i2c devices

From: Olof Johansson <hidden>
Date: 2011-03-07 23:26:17

Hi,

On Mon, Mar 7, 2011 at 11:39 AM, Stephen Warren [off-list ref] wrote:

quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help