mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 07:01:32 +00:00
linux-can-fixes-for-4.8-20160921
-----BEGIN PGP SIGNATURE----- iQEcBAABCgAGBQJX4kYAAAoJED07qiWsqSVqzoYIAKEkRhTIgrHr14kJhFOTfMF2 jftbRrOXgUhfaVTrK8EdqCZ6RWUsquHg/l6n4N5uMu2mPE9z2xaql6TuoeS0LLtu l7a6sSgo+qvAY8nwn8ObAI0+528kIkPHY8bM3QCx0LhjVrBM0JtLWgPRudsQoUko yctxxpXY18Jo58SCn7k27cg+3V2j+ZDYd0hAOvQUPbI5Cw8kGRUHkUOqUtqn3oD3 3eSlRX64Or25V2q0zrM1OqFcmT/W6Os+Icne4DWomU0uy4e/YV8DyTj2qV52S4id 7k7qyv/ITVPdHeg/xxdEVgc6AaD1HsIym1IZF6JsdUFRPf6r/Rt+hVAlPYbDdtg= =zagb -----END PGP SIGNATURE----- Merge tag 'linux-can-fixes-for-4.8-20160921' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2016-09-21 this is another pull request of one patch for the upcoming linux-4.8 release. Marek Vasut fixes the CAN-FD bit rate switch in the ifi driver by configuring the transmitter delay. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
290b774a1e
@ -81,6 +81,10 @@
|
||||
#define IFI_CANFD_TIME_SET_TIMEA_4_12_6_6 BIT(15)
|
||||
|
||||
#define IFI_CANFD_TDELAY 0x1c
|
||||
#define IFI_CANFD_TDELAY_DEFAULT 0xb
|
||||
#define IFI_CANFD_TDELAY_MASK 0x3fff
|
||||
#define IFI_CANFD_TDELAY_ABS BIT(14)
|
||||
#define IFI_CANFD_TDELAY_EN BIT(15)
|
||||
|
||||
#define IFI_CANFD_ERROR 0x20
|
||||
#define IFI_CANFD_ERROR_TX_OFFSET 0
|
||||
@ -641,7 +645,7 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
|
||||
struct ifi_canfd_priv *priv = netdev_priv(ndev);
|
||||
const struct can_bittiming *bt = &priv->can.bittiming;
|
||||
const struct can_bittiming *dbt = &priv->can.data_bittiming;
|
||||
u16 brp, sjw, tseg1, tseg2;
|
||||
u16 brp, sjw, tseg1, tseg2, tdc;
|
||||
|
||||
/* Configure bit timing */
|
||||
brp = bt->brp - 2;
|
||||
@ -664,6 +668,11 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
|
||||
(brp << IFI_CANFD_TIME_PRESCALE_OFF) |
|
||||
(sjw << IFI_CANFD_TIME_SJW_OFF_7_9_8_8),
|
||||
priv->base + IFI_CANFD_FTIME);
|
||||
|
||||
/* Configure transmitter delay */
|
||||
tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK;
|
||||
writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc,
|
||||
priv->base + IFI_CANFD_TDELAY);
|
||||
}
|
||||
|
||||
static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
|
||||
|
Loading…
Reference in New Issue
Block a user