From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E278DEB64D9 for ; Wed, 12 Jul 2023 09:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XUtrhW2NJWA3GoKXSDrdS1conjTSBo8Pslfh3vUHVhw=; b=R6DHLUJAMK8V2M MB8eagX8eNpoXMD7ODdUNRFtf/JfsyE7AjFq2GoZlndOUrJYQsdardBe0kpj4Ry1WzBsPTz4CesJ7 g4D1JdP9kJwMtEgBT11zsenMjseGpprylKrsePkZUVdMjC0l143ZDSafSOeacazODwhI3Dbmetw0f NiD8gleY+EzPqjVBAGZ7boAtFUUP1finEkBNazM+kdOuKK3wKH1+kOQiJYfCCnO10uyU5gE7azNWz QgxfgtHUM66a9WxXR6yUIXZLtuilw6nP2kPcIJfmpruWKpx0YwkVFdEgOXQDsPj3Jv6iAWlnU94WM bYi8gw8ttQ8YBCs29PFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJWFf-00H3uK-2P; Wed, 12 Jul 2023 09:35:15 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJWFc-00H3sW-3A for linux-arm-kernel@lists.infradead.org; Wed, 12 Jul 2023 09:35:14 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3142ee41fd2so6774985f8f.3 for ; Wed, 12 Jul 2023 02:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689154511; x=1691746511; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=vBqycqdNdKpz14Pbyqrq6OFOf+4Pct6fOpn39ZFo7ps=; b=e/BwJ7H+6lYRsarWatoXwjH2z6jSppmrB0Kd9gpWYbB398QX9je+5K44f+oJE+Ga0e jko5FJSrMikCULG5hqUyTiLNJwPuq7ua9f6bs2cJ7jFMCyPxVsgII3FRjwAbn5wyUVxT UcGyC42hJkyU4cPrdw6+r5xhO270c5tcLguSWw0Oipt+ynQq1mRgHVe8FaaabfOCMRi3 K7sN3Uunjy2Qsr2JYT1CBCEnSqtSb9UZ3BxqaxYA86Jw4Jdw1yKDPFMlPqHY0efsfy8q 2LnxIZ6cfKhueEb0q3doHIbdgzr3LdsseLY+rRNYr5ttPzYmVtEPdUWVi33mUPU+cqYl YC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689154511; x=1691746511; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vBqycqdNdKpz14Pbyqrq6OFOf+4Pct6fOpn39ZFo7ps=; b=JB7vMT9UTqpad6lYivC1aMKNoepUeXn2dHqsiUgfh3fy6TR3iFweah9x78LnFg6BHn T0TlxN2b24/Z08UycZqXXzBgnp4ghn0v+X8Is5Xl+8xXrA2DC32uxCPXlboJ/G+spBAb fnM+aehraLuAujVBB98ecfuGWPYjz8whiFIAbYyZplb4sjjbZb+/+4d0ROcmI+2917wv MWKL/xpPfgXkphLkNuBTaFihPq8hv1xNnUESTkj7hwL7IdW/VVbl5CeRXNl8PvKd8Uys 6oYfS2JoPiW+bv+udMU2bsdBx97MHRBna160F8Zln87ZmSvQvu0T37NQN9MwU2tZ5k5L 9eRg== X-Gm-Message-State: ABy/qLYH6DW9gucIsLdNrLnSg5IB5SAmNOkjjX7dxlaZ6WB8b4D1IHNp I5f0qkWbaED2cZZmJAK1olI= X-Google-Smtp-Source: APBJJlEx9oYNUwmPTQ7MzLLoCB7QFxl2/IctouLhRz+s1Xh6/Gry0pjzT5sJQzzPMOjfkp5Kv1K90A== X-Received: by 2002:a5d:68c6:0:b0:315:a043:5e0a with SMTP id p6-20020a5d68c6000000b00315a0435e0amr7048870wrw.56.1689154510696; Wed, 12 Jul 2023 02:35:10 -0700 (PDT) Received: from Ansuel-xps. (93-34-93-173.ip49.fastwebnet.it. [93.34.93.173]) by smtp.gmail.com with ESMTPSA id u23-20020a05600c00d700b003fc02219081sm4594539wmm.33.2023.07.12.02.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 02:35:10 -0700 (PDT) Message-ID: <64ae73ce.050a0220.fe1a6.4b8a@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 12 Jul 2023 03:59:10 +0200 From: Christian Marangi To: Colin Foster Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Linus Walleij , UNGLinuxDriver@microchip.com, Daniel Machon , Steen Hegelund , Lars Povlsen , Andrew Lunn , Florian Fainelli , Vladimir Oltean Subject: Re: [RFC RESEND v1 pinctrl-next 0/1] add blink and activity functions to SGPIO References: <20230712022250.2319557-1-colin.foster@in-advantage.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230712022250.2319557-1-colin.foster@in-advantage.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230712_023513_025129_181ECFF9 X-CRM114-Status: GOOD ( 36.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 11, 2023 at 07:22:49PM -0700, Colin Foster wrote: > Preface (new for resend): > > This is a resend of a patch I'd sent a couple years back. At that time, > I was told to wait for hardware-offloaded LEDS. It looks like that time > has finally come, so I've changed this from PATCH down to an RFC to make > sure this is the right approach for the framework. > > Ocelot chips (VSC7511, VSC7512, VSC7513, VSC7514) have support for > hardware-offloaded LEDs based on network activity. This is currenty > managed by way of pinctrl-microchip-sgpio (and this current patch). > > The purpose of this resend is two-fold. First, to come up with an idea > of how this pinctrl-microchip-sgpio module can fit in with the new > hardware-offloaded netdev triggers Christian Marangi recently added. Is > this something that should be in the pinctrl module itself? Or should > there be a drivers/net/ethernet/mscc/ocelot_leds.c module that I should > add? > I'm a bit out of the loop on what magic OEM did to make LED work on ocelot but I feel an ocelot_leds submodule is needed. To correctly supports the hw many API needs to be defined and for switch I would stick with how things are done with qca8k, codewise and DT wise (with how LEDs are defined in DT) Ideally the feature for MAC will be generilized and added to the DSA ops struct, so having things in the DSA driver would make the migration easier. > The second reason is maybe there's someone out there who might also be > considering implementing this. This might be a good starting point if > someone is eager to get coding. On my priority list, this is quite low > so I'll get to it eventually, but maybe not even in this dev cycle. > That's why I'm including the original patch. > > > Any suggestions on how to approach this problem are welcome. > > > > > (You can probably stop reading here) > > > Original Header: > > Expose a debugfs / devicetree interface for Microsemi SGPIO controllers. > By writing values of 2-5, the SGPIO pins can be configured for either > automatic blinking or activity. > > The implementation is modeled after the code in > /drivers/pinctrl/pinctrl-ocelot.c. > > I have only tested this with currently out-of-tree patches for the > VSC7512 that I hope to get in soon. They are not needed for VSC7513 / > VSC7514, SPARX5, or LUTON - but I don't have any hardware to test. > > Of note: the 7512 chip has a discrepancy between the datasheet and the > registers. The datahseet claims 20Hz blink default frequency, the > registers claim 5 Hz default frequency for BMODE_0. I override the > OCELOT registers to correct for this. I don't know if that is needed for > LUTON or SPARX, but having two blink modes at the same frequency isn't > beneficial. As such, I make the blink modes match the 5Hz / 20Hz for the > two modes. > > Tested with VSC7512 by way of: > echo SGPIO_O_p1b0 {blink0,blink1,activity0,activity1} > > /sys/kernel/debug/pinctrl/pinctrl-sgpio-pinctrl-sgpio-output/pinmux-select > > LEDs blink! > > > Colin Foster (1): > pinctrl: microchip-sgpio: add activity and blink functionality > > drivers/pinctrl/pinctrl-microchip-sgpio.c | 135 +++++++++++++++++++++- > 1 file changed, 130 insertions(+), 5 deletions(-) > > -- > 2.25.1 > -- Ansuel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel