Skip to contentSkip to conversation

can: ti hecc module : add platform specific initialization callback.

PATCH Applied Sriramakrishnan 4 participants 4 messages Feb 22, 2010 – Feb 23, 2010 1 message not in the archive

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

PATCH 2/2 can: ti hecc module : add platform specific initialization callback.

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.

---
 drivers/net/can/ti_hecc.c            |    3 +++
 include/linux/can/platform/ti_hecc.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/can/ti_hecc.c +3 -0
index df27d82..604147e 100644
@@ -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");
include/linux/can/platform/ti_hecc.h +1 -0
index 4688c7b..7036612 100644
@@ -35,6 +35,7 @@ struct ti_hecc_platform_data {
 	u32 mbx_offset;
 	u32 int_line;
 	u32 version;
+	void (*platform_init) (void);
 };
 
 
Signature · 1 line
1.6.2.4
#1 lore raw
Quoted 3 lines · 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.

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

Signature · 4 lines
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   |

A message that is not in the archive (sent off-list or not yet received): 20100222.154741.56894014.davem-fT/PcQaiUtIeIZ0/[email protected]

#4 lore raw
Quoted 11 lines · David Miller

From: Sriramakrishnan <[email protected]>
Date: Mon, 22 Feb 2010 19:06:02 +0530

Quoted 6 lines

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.

Please address Wolfgang's feedback comments.

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

Wolfgang.