From patchwork Thu Jul 28 15:56:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 594397 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 ED2CBC3F6B0 for ; Thu, 28 Jul 2022 15:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232034AbiG1P5M (ORCPT ); Thu, 28 Jul 2022 11:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbiG1P5K (ORCPT ); Thu, 28 Jul 2022 11:57:10 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2054.outbound.protection.outlook.com [40.107.22.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A7E51A29; Thu, 28 Jul 2022 08:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJUqnVXSi8p6ZQjLo/mFGti5RVDp+4uw6+ja7r87zKyoF0h0A3vydPxggzdJCGtmnCXZx3q0yKmYSzaX/qZx0TRWAO/hTWRkBX+oM/ku7XixPzy2D2WYk/sADZRZskPA8O88b8wC3u/eDaM637FyQCWkGOz2RIUVUEnIrSI/1kCKzIGc3hZqP84cIKlVoLDvq1jqlEAR3oVEwikpf8/DbuRewCv4GZOoSdGGE7CGf8KALYFOouMvR9AyiyjVaEo5Kb1IpFBKrfkAFE8EEScQHo2Sy/U4434uVaNosC8nu3uRDSv0x/6h+OI/ITRPjo94clnUQXUmzsM0dxA4M2Q7Ng== 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=s3KwhYGpz1G6k+JfbZKb1Awi3Dwp2h6dvg8YUZb5LkA=; b=L0t7dv93tagkw6+csdh98peRB6xCIZf0VeeRAzmhoA1CdcSnqx4CqfirNUOABHK+1BubXRmVdmKonSKqz4QlshGIUdWCLDYb24nGeLZ3X3CM7kJIVSfP+j4LlRPMP4cPgT9sk6CpCb+e9freQN551MkR0O6VNMJIVOZ+ZB8NCb9+7zw9Gw8zlQ+HmqoOo09DqLrSXsYd+Wg7GG3vu49wsse5r2RKr3CRD2WbrNV5ioDZAp2ozf2p3Tz+9a5NXsHKkzxSntkm6Yej26SClyxiqYQ7FrDw6v2VtHU9SEDkJqAO4SeIz9lX2+RBxGC78ACe0uMXMozAtDepUqzWybU49w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=siemens.com; dmarc=pass (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=s3KwhYGpz1G6k+JfbZKb1Awi3Dwp2h6dvg8YUZb5LkA=; b=IhrL/3CBX2wMQHs217L5AzAPgE6UryaLvLHQkJqsPH8KD8EBXlqCCEdCZtSQ6q/7E5jz0/iuRk5/p3tz2UZ6u1/Y72R9jVHgssGhr6ekPGRf+9/3CPSa+rMHvyZ7QBtwousgYg9oDJQk0PDwcOBcrIUw9Ml+U1SJVbF5dWvhak7Lm5sOS0+Ju2UoIxk9M5/vJa9phVopvHfUyH1NokZV9Qu2Y5RsZ0/gWHp29c0P6+/VH25EqqxR6AectYVD20iS9C0R17wcCk15zBvA9VW6sy/O6DK6krqpr4Vi+Fknrw3q+IdntUABhYoYwewtY/PjFHrHqMLY7d2mQu2i5SvPIg== Received: from DU2PR04CA0318.eurprd04.prod.outlook.com (2603:10a6:10:2b5::23) by DB9PR10MB4332.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:224::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Thu, 28 Jul 2022 15:57:02 +0000 Received: from DB5EUR01FT089.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::91) by DU2PR04CA0318.outlook.office365.com (2603:10a6:10:2b5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.71) by DB5EUR01FT089.mail.protection.outlook.com (10.152.5.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:02 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 28 Jul 2022 17:57:02 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.69.242) 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, 28 Jul 2022 17:57:02 +0200 From: Henning Schild To: , , "Bartosz Golaszewski" , Linus Walleij , Tasanakorn Phaipool CC: Sheng-Yuan Huang , Kuan-Wei Ho , Andy Shevchenko , Henning Schild Subject: [PATCH 1/4] gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Date: Thu, 28 Jul 2022 17:56:49 +0200 Message-ID: <20220728155652.29516-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220728155652.29516-1-henning.schild@siemens.com> References: <20220728155652.29516-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.69.242] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e13c98be-eda3-4e0c-7b3f-08da70b1d00e X-MS-TrafficTypeDiagnostic: DB9PR10MB4332:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1/001oTtonm4YKqrV75CisapgrUGC923yTtcKO46l5dog4SAa7YjpIoZf31Bvnbum3HBRCN+5f7ITwVY4yrH1VPFpGtHeFnkFUshsQZek72gjBCzNGFjE7EeWijLMd5SkxDnCyUcmsg3K4zGaIjEu+TFJHzd0tVUUDCvEkJm0iB9I6EdtIHUnDLu/oQA5u+r/LOpy3jsuwIHDtUAR/YGr1h9QTN/HYclHf+nc+GZZ6j0+eMjuuCl9lE9X+9RkjOCOvMGzNxhiTLezIzZEGlJ9fR1N+iXCknPsqTV++sAoHtTYRzKr++dothyI7WUF9aWPKMM4xma61yy714NSu1gAv4afXkXh7vOqmIAB4siE86eqnYbaHRiVI8RLGoolnCUZeDwhHoZDqscYJqDYUhQGqoBvbB9Y95y51ZxybAsRxFnz/hVqjNQy3Y61Em37rW+dmJ2XODpcJk9anx5F7iDVscbqmkQSNfIeaCT1lJ4vh6ISNcfww8KS8WZm6Q2WQwtLZcVit8cVQSzwXwOR6n+DipO9MHuoPXW42pkoccbavgQiCcYXqiLwSEeaRZqpdsxAicYpz18OECCiH9qA9s7VctdGC8hZsSoCA4i2dX6iRnQG1n5r4+kxKOUnoRY3CGOp/QG7oiBVUPW6L8iXAT4IxdWgYMXycV708sdCuBkZ1XSCcuC0omjETyxfBA+LHNXYooG0xRWcbeyBAyXrG92kD/eoXfkl/llWVUDhQ9oQIqY5mzYrk01j4MlqQWpHjacLx1x7YwmwxY8a9BLBbCug2rgU2bnJ3YaPxvOtHLuhl3KjVqJ8ECwPSkAEVUJR2ZoREeSftFMuO/SApB77+rpHw== X-Forefront-Antispam-Report: CIP:194.138.21.71; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(39860400002)(136003)(346002)(40470700004)(36840700001)(46966006)(110136005)(86362001)(478600001)(41300700001)(6666004)(356005)(26005)(36860700001)(82960400001)(83380400001)(336012)(47076005)(956004)(2616005)(16526019)(81166007)(107886003)(1076003)(186003)(316002)(8936002)(44832011)(5660300002)(36756003)(4326008)(40460700003)(82310400005)(2906002)(54906003)(70206006)(82740400003)(70586007)(8676002)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 15:57:02.7853 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e13c98be-eda3-4e0c-7b3f-08da70b1d00e 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.71]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT089.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR10MB4332 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. Signed-off-by: Henning Schild --- drivers/gpio/gpio-f7188x.c | 70 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c index 18a3147f5a42..431ce2cda1d8 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,9 @@ #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 */ +#define SIO_GPIO_ENABLE 0x30 /* GPIO enable */ enum chips { f71869, @@ -48,6 +50,7 @@ enum chips { f81866, f81804, f81865, + nct6116d, }; static const char * const f7188x_names[] = { @@ -59,10 +62,12 @@ static const char * const f7188x_names[] = { "f81866", "f81804", "f81865", + "nct6116d", }; struct f7188x_sio { int addr; + int device; enum chips type; }; @@ -254,6 +259,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 +280,20 @@ 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 (sio->device == SIO_LD_GPIO_NUVOTON) { + if (dir & BIT(offset)) + return GPIO_LINE_DIRECTION_IN; + + return GPIO_LINE_DIRECTION_OUT; + } + + if (dir & BIT(offset)) return GPIO_LINE_DIRECTION_OUT; return GPIO_LINE_DIRECTION_IN; @@ -286,10 +309,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 (sio->device == SIO_LD_GPIO_FINTEK) + dir &= ~BIT(offset); + else + dir |= BIT(offset); superio_outb(sio->addr, gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -307,7 +334,7 @@ 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)); @@ -332,7 +359,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 +369,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 (sio->device == SIO_LD_GPIO_FINTEK) + dir |= BIT(offset); + else + dir &= ~BIT(offset); superio_outb(sio->addr, gpio_dir(bank->regbase), dir); superio_exit(sio->addr); @@ -360,7 +390,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 +418,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 +479,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 +519,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 +547,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 Thu Jul 28 15:56:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 594163 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 F39ADC19F2B for ; Thu, 28 Jul 2022 15:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbiG1P5N (ORCPT ); Thu, 28 Jul 2022 11:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbiG1P5L (ORCPT ); Thu, 28 Jul 2022 11:57:11 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463B261D48; Thu, 28 Jul 2022 08:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROTBifVeY+U8cEGDCsGgyB6ObdWeC3HIcl4a/EQ/QIXRE7W32/5nJmnBgXegSxFjSrUqknsSaQGK3ePvHMLH4leTM0h3T+MkdcgqMc0vg79GnNT4970rm7VfqBYzLXv+VHbu3kHQpXgCwRPY10OjnJS7l78rclPp03bvl0UWYYaqg8EN1bKsq0JRMJddkV07tfQ8c/+tJK9MAmNkSOjoubFG4VS9Nf6/gKIPcnCqYHYvk3Mbeyza/EUCjnx7UgtWjgUJrksNwejiUQP4Ihcrq/vwhQgY44LDNcZ7a/AFSyRbiQtj4yBniDevjbP+qxldlHyEIdkUosL9G5hOptB9vg== 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=la1KRgcGK4dZq7v/VZiuS81LKrzy74zjsGQ5ifXobQg=; b=nuI+O45bJWsGLo5lkv2bglgauj0n/OZEJxZi+l6eUv9lhtn3iQUOAO4fTzBO6BFCsNMQkf9YgzKINLxlKggIiQoPkCcsf/I30hVpOLJ74NDzpm34uibhN9in9IRfHzreQdtnykw2vfIXI9w4PauIFqEIfrM34WwkNm//kCpTb2tj12SjK1hH4jYOZgwXaCHG8byj0bto7Xirv5MiNVmZJInsTVR54G3alWu+QTGyONAOUboIEk9r8D8c298FUNHXyWz1PJ2KZiXNnRg4+19s9MeSlX33mHKPDZ9kGHXd5jT5VHhOKNHYiGheJ4i8338fV+uZ5eTdn2yc6YcVce44Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=siemens.com; dmarc=pass (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=la1KRgcGK4dZq7v/VZiuS81LKrzy74zjsGQ5ifXobQg=; b=H00lp0IWvROSHDHtCr6sC2whNgTtgf+kdm/EVrMYXPXBqRcHbZS2j16ppaPdQZpBkovIEsamC6Hv/FOruVYL7MykoJqnFCGULKf1e27GzH8e5jympgak4zfCzmmfEs/2flzu1AxV+Y+XuDCMLAxueTUxGOhTbaHuscXYGu/i2DxMZSDXrT3NOp/DZTXltmkYJAmxROxqoCUP7tPSEBf3BgHxK935sXC5nWtF+HVP7nP5mGWjDU8bXFnUTuWy2ALG7kPh4+BPf+xJuhO7AMI0u2u8vG/s58nEcHzCdC9+NTY5me7Q74Niejpr/iPNaOkEhG51qbQuyMaxtiyNV5R6cg== Received: from DU2PR04CA0304.eurprd04.prod.outlook.com (2603:10a6:10:2b5::9) by AM7PR10MB3686.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:13f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Thu, 28 Jul 2022 15:57:03 +0000 Received: from DB5EUR01FT089.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::e4) by DU2PR04CA0304.outlook.office365.com (2603:10a6:10:2b5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11 via Frontend Transport; Thu, 28 Jul 2022 15:57:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.71) by DB5EUR01FT089.mail.protection.outlook.com (10.152.5.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:03 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 28 Jul 2022 17:57:02 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.69.242) 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, 28 Jul 2022 17:57:02 +0200 From: Henning Schild To: , , "Bartosz Golaszewski" , Linus Walleij , Tasanakorn Phaipool CC: Sheng-Yuan Huang , Kuan-Wei Ho , Andy Shevchenko , Henning Schild Subject: [PATCH 2/4] gpio-f7188x: use unique labels for banks/chips Date: Thu, 28 Jul 2022 17:56:50 +0200 Message-ID: <20220728155652.29516-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220728155652.29516-1-henning.schild@siemens.com> References: <20220728155652.29516-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.69.242] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1a985a1-1e1f-41a3-029d-08da70b1d037 X-MS-TrafficTypeDiagnostic: AM7PR10MB3686:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G8ibihkolTxmpgDUmsqLwoNm5sNfTINfrpOADj8F5A34nBzF39XFph7lEcCCPyg/RwGgkzyUmEonCCQi4hcJ6K0IFVmYWLNo0CTIhn4QDOMOTNh/152dVjsU5ZWQhLZq9zlkQNOQXq2usdsksBbNu21U/8N++5bag2/C4pkCeeONn2qIYOqxr6E8J6+dsdT+dSeTOyT/ExwtwCF0XQlQMHMjIts0lY1hyCG5YqVvBbO3rKT7I2rWXUBhD8hiCvGHVurUhoxUtwZsZkBUyeB6LKpfL6jyemlxC/D+UOrkTtDYLc1mPkB326BEPlIvshUGWUxiJ9KFEp7CjUCIVZYBlqOf0mGfQjp43dvQoyviWsl71qDSqdZnVxABk+JPbHKcYt2wEtuAHjdlvwt6yC7Nlb/uf6lc9XPvrbrreKvA9bF1tAgtXl4bZqbdHslUxXLivnKWtxA7syGqB91A60MoHtjkGZiSqEFcPMozzNpkNROe0sW5cQvp/PC9hwSriDPtK16N+Q+DKSAXwuHTMzrKGCxXJbA6sfOCLF1eWxgVAi6xD2LQgbD7zuprtrEMVO3R8LiBwAPRhFCWlEfTsu9WI2X+p1RIUZWq6t4WBQhwwFnQkPuvkZi/c8LPbDbPtXZSwUhKZJqc3tUOvMOGaiJsKMNDZMadHazKTN1rMjcGmkDzvIj0l0T35M4rbP6hIFoAcQiXJ4WoMVZdpaAX7PfpQxetnliJKktSP++z9EX/AHEEnriYdIMGUexrymY1YuMO4nY31uObU6lemLbug6AF2oo+o+eXOG8hL9wz8YUW+htI26eNoBbTnNY2Nta0GNICK+ibxuEbHOws+ueg4gluUg== X-Forefront-Antispam-Report: CIP:194.138.21.71; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(376002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(8676002)(82740400003)(4326008)(36860700001)(47076005)(5660300002)(40480700001)(82960400001)(2616005)(70586007)(356005)(44832011)(8936002)(2906002)(956004)(70206006)(81166007)(1076003)(186003)(316002)(6666004)(41300700001)(86362001)(36756003)(478600001)(110136005)(107886003)(54906003)(26005)(336012)(83380400001)(40460700003)(16526019)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 15:57:03.0353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1a985a1-1e1f-41a3-029d-08da70b1d037 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.71]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT089.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR10MB3686 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. 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 431ce2cda1d8..5f2f3c01231d 100644 --- a/drivers/gpio/gpio-f7188x.c +++ b/drivers/gpio/gpio-f7188x.c @@ -151,10 +151,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, \ @@ -176,98 +176,98 @@ static int f7188x_gpio_set_config(struct gpio_chip *chip, unsigned offset, #define gpio_out_mode(base) (base + 3) 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 Jul 28 15:56:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 594162 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 8303BC3F6B0 for ; Thu, 28 Jul 2022 15:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbiG1P5a (ORCPT ); Thu, 28 Jul 2022 11:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbiG1P5S (ORCPT ); Thu, 28 Jul 2022 11:57:18 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20089.outbound.protection.outlook.com [40.107.2.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496AC66AD2; Thu, 28 Jul 2022 08:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUYFy330pa8vzj+6PS7nTHTlFulJ9/Wb1Vk58ZKxOUltN6vUvZukAG6O4KRh1TgzRHLmxdLOAhUCiHHRvPyk44DG5pn4pYOqjH3DpFugZdWBMtgJ00rf+7cYGtcelE3wXeCZJK+5u7S2bnBrn3Y1avwPNUklWOZ2zEpDsAfQQwasPHCc/KZ/1b4p9CrCW+2AZ1OQ50drbFXsmd1OqFDuxkJhRWxQNtnRq+eAGa+Lx7Pu6VbzapmzY9vCZksYjauQAsBI1x5m7CBI2dqCIcUXk3xO8VubB+ra13wXtSQyUlk7AGiYwFmjMDT5MsRbKe5s6aTD0M7xYmK35g/udEsZIQ== 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=5P7Bge2TBQzZWHcKMZsQtiWVjdMghiTUYP+4kXDWmK4=; b=I4ITifiHV8UTo+JZIeSDnWbatUEOOtHqijSPoQ6mv9DCR2YOALSjttYFY5ZDG6UpU50rbsXP85bwIjY58sRGV0EmUIsxaCrA/S5JuW/vhxmPdlgVQXIL8SFAfSG1QzMOAYtDKZ+t3FxuWcL0Fvb9zPoNxBmHIiwz8JNCH9y0ceGEFhrpseaZvC5ccNRg/dSLG4lEdPQKN4C5rVA0WipjR4pzIF4ULNbyhfHHP1gWtozC8UiPpaY5uVVrA6xQbU5TBf60Q/r1VAyRmsgBfADDIi8cBYaFtiqGsVrtmOb8/KUpoQ11b6kvjIRejOLgkN20GQpMQEtYy2TOKDlU0jtSpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=siemens.com; dmarc=pass (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=5P7Bge2TBQzZWHcKMZsQtiWVjdMghiTUYP+4kXDWmK4=; b=uDuXr+nClzWIzYjQ0fIa97DDWCaCd3brS6j9RjzgllQDkMEGiwaSMqqVmS9Ri0tfk7WGBZ5hmhO+IWVI3hLrdCkKRmMQS0UPrUD+134meK56ShPI+RZVK9+NcEGYldtiJZUdVhcxnLUr46YgnyB3LvHD4LJeA7IU3K7FqHRgeyK+dLyZIEA9SbE7zVvdEkdY+ZmnaADEmxogrxjMRFdqO8PzutEzmb/rkR59OwFEeYdOF0arJHYbt81JHPyrlD7qudtSvDNpsNIIoPn1g1RWC4YpTvipU8zSJQhbT3S27I5x0qKevbLdloBhMbpUml16UYlgjTr0SPV9GRUsCPGRHw== Received: from DB8P191CA0022.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::32) by VI1PR10MB2368.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:84::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Thu, 28 Jul 2022 15:57:14 +0000 Received: from DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:130:cafe::17) by DB8P191CA0022.outlook.office365.com (2603:10a6:10:130::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Thu, 28 Jul 2022 15:57:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.71) by DB5EUR01FT030.mail.protection.outlook.com (10.152.4.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:14 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 28 Jul 2022 17:57:14 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.69.242) 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, 28 Jul 2022 17:57:13 +0200 From: Henning Schild To: , , "Bartosz Golaszewski" , Linus Walleij , Tasanakorn Phaipool CC: Sheng-Yuan Huang , Kuan-Wei Ho , Andy Shevchenko , Henning Schild Subject: [PATCH 3/4] leds: simatic-ipc-leds-gpio: add new model 227G Date: Thu, 28 Jul 2022 17:56:51 +0200 Message-ID: <20220728155652.29516-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220728155652.29516-1-henning.schild@siemens.com> References: <20220728155652.29516-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.69.242] 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: FD494BCE663D66D0CE9BA816CCE0712CE9F5184A8B59E9B37575AB9C67B598262000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca035dbc-397a-460f-278f-08da70b1d701 X-MS-TrafficTypeDiagnostic: VI1PR10MB2368:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FfXGH/F+HcxJiWT4WZXj80MuqWcRi4NGgRfPpuxP1yR5jc1IeZlTSL2uesGBtnlanOxNeZfldMOEtzlINZECHurp1kxm2oNcprYmHu1godciMqnN4+lkm8PfFngizZuESWxRXD6hYF52nc1wPtD0WTHETket/kkxcWmw0O9ZDAtSASnAwVUC4bOmDjLIFbTQDJZlJBhy9dmucIOgre1IjsuXOotSyOA2x2w3j1WVQ1a2e1cMrFyptGNYmk+PvyJnw7naUMhN6asXCdNfLFJmGbsIjWiFD+znM3Ww0INm33lJCtxF7mfF04JqjiDnMw09PvSpKv0zfVePM96oLN1u+Rz5Z9x45OcyTFavKNbVAEnH/GVvH6XHcNZifg0a4KWjWbjrJZrDlRwQoGOk2ekwZIgtTUzTqn7F7JNtZ3dokFLm0i7eALr+KxAzEkRbeizx04TP2lDrb3kN55N3QTdGBEAM0vlXyMClRJBq8pXqoEW/1zzKg/nFBue851GfF1X/tTLPYBKxfqJI8TrDZpl5deK6aisTpgYYhySF4+Jf61ENsw0Hq3p4j6a9HutBC4XbG+01X8L0aRJLxR79wmLCRmgotbvho22L5iytlCCb0nACUr/758EVQUF1R3atn/INHJyQOGeLFOk2LyvgAFyYh64NwZAZYqA2fAqBuhYz6atc7Qup0Li4TNIlfFqURNR51PNgHHV7+JE9rWkBDVy4+En6FF6sRVERehPxmVoWNyb8Tv8lMEI091diLHdBAlxtLxw7wGy10ke8chaFSssb+XYiAmBcl3zPNhkJiBbcMUAzxy3MBEKsIsaZHcidctXTs0AjJ68sOwai7YStFkqu6Q== X-Forefront-Antispam-Report: CIP:194.138.21.71; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(376002)(396003)(136003)(346002)(39860400002)(46966006)(40470700004)(36840700001)(316002)(86362001)(40460700003)(5660300002)(44832011)(8936002)(26005)(110136005)(54906003)(2906002)(478600001)(36756003)(41300700001)(6666004)(1076003)(107886003)(956004)(2616005)(82310400005)(356005)(36860700001)(40480700001)(81166007)(82960400001)(186003)(16526019)(8676002)(336012)(4326008)(82740400003)(83380400001)(70206006)(70586007)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 15:57:14.4264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca035dbc-397a-460f-278f-08da70b1d701 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.71]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2368 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. 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..248882fb54e2 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-2", 6, NULL, 6, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, 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 Jul 28 15:56:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 594396 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 93D02C04A68 for ; Thu, 28 Jul 2022 15:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232514AbiG1P5a (ORCPT ); Thu, 28 Jul 2022 11:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232339AbiG1P5S (ORCPT ); Thu, 28 Jul 2022 11:57:18 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150043.outbound.protection.outlook.com [40.107.15.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FF162A45; Thu, 28 Jul 2022 08:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUGtCpKCjEhTv5vRCNK8bf0uM37qL3gpQq/lrAZT6QlkhFwBLPxK0Ajt4wLETPKC/Dq9pqVQY1ORlWx/MA7MOYsscXToUFL+3K4FUBXhyP8IXBo/L4WNRIzIuO1vwmFVb6KQzW21i6JMB+J4sauCPs5FiL27S6i65P6PMV68KKSqjmhz6kkmxZb91VDHWXZ0aj3C92evhJlbvrViAwH4OAkZigVYG+mtmkPBFUxmcU1pHQoffI/vSfsw5KcgJ6zcoUMZGW163z2j5DnzZCTV6GWF32M4zSrfjw3NFPz8PfWDdc8E5lR16Xsi4snVg52bYcINr8E2pMDm+fbEoboDtQ== 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=kbyZ66tDVkyEmor7bB41uDaCD4BIy2+ZSpb06FZEmdbuiHbHZgIzWZp6xyXxRhOp9cDPImXDpEkIGRA7bx+ZbXzn4TrXqwOtvZgRp2k4sYdIMlqmF/yiz8HuYjNGCrk2B8i/k0eoj/T8XlvOUU14PCSGs/2uwrlDg7YmcESa7LAhtvFM+D9XQn7sRQw9AIMxU2RHav7rNOHZQNKZGAeDwf36RJnCd9XvMOYdGMf1Af/sPgl3tweU8kAzaNzO8m82T32D1/8SsDuHrewkjxHRZeYPs40yd1m3FS+ZmZ7IYw0APVBKcR3ar9WHgvNpDY8OG1oiaPZKW6uboB39DUCLrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=siemens.com; dmarc=pass (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=rrW4cPb065HkfK1Ibb40IdxLyOtMwUdy7lJvOeqVoXnTvVEanwfkoa1ygLt9VBSLgTAN/htZ1V+dvW17NQgQhJomf1ZOCniufOFzki4bzxhFLBsrcUiWR12HPIyxkmc4+ACHTWrqZTT2h5c1RnX2n04W0ToAzlWzTH5hhN+CJvb8B5ieEc5jz42a04FI/YdjSvyrNTEZJ9mEj6pF5ZO1NUtEPB0VrEkSgvc/t4bGG2XPwOCgsVuWhmbhTnnh7ISBnaShIGpDhSowsixVIE60csj4hhLtE1727T//3m5wmTL06GasM9pLyvAUIqfD7F5VwuZIGsTbp5fqjawb8WmQ3g== Received: from DB8P191CA0025.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::35) by DB7PR10MB2139.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.22; Thu, 28 Jul 2022 15:57:15 +0000 Received: from DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:130:cafe::5f) by DB8P191CA0025.outlook.office365.com (2603:10a6:10:130::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.71) by DB5EUR01FT030.mail.protection.outlook.com (10.152.4.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 15:57:15 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.9; Thu, 28 Jul 2022 17:57:14 +0200 Received: from md1za8fc.ad001.siemens.net (139.25.69.242) 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, 28 Jul 2022 17:57:13 +0200 From: Henning Schild To: , , "Bartosz Golaszewski" , Linus Walleij , Tasanakorn Phaipool CC: Sheng-Yuan Huang , Kuan-Wei Ho , Andy Shevchenko , Henning Schild Subject: [PATCH 4/4] platform/x86: simatic-ipc: enable watchdog for 227G Date: Thu, 28 Jul 2022 17:56:52 +0200 Message-ID: <20220728155652.29516-5-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220728155652.29516-1-henning.schild@siemens.com> References: <20220728155652.29516-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.69.242] 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: A15FED269835BF8CF7C1A137653E6D19B4BCC571B4C79D2B4C34F32CAAC23B342000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc4a0a34-4daf-4f0d-0db4-08da70b1d76a X-MS-TrafficTypeDiagnostic: DB7PR10MB2139:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vs2I7TvauCllnICd7bydGgqEk0wJVt9bnm0kJrHxXc2jaTT+cJZtxUoGs0wVut3Kwp1T6ikTinQhtdEMNE7gDGduktX39JDS2OD4V1j0T19berWsLDFgWpPmNFHFfpC2nHMHU0x7TA11aOoOgf/Iirku3TQP2Io5DL03MOPbZ/Q9LUHTUR1UgIXb7RZnt55aqL0tPbsME0iHLjJsZb68P4QLpwtdFIBJ4spLpJK1PqAL+3JpVqRTxbuY2No/mUPy8i9Zg2QvFJexHThyF1PD128FW8xtRQ0wHrpT7b+u16bBV8lXZJe+B6FeDAwpEjAL2l3Kwke/83A8zXo4CISf6Cs/6hDzmIGUJR7FrN+Ib3ew+OYq9cs95uikFlwhD5LXkfiGvoLg/Lavnv5+wFPXP1Dpfdbhw60kP+abhxgNXABvwFzqFotrUA3BqBd1JcrmuYOdhDgRX8SJ7zaDd6wAUn5L0GbvJ9FrQmNyc8eHCc/xanRQq8/uE3i1hNKIFYezTtEdSXbF2t3O0IEQQIA1u6hw9CYfIo1p9u1VAbiW1ekbNQAfj3yVNz5bMnyJxE993X3TjT6RaTLCfPyprpsRU20qeQudyMgKtCr7/Nq73sk8d+cgCI1lFETxz5/QU7kdKvMwPigXU52PcZA+ekUy7ezpraKBD9y+Md1jncjynZXs4jZQR1ZZlCDpaTiXPD86H/cht/5Pj1+M/VMot4x0z+yQDkN7kagrCIaJ8rsnXdIosIwARUl7tsGyVtpnnj0BnFx7tmQG1QnXbOyUf4BYpynkUDFv7xMf1VM0GjthcvrcfMROzLTRLhp77UlTSXFUPM/qh81iyLTLIQ+JFS58xg== X-Forefront-Antispam-Report: CIP:194.138.21.71; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(376002)(39860400002)(346002)(36840700001)(40470700004)(46966006)(336012)(1076003)(36860700001)(82310400005)(2906002)(107886003)(478600001)(47076005)(26005)(41300700001)(2616005)(40480700001)(16526019)(83380400001)(316002)(4744005)(44832011)(186003)(5660300002)(86362001)(4326008)(6666004)(81166007)(54906003)(8676002)(70586007)(8936002)(356005)(82740400003)(110136005)(956004)(36756003)(70206006)(82960400001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 15:57:15.1139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc4a0a34-4daf-4f0d-0db4-08da70b1d76a 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.71]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR10MB2139 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. 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",