diff mbox series

[25/28] raw/cnxk_bphy: add support for reading number of irqs

Message ID 20210531214142.30167-26-tduszynski@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series add support for baseband phy | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tomasz Duszynski May 31, 2021, 9:41 p.m. UTC
Add support for retrieving maximum number of interrupts.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 12 ++++++++++++
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.h |  2 ++
 drivers/raw/cnxk_bphy/version.map     |  1 +
 3 files changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
index 5d47840d6..6a68db8a9 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
@@ -24,6 +24,18 @@  cnxk_bphy_get_bphy_dev_by_dev_id(uint16_t dev_id)
 	return (struct bphy_device *)rawdev->dev_private;
 }
 
+uint64_t
+cnxk_bphy_irq_max_get(uint16_t dev_id)
+{
+	struct roc_bphy_irq_chip *irq_chip;
+	struct bphy_device *bphy_dev;
+
+	bphy_dev = cnxk_bphy_get_bphy_dev_by_dev_id(dev_id);
+	irq_chip = bphy_dev->irq_chip;
+
+	return irq_chip->max_irq;
+}
+
 int
 cnxk_bphy_intr_init(uint16_t dev_id)
 {
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
index 6e3d77768..d18fbd69e 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
@@ -24,5 +24,7 @@  __rte_internal
 int cnxk_bphy_intr_init(uint16_t dev_id);
 __rte_internal
 void cnxk_bphy_intr_fini(uint16_t dev_id);
+__rte_internal
+uint64_t cnxk_bphy_irq_max_get(uint16_t dev_id);
 
 #endif /* _CNXK_BPHY_IRQ_ */
diff --git a/drivers/raw/cnxk_bphy/version.map b/drivers/raw/cnxk_bphy/version.map
index e087cd39b..6c5e9639a 100644
--- a/drivers/raw/cnxk_bphy/version.map
+++ b/drivers/raw/cnxk_bphy/version.map
@@ -6,6 +6,7 @@  INTERNAL {
 
 	cnxk_bphy_intr_init;
 	cnxk_bphy_intr_fini;
+	cnxk_bphy_irq_max_get;
 };
 EXPERIMENTAL {
 	global: