mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
@ 2015-01-20  7:31 Bo Shen
  2015-01-21  9:41 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Bo Shen @ 2015-01-20  7:31 UTC (permalink / raw)
  To: s.hauer, plagnioj; +Cc: barebox

As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
So, make LED enable only when the 1-wire is disabled.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---

 arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boards/sama5d3xek/init.c b/arch/arm/boards/sama5d3xek/init.c
index 0b83147..ce05108 100644
--- a/arch/arm/boards/sama5d3xek/init.c
+++ b/arch/arm/boards/sama5d3xek/init.c
@@ -49,11 +49,13 @@
 
 #include "hw_version.h"
 
+#ifdef CONFIG_W1_MASTER_GPIO
 struct w1_gpio_platform_data w1_pdata = {
 	.pin = AT91_PIN_PE25,
 	.ext_pullup_enable_pin = -EINVAL,
 	.is_open_drain = 0,
 };
+#endif
 
 #if defined(CONFIG_NAND_ATMEL)
 static struct atmel_nand_data nand_pdata = {
@@ -323,11 +325,13 @@ struct gpio_led leds[] = {
 			.name = "d1",
 		},
 	}, {
+#ifndef CONFIG_W1_MASTER_GPIO
 		.gpio	= AT91_PIN_PE25,
 		.active_low	= 1,
 		.led	= {
 			.name = "d2",
 		},
+#endif
 	},
 };
 
@@ -353,6 +357,7 @@ static int at91sama5d3xek_mem_init(void)
 }
 mem_initcall(at91sama5d3xek_mem_init);
 
+#ifdef CONFIG_W1_MASTER_GPIO
 static void ek_add_device_w1(void)
 {
 	at91_set_gpio_input(w1_pdata.pin, 0);
@@ -361,6 +366,9 @@ static void ek_add_device_w1(void)
 
 	at91sama5d3xek_devices_detect_hw();
 }
+#else
+static void ek_add_device_w1(void) {}
+#endif
 
 #ifdef CONFIG_POLLER
 /*
-- 
2.3.0.rc0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-20  7:31 [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led Bo Shen
@ 2015-01-21  9:41 ` Sascha Hauer
  2015-01-21  9:56   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2015-01-21  9:41 UTC (permalink / raw)
  To: Bo Shen; +Cc: barebox

On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
> So, make LED enable only when the 1-wire is disabled.
> 
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
> 
>  arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-21  9:41 ` Sascha Hauer
@ 2015-01-21  9:56   ` Jean-Christophe PLAGNIOL-VILLARD
  2015-01-21 10:03     ` Bo Shen
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-21  9:56 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


> On Jan 21, 2015, at 5:41 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
>> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
>> So, make LED enable only when the 1-wire is disabled.
>> 
>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>> ---
>> 
>> arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
> 

On barebox this does not conflict

as we do not have multi task support

Best Regards,
J.
> Applied, thanks
> 
> Sascha
> 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-21  9:56   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2015-01-21 10:03     ` Bo Shen
  2015-01-23  7:58       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Bo Shen @ 2015-01-21 10:03 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD, Sascha Hauer; +Cc: barebox

Hi J,

On 01/21/2015 05:56 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>
>> On Jan 21, 2015, at 5:41 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>
>> On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
>>> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
>>> So, make LED enable only when the 1-wire is disabled.
>>>
>>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>>> ---
>>>
>>> arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>
>
> On barebox this does not conflict

As both use gpio mode, which will call gpio request, when LED try to 
request the same gpio, it will failed. So, the led d2 won't be 
successfully registered.

> as we do not have multi task support
>
> Best Regards,
> J.
>> Applied, thanks
>>
>> Sascha
>>
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>

Best Regards,
Bo Shen

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-21 10:03     ` Bo Shen
@ 2015-01-23  7:58       ` Jean-Christophe PLAGNIOL-VILLARD
  2015-01-23  8:35         ` Bo Shen
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-23  7:58 UTC (permalink / raw)
  To: Bo Shen; +Cc: barebox


> On Jan 21, 2015, at 6:03 PM, Bo Shen <voice.shen@atmel.com> wrote:
> 
> Hi J,
> 
> On 01/21/2015 05:56 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>> 
>>> On Jan 21, 2015, at 5:41 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>> 
>>> On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
>>>> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
>>>> So, make LED enable only when the 1-wire is disabled.
>>>> 
>>>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>>>> ---
>>>> 
>>>> arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>>>> 1 file changed, 8 insertions(+)
>>> 
>> 
>> On barebox this does not conflict
> 
> As both use gpio mode, which will call gpio request, when LED try to request the same gpio, it will failed. So, the led d2 won't be successfully registered.

Yes with the pinctrl driver

but it will be a choice at defconfig level not C code

if you enable both we need to put a warning at compiling time
and decide which one is more important because if you do not use the w1 you may do except to have both legs


> 
>> as we do not have multi task support
>> 
>> Best Regards,
>> J.
>>> Applied, thanks
>>> 
>>> Sascha
>>> 
>>> 
>>> --
>>> Pengutronix e.K.                           |                             |
>>> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
>>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>> 
> 
> Best Regards,
> Bo Shen


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-23  7:58       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2015-01-23  8:35         ` Bo Shen
  2015-01-23  9:18           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Bo Shen @ 2015-01-23  8:35 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

Hi J,

On 01/23/2015 03:58 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>
>> On Jan 21, 2015, at 6:03 PM, Bo Shen <voice.shen@atmel.com> wrote:
>>
>> Hi J,
>>
>> On 01/21/2015 05:56 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>
>>>> On Jan 21, 2015, at 5:41 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>>>
>>>> On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
>>>>> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
>>>>> So, make LED enable only when the 1-wire is disabled.
>>>>>
>>>>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>>>>> ---
>>>>>
>>>>> arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>>>>> 1 file changed, 8 insertions(+)
>>>>
>>>
>>> On barebox this does not conflict
>>
>> As both use gpio mode, which will call gpio request, when LED try to request the same gpio, it will failed. So, the led d2 won't be successfully registered.
>
> Yes with the pinctrl driver
>
> but it will be a choice at defconfig level not C code
>
> if you enable both we need to put a warning at compiling time

I don't find any good solution for this, can you provide one? Thanks.

> and decide which one is more important because if you do not use the w1 you may do except to have both legs

Actually, in code, no use for led d2, only d1 heart beat.

>
>>
>>> as we do not have multi task support
>>>
>>> Best Regards,
>>> J.
>>>> Applied, thanks
>>>>
>>>> Sascha
>>>>
>>>>
>>>> --
>>>> Pengutronix e.K.                           |                             |
>>>> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>>>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
>>>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>>
>>
>> Best Regards,
>> Bo Shen
>

Best Regards,
Bo Shen


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led
  2015-01-23  8:35         ` Bo Shen
@ 2015-01-23  9:18           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-23  9:18 UTC (permalink / raw)
  To: Bo Shen; +Cc: barebox


> On Jan 23, 2015, at 4:35 PM, Bo Shen <voice.shen@atmel.com> wrote:
> 
> Hi J,
> 
> On 01/23/2015 03:58 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>> 
>>> On Jan 21, 2015, at 6:03 PM, Bo Shen <voice.shen@atmel.com> wrote:
>>> 
>>> Hi J,
>>> 
>>> On 01/21/2015 05:56 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>> 
>>>>> On Jan 21, 2015, at 5:41 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>>>> 
>>>>> On Tue, Jan 20, 2015 at 03:31:25PM +0800, Bo Shen wrote:
>>>>>> As the 1-wire and LED d2 use the same pin (PE25) on the EK board.
>>>>>> So, make LED enable only when the 1-wire is disabled.
>>>>>> 
>>>>>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>>>>>> ---
>>>>>> 
>>>>>> arch/arm/boards/sama5d3xek/init.c | 8 ++++++++
>>>>>> 1 file changed, 8 insertions(+)
>>>>> 
>>>> 
>>>> On barebox this does not conflict
>>> 
>>> As both use gpio mode, which will call gpio request, when LED try to request the same gpio, it will failed. So, the led d2 won't be successfully registered.
>> 
>> Yes with the pinctrl driver
>> 
>> but it will be a choice at defconfig level not C code
>> 
>> if you enable both we need to put a warning at compiling time
> 
> I don't find any good solution for this, can you provide one? Thanks.
> 
>> and decide which one is more important because if you do not use the w1 you may do except to have both legs
> 
> Actually, in code, no use for led d2, only d1 heart beat.
> 


Will take a look next week

Best Regards,
J.
>> 
>>> 
>>>> as we do not have multi task support
>>>> 
>>>> Best Regards,
>>>> J.
>>>>> Applied, thanks
>>>>> 
>>>>> Sascha
>>>>> 
>>>>> 
>>>>> --
>>>>> Pengutronix e.K.                           |                             |
>>>>> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>>>>> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
>>>>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>>> 
>>> 
>>> Best Regards,
>>> Bo Shen
>> 
> 
> Best Regards,
> Bo Shen
> 


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-23  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20  7:31 [PATCH] ARM: atmel: sama5d3xek: fix conflict between w1 and led Bo Shen
2015-01-21  9:41 ` Sascha Hauer
2015-01-21  9:56   ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-21 10:03     ` Bo Shen
2015-01-23  7:58       ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-23  8:35         ` Bo Shen
2015-01-23  9:18           ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox