public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can : AM3517EVM : add platform specific init
@ 2011-03-10 16:39 Abhilash K V
  2011-03-11 12:19 ` Sergei Shtylyov
  2011-03-11 16:57 ` Wolfgang Grandegger
  0 siblings, 2 replies; 3+ messages in thread
From: Abhilash K V @ 2011-03-10 16:39 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, linux-kernel
  Cc: tony, linux, Abhilash K V, Sriramakrishnan

CAN module on AM3517 requires programming of IO expander
as part of init sequence. Added transceiver_switch
callback to handle this.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Reviewed-by:  Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 2e4aad2..782d72d 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -734,6 +734,23 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
+/*
+ * HECC information
+ */
+
+#define CAN_STB         214
+static void hecc_phy_control(int on)
+{
+        int r;
+
+        r = gpio_request(CAN_STB, "can_stb");
+        if (r) {
+                printk(KERN_ERR "failed to get can_stb \n");
+                return;
+        }
+
+        gpio_direction_output(CAN_STB, (on==1)?0:1);
+}
 
 static struct resource am3517_hecc_resources[] = {
 	{
@@ -762,6 +779,7 @@ static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
 	.mbx_offset		= AM35XX_HECC_MBOX_OFFSET,
 	.int_line		= AM35XX_HECC_INT_LINE,
 	.version		= AM35XX_HECC_VERSION,
+	.transceiver_switch     = hecc_phy_control,
 };
 
 static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
-- 
1.6.2.4


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

* Re: [PATCH] can : AM3517EVM : add platform specific init
  2011-03-10 16:39 [PATCH] can : AM3517EVM : add platform specific init Abhilash K V
@ 2011-03-11 12:19 ` Sergei Shtylyov
  2011-03-11 16:57 ` Wolfgang Grandegger
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2011-03-11 12:19 UTC (permalink / raw)
  To: Abhilash K V
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux,
	Sriramakrishnan

Hello.

On 10-03-2011 19:39, Abhilash K V wrote:

> CAN module on AM3517 requires programming of IO expander
> as part of init sequence. Added transceiver_switch
> callback to handle this.

> Signed-off-by: Sriramakrishnan<srk@ti.com>
> Reviewed-by:  Vaibhav Hiremath<hvaibhav@ti.com>
> Signed-off-by: Abhilash K V<abhilash.kv@ti.com>
> ---
>   arch/arm/mach-omap2/board-am3517evm.c |   18 ++++++++++++++++++
>   1 files changed, 18 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
> index 2e4aad2..782d72d 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -734,6 +734,23 @@ static struct omap_board_mux board_mux[] __initdata = {
>   };
>   #endif
>
> +/*
> + * HECC information
> + */
> +
> +#define CAN_STB         214
> +static void hecc_phy_control(int on)
> +{
> +        int r;
> +
> +        r = gpio_request(CAN_STB, "can_stb");
> +        if (r) {
> +                printk(KERN_ERR "failed to get can_stb \n");

    Have you run the patch thru checkpatch.pl? IIRC, it warns about spaces 
before '\n'...

WBR, Sergei

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

* Re: [PATCH] can : AM3517EVM : add platform specific init
  2011-03-10 16:39 [PATCH] can : AM3517EVM : add platform specific init Abhilash K V
  2011-03-11 12:19 ` Sergei Shtylyov
@ 2011-03-11 16:57 ` Wolfgang Grandegger
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Grandegger @ 2011-03-11 16:57 UTC (permalink / raw)
  To: Abhilash K V
  Cc: linux-omap, linux-arm-kernel, linux-kernel, tony, linux,
	Sriramakrishnan

On 03/10/2011 05:39 PM, Abhilash K V wrote:
> CAN module on AM3517 requires programming of IO expander
> as part of init sequence. Added transceiver_switch
> callback to handle this.
> 
> Signed-off-by: Sriramakrishnan <srk@ti.com>
> Reviewed-by:  Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
> index 2e4aad2..782d72d 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -734,6 +734,23 @@ static struct omap_board_mux board_mux[] __initdata = {
>  };
>  #endif
>  
> +/*
> + * HECC information
> + */
> +
> +#define CAN_STB         214
> +static void hecc_phy_control(int on)
> +{
> +        int r;
> +
> +        r = gpio_request(CAN_STB, "can_stb");
> +        if (r) {
> +                printk(KERN_ERR "failed to get can_stb \n");
> +                return;
> +        }
> +
> +        gpio_direction_output(CAN_STB, (on==1)?0:1);
> +}

This function is called ony *any* ifconfig up and down request. I would
expect gpio_request() will return -EBUSY when it's called more than once.

Wolfgang.


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

end of thread, other threads:[~2011-03-11 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 16:39 [PATCH] can : AM3517EVM : add platform specific init Abhilash K V
2011-03-11 12:19 ` Sergei Shtylyov
2011-03-11 16:57 ` Wolfgang Grandegger

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