From patchwork Tue Aug 9 15:04:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 596329 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 6D12BC25B0E for ; Tue, 9 Aug 2022 15:05:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244764AbiHIPE7 (ORCPT ); Tue, 9 Aug 2022 11:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbiHIPE6 (ORCPT ); Tue, 9 Aug 2022 11:04:58 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80073.outbound.protection.outlook.com [40.107.8.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C4C1CB1A; Tue, 9 Aug 2022 08:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ogo3a4KhR/3v81sVkqnXXmIpowwuZCFYwqusFgmBPhld0SGLGk7KwGQDAtuApE6Kd2v//c1nbPoXGmJ83iAcIT5+1wPILZHtbcSF/p5C/HjOxaTVI3W5/vPaNWlt0lbM/YjdN7Z6KDDq7S3SOD/yHQZdaW2vHj88swfuJLcP/JPiBb27ZYFYLLFSnV/f73GBBfZfmLpPUq60Pf3fB3uYW52KpE+bfTumHHehNaKBKbZMO8Xtv5e89zSmhlliDIU9OhN3nzUN42UxB7ijoCfW5k3SqKlguP4Oyth9hBNFUYC9pfH09qEkH+UWcbCOFxYNNui6IlU8xWuaej5tlu1f8w== 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=lzaUqQmeVJ2hp83ZBWKmMFLkduKzEfxPNWugpUX9nNQ=; b=aydF0L4dVxMyYpUigkg7lDTHTv8toZvG87x39gtBU2rpgdxpAGq1mzUpoU2KHZbDxgterAKz/8ykHDNR7EGgymxKrmkuXPYG9bdFWXphMocdih00Voi98MAMGwzaPZgV/X/0r3/L2LJdaaNP8YRok0+M1dCw1N1eQ/C4zcua7XIaXSFmn+KA+uGjY7yhqd5Es1t71KlRvnbu0L8OxFOYKG+latEA4TRe+f+Rp6JCQMbQGQqdCNmEa7ox7r5O2nLS1Clpu5feZQD53Q+LBbFujUyieP+1AWcVBgZ+GPdzIY29M4D/Vm4QdXLFY5OIPF9Ool3AjHOsXiZQGXvsHNNn8A== 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=lzaUqQmeVJ2hp83ZBWKmMFLkduKzEfxPNWugpUX9nNQ=; b=stEM43mdzUBSADVmun5SeJ5Amryyt4I4xO4MZpZ2tGsUz4+Wn5J/kZgJCM3fGB9Lnm6is7zVG6+/D63lJ10GxjyU886JwljXnNDYmzz7OJRmAYOhLWhAxadqbx0sgkTrPJrexHrMzB3wLJD0gz3CX7hE9NxXtCPIhygLddlQxS3eADiHvcfur89mZzF/+34JXmSBCnFCNH+2z02DueOwPRkR0J0L+hSrBbIZWZ2oLW9FFenRAWL0aJuCAeivlFU2Y7fuj3y+wBjfdmtU/9eRTLKLSVvLzDDt80qwri52JHxJqG7YYTiyTTIBrgwguEa3vRF4+Zye8ODU3TQwmRNpog== Received: from DB8PR09CA0012.eurprd09.prod.outlook.com (2603:10a6:10:a0::25) by VI1PR10MB1807.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:802:36::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.15; Tue, 9 Aug 2022 15:04:53 +0000 Received: from DB5EUR01FT026.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:a0:cafe::1a) by DB8PR09CA0012.outlook.office365.com (2603:10a6:10:a0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:04:53 +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 DB5EUR01FT026.mail.protection.outlook.com (10.152.5.2) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:04:53 +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; Tue, 9 Aug 2022 17:04:52 +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; Tue, 9 Aug 2022 17:04:52 +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 v2 1/4] gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Date: Tue, 9 Aug 2022 17:04:39 +0200 Message-ID: <20220809150442.3525-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220809150442.3525-1-henning.schild@siemens.com> References: <20220809150442.3525-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.964100-8.000000 X-TMASE-MatchedRID: h70/C8ZQwy0najXSbZssErN5pka0DGqI47cLULZlxOVkGI+vgRTxME+c rEA4+nhZEmx/CUhRV0GhAqHLqD5GgW7iQTMjrcXyajaAHeKHIftiWV0DQ85LUrcPsR57JkIzSWg +u4ir2NPvmUrJba0cpHoHefDWzW72szhj7g02MR5Xt0iLVmIq+oEBch0HhZyDfzgVmnL/olWMQf Yi97TPS1VkJxysad/IRlSqJpn6jycKXI0GFROfCKWyTAyGeJuv/63r0U2g4cfCtSG/SQAC8bWTd tEh1dU0GlfXMQvierexCOv1qt1aOU+UviNdiXF3EtRm78gcrDGioinUBRkHmltTO+xodboGwRdj nTeqAAGbKItl61J/yZ+inTK0bC9eKrauXd3MZDWiZ3sWC9weZNJlJOoUXGozevzTvFcXhxjxz8N bCt5u+cNnCC/0tBlI X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.964100-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 980C58D8C0F0454EDC62F5EB960A0204CE12F51CB223AC75E6EA1B25C19196C62000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8692a1d-0c79-47e9-a6a1-08da7a1883f1 X-MS-TrafficTypeDiagnostic: VI1PR10MB1807:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uZ96ykE7bkvbn7mvaXIxEv4mPqxn1szQLSC83znwV0hOtmYoHQs4BPI71tGXtRyEf/drXV/603bAiIDBcxQxvatI2+UXvfX1gdOfIXrv9YgqdXrNpxGAeB382pH9i6iFZFbT/9vEU+SOqz7y3wvx8OrWflMdjQ9FMtAsEoT6r7qLOSQ90Fcgxx7RB8yzoIx6MEbomVUlcSrP09WS+WRpt30gtEQ969max4lUgXuiZXjgJv6IDqbU4ePNntFEE1/5NbtcNBHFmgHSizZWc7eZ65uyH81g7uor5RjK8SJBUkvED7bgt4lt/BrE4wbd2zYFtzXKQQk/KnitL7+GFGh92yvbChqTi17iddWKOSjZ2M24xRCiOIK8/sCQC/vnBqQ2Zru0Yn+nOtDErYAyCOCQGPDim8mOmrBG9+Atc9rhlpYGGd8SYc3tmSoeYX1+ZVxR5mNByLmwmg92eP8ta1iDNHO1+YI+eap8kgb4jjp6FUOAi/tzURIxDs/pEO7hXmYaY9kJPSZXL20AXDeHoPi3BERdg/zfwxUopGDDzE7gPbZdFpCDUk6z7iyAQ68gUGtLvt8YyLxL5H14xmo+KeCQXTj7atyEeG95j3HNvMbKQkGOILTSGQvXBVm3JXSqN5LMav6s1p/Z94ZU5W2cIee0xnveafLwKYcotKG/AQ6p+FHXCTQ/CAoHA6PZPFWl3yTxMAMGlN0gUh9wskixtfD7BCH3hmGELTm14TRPExgiGUiNxIf6UQGZFPgZGgTbA8rE1LM8CcqaghIXaOqFY5d1x/MmPw2AP06EPL4LORt6AfHYDdfZv4deA4O9EXRbTA+6SzwkW2GGbGl8aNS7L1d2YkiYm/lExOLRicie1ahlW8rDOansLAGzm4TVi4BCM7eFFz/ybj1jwa4blpYx4uiPe8ZFCyFWrILmZCoWkBYpq1inpCICeaoWlT8f1tWtF1p9 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)(39860400002)(376002)(136003)(46966006)(40470700004)(36840700001)(82740400003)(4326008)(7416002)(70206006)(70586007)(36860700001)(54906003)(8936002)(82310400005)(5660300002)(8676002)(186003)(316002)(44832011)(478600001)(110136005)(36756003)(956004)(107886003)(2616005)(47076005)(26005)(2906002)(41300700001)(336012)(6666004)(921005)(356005)(1076003)(16526019)(81166007)(83380400001)(82960400001)(86362001)(40480700001)(40460700003)(2101003)(36900700001)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2022 15:04:53.7177 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8692a1d-0c79-47e9-a6a1-08da7a1883f1 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: DB5EUR01FT026.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB1807 Precedence: bulk List-ID: X-Mailing-List: linux-leds@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. Signed-off-by: Henning Schild --- drivers/gpio/gpio-f7188x.c | 70 +++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index 18a3147f5a42..4d8f38bc3b45 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * GPIO driver for Fintek Super-I/O F71869, F71869A, F71882, F71889 and F81866 + * and Nuvoton Super-I/O NCT6116D * * Copyright (C) 2010-2013 LaCie * @@ -22,13 +23,11 @@ #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 */ +#define SIO_LD_GPIO_FINTEK 0x06 /* GPIO logical device */ #define SIO_F71869_ID 0x0814 /* F71869 chipset ID */ #define SIO_F71869A_ID 0x1007 /* F71869A chipset ID */ #define SIO_F71882_ID 0x0541 /* F71882 chipset ID */ @@ -38,6 +37,8 @@ #define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */ #define SIO_F81865_ID 0x0704 /* F81865 chipset ID */ +#define SIO_LD_GPIO_NUVOTON 0x07 /* GPIO logical device */ +#define SIO_NCT6116D_ID 0xD283 /* NCT6116D chipset ID */ enum chips { f71869, @@ -48,6 +49,7 @@ enum chips { f81866, f81804, f81865, + nct6116d, }; static const char * const f7188x_names[] = { @@ -59,10 +61,12 @@ static const char * const f7188x_names[] = { "f81866", "f81804", "f81865", + "nct6116d", }; struct f7188x_sio { int addr; + int device; enum chips type; }; @@ -170,6 +174,9 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, /* Output mode register (0:open drain 1:push-pull). */ #define gpio_out_mode(base) (base + 3) +#define gpio_needs_invert(device) ((device) != SIO_LD_GPIO_FINTEK) +#define gpio_single_data(device) ((device) != SIO_LD_GPIO_FINTEK) + static struct f7188x_gpio_bank f71869_gpio_bank[] = { F7188X_GPIO_BANK(0, 6, 0xF0), F7188X_GPIO_BANK(10, 8, 0xE0), @@ -254,6 +261,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; @@ -264,13 +282,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, gpio_dir(bank->regbase)); superio_exit(sio->addr); - if (dir & 1 << offset) + if (gpio_needs_invert(sio->device)) + dir = ~dir; + + if (dir & BIT(offset)) return GPIO_LINE_DIRECTION_OUT; return GPIO_LINE_DIRECTION_IN; @@ -286,10 +307,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, gpio_dir(bank->regbase)); - dir &= ~BIT(offset); + + if (gpio_needs_invert(sio->device)) + dir |= BIT(offset); + else + dir &= ~BIT(offset); superio_outb(sio->addr, gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -307,11 +332,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, gpio_dir(bank->regbase)); dir = !!(dir & BIT(offset)); - if (dir) + if (gpio_single_data(sio->device) || dir) data = superio_inb(sio->addr, gpio_data_out(bank->regbase)); else data = superio_inb(sio->addr, gpio_data_in(bank->regbase)); @@ -332,7 +357,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, gpio_data_out(bank->regbase)); if (value) @@ -342,7 +367,10 @@ static int f7188x_gpio_direction_out(struct gpio_chip *chip, superio_outb(sio->addr, gpio_data_out(bank->regbase), data_out); dir = superio_inb(sio->addr, gpio_dir(bank->regbase)); - dir |= BIT(offset); + if (gpio_needs_invert(sio->device)) + dir &= ~BIT(offset); + else + dir |= BIT(offset); superio_outb(sio->addr, gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -360,7 +388,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, gpio_data_out(bank->regbase)); if (value) @@ -388,7 +416,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, gpio_out_mode(bank->regbase)); if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN) @@ -449,6 +477,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; } @@ -485,12 +517,8 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio) return err; 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); - goto err; - } + sio->device = SIO_LD_GPIO_FINTEK; devid = superio_inw(addr, SIO_DEVID); switch (devid) { case SIO_F71869_ID: @@ -517,8 +545,12 @@ 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(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid); + pr_info(DRVNAME ": Unsupported device 0x%04x\n", devid); goto err; } sio->addr = addr; From patchwork Tue Aug 9 15:04:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 596582 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 8E04CC282E7 for ; Tue, 9 Aug 2022 15:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244774AbiHIPFA (ORCPT ); Tue, 9 Aug 2022 11:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244754AbiHIPE6 (ORCPT ); Tue, 9 Aug 2022 11:04:58 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A6BF1CB16; Tue, 9 Aug 2022 08:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c2zh9MFHJRuxFczCiinjUFHfbUAhLoc2OqZvFJ5WRKbBc5JKTcLwFk0jCBrvM8Cj7diOYNcWsNUDcTfL56cLkXEGnxj8ayHflM6TVFblt/YcajkGdxYYCprpqRNtZzCqs8EGjRT1TVSrcMoYjoFMZIweOTO92ohdgSx9yITCLXxf3PInqaIHohyHwtqWKIL6tSxVw5JJ84Pv/ePNuFJIsfyAHbYM7Ua+vdH6qnupjvMD8oSHDbmhNXFV1c9E8Mo3Z+cGoNiJWHi4ScyFRn7M/9bHZVcBMT+5iEwtv4K/+adHOJKFwcCgrVhFrKnerQ5cQ0MHby0x9ozz2CgKc5Fitw== 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=LLMRvvDyETTQ+5CgSsja2XcFDam5k1b+ywDOp2ANl+w=; b=HHV69gNYHc8kD03MQmST3zZYidsN1/l7L9QVJ+fi9gfb34YZm1y2aZMfNcptlKg/Kfe+AV10BRN90NwujZNQGlx13fNJIbL31Czu69t7018aNO2TRWvAOw41xvKQaBK7UvK6fZWhp9Qokx6QlrJw0p4oHuXW6lZ6ZwSqh3x/F3OHGI7uPHQeZAScjTn5xl4WyX9Q4OAzydOYEPL1zWAfO2fMX4BYEDtKEMzbSkGcXsUPrRR9nL1MMN5yZFNbmegczclfoZqz1QREO817QKuEjHRWhJ1jCpgupIT/h3c6dBf708wrDhpfSaajJEnEOExh7d7yAbhPhj0CfdSCG2/sgQ== 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=LLMRvvDyETTQ+5CgSsja2XcFDam5k1b+ywDOp2ANl+w=; b=Vp8BE8/prvmjntCV1XJV6fN1cuVArpQj0vjeEEq/kJZvhvkbSe5VlXE/Xi2zhRAwSEa3ECpnasgoCY5XeQ/TecoIdvU8EMTV0cjpue5eK5u9bQfJxHCuNpKzXqAX3IOoBYPH7rSBQx46demxeeNUx0r8eatPXUGIhbaus6dQ0M/9s5WvQvrglQteuvRbzmlPM66EZN3aa7STCQLGteYk8gxDMIeKuaHQRmobqlDxOe+zeEjn3JlKPunca7XWEz0iKSIm3fBI+APsTQLabHj0gitseA4RD51Cp2gi+K6SPSQ0rIx8xXwdXjAKHSiIiD2SjUcP9mM/S1yjI7VIaWQ6xw== Received: from DB8PR09CA0026.eurprd09.prod.outlook.com (2603:10a6:10:a0::39) by VI1PR1001MB1150.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:6d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Tue, 9 Aug 2022 15:04:54 +0000 Received: from DB5EUR01FT026.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:a0:cafe::ee) by DB8PR09CA0026.outlook.office365.com (2603:10a6:10:a0::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:04:54 +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 DB5EUR01FT026.mail.protection.outlook.com (10.152.5.2) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:04:54 +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; Tue, 9 Aug 2022 17:04:53 +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; Tue, 9 Aug 2022 17:04:52 +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 v2 2/4] gpio-f7188x: use unique labels for banks/chips Date: Tue, 9 Aug 2022 17:04:40 +0200 Message-ID: <20220809150442.3525-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220809150442.3525-1-henning.schild@siemens.com> References: <20220809150442.3525-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--9.460600-8.000000 X-TMASE-MatchedRID: 7+tntXNf1S0rdWdGoKfUymdUGQPHutoBzECLGgnCzVgD2WXLXdz+Adi5 W7Rf+s6QPILl10bYlyBzWECVCpPY5j8lZObuvExhu5R9yM464AtF28kU6TjvF54CIKY/Hg3AGdQ nQSTrKGPEQdG7H66TyH4gKq42LRYkuPDdukQ9meg9Muj0X0hwMWSIABmEnaseiNYXiX2Y249+3B ndfXUhXQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.460600-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: FB0D2771DC3B2AD8B77081001B894EA30722043B857051C115D458ABE931075C2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e883a30-1e42-444d-3d28-08da7a18846b X-MS-TrafficTypeDiagnostic: VI1PR1001MB1150:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k3SzRB2cBX6COLU4mKEq1CE65Zl2LW83iqSHPTpEX9CcTYpCj/fS8b7vIqDqMZOX6g8G/Ppba5bREBZEjcOceBYZR78x64JK5bXqJ8fyrf9IPcIKCwsBMJHmmiFeeHQSjwsDnxmzqr48FX0kDCleUat6rlc9Qfa76JcFsEO+cwFt6hn0ABdPCpPrgaGRjHzisKl9IuUZlN1BMlBz6HzzgEb+9l8SlmIunXyrf0yG4nQD4kyuNT02aD7s5PaApCaCS1el+NIEY15AoXP8aFopGknbmTZjPNlTmDPGc7NcuPUNQ9KwO8fW0syURmFJlyRODuXeYHcqjV+fkQMLMpsd0lONDKwdpXiFjbvo4evbK6WiAbEMETWU4NaS5IXlqh1tyeFjkhY60PJfvkLcUJRXZKqOMH2ncNIq/afUJXPUD6L79b1EU8Hx2/ckHMh2yVh6o3zoYYk45Ygx7kgNTW/07pa/IjRULXOTsJL7RDEbqLA1VhUEOCA0UIGMHqmQB/Do98cLfBWlk3EK9+ovejYjFi3tVHd5UY+aZVtR6CCLxZ/jtM7djazVZEDxEyl9pA8LNxnCdry7j9rTXe45WYwGGdkbfDpES+VVNpvhjDAWSsHixHrb0kp0i1rDewP2cgeaoLxX+yYUCsSjHuFP+NXCokopGJkactjSBJ3R6Jk6GR7s5s/uV53vo5IDl2l9arQlmatRNz5bKH/KrAKNBi71C5SPzPmMk1sl3ilECQvQIwfPR25S0BaEGCsJaHcHTnqhFuKJ532/Wex11BZpHecYiX5jr0SF/KhEiS4h8BEzW6cXiYRMRgSLMDiMHH6uUF4yTnsyTuLUhsPKqB7goRTdgw/618ft3zicp+SD4U2SmF14Eu9sXLlKnWZT6/sV+SrtQ1O0nviqZpU2HOKILB4t5g== 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)(136003)(346002)(39860400002)(376002)(36840700001)(46966006)(40470700004)(110136005)(54906003)(316002)(83380400001)(36756003)(82740400003)(82960400001)(921005)(356005)(16526019)(47076005)(336012)(40460700003)(186003)(81166007)(40480700001)(4326008)(8676002)(41300700001)(956004)(70206006)(70586007)(86362001)(2616005)(107886003)(36860700001)(6666004)(44832011)(5660300002)(1076003)(82310400005)(26005)(478600001)(2906002)(8936002)(7416002)(36900700001)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2022 15:04:54.5145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e883a30-1e42-444d-3d28-08da7a18846b 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: DB5EUR01FT026.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR1001MB1150 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org So that drivers building on top can find those pins with GPIO_LOOKUP helpers. Signed-off-by: Henning Schild Acked-by: Simon Guinot --- 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 4d8f38bc3b45..9c91832b8c71 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -150,10 +150,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, \ @@ -178,98 +178,98 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, #define gpio_single_data(device) ((device) != SIO_LD_GPIO_FINTEK) 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 Tue Aug 9 15:04:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 596581 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 E3450C19F2D for ; Tue, 9 Aug 2022 15:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243123AbiHIPFa (ORCPT ); Tue, 9 Aug 2022 11:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244818AbiHIPFO (ORCPT ); Tue, 9 Aug 2022 11:05:14 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140078.outbound.protection.outlook.com [40.107.14.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C085E1EAFC; Tue, 9 Aug 2022 08:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jGn4rnGhv965x4bzaft1WK8l/M2j1CTRj8HD+urgYr38BHkQeIMtwnfHa/5LEm+horGxuDA1J1L7Y8rusxpCGTFZOROjDzYOP3KjZv+nUT9s2Sv1Z2R6/AfGZxPoQCuy71IznyLSXW8cHmUDZ/vH2C7QdD/kWAEJ4c/gZfHE2aB7Quwl8kKCuAz1rWl9MCqzk2HZ1AodT825YaeG5Lw9o4eSU2WTSd2VlmmUzhTVUtK6MSEQpNcWbTJh5DMTlIWEt94EoZriSOspiDMKgwQtAo1ZQLTdOLa+Hldw4dg5dO85HOtvQk9iIgLKk7fX9pCI7ok387pYHUQqo3b2ceBvWQ== 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=fra4t7k5jfZkDA4RoMRNACiaCeB1EAzVqt+GvK6XdEE=; b=kPiYsMMD0JM8rB6BHODoizn2VwKTMPKRE0cgAG9m6i1OkjOP754Bidhz+VTgqzk0SKhC+Qj12M8XP+IAoEirQOK1mDd2kaTDi7zisnnV+UbZgyD1JiV6U4EP2Vj/jW5hFlj8R/pf4JuDztkyKpAXQPp0Cy4+AV4O3j9qYSpODb5yQhmXaC23lxAZZ1CgJqs/bUzieUh56crn82HWW8oq9FPuSDEWxpc2zT4HKeNdgvJJ20fwzsODEWtkLU70EyNzG+HyzeZGzjstCm3Y2ldYmgza0P3FR2XMOi1o5obZF8/aLTKaaMmkFtAGQsRqHXnzOlFf2Ff4j4+5kZjUT9F4NA== 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=fra4t7k5jfZkDA4RoMRNACiaCeB1EAzVqt+GvK6XdEE=; b=bOc/kJKLMopi/i5SOiRaAlDa8XS0G9lU/OHGyZmYDktF86QtAxTTOes3O2nTi6rRcESLeXErbYiRun5nZPHUf2darDiRBUJZI6t/gJO4NDlQxUQQwqUoC3UDdgeDzDQT6kcPjp/PoUr5GnmhYqE5OQ8BWcP8wVQmJhhZtCFkR2ykOg2JibayUft+U/TvcPBXIDfpT/0VC/B/5N5kLvlXsSMbyIyHNswBI/TvsuC1/85f60jyCbqfI7wpty+jsKQgJWC5A9zVqB0eQCFM5cEokJ33+eulX4qQs6t6FxEk8P1ug4PmEj8QcWfZkxSopzU+HhmIwHPJ/0gCwh6vn+tsvQ== Received: from AM6P195CA0066.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::43) by VI1PR10MB3984.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:13d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.10; Tue, 9 Aug 2022 15:05:05 +0000 Received: from VE1EUR01FT090.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:87:cafe::b) by AM6P195CA0066.outlook.office365.com (2603:10a6:209:87::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Tue, 9 Aug 2022 15:05:05 +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 VE1EUR01FT090.mail.protection.outlook.com (10.152.3.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:05:04 +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; Tue, 9 Aug 2022 17:05:04 +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; Tue, 9 Aug 2022 17:05:03 +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 v2 3/4] leds: simatic-ipc-leds-gpio: add new model 227G Date: Tue, 9 Aug 2022 17:04:41 +0200 Message-ID: <20220809150442.3525-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220809150442.3525-1-henning.schild@siemens.com> References: <20220809150442.3525-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.051300-8.000000 X-TMASE-MatchedRID: PhhAXV/E8uDFiWpUiGitMXibxqQL9M5Vn9v8HoDZ0FGJUlmL3Uj0mFF5 adRR2Ej1Yy6fApvL8BePKVzaGaT8FjSZ7fU1v8cGIdEenw1YMGhRhHeTkgZm5j8Ckw9b/GFeTFQ nI+epPIZVZCccrGnfyBUCx/X5xkUnnMbutg9GaHV4CMgAuim1qLUi+RdXr/ZOqhcdnP91eXFrTW aGefu3pAQsw9A3PIlL+ifST869BXUz6mn1o9MiYCq75Q09Yd+O8om7UDiAlrnHmyDJSEsI230tC KdnhB589yM15V5aWpj6C0ePs7A07V9vMTaVNFNzhnCXbGOPTDtfxTIYE/WOxju1gO3/3AiO6oOS 5rp+aqM= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.051300-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 8B5484228CE86B8F61FBD7E031EBFA6C6DCF3488D0C20E725FC9DA9CE4B9562C2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66cd6e45-61c6-421d-5ead-08da7a188a7a X-MS-TrafficTypeDiagnostic: VI1PR10MB3984:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GwXmVlTW7z8Bf/vYnpRlyX/LspIYT9fpmytrmpzmMEKIsY6vb4CmNw7iwk+8q0SWkRhY5LhJMSBU+lHKmyq4uDdL3nbpzo5r+Vfjb5uIqC73jqyZo04OTVhuVkr1CIhACkZwe8ZbggeBBy0i3G8qIb8A6QkT1p52eZR9S8bFuCUxf0+dV0kHYk77Y8z3Uavqq3P9Sw4NpNnDVQPZ2QJ712IIG7ng+KU4aExWK9SIYkRvsLJamp1luYJ0+BHf1WxJU1nFKOEMNj+TV8eRNFKxLZCrqcGDVS+e3bFimEkUlaX4U7pQaXtYsZxk7A7pPLRUd307+u0b0JRKQIWPQqYdmN9lRxxn2f9JbJooY6wp1x7YTX77a1UveVgiSjBShjx3daJ22hbHzWA+mMHlN/jVRgq483THBu7KcQLWjIO78sOLnxFQyLvFC8fdrfYpmmTyQQt/rvbt560uVR1VotTdXyiKCZaXHniqKAV/IbV0WahGjvtP3cL0tj2Oq40MaBaN/YetNEqTRmageEtdrqCbIdiiFIh7swy6D7fTn5iNTU/EIAooefgHhz/JLzpPxrYQjVGrqiWXAcbJ5zzdBr+USsOKVSws+RajCTgrb3K/T6V1o0YaMXVVgzh26bGnwsAUX/Xbm62lauBUecxS7oOUA4H6aiOsPvIcq+X+AvtnyLLJMN3tCLJm/RZFEVO9Z2jXcX4ut+CG7Fbp3CCy5nYxYS2mDwHPpJuOMzhe8GS2NzA7pOHgTqhiGa/ipXtv7mkXoS9FD/1j1XCmHaj6JkZqZhykSbH+UvtKc6YBHD+KyndLPz35saFHteGw+xs5K1a1cCbbsAQMCQRe+clqoT98r8RZpHu061C7YQPytrYlW9iGMFXK1z/FaWA/mmT8YhcQ+c0e8tzsvGDof8AyoLIpTA== 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)(346002)(39860400002)(376002)(136003)(396003)(46966006)(40470700004)(36840700001)(316002)(54906003)(110136005)(41300700001)(478600001)(2906002)(40460700003)(82310400005)(40480700001)(70586007)(4326008)(8676002)(7416002)(44832011)(70206006)(5660300002)(8936002)(82740400003)(36860700001)(36756003)(86362001)(81166007)(16526019)(107886003)(82960400001)(356005)(921005)(1076003)(2616005)(956004)(186003)(336012)(47076005)(26005)(6666004)(83380400001)(2101003)(36900700001)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2022 15:05:04.6800 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66cd6e45-61c6-421d-5ead-08da7a188a7a 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: VE1EUR01FT090.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB3984 Precedence: bulk List-ID: X-Mailing-List: linux-leds@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. 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 Tue Aug 9 15:04:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 596328 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 AA906C25B0C for ; Tue, 9 Aug 2022 15:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244840AbiHIPF1 (ORCPT ); Tue, 9 Aug 2022 11:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244816AbiHIPFO (ORCPT ); Tue, 9 Aug 2022 11:05:14 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2063.outbound.protection.outlook.com [40.107.104.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A23551EADE; Tue, 9 Aug 2022 08:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UEQeidl3EQa6zlxaKs/w3ZzYeSIqdvJnb9FaJZs93J4VaZZregJQ7Mun5WneTVES+ulciGkInLqaj4bKjRMuSKIvUEZluTUlnUZCJL/jO76GkjcQOI6Pu1BfWtYreIQJ2OBHFCv6id/opro9SasZzdAiKf/lf9RO8J7FkE/PuH2i1v7Mc4JdQzTJaB9OrB5tUVcbWglGqvXaOpk4qsSXNbb6Vq4a4hu8Z1LUmrfn1Zg9R2OTHZ3zGXU4NrrvKF+QgE+jD8gIl/u0i3m6ehV9ci1IP7ViCczKeXiu0iGxTiaZga2OnsNSMRjL8cvBQNdpPN2sYFoMiFbVzWcXXHL/9g== 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=Q/SIkLdlwCfAKaSHnpyBQjoFHswi4PZziFDzWcXh9Yo=; b=YxPo0DWEirbdMG03/cnsFC01lrRLTeh/L3AlayL69kC6theclY73Y6lq6nDGnDoB8+U4WVQTRFWjA43IuGrORmboiSyVsXTuJnPY0gj+csUos+PxXHgs7JWMzQUqLcxmgBGoSqqe0uQpINSncZzBRnFirTWsUExqA1y7S6xViayoBleT6QqNYFJQt4i/1liL2aJ1FoUnN3NOJFINwdSIoT/2SGsIM1iwgmvM3NS75CJrc50b/odpOJfMAq4nD7e4UGIycTcW2HvahsG6VexKR5yF4TotixJYtLUKZZm/m4DKL2c+7toNq9iWqsfbqkqNOOOKSrZsKylJFiwwrSJqhw== 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=Q/SIkLdlwCfAKaSHnpyBQjoFHswi4PZziFDzWcXh9Yo=; b=hGEgXxUIF31q/8C3QcF+0a3AKljUexBrUZnL0xvonMHJDfLNg/cOhiWnebmJn/cb8YioI4DdcLUbh2Ukn4L0teBgXyrYaSHCiChfg+AwARK0AVgRO4GfbdcEYoTpgtiGnztQzVwQWc4nMIOsTl4afXpH0GXEf6ynEa0tcp8ly9BcuF45NOWSRilr/Lx0GJLY7EnLSfam7XkevMAUFviO3nC42fBNOkxoBK6aR3Vah0sFAl0YQtDv/NAB31GN3M15n09HspAcCQhlR8swrX5sabP0EJ41WKBxOzO615n7+E0d8aVPKTThxEjl6n7FuISTtdiPfF/okYXdj4AbnQHnJw== Received: from AM6P195CA0051.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::28) by DB8PR10MB3483.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:142::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Tue, 9 Aug 2022 15:05:05 +0000 Received: from VE1EUR01FT090.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:87:cafe::5f) by AM6P195CA0051.outlook.office365.com (2603:10a6:209:87::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Tue, 9 Aug 2022 15:05:05 +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 VE1EUR01FT090.mail.protection.outlook.com (10.152.3.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 15:05:05 +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; Tue, 9 Aug 2022 17:05:04 +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; Tue, 9 Aug 2022 17:05:04 +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 v2 4/4] platform/x86: simatic-ipc: enable watchdog for 227G Date: Tue, 9 Aug 2022 17:04:42 +0200 Message-ID: <20220809150442.3525-5-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220809150442.3525-1-henning.schild@siemens.com> References: <20220809150442.3525-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.447500-8.000000 X-TMASE-MatchedRID: L90KqhDWgfOUYAP3WXIsZ3Cm15xQGrnE2mwVXKpQ3BdHg88w74mNDktc 8DbogbSE31GU/N5W5BDT/pFzauZLmXEK4P8QtiVHs3gZaLIY9no/aaS8hrB/2J4CIKY/Hg3AaZG o0EeYG97Gr09tQ7Cw/1BIVsvVu9ABIAcCikR3vq9vibMxAqYXjWHFPUyW8t4AX3DcTx0UaPNCEh brM/bogi6eQ3HQcWnw X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.447500-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: A4D83ADDEC2F83E16A51C985D085CB3DDD5F9A3A4CC587B04CDBD6882E446B2F2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39fa3db3-9809-4106-a704-08da7a188ae5 X-MS-TrafficTypeDiagnostic: DB8PR10MB3483:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oTAEfEMMb43bR9Zj2AuB6yenhgZCyC9OABRq73d31smp65/6RcIHbPb7S5S+uRngghmPT/cMWhNJQSGtALOoa9Ba3X3h6ur5CMutcrUw+oqhN+18BeQPkA0dxZRCkJbdyUIL2L3EHcHEZmfeZ0IN+s5vR5237bQPv6LpBh4uuhFXSvtiz5/z76+e7ZowNN1gollqUALBC2e/WWFAwdl8ACZ2CPA4aq9MptDZarDCX6df4HEg88TQapBCh1lZB8SeVdWnWclhMIU0IxaGMqzG5koHA9NPUzMppJBbh5ezgyVa/VdSzugX2/q4a12jUHM8riApD9/sA/r1RH/TLtIfEWw61yN/Oft8STW23eMzy3Ywm2Odbrww/4znkdz7hw/0TWVcVSdn0bXAUNh2b9RXhqYuA1p7cvpA8BgxLwglAZ0zYvHS2/LvHHjg5Z6zOyHbWRayljl8zWWp6yfSC5FTU+nxPgGD9LErLdxI9icbwH0+Rvhh+RoLWYYsSHmH9LxUDfJgwH6kORC2RptvBqPLwcNDWkHtA9JFt34NHY0tZJQICm3OrXjoXomLn7N2NGIgN7ISRUSHzH1M6C7XG+Vxir6vnsor/ZodFBfgguMgKo+Uy3l1Ni4v7Q/5pixbJ92MHHUof/BgNE5GSDKdtP3jeGKnrgebh8hqgShvQjR0jQs7ywVqBX9vu7cXeZjyhIGONKKn9ZbIXPZvStGVp8NUuIk/Y+S8spEnhFGdmWiLVzm4NpNtmajwqQ4Uxa9DqiYaSHwiOkCbRFFA/9n95+q2mqZp3erS8Z2rMx0Xk8tacvnR91CdTObW5cnGmUA2EQ5XTnZwXJ4+8BY2cB3W2QsyLrCq5gm45Ej4UJooZoUHPqphnl7/M9+y5SJ/92JhvI5qiyXk2hjQMdQZFmA57N5anQ== 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)(376002)(346002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(40480700001)(2906002)(70206006)(70586007)(83380400001)(8676002)(5660300002)(4326008)(82310400005)(316002)(86362001)(4744005)(44832011)(8936002)(36756003)(110136005)(7416002)(54906003)(186003)(36860700001)(41300700001)(82740400003)(6666004)(40460700003)(26005)(478600001)(2616005)(956004)(47076005)(336012)(16526019)(1076003)(107886003)(921005)(356005)(81166007)(82960400001)(2101003)(36900700001)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2022 15:05:05.3987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39fa3db3-9809-4106-a704-08da7a188ae5 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: VE1EUR01FT090.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR10MB3483 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Just load the watchdog module, after having identified that machine. That watchdog module does not have any autoloading support. 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",