diff mbox

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

Message ID 1266845762-7809-1-git-send-email-srk@ti.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Sriram Feb. 22, 2010, 1:36 p.m. UTC
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(-)

Comments

Marc Kleine-Budde Feb. 22, 2010, 4 p.m. UTC | #1
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
David Miller Feb. 22, 2010, 11:47 p.m. UTC | #2
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfgang Grandegger Feb. 23, 2010, 2:34 p.m. UTC | #3
David Miller wrote:
> 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.

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

Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);
 };