netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] can: ti hecc module : add platform specific initialization callback.
@ 2010-02-22 13:36 Sriramakrishnan
  2010-02-22 16:00 ` Marc Kleine-Budde
  2010-02-22 23:47 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Sriramakrishnan @ 2010-02-22 13:36 UTC (permalink / raw)
  To: socketcan-core, netdev; +Cc: anantgole, Sriramakrishnan

CAN module on AM3517 requires programming of IO expander as part
of init sequence - to enable CAN PHY. Added platform specific
init callback to handle this.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Acked-by: Anant Gole <anantgole@ti.com>
---
 drivers/net/can/ti_hecc.c            |    3 +++
 include/linux/can/platform/ti_hecc.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index df27d82..604147e 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -865,6 +865,9 @@ static int ti_hecc_probe(struct platform_device *pdev)
 		goto probe_exit;
 	}
 
+	if (pdata->platform_init)
+		pdata->platform_init();
+
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!mem) {
 		dev_err(&pdev->dev, "No mem resources\n");
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
index 4688c7b..7036612 100644
--- a/include/linux/can/platform/ti_hecc.h
+++ b/include/linux/can/platform/ti_hecc.h
@@ -35,6 +35,7 @@ struct ti_hecc_platform_data {
 	u32 mbx_offset;
 	u32 int_line;
 	u32 version;
+	void (*platform_init) (void);
 };
 
 
-- 
1.6.2.4


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

* Re: [PATCH 2/2] can: ti hecc module : add platform specific initialization callback.
  2010-02-22 13:36 [PATCH 2/2] can: ti hecc module : add platform specific initialization callback Sriramakrishnan
@ 2010-02-22 16:00 ` Marc Kleine-Budde
  2010-02-22 23:47 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2010-02-22 16:00 UTC (permalink / raw)
  To: Sriramakrishnan; +Cc: socketcan-core, netdev

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

Sriramakrishnan wrote:
> CAN module on AM3517 requires programming of IO expander as part
> of init sequence - to enable CAN PHY. Added platform specific
> init callback to handle this.

Consider giving it a more descriptive name like "phy_switch" and adding
an argument to the function to enable/disable the phy. Put the routine
in the driver's open and close function.

Pleae also update the ti_hecc_platform_data documentation in the top of
ti_hecc.c

Have a look at the at91 for example.

cheers, Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [PATCH 2/2] can: ti hecc module : add platform specific initialization callback.
  2010-02-22 13:36 [PATCH 2/2] can: ti hecc module : add platform specific initialization callback Sriramakrishnan
  2010-02-22 16:00 ` Marc Kleine-Budde
@ 2010-02-22 23:47 ` David Miller
       [not found]   ` <20100222.154741.56894014.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2010-02-22 23:47 UTC (permalink / raw)
  To: srk; +Cc: socketcan-core, netdev, anantgole

From: Sriramakrishnan <srk@ti.com>
Date: Mon, 22 Feb 2010 19:06:02 +0530

> CAN module on AM3517 requires programming of IO expander as part
> of init sequence - to enable CAN PHY. Added platform specific
> init callback to handle this.
> 
> Signed-off-by: Sriramakrishnan <srk@ti.com>
> Acked-by: Anant Gole <anantgole@ti.com>

Please address Wolfgang's feedback comments.

Thanks.

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

* Re: [PATCH 2/2] can: ti hecc module : add platform specific initialization callback.
       [not found]   ` <20100222.154741.56894014.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2010-02-23 14:34     ` Wolfgang Grandegger
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Grandegger @ 2010-02-23 14:34 UTC (permalink / raw)
  To: David Miller
  Cc: srk-l0cyMroinI0, socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA

David Miller wrote:
> From: Sriramakrishnan <srk-l0cyMroinI0@public.gmane.org>
> Date: Mon, 22 Feb 2010 19:06:02 +0530
> 
>> CAN module on AM3517 requires programming of IO expander as part
>> of init sequence - to enable CAN PHY. Added platform specific
>> init callback to handle this.
>>
>> Signed-off-by: Sriramakrishnan <srk-l0cyMroinI0@public.gmane.org>
>> Acked-by: Anant Gole <anantgole-l0cyMroinI0@public.gmane.org>
> 
> Please address Wolfgang's feedback comments.

Yes, as Marc suggested, please follow the at91_can.c example using
transceiver_switch.

Wolfgang.

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

end of thread, other threads:[~2010-02-23 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 13:36 [PATCH 2/2] can: ti hecc module : add platform specific initialization callback Sriramakrishnan
2010-02-22 16:00 ` Marc Kleine-Budde
2010-02-22 23:47 ` David Miller
     [not found]   ` <20100222.154741.56894014.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-02-23 14:34     ` Wolfgang Grandegger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).