From patchwork Wed Dec 29 00:37:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12700668 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 2331FC433EF for ; Wed, 29 Dec 2021 00:39:06 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fL+xGlIHtDlktnweh0QuIQjHDDde0Bgi6QQdikv+qrg=; b=kpvreBGSXpJ0st PbAgTCB2piv7qDJj2QCyrCTbKvFNS4RISDEfOOqXYw3dnI+rinCllKD/RH0uX2ltbtRvzLCFLc+tG E8lhXYWyhlKAObdmEEda7rPljAsW6cDZd5ZyXFNAP1QA2+H9I2Ib3ncL4+XrzaHDKM3yojC+FCmIf oWAChymocKTBz6KPNlYynWTpxZlCu/nAI8+o/vHOE6TfizNyGbMWuR+zkgIwSrWfxCy4mGsivE5sT bHykcyfs001m7b4uKez3b0VBeyXJfiKigN/5EWi3/1kO6QxUpYjoVHKIRD9ziLca9uMCtzRoHoSkg X7P0izQ8UijFQHJRPfzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2MyV-0022AJ-1c; Wed, 29 Dec 2021 00:37:51 +0000 Received: from mail-mw2nam10on2114.outbound.protection.outlook.com ([40.107.94.114] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2MyS-00229G-23 for linux-arm-kernel@lists.infradead.org; Wed, 29 Dec 2021 00:37:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XcbGO2j96C0N5OrxNl8eQ1gGbfUd1h3a0jgHUCeoOlQbc5q99aUGPW73Q2vPo+RPvji9OWRMzyIVd9Xxk3Hezj+oIvNXQto+V8JABsSVyyhC//fJ0NY0EKGSwNjh4BQH8NWtY1dlhrLNt5KhysU35+lIwfRhThRc3Fvu54IpPZc8XYuWbznNTQy/wKXgfdr8qkUYqxE1iSrcpKBFQE/PWdEaiYgkTC9cJPPjr89KAoml1MhmbMTu9+UQcQN/HUo1LpSju8t9wyuRPneoX/X9tvAoCWZX1dX85d6YaL+qtLo95BQFEUvt+vTYMCIedVDqjYbnQDHA//yL9YFVnzWwnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vIhZ/5zmYK4Q0FWsAZjQxzMjsmGWXaXqN42mopO9C4s=; b=lO3gPOm3M2soDeiJilop3p82l3sTE7k+CUXq/jen3ToJLGaYAMpoRawTMslDu/RRxhangaffh20iOy3iW9a1a4xJFUwbvw47w1+A9Xfp0RWNQKvQLN6WHqLRrWlIGl3BccfhQ6/LrPox26EIEJ/YG1AkH6Xbqcqrldf7HTooigk2GG08J9J7TVskATdFoCYxj6IXOhrmQODCST+sOvww05rc8M9eY3GXHEc6Ecq/6N1C7ePdYov3HOXMmBkEC66VN2bq5SwvD4zNjAbQ6Dw382hNGBXdPLAz9A6fEUv42BfdPkGKmGvdVdF3qYNWIqemowaTAxqt/qHQIMEC6GfOwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vIhZ/5zmYK4Q0FWsAZjQxzMjsmGWXaXqN42mopO9C4s=; b=QGEW870tn02BR4LeFMysKJEz8EewKeyXp6NuE1nAL8OV5Qi3FTz7IwUXymrcb4NJeEoy5r/IdHEIeX+7dZxucibYp/ToDi9PxxhKy0UUyj0r1DMXRfg5pumYC80HM+VNEOVzA+xHEhRmGvIlhRVpBn+XUPwOqidrXAHzJRzxm2E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (10.174.170.165) by CO1PR10MB4612.namprd10.prod.outlook.com (20.182.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.17; Wed, 29 Dec 2021 00:37:44 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::2d52:2a96:7e6c:460f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::2d52:2a96:7e6c:460f%4]) with mapi id 15.20.4823.023; Wed, 29 Dec 2021 00:37:44 +0000 From: Colin Foster To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , UNGLinuxDriver@microchip.com, Steen Hegelund , Lars Povlsen Subject: [PATCH v1 pinctrl-next 0/1] add blink and activity functions to SGPIO Date: Tue, 28 Dec 2021 16:37:28 -0800 Message-Id: <20211229003729.618079-1-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: CO1PR15CA0085.namprd15.prod.outlook.com (2603:10b6:101:20::29) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8d1953c-82a9-40f5-3cbb-08d9ca636d9b X-MS-TrafficTypeDiagnostic: CO1PR10MB4612:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a+5O69QIYefJkCyWN6SZw6KoEFZWHs2wnDPMt/r7hLYlIB2pZ+ymx4gNbwnoK5JPdfeOX/VcZOaPNKRJ6J5w1Ztx2D1peFe8WvyssAFTmd273sIi2fEGMMxPIe1HzDjYMnaP6kXpN1uQ8FSPWfdLfE91ulb2YdTWMmO6MrPJ5MREkupPXFYU9KtihgPYJ9JiIkH9iKI+j67naTI0YFbqOKuWQzajQBi+oetO6b/vd06PB8+mrskEQ6QOeuDQauIgEYA6Viz2pjLiVu39mDdtbbP/VqZhAT/dQFhRdPC5j18NcGAwUlPtdY4ExAm1nhVcXkpiYLVsUKtjXoiCYvi3e8j59SoJ5zv49VMBxHzFohwlVcHlcTHBCOS5QbJD5qZdHh3yS0s+rdF72Am6wX06jlVhVRjm3/i75Lyz4x6Kx4zQsWSXrYmsvmzC+xML7iwNhGH3G/dSOclM+5CymfQT/+lmzMn9tYepe48LGmpNRtjKyv+fwc4pwGQTwq18NSXZfJMR74YHukQti3iRxa3rXa8yKnSEZXyYy22g/LNGIDuroShI/mYRVhQuX9AaOOJ7LPCsBFXuHErk+4uXcGFbQKz0lxVPOMJdMyqfl9NkrqD1euM1MGfCfUWzrpTTYh0bfBMjLAAUuDTLWs3fLtcoOSbAAd5/rA3RASlkfQbneg/Zbq1EefgvJntuDEkCCVjG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2351.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(39830400003)(366004)(42606007)(136003)(346002)(66946007)(8936002)(2616005)(5660300002)(1076003)(8676002)(186003)(38350700002)(26005)(316002)(6486002)(38100700002)(6512007)(508600001)(54906003)(2906002)(86362001)(66556008)(6666004)(83380400001)(66476007)(36756003)(4326008)(52116002)(6506007)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bC+RsQvXfBuQR3Azc1Ev7T74dOm55j673lvS5VhyOTqkESfWPqcjwU5EyWZXoLBzJG9bjWAXgIfDCStVX7Oa/jiKIoUEh1VKed9JJ+1jPoW9IkcRhbXqzLZ2jFc4Sp86lDRarSqIE1+yniGDHoio5JqV4KZAph69pV1GCLA5xXZ8r+Q1FUPTXE3qXXmbGdNPbRrWYAIKaVcm824ZZ+d5WqeGbIxCkhMkFH/8CgM2wMUIUJZy/oZK6oDW6YSMVGmWdkOqF22c4P++CLTsFHqAo0hqPqtwHpx9drXrmgo9ZTkX71XS/mUYLnjOd9/XAzisUJ9fnWOtiRofmpmLzD8RbXdJdeEzyudr7A7tBS7NuiFRIPECDq5dijeXWhLIirH2QzpCyNFGWOCmvoX9Ym7WJOUMpG7trZckZCljIImYS77tpQEkCrvh9YBHArp6wil1jvX48eTef30DhwlS+KJHHNz656E/iJ0tuw63NHjEyYhvEr3GOI8FifRPeHP/rYqq3KbLsJg2DlSC/wWw+S44l5xY4vL8AtW5nxv2BUTpyoRvrIhnLRTAwBiX7qsvaKfc4Nc3U5po7rCyzDi4fXtSmpWIbO4ltpKsxrBy7ZTq538v7yCm/7NJyrh/BfJGL5IMX8MoegpDjnfjXqJqXt1zgygO4hb0ngSIj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ca636d9b X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2021 00:37:44.2692 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3ed563Kuyzzk2I5iPkPegx7+XKknCzopAIhJe2p2mwORRYK2r72xmpipl5xwcQowlQWeOq4NGDPiafwWknJgTYYBkenq08D+HsJDZx8UccU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4612 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_163748_213159_4BC5F4B2 X-CRM114-Status: GOOD ( 11.33 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-)