mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
soc: ti: k3-ringacc: Use the ti_sci set_cfg callback for ring configuration
Switch to the new set_cfg to configure the ring. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
This commit is contained in:
parent
3c2017536f
commit
bb49ca00bd
1 changed files with 32 additions and 47 deletions
|
@ -365,20 +365,16 @@ EXPORT_SYMBOL_GPL(k3_ringacc_request_rings_pair);
|
|||
|
||||
static void k3_ringacc_ring_reset_sci(struct k3_ring *ring)
|
||||
{
|
||||
struct ti_sci_msg_rm_ring_cfg ring_cfg = { 0 };
|
||||
struct k3_ringacc *ringacc = ring->parent;
|
||||
int ret;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->config(
|
||||
ringacc->tisci,
|
||||
TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID,
|
||||
ringacc->tisci_dev_id,
|
||||
ring->ring_id,
|
||||
0,
|
||||
0,
|
||||
ring->size,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
ring_cfg.nav_id = ringacc->tisci_dev_id;
|
||||
ring_cfg.index = ring->ring_id;
|
||||
ring_cfg.valid_params = TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID;
|
||||
ring_cfg.count = ring->size;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->set_cfg(ringacc->tisci, &ring_cfg);
|
||||
if (ret)
|
||||
dev_err(ringacc->dev, "TISCI reset ring fail (%d) ring_idx %d\n",
|
||||
ret, ring->ring_id);
|
||||
|
@ -398,20 +394,16 @@ EXPORT_SYMBOL_GPL(k3_ringacc_ring_reset);
|
|||
static void k3_ringacc_ring_reconfig_qmode_sci(struct k3_ring *ring,
|
||||
enum k3_ring_mode mode)
|
||||
{
|
||||
struct ti_sci_msg_rm_ring_cfg ring_cfg = { 0 };
|
||||
struct k3_ringacc *ringacc = ring->parent;
|
||||
int ret;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->config(
|
||||
ringacc->tisci,
|
||||
TI_SCI_MSG_VALUE_RM_RING_MODE_VALID,
|
||||
ringacc->tisci_dev_id,
|
||||
ring->ring_id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
mode,
|
||||
0,
|
||||
0);
|
||||
ring_cfg.nav_id = ringacc->tisci_dev_id;
|
||||
ring_cfg.index = ring->ring_id;
|
||||
ring_cfg.valid_params = TI_SCI_MSG_VALUE_RM_RING_MODE_VALID;
|
||||
ring_cfg.mode = mode;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->set_cfg(ringacc->tisci, &ring_cfg);
|
||||
if (ret)
|
||||
dev_err(ringacc->dev, "TISCI reconf qmode fail (%d) ring_idx %d\n",
|
||||
ret, ring->ring_id);
|
||||
|
@ -478,20 +470,15 @@ EXPORT_SYMBOL_GPL(k3_ringacc_ring_reset_dma);
|
|||
|
||||
static void k3_ringacc_ring_free_sci(struct k3_ring *ring)
|
||||
{
|
||||
struct ti_sci_msg_rm_ring_cfg ring_cfg = { 0 };
|
||||
struct k3_ringacc *ringacc = ring->parent;
|
||||
int ret;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->config(
|
||||
ringacc->tisci,
|
||||
TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER,
|
||||
ringacc->tisci_dev_id,
|
||||
ring->ring_id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
ring_cfg.nav_id = ringacc->tisci_dev_id;
|
||||
ring_cfg.index = ring->ring_id;
|
||||
ring_cfg.valid_params = TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->set_cfg(ringacc->tisci, &ring_cfg);
|
||||
if (ret)
|
||||
dev_err(ringacc->dev, "TISCI ring free fail (%d) ring_idx %d\n",
|
||||
ret, ring->ring_id);
|
||||
|
@ -575,28 +562,26 @@ EXPORT_SYMBOL_GPL(k3_ringacc_get_ring_irq_num);
|
|||
|
||||
static int k3_ringacc_ring_cfg_sci(struct k3_ring *ring)
|
||||
{
|
||||
struct ti_sci_msg_rm_ring_cfg ring_cfg = { 0 };
|
||||
struct k3_ringacc *ringacc = ring->parent;
|
||||
u32 ring_idx;
|
||||
int ret;
|
||||
|
||||
if (!ringacc->tisci)
|
||||
return -EINVAL;
|
||||
|
||||
ring_idx = ring->ring_id;
|
||||
ret = ringacc->tisci_ring_ops->config(
|
||||
ringacc->tisci,
|
||||
TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER,
|
||||
ringacc->tisci_dev_id,
|
||||
ring_idx,
|
||||
lower_32_bits(ring->ring_mem_dma),
|
||||
upper_32_bits(ring->ring_mem_dma),
|
||||
ring->size,
|
||||
ring->mode,
|
||||
ring->elm_size,
|
||||
0);
|
||||
ring_cfg.nav_id = ringacc->tisci_dev_id;
|
||||
ring_cfg.index = ring->ring_id;
|
||||
ring_cfg.valid_params = TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER;
|
||||
ring_cfg.addr_lo = lower_32_bits(ring->ring_mem_dma);
|
||||
ring_cfg.addr_hi = upper_32_bits(ring->ring_mem_dma);
|
||||
ring_cfg.count = ring->size;
|
||||
ring_cfg.mode = ring->mode;
|
||||
ring_cfg.size = ring->elm_size;
|
||||
|
||||
ret = ringacc->tisci_ring_ops->set_cfg(ringacc->tisci, &ring_cfg);
|
||||
if (ret)
|
||||
dev_err(ringacc->dev, "TISCI config ring fail (%d) ring_idx %d\n",
|
||||
ret, ring_idx);
|
||||
ret, ring->ring_id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue