Skip to content

Commit

Permalink
can: at91_can: add listen only mode
Browse files Browse the repository at this point in the history
This patch adds listen only mode support to the at91_can driver.

Signed-off-by: Yoann DI-RUZZA <ydiruzza@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Yoann DI RUZZA authored and Marc Kleine-Budde committed Feb 11, 2014
1 parent b18ec27 commit 17a50ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/can/at91_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ static void at91_chip_start(struct net_device *dev)
at91_transceiver_switch(priv, 1);

/* enable chip */
at91_write(priv, AT91_MR, AT91_MR_CANEN);
if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
reg_mr = AT91_MR_CANEN | AT91_MR_ABM;
else
reg_mr = AT91_MR_CANEN;
at91_write(priv, AT91_MR, reg_mr);

priv->can.state = CAN_STATE_ERROR_ACTIVE;

Expand Down Expand Up @@ -1341,7 +1345,8 @@ static int at91_can_probe(struct platform_device *pdev)
priv->can.bittiming_const = &at91_bittiming_const;
priv->can.do_set_mode = at91_set_mode;
priv->can.do_get_berr_counter = at91_get_berr_counter;
priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
CAN_CTRLMODE_LISTENONLY;
priv->dev = dev;
priv->reg_base = addr;
priv->devtype_data = *devtype_data;
Expand Down

0 comments on commit 17a50ee

Please sign in to comment.