From patchwork Thu Aug 25 10:44:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600455 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50789C64990 for ; Thu, 25 Aug 2022 10:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241133AbiHYKoo (ORCPT ); Thu, 25 Aug 2022 06:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234446AbiHYKom (ORCPT ); Thu, 25 Aug 2022 06:44:42 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2082.outbound.protection.outlook.com [40.107.105.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B7B8AA36F; Thu, 25 Aug 2022 03:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJKGyGWhLq07tyX33t4RBaVfJwxc8iwHtgLcaJZQtiXR8fQTM+bCnjrIk5XAQhn9BX98glyYTakH2KtkrU09KajPq+GouuXUunWLe3BCnbqPnzOEAlR6WQ8mIYsGu7QhCxfbwL6xG+1WMATTT6LVGjDFQcOSg6VxkqTePREe4xUO4uRJHDXIH1faBDKHHiZ41k+brqOCGDwCmWb2MhlTe/XrgHIBoBUMUqs9LjTMU16Q3SessxBlsxUGLoRMh18D4M4UFJi+0MxPhTYvMz/L6XWYUll6eZm+5ogNx1KdUb6S3RCv1ix+93v4CuqwtbOShwWSTQXd8FCoEFQ3LWyINQ== 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=rRCBzMP08a86QV3+iQNYbEM8PajRVQlJ5OjM+5s9UyE=; b=XrLi4s60jM2bY5foeWfMa+/U4iLBYp2BNlLlPyConcUyY82pgjDWLI/WBxmcoWmfZC7FnhOGu94RFGJEVJ6G3KjJ+xY3ojUiOsK9A/Jqo2JD5mwfXFGf2coWyuZ+EXjoh2tJLPTv/aFFLndR54ZzUB3I5QMh4t/1lZY2vaKzPCg4FOyoS2JIzLBEKsGkBmaGNcIB1Z/66F/2KAvT7s5ryrDrS49s85r5t3i/y+UZ/KWGyCMyyzLgIILVt+eIWRppDIL7xUH5bOTmiUhKryWgYMa95uXMJXd1cJcZoRGZDZDZW7IZiboXm+fiMgDQ0suoo51tXg38lqQXUV3oDf5Nsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.75) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rRCBzMP08a86QV3+iQNYbEM8PajRVQlJ5OjM+5s9UyE=; b=rWLJW9jHovO080fCEu+UMuIuJ/XtgB7QAjMGE8C5IY+F0cXGupdYZe2PZDiPsCWwxjQ+GHqQTmQEUbyMgZWxX2bY0NLWALrO3qYkpE9oIkxWpEUHfJtZSDsUVylPw19a2VhcpU0xBlUwXhPLcY+pCmz5IOO5s6VTYlFt8iHyMApiur6uHwMBkanXw8GTAxWJpAclN5ZM/JCzIoT6laQbMWshsZiMZKbc5cFRH4ir9VI5qdfMLgDPeFhiTkw+XnTQ0stbcJUo0+PM+m6fooUeoExx2kXTE1rPH/QeNCwhmuSrBlQt3WWM3CvPz/1kaL3B8edqD7bJ3Mw9zwjDS0jfkg== Received: from AS4P192CA0026.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::10) by PA4PR10MB4511.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:105::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.19; Thu, 25 Aug 2022 10:44:39 +0000 Received: from VE1EUR01FT086.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:5e1:cafe::19) by AS4P192CA0026.outlook.office365.com (2603:10a6:20b:5e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:38 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.75) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.75 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.75; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.75) by VE1EUR01FT086.mail.protection.outlook.com (10.152.2.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:38 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VRA.ad011.siemens.net (194.138.21.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:37 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:36 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 1/7] gpio-f7188x: switch over to using pr_fmt Date: Thu, 25 Aug 2022 12:44:16 +0200 Message-ID: <20220825104422.14156-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--11.376600-8.000000 X-TMASE-MatchedRID: +czlWKbBGYFzI+dG37rJkJZVmFGg61XXBZzfOdtebLR08zy97KsgJnFa /hQHt1A1Yy6fApvL8BdAHOg8qEtqyCp6C6A3Owl9/loNwYTKhKGoXh0SiGjEzEeDzzDviY0OTFQ nI+epPIYda1Vk3RqxOL7MIEVzBlttgTMB89obbzHU1g4lO1dF7W31FZ8LNR0ExVQFfLw4zf+MwE e0REwvkOZMicrOlIVJWZ5SeHs/EKwSREDsWlFRcPy6tSSuZMgS921KMlA7Vdon6YVq3MQsI3oCB x19i+GMmyiLZetSf8mfop0ytGwvXiq2rl3dzGQ1u/SjjL7lkPOD7WkSJoQpshWUI90Y/2jE2n3G Kv1+wijdr1MDrcCkeA== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.376600-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: CE4F6D7C5BC5F49D0DA48FF424D65095871529BC38358A62C99638AA9F96A8272000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e459f4f-4a40-4467-7aa4-08da8686cf0e X-MS-TrafficTypeDiagnostic: PA4PR10MB4511:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cm5r2E5MslHm2OQev0XyToRHvcqfKvs0TH/RxeTkgePjUlsYr+qsXENnC1MMMppBftAbS777GWX2zDSQM7dZ0QABAY7c2EbjF1SPkRjIFBUNMsJBO89qaToXBkIIMq9g+6F/WFp/kC30iz65HeUolJ2ilFnRhxVUvhmQphTkXtl4brf+Zudy4DdJU51FaEgjjlxoUonLQfiORrRAF7FwTlPoOmxr0X4LfqUNqF9hb1WzCSQagxqydhOsg6Sj1VYU1bZ89xPo90sR79pmBXL8STrvoxlgge9ZOx5EG4GMxlKyu7N5IFQR3KrKBE4xQ4W5oGuAndn2IZ+5b2ZYq9Pu5UnYQgeAbnkB98GSBo8Bwsj9cNB2dCJM7ophTmjun3mm2ZvQzApdr8Y3hsXCOGE6h6QHLkTb0HTDgefLio0ng58geOuvHsrtIpDJlu1xxwejoJVaxGBVIgAi3NFaFVboZFCDzDr2jljZctS/SPaSlQPejl7Bw3kskwgXTkRCwvbr+dJUVfF4JcAs18JrHJIfRGsWRfmuPwRA/+XemYVEzK4eggnnO1KPGriiRF7ngWTjP91F/BNK6tDZShhr/ccAVJOdzW3H2cZ5LYtw12MHgb6v7BB7Q28CB4FKKhkG5tTJ9PXNSJDCTWhK36G34+y0WKt2kuAweULP9Lml2GW4Rwz6OZByQp7SaUNl4dJqNhJNNYa5lHkBW/aoDjQSjn54g3wZOpCH+S3elkXojhSH8RvAvmPb2dQ8Q99mgpRjQchxq58WPuIozElyWXBNABWQ6FAQGhL3OvMM+el6JFIMKPwJSdzaR5fQjeg6zK3PZcGmF19DE8DD9ybDmU8IQBBuNkp1evK7f77pj4r5NyuQDdlQHzdC7J0LnouKezZsOP81 X-Forefront-Antispam-Report: CIP:194.138.21.75; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(346002)(376002)(136003)(36840700001)(40470700004)(46966006)(6666004)(54906003)(41300700001)(8936002)(5660300002)(110136005)(36756003)(82310400005)(107886003)(316002)(40460700003)(478600001)(44832011)(7416002)(8676002)(70586007)(4326008)(70206006)(40480700001)(2616005)(956004)(1076003)(336012)(16526019)(26005)(47076005)(2906002)(83380400001)(86362001)(356005)(36860700001)(921005)(81166007)(82960400001)(82740400003)(186003)(36900700001)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:38.3293 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e459f4f-4a40-4467-7aa4-08da8686cf0e X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.75]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT086.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR10MB4511 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Subsequent patches will touch that file, apply some nice to have style changes before actually adding functional changes. Signed-off-by: Henning Schild Reviewed-by: Linus Walleij --- drivers/gpio/gpio-f7188x.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index 18a3147f5a42..fef539bbc03a 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -7,6 +7,9 @@ * Author: Simon Guinot */ +#define DRVNAME "gpio-f7188x" +#define pr_fmt(fmt) DRVNAME ": " fmt + #include #include #include @@ -14,8 +17,6 @@ #include #include -#define DRVNAME "gpio-f7188x" - /* * Super-I/O registers */ @@ -110,7 +111,7 @@ static inline int superio_enter(int base) { /* Don't step on other drivers' I/O space by accident. */ if (!request_muxed_region(base, 2, DRVNAME)) { - pr_err(DRVNAME "I/O address 0x%04x already in use\n", base); + pr_err("I/O address 0x%04x already in use\n", base); return -EBUSY; } @@ -487,7 +488,7 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio) err = -ENODEV; devid = superio_inw(addr, SIO_MANID); if (devid != SIO_FINTEK_ID) { - pr_debug(DRVNAME ": Not a Fintek device at 0x%08x\n", addr); + pr_debug("Not a Fintek device at 0x%08x\n", addr); goto err; } @@ -518,13 +519,13 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio) sio->type = f81865; break; default: - pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid); + pr_info("Unsupported Fintek device 0x%04x\n", devid); goto err; } sio->addr = addr; err = 0; - pr_info(DRVNAME ": Found %s at %#x, revision %d\n", + pr_info("Found %s at %#x, revision %d\n", f7188x_names[sio->type], (unsigned int) addr, (int) superio_inb(addr, SIO_DEVREV)); @@ -548,13 +549,13 @@ f7188x_gpio_device_add(const struct f7188x_sio *sio) err = platform_device_add_data(f7188x_gpio_pdev, sio, sizeof(*sio)); if (err) { - pr_err(DRVNAME "Platform data allocation failed\n"); + pr_err("Platform data allocation failed\n"); goto err; } err = platform_device_add(f7188x_gpio_pdev); if (err) { - pr_err(DRVNAME "Device addition failed\n"); + pr_err("Device addition failed\n"); goto err; } From patchwork Thu Aug 25 10:44:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600117 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE861C04AA5 for ; Thu, 25 Aug 2022 10:44:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241122AbiHYKon (ORCPT ); Thu, 25 Aug 2022 06:44:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230395AbiHYKom (ORCPT ); Thu, 25 Aug 2022 06:44:42 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80040.outbound.protection.outlook.com [40.107.8.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 180F0AA374; Thu, 25 Aug 2022 03:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XcOsnsdlP17j4eJOgskxVSo18M6NJCK5RCRQ9hlpAg0FIW8psS8pbCRNtCjIcOccMZeApjed4aSqXofKPEKYhpMBj6INrPXRl5amstpiKxEUOaoVn8wTAEVaodp4eMckazF9Su/tn/bMjxDNdKB54HtccKB2YxlPZg66DTNmuyFc0phG90AA0IwHGMOCyEEjYoLojReI9m+yLyXp3jcImoKCwJxsGKYtd/FQcHC5yxStbOEEkVc0A60pjWCEOK6RpXbCd2HJyXdJh0vX6oa5LA0zIz2PiTNxy0dCMiLjfD8nxg+IWb5UBCP+sX3ijR9E7M1IytI0+9CJM5dlDB6p4A== 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=ZETyLlyBKcILdLFZEJbVrPryecl4Hv+yog2b3jg6uCE=; b=JZX/GozJMQPRpgYnC71Md7p0U46dpvSWGSt1TdoJcuQbepltlfP2MaIEReXkcYVtbOlPZtMzSQ3DB5F1G6+L+44eFnPZpkvL/IRe7GnIEMrCenMDVPG2r7sK6M4HCbCXffoutnz8DJqbGwjleDIA3ItIOfFPzZDKkpEov50uEabE7M0SpojCJcOAjUUEw8kv1o83Bd/YdA9xAzC+I0HbuLGje5x0jyAewdlI5mlLwuwGvSQ3ljt5uuakGnPJ1H5H9T0GRc4wtmCuepnYoEPcsUQL/bWR6xbBHOZbjFsBhai6T54kcTnHIj0wOMnood8THIpPjmplQHjRa9ww3W2iuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.76) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZETyLlyBKcILdLFZEJbVrPryecl4Hv+yog2b3jg6uCE=; b=htIPzo3jV0jDbXB07GW6nGc1X0GojYDvSCrHiMJ7kAR1VSSrym1dVt0+/+VuIGQazJmDmWTYrQAbjYwSzCUq0VboEB1XgeeT9zghPKd08tD999DElIz6aEbqh18RQp7qV9bKAHDCn/MqtSHCQXlx2kz578pZDXgrz5ZtW20bmUixAme8iu91rRJzw+xJyL1l9YPbi6oNzM+a/hffJRf/GdSV+E29E1Q+uYl6FHgv6jR6s6DxPqpmwx+RZfbj/WsLZzuI+/PA9bc9NfSdZSzQP4hV65behj5Rv1nyKA8cx4aDXnq6AT/ZWo63cq/mlyKBT9vzLZsg0IocrYfmDPyAFQ== Received: from OL1P279CA0015.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:12::20) by VE1PR10MB3952.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:168::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 10:44:37 +0000 Received: from HE1EUR01FT086.eop-EUR01.prod.protection.outlook.com (2603:10a6:e10:12:cafe::c7) by OL1P279CA0015.outlook.office365.com (2603:10a6:e10:12::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14 via Frontend Transport; Thu, 25 Aug 2022 10:44:37 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.76) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.76 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.76; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.76) by HE1EUR01FT086.mail.protection.outlook.com (10.152.1.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:37 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VSA.ad011.siemens.net (194.138.21.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:36 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:36 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 2/7] gpio-f7188x: add a prefix to macros to keep gpio namespace clean Date: Thu, 25 Aug 2022 12:44:17 +0200 Message-ID: <20220825104422.14156-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--10.255400-8.000000 X-TMASE-MatchedRID: MWbpXFXsFA5zI+dG37rJkJZVmFGg61XXBZzfOdtebLR08zy97KsgJnFa /hQHt1A1Yy6fApvL8BdAHOg8qEtqyI+pAn19BHXOybpNH7+LubuplamT4YpFU5XIRfiL5JZTuaL iYlmqWfdRl9RGGk4QA+GSO/vwd6PhaUkFFARetjGAMuqetGVetnyef22ep6XYOwBXM346/+wmcp slEXGWqV+Z7nYsdNhzkRi5ABIRNlyTI7BQVR47eoEXinL0Onln X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.255400-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: EDC9E1C0F0347AFD1EA1E08E30DDEC91D36732885E9F307F01131F7C59764DB72000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dbeea725-9e2e-4b17-45e3-08da8686ce96 X-MS-TrafficTypeDiagnostic: VE1PR10MB3952:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E9o29YtSCCcg2n4RxgHTzsVh9iYeRHnkM+h4oAfq+3rynwk6hd1iVJQ31PgSuPtSBPCzCNRmoBdFrz/gHAzqN81nBhVT/NoqjfpYgIu3lxQRXnS0iEwJSjbx0QLjEG1OivVBxxtyAeoWyvLZipvMcV3DwMGv1pnjehb+2nkX2+bf4/3J/YFClk6MJ5XTBG9LUYti1XsZOkQR3VznHXI9mHKeoBwjUetHbC5hL9Z2bxd64SuGVN5tqX6s1BaTmXJTuhnNFywbfyyPlsLZhu0ySCni4njz2TKFCd5M7vwvaInPMq90nefg29/DlqvU5znCRLefh4Hnz8niCL2P6iXbu7Oz1KGFopWBH7ykZHpH9HKePeqZCCzAPzPxs5mK4p84PJmCA7pYn7N4Y9PMnIO0m+w2vruzDPvn7aOBseB7Nq4BTKR1TvzhIfr0lqKegsg6A8Vilxzt3X+jnROWKGlVUcTLq2cYuHTJDpqeOyo0QZZlL0MkvrbBcw6JHRLAxr/V66HgvbEeMdkALfs72atFesDLy9sPh7GUabj3rcSzUqTTnDEzhxF/TQx6lXUoKmPV/2xfKprAjVY9rsHQjgRhBMLAa3Byqt/segyxH+vI6TqxJ/5Zp1ICEm27n0IA67W/YAwqouEKxy1Tr4xjb6zkbb138QCxsQCwuK//RO8pFVYUofVlcx6WK9LwwY0eqFWuiRmeJOYSUn4Q8mXAabQOn+qqISP7XYDBakkvZRA9SXiXTq37K9pV8jZwEtB2bGcx8JWiQ0CXDard/B7COanni1t9H80Impki7GxZNMAMsUwtx+lx71n3dxS33nERhHrHF4iSDk0dSDwqVsSdrlu4HJNz3Iwz4Od1v6vjJDKxNybYnY/F0c2T6X5ImnLhSvq+ X-Forefront-Antispam-Report: CIP:194.138.21.76; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(346002)(396003)(376002)(39860400002)(136003)(40470700004)(36840700001)(46966006)(36860700001)(82740400003)(86362001)(82960400001)(81166007)(356005)(54906003)(40460700003)(70586007)(70206006)(921005)(316002)(2906002)(110136005)(44832011)(8936002)(7416002)(5660300002)(8676002)(4326008)(83380400001)(2616005)(82310400005)(47076005)(956004)(1076003)(336012)(186003)(478600001)(16526019)(26005)(40480700001)(6666004)(107886003)(41300700001)(36756003)(83996005)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:37.5037 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbeea725-9e2e-4b17-45e3-08da8686ce96 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.76]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT086.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR10MB3952 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Subsequent patches will touch that file, apply some nice to have style changes before actually adding functional changes. Signed-off-by: Henning Schild Reviewed-by: Andy Shevchenko --- drivers/gpio/gpio-f7188x.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index fef539bbc03a..878458249833 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -165,11 +165,11 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, .regbase = _regbase, \ } -#define gpio_dir(base) (base + 0) -#define gpio_data_out(base) (base + 1) -#define gpio_data_in(base) (base + 2) +#define f7188x_gpio_dir(base) ((base) + 0) +#define f7188x_gpio_data_out(base) ((base) + 1) +#define f7188x_gpio_data_in(base) ((base) + 2) /* Output mode register (0:open drain 1:push-pull). */ -#define gpio_out_mode(base) (base + 3) +#define f7188x_gpio_out_mode(base) ((base) + 3) static struct f7188x_gpio_bank f71869_gpio_bank[] = { F7188X_GPIO_BANK(0, 6, 0xF0), @@ -267,7 +267,7 @@ static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) return err; superio_select(sio->addr, SIO_LD_GPIO); - dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); + dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); superio_exit(sio->addr); @@ -289,9 +289,9 @@ static int f7188x_gpio_direction_in(struct gpio_chip *chip, unsigned offset) return err; superio_select(sio->addr, SIO_LD_GPIO); - dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); + dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); dir &= ~BIT(offset); - superio_outb(sio->addr, gpio_dir(bank->regbase), dir); + superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -310,12 +310,12 @@ static int f7188x_gpio_get(struct gpio_chip *chip, unsigned offset) return err; superio_select(sio->addr, SIO_LD_GPIO); - dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); + dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); dir = !!(dir & BIT(offset)); if (dir) - data = superio_inb(sio->addr, gpio_data_out(bank->regbase)); + data = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); else - data = superio_inb(sio->addr, gpio_data_in(bank->regbase)); + data = superio_inb(sio->addr, f7188x_gpio_data_in(bank->regbase)); superio_exit(sio->addr); @@ -335,16 +335,16 @@ static int f7188x_gpio_direction_out(struct gpio_chip *chip, return err; superio_select(sio->addr, SIO_LD_GPIO); - data_out = superio_inb(sio->addr, gpio_data_out(bank->regbase)); + data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); if (value) data_out |= BIT(offset); else data_out &= ~BIT(offset); - superio_outb(sio->addr, gpio_data_out(bank->regbase), data_out); + superio_outb(sio->addr, f7188x_gpio_data_out(bank->regbase), data_out); - dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); + dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); dir |= BIT(offset); - superio_outb(sio->addr, gpio_dir(bank->regbase), dir); + superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -363,12 +363,12 @@ static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value) return; superio_select(sio->addr, SIO_LD_GPIO); - data_out = superio_inb(sio->addr, gpio_data_out(bank->regbase)); + data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); if (value) data_out |= BIT(offset); else data_out &= ~BIT(offset); - superio_outb(sio->addr, gpio_data_out(bank->regbase), data_out); + superio_outb(sio->addr, f7188x_gpio_data_out(bank->regbase), data_out); superio_exit(sio->addr); } @@ -391,12 +391,12 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, return err; superio_select(sio->addr, SIO_LD_GPIO); - data = superio_inb(sio->addr, gpio_out_mode(bank->regbase)); + data = superio_inb(sio->addr, f7188x_gpio_out_mode(bank->regbase)); if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN) data &= ~BIT(offset); else data |= BIT(offset); - superio_outb(sio->addr, gpio_out_mode(bank->regbase), data); + superio_outb(sio->addr, f7188x_gpio_out_mode(bank->regbase), data); superio_exit(sio->addr); return 0; From patchwork Thu Aug 25 10:44:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600115 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF5CAC3F6B0 for ; Thu, 25 Aug 2022 10:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241219AbiHYKo6 (ORCPT ); Thu, 25 Aug 2022 06:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241171AbiHYKoz (ORCPT ); Thu, 25 Aug 2022 06:44:55 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 023604BD3B; Thu, 25 Aug 2022 03:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzH68/f76Ip+tvjZS+NaAZ73C9RouR2kGIopm+RcO04xSkz6ux82ArDFVXQIgu/Z2wR7z5HTMbnPoih7Q0rkvlhcbKO5ARxEm+OWRW6XXNTABex5zQ9wX/JJ1Fwo+SbPqWzIZ3xmeF8pnbqX/MSqoUCEJrhk3Oi45Q8NlVD84B1KZJ7fKXWRD3O6cvD1fv9xakkeS2SFUXhXsjbVtD1+oCx8uD0oOMb+HM/35rv0RXLhDXt8uhRNr1Plww05atc5Jbgqj4f0BlEq2AoqGOPOFDrUre7i7jISz00hOJ+qIX/mzHKrJH5xc6CG0ZKCFx3r3uo5mnvSOwc63TTfoqaFFw== 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=yXqcOZ2eEscInWqK2z7PIYAdQfxfLBfslrQ3D5wrsr4=; b=EKLlpoazRGZYh4u5ZEY1Nd6FYofe7uZtyqZt7swtl/Aj8CMFc7qj++uNEmSakFjcDb17A1ch4M9KcymtFu7QH7IWGYbGQZ6bDKg9gIARpG8zknmfVKa84bXJXXIyCnQb8g8e165uYl15Sq9J1DB1PiggXhA59rh7qPvXZOMisrU0NpOvEHvus2XbKFiqI1D5DQ6Xn7AxHUYD2DSYp9dQIQtcS4rDinlnYCShj2kQMRX8UiSiaZsychZR65z+mb/mcxFmw78D1oj0cwBDUZXlGS2qLU3hFnHn+1cVFI3D7zvKTD9FwSimmv8w8h96WXUVxNq33rgigTZrOnYHqeWJvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.74) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yXqcOZ2eEscInWqK2z7PIYAdQfxfLBfslrQ3D5wrsr4=; b=CDqt+OF1jRMFVPVsLTU+rSBDEJpx6xj9h5DrcWiKh6DxjhlH9yQp1lgNo7hh583NPJcL5oB1W3k1eVzW2X7m+LUEl5WJrPtpUAmWpbE4rMNjzkOdjTJ8jlUzE5vcbM4BV/GMY3bUrCII3U+j/8JYx0anfcX/uay+qNkD/7x/8RMeZ2mRuB3NkPLlMVSkOZsnZp+lq/Ivzp1qvfVO+4TFrV5yERpzxkE6WDg5IkX3kBrubTXUnPiJZJSXuBq/XtkMfI706r1kEks2gIsWZ8Laceiz3dSoONT0m1tp3a9gx69B4PztSVNkps1mKLLA4Px59CQeYCYUxE2FvOF4lVMSig== Received: from DB6PR0601CA0048.eurprd06.prod.outlook.com (2603:10a6:4:17::34) by AM9PR10MB4248.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:1f7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Thu, 25 Aug 2022 10:44:48 +0000 Received: from DB5EUR01FT055.eop-EUR01.prod.protection.outlook.com (2603:10a6:4:17:cafe::cd) by DB6PR0601CA0048.outlook.office365.com (2603:10a6:4:17::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:48 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.74) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.74 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.74; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.74) by DB5EUR01FT055.mail.protection.outlook.com (10.152.5.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:48 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VQA.ad011.siemens.net (194.138.21.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:47 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:47 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 3/7] gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Date: Thu, 25 Aug 2022 12:44:18 +0200 Message-ID: <20220825104422.14156-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--9.929100-8.000000 X-TMASE-MatchedRID: xpRMqq2LnxwnajXSbZssErN5pka0DGqI47cLULZlxOVkGI+vgRTxME+c rEA4+nhZEmx/CUhRV0GhAqHLqD5GgW7iQTMjrcXyIyjGuFgTWAqmWOD8X0TFhCfphWrcxCwjaeM aKzvXUpljjMm9SMavFWO27X3o/SbCfGzuoVn0Vs6PQi9XuOWoOA2qw+l5gxNFXQ3GOUdI0+7lm5 R3Gqr5Dr59Yrw3aQCHGdJD2ytTIBErtzhh+D9NIseenRSRvoM4Mzwe5s18okNzEyQF4j0rdxA5w xKjT3bqx6C6dcifNxiLVFtk3Um5KCqcD2KTceXurQB5G2coNlKCnzYdtGmczFPCjtWo3QQ8hVDn kfzD7uY8guXXRtiXIJhRBYxZ+VWn3nZy7lirOs91hJ+eDAEvqGoR/pevuvZYKrDHzH6zmUXAmOf zKotToreWSoRRutYI4G+HMbHU4xDi8zVgXoAltsIJ+4gwXrEtIAcCikR3vq94SPnU7aqreg9bxS b2aZXkGW+/zwSXigzF16Q1sV9deXkQgFDHvKre X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.929100-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 9B10E295BA4954010F80E7662EDF7C9967301A7E88B7F15FB3021A92D1F07D1B2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7111230-f8e0-4aee-1a3e-08da8686d4f0 X-MS-TrafficTypeDiagnostic: AM9PR10MB4248:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FrXbCluS0b+JO4Wd0OulVizi8aTAYs1RJnUUxXH5P4RtDMjBacAnOyoxpoKzP+DNIsCjPxGMLq614R6V1MK5nSy2ix/uqjINagcTkit03IRtw6EaCUYrAghAQc/0b9cFFdmtaZiIkoTF3DMtzhl/KLX2tqxrUoNOxp7qGWdwyF1hlXB12NIHbnXROl7abOlLt+WQd40XlrCdfxtiodm6IcvXqYXmy49nyylHZBel4XPjf8k6xf+SDKSYIKA+alc+T6IT/TucIdW4dpEEOUcgBfvV39afCyTZigXjcbUl8GwGOPdSQHz2fiZDr6cYbNWjri+1y6LHLEb+/tqqsRnVlWJEj7+DPENskjT+ehcBPFBwcML3HQmEj5Cd5SD4SWHoxpgBxTRHfMO4jCxcvyA59KXaEQkZTu1+hdF+KgsWfZzJ3UXZMDOnO3Joib9k79BXQg8t4YAd55a7Rwnac5WKOZE+wY9VvcPXhsTh03vufk86lFmyqD0+Zoj0n5rK1Mwk25pPSkpHVzVysaJjxcBx8k0H3qCG1FuDWckEjMN0l7nB+7RH1i2l6ZrdO8B4QthKMj/ZUPSKX7U9+gS+AXqH2oUWJVM7f1gAKJxUkzr3+glJdpFQHy/O2qNwwWhTqL6/IqJd9h4xOGA1uykmgzLSXqe9riX3pntqQgROJjNXhe/Sz8uNJAw9Yd46E7NKhhGmAcEkL9JJSkP+uLA/uaRnA6ToeqeswZyKKQFR+9XzOsJ8yH1DKpOuRNnBNWeOIk13sufcfPnwsGKoGcSr2jU/Ss4s9NUaV2Qls55zbPA2Y6m5K79isl5t11+BtEtAGyTcwW6CNrZ2ARDwrzgRpcTcYg== X-Forefront-Antispam-Report: CIP:194.138.21.74; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:hybrid.siemens.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(346002)(136003)(376002)(40470700004)(46966006)(36840700001)(5660300002)(7416002)(41300700001)(36860700001)(110136005)(54906003)(186003)(1076003)(40460700003)(8936002)(16526019)(336012)(86362001)(316002)(2616005)(956004)(47076005)(921005)(82960400001)(356005)(7596003)(7636003)(82310400005)(82740400003)(70586007)(70206006)(8676002)(4326008)(83380400001)(40480700001)(478600001)(6666004)(36756003)(2906002)(26005)(107886003)(44832011)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:48.1810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7111230-f8e0-4aee-1a3e-08da8686d4f0 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.74]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT055.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB4248 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add GPIO support for Nuvoton NCT6116 chip. Nuvoton SuperIO chips are very similar to the ones from Fintek. In other subsystems they also share drivers and are called a family of drivers. For the GPIO subsystem the only difference is that the direction bit is reversed and that there is only one data bit per pin. On the SuperIO level the logical device is another one. On a chip level we do not have a manufacturer ID to check and also no revision. Reviewed-by: Andy Shevchenko Acked-by: Simon Guinot Signed-off-by: Henning Schild --- drivers/gpio/Kconfig | 3 +- drivers/gpio/gpio-f7188x.c | 104 ++++++++++++++++++++++++++++--------- 2 files changed, 81 insertions(+), 26 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 0642f579196f..3f64345fe40b 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -874,10 +874,11 @@ config GPIO_104_IDI_48 module parameter. config GPIO_F7188X - tristate "F71869, F71869A, F71882FG, F71889F and F81866 GPIO support" + tristate "Fintek and Nuvoton Super-I/O GPIO support" help This option enables support for GPIOs found on Fintek Super-I/O chips F71869, F71869A, F71882FG, F71889F and F81866. + As well as Nuvoton Super-I/O chip NCT6116D. To compile this driver as a module, choose M here: the module will be called f7188x-gpio. diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index 878458249833..29c73ea96466 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * GPIO driver for Fintek Super-I/O F71869, F71869A, F71882, F71889 and F81866 + * GPIO driver for Fintek and Nuvoton Super-I/O chips * * Copyright (C) 2010-2013 LaCie * @@ -22,23 +22,36 @@ */ #define SIO_LDSEL 0x07 /* Logical device select */ #define SIO_DEVID 0x20 /* Device ID (2 bytes) */ -#define SIO_DEVREV 0x22 /* Device revision */ -#define SIO_MANID 0x23 /* Fintek ID (2 bytes) */ -#define SIO_LD_GPIO 0x06 /* GPIO logical device */ #define SIO_UNLOCK_KEY 0x87 /* Key to enable Super-I/O */ #define SIO_LOCK_KEY 0xAA /* Key to disable Super-I/O */ -#define SIO_FINTEK_ID 0x1934 /* Manufacturer ID */ +/* + * Fintek devices. + */ +#define SIO_FINTEK_DEVREV 0x22 /* Fintek Device revision */ +#define SIO_FINTEK_MANID 0x23 /* Fintek ID (2 bytes) */ + +#define SIO_FINTEK_ID 0x1934 /* Manufacturer ID */ + #define SIO_F71869_ID 0x0814 /* F71869 chipset ID */ #define SIO_F71869A_ID 0x1007 /* F71869A chipset ID */ #define SIO_F71882_ID 0x0541 /* F71882 chipset ID */ #define SIO_F71889_ID 0x0909 /* F71889 chipset ID */ #define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */ #define SIO_F81866_ID 0x1010 /* F81866 chipset ID */ -#define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */ +#define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for F81966 */ #define SIO_F81865_ID 0x0704 /* F81865 chipset ID */ +#define SIO_LD_GPIO_FINTEK 0x06 /* GPIO logical device */ + +/* + * Nuvoton devices. + */ +#define SIO_NCT6116D_ID 0xD283 /* NCT6116D chipset ID */ + +#define SIO_LD_GPIO_NUVOTON 0x07 /* GPIO logical device */ + enum chips { f71869, @@ -49,6 +62,7 @@ enum chips { f81866, f81804, f81865, + nct6116d, }; static const char * const f7188x_names[] = { @@ -60,10 +74,12 @@ static const char * const f7188x_names[] = { "f81866", "f81804", "f81865", + "nct6116d", }; struct f7188x_sio { int addr; + int device; enum chips type; }; @@ -171,6 +187,9 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, /* Output mode register (0:open drain 1:push-pull). */ #define f7188x_gpio_out_mode(base) ((base) + 3) +#define f7188x_gpio_dir_invert(type) ((type) == nct6116d) +#define f7188x_gpio_data_single(type) ((type) == nct6116d) + static struct f7188x_gpio_bank f71869_gpio_bank[] = { F7188X_GPIO_BANK(0, 6, 0xF0), F7188X_GPIO_BANK(10, 8, 0xE0), @@ -255,6 +274,17 @@ static struct f7188x_gpio_bank f81865_gpio_bank[] = { F7188X_GPIO_BANK(60, 5, 0x90), }; +static struct f7188x_gpio_bank nct6116d_gpio_bank[] = { + F7188X_GPIO_BANK(0, 8, 0xE0), + F7188X_GPIO_BANK(10, 8, 0xE4), + F7188X_GPIO_BANK(20, 8, 0xE8), + F7188X_GPIO_BANK(30, 8, 0xEC), + F7188X_GPIO_BANK(40, 8, 0xF0), + F7188X_GPIO_BANK(50, 8, 0xF4), + F7188X_GPIO_BANK(60, 8, 0xF8), + F7188X_GPIO_BANK(70, 1, 0xFC), +}; + static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) { int err; @@ -265,13 +295,16 @@ static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) err = superio_enter(sio->addr); if (err) return err; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); superio_exit(sio->addr); - if (dir & 1 << offset) + if (f7188x_gpio_dir_invert(sio->type)) + dir = ~dir; + + if (dir & BIT(offset)) return GPIO_LINE_DIRECTION_OUT; return GPIO_LINE_DIRECTION_IN; @@ -287,10 +320,14 @@ static int f7188x_gpio_direction_in(struct gpio_chip *chip, unsigned offset) err = superio_enter(sio->addr); if (err) return err; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); - dir &= ~BIT(offset); + + if (f7188x_gpio_dir_invert(sio->type)) + dir |= BIT(offset); + else + dir &= ~BIT(offset); superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -308,11 +345,11 @@ static int f7188x_gpio_get(struct gpio_chip *chip, unsigned offset) err = superio_enter(sio->addr); if (err) return err; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); dir = !!(dir & BIT(offset)); - if (dir) + if (f7188x_gpio_data_single(sio->type) || dir) data = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); else data = superio_inb(sio->addr, f7188x_gpio_data_in(bank->regbase)); @@ -333,7 +370,7 @@ static int f7188x_gpio_direction_out(struct gpio_chip *chip, err = superio_enter(sio->addr); if (err) return err; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); if (value) @@ -343,7 +380,10 @@ static int f7188x_gpio_direction_out(struct gpio_chip *chip, superio_outb(sio->addr, f7188x_gpio_data_out(bank->regbase), data_out); dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); - dir |= BIT(offset); + if (f7188x_gpio_dir_invert(sio->type)) + dir &= ~BIT(offset); + else + dir |= BIT(offset); superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -361,7 +401,7 @@ static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value) err = superio_enter(sio->addr); if (err) return; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); if (value) @@ -389,7 +429,7 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, err = superio_enter(sio->addr); if (err) return err; - superio_select(sio->addr, SIO_LD_GPIO); + superio_select(sio->addr, sio->device); data = superio_inb(sio->addr, f7188x_gpio_out_mode(bank->regbase)); if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN) @@ -450,6 +490,10 @@ static int f7188x_gpio_probe(struct platform_device *pdev) data->nr_bank = ARRAY_SIZE(f81865_gpio_bank); data->bank = f81865_gpio_bank; break; + case nct6116d: + data->nr_bank = ARRAY_SIZE(nct6116d_gpio_bank); + data->bank = nct6116d_gpio_bank; + break; default: return -ENODEV; } @@ -480,18 +524,15 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio) { int err; u16 devid; + u16 manid; err = superio_enter(addr); if (err) return err; err = -ENODEV; - devid = superio_inw(addr, SIO_MANID); - if (devid != SIO_FINTEK_ID) { - pr_debug("Not a Fintek device at 0x%08x\n", addr); - goto err; - } + sio->device = SIO_LD_GPIO_FINTEK; devid = superio_inw(addr, SIO_DEVID); switch (devid) { case SIO_F71869_ID: @@ -518,17 +559,30 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio) case SIO_F81865_ID: sio->type = f81865; break; + case SIO_NCT6116D_ID: + sio->device = SIO_LD_GPIO_NUVOTON; + sio->type = nct6116d; + break; default: pr_info("Unsupported Fintek device 0x%04x\n", devid); goto err; } + + /* double check manufacturer where possible */ + if (sio->type != nct6116d) { + manid = superio_inw(addr, SIO_FINTEK_MANID); + if (manid != SIO_FINTEK_ID) { + pr_debug("Not a Fintek device at 0x%08x\n", addr); + goto err; + } + } + sio->addr = addr; err = 0; - pr_info("Found %s at %#x, revision %d\n", - f7188x_names[sio->type], - (unsigned int) addr, - (int) superio_inb(addr, SIO_DEVREV)); + pr_info("Found %s at %#x\n", f7188x_names[sio->type], (unsigned int)addr); + if (sio->type != nct6116d) + pr_info(" revision %d\n", superio_inb(addr, SIO_FINTEK_DEVREV)); err: superio_exit(addr); From patchwork Thu Aug 25 10:44:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600454 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94260C04AA5 for ; Thu, 25 Aug 2022 10:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241176AbiHYKo4 (ORCPT ); Thu, 25 Aug 2022 06:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241187AbiHYKoy (ORCPT ); Thu, 25 Aug 2022 06:44:54 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80057.outbound.protection.outlook.com [40.107.8.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E6D18E1E; Thu, 25 Aug 2022 03:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IsZuw5JiBgT3RFQRJLRjScKt9vYTF47icwKPGdxy046A88EFwcm3OK30tiqu0od7QZFwpseQBEi70fTYF2WsMjRfXsda4bQM2ji4QKpc8XvcdlDlNA7rQhaWIKBkB77sPKRLNpuBeyxAo7mpQEqNqbWOkrxVMxCh4zunw295wcWqYsWKjjXFuyHfm9BZ6e8uva0hQbYLyyXXbb+fY49weSoBdiIQcToSEtkCc+MJpD50WWVEQkdEyLI59Vk/muaCMHpzRf6OlXmZgyCya0nV8HWYnCu0dMYslO9+lavU8HDZuMpTKNmqaGvjiFq8Q+/ggqUIvuKf5RkrKHgPeNAL7Q== 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=JGtZGqDc6LA+iwjNfm9cHVQ+NwakcT1QLgyFZ8FGn5M=; b=Sj9kBCGx+xjCLjCoXwYaMrVPdIFb3gttYFyZR1XxcakPVNqZxFqJPG3/ezrpt6XQ3QiIUIsPYbhtzgnOy+7aCyoaBIiPjjr117oBRClRKRZtFi8ikCgOCNVhf//V1WP2et9Kgk4I382lOGfxgCSXptXjy23vNHA1Z1tTEyEgftR/yB4x47zAQRfOgnBhxI5FxtKEPhjQzOtIL/A3BNCLNCz/lJWjRR3XnM5Et7vNMNyZjncOwf/cDTdFxbbd67sfb0nk5tG8GG+R8mKinAYjNpXYKE809Bb27Y1xAXS6qXy0ICLXCGhnRWyUp+Jd9FINfkGoaQj7j47uYRINC19MxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.76) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JGtZGqDc6LA+iwjNfm9cHVQ+NwakcT1QLgyFZ8FGn5M=; b=CKUg37JydTEb3nea2RzVnh9fNGagDdI2C8MP43235zmaT3o/LZTPZJcvunM6vmWYzfBKbU89isukgeezaSZmFX5yTr8LzFjPnJsndXo6Ivy3yDXXlPxW2XKSFdRENyr6jNv4nLHAgnXXklR2j3y0a+tDIHqxLhTZCr48/hoR/W+yGGAl8xFkwiDu+oCbSFryn76KxeykV7H9PblvwOSLl6lig9PHsGGxrtXHZ9ZO79pP/YDQuu3eEhuJ05NBaIr9rp3hAZNEv566J6xjt0rn83+DSEdk304IeN3FXLqH4L4zPkBGwliEsfQPa4GfkuMHYl0BVGBRQ1jPc28VunTXVg== Received: from GV3P280CA0120.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:8::26) by AS8PR10MB5025.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:340::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Thu, 25 Aug 2022 10:44:48 +0000 Received: from HE1EUR01FT056.eop-EUR01.prod.protection.outlook.com (2603:10a6:150:8:cafe::34) by GV3P280CA0120.outlook.office365.com (2603:10a6:150:8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:48 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.76) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.76 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.76; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.76) by HE1EUR01FT056.mail.protection.outlook.com (10.152.0.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:48 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VSA.ad011.siemens.net (194.138.21.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:47 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:47 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 4/7] gpio-f7188x: use unique labels for banks/chips Date: Thu, 25 Aug 2022 12:44:19 +0200 Message-ID: <20220825104422.14156-5-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--9.309700-8.000000 X-TMASE-MatchedRID: D+XfgODzmzordWdGoKfUymdUGQPHutoBOT0VlJjRfnH27WtDgGBc8tGO cAfHKa6uB2QWi8BF5ShpRezoWC5XLXFnQp1moK9xjO5iMKbqS0z7XyLXPDdLs6chFrOB9kanCy8 7Unb7MRibKItl61J/yZ+inTK0bC9eKrauXd3MZDVTxudrnzbN7TI0TdGDHTeCxe6/NfpGSBcN14 644BFiKkyi5Zl49Fqp X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.309700-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 79C1488D1547FF70A121871CBCBD2E910B16D2D93238AA0059E925558D514A732000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32564fc4-1748-48a1-f1a9-08da8686d518 X-MS-TrafficTypeDiagnostic: AS8PR10MB5025:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HJTZw8Ez0dumlWAIIooQj5QuEhCACkmKsne7ZGHWlIcZRpLCb4ZhVkBvJJFxP4dOXMEKHWueU9hvGiyjsZGfoyOU+2T5DMBbi3vdTIWcwa7E/jCw6Mfww9AkImGS/WlpEm1NIc5Ktzpwyve1K7Ms/X8OILPFXzd3OHGAFQscGobvdlxmSiTx5BQbwsnTgqq4uuf4fm+aOeAd2/Yx3unCsTFklYYfcDfRyHxzFjRKkSkKPfDLU85pLRbHhh9oyNbxLXuUg9dt87KcTxPFqSW81UgJBbbVAsBGHM6ClVTYXK0OBBfcKjdRgj2xTsDA36pOvuScPbNiAHUfEm2rCn5pLks3dUq0G/pEr+vVPDEF8t59RB/wHA7+VFaNy9MxhGcUjZ15D2CDQKBFQy7BA3smRaqidyvPFC3iffD0/VGMjKOsVao+fUaeAsbyglsLCZgWtIL8hIASI1p83sfJ4cfaJUNxPfiGllfveYUf1mUxleiXcagxDyBOhMrG1iVG1dKeC1MTecaiuTcRoQnTfM/NucMk0M4z3xk0VVSCE0JnG+EXfegx75ldFX64FJTVKfjODPPjitMQkOkOd7OPjstpEEBEZK9fLeGlNPJRyW+0V4GqCIDUMqsdMozLcQC3lPRE+yzvG19BZTRHVyxx9o6E4J7xDiwfjioU9ED0GwAX3JRdzz6Ad0sALmi1GFe1uh+pivTfXLjcNafwbYP+LY7kV+FUcu/TMVucpu8LiZQMxd0f+5oLSVCGw0jAGf/buoydSwAyNlagu2yYgZQMGa5UId/MomL8SytzO3Ot80Ew3wfyourrbrlu0wBks8hGyJeLvOYCI3xRWe3VvR279TJyJkNQWowdBS4U6TpAghhOeoOeh2OZtti3g+E924h5NbXX X-Forefront-Antispam-Report: CIP:194.138.21.76; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(346002)(136003)(39860400002)(376002)(36840700001)(40470700004)(46966006)(4326008)(40460700003)(86362001)(70586007)(70206006)(5660300002)(26005)(7416002)(478600001)(6666004)(8936002)(107886003)(356005)(2906002)(40480700001)(81166007)(8676002)(41300700001)(82310400005)(921005)(82960400001)(44832011)(186003)(47076005)(1076003)(336012)(16526019)(82740400003)(2616005)(956004)(36860700001)(83380400001)(36756003)(110136005)(54906003)(316002)(2101003)(83996005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:48.4269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32564fc4-1748-48a1-f1a9-08da8686d518 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.76]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT056.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB5025 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org So that drivers building on top can find those pins with GPIO_LOOKUP helpers. Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Acked-by: Simon Guinot Signed-off-by: Henning Schild --- drivers/gpio/gpio-f7188x.c | 138 ++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index 29c73ea96466..9effa7769bef 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -163,10 +163,10 @@ static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value); static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, unsigned long config); -#define F7188X_GPIO_BANK(_base, _ngpio, _regbase) \ +#define F7188X_GPIO_BANK(_base, _ngpio, _regbase, _label) \ { \ .chip = { \ - .label = DRVNAME, \ + .label = _label, \ .owner = THIS_MODULE, \ .get_direction = f7188x_gpio_get_direction, \ .direction_input = f7188x_gpio_direction_in, \ @@ -191,98 +191,98 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, #define f7188x_gpio_data_single(type) ((type) == nct6116d) static struct f7188x_gpio_bank f71869_gpio_bank[] = { - F7188X_GPIO_BANK(0, 6, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 5, 0xA0), - F7188X_GPIO_BANK(60, 6, 0x90), + F7188X_GPIO_BANK(0, 6, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 5, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 6, 0x90, DRVNAME "-6"), }; static struct f7188x_gpio_bank f71869a_gpio_bank[] = { - F7188X_GPIO_BANK(0, 6, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 5, 0xA0), - F7188X_GPIO_BANK(60, 8, 0x90), - F7188X_GPIO_BANK(70, 8, 0x80), + F7188X_GPIO_BANK(0, 6, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 5, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 8, 0x90, DRVNAME "-6"), + F7188X_GPIO_BANK(70, 8, 0x80, DRVNAME "-7"), }; static struct f7188x_gpio_bank f71882_gpio_bank[] = { - F7188X_GPIO_BANK(0, 8, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 4, 0xC0), - F7188X_GPIO_BANK(40, 4, 0xB0), + F7188X_GPIO_BANK(0, 8, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 4, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 4, 0xB0, DRVNAME "-4"), }; static struct f7188x_gpio_bank f71889a_gpio_bank[] = { - F7188X_GPIO_BANK(0, 7, 0xF0), - F7188X_GPIO_BANK(10, 7, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 5, 0xA0), - F7188X_GPIO_BANK(60, 8, 0x90), - F7188X_GPIO_BANK(70, 8, 0x80), + F7188X_GPIO_BANK(0, 7, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 7, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 5, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 8, 0x90, DRVNAME "-6"), + F7188X_GPIO_BANK(70, 8, 0x80, DRVNAME "-7"), }; static struct f7188x_gpio_bank f71889_gpio_bank[] = { - F7188X_GPIO_BANK(0, 7, 0xF0), - F7188X_GPIO_BANK(10, 7, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 5, 0xA0), - F7188X_GPIO_BANK(60, 8, 0x90), - F7188X_GPIO_BANK(70, 8, 0x80), + F7188X_GPIO_BANK(0, 7, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 7, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 5, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 8, 0x90, DRVNAME "-6"), + F7188X_GPIO_BANK(70, 8, 0x80, DRVNAME "-7"), }; static struct f7188x_gpio_bank f81866_gpio_bank[] = { - F7188X_GPIO_BANK(0, 8, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 8, 0xA0), - F7188X_GPIO_BANK(60, 8, 0x90), - F7188X_GPIO_BANK(70, 8, 0x80), - F7188X_GPIO_BANK(80, 8, 0x88), + F7188X_GPIO_BANK(0, 8, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 8, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 8, 0x90, DRVNAME "-6"), + F7188X_GPIO_BANK(70, 8, 0x80, DRVNAME "-7"), + F7188X_GPIO_BANK(80, 8, 0x88, DRVNAME "-8"), }; static struct f7188x_gpio_bank f81804_gpio_bank[] = { - F7188X_GPIO_BANK(0, 8, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(50, 8, 0xA0), - F7188X_GPIO_BANK(60, 8, 0x90), - F7188X_GPIO_BANK(70, 8, 0x80), - F7188X_GPIO_BANK(90, 8, 0x98), + F7188X_GPIO_BANK(0, 8, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(50, 8, 0xA0, DRVNAME "-3"), + F7188X_GPIO_BANK(60, 8, 0x90, DRVNAME "-4"), + F7188X_GPIO_BANK(70, 8, 0x80, DRVNAME "-5"), + F7188X_GPIO_BANK(90, 8, 0x98, DRVNAME "-6"), }; static struct f7188x_gpio_bank f81865_gpio_bank[] = { - F7188X_GPIO_BANK(0, 8, 0xF0), - F7188X_GPIO_BANK(10, 8, 0xE0), - F7188X_GPIO_BANK(20, 8, 0xD0), - F7188X_GPIO_BANK(30, 8, 0xC0), - F7188X_GPIO_BANK(40, 8, 0xB0), - F7188X_GPIO_BANK(50, 8, 0xA0), - F7188X_GPIO_BANK(60, 5, 0x90), + F7188X_GPIO_BANK(0, 8, 0xF0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE0, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xD0, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xC0, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xB0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 8, 0xA0, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 5, 0x90, DRVNAME "-6"), }; static struct f7188x_gpio_bank nct6116d_gpio_bank[] = { - F7188X_GPIO_BANK(0, 8, 0xE0), - F7188X_GPIO_BANK(10, 8, 0xE4), - F7188X_GPIO_BANK(20, 8, 0xE8), - F7188X_GPIO_BANK(30, 8, 0xEC), - F7188X_GPIO_BANK(40, 8, 0xF0), - F7188X_GPIO_BANK(50, 8, 0xF4), - F7188X_GPIO_BANK(60, 8, 0xF8), - F7188X_GPIO_BANK(70, 1, 0xFC), + F7188X_GPIO_BANK(0, 8, 0xE0, DRVNAME "-0"), + F7188X_GPIO_BANK(10, 8, 0xE4, DRVNAME "-1"), + F7188X_GPIO_BANK(20, 8, 0xE8, DRVNAME "-2"), + F7188X_GPIO_BANK(30, 8, 0xEC, DRVNAME "-3"), + F7188X_GPIO_BANK(40, 8, 0xF0, DRVNAME "-4"), + F7188X_GPIO_BANK(50, 8, 0xF4, DRVNAME "-5"), + F7188X_GPIO_BANK(60, 8, 0xF8, DRVNAME "-6"), + F7188X_GPIO_BANK(70, 1, 0xFC, DRVNAME "-7"), }; static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) From patchwork Thu Aug 25 10:44:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600452 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 326AAC3F6B0 for ; Thu, 25 Aug 2022 10:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241229AbiHYKpg (ORCPT ); Thu, 25 Aug 2022 06:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241227AbiHYKpZ (ORCPT ); Thu, 25 Aug 2022 06:45:25 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FDA2A4077; Thu, 25 Aug 2022 03:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQaHHEyoi2vExzqhgr6EZwa3HwhOyur0TimAM8eXUukDKqcpaGg3+QbTRMAoKfcXxAxrz2aJeY7IUy+UCL0CA2oZXGTxHlpo8ykxHliqjxpUqiL7PPgN9sy4Mo8pMmsobbCUcpTlE0I8clpNtV73c0H96kPG70pvp/mUioe3lMJsiJvLTxEEfUrZsFHF571ZieNbiX5ykWgayDFDceVBjcGKCon8YQJ1TMO941UvVM6NyYX0CsArjK5G9zN08FqUlqBj1MyoLh/qv60UirZVo9/sNuFimmrifeKdlzx/dhJJea/Gh6GHNevYvjctZzhdlWfJn0jxW5kn6V78QPjoWQ== 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=T+2bViNTZBcxo0DYtI+egJrMHPDUebydfxh/wJvFVUo=; b=SGHh18twZBIaUS4/eZLOi6xwdTSC7/iuK2k4K1lK930Pu3VLKHOVePoIYxvTrSe1CSsGeAHbM++YKPU/Gr3BbTp01/DARaQPqk/Eqy2w7scZFmG6WbQGoL9baf/3ON7Z4xfTUsSpxk23gwUAebwQFv3hvUe7eoKlItM2/td4nseh7Y4F47+NtehTAlJ57p8XnI2OSXoecnWCPm8oi/46KKR5Ys4W6gY8xa4/JbkqIm9utFVqdtzMi1x29qosLPqh2JBmLs1FA/TNOyCh2+UMz21unryGRSbtDydQXqstC8520IZ4EoafDK3ojhh3E8dOHPBZfvIXCuQYgQ/iS3LDNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 194.138.21.75) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=temperror action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T+2bViNTZBcxo0DYtI+egJrMHPDUebydfxh/wJvFVUo=; b=FGBqSJUqA3rQK0p8Pu1TqoFsHUNf1gt5D2nt1EsmaGA93tuaI+SYndVM18qcVhvSDeRCxVfbD5f0lyUkyo8/i5uF8GKvmJTxAnrOMX7pHTk6gTGtqGelkeaCxMyTqdL/TD+BAyUxz4JVNIw0I7aRsh6j6EZGAz0WVrozV88XoCXjqdh09sJZYMthNqel0oMrb/Lz4ydaGWlY3VToaoae6iOuOKXUh3q/oGURi7ihK32cuZyuNFuHStoTF897JS+GrdlQgp183LrVn+Sv1blIXojTTIjsa4v/eNCIDmda2KXtjBSR9YxhlnzhGg/FEB0Mt8M8Ywr3/TVOEgx3BFcaTw== Received: from AS8PR04CA0030.eurprd04.prod.outlook.com (2603:10a6:20b:310::35) by AM6PR10MB3109.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:a2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 10:44:50 +0000 Received: from VE1EUR01FT059.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:310:cafe::dc) by AS8PR04CA0030.outlook.office365.com (2603:10a6:20b:310::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:50 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 194.138.21.75) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=siemens.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of siemens.com: DNS Timeout) Received: from hybrid.siemens.com (194.138.21.75) by VE1EUR01FT059.mail.protection.outlook.com (10.152.3.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:49 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VRA.ad011.siemens.net (194.138.21.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:48 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:47 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 5/7] leds: simatic-ipc-leds-gpio: add new model 227G Date: Thu, 25 Aug 2022 12:44:20 +0200 Message-ID: <20220825104422.14156-6-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--11.474100-8.000000 X-TMASE-MatchedRID: Qby9J4e4UdTFiWpUiGitMXibxqQL9M5Vn9v8HoDZ0FGJUlmL3Uj0mFF5 adRR2Ej1cJHSK1bfF9Umgo5BSqf/nu3KKKhzBK2tQq3vCgXA4C0S5iXdhf8hbmwTEruL9ObTP6T ki+9nU3/yY5FJckXFdm7lBX/37R4pI1uRVimIzhiFXYmCt5bnqrc+8pJXJ20jEhGH3CRdKUVcaN B/u5yQq+jMOEZ5AL0Sg7lN9LOvFDugzZZTnrU2qAGgqRQZQsCi/N0WsxWI4QdKzOvae5Q0rOBef ETzWLKxeUMkPpZu/kCjxYyRBa/qJcFwgTvxipFajoczmuoPCq2xjy26AbxiQ66ZsFHm/46eQuSZ FB5k+XLER/K3k5CAOvtse/274YkU X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.474100-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 4781B099614B9956418F31726BDE52EAEC0ABEFBFAB9CB0C94722DC01939C9362000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ab663d60-a025-4e8a-36ab-08da8686d5e1 X-MS-TrafficTypeDiagnostic: AM6PR10MB3109:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2mu4zzohpsz00OUANoxkida43p9WpdeU7CBO2CVlFPFOhEPkaOl6dT1BVj9bMiGtCBEMR4AeyLxGPyy7xGxM1OKWyY2dJ3Exidl6IpVBjdWyb8HRGSZaC9w06GdzL7h1ZGafysqALVrWfXv/qCvbhQN0Dos/BkunGyqNL/oLFXTIOTOc/ceH/x2ghJmyaAlV8P59G52yBkEEZUY/W16AYn/qwK8nNTOiPNwKWuqts9MdCfAYWDrkRXAwzXe59CxGN/KG7BF9bGaMvJSEv2PWhfsULGLlbH6ZMMzQv3K/VhlEIHZZ+XuSdW9SyFZnHGbysXnNnkdKk62YoOjMmTiYhOqRe/4tEZE5z5cSA3qv5Uc7/ij2FFYXizU/HWJmj1wYwSoRqxpnV/ZW2e3HvoEpYLUnY5SGR7vW9ES5lwT8uXBl9rH+Dj1EG0TLfe3imHQSNmwp/aYgLyqsQ2shvGP7KjM54dIBv6PQRcdKp9qg1yea2mdaIxmbqVd+YQPTvD1G7eJn9AY1z/KrI7tRg5bD7Ent6fMM4U7aTqykTpWmXk7V0TOA1NZB7lPq3k7HpoOU0+cZUPZWyh69UQBsP2o98lP2Bb8OB3bnLXmuWAeQg7UlYmyuqHZD4BBh8iPOcscfMHTBTz/xrYsGIs++4mYGRc9Q2oe8dYraVmaugcMkWH0D6Y5rf04NMWKOnsO5QIFolSxU/qY8MtyEvk0psz6uJGWFVTbz0GCfZLCiBK2Tz7oScxUI/lRsfkrImfoUmpBKpgBbVszc/syjhg+5/N6XZRj3AIKUN0dJPaCPymy0E/x6LsXfY/epcpB0bILrvIJOfh+ddwJjeN1cfuLASN4PB7jHPUca842m+i22/kpXnejTBvIuGg5EH7xHPR1xr2iD X-Forefront-Antispam-Report: CIP:194.138.21.75; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(396003)(39860400002)(376002)(40470700004)(46966006)(36840700001)(44832011)(70206006)(70586007)(6666004)(40480700001)(82310400005)(107886003)(2906002)(36756003)(8936002)(5660300002)(7416002)(478600001)(4326008)(54906003)(316002)(110136005)(41300700001)(8676002)(186003)(336012)(16526019)(26005)(2616005)(956004)(1076003)(47076005)(63370400001)(83380400001)(63350400001)(40460700003)(36860700001)(82960400001)(356005)(921005)(81166007)(86362001)(82740400003)(83996005)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:49.7767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab663d60-a025-4e8a-36ab-08da8686d5e1 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.75]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT059.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR10MB3109 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This adds support of the Siemens Simatic IPC227G. Its LEDs are connected to GPIO pins provided by the gpio-f7188x module. We make sure that gets loaded, if not enabled in the kernel config no LED support will be available. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Henning Schild --- drivers/leds/simple/simatic-ipc-leds-gpio.c | 42 ++++++++++++++++--- drivers/platform/x86/simatic-ipc.c | 4 +- .../platform_data/x86/simatic-ipc-base.h | 1 + include/linux/platform_data/x86/simatic-ipc.h | 1 + 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.c b/drivers/leds/simple/simatic-ipc-leds-gpio.c index 4c9e663a90ba..0d73dcbeec2d 100644 --- a/drivers/leds/simple/simatic-ipc-leds-gpio.c +++ b/drivers/leds/simple/simatic-ipc-leds-gpio.c @@ -13,28 +13,45 @@ #include #include #include +#include -static struct gpiod_lookup_table simatic_ipc_led_gpio_table = { +struct gpiod_lookup_table *simatic_ipc_led_gpio_table; + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = { .dev_id = "leds-gpio", .table = { - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 0, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL, 1, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL, 2, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL, 3, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 4, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 5, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 0, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH), }, }; +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("gpio-f7188x-2", 0, NULL, 0, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-2", 1, NULL, 1, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-2", 2, NULL, 2, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-2", 3, NULL, 3, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-2", 4, NULL, 4, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-2", 5, NULL, 5, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, NULL, 6, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("gpio-f7188x-3", 7, NULL, 7, GPIO_ACTIVE_HIGH), + } +}; + static const struct gpio_led simatic_ipc_gpio_leds[] = { - { .name = "green:" LED_FUNCTION_STATUS "-3" }, { .name = "red:" LED_FUNCTION_STATUS "-1" }, { .name = "green:" LED_FUNCTION_STATUS "-1" }, { .name = "red:" LED_FUNCTION_STATUS "-2" }, { .name = "green:" LED_FUNCTION_STATUS "-2" }, { .name = "red:" LED_FUNCTION_STATUS "-3" }, + { .name = "green:" LED_FUNCTION_STATUS "-3" }, }; static const struct gpio_led_platform_data simatic_ipc_gpio_leds_pdata = { @@ -46,7 +63,7 @@ static struct platform_device *simatic_leds_pdev; static int simatic_ipc_leds_gpio_remove(struct platform_device *pdev) { - gpiod_remove_lookup_table(&simatic_ipc_led_gpio_table); + gpiod_remove_lookup_table(simatic_ipc_led_gpio_table); platform_device_unregister(simatic_leds_pdev); return 0; @@ -54,10 +71,25 @@ static int simatic_ipc_leds_gpio_remove(struct platform_device *pdev) static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) { + const struct simatic_ipc_platform *plat = pdev->dev.platform_data; struct gpio_desc *gpiod; int err; - gpiod_add_lookup_table(&simatic_ipc_led_gpio_table); + switch (plat->devmode) { + case SIMATIC_IPC_DEVICE_127E: + simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_127e; + break; + case SIMATIC_IPC_DEVICE_227G: + if (!IS_ENABLED(CONFIG_GPIO_F7188X)) + return -ENODEV; + request_module("gpio-f7188x"); + simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_227g; + break; + default: + return -ENODEV; + } + + gpiod_add_lookup_table(simatic_ipc_led_gpio_table); simatic_leds_pdev = platform_device_register_resndata(NULL, "leds-gpio", PLATFORM_DEVID_NONE, NULL, 0, &simatic_ipc_gpio_leds_pdata, diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c index ca3647b751d5..1825ef21a86d 100644 --- a/drivers/platform/x86/simatic-ipc.c +++ b/drivers/platform/x86/simatic-ipc.c @@ -41,6 +41,7 @@ static struct { {SIMATIC_IPC_IPC127E, SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC227D, SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC227E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E}, + {SIMATIC_IPC_IPC227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC277E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E}, {SIMATIC_IPC_IPC427D, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E}, @@ -65,7 +66,8 @@ static int register_platform_devices(u32 station_id) } if (ledmode != SIMATIC_IPC_DEVICE_NONE) { - if (ledmode == SIMATIC_IPC_DEVICE_127E) + if (ledmode == SIMATIC_IPC_DEVICE_127E || + ledmode == SIMATIC_IPC_DEVICE_227G) pdevname = KBUILD_MODNAME "_leds_gpio"; platform_data.devmode = ledmode; ipc_led_platform_device = diff --git a/include/linux/platform_data/x86/simatic-ipc-base.h b/include/linux/platform_data/x86/simatic-ipc-base.h index 39fefd48cf4d..57d6a10dfc9e 100644 --- a/include/linux/platform_data/x86/simatic-ipc-base.h +++ b/include/linux/platform_data/x86/simatic-ipc-base.h @@ -19,6 +19,7 @@ #define SIMATIC_IPC_DEVICE_427E 2 #define SIMATIC_IPC_DEVICE_127E 3 #define SIMATIC_IPC_DEVICE_227E 4 +#define SIMATIC_IPC_DEVICE_227G 5 struct simatic_ipc_platform { u8 devmode; diff --git a/include/linux/platform_data/x86/simatic-ipc.h b/include/linux/platform_data/x86/simatic-ipc.h index f3b76b39776b..7a2e79f3be0b 100644 --- a/include/linux/platform_data/x86/simatic-ipc.h +++ b/include/linux/platform_data/x86/simatic-ipc.h @@ -31,6 +31,7 @@ enum simatic_ipc_station_ids { SIMATIC_IPC_IPC427E = 0x00000A01, SIMATIC_IPC_IPC477E = 0x00000A02, SIMATIC_IPC_IPC127E = 0x00000D01, + SIMATIC_IPC_IPC227G = 0x00000F01, }; static inline u32 simatic_ipc_get_station_id(u8 *data, int max_len) From patchwork Thu Aug 25 10:44:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600114 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE7EC64991 for ; Thu, 25 Aug 2022 10:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241257AbiHYKph (ORCPT ); Thu, 25 Aug 2022 06:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241203AbiHYKp0 (ORCPT ); Thu, 25 Aug 2022 06:45:26 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60063.outbound.protection.outlook.com [40.107.6.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F85A5708; Thu, 25 Aug 2022 03:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/iBEOLS8YecCagT8MudD0vUcUt1GaJaWTKd/vvky2DRvJ+ooUffELoNdNMBhx29OUeWE53oqzMvuZx2Qwep8y9c8OUcaltiIgSjSa9jB4EcD31pZfJuhQJ3ymV/Swj3gIoEURTdAuLbc65RAjehznjiaNPfJaH6jdNaApU58uxg+qSlEoDINfWvm+tdipWLbdHbl0IYBdzA0tnxIiT/DQh3YnNd78DPHaL3647Cdq5cgOdOwEWeqxeVtfAx9favSdyupFuNt3Qh/2N/SxI/aOrbBMUzUA7+KgoqJYG/jHPrkOH1vVUeiITweJUcgpcuwWIjn8NSrpqL5xD3K785gQ== 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=h/r+FQX2eliYY+NZbS2M+ZUIIXNF73vRJLxYe4sDdtk=; b=ReFWGAFTPK7c08qJ1Oi1hK/63GPU5D/VV9zU0/biKv+399kEEPZYTW0tNL4UGmLZjdQs+7LSag3njBgBdJ6Q3z5Pejm/5shAIwGg4vQ/jpgMi9RQyOs6dVEtge/a+P+HxxOe9TzbrogN8atDGMSiMlzPYiOJAg6QSMGK67RfChADAYO82CzYrp6P/lFkqYPlfw4AZZmKUY0L4DbMJ6nCcYzl/C5i1qgdVcy/hPmiQK5qyrtgbYuG5OEUsXUGx7HgYzE9tI+VkCLsfiedVXxzRDf32gE3e4vyjzij2EwuOLS7OpjkzeO28ZDsmXgx45/pkqVsngXxyezZGQsIny4GZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.75) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h/r+FQX2eliYY+NZbS2M+ZUIIXNF73vRJLxYe4sDdtk=; b=XyhFT4i071GQj9DHK9Am1oLXI7ZaGpBXkeMFEfC9aznguX7FIIc0OpM2zI4DdYCeDXX9hWXmEfCZZcwgc/fmFooSZwIFHIhAr2mlsohzAdf+qyItK7ymwUV00pHG7NhSl0xeQwwR+Lj3fYS8luroX+rBWoNhUL70XI/tmBZm2q1xz0sw/+sc5rQ2Y9XCFvIYyic8BOUoClpEdK2SDuJVcJ8nLAXWNEwNktIL9yZvK8SgSHfI5/te6YQ0uLavvn38dwvrdD/9jRZo8gDtQdmPUQfjXY6WzE+lk/iwMJTXEf5s9niLFfd3y07QAymTt4V9HMTbgogaozZ/+ofkvmEQyw== Received: from AS8PR04CA0006.eurprd04.prod.outlook.com (2603:10a6:20b:310::11) by AM6PR10MB2648.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.19; Thu, 25 Aug 2022 10:45:06 +0000 Received: from VE1EUR01FT059.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:310:cafe::bb) by AS8PR04CA0006.outlook.office365.com (2603:10a6:20b:310::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:45:06 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.75) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.75 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.75; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.75) by VE1EUR01FT059.mail.protection.outlook.com (10.152.3.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:45:06 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC8VRA.ad011.siemens.net (194.138.21.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:56 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:56 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 6/7] platform/x86: simatic-ipc: enable watchdog for 227G Date: Thu, 25 Aug 2022 12:44:21 +0200 Message-ID: <20220825104422.14156-7-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c010fa7f-bc28-45ca-d98d-08da8686dfbd X-MS-TrafficTypeDiagnostic: AM6PR10MB2648:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mrnYKCAE7RD//IMW7UPwf8HgeiZ4X8WngwYhD7GcEu74kXur36ghDeqEa3OQFu7Q+WsP3R+hvpcp7sUISN7ud7Cqqn8dL6pan+9hE8x/8WACm54BDY9ADN0HsOdz33vn/FPx33vxa9TWtqT3OPBBrh6yo4raXpR432UGfCdLrbVz5UphDalYAvwiEH8S43DOU+f7ZMf04E4L1aOEcr3vkLgnmwZzUpYHRgVwK1dOs81pIxBcSAdiONChsGkmshR172IOEaZJ2DpPZJhXTa0uMi7eGTRtuwMIdtXH2oYzmOJk56plhFvWiIt6RHFFQBdVj0mlGbM/f3CsUlPid4YdtY0k6Eb5G3P/Qwuq4P5/bAs/ShghPZjg0CpfJdKSqFfknoNAOr8DIvDs4nUqFZG+yEubkMRm5sa3fJUMy6SBHBdva/TJ69Opi3bM77AmCloo3DvpjvdmFKTarAWepD6jr0QubhSGZSEuH5mFl7IXS5cOnJ6nUchssu3GYxqtTI0CIdy0LVrBjB5Q/g8tUQETHyU/yrbm3qEhyunm6IlqxZgX+P2M6kpjRob8R5z51lRXA/M8goqqxX57GEwx7W/JVZDgwRUpt0hDkFrfdNHuYhnK8FltyObS4v9p7vOmLq01rC3Qzgt0KUGrUnI/UI4jqOKZXrv0UxIw6xrg22doKryivqqxgzLQsjIcxEb5sXWdwRNCBfsMJgRGc4aZwIPueVDMEgm2uALxfficrWA+0Yjogdopwv7ypg4V91hDftWgwC8+VFC8RYDOt84IphtrIRQBjn6dHhjYy9KciuDOflOmXQ6VpTt6Mc7Ur7egqBzbOiENkN/qhzgo0nNR+Mps2enH87kg5UnFzhk71Ngoitk= X-Forefront-Antispam-Report: CIP:194.138.21.75; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(376002)(346002)(136003)(40470700004)(36840700001)(46966006)(83380400001)(2616005)(316002)(356005)(47076005)(16526019)(956004)(186003)(82960400001)(921005)(107886003)(336012)(1076003)(81166007)(36756003)(54906003)(110136005)(4326008)(86362001)(2906002)(41300700001)(6666004)(40460700003)(8936002)(478600001)(5660300002)(70586007)(8676002)(70206006)(82310400005)(40480700001)(82740400003)(36860700001)(26005)(44832011)(4744005)(7416002)(36900700001)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:45:06.3222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c010fa7f-bc28-45ca-d98d-08da8686dfbd X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.75]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT059.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR10MB2648 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Just load the watchdog module, after having identified that machine. That watchdog module does not have any autoloading support. Reviewed-by: Andy Shevchenko Signed-off-by: Henning Schild --- drivers/platform/x86/simatic-ipc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c index 1825ef21a86d..8dd686d1c9f1 100644 --- a/drivers/platform/x86/simatic-ipc.c +++ b/drivers/platform/x86/simatic-ipc.c @@ -96,6 +96,9 @@ static int register_platform_devices(u32 station_id) ipc_wdt_platform_device->name); } + if (station_id == SIMATIC_IPC_IPC227G) + request_module("w83627hf_wdt"); + if (ledmode == SIMATIC_IPC_DEVICE_NONE && wdtmode == SIMATIC_IPC_DEVICE_NONE) { pr_warn("unsupported IPC detected, station id=%08x\n", From patchwork Thu Aug 25 10:44:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 600453 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83D7BC28D13 for ; Thu, 25 Aug 2022 10:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241205AbiHYKpd (ORCPT ); Thu, 25 Aug 2022 06:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241265AbiHYKpU (ORCPT ); Thu, 25 Aug 2022 06:45:20 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2068.outbound.protection.outlook.com [40.107.22.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23ECA61DAC; Thu, 25 Aug 2022 03:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iP5nr/lfM6040qk3/8DfnAvRNOKygS4dmeuIlgaFPTZuBVIkM85DxvRIif1HAgVbk8HRN9UuFPpv4jS6+E4G6EJDgr3WyZjPNdQkxi+FTmnqkNLCUAus/PlxC5RJ6NUDArk2PDcl5XbAyGQor5UAj2Pq8JuWKS957tOGYrqPzlgEKju+5q8OzwcWbA5aiuqPXNrndruSOHhltaCaz9l2O4QrKiRnLYhVJEw+YqXDcpnwqw8WeZFXBXc90oKauCR9h4RGaDzZfIsWF0VZMuby+t0yFzgNQ2fH2ZjD2WKOqRhrOoWK8sAG5+WnXc3j4UBUj+cn6kt+yIIMkG/nHFtDbQ== 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=CoeqWO5jn+/1Y3EBaDcSz5dtAsOK/vG3RHWEKr4jE9U=; b=Qewlv3IahLhiY3O4pvhHyg1Crz5hG8idgRVZgKW3010A0tE2TfiV6BEjx8wZG1H5K2SPh65oTTYSzT1OGQWjvXDcmAx91jMkbfT+UuXQlz4L51FvigOjHyR/Gmj0RceePkzyc+2/oPaV85i5Sq12KUIZQRPY5z2os0u8/bknkV3Wy11WaTr912Oe/DuOV206FGaCsApeB0GE3uSoPR6q4nsU1erqDvJl6NtQxSpM4t9ACwVDItjZrQyuit8oEtxLP2HNdAcR59Nv1PL/qIp5rM18rYxdTkIsOJzRF0CvV21vJ0twQHpTRK/uaYw+Z+FnhIlx9A9eog8R9Hvv1pXz1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 194.138.21.74) smtp.rcpttodomain=linaro.org smtp.mailfrom=siemens.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CoeqWO5jn+/1Y3EBaDcSz5dtAsOK/vG3RHWEKr4jE9U=; b=ek2sm03decBl8no0wuwVy3QPrOjfd7Kj1/Fvp5O89plyWBOzVgcGKaYKiQLNShh+V0wfMM7MfHAvk8JMUKLWAuRZd3bnWTWXEF2tzckpAAV9h+Vl0TbKkssK4Z/YHadulEEGfMaTO1sH14v77MN+EvuSSdnlv6IGdRNHzHRrlLZPkfd/FjV0T6iwgkAgfUWBckgpkPHps6gUh7q7SvuBAF/3mRYXJXHgUm7yEn/rXVd4eDKNrSiKrTJxW/LkKrSL0EFk+O6UWwK3VRT86nlRCok3cjwqhGN3RuZQ8f1wzt0omgn1D2NjsDV0mYtt6KgLyAeOSOW7ItdvFfhxTeJO7Q== Received: from DB6PR0801CA0062.eurprd08.prod.outlook.com (2603:10a6:4:2b::30) by DU0PR10MB5386.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:328::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 10:44:57 +0000 Received: from DB5EUR01FT078.eop-EUR01.prod.protection.outlook.com (2603:10a6:4:2b:cafe::7f) by DB6PR0801CA0062.outlook.office365.com (2603:10a6:4:2b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14 via Frontend Transport; Thu, 25 Aug 2022 10:44:57 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 194.138.21.74) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=siemens.com; Received-SPF: Fail (protection.outlook.com: domain of siemens.com does not designate 194.138.21.74 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.74; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.74) by DB5EUR01FT078.mail.protection.outlook.com (10.152.5.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 10:44:57 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC8VQA.ad011.siemens.net (194.138.21.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 25 Aug 2022 12:44:56 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.0.80) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 25 Aug 2022 12:44:56 +0200 From: Henning Schild To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , , , , CC: Sheng-Yuan Huang , Tasanakorn Phaipool , , Henning Schild Subject: [PATCH v6 7/7] platform/x86: simatic-ipc: add new model 427G Date: Thu, 25 Aug 2022 12:44:22 +0200 Message-ID: <20220825104422.14156-8-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220825104422.14156-1-henning.schild@siemens.com> References: <20220825104422.14156-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.0.80] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5abc5d1c-0bd0-4dd6-1803-08da8686da6e X-MS-TrafficTypeDiagnostic: DU0PR10MB5386:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zXl2oPvr/K7P4qmKD+OxyyTOkZbi8qLKlol38RSKFeCCQF/toDWB9PdzJd89lImnpfbBhS+PihFryafi7aWYTHpUh041QsZpGmNwd3tTwykRBOU2Ar3Z96ZHXpN58/EVI7UEK1NlOUDJj7UGLQyg8rOkaKhV4ks2kDKBZv7tNHhdMuvcWZ4cdxNxOUTzb9h81O4THYN9/s9jFb7NFWMztFXD4pjETmFVQ/GBVYXPVyker4WTaHKQqolDDTCl7QvgS9tIs6NfK/ivhi8nxmv8KLfOrDt4HusMCTo/GGgW4kKR1F0Sg4ZdqZWBYvyyTjUlA3ip4vx5Q6w+wb9gfqtC6PLG7UffwJ7IpIJIQGwJ5XV9hXcaI2JRprbKL7HRS/B/nXzNy1oU9M/5ECKQ6UaGffAeCNPFmRZ5uVAdc2JfOTQvz9rgYvWUBKx1kLouez+VCjt3LO7Dxtg/695AOn9pNDPfHkxAckGETncHW7HekWs1EpKhoRYqz3MnNpk6YjY8313Aru5MwX0ue0VqBH9JIsxA8YQ/+fX45MNu0YBS08NEj1s3KAAaqbmi+Bc0ksLD4R87wz3PKZ+0w2ZZWO8bH7pW8Mwysfl6luXcEoRZzWv9EJwcQKDXVn15P8VHgg8wZFNL4Kc47egoBEoFhkn5AN13X9cpnrKslRvj5XQyI0X7kmKjF6t5+OZtX4QsH/EaTly6oDu7qOJ5WjwyQkv57wD6lYdnl3TlWiXAOo01uKwtpcBupsgKI3txcuzK5+NmUZpG0qZ7knplYnEweMsHyJci38hkfT1bmOa7SwySJJhdk1ffx06C2W753gFHcnM3XflwYh1fcyawPG1pfBDASw== X-Forefront-Antispam-Report: CIP:194.138.21.74; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:hybrid.siemens.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(396003)(346002)(39860400002)(46966006)(36840700001)(40470700004)(1076003)(6666004)(186003)(70206006)(8936002)(41300700001)(82310400005)(4326008)(8676002)(26005)(86362001)(70586007)(107886003)(36860700001)(16526019)(336012)(83380400001)(44832011)(316002)(47076005)(7416002)(2616005)(5660300002)(7596003)(36756003)(956004)(40480700001)(7636003)(478600001)(356005)(2906002)(82960400001)(110136005)(40460700003)(82740400003)(54906003)(921005)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 10:44:57.4109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5abc5d1c-0bd0-4dd6-1803-08da8686da6e X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.74]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT078.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR10MB5386 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This adds support for the Siemens Simatic IPC427G. A board which basically works like the 227G added in a previous patch. So all there is to do is to add the station_id and make it take all the 227G branches. Reviewed-by: Andy Shevchenko Signed-off-by: Henning Schild --- drivers/platform/x86/simatic-ipc.c | 11 +++++++---- include/linux/platform_data/x86/simatic-ipc.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c index 8dd686d1c9f1..ca76076fc706 100644 --- a/drivers/platform/x86/simatic-ipc.c +++ b/drivers/platform/x86/simatic-ipc.c @@ -41,11 +41,12 @@ static struct { {SIMATIC_IPC_IPC127E, SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC227D, SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC227E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E}, - {SIMATIC_IPC_IPC227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_NONE}, + {SIMATIC_IPC_IPC227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G}, {SIMATIC_IPC_IPC277E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E}, {SIMATIC_IPC_IPC427D, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E}, {SIMATIC_IPC_IPC477E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E}, + {SIMATIC_IPC_IPC427G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G}, }; static int register_platform_devices(u32 station_id) @@ -82,6 +83,11 @@ static int register_platform_devices(u32 station_id) ipc_led_platform_device->name); } + if (wdtmode == SIMATIC_IPC_DEVICE_227G) { + request_module("w83627hf_wdt"); + return 0; + } + if (wdtmode != SIMATIC_IPC_DEVICE_NONE) { platform_data.devmode = wdtmode; ipc_wdt_platform_device = @@ -96,9 +102,6 @@ static int register_platform_devices(u32 station_id) ipc_wdt_platform_device->name); } - if (station_id == SIMATIC_IPC_IPC227G) - request_module("w83627hf_wdt"); - if (ledmode == SIMATIC_IPC_DEVICE_NONE && wdtmode == SIMATIC_IPC_DEVICE_NONE) { pr_warn("unsupported IPC detected, station id=%08x\n", diff --git a/include/linux/platform_data/x86/simatic-ipc.h b/include/linux/platform_data/x86/simatic-ipc.h index 7a2e79f3be0b..632320ec8f08 100644 --- a/include/linux/platform_data/x86/simatic-ipc.h +++ b/include/linux/platform_data/x86/simatic-ipc.h @@ -32,6 +32,7 @@ enum simatic_ipc_station_ids { SIMATIC_IPC_IPC477E = 0x00000A02, SIMATIC_IPC_IPC127E = 0x00000D01, SIMATIC_IPC_IPC227G = 0x00000F01, + SIMATIC_IPC_IPC427G = 0x00001001, }; static inline u32 simatic_ipc_get_station_id(u8 *data, int max_len)