From patchwork Fri Dec 15 21:22:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 18167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9669529dys; Fri, 15 Dec 2023 16:33:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6en2PvJLP1zwV5DhmoX7yawEdxrXUfPYTpO8Vioso9jElinrTKXehrXTdOIDlf8UjsDsf X-Received: by 2002:a17:906:20de:b0:a1f:a0ed:6ba with SMTP id c30-20020a17090620de00b00a1fa0ed06bamr5635756ejc.81.1702686793363; Fri, 15 Dec 2023 16:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702686793; cv=none; d=google.com; s=arc-20160816; b=kYrnPM+rlfzr4AZWqYKw+RZ3tVs50wlvdHky4jxoVYxgMrpDH0BkWxgWSNl3aodUqb CA5F/SYmK7SyI/xjn2VmGBBqt32O6pjte95rbiuufwgmgBVezne5GuFZqZhA39RKEWz2 B4djcFkFyYmPn2HUkYagtsuL6zsTDeKeC5msDi5SrO0Tbi8KSigla2D7sjWjt/fSAu0+ U/Khz6DKci7/sXRE4Hr7cT3b+a4AA6Gs7bTJ4MTyPPiV/6qHqdnPGsLWHIBmBKBmokBO /H/Rj0jvFk95k9awmapEFNWGQJVi+KZPytfuV2emyyKD/m8tWe/RjfVf9yTE5MJI34l4 5Zaw== ARC-Message-Signature: i=1; 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:message-id:date:subject:to:from :dkim-signature; bh=I2cQQHTukUtPE/uR7ah1Fmgn0krkwrRifPUQAFLRAB0=; fh=zMhr/QaHlUGdJIFxViiudBM+C42ITh4H3O1f/VExlVE=; b=rEA22EQsv1nb75TlgnLZJzkiQbtaW5JD8Y1FM4tK8Odg6rM6K5nN92UIzohaNrH3Bh 6Rzx2VedoPNS2MYYAL04Zzcb/xQcy5s3h9gnaHNZX27Zu/4nFFJaWKQC/7e5x7wfze+b cMBQznPAhQqEnbPWo4xoxrBwfmoQPzT3NOEqNA+mq/6MQtiiVNgG9O7tp8+TVNjQRiop /TGL9h0WE/hG4UfUz0/NG1Tl4+/dfJCls4p2G4a+2JmOeTIQkI9HZhv3UKUagLaqu6z1 3hFdXHeyVQSAUI1y1V6zS356kNAzQjBm/7nGzE7/5nWigYY1iopECk62AWVAgDHS5bQ0 ijEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Dor0919s; spf=pass (google.com: domain of linux-kernel+bounces-1902-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1902-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q23-20020a1709066b1700b00a22eba0b564si3611205ejr.288.2023.12.15.16.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 16:33:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1902-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Dor0919s; spf=pass (google.com: domain of linux-kernel+bounces-1902-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1902-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EBA6A1F25A84 for ; Sat, 16 Dec 2023 00:33:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D43965C9C; Sat, 16 Dec 2023 00:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dor0919s" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 366815675; Sat, 16 Dec 2023 00:23:08 +0000 (UTC) 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-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c2718a768so11796825e9.0; Fri, 15 Dec 2023 16:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702686186; x=1703290986; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=I2cQQHTukUtPE/uR7ah1Fmgn0krkwrRifPUQAFLRAB0=; b=Dor0919sjHLJZ4NqGrIyvh5qAm604y+rPPova9ukVvqF8ot6P3u4/aSWfdxNt6MMrW Qk3hO0Xzzezv/lVwrW7wCVZb7/4SGQ67Yaq9SjpvoQKNmtMKmTbmttSStdxC1ximohl3 S5B3hX+K5ghei03lPaS3V4D6xKxrF87pZqa3j2MmP96pWRENWoZKdL4r4cn+w2Bdqz4t g6c8+Yu0jL2UFCqQ9p4yw57kR8RzSEyVkVFtbfrIEFQNv0ZccibiSYugkD7c0/LOh+R2 Gk9OU8mNsB5vr4x+V4YC7Qb68h+8C5hP3dHbePY4WQljEdbwNu6z3/u5MO31sU1rjqeE IBdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702686186; x=1703290986; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I2cQQHTukUtPE/uR7ah1Fmgn0krkwrRifPUQAFLRAB0=; b=u0+7sde2nXevrTax6Y2YiDca6Vz8UZVb8DKEVN3+4gERtLMm8SFyo2ZpYiKk+lUNCu EL+mA0kDaMSoYtQz2JtQ8bHcWnMmr2ImywXDFuTgJy3p6L3Oz+FtNISusdCBAJw2W/bM XDbdvK0pzBQ4qwtBLFWrqIC7qw6e51bJ0D/GGTc3OI5w0DTEV8BpKrNnfTWcFpu+9uYX E0ikI0j0GKCYC8lBFXAUh/2nWWR9JpMpSdV9CAcUK053bE8iCl6z2Xu+FsOcTIa/YexB 4cOSyZOA543X5cVTgxfDxU2BNaoT0TNSvXIjcjxtL21Q93X7JC8GPCjlUEBMQcFvXwC7 jCpA== X-Gm-Message-State: AOJu0YwY1UCs1ipdTjMuk3yyK63AVggP72/61NLE/p7U8x5hMC8aZJsg Q3QN5jE/zwso21Gx4UB99qc= X-Received: by 2002:a7b:c7ca:0:b0:40b:5e1b:54ac with SMTP id z10-20020a7bc7ca000000b0040b5e1b54acmr7682448wmk.56.1702686186209; Fri, 15 Dec 2023 16:23:06 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id a15-20020a5d508f000000b0033330846e76sm1496191wrt.86.2023.12.15.16.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 16:23:05 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Christian Marangi , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Waldekranz Subject: [net-next PATCH v4 0/4] net: phy: generic polarity + LED support for qca808x Date: Fri, 15 Dec 2023 22:22:40 +0100 Message-Id: <20231215212244.1658-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 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: 1785396507146311358 X-GMAIL-MSGID: 1785396507146311358 This small series add LEDs support for qca808x. Qca808x apply on PHY reset a strange polarity settings and require some tweak to apply a more common configuration found on devices. On adding support for it, it was pointed out that a similar feature is also being implemented for a marvell PHY where LED polarity is set per LED (and not global) and also have a special mode where the LED is tristated. The first 2 patch are to generalize this as we expect more PHY in the future to have a similar configuration. The implementation is extensible to support additional special mode in the future with minimal changes and don't create regression on already implemented PHY drivers. (changelog present in single patch) Christian Marangi (4): dt-bindings: net: phy: Document new LEDs polarity property net: phy: add support for PHY LEDs polarity modes dt-bindings: net: Document QCA808x PHYs net: phy: at803x: add LED support for qca808x .../devicetree/bindings/net/ethernet-phy.yaml | 11 + .../devicetree/bindings/net/qca,qca808x.yaml | 54 +++ drivers/net/phy/at803x.c | 308 ++++++++++++++++++ drivers/net/phy/phy_device.c | 45 +++ include/linux/phy.h | 25 ++ 5 files changed, 443 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml