can: ti hecc module : add platform specific initialization callback.
Subsystems (3)
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
@@ -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
@@ -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
Marc Kleine-Budde
maintainerQuoted 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 |
David Miller
maintainerFrom: 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.
Signed-off-by Sriramakrishnan <[email protected]>Acked-by Anant Gole <[email protected]>
Please address Wolfgang's feedback comments.
Thanks.
A message that is not in the archive (sent off-list or not yet received): 20100222.154741.56894014.davem-fT/PcQaiUtIeIZ0/[email protected]
Quoted 11 lines · David Miller
From: Sriramakrishnan <[email protected]>
Date: Mon, 22 Feb 2010 19:06:02 +0530Quoted 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.
Signed-off-by Sriramakrishnan <[email protected]>Acked-by Anant Gole <[email protected]>Please address Wolfgang's feedback comments.
Yes, as Marc suggested, please follow the at91_can.c example using transceiver_switch.
Wolfgang.