Commit 01bcfc1a authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-dsa-microchip-ksz9477-enable-interrupt-for-internal-phy-link-detection'

Arun Ramadoss says:

====================
net: dsa: microchip: ksz9477: enable interrupt for internal phy link detection

This patch series implements the common interrupt handling for ksz9477 based
switches and lan937x. The ksz9477 and lan937x has similar interrupt registers
except ksz9477 has 4 port based interrupts whereas lan937x has 6 interrupts.
The patch moves the phy interrupt hanler implemented in lan937x_main.c to
ksz_common.c, along with the mdio_register functionality.
====================

Link: https://lore.kernel.org/r/20220922071028.18012-1-arun.ramadoss@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents fc4f2fd0 db45c76b
This diff is collapsed.
......@@ -45,6 +45,7 @@ struct ksz_chip_data {
int num_statics;
int cpu_ports;
int port_cnt;
u8 port_nirqs;
const struct ksz_dev_ops *ops;
bool phy_errata_9477;
bool ksz87xx_eee_link_erratum;
......@@ -71,10 +72,13 @@ struct ksz_chip_data {
struct ksz_irq {
u16 masked;
struct irq_chip chip;
u16 reg_mask;
u16 reg_status;
struct irq_domain *domain;
int nirqs;
int irq_num;
char name[16];
struct ksz_device *dev;
};
struct ksz_port {
......@@ -572,6 +576,15 @@ static inline int is_lan937x(struct ksz_device *dev)
#define P_MII_MAC_MODE BIT(2)
#define P_MII_SEL_M 0x3
/* Interrupt */
#define REG_SW_PORT_INT_STATUS__1 0x001B
#define REG_SW_PORT_INT_MASK__1 0x001F
#define REG_PORT_INT_STATUS 0x001B
#define REG_PORT_INT_MASK 0x001F
#define PORT_SRC_PHY_INT 1
/* Regmap tables generation */
#define KSZ_SPI_OP_RD 3
#define KSZ_SPI_OP_WR 2
......
This diff is collapsed.
......@@ -3348,6 +3348,8 @@ static struct phy_driver ksphy_driver[] = {
.name = "Microchip KSZ9477",
/* PHY_GBIT_FEATURES */
.config_init = kszphy_config_init,
.config_intr = kszphy_config_intr,
.handle_interrupt = kszphy_handle_interrupt,
.suspend = genphy_suspend,
.resume = genphy_resume,
} };
......
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