Commit 57c15bd3 authored by Martin Jeřábek's avatar Martin Jeřábek

driver: add ctu_can_fd_int_mask_{set,clr}

parent b847c15e
......@@ -225,8 +225,9 @@ static int ctucan_chip_start(struct net_device *ndev)
clear_bit(CTUCAN_FLAG_RX_SCHED, &priv->drv_flags);
ctu_can_fd_int_mask(&priv->p, int_msk, int_enamask_mask);
ctu_can_fd_int_ena(&priv->p, int_ena, int_enamask_mask);
/* It's after reset, so there is no need to clear anything */
ctu_can_fd_int_mask_set(&priv->p, int_msk);
ctu_can_fd_int_ena_set(&priv->p, int_ena);
priv->can.state = CAN_STATE_ERROR_ACTIVE;
......@@ -722,8 +723,8 @@ static irqreturn_t ctucan_interrupt(int irq, void *dev_id)
imask.u32 = 0xffffffff;
ival.u32 = 0;
ctu_can_fd_int_ena(&priv->p, imask, ival);
ctu_can_fd_int_mask(&priv->p, imask, ival);
ctu_can_fd_int_ena_clr(&priv->p, ival);
ctu_can_fd_int_mask_set(&priv->p, imask);
}
return IRQ_HANDLED;
......
......@@ -370,6 +370,32 @@ void ctu_can_fd_int_ena(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val);
/*
* Mask interrupts of CTU CAN FD Core.
*
* Arguments:
* priv Private info
* mask Mask of interrupts which should be masked.
*/
static inline void ctu_can_fd_int_mask_set(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask)
{
priv->write_reg(priv, CTU_CAN_FD_INT_MASK_SET, mask.u32);
}
/*
* Unmask interrupts of CTU CAN FD Core.
*
* Arguments:
* priv Private info
* mask Mask of interrupts which should be unmasked.
*/
static inline void ctu_can_fd_int_mask_clr(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask)
{
priv->write_reg(priv, CTU_CAN_FD_INT_MASK_CLR, mask.u32);
}
/*
* Mask/Unmask interrupts of CTU CAN FD Core.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment