@@ -171,6 +171,11 @@ enum c_can_dev_id {
struct c_can_driver_data {
enum c_can_dev_id id;
+
+ /* RAMINIT register description. Optional. */
+ u8 raminit_start_bit; /* START bit position in RAMINIT reg. */
+ u8 raminit_done_bit; /* DONE bit position in RAMINIT reg. */
+ bool raminit_pulse; /* If set, sets and clears START bit (pulse) */
};
/* c_can private data structure */
@@ -196,6 +201,7 @@ struct c_can_priv {
u32 comm_rcv_high;
u32 rxmasked;
u32 dlc[C_CAN_MSG_OBJ_TX_NUM];
+ const struct c_can_driver_data *drvdata;
};
struct net_device *alloc_c_can_dev(void);
@@ -250,6 +250,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
}
priv = netdev_priv(dev);
+ priv->drvdata = drvdata;
+
switch (drvdata->id) {
case BOSCH_C_CAN:
priv->regs = reg_map_c_can;
Some platforms (e.g. TI) need special RAMINIT register handling. Provide a way to store RAMINIT register description in driver data. Signed-off-by: Roger Quadros <rogerq@ti.com> --- drivers/net/can/c_can/c_can.h | 6 ++++++ drivers/net/can/c_can/c_can_platform.c | 2 ++ 2 files changed, 8 insertions(+)