Commit 6d06009c authored by Madalin Bucur's avatar Madalin Bucur Committed by Li Yang

soc: fsl: qbman: add interrupt coalesce changing APIs

Add the APIs required to control the QMan portal interrupt coalescing
settings.
Signed-off-by: default avatarMadalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent e0940b34
...@@ -1012,6 +1012,37 @@ static inline void put_affine_portal(void) ...@@ -1012,6 +1012,37 @@ static inline void put_affine_portal(void)
static struct workqueue_struct *qm_portal_wq; static struct workqueue_struct *qm_portal_wq;
void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh)
{
if (!portal)
return;
qm_dqrr_set_ithresh(&portal->p, ithresh);
portal->p.dqrr.ithresh = ithresh;
}
EXPORT_SYMBOL(qman_dqrr_set_ithresh);
void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh)
{
if (portal && ithresh)
*ithresh = portal->p.dqrr.ithresh;
}
EXPORT_SYMBOL(qman_dqrr_get_ithresh);
void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod)
{
if (portal && iperiod)
*iperiod = qm_in(&portal->p, QM_REG_ITPR);
}
EXPORT_SYMBOL(qman_portal_get_iperiod);
void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod)
{
if (portal)
qm_out(&portal->p, QM_REG_ITPR, iperiod);
}
EXPORT_SYMBOL(qman_portal_set_iperiod);
int qman_wq_alloc(void) int qman_wq_alloc(void)
{ {
qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1); qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1);
......
...@@ -1194,4 +1194,32 @@ int qman_release_cgrid(u32 id); ...@@ -1194,4 +1194,32 @@ int qman_release_cgrid(u32 id);
*/ */
int qman_is_probed(void); int qman_is_probed(void);
/**
* qman_dqrr_get_ithresh - Get coalesce interrupt threshold
* @portal: portal to get the value for
* @ithresh: threshold pointer
*/
void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh);
/**
* qman_dqrr_set_ithresh - Set coalesce interrupt threshold
* @portal: portal to set the new value on
* @ithresh: new threshold value
*/
void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh);
/**
* qman_dqrr_get_iperiod - Get coalesce interrupt period
* @portal: portal to get the value for
* @iperiod: period pointer
*/
void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod);
/**
* qman_dqrr_set_iperiod - Set coalesce interrupt period
* @portal: portal to set the new value on
* @ithresh: new period value
*/
void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod);
#endif /* __FSL_QMAN_H */ #endif /* __FSL_QMAN_H */
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