Skip to contentSkip to conversation

Errors at boot time from OMAP4430SDP (and a whinge about serial stuff)

DISCUSSION Russell King - ARM Linux 9 participants 31 messages Oct 12, 2012 – Oct 25, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22
omap_hwmod: mcpdm: cannot be enabled for reset (3)
omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2
Error setting wl12xx data: -38
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

As of today, I've rebased my serial changes as far forward as I dare at the moment (to the commit before removal of DMA), and then merged it into the latest trees from armsoc and myself, fixing up all the horrid conflicts. I've finally got it to a stage where at least it compiles, but unfortunately something has broken serial output from userspace quite badly to the point that it doesn't work.

I know that my serial changes were fine before I tried rebasing them (the set I posted to the mailing list certainly did work) so I suspect that it's down to incompatibilities between the fixes done by others (who didn't really understand all issues involved) and those done by myself.

Unfortunately, the series of patches to fix the register writes and bits to enable hardware assisted software flow control which have gone into mainline have actually made the situation much worse - now the hardware can end up with IXANY stuck on, and no way to turn off hardware assisted software flow control - which is bad news for binary serial protocols. It would have been far better to leave the driver as-is - at least the software flow control would have been dealt correctly by the generic tty layer. Instead, we have a worse situation today...

While I may be the ex-maintainer of serial-core, given that I had already investigated the issues there and had an understanding of the problems, -and that was known-, copying me with the patches before they went into mainline would've been the decent thing to have done, so that someone with the knowledge of the breakage could have said "yes lets take those patches" and "no, those shouldn't go in because it'll cause breakage" such as I describe above.

I know how this situation arose; TI are desperate to get rid of the legacy OMAP DMA API, and wanted me to look at the crypto drivers for DMA engine support. In the mean time, they silently took the serial issues away from me and gave them other people to look at. Reality is, I could have sorted out the serial issues while I wait for responses from Dan Williams on the async tx API issues.

Eventually, I got bored of waiting for Dan's responses, that I looked at the serial issues anyway, and produced _my_ patch set which fixes the issues _properly_, so at least I can say that I had done something producive. The sad thing is, most of that is now having to be reworked to sort out an entirely new set of problems caused by TI's attitude towards this stuff, and this rework is consuming a lot more time than it needed to.

As for Dan, an update for the situation from Monday's call. I have a reply to my email I sent during that call, and Dan is looking at getting back up to speed with DMA engine stuff - but he no longer has the hardware. He seems to want to keep hold of the responsibility for that, so I think we're rather stuck at the moment over anything OMAP which uses the crypto stuff.

That's fine for the time being; the schedule for the removal of the legacy OMAP DMA stuff that I put into feature-removal.txt says "2013" and I _never_ intended that to mean the start of 2013.

maintainer
#1 lore raw
Quoted 4 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Thanks, let's get those fixed ASAP.

Quoted 2 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22

Hmm I think this regression was caused by my sparse IRQ changes, looks like I have a typo using OMAP_INTC_START in stead of the GIC base. Will do a patch for this.

Quoted 1 line

omap_hwmod: mcpdm: cannot be enabled for reset (3)

Paul, Benoit, care to take a look at this?

Quoted 2 lines

omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2

I think Afzal posted something about this already? Looks like this too could be sparse IRQ related regression..

Quoted 1 line

Error setting wl12xx data: -38

Hmm I wonder if wl12xx_set_platform_data() is really supposed to return -EBUSY if platform_data exists? Ohad, can you please take a look?

Quoted 3 lines

omap_hsmmc omap_hsmmc.1: Failed to get debounce clk omap_hsmmc omap_hsmmc.0: Failed to get debounce clk omap_hsmmc omap_hsmmc.4: Failed to get debounce clk

These should be optional AFAIK, so no warning should be printed.

Quoted 1 line

twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file

Peter, can you take a look please?

Quoted 2 lines

omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.

Kevin?

Quoted 1 line

mmc1: host does not support reading read-only switch. assuming write-enable.

This too should be optional.

Quoted 11 lines

As of today, I've rebased my serial changes as far forward as I dare at the moment (to the commit before removal of DMA), and then merged it into the latest trees from armsoc and myself, fixing up all the horrid conflicts. I've finally got it to a stage where at least it compiles, but unfortunately something has broken serial output from userspace quite badly to the point that it doesn't work.

I know that my serial changes were fine before I tried rebasing them (the set I posted to the mailing list certainly did work) so I suspect that it's down to incompatibilities between the fixes done by others (who didn't really understand all issues involved) and those done by myself.

Have you been able to locate the breaking patches, maybe those could be reverted?

Regards,

Tony

#2 lore raw
Quoted 8 lines · Tony Lindgren
Quoted 7 lines · Russell King - ARM Linux

As of today, I've rebased my serial changes as far forward as I dare at the moment (to the commit before removal of DMA), and then merged it into the latest trees from armsoc and myself, fixing up all the horrid conflicts. I've finally got it to a stage where at least it compiles, but unfortunately something has broken serial output from userspace quite badly to the point that it doesn't work.

Quoted 7 lines
Quoted 4 lines

I know that my serial changes were fine before I tried rebasing them (the set I posted to the mailing list certainly did work) so I suspect that it's down to incompatibilities between the fixes done by others (who didn't really understand all issues involved) and those done by myself.

Have you been able to locate the breaking patches, maybe those could be reverted?

Not yet; I'll look into it this weekend. I've only recently got stuff back into a state where the kautobuild kernels don't error out during the build for the OMAP and SA11x0 stuff. OMAP ended up in that situation because of the duplicated serial efforts causing rather disgusting and horrid conflicts.

#3 lore raw
In reply to Tony Lindgren

Hi Tony,

Quoted 11 lines · Tony Lindgren
Quoted 4 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Thanks, let's get those fixed ASAP.

Quoted 2 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22

Quoted 7 lines

Hmm I think this regression was caused by my sparse IRQ changes, looks like I have a typo using OMAP_INTC_START in stead of the GIC base. Will do a patch for this.

Quoted 1 line

omap_hwmod: mcpdm: cannot be enabled for reset (3)

Paul, Benoit, care to take a look at this?

Yeah, that one is a warning. The mcpdm is not accessible at boot time if the external clock (from twl6040) is not enabled.

Paul introduced a HWMOD_EXT_OPT_MAIN_CLK flag to avoid the warning [1], but it looks like that code is not merged.
I'll check where that patch is stuck.

Regards,
Benoit

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-June/103019.html

maintainer
#4 lore raw
Quoted 13 lines · Benoit Cousson

Hi Tony,

Quoted 10 lines · Tony Lindgren
Quoted 4 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Thanks, let's get those fixed ASAP.

Quoted 2 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22

Posted a fix for this as "ARM: OMAP4: Fix twd_local_timer_register regression".

Quoted 6 lines
Quoted 6 lines

Hmm I think this regression was caused by my sparse IRQ changes, looks like I have a typo using OMAP_INTC_START in stead of the GIC base. Will do a patch for this.

Quoted 1 line

omap_hwmod: mcpdm: cannot be enabled for reset (3)

Quoted 8 lines
Quoted 1 line

Paul, Benoit, care to take a look at this?

Yeah, that one is a warning. The mcpdm is not accessible at boot time if the external clock (from twl6040) is not enabled.

Paul introduced a HWMOD_EXT_OPT_MAIN_CLK flag to avoid the warning [1], but it looks like that code is not merged.
I'll check where that patch is stuck.

Thanks, seems like that would be OK to do during the early -rc cycle to fix the warning.

Regards,

Tony

Quoted 2 lines

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-June/103019.html

#5 lore raw
In reply to Tony Lindgren
Quoted 5 lines · Tony Lindgren
Quoted 4 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

[...]

Quoted 5 lines
Quoted 3 lines

omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.

Kevin?

Have had a fix for this for awhile, but it's currently part of a broader VC/VP feature set. I thought about breaking it out as its own fix, but since voltage scaling is currently not supported/working on OMAP4 anyways, I decided it was not urgent.

Kevin

#6 lore raw
In reply to Tony Lindgren
Quoted 1 line · Tony Lindgren
Quoted 1 line

Error setting wl12xx data: -38

..

Quoted 1 line

Ohad, can you please take a look?

Sure, -38 is -ENOSYS which is returned when the wl12xx driver isn't configured.

This isn't an error (it's a user decision, and it shouldn't elicit any error) and the patch below (also attached) should make it go away on:

Quoted 1 line

From 374f145568585c8d6a8d5e4b8b5d3e6baedd2f39 Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  7 ++++++-
 arch/arm/mach-omap2/board-4430sdp.c          | 13 ++++++++++--
 arch/arm/mach-omap2/board-omap3evm.c         | 11 +++++++++-
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 ++++++++-
 arch/arm/mach-omap2/board-omap4panda.c       | 30 ++++++++++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 20 ++++++++++++++++---
 6 files changed, 76 insertions(+), 14 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-davinci/board-da850-evm.c
index 32ee3f8..1b19415 100644

arch/arm/mach-davinci/board-da850-evm.c +6 -1
@@ -1404,8 +1404,13 @@ static __init int da850_wl12xx_init(void)
 	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
 
 	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto free_wlan_irq;
+
+	/* bail out verbosely on any other error */
 	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto free_wlan_irq;
 	}
 
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c12..d1dd81a 100644

arch/arm/mach-omap2/board-4430sdp.c +11 -2
@@ -826,9 +826,18 @@ static void __init omap4_sdp4430_wifi_init(void)
 
 	omap4_sdp4430_wifi_mux_init();
 	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
 	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
-	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3evm.c
index b9b776b..7f72e44 100644

arch/arm/mach-omap2/board-omap3evm.c +10 -1
@@ -637,9 +637,18 @@ static void __init omap3_evm_wl12xx_init(void)
 
 	/* WL12xx WLAN Init */
 	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
-	if (ret)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..bbc4001 100644

arch/arm/mach-omap2/board-omap3pandora.c +8 -1
@@ -549,8 +549,15 @@ static void __init pandora_wl1251_init(void)
 
 	pandora_wl1251_pdata.use_eeprom = true;
 	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto fail_irq;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto fail_irq;
+	}
 
 	return;
 
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap4panda.c
index bfcd397..cc5cdd6 100644

arch/arm/mach-omap2/board-omap4panda.c +24 -6
@@ -486,24 +486,42 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
+	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
+
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-zoom-peripherals.c
index c166fe1..3506ed2 100644

arch/arm/mach-omap2/board-zoom-peripherals.c +17 -3
@@ -286,19 +286,33 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
 	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
 
-	if (ret)
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
 
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
Signature · 1 line
1.7.10.rc3.1067.gb129051

From 374f145568585c8d6a8d5e4b8b5d3e6baedd2f39 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  7 ++++++-
 arch/arm/mach-omap2/board-4430sdp.c          | 13 ++++++++++--
 arch/arm/mach-omap2/board-omap3evm.c         | 11 +++++++++-
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 ++++++++-
 arch/arm/mach-omap2/board-omap4panda.c       | 30 ++++++++++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 20 ++++++++++++++++---
 6 files changed, 76 insertions(+), 14 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +6 -1
index 32ee3f8..1b19415 100644
@@ -1404,8 +1404,13 @@ static __init int da850_wl12xx_init(void)
 	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
 
 	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto free_wlan_irq;
+
+	/* bail out verbosely on any other error */
 	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto free_wlan_irq;
 	}
 
arch/arm/mach-omap2/board-4430sdp.c +11 -2
index 3669c12..d1dd81a 100644
@@ -826,9 +826,18 @@ static void __init omap4_sdp4430_wifi_init(void)
 
 	omap4_sdp4430_wifi_mux_init();
 	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
 	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
-	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3evm.c +10 -1
index b9b776b..7f72e44 100644
@@ -637,9 +637,18 @@ static void __init omap3_evm_wl12xx_init(void)
 
 	/* WL12xx WLAN Init */
 	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
-	if (ret)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3pandora.c +8 -1
index 00a1f4a..bbc4001 100644
@@ -549,8 +549,15 @@ static void __init pandora_wl1251_init(void)
 
 	pandora_wl1251_pdata.use_eeprom = true;
 	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto fail_irq;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto fail_irq;
+	}
 
 	return;
 
arch/arm/mach-omap2/board-omap4panda.c +24 -6
index bfcd397..cc5cdd6 100644
@@ -486,24 +486,42 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
+	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
+
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/board-zoom-peripherals.c +17 -3
index c166fe1..3506ed2 100644
@@ -286,19 +286,33 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
 	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
 
-	if (ret)
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
 
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
Signature · 1 line
1.7.10.rc3.1067.gb129051
#20 lore raw
In reply to Tony Lindgren

Hi,

Quoted 7 lines · Tony Lindgren
Quoted 2 lines · Russell King - ARM Linux

omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2

I think Afzal posted something about this already? Looks like this too could be sparse IRQ related regression..

Patch has been posted to resolve the issue,
"ARM: OMAP4: hwmod data: gpmc main clk".

Regards
Afzal

#24 lore raw
In reply to Tony Lindgren
Quoted 3 lines · Tony Lindgren
Quoted 1 line

twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file

Peter, can you take a look please?

Patch to fix this has been already sent:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055684.html

The same issue has been also fixed for twl4030:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055683.html

Signature · 5 lines
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#7 lore raw
In reply to Ohad Ben-Cohen
Quoted 23 lines · Ohad Ben-Cohen
Quoted 1 line · Tony Lindgren
Quoted 1 line

Error setting wl12xx data: -38

..

Quoted 1 line

Ohad, can you please take a look?

Sure, -38 is -ENOSYS which is returned when the wl12xx driver isn't configured.

This isn't an error (it's a user decision, and it shouldn't elicit any error) and the patch below (also attached) should make it go away on:

From 374f145568585c8d6a8d5e4b8b5d3e6baedd2f39 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

Quoted 5 lines

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Thanks applying into omap-for-v3.7-rc1/fixes-part2.

Regards,

Tony

Quoted 200 lines
---
 arch/arm/mach-davinci/board-da850-evm.c      |  7 ++++++-
 arch/arm/mach-omap2/board-4430sdp.c          | 13 ++++++++++--
 arch/arm/mach-omap2/board-omap3evm.c         | 11 +++++++++-
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 ++++++++-
 arch/arm/mach-omap2/board-omap4panda.c       | 30 ++++++++++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 20 ++++++++++++++++---
 6 files changed, 76 insertions(+), 14 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +6 -1
index 32ee3f8..1b19415 100644
@@ -1404,8 +1404,13 @@ static __init int da850_wl12xx_init(void)
 	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
 
 	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto free_wlan_irq;
+
+	/* bail out verbosely on any other error */
 	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto free_wlan_irq;
 	}
 
arch/arm/mach-omap2/board-4430sdp.c +11 -2
index 3669c12..d1dd81a 100644
@@ -826,9 +826,18 @@ static void __init omap4_sdp4430_wifi_init(void)
 
 	omap4_sdp4430_wifi_mux_init();
 	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
 	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
-	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3evm.c +10 -1
index b9b776b..7f72e44 100644
@@ -637,9 +637,18 @@ static void __init omap3_evm_wl12xx_init(void)
 
 	/* WL12xx WLAN Init */
 	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
-	if (ret)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3pandora.c +8 -1
index 00a1f4a..bbc4001 100644
@@ -549,8 +549,15 @@ static void __init pandora_wl1251_init(void)
 
 	pandora_wl1251_pdata.use_eeprom = true;
 	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		goto fail_irq;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
 		goto fail_irq;
+	}
 
 	return;
 
arch/arm/mach-omap2/board-omap4panda.c +24 -6
index bfcd397..cc5cdd6 100644
@@ -486,24 +486,42 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
+
+	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
+
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/board-zoom-peripherals.c +17 -3
index c166fe1..3506ed2 100644
@@ -286,19 +286,33 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
 	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
+
 	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return;
 
-	if (ret)
+	/* bail out verbosely on any other error */
+	if (ret) {
 		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+	}
 
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
Signature · 1 line
1.7.10.rc3.1067.gb129051
maintainer
#21 lore raw
In reply to Mohammed, Afzal
Quoted 5 lines · Mohammed, Afzal

Hi,

Quoted 1 line · Tony Lindgren

* Russell King - ARM Linux <[email protected]> [121012 08:56]:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2

I think Afzal posted something about this already? Looks like this too could be sparse IRQ related regression..

Patch has been posted to resolve the issue,
"ARM: OMAP4: hwmod data: gpmc main clk".

OK thanks I'll pick that up.

Regards,

Tony

maintainer
#8 lore raw
In reply to Tony Lindgren
Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Ohad Ben-Cohen
Quoted 1 line · Tony Lindgren
Quoted 1 line

Error setting wl12xx data: -38

..

Quoted 1 line

Ohad, can you please take a look?

Sure, -38 is -ENOSYS which is returned when the wl12xx driver isn't configured.

This isn't an error (it's a user decision, and it shouldn't elicit any error) and the patch below (also attached) should make it go away on:

From 374f145568585c8d6a8d5e4b8b5d3e6baedd2f39 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

Quoted 7 lines
Quoted 5 lines

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Thanks applying into omap-for-v3.7-rc1/fixes-part2.

Hmm looking at it repeats the same code over again. Can you rather add some wl12xx_board_init() helper function to mach-omap2/devices.c to do it? Dropping this for now.

Regards,

Tony

#22 lore raw
In reply to Tony Lindgren

Hi Tony,

Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Mohammed, Afzal

Hi,

Quoted 5 lines · Tony Lindgren
Quoted 2 lines · Russell King - ARM Linux

omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I think Afzal posted something about this already? Looks like this too could be sparse IRQ related regression..

Patch has been posted to resolve the issue,
"ARM: OMAP4: hwmod data: gpmc main clk".

OK thanks I'll pick that up.

In fact you should not pick that one, the one I sent superseded it:

[PATCH] ARM: OMAP2+: clock data: Add dev-id for the omap-gpmc dummy fck

BTW, I cannot find your omap-for-v3.7-rc1/fixes-part2 branch, did you already pushed it?

Regards,
Benoit

maintainer
#23 lore raw
Quoted 15 lines · Benoit Cousson

Hi Tony,

Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Mohammed, Afzal

Hi,

Quoted 7 lines · Tony Lindgren
Quoted 2 lines · Russell King - ARM Linux

omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2

I think Afzal posted something about this already? Looks like this too could be sparse IRQ related regression..

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Patch has been posted to resolve the issue,
"ARM: OMAP4: hwmod data: gpmc main clk".

OK thanks I'll pick that up.

In fact you should not pick that one, the one I sent superseded it:

[PATCH] ARM: OMAP2+: clock data: Add dev-id for the omap-gpmc dummy fck

OK yeah looks like I have the right one then.

Quoted 2 lines

BTW, I cannot find your omap-for-v3.7-rc1/fixes-part2 branch, did you already pushed it?

Not yet, was running randconfig builds on it while I was out for lunch :) Just pushed it out.

Regards,

Tony

#9 lore raw
In reply to Tony Lindgren
Quoted 3 lines · Tony Lindgren

Hmm looking at it repeats the same code over again. Can you rather add some wl12xx_board_init() helper function to mach-omap2/devices.c to do it?

Nice, see below. Note that I can only compile test this now, which may be ok because it's pretty trivial. But do let me know if you want me to get it tested.

Quoted 1 line

From b940fb88a97494ad3a0a093279a5f176c0b29e44 Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++------
 arch/arm/mach-omap2/board-4430sdp.c          |  7 ++++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 +++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++------
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++++-----
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 arch/arm/mach-omap2/devices.c                | 26 ++++++++++++++++++++++++++
 8 files changed, 64 insertions(+), 29 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-davinci/board-da850-evm.c
index 32ee3f8..7243c22 100644

arch/arm/mach-davinci/board-da850-evm.c +2 -6
@@ -1401,13 +1401,9 @@ static __init int da850_wl12xx_init(void)
 		goto free_wlan_en;
 	}
 
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+	ret = wl12xx_board_init(&da850_wl12xx_wlan_data, DA850_WLAN_IRQ);
+	if (ret)
 		goto free_wlan_irq;
-	}
 
 	return 0;
 
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c12..bc48679 100644

arch/arm/mach-omap2/board-4430sdp.c +4 -3
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3evm.c
index b9b776b..8e3a075 100644

arch/arm/mach-omap2/board-omap3evm.c +3 -3
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..bfdc7aa 100644

arch/arm/mach-omap2/board-omap3pandora.c +3 -6
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap4panda.c
index bfcd397..f203cd9 100644

arch/arm/mach-omap2/board-omap4panda.c +14 -6
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-zoom-peripherals.c
index c166fe1..c81a2c7 100644

arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/common-board-devices.h
index a0b4a428..52e91424 100644

arch/arm/mach-omap2/common-board-devices.h +2 -0
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
arch/arm/mach-omap2/devices.c +26 -0
index c8c2117..9e86bb9 100644
@@ -19,6 +19,7 @@
 #include <linux/of.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/omap4-keypad.h>
+#include <linux/wl12xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -38,6 +39,31 @@
 #define L3_MODULES_MAX_LEN 12
 #define L3_MODULES 3
 
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static int __init omap3_l3_init(void)
 {
 	struct omap_hwmod *oh;
Signature · 1 line
1.7.10.rc3.1067.gb129051

From b940fb88a97494ad3a0a093279a5f176c0b29e44 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++------
 arch/arm/mach-omap2/board-4430sdp.c          |  7 ++++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 +++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++------
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++++-----
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 arch/arm/mach-omap2/devices.c                | 26 ++++++++++++++++++++++++++
 8 files changed, 64 insertions(+), 29 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +2 -6
index 32ee3f8..7243c22 100644
@@ -1401,13 +1401,9 @@ static __init int da850_wl12xx_init(void)
 		goto free_wlan_en;
 	}
 
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+	ret = wl12xx_board_init(&da850_wl12xx_wlan_data, DA850_WLAN_IRQ);
+	if (ret)
 		goto free_wlan_irq;
-	}
 
 	return 0;
 
arch/arm/mach-omap2/board-4430sdp.c +4 -3
index 3669c12..bc48679 100644
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3evm.c +3 -3
index b9b776b..8e3a075 100644
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3pandora.c +3 -6
index 00a1f4a..bfdc7aa 100644
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
arch/arm/mach-omap2/board-omap4panda.c +14 -6
index bfcd397..f203cd9 100644
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
index c166fe1..c81a2c7 100644
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
arch/arm/mach-omap2/common-board-devices.h +2 -0
index a0b4a428..52e91424 100644
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
arch/arm/mach-omap2/devices.c +26 -0
index c8c2117..9e86bb9 100644
@@ -19,6 +19,7 @@
 #include <linux/of.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/omap4-keypad.h>
+#include <linux/wl12xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -38,6 +39,31 @@
 #define L3_MODULES_MAX_LEN 12
 #define L3_MODULES 3
 
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static int __init omap3_l3_init(void)
 {
 	struct omap_hwmod *oh;
Signature · 1 line
1.7.10.rc3.1067.gb129051
#10 lore raw

Hi Ohad,

Quoted 8 lines · Ohad Ben-Cohen
Quoted 3 lines · Tony Lindgren

Hmm looking at it repeats the same code over again. Can you rather add some wl12xx_board_init() helper function to mach-omap2/devices.c to do it?

Nice, see below. Note that I can only compile test this now, which may be ok because it's pretty trivial. But do let me know if you want me to get it tested.

The patch looks good, though minor comment below.

Quoted 31 lines
Quoted 2 lines

From b940fb88a97494ad3a0a093279a5f176c0b29e44 Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++------
 arch/arm/mach-omap2/board-4430sdp.c          |  7 ++++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 +++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++------
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++++------
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++++-----
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 arch/arm/mach-omap2/devices.c                | 26 ++++++++++++++++++++++++++
 8 files changed, 64 insertions(+), 29 deletions(-)

[...]

Quoted 6 lines
arch/arm/mach-omap2/common-board-devices.h +0 -0
index a0b4a428..52e91424 100644

arch/arm/mach-omap2/common-board-devices.h line 15

Quoted 9 lines
arch/arm/mach-omap2/common-board-devices.h +2 -0
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);

You are adding declarations inside the common-board-devices.h, but the implementation inside the devices.c.
I can see that devices.c has only on-soc devices in it.
So, I would expect to have the wl12xx_board_init() function implementation inside the common-board-devices.c file.

Another minor nit: I don't think you need to mark the declaration as __init, only the implementation, or is it for documenting it so?

Quoted 23 lines
arch/arm/mach-omap2/common-board-devices.h +0 -0
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
arch/arm/mach-omap2/devices.c +6 -0
index c8c2117..9e86bb9 100644
@@ -19,6 +19,7 @@
 #include <linux/of.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/omap4-keypad.h>
+#include <linux/wl12xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -38,6 +39,31 @@
 #define L3_MODULES_MAX_LEN 12
 #define L3_MODULES 3
 
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);

arch/arm/mach-omap2/devices.c line 56

Quoted 10 lines
arch/arm/mach-omap2/devices.c +10 -0
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;

Instead of the above, wouldn't it be better to have:
#if defined(CONFIG_WL12XX_PLATFORM_DATA)
int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio) {
...
}
#else
inline int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio)

{
	return 0;
}

#endif

Quoted 13 lines
arch/arm/mach-omap2/devices.c +10 -0
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static int __init omap3_l3_init(void)
 {
 	struct omap_hwmod *oh;
Signature · 2 lines
Regards,
Igor.
#11 lore raw

Hi Igor,

Quoted 5 lines · Igor Grinberg

You are adding declarations inside the common-board-devices.h, but the implementation inside the devices.c.
I can see that devices.c has only on-soc devices in it.
So, I would expect to have the wl12xx_board_init() function implementation inside the common-board-devices.c file.

I really don't mind. Tony do you have any preference?

Quoted 2 lines

Another minor nit: I don't think you need to mark the declaration as __init, only the implementation, or is it for documenting it so?

It may be, but I don't really mind removing it. Let's remove it if we'll move to common-board-devices.c, otherwise it probably isn't worth the noise.

Quoted 8 lines

Instead of the above, wouldn't it be better to have:
#if defined(CONFIG_WL12XX_PLATFORM_DATA)
int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio) {
...
}
#else
inline int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio)

Quoted 4 lines
{
        return 0;
}

#endif

I think readability-wise we're probably better off without the #ifdef.

Thanks,
Ohad.

maintainer
#12 lore raw
Quoted 10 lines · Ohad Ben-Cohen

Hi Igor,

Quoted 5 lines · Igor Grinberg

You are adding declarations inside the common-board-devices.h, but the implementation inside the devices.c.
I can see that devices.c has only on-soc devices in it.
So, I would expect to have the wl12xx_board_init() function implementation inside the common-board-devices.c file.

I really don't mind. Tony do you have any preference?

Yes common-board-devices.c would be better.

Quoted 6 lines
Quoted 2 lines

Another minor nit: I don't think you need to mark the declaration as __init, only the implementation, or is it for documenting it so?

It may be, but I don't really mind removing it. Let's remove it if we'll move to common-board-devices.c, otherwise it probably isn't worth the noise.

OK

Quoted 13 lines
Quoted 8 lines

Instead of the above, wouldn't it be better to have:
#if defined(CONFIG_WL12XX_PLATFORM_DATA)
int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio) {
...
}
#else
inline int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int irq_gpio)

Quoted 4 lines
{
        return 0;
}

#endif

Quoted 1 line

I think readability-wise we're probably better off without the #ifdef.

We could optimize away a minimal amount of code for many configurations with the ifdef? :)

Regards,

Tony

#13 lore raw

On Fri, Oct 19, 2012 at 7:07 PM, Tony Lindgren <[email protected]> wrote:
...

Quoted 2 lines

We could optimize away a minimal amount of code for many configurations with the ifdef? :)

Sure, here goes (compile tested only):

Quoted 1 line

From 6b82365da2c04986e647d06c285197efece7cb34 Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++-----
 arch/arm/mach-omap2/board-4430sdp.c          |  7 +++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 ++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++-----
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++-----
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
 arch/arm/mach-omap2/common-board-devices.c   | 33 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 8 files changed, 71 insertions(+), 29 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-davinci/board-da850-evm.c
index 32ee3f8..7243c22 100644

arch/arm/mach-davinci/board-da850-evm.c +2 -6
@@ -1401,13 +1401,9 @@ static __init int da850_wl12xx_init(void)
 		goto free_wlan_en;
 	}
 
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+	ret = wl12xx_board_init(&da850_wl12xx_wlan_data, DA850_WLAN_IRQ);
+	if (ret)
 		goto free_wlan_irq;
-	}
 
 	return 0;
 
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c12..bc48679 100644

arch/arm/mach-omap2/board-4430sdp.c +4 -3
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3evm.c
index b9b776b..8e3a075 100644

arch/arm/mach-omap2/board-omap3evm.c +3 -3
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..bfdc7aa 100644

arch/arm/mach-omap2/board-omap3pandora.c +3 -6
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap4panda.c
index bfcd397..f203cd9 100644

arch/arm/mach-omap2/board-omap4panda.c +14 -6
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-zoom-peripherals.c
index c166fe1..c81a2c7 100644

arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/common-board-devices.c
index 48daac2..02351e9 100644

arch/arm/mach-omap2/common-board-devices.c +1 -0
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/wl12xx.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
@@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options,

struct mtd_partition *parts,
{
}
#endif
+
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio) +{
+ int ret;
+
+ wlan_data->irq = gpio_to_irq(gpio);
+ if (wlan_data->irq < 0) {
+ ret = wlan_data->irq;
+ pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+ return ret;
+ }
+
+ ret = wl12xx_set_platform_data(wlan_data);
+ /* bail out silently in case wl12xx isn't configured */
+ if (ret == -ENOSYS)
+ return ret;
+
+ /* bail out verbosely on any other error */
+ if (ret) {
+ pr_err("error setting wl12xx data: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+#else /* !CONFIG_WL12XX_PLATFORM_DATA */
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio) +{
+ return 0;
+}
+#endif

(quoted diff) +0 -0

b/arch/arm/mach-omap2/common-board-devices.h
index a0b4a428..0e7398f 100644

arch/arm/mach-omap2/common-board-devices.h +2 -0
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
Signature · 1 line
1.7.10.rc3.1067.gb129051

From 6b82365da2c04986e647d06c285197efece7cb34 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++-----
 arch/arm/mach-omap2/board-4430sdp.c          |  7 +++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 ++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++-----
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++-----
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
 arch/arm/mach-omap2/common-board-devices.c   | 33 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 8 files changed, 71 insertions(+), 29 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +2 -6
index 32ee3f8..7243c22 100644
@@ -1401,13 +1401,9 @@ static __init int da850_wl12xx_init(void)
 		goto free_wlan_en;
 	}
 
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+	ret = wl12xx_board_init(&da850_wl12xx_wlan_data, DA850_WLAN_IRQ);
+	if (ret)
 		goto free_wlan_irq;
-	}
 
 	return 0;
 
arch/arm/mach-omap2/board-4430sdp.c +4 -3
index 3669c12..bc48679 100644
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3evm.c +3 -3
index b9b776b..8e3a075 100644
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3pandora.c +3 -6
index 00a1f4a..bfdc7aa 100644
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
arch/arm/mach-omap2/board-omap4panda.c +14 -6
index bfcd397..f203cd9 100644
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
index c166fe1..c81a2c7 100644
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
arch/arm/mach-omap2/common-board-devices.c +33 -0
index 48daac2..02351e9 100644
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/wl12xx.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
@@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
 {
 }
 #endif
+
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+#else /* !CONFIG_WL12XX_PLATFORM_DATA */
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	return 0;
+}
+#endif
arch/arm/mach-omap2/common-board-devices.h +2 -0
index a0b4a428..0e7398f 100644
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
Signature · 1 line
1.7.10.rc3.1067.gb129051
Acked-by
#14 lore raw
Quoted 20 lines · Ohad Ben-Cohen

On Fri, Oct 19, 2012 at 7:07 PM, Tony Lindgren <[email protected]> wrote:
...

Quoted 2 lines

We could optimize away a minimal amount of code for many configurations with the ifdef? :)

Sure, here goes (compile tested only):

Quoted 1 line

From 6b82365da2c04986e647d06c285197efece7cb34 Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

Quoted 7 lines

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

Apart, from the minor comment below,

Quoted 10 lines
---
 arch/arm/mach-davinci/board-da850-evm.c      |  8 ++-----
 arch/arm/mach-omap2/board-4430sdp.c          |  7 +++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 ++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++-----
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++-----
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
 arch/arm/mach-omap2/common-board-devices.c   | 33 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 8 files changed, 71 insertions(+), 29 deletions(-)

[...]

Quoted 25 lines
arch/arm/mach-omap2/common-board-devices.c +8 -0
index 48daac2..02351e9 100644
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/wl12xx.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
@@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options,
 struct mtd_partition *parts,
 {
 }
 #endif
+
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);

arch/arm/mach-omap2/common-board-devices.c void __init omap_nand_flash_init(int options, · line 161

Quoted 10 lines
arch/arm/mach-omap2/common-board-devices.c +10 -0
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;

Since we have the function ifdef'ed, I don't think we need the ENOSYS check, do we?

Quoted 15 lines
arch/arm/mach-omap2/common-board-devices.c +15 -0
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+#else /* !CONFIG_WL12XX_PLATFORM_DATA */
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	return 0;
+}
+#endif

[...]

Signature · 2 lines
Regards,
Igor.
#15 lore raw
Quoted 7 lines · Igor Grinberg

arch/arm/mach-omap2/common-board-devices.c void __init omap_nand_flash_init(int options, struct mtd_partition *parts, · line 161

Quoted 4 lines
arch/arm/mach-omap2/common-board-devices.c +4 -0
+     ret = wl12xx_set_platform_data(wlan_data);
+     /* bail out silently in case wl12xx isn't configured */
+     if (ret == -ENOSYS)
+             return ret;

Since we have the function ifdef'ed, I don't think we need the ENOSYS check, do we?

If we want to be strict, we better not remove it.

It's an interface that hides the internal implementation, and it's just better not to assume anything beyond the return values and their meanings. This way if WLAN folks change something in the future, we don't need to update all the boards code again.

Thanks,
Ohad.

#16 lore raw
Quoted 9 lines · Ohad Ben-Cohen
Quoted 7 lines · Igor Grinberg

arch/arm/mach-omap2/common-board-devices.c void __init omap_nand_flash_init(int options, struct mtd_partition *parts, · line 161

Quoted 4 lines
arch/arm/mach-omap2/common-board-devices.c +4 -0
+     ret = wl12xx_set_platform_data(wlan_data);
+     /* bail out silently in case wl12xx isn't configured */
+     if (ret == -ENOSYS)
+             return ret;

Since we have the function ifdef'ed, I don't think we need the ENOSYS check, do we?

Quoted 6 lines

If we want to be strict, we better not remove it.

It's an interface that hides the internal implementation, and it's just better not to assume anything beyond the return values and their meanings. This way if WLAN folks change something in the future, we don't need to update all the boards code again.

Well, with this argument, we can add this (and many other checks) to many more places in the code...
I just wanted to point out that most probably ret == -ENOSYS will never happen since the #ifdef is added, but no problem from my side, it does not hurt to have 4 more lines just in case, right?

Thanks for the patch and the explanation!

You have my ack already...

Signature · 2 lines
Regards,
Igor.
#25 lore raw
In reply to Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Quoted 13 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22
omap_hwmod: mcpdm: cannot be enabled for reset (3)
omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2
Error setting wl12xx data: -38
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

Here's the latest set of error like messages, thanks to the kautobuild system:

omap_hwmod: mcpdm: cannot be enabled for reset (3)
Error setting wl12xx data: -38
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

maintainer
#17 lore raw
In reply to Ohad Ben-Cohen
Quoted 8 lines · Ohad Ben-Cohen

On Fri, Oct 19, 2012 at 7:07 PM, Tony Lindgren <[email protected]> wrote:

arch/arm/mach-davinci/board-da850-evm.c +0 -1
@@ -1401,13 +1401,9 @@ static __init int da850_wl12xx_init(void)
 		goto free_wlan_en;
 	}
 
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);

arch/arm/mach-davinci/board-da850-evm.c static __init int da850_wl12xx_init(void) · line 1408

Quoted 10 lines
arch/arm/mach-davinci/board-da850-evm.c +2 -5
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
+	ret = wl12xx_board_init(&da850_wl12xx_wlan_data, DA850_WLAN_IRQ);
+	if (ret)
 		goto free_wlan_irq;
-	}
 
 	return 0;

I don't think mach-davinci has wl12xx_board_init() available? Maybe leave this out or define also also somewhere for mach-davinci?

Regards,

Tony

#18 lore raw
Quoted 2 lines · Tony Lindgren

I don't think mach-davinci has wl12xx_board_init() available? Maybe leave this out or define also also somewhere for mach-davinci?

Yeah let's leave davinci out for now:

Quoted 1 line

From 665bcaa7ef0ed385cf1765f2d4503bf84aaf488a Mon Sep 17 00:00:00 2001

From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-omap2/board-4430sdp.c          |  7 +++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 ++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++-----
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++-----
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
 arch/arm/mach-omap2/common-board-devices.c   | 33 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 7 files changed, 69 insertions(+), 23 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c12..bc48679 100644

arch/arm/mach-omap2/board-4430sdp.c +4 -3
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3evm.c
index b9b776b..8e3a075 100644

arch/arm/mach-omap2/board-omap3evm.c +3 -3
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..bfdc7aa 100644

arch/arm/mach-omap2/board-omap3pandora.c +3 -6
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap4panda.c
index bfcd397..f203cd9 100644

arch/arm/mach-omap2/board-omap4panda.c +14 -6
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-zoom-peripherals.c
index c166fe1..c81a2c7 100644

arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/common-board-devices.c
index 48daac2..02351e9 100644

arch/arm/mach-omap2/common-board-devices.c +1 -0
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/wl12xx.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
@@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options,

struct mtd_partition *parts,
{
}
#endif
+
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio) +{
+ int ret;
+
+ wlan_data->irq = gpio_to_irq(gpio);
+ if (wlan_data->irq < 0) {
+ ret = wlan_data->irq;
+ pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+ return ret;
+ }
+
+ ret = wl12xx_set_platform_data(wlan_data);
+ /* bail out silently in case wl12xx isn't configured */
+ if (ret == -ENOSYS)
+ return ret;
+
+ /* bail out verbosely on any other error */
+ if (ret) {
+ pr_err("error setting wl12xx data: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+#else /* !CONFIG_WL12XX_PLATFORM_DATA */
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio) +{
+ return 0;
+}
+#endif

(quoted diff) +0 -0

b/arch/arm/mach-omap2/common-board-devices.h
index a0b4a428..0e7398f 100644

arch/arm/mach-omap2/common-board-devices.h +2 -0
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
Signature · 1 line
1.7.10.rc3.1067.gb129051

From 665bcaa7ef0ed385cf1765f2d4503bf84aaf488a Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

---
 arch/arm/mach-omap2/board-4430sdp.c          |  7 +++---
 arch/arm/mach-omap2/board-omap3evm.c         |  6 ++---
 arch/arm/mach-omap2/board-omap3pandora.c     |  9 +++-----
 arch/arm/mach-omap2/board-omap4panda.c       | 20 ++++++++++++-----
 arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
 arch/arm/mach-omap2/common-board-devices.c   | 33 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/common-board-devices.h   |  2 ++
 7 files changed, 69 insertions(+), 23 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +4 -3
index 3669c12..bc48679 100644
@@ -825,10 +825,11 @@ static void __init omap4_sdp4430_wifi_init(void)
 	int ret;
 
 	omap4_sdp4430_wifi_mux_init();
-	omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
+
+	ret = wl12xx_board_init(&omap4_sdp4430_wlan_data, GPIO_WIFI_IRQ);
 	if (ret)
-		pr_err("Error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
 		pr_err("Error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3evm.c +3 -3
index b9b776b..8e3a075 100644
@@ -636,10 +636,10 @@ static void __init omap3_evm_wl12xx_init(void)
 	int ret;
 
 	/* WL12xx WLAN Init */
-	omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
+	ret = wl12xx_board_init(&omap3evm_wlan_data, OMAP3EVM_WLAN_IRQ_GPIO);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		return;
+
 	ret = platform_device_register(&omap3evm_wlan_regulator);
 	if (ret)
 		pr_err("error registering wl12xx device: %d\n", ret);
arch/arm/mach-omap2/board-omap3pandora.c +3 -6
index 00a1f4a..bfdc7aa 100644
@@ -543,13 +543,10 @@ static void __init pandora_wl1251_init(void)
 	if (ret < 0)
 		goto fail;
 
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
 	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
+
+	ret = wl12xx_board_init(&pandora_wl1251_pdata, PANDORA_WIFI_IRQ_GPIO);
+	if (ret)
 		goto fail_irq;
 
 	return;
arch/arm/mach-omap2/board-omap4panda.c +14 -6
index bfcd397..f203cd9 100644
@@ -486,24 +486,32 @@ static void omap4_panda_init_rev(void)
 	}
 }
 
+static void __init omap4_panda_wlan_init(void)
+{
+	int ret;
+
+	ret = wl12xx_board_init(&omap_panda_wlan_data, GPIO_WIFI_IRQ);
+	if (ret)
+		return;
+
+	ret = platform_device_register(&omap_vwlan_device);
+	if (ret)
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
-	int ret;
 
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		package = OMAP_PACKAGE_CBL;
 	omap4_mux_init(board_mux, NULL, package);
 
-	omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
-	ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
-	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+	omap4_panda_wlan_init();
 
 	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
-	platform_device_register(&omap_vwlan_device);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/board-zoom-peripherals.c +10 -5
index c166fe1..c81a2c7 100644
@@ -286,19 +286,24 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
-void __init zoom_peripherals_init(void)
+static void __init zoom_wlan_init(void)
 {
 	int ret;
 
-	omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
-	ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
+	ret = wl12xx_board_init(&omap_zoom_wlan_data, OMAP_ZOOM_WLAN_IRQ_GPIO);
+	if (ret)
+		return;
 
+	ret = platform_device_register(&omap_vwlan_device);
 	if (ret)
-		pr_err("error setting wl12xx data: %d\n", ret);
+		pr_err("error registering wl12xx's fixed regulator: %d\n", ret);
+}
 
+void __init zoom_peripherals_init(void)
+{
 	omap_hsmmc_init(mmc);
+	zoom_wlan_init();
 	omap_i2c_init();
-	platform_device_register(&omap_vwlan_device);
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
arch/arm/mach-omap2/common-board-devices.c +33 -0
index 48daac2..02351e9 100644
@@ -23,6 +23,7 @@
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/wl12xx.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
@@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
 {
 }
 #endif
+
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	int ret;
+
+	wlan_data->irq = gpio_to_irq(gpio);
+	if (wlan_data->irq < 0) {
+		ret = wlan_data->irq;
+		pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
+		return ret;
+	}
+
+	ret = wl12xx_set_platform_data(wlan_data);
+	/* bail out silently in case wl12xx isn't configured */
+	if (ret == -ENOSYS)
+		return ret;
+
+	/* bail out verbosely on any other error */
+	if (ret) {
+		pr_err("error setting wl12xx data: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+#else /* !CONFIG_WL12XX_PLATFORM_DATA */
+int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
+{
+	return 0;
+}
+#endif
arch/arm/mach-omap2/common-board-devices.h +2 -0
index a0b4a428..0e7398f 100644
@@ -7,9 +7,11 @@
 
 struct mtd_partition;
 struct ads7846_platform_data;
+struct wl12xx_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
+int wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
Signature · 1 line
1.7.10.rc3.1067.gb129051
maintainer
#26 lore raw
In reply to Russell King - ARM Linux
Quoted 20 lines · Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Quoted 13 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22
omap_hwmod: mcpdm: cannot be enabled for reset (3)
omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2
Error setting wl12xx data: -38
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

Quoted 5 lines

Here's the latest set of error like messages, thanks to the kautobuild system:

omap_hwmod: mcpdm: cannot be enabled for reset (3) Error setting wl12xx data: -38

That's now fixed up and I've queued it.

Quoted 9 lines

omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

Kevin, do you have a patch for some of this?

Regards,

Tony

#27 lore raw
Quoted 5 lines · Tony Lindgren
Quoted 4 lines · Russell King - ARM Linux

On Fri, Oct 12, 2012 at 04:54:34PM +0100, Russell King - ARM Linux wrote:
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk omap_hsmmc omap_hsmmc.0: Failed to get debounce clk omap_hsmmc omap_hsmmc.4: Failed to get debounce clk

Hi,

Posted a patch to remove this warning, as debounce clock is not applicable for most platforms and optional for omap2430.

https://patchwork.kernel.org/patch/1645461/

Quoted 17 lines
Quoted 6 lines

omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

Kevin, do you have a patch for some of this?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#28 lore raw
In reply to Tony Lindgren
Quoted 36 lines · Tony Lindgren
Quoted 20 lines · Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux

For those who don't bother looking at my kautobuild boot tests on the OMAP boards I have, here's the errors which get spat out at boot time. Note that some of these I've reported in the past, and one of them is missing a newline character at the end of its string.

Quoted 13 lines

twd: can't register interrupt 45 (-22)
twd_local_timer_register failed -22
omap_hwmod: mcpdm: cannot be enabled for reset (3)
omap-gpmc omap-gpmc: error: clk_get
omap-gpmc: probe of omap-gpmc failed with error -2
Error setting wl12xx data: -38
omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
twl6040-codec twl6040-codec: ASoC: Failed to create Capture debugfs file
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

Quoted 5 lines

Here's the latest set of error like messages, thanks to the kautobuild system:

omap_hwmod: mcpdm: cannot be enabled for reset (3) Error setting wl12xx data: -38

That's now fixed up and I've queued it.

Quoted 7 lines

omap_hsmmc omap_hsmmc.1: Failed to get debounce clk
omap_hsmmc omap_hsmmc.0: Failed to get debounce clk
omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

Quoted 5 lines
Quoted 2 lines

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

Kevin, do you have a patch for some of this?

I'll fix up the missing newline right away.

I was planning to leave the VC mismatch problem because it's fixed in Tero's auto retention series. However, I haven't been able to get to that series yet due to all the regressions/bugfixes, so I'll at least pull out the part that fixes up the mistmatch and submit it for v3.7.

Kevin

[1] http://marc.info/?l=linux-omap&m=134859084918176&w=2

#29 lore raw
Quoted 2 lines · Kevin Hilman

Tony Lindgren <[email protected]> writes:

[...]

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

Kevin, do you have a patch for some of this?

I'll fix up the missing newline right away.

Patch sent.

Quoted 4 lines

I was planning to leave the VC mismatch problem because it's fixed in Tero's auto retention series. However, I haven't been able to get to that series yet due to all the regressions/bugfixes, so I'll at least pull out the part that fixes up the mistmatch and submit it for v3.7.

On closer look, I don't think a quick fix is right for this one. Those I2C config mismatch warnings are legitmate for now, and will be fixed when Tero's series is merged.

Kevin

Quoted 3 lines

Kevin

[1] http://marc.info/?l=linux-omap&m=134859084918176&w=2

maintainer
#30 lore raw
Quoted 14 lines · Kevin Hilman
Quoted 2 lines · Kevin Hilman

Tony Lindgren <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

omap_hsmmc omap_hsmmc.4: Failed to get debounce clk
omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.
mmc1: host does not support reading read-only switch. assuming write-enable.

This looks much better compared to the previous set, but we could still do with getting a "\n" on at least one of those messages...

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Kevin, do you have a patch for some of this?

I'll fix up the missing newline right away.

Patch sent.

OK thanks.

Quoted 8 lines
Quoted 4 lines

I was planning to leave the VC mismatch problem because it's fixed in Tero's auto retention series. However, I haven't been able to get to that series yet due to all the regressions/bugfixes, so I'll at least pull out the part that fixes up the mistmatch and submit it for v3.7.

On closer look, I don't think a quick fix is right for this one. Those I2C config mismatch warnings are legitmate for now, and will be fixed when Tero's series is merged.

OK fine with me.

Regards,

Tony

Quoted 1 line
Quoted 1 line

[1] http://marc.info/?l=linux-omap&m=134859084918176&w=2

maintainer
#19 lore raw
In reply to Ohad Ben-Cohen
Quoted 15 lines · Ohad Ben-Cohen
Quoted 2 lines · Tony Lindgren

I don't think mach-davinci has wl12xx_board_init() available? Maybe leave this out or define also also somewhere for mach-davinci?

Yeah let's leave davinci out for now:

From 665bcaa7ef0ed385cf1765f2d4503bf84aaf488a Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Sun, 14 Oct 2012 20:16:01 +0200
Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
configured

Stop intimidating users with scary wlan error messages in case wl12xx support wasn't even built.

Quoted 8 lines

In addition, when wl12xx_set_platform_data() fails, don't bother registering wl12xx's fixed regulator device (on the relevant boards).

While we're at it, extract the wlan init code to a dedicated function to make (the relevant boards') init code look a bit nicer.

Compile tested only.

Seems to work here, tested on panda es with wlan working and on sdp with the warning gone.

Quoted 2 lines

Thanks applying into omap-for-v3.7-rc2/fixes-part2.

Regards,

Tony