From patchwork Thu Feb 1 13:46:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 195337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp160480dyb; Thu, 1 Feb 2024 05:47:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEleK8QWrlMfD0Wt+1edi6ll6b79/nVKDpPn6x/1ysCY6qfpiaaMZyM+ploOZJZ7oGzs1Ra X-Received: by 2002:a17:90a:e543:b0:293:fc07:22c7 with SMTP id ei3-20020a17090ae54300b00293fc0722c7mr2099544pjb.47.1706795222173; Thu, 01 Feb 2024 05:47:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706795222; cv=pass; d=google.com; s=arc-20160816; b=NBF+pm+LYirjPyybBWLvQMfnQAc6zmAh8fqPn9q+okATFRbXPfg+QS60jFUVA/g0Bf 5cPgcKMRQmYcFfnb0AJidITrWOCcgw7ZLp4HOLDExuJ6/ZkTvUJx+8dAz3H3hCeSn/lR Uzb1vLNIGGJCgTIEa3xfmppPb3dc5BgwusznqX7ORbV3pTpQYJVxpBPLPYuzPxMH131B j79eivzgI+ryAVndfST+YYK/kDq+K4YVzORycz9YRgpqeBqzcKHqOQx+m08eJxU/SSSS q3JDytNwBB2kIKc48HsFt0Jrzp9MZrPUFfeitpeJawFgsCXklOcr/v5EtuAUktJXKAQJ G54w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=WI57s8xyw/VuqwwATztcVrR0u1zGyJD6fjAnhGWvRH0=; fh=95cUboNCqL+ZvcFsvUJAyfzF0cNf6Qf8J/9Ik35+0Is=; b=xSFwP3xYkg5JIFhB6u8LHzg2BjV/1+rR9XvWJ+j+1Pya9W36uekfoP8dOUYe81MHKG mDkFJtkZveMQjJ/P47NffLhzs0NwoCC7wkDs17zUG2avWWFl4c8dedIYyZr/ZzeBHU6o X3nHmXKqOk8/jYMO/F7lbo3K4SdK1NtN3TbvG+d/C1bUS7UnEO2tv5N7yuTtce02PkNL Yc5pNzGfktPfNvIj3V1QKNe5hWc2VzgbI+raiyZU13qogvmD4oYBwwy+wSiX9HELmFjr Z8FECZrtIbde+XGs0s1W9bNfp+OxLwEu+QHh1CSQKl3/8HygJE7dush6auG9aXh2Bnpx B2jA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SnpWIJUh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48255-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCVZn1HYfznw4e+uqdruLnNWYam0InBSmEAprBC5OFV7Y8Yf6yZnHoNAXP8TXyDRQL2a0crJzMPcqj7wdEcBz139EUmj3g== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f8-20020a17090ac28800b00290191c241bsi3628759pjt.19.2024.02.01.05.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:47:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SnpWIJUh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48255-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E793E28D404 for ; Thu, 1 Feb 2024 13:47:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D3195F486; Thu, 1 Feb 2024 13:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SnpWIJUh" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7DE55B680; Thu, 1 Feb 2024 13:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795175; cv=none; b=axp6arzz/tgNgCZ7r9hgvfejtUO+J4ZoNWkX0utAEMhhH4WM9ebbvY0rN/RaMKOSsBq6Bjg0Wdb6Vzx8/rvTSbL8Kkplqo/4GYZX2SgS+iv8cCsL/0mja49emIDuqwVERuqTTnDEeAPoRXDn8vUjM73giVtmRC9I4rV5UtOhfa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795175; c=relaxed/simple; bh=8yshVBdG6yyHyf6kHZbatq/nmG8GO2JLF6m2JCHdA7c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bGDCq6dALsjIJDvuVBZmOa86XT9VjjwsQv7n0w9j9r5nqNfBreQ2lM+YMRM9UpBB/aY+4Sb4+tTdIpeF2Mf53QQZZCfyj3FMSaL0H0xoeitkNlevnHKuu4pcRGavOBv8wWEHfna8FYQFMtAFaaBtY2ucfYoKitZB2zKB5MVkWGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SnpWIJUh; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-33b18099411so335050f8f.0; Thu, 01 Feb 2024 05:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706795172; x=1707399972; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WI57s8xyw/VuqwwATztcVrR0u1zGyJD6fjAnhGWvRH0=; b=SnpWIJUhrjNxx0fXsX2IZ+fr/oYrEdOaUhpRTbpTl7dawfIIo6vVgzhOOwaI8aglG0 t0zwR53S2cYRm8wN+7hjtTOCmoGids/JVW8Ye2Yzy09r5FwDWmEJFZLG3tof/VC3zaMB 4vaQXu41sG6kI9iclqWAX0yGMlDSGX5VeCPE7VkFJgikPb7b/KbU/JR8lk8mlr+amjev T+cFutMl986rzApsrI2YBJiwec+pWHx9v/+5j58fr8zQ3LsvHGAdbDjmaOG+b77LfhjL hf4Lc8XHZPmFT2Il6wjD2c1yxaw5JSO0MW4P0ODUhHNsny65j8AOc39BylN1vJCLSPuE fWDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706795172; x=1707399972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WI57s8xyw/VuqwwATztcVrR0u1zGyJD6fjAnhGWvRH0=; b=qd6JzC8hmt5anEGW0geljRdzPGV8bz6YOJeBNJtXecX3PSHrP92uWt9QMReTHCPnpB PhrAqZN+Q3bJ7AgleJS8ISRhQZIEl8Rz93/rGDotUQnmHVC3si92z4iPe6dB2jVoqQ4Z bqy/zMB6+JMpFAZIwELsCOiGz3O3eVQHZY8bfDsEIt/dr3ON6mpB5V9jy6YESqgrYJwo 1OOOwsQ3FJ+sXFoLWakxbwhCJTJMwzFEmlrtZ5gyDJdR4j/5sWP/iu3f663UHkvCq1wU dC1Vf/FtrU3utpFaRyyVHMaUbNugVF3K3fYeqpbrEqisYvyJuN4Vin5GJqYVh1ZSXInO dMhQ== X-Gm-Message-State: AOJu0YyCLo99xoyFbku+Uq03hIQf7BU3diV+aQ4sz7hFXYTpNHxIyiDB eMHAQH/a+XzXnWROVtqwc8OCBPwCkdOzZcsJxQpTxenyJ3ThcdJJ X-Received: by 2002:a5d:6481:0:b0:33b:1b14:a93a with SMTP id o1-20020a5d6481000000b0033b1b14a93amr600789wri.69.1706795171927; Thu, 01 Feb 2024 05:46:11 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXQq1KKiH4YUpiZz6T97SMNSIrGvfYkCGSUEWqTTAPjRIP3miTnFwqPl6HLjUy/HlvupXtSbLZlcl3yoL1aeETzf3d7qhup5+CYV/YSEx05YfhDWCAb1BPhmRBOuHXhV1ILD80X0uojgOs/jA4GWfmikSpcyuvfzoKJ2XKP0WZQc1gmoPzJEX38znRRJM4ArJds1FIScDxL1KorbrOwjRK5htwkvLRH13xq553Spb10P2o06USmuQW/U7d9LP/bPecVwvtgzXpSUyuBTEym1eqp1TgHDeebbXPtOFnkSoX9I0twrqmcewojUbgBtloOnlOB4nPEd/ObCrcv0MyH9tpfifcTAllWctMKKycF55o+2UA52jIp6nyEF+UC9eUNyD3XOPrCsw7ilzVOcA0DjQlyEhqafTP0rOmmXU+PgAI= Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id b16-20020a5d6350000000b0033aeb0afa8fsm11691259wrw.39.2024.02.01.05.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:46:11 -0800 (PST) From: Christian Marangi To: Bjorn Andersson , Konrad Dybcio , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Marangi , linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 1/2] net: phy: qcom: qca808x: fix logic error in LED brightness set Date: Thu, 1 Feb 2024 14:46:00 +0100 Message-ID: <20240201134602.11085-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201134602.11085-1-ansuelsmth@gmail.com> References: <20240201134602.11085-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789704506993047825 X-GMAIL-MSGID: 1789704506993047825 In switching to using phy_modify_mmd and a more short version of the LED ON/OFF condition in later revision, it was made a logic error where value ? QCA808X_LED_FORCE_ON : QCA808X_LED_FORCE_OFF is always true as value is always OR with QCA808X_LED_FORCE_EN due to missing () resulting in the testing condition being QCA808X_LED_FORCE_EN | value. Add the () to apply the correct condition and restore correct functionality of the brightness ON/OFF. Fixes: 7196062b64ee ("net: phy: at803x: add LED support for qca808x") Signed-off-by: Christian Marangi --- drivers/net/phy/qcom/qca808x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c index 0f549027d899..00db4b274264 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -820,8 +820,8 @@ static int qca808x_led_brightness_set(struct phy_device *phydev, return phy_modify_mmd(phydev, MDIO_MMD_AN, reg, QCA808X_LED_FORCE_EN | QCA808X_LED_FORCE_MODE_MASK, - QCA808X_LED_FORCE_EN | value ? QCA808X_LED_FORCE_ON : - QCA808X_LED_FORCE_OFF); + QCA808X_LED_FORCE_EN | (value ? QCA808X_LED_FORCE_ON : + QCA808X_LED_FORCE_OFF)); } static int qca808x_led_blink_set(struct phy_device *phydev, u8 index, From patchwork Thu Feb 1 13:46:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 195340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp170391dyb; Thu, 1 Feb 2024 06:02:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHg7DOtPZLZl+RTAEk049dMYSsojHImwJAQlNxi5ZQHf6CoCuqR67xaJN2RIlz5bRVBR++Z X-Received: by 2002:a05:6a20:b927:b0:19c:a16c:8ab8 with SMTP id fe39-20020a056a20b92700b0019ca16c8ab8mr3624695pzb.55.1706796157533; Thu, 01 Feb 2024 06:02:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706796157; cv=pass; d=google.com; s=arc-20160816; b=KmkB1eYVbkp1BHFc24HoBG1xc023xYefbphWi35Gx3OJeikSa4jGLh1QoFIwoHCgNM 7qKsIfFP0RpzjXy6z9TuGu1eOnO15zJZvh0x9fi9lkzYjzz8fFzstKw+vSmr+OMp2NIE N3g/Q1JoB1MLQEl5PxBU8WqxaFklWloUQvBB3EHisplbwB9E/LZYICQrXwrqV5EfY9Cl zz3W8gXxTZ9PLgs0B1c0VEg/cdp5aqI+TzpfMUl5gS0kKVrJUG4oi24FKcn0/quBRrON EbTjJHdPEYNQFaeFya43lVyVsWkzPetSWatKcecp33h8wrNer21dQUanLOsFMwLaR4X/ ll8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=xQ2XhJ2ku7B00kn4WBK5cWqlj8C1avq/4Iei1MyTst0=; fh=vKD6taMqZAvdIjyfaCW2ObRcxvUGNGQ/h9SkxdZWN6s=; b=tePGJWvczp8W1wTqAnAfXezC5vq8VGypa84RxV/DJHhoa9xbcSwCTgUltn/tlEWnY7 c5nz5gYIzHWRRdy7ntRpH+BSdjrLwYGG2xKguLwr73mgv2l0zE6ASi9fkotBW+MaKjk7 D1CjW8OEWnIx2oT459PCZHBuZJ10O+zWz9MgzzLmRDskQZcTLaZFCjnLrZeXG431KDZe 5tNWzU+guDIVLoP7Szpvpspo99nKGJWeEKQi3IM7nPXezEp9Ihbi/ReKX7wOZaaFUOGS 4MB8jH6eWj3is4rZuq5CFwy4vYRZpBK+WAVIg0Loxv/r4vkcp/ynKdcZoJkLyXtcdigc KIuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CDyGRUj0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48256-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48256-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCXMQXLp/HzR9cPS1cmtxvPESVochLQjv2pbfTqaPhUQTtew0kxRTIgHI9s+fdW2dhGyQQ42z3nE8CNibHzWQiDlg68DhA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y3-20020a636403000000b005ce3c33c303si12464724pgb.301.2024.02.01.06.02.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 06:02:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48256-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CDyGRUj0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48256-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48256-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2EDF1B25856 for ; Thu, 1 Feb 2024 13:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 658385F498; Thu, 1 Feb 2024 13:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CDyGRUj0" Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE6425CDF9; Thu, 1 Feb 2024 13:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795176; cv=none; b=ZnpMzMkK5wj4fMT1LhbPw0X8M4yn7eJhYZBSQJ4RjPwNOUTmK6PHZNJlRp51L5HORDLwt+fPiDAMsimIX2Q3F+HKxOAO0SxfNixp6lsXPQZ8GbMr4DVbj85fFtU9102JbFl8yfPwMJI7E+0b3r0/r4SfV4JyhgT9gvuJHqA2nAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795176; c=relaxed/simple; bh=phwZqH1fEaM4FYVACYhk06VJK88fgHRIPod217ZwYMo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ch5uLN5kRgVEDAfty/61yOXUT4nLs+vZ1XLu5Uh26xcigctxGKM3f8EEGps3oqPHG5CzRSk7y2ZAHVh0blN7xMGPhAEQKx+E1ocf3oTENFhzXe5S1bGJPX4zedzTQzrlThShqzWhlgPlvGGewc4ktHSuUhLrN7XYYnYFyagsqK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CDyGRUj0; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-51032058f17so1087298e87.3; Thu, 01 Feb 2024 05:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706795173; x=1707399973; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xQ2XhJ2ku7B00kn4WBK5cWqlj8C1avq/4Iei1MyTst0=; b=CDyGRUj0p3SW/S7Wv/0WwL3ULAzTjPGVoAb/yLSscwlYhNiqVzkc7pPBTchcKax8+N HpJlMkVR4F+r5H4fYuHpP9++4xbkJbqLAMVQKqRmjIFRgTKMmNkTBaJpZ7OckldasNYN 9omjKfDmkXEtRrdNkcniQi3Ky6KWmlwlAhza6OMFh4Z9edUQs2iqioifPpQ6B5QBvLy5 09ba4qTmWCtQkTNAD+xc/JcT5CK27o950bgn+bVahWdYFcmZzc3G5UuICbuZ5wPvcDPn nEs3i9ntC7o1bDlWP/K2CgGLlW6Ewm7+5qhl0iAtdzrCX0+VhS1Z86h5qtt6IlrJg5vt DWZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706795173; x=1707399973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xQ2XhJ2ku7B00kn4WBK5cWqlj8C1avq/4Iei1MyTst0=; b=iBMEA0TmIG9PCYof4exERIr/YiGciKUvwpjsbZ9zQW9w6xd/Xd1NCfxiD/KWYx6p0m oe7dpsH3eQtFd4kEuFHupQq93hlozusKZ/gycV2ui0f6YAlMNDOPTCV709SQi4Oi++ZL xxFHMR31V9ek84KlilYVUeBO/3UBupy6eBn1LMwwU+n6aHGRQFlwic0wbkFk3A3/K7wY iz7YG+RliryII6wSniysIkeN7dKf+kAiDv+hmIQElzu1UmPJMnfTWva8ew8EqQxG3BBy BnE7xS5QLuKiZqtAVkwYNpd0Qngcdt5FeYKr52tePGghohA73+Oq7Kig7C2h1MYSFlGI QQ/w== X-Gm-Message-State: AOJu0YzGXPrfZbemIbbZQHxEOBY033ClNGV54OPpq+IADhfGZrG7dxGz NDXqcM7zBSL0F+dgO/yrDdv0wLGfbDTq2TJXJFm9JNfxJY7F6MBN X-Received: by 2002:ac2:5999:0:b0:511:16e8:58ba with SMTP id w25-20020ac25999000000b0051116e858bamr2036307lfn.68.1706795172905; Thu, 01 Feb 2024 05:46:12 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWMbucVCeyWt0jHdroOlPbtHYMYzK7ja4URNBQHvKio1l1eks+KFR4oRNtlgNKuIkEvfBLhWSArG7lqVdmMMA6dk7rS2V3TeQoTvsg2Rkp7ObHRv9UbelkMKS9kzkDgtc9rkVKsRTxhjExrbuIfaiaFfJaysAytG4Bn1QSOzWfmt+iGakqVkdoK21/YpxDRN1tt+qRcijD1ZDnCON3UNj53XWxQVVlYavavcK9qxqfu0AtblgONF+/h8/qh5ijedurF5jrcUsf9gw+nSYlUHVKQiT+vszk45pGy2P4D2WUG5NtwBIpZCwZtdXFMw1+j9VnUJvt1v99h2n5ZiarLDBb5ShqFlvsQ2LLFHZcmmfsptTwlZM37h+OCl3Vf3r2HiBTcmjyxY4G1DAYA/ewevZyeEAinrPsv1PcrOM/b68w= Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id b16-20020a5d6350000000b0033aeb0afa8fsm11691259wrw.39.2024.02.01.05.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:46:12 -0800 (PST) From: Christian Marangi To: Bjorn Andersson , Konrad Dybcio , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Marangi , linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 2/2] net: phy: qcom: qca808x: default to LED active High if not set Date: Thu, 1 Feb 2024 14:46:01 +0100 Message-ID: <20240201134602.11085-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201134602.11085-1-ansuelsmth@gmail.com> References: <20240201134602.11085-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789705488083048559 X-GMAIL-MSGID: 1789705488083048559 qca808x PHY provide support for the led_polarity_set OP to configure and apply the active-low property but on PHY reset, the Active High bit is not set resulting in the LED driven as active-low. To fix this, check if active-low is not set in DT and enable Active High polarity by default to restore correct funcionality of the LED. Fixes: 7196062b64ee ("net: phy: at803x: add LED support for qca808x") Signed-off-by: Christian Marangi --- drivers/net/phy/qcom/qca808x.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c index 00db4b274264..d88e04278fc4 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -290,8 +290,18 @@ static int qca808x_probe(struct phy_device *phydev) static int qca808x_config_init(struct phy_device *phydev) { + struct qca808x_priv *priv = phydev->priv; int ret; + /* Default to LED Active High if active-low not in DT */ + if (priv->led_polarity_mode == -1) { + ret = phy_set_bits_mmd(phydev, MDIO_MMD_AN, + QCA808X_MMD7_LED_POLARITY_CTRL, + QCA808X_LED_ACTIVE_HIGH); + if (ret) + return ret; + } + /* Active adc&vga on 802.3az for the link 1000M and 100M */ ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, QCA808X_PHY_MMD3_ADDR_CLD_CTRL7, QCA808X_8023AZ_AFE_CTRL_MASK, QCA808X_8023AZ_AFE_EN);