summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/gsi.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2023-02-15 13:53:49 -0600
committerPaolo Abeni <pabeni@redhat.com>2023-02-20 08:14:20 +0100
commitf75f44ddd4cb4bb0ede9c6c7f29679e9794552df (patch)
tree066973f2e981a5a9cc007cb6d374ba4398cd5480 /drivers/net/ipa/gsi.c
parent59b12b1d27f3f82e56462f0da6413e1849a06d3a (diff)
downloadlwn-f75f44ddd4cb4bb0ede9c6c7f29679e9794552df.tar.gz
lwn-f75f44ddd4cb4bb0ede9c6c7f29679e9794552df.zip
net: ipa: kill ev_ch_e_cntxt_1_length_encode()
Now that we explicitly define each register field width there is no need to have a special encoding function for the event ring length. Add a field for this to the EV_CH_E_CNTXT_1 GSI register, and use it in place of ev_ch_e_cntxt_1_length_encode() (which can be removed). Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ipa/gsi.c')
-rw-r--r--drivers/net/ipa/gsi.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 2ef5509e3c83..0e6f679f71a8 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -193,17 +193,6 @@ static u32 ch_c_cntxt_0_type_encode(enum ipa_version version,
return val | reg_encode(reg, CHTYPE_PROTOCOL_MSB, type);
}
-/* Encode the length of the event channel ring buffer for the
- * EV_CH_E_CNTXT_1 register.
- */
-static u32 ev_ch_e_cntxt_1_length_encode(enum ipa_version version, u32 length)
-{
- if (version < IPA_VERSION_4_9)
- return u32_encode_bits(length, GENMASK(15, 0));
-
- return u32_encode_bits(length, GENMASK(19, 0));
-}
-
/* Update the GSI IRQ type register with the cached value */
static void gsi_irq_type_update(struct gsi *gsi, u32 val)
{
@@ -731,7 +720,6 @@ static void gsi_evt_ring_program(struct gsi *gsi, u32 evt_ring_id)
struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
struct gsi_ring *ring = &evt_ring->ring;
const struct reg *reg;
- size_t size;
u32 val;
reg = gsi_reg(gsi, EV_CH_E_CNTXT_0);
@@ -743,8 +731,7 @@ static void gsi_evt_ring_program(struct gsi *gsi, u32 evt_ring_id)
iowrite32(val, gsi->virt + reg_n_offset(reg, evt_ring_id));
reg = gsi_reg(gsi, EV_CH_E_CNTXT_1);
- size = ring->count * GSI_RING_ELEMENT_SIZE;
- val = ev_ch_e_cntxt_1_length_encode(gsi->version, size);
+ val = reg_encode(reg, R_LENGTH, ring->count * GSI_RING_ELEMENT_SIZE);
iowrite32(val, gsi->virt + reg_n_offset(reg, evt_ring_id));
/* The context 2 and 3 registers store the low-order and