Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4634470pxj; Wed, 12 May 2021 09:42:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFZ4Tn7l3jsXKmkC7tPVrApZl9T5iVSbyiiJ4amLmq3kXKaXzXSVg419/07iUv7Ut89HDI X-Received: by 2002:a05:6830:1d81:: with SMTP id y1mr12190885oti.24.1620837752297; Wed, 12 May 2021 09:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837752; cv=none; d=google.com; s=arc-20160816; b=RAh6POkn7J+f3jZYcxTCsZnJXfEugcYFVzaBci9PjesLLuHTYEcjRVSMfeWrbcQKey OMDgZyJX8bheEJDeuO82vEoaOXSUQWSmIVIiTMsVN45pLVqU5a4IEBa7XtZn8Vi4wqIy MDTGChQlBdh9vBctHKmsmcSRlGDHJefkxMmXdWrwny9Zx6kYkl6DblqB8Hg1JjOSLN2O U68zNoCYvqSZBOL4IJOZGD0gJUpfBaq7OlSDzDFHRXHZMb2qpJXdzfBjih4X8Scc5hrx of1R/v79L89kdtD44jhsrNuGn8TgPRh9qjnysd0QtK5T77yPJxGpNL+9MlAEchP44ZEY a+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jKDomNUPYZ9yQp6Na/GBkHl24A+OdRvoFVFjNkGZCW4=; b=dTZ0XJUyO8xKxB3JzoKajgwIdCkZFSA+jB6iFiPzh78NfnAAjaGB2dNd/yzpLBMjyh i8IpvofsoAkEtKRf3KLdazOgxpUdGyhVQwM197vIX1aTKJGazFukr1Dzl4o9D3T1uAbo kF4LxGfaivafzR06aDNZwxO0Y5J5wXf0I1wLS+0KIDXwJrVxElf61y+DIbS+nQaOVt5m 08oIc1MhV5W8JoKqRLfzgkBX07htqi7/XgXQihjbDh7a5d21REYtaFA+oD7AyvuX2hRB lfDxg2vx56p+JDONhIiMht35bi4/7s0S0PUPMKzdIIxIH/tz6PriWiSZuv+s8q3t+Qhm /lXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pnN8KN1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si412832otk.202.2021.05.12.09.42.18; Wed, 12 May 2021 09:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pnN8KN1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235122AbhELQiM (ORCPT + 99 others); Wed, 12 May 2021 12:38:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236751AbhELPqD (ORCPT ); Wed, 12 May 2021 11:46:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7243861C9C; Wed, 12 May 2021 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833018; bh=eyu97ZBK9xnhz5oNASxAacHzMyKRH3epYFGkrRIH7dY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pnN8KN1g8g7kU1HfA5EAszc95QHt3HBnklRJHDwX4fMVaDcduugSr+p6uIkmToal0 dT3JKMEKV99ctYisQMsOJU2pg3qpqNUtBanJFHtyVcKj5SQ++haJ5gLHkxraS/jj8w JPQbxMcQSlscvxGacK24lQ5igTh7SWjLwvUnnQOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schiller , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 482/530] net: phy: intel-xway: enable integrated led functions Date: Wed, 12 May 2021 16:49:52 +0200 Message-Id: <20210512144835.602387451@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Schiller [ Upstream commit 357a07c26697a770d39d28b6b111f978deb4017d ] The Intel xway phys offer the possibility to deactivate the integrated LED function and to control the LEDs manually. If this was set by the bootloader, it must be ensured that the integrated LED function is enabled for all LEDs when loading the driver. Before commit 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") the LEDs were enabled by a soft-reset of the PHY (using genphy_soft_reset). Initialize the XWAY_MDIO_LED with it's default value (which is applied during a soft reset) instead of adding back the soft reset. This brings back the default LED configuration while still preventing an excessive amount of soft resets. Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") Signed-off-by: Martin Schiller Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/intel-xway.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/phy/intel-xway.c b/drivers/net/phy/intel-xway.c index b7875b36097f..574a8bca1ec4 100644 --- a/drivers/net/phy/intel-xway.c +++ b/drivers/net/phy/intel-xway.c @@ -11,6 +11,18 @@ #define XWAY_MDIO_IMASK 0x19 /* interrupt mask */ #define XWAY_MDIO_ISTAT 0x1A /* interrupt status */ +#define XWAY_MDIO_LED 0x1B /* led control */ + +/* bit 15:12 are reserved */ +#define XWAY_MDIO_LED_LED3_EN BIT(11) /* Enable the integrated function of LED3 */ +#define XWAY_MDIO_LED_LED2_EN BIT(10) /* Enable the integrated function of LED2 */ +#define XWAY_MDIO_LED_LED1_EN BIT(9) /* Enable the integrated function of LED1 */ +#define XWAY_MDIO_LED_LED0_EN BIT(8) /* Enable the integrated function of LED0 */ +/* bit 7:4 are reserved */ +#define XWAY_MDIO_LED_LED3_DA BIT(3) /* Direct Access to LED3 */ +#define XWAY_MDIO_LED_LED2_DA BIT(2) /* Direct Access to LED2 */ +#define XWAY_MDIO_LED_LED1_DA BIT(1) /* Direct Access to LED1 */ +#define XWAY_MDIO_LED_LED0_DA BIT(0) /* Direct Access to LED0 */ #define XWAY_MDIO_INIT_WOL BIT(15) /* Wake-On-LAN */ #define XWAY_MDIO_INIT_MSRE BIT(14) @@ -159,6 +171,15 @@ static int xway_gphy_config_init(struct phy_device *phydev) /* Clear all pending interrupts */ phy_read(phydev, XWAY_MDIO_ISTAT); + /* Ensure that integrated led function is enabled for all leds */ + err = phy_write(phydev, XWAY_MDIO_LED, + XWAY_MDIO_LED_LED0_EN | + XWAY_MDIO_LED_LED1_EN | + XWAY_MDIO_LED_LED2_EN | + XWAY_MDIO_LED_LED3_EN); + if (err) + return err; + phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LEDCH, XWAY_MMD_LEDCH_NACS_NONE | XWAY_MMD_LEDCH_SBF_F02HZ | -- 2.30.2