diff options
author | Vivien Didelot <vivien.didelot@gmail.com> | 2019-08-31 16:18:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-01 12:16:37 -0700 |
commit | 4241ef52372ebee93f4ed67e08c9316ccb20bdd7 (patch) | |
tree | 4909e0f4d5da9fde3bffd3f3242ab1ad8505497c /drivers/net/dsa/mv88e6xxx/serdes.c | |
parent | f441ed0f4c89c14dd68ce477f513bae43509237e (diff) | |
download | blackbird-op-linux-4241ef52372ebee93f4ed67e08c9316ccb20bdd7.tar.gz blackbird-op-linux-4241ef52372ebee93f4ed67e08c9316ccb20bdd7.zip |
net: dsa: mv88e6xxx: introduce .serdes_irq_mapping
Introduce a new .serdes_irq_mapping operation to prepare the
abstraction of IRQ mapping from the SERDES IRQ setup code.
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/serdes.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/serdes.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c index f65652e6edec..4fb1dca64ef1 100644 --- a/drivers/net/dsa/mv88e6xxx/serdes.c +++ b/drivers/net/dsa/mv88e6xxx/serdes.c @@ -240,18 +240,25 @@ static int mv88e6352_serdes_irq_disable(struct mv88e6xxx_chip *chip) return mv88e6352_serdes_write(chip, MV88E6352_SERDES_INT_ENABLE, 0); } +unsigned int mv88e6352_serdes_irq_mapping(struct mv88e6xxx_chip *chip, int port) +{ + return irq_find_mapping(chip->g2_irq.domain, MV88E6352_SERDES_IRQ); +} + int mv88e6352_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) { + unsigned int irq; int err; if (!mv88e6352_port_has_serdes(chip, port)) return 0; - chip->ports[port].serdes_irq = irq_find_mapping(chip->g2_irq.domain, - MV88E6352_SERDES_IRQ); - if (!chip->ports[port].serdes_irq) + irq = mv88e6xxx_serdes_irq_mapping(chip, port); + if (!irq) return 0; + chip->ports[port].serdes_irq = irq; + /* Requesting the IRQ will trigger irq callbacks. So we cannot * hold the reg_lock. */ @@ -673,8 +680,14 @@ out: return ret; } +unsigned int mv88e6390_serdes_irq_mapping(struct mv88e6xxx_chip *chip, int port) +{ + return irq_find_mapping(chip->g2_irq.domain, port); +} + int mv88e6390_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) { + unsigned int irq; int err; u8 lane; @@ -685,11 +698,12 @@ int mv88e6390_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) return err; } - chip->ports[port].serdes_irq = irq_find_mapping(chip->g2_irq.domain, - port); - if (!chip->ports[port].serdes_irq) + irq = mv88e6xxx_serdes_irq_mapping(chip, port); + if (!irq) return 0; + chip->ports[port].serdes_irq = irq; + /* Requesting the IRQ will trigger irq callbacks. So we cannot * hold the reg_lock. */ |