Hi Maxime,
On Fri, 2026-01-23 at 09:57 +0100, Maxime Chevallier wrote:
Hi Jens,
On 23/01/2026 08:50, Jens Emil Schulz Østergaard wrote:
quoted
LAN9645X is a family of switch chips with 5 internal copper phys.
The
internal PHY is based on parts of LAN8832. This is a low-power,
single
port triple-speed (10BASE-T/100BASE-TX/1000BASE-T) ethernet
physical
layer transceiver (PHY) that supports transmission and reception of
data
on standard CAT-5, as well as CAT-5e and CAT-6 Unshielded Twisted
Pair (UTP) cables.
Add support for the internal PHY of the lan9645x chip family.
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Jens Emil Schulz Østergaard
[off-list ref]
---
[...]
quoted
+static int lan9645x_config_intr(struct phy_device *phydev)
+{
+ int err;
+
+ /* enable / disable interrupts */
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
+ /* This is an internal PHY of lan9645x and is not
possible to
+ * change the polarity of irq sources in the OIC
(CPU_INTR)
+ * found in lan9645x. Therefore change the polarity
of the
+ * interrupt in the PHY from being active low instead
of active
+ * high.
+ */
+ phy_write(phydev, LAN8804_CONTROL,
+ LAN8804_CONTROL_INTR_POLARITY);
+
+ /* By default interrupt buffer is open-drain in which
case the
+ * interrupt can be active only low. Therefore change
the
+ * interrupt buffer to be push-pull to be able to
change
+ * interrupt polarity.
+ */
+ phy_write(phydev, LAN8804_OUTPUT_CONTROL,
+ LAN8804_OUTPUT_CONTROL_INTR_BUFFER);
Small nit from me, you're missing error checks on the 2 above reads.
Thanks,
Maxime
Thank you, I will add error checks in the next version.
Thanks,
Emil