From patchwork Thu Sep 22 07:10:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 12984644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87EB8C6FA82 for ; Thu, 22 Sep 2022 07:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiIVHLJ (ORCPT ); Thu, 22 Sep 2022 03:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbiIVHLH (ORCPT ); Thu, 22 Sep 2022 03:11:07 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C8A98D01; Thu, 22 Sep 2022 00:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663830663; x=1695366663; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AaF/adrnSmLVJ38c7CTc0hQa7F9kDTXh+ROH6ZvZgfs=; b=hta3Xz2G+ja+nnpU77LDiPIZ5R14LWc6i6cIlP9WMxCWW6oMGTUZGOci gYXMomMkRpiwq8uzcUXUU4ubq9jPQrS2YW56FAA+ELql/bR78rLLRDEey s72Fe5EX8SdKfarJXJpbb1a2gmo0PBcrSy3jnZGBO0m/M4yZ9bEupKqoj +of0459BU82X1OnbSEcs+8Vxf9QyaS8io/HMM3LgwOq8fA7JWU0sbR5Ny tFxwaLyi0q2JTU4/YdJ7Mwq3TaIbIHCngofI9j4k1c2alKOOEjH7KnJin 0tneQDbK8sxYvrG5FJwZji4r1AvSvknIDz5njstyTEqyHCza9miY8gYEg Q==; X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="181581741" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Sep 2022 00:11:02 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 22 Sep 2022 00:11:00 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 22 Sep 2022 00:10:54 -0700 From: Arun Ramadoss To: , CC: , , , , , , , , , , , , , , Subject: [Patch net-next v4 0/6] net: dsa: microchip: ksz9477: enable interrupt for internal phy link detection Date: Thu, 22 Sep 2022 12:40:22 +0530 Message-ID: <20220922071028.18012-1-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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. v3 -> v4 - Rebased the code to latest net-next v2 -> v3 - Added the common interrupt routines for girq and pirq v1 -> v2 - Added the .port_nirqs = 2 for ksz9896 Changes in RFC -> v1 - modified the return -ENODEV to 0 if mdio node not present Arun Ramadoss (6): net: dsa: microchip: determine number of port irq based on switch type net: dsa: microchip: enable phy interrupts only if interrupt enabled in dts net: dsa: microchip: lan937x: return zero if mdio node not present net: dsa: microchip: move interrupt handling logic from lan937x to ksz_common net: dsa: microchip: use common irq routines for girq and pirq net: phy: micrel: enable interrupt for ksz9477 phy drivers/net/dsa/microchip/ksz_common.c | 320 +++++++++++++++++ drivers/net/dsa/microchip/ksz_common.h | 15 +- drivers/net/dsa/microchip/lan937x_main.c | 427 ----------------------- drivers/net/phy/micrel.c | 2 + 4 files changed, 336 insertions(+), 428 deletions(-) base-commit: 7a5d48c4463e6ef896ea2190a97d9e90b37c38da