From patchwork Wed May 24 12:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 685539 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 7667BC77B73 for ; Wed, 24 May 2023 12:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234096AbjEXMqq (ORCPT ); Wed, 24 May 2023 08:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233349AbjEXMqp (ORCPT ); Wed, 24 May 2023 08:46:45 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2059.outbound.protection.outlook.com [40.107.21.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A259E; Wed, 24 May 2023 05:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7db8Was0sy1QPANP+NYgLAGWSwLsrztvwJFWC5/IxME88dhFxW/okFCPe06MTtlFPjX2OdgHXOwYQdDMXiSlrjLH8KwZAWzpgDFjQEqVcjuL+ANnBgW8jYcL99ieHtGcT3z/768LCS+dhw/NPRSRdqR+CnB4b77cZGfHHw4t/de1AWPaAjRaf4N4RVhURpJCVWzl5SP86KtLnVdxHo1U9HV4z5cP/+Gxs9stKI9xBu5lDk9J2uthXiSI6Tr0VTqp+xgn94K6pEmWsrbLVuCDXnoqKvfGrFmw3g+MQUJHjC1BSEQgAGJR/9JbTN1zVibMp9VXiVb5i4TXvplh24baw== 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=grjLN1PUkCyJ04ESW2GNFn2aZS+qEMjnJxxslmSTWfI=; b=O2K9gKWPkJGrZigoNpiaymylgi/EqA2Fo039Csurh/tFDD1uw7Ikm7J001oY17TCflDJHG65DrNIxFNRcoedfc+QZRsa1aRgD0kKsZLin3QV2ukz2dhGf2xtO9BLvk20HyGPw7oDnDysADaUcDdMxTu9bEwy8dFRiO88UBUsmPJGoT60+CTR5ZnjIP3Hmfl4GEDO0KouXJXf66Qekzf2kiZ9lM/MgLN9kcN/9vQg8P/4X5rf8ThFBvwQ4N8pHsGAebl0kKWyofgaHvoK/CeITARGcgaOuYMzAz+dNUQ7B5cO6YtHdU1rAKqVUzGeHV6tEc1aX3Z/DRDILzl8mYde6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.75) smtp.rcpttodomain=ucw.cz smtp.mailfrom=siemens.com; dmarc=pass (p=reject sp=reject 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=grjLN1PUkCyJ04ESW2GNFn2aZS+qEMjnJxxslmSTWfI=; b=u2N47P+xlb/YL8+gaNNH1jyG8p7LRgngWgcmtTiuJ7gMPKbE2KjE6mvsrSWXMo75Wo5/xqzXOmnJ6IMGin9Wkopd9FnCM/B3l0sGH4Yh3GfxJ2cQ3xCoElwpKbbE7ZbcJDNY+DQ2JzqHpNe0e0fVqfR2E408891iQm40NhytJvA6CFhOKcSYGyhUpAdy6+IyADsjDrP2ng5hmfOVplrMtcOhstPIr52qqsCUBvv1eeP9ypf506mOOjSrjJRIRYAl5kyRMnKpQpQZZZ1/sF6pE4F9DCPD59HQVM0oOytVd9YlzpJJA8OUJRfRVMVDXjKbs/DgcfriZvMXWSntY18Kug== Received: from DB6PR0802CA0040.eurprd08.prod.outlook.com (2603:10a6:4:a3::26) by AS2PR10MB7981.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:559::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Wed, 24 May 2023 12:46:41 +0000 Received: from DB5EUR01FT061.eop-EUR01.prod.protection.outlook.com (2603:10a6:4:a3:cafe::b1) by DB6PR0802CA0040.outlook.office365.com (2603:10a6:4:a3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.75) 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.75 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.75; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.75) by DB5EUR01FT061.mail.protection.outlook.com (10.152.5.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:40 +0000 Received: from DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) 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.25; Wed, 24 May 2023 14:46:40 +0200 Received: from localhost.localdomain (139.22.37.129) by DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 24 May 2023 14:46:39 +0200 From: Henning Schild To: Pavel Machek , Lee Jones , Hans de Goede , Mark Gross , Andy Shevchenko , , , CC: Henning Schild Subject: [PATCH v4 1/4] leds: simatic-ipc-leds-gpio: add terminating entries to gpio tables Date: Wed, 24 May 2023 14:46:25 +0200 Message-ID: <20230524124628.32295-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230524124628.32295-1-henning.schild@siemens.com> References: <20230524124628.32295-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.22.37.129] X-ClientProxiedBy: DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) To DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5EUR01FT061:EE_|AS2PR10MB7981:EE_ X-MS-Office365-Filtering-Correlation-Id: 1981629c-ae61-42e8-af32-08db5c54ebf4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6RJ6YRkcytnyo3PfCBerEShoq6mlOSTC8+RbQFhtLNvWcWlxRWXY24Ja7kb1KIW1OobPH9JwZQZ/2u3a8YPdVboHjQ76lFPAcQM6dNU/CmAyqWnVOq1TP4qWTzJPwSH1z2fotHuH+LH6jmRo0f85SI6DcYFFctIIP50aplYZ4LBDr4sHiaCL0BTF508a2h2Bii9N0KsQAcg9rxseX+dVdm7kmF7lkg6ZZ79JkktQRkgfgKTfVz73lDwWcp01KPw+Wa2dmjc03W4i6Q2zh/BBFicuwRIc3mUlmXVeHugmQq+YhOP/tcKjmS/MHk3tKvIFbKrQHWTX8lhr+FxKFrDoAPP5g+bMjQVR5qvYQUdm662oX+c2sFzZk0aThT/M0YaRlgjH8Yvrr/yQF9wkWDB8KrfukxiUax/Heibs0EI7FUqC2zunX+SLrpYJDu3Bhmyl34G5PML8QQaZK0PWRLyiGBkF+PMW6HxiHU4EC3Vc6IYcMd/UQs8mRt8VmcNZ8kiettIz5W1dXpKTWsz3G6MO4rDy89uwLOR9kU+vJo3NF2+LkwnawWk5SoKPGcQ4viK/0L3BpNUmXTac74DywMFs3op89xWoxxBSCoEQsW/53YnZvN1ZKNAneTeAvIggo0bFukyTBrasWi4mJlsDwI+O2YrWXP3bx6sPWvGtDw/COVjJlX1ypljs8489d8JFMes0gp2xYBZvDoPxAxiobx/vIXmHjQXLE9UTfxEJfTAOR1lgM9OV1XXEeMmdUsmjwGgrGbD437g//RHB/nGT607Oow== 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:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199021)(36840700001)(46966006)(40470700004)(40460700003)(5660300002)(8676002)(8936002)(16526019)(186003)(36860700001)(47076005)(86362001)(36756003)(2906002)(336012)(2616005)(956004)(82310400005)(44832011)(356005)(82960400001)(40480700001)(82740400003)(81166007)(1076003)(26005)(107886003)(4326008)(316002)(70586007)(70206006)(6666004)(110136005)(478600001)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 12:46:40.8033 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1981629c-ae61-42e8-af32-08db5c54ebf4 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: DB5EUR01FT061.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR10MB7981 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org The entries do not seem to be stricly needed when the number of entries is given via the number of LEDs. But adding them is a safeguard should anyone ever iterate over the tables to their end, it also gets us in line with other drivers that register "leds-gpio" tables. Signed-off-by: Henning Schild Reviewed-by: Andy Shevchenko Reported-by: Andy Shevchenko --- drivers/leds/simple/simatic-ipc-leds-gpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.c b/drivers/leds/simple/simatic-ipc-leds-gpio.c index e8d329b5a68c..1a1cfdad6218 100644 --- a/drivers/leds/simple/simatic-ipc-leds-gpio.c +++ b/drivers/leds/simple/simatic-ipc-leds-gpio.c @@ -28,6 +28,7 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = { GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, 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), + {} /* Terminating entry */ }, }; @@ -42,6 +43,7 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g = { 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), + {} /* Terminating entry */ } }; From patchwork Wed May 24 12:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 685538 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 DDF1FC7EE2C for ; Wed, 24 May 2023 12:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234303AbjEXMqr (ORCPT ); Wed, 24 May 2023 08:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232032AbjEXMqp (ORCPT ); Wed, 24 May 2023 08:46:45 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2080.outbound.protection.outlook.com [40.107.6.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E809C99; Wed, 24 May 2023 05:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTkpBNpw1lhOuVVd6LfXkn+rP+FP14UnBW+sVwjoJgzPRsH7/YeDg+FZ4imhdSyOeea89DnPqjxFWvDwQwV+3ibaM2O001I7mVWjc3zALqJLCVIwtsPBoZ6HUIrf87JFiHme3PjxE1grtOhjJR2d8RB6I4X/dsPsYhgFksa+Ft1A2+1UpTEWNUE0gCCUW0HAXrEG9+/UE5AxoejMGPovDmOavIdhCp+VokAQ2Ob6kJIEjd5jEeuK97d52mWDqfVuiCR6bjY/k7kCsa5ynrTKXKFm+GAD8Y1Q9C4kPKxC/Vd9omvlqP3qclbGdC9k+dAWEe0HfnFe4VzDmM6d2R5E3A== 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=dh3TbW4YErS+bBUZE1cA52kD2hjgiMDDXP+wCSGt0C4=; b=ndWZWKuaEm0iiGLMSgpCDNEa1WM/JU+tH7F28yZTUhTbuJqcVPMfDlvIrYXEmzqNfIXuuJdWV4VZ1Z6jui/BSAuvEm9h7avHtWQ85Yq5DVhev7yDkhCawOBI0aOPx2BNa2tFencg42OfiCs+z+O7OWYa35c5RoA6CjsFZVU7FY54Nxptan3JhNcF48NbZl9lGulbR34tp49LkZxT/TM39QlQXv+Jqjm3WT3buCjOt9m6MrIKOY+I6kfCMMcy/GUeV8xOa3BeKfKJf6qUUBkKP5XmCY6b0Y5djLR2wGvB+6of3WIq/at2dY2KdByGdqhtqTPqQkD9a/Mhbm7mAezYJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.74) smtp.rcpttodomain=ucw.cz smtp.mailfrom=siemens.com; dmarc=pass (p=reject sp=reject 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=dh3TbW4YErS+bBUZE1cA52kD2hjgiMDDXP+wCSGt0C4=; b=NhajjtMEJSeGN9+MBpr1kqjNkP6w6XTF1tymHC6rB/QC5F2lkM5uS20H8nUKj1tACWPFRe/fLhxiKyqBkoP4ceM8SkU5LuDttajz5Ro1rdhisS0P2/gJejDs/R2YEHPY72MTCBfr3D8F2Id+yQI4luGxb9lvMFUtkHYEYrJsyvw5sJSSOo0YgnC7uA7Ih9ElpoLbOoBZ7YBQRiLJRHao9f13IuvxdqrCi/v5TA9HggQiAZAKQv0BjO3lE/yb4LDVcihlsBEt7tDmLTne0nBK1xRTONdkxc7Zijd2gMWVWRPKVDalzYjsJOJz0NHBBfyWrG6WlEmixydNtdb8EACS6A== Received: from GVYP280CA0038.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:f9::15) by DU2PR10MB7882.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:46e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 12:46:42 +0000 Received: from HE1EUR01FT095.eop-EUR01.prod.protection.outlook.com (2603:10a6:150:f9:cafe::5e) by GVYP280CA0038.outlook.office365.com (2603:10a6:150:f9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.74) 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.74 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.74; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.74) by HE1EUR01FT095.mail.protection.outlook.com (10.152.1.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:41 +0000 Received: from DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) by DEMCHDC8VQA.ad011.siemens.net (194.138.21.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 24 May 2023 14:46:40 +0200 Received: from localhost.localdomain (139.22.37.129) by DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 24 May 2023 14:46:40 +0200 From: Henning Schild To: Pavel Machek , Lee Jones , Hans de Goede , Mark Gross , Andy Shevchenko , , , CC: Henning Schild Subject: [PATCH v4 2/4] leds: simatic-ipc-leds-gpio: move two extra gpio pins into another table Date: Wed, 24 May 2023 14:46:26 +0200 Message-ID: <20230524124628.32295-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230524124628.32295-1-henning.schild@siemens.com> References: <20230524124628.32295-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.22.37.129] X-ClientProxiedBy: DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) To DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1EUR01FT095:EE_|DU2PR10MB7882:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bd9f38b-c7e3-4357-3b3d-08db5c54ec64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sQgwHxigQ0Gi+DRwIcl0hsym7SukLO3/TgLAy4UMrxHoBph1ed3HRQt0MobPxgnFqum/EgwJT2Bo3lt/jGeJxVwUPflLrzrQeKRDzKoxOoOvZoW9YJUQABFRBgr+Mc1U6lCY34lJJxiqgxmdkA5L7TOeK0/ravqwfzWp2xRTNaoOJegFkqIZkz0AKr+slZnLjmkFWmSGHfVKi0lYlkQLUcoUhjjmVnwYLPIKRQ9q2etH6AlqXRdMV8AJKslMGZTorV9VqRfkz8q2xQ6K4oXWFXz7QhNJhvowhnZk+HWi6bwmj+D41RscPKP7gGACJW49MZcpL8OH+hPgSAEXtkSIAfDeC0ZGzZ23Ffn4Bga7PLnYF29Z59dGzo1azMP99CzIjgsXuMHN3cMLdSmhtlzxe39Qxxl4N0YnKbyhjjNzGUzpZFT6hZ+zBxIngKfsuzoE3A+6VtJs11Xx/WV4cHbT32b/Coq5PBHl2CcSF+69mgU2opd0at3DzhvdfruEUIG91IbasoxX9WGB4KxmTbPVKoWK11zHfKLGfTdkRwj3+pbPpI584GRIgMcwgmZt9l/Yy4mq12Mkqxzi8WJFBJKo6w2dS7e+4SjTh8xtHIAxn/AFnZx2WzSYpEzpRC0ufNc8X98huTtXXYAE/dUPAyQEpK0OI0qxb6BoGsL9b+KV4VKaQngWC0c0H2Em760skwoF27e1wfTFPqaiuH8At45KB3Ehm5bZRkUtZtX7CTrFdCBkcsK+PxWiN+GikSIqI1Sf X-Forefront-Antispam-Report: CIP:194.138.21.74; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:hybrid.siemens.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199021)(36840700001)(40470700004)(46966006)(82740400003)(82960400001)(4326008)(47076005)(36860700001)(70586007)(70206006)(40480700001)(316002)(7596003)(356005)(7636003)(110136005)(478600001)(6666004)(41300700001)(40460700003)(956004)(26005)(86362001)(5660300002)(336012)(107886003)(82310400005)(1076003)(2906002)(36756003)(44832011)(2616005)(8676002)(16526019)(186003)(83380400001)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 12:46:41.4963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bd9f38b-c7e3-4357-3b3d-08db5c54ec64 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.74]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT095.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR10MB7882 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org There are two special pins needed to init the LEDs. We used to have them at the end of the gpiod_lookup table to give to "leds-gpio". A cleaner way is to have a dedicated table for the special pins. Signed-off-by: Henning Schild --- drivers/leds/simple/simatic-ipc-leds-gpio.c | 28 ++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.c b/drivers/leds/simple/simatic-ipc-leds-gpio.c index 1a1cfdad6218..0f1fde44e8d9 100644 --- a/drivers/leds/simple/simatic-ipc-leds-gpio.c +++ b/drivers/leds/simple/simatic-ipc-leds-gpio.c @@ -16,6 +16,7 @@ #include static struct gpiod_lookup_table *simatic_ipc_led_gpio_table; +static struct gpiod_lookup_table *simatic_ipc_led_gpio_table_extra; static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = { .dev_id = "leds-gpio", @@ -26,6 +27,13 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = { GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 3, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 4, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, GPIO_ACTIVE_LOW), + {} /* Terminating entry */ + }, +}; + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e_extra = { + .dev_id = NULL, /* Filled during initialization */ + .table = { GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW), GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH), {} /* Terminating entry */ @@ -41,10 +49,17 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g = { 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), + {} /* Terminating entry */ + }, +}; + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g_extra = { + .dev_id = NULL, /* Filled during initialization */ + .table = { GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, NULL, 6, GPIO_ACTIVE_HIGH), GPIO_LOOKUP_IDX("gpio-f7188x-3", 7, NULL, 7, GPIO_ACTIVE_HIGH), {} /* Terminating entry */ - } + }, }; static const struct gpio_led simatic_ipc_gpio_leds[] = { @@ -66,6 +81,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_extra); platform_device_unregister(simatic_leds_pdev); return 0; @@ -74,6 +90,7 @@ 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 device *dev = &pdev->dev; struct gpio_desc *gpiod; int err; @@ -82,12 +99,14 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) if (!IS_ENABLED(CONFIG_PINCTRL_BROXTON)) return -ENODEV; simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_127e; + simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_127e_extra; 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; + simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_227g_extra; break; default: return -ENODEV; @@ -103,8 +122,11 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) goto out; } + simatic_ipc_led_gpio_table_extra->dev_id = dev_name(dev); + gpiod_add_lookup_table(simatic_ipc_led_gpio_table_extra); + /* PM_BIOS_BOOT_N */ - gpiod = gpiod_get_index(&simatic_leds_pdev->dev, NULL, 6, GPIOD_OUT_LOW); + gpiod = gpiod_get_index(dev, NULL, 6, GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { err = PTR_ERR(gpiod); goto out; @@ -112,7 +134,7 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) gpiod_put(gpiod); /* PM_WDT_OUT */ - gpiod = gpiod_get_index(&simatic_leds_pdev->dev, NULL, 7, GPIOD_OUT_LOW); + gpiod = gpiod_get_index(dev, NULL, 7, GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { err = PTR_ERR(gpiod); goto out; From patchwork Wed May 24 12:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 686605 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 E683CC77B7A for ; Wed, 24 May 2023 12:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234452AbjEXMrL (ORCPT ); Wed, 24 May 2023 08:47:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbjEXMrK (ORCPT ); Wed, 24 May 2023 08:47:10 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2086.outbound.protection.outlook.com [40.107.6.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9761BD; Wed, 24 May 2023 05:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULc8sjF9D0T1TmTquCEcQxBmrmM/Ri12LUmivxNG7S9HQwpjFutT/MhLuF5jJS0g+2h1opjbziuvI7igElu6iBN4HsuGNoshbRdJmK2kfrOPzrzneUmOvFJrbDcgNtvOmqLWPbfd2WHxw4Nsd/b03w3e41e7ec9R8dtnns3070yiHoqUjE3yXyEvWHxVqz0S0kz5rtKsnsjMwLq7N75hWx358Vq8QeLSfj0KzwfMxTfF67JpHFbB5suk8BnMyLORvtNJ+YTSLDsUv3kRhcs54LLXGxpucIzdDIzXtUQZFnqfPfwtSxmw/t7ORrdlggCeA8nbI6rds+zobElqYzHNuA== 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=FPeQ15n7qmOzwPQai54yq6/WTsgJDW1jLz12XX4r93o=; b=NwEdWv8J6TB5E/2Q9nShJNvx7w5lHAn/2fInhsmm/Lf4P28SYp3z9yoglWxIUL/Bzp2JxzH+L4zM9fH4qVFzefckw8pWuzai1KpDJkGQI/QOrQOW90sO+S6X+U2rK64aQleGfQH9l0tBeb8E72w2u+ntJ5+ZEWkdyIoip7RJAWcqTuS8M4a2ixzzNb8Q0y5ZjdD7KL04DtUaADU677BR6e7YazmhwZBzuZNVvScJ/2KKYRJyD7PlcBGXstril7XEIfefN2QproWX1esgE+O8vAVtECJMsdjg+/+VOuqw3dwSTijLxdyGmQXHSOnCmTqAQg5meTbpvlJ8FkNhadOY+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.76) smtp.rcpttodomain=ucw.cz smtp.mailfrom=siemens.com; dmarc=pass (p=reject sp=reject 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=FPeQ15n7qmOzwPQai54yq6/WTsgJDW1jLz12XX4r93o=; b=k4IDnHUGYhg8qubxkjpm/WxNYtlDeOMnwiWLJisc80MAosxZ2sNEhQ28zskMvzJKnhjQZ5co8NGn0KI60eP5dKSiDt7pErY3xAHgW/PREBBltmo42PstVTnTzzWgkpoJv7VFSeEmXpwIjj2EN7yJJIRzh/HJ1T8lwC28wqNB3RLgohwI+ZQ8ynRgg5osY8HErgqbuKKdcdHO44aMwdA7oilJxFN9v3qkN1jBXd8CKEy26j8lkGVudGd8NkXMq8iN49CpVyZ1B0VikY122JmY0Q7xm6D1wB6BVUlJ1Fj/xm+IXP30JJl7+1RP1yOPCFiUT46duTUwN5llZh/HfPu3HQ== Received: from AM0PR01CA0089.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::30) by DBAPR10MB4108.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:1c5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Wed, 24 May 2023 12:46:55 +0000 Received: from VE1EUR01FT011.eop-EUR01.prod.protection.outlook.com (2603:10a6:208:10e:cafe::f2) by AM0PR01CA0089.outlook.office365.com (2603:10a6:208:10e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.76) 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.76 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.76; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.76) by VE1EUR01FT011.mail.protection.outlook.com (10.152.2.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.16 via Frontend Transport; Wed, 24 May 2023 12:46:54 +0000 Received: from DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) 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.25; Wed, 24 May 2023 14:46:54 +0200 Received: from localhost.localdomain (139.22.37.129) by DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 24 May 2023 14:46:53 +0200 From: Henning Schild To: Pavel Machek , Lee Jones , Hans de Goede , Mark Gross , Andy Shevchenko , , , CC: Henning Schild Subject: [PATCH v4 3/4] leds: simatic-ipc-leds-gpio: split up into multiple drivers Date: Wed, 24 May 2023 14:46:27 +0200 Message-ID: <20230524124628.32295-4-henning.schild@siemens.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230524124628.32295-1-henning.schild@siemens.com> References: <20230524124628.32295-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.22.37.129] X-ClientProxiedBy: DEMCHDC8WAA.ad011.siemens.net (139.25.226.104) To DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR01FT011:EE_|DBAPR10MB4108:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ad04797-18c7-445a-8cba-08db5c54f446 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a3wCcZYlq09FqjPhTuOng5S2SJ0t+TdsKIHcPwMVEWCV3Fr2HfGU1rz0KLU3rD8fYYzT8+G90Wb6M6OdXKZMhU0BU7wdA3IHgenNii3Ux7gRCb+z6suInPAuS82n+OSZYSpQyb6RIORuLtGW2Xaq2GTHjNyKZMvMDOJ5UOaDAAM8MWCqTeTE1eVuy7aw30O4Dz9PVNX/01Nb6cQEanarSR9XiWWH+xLWjVOH5xLlpqWYYDkOPSCEF6+mt4AYsR74auOfZlyxMNZo2+W3g2DZHfYQn1QpInpYOZp/XUhTb5OAUxHJKwWHd99NRNQqOIORu7n2NJp5w6IuP5rOjITZAI3eVaVckNBpbqKmNjhSC5akqcVTGmjHb0HPKLnUFEr/TRGDuhwt+vRn9piEjMIp6EOziSGervft3giyw3U91mKGaunyQcWpHWeutytVw95aS6x/GSuic9ReAoH/KLHQ3/0UHXzx4btdujttvZEiUoRLQ7Ov3nTvRw+6BAw4nchMADHgCWiypC+AWdVyIWRuTCINpgY3+JARUBMFhveXG/CJREub/caRwEFvzbSEkrdtSDDUkswTK9VjrTputszIwECMS6Ro0jEcTdrvYXVn5kHDS7Vx63eTeikbLJSXhQLXOpTVcPUOzTBa3IJY/p1cTGhApPEf2qJJrCORFEDHaOiBfN1gLFQdKIRlb9Gs8u/hQR4gUpNyTn1qZ+VQqHjxPbsiva62OQQ355akNbjbxJQSfbjhmwao7AbpnQIsHs4/EYWSuQBxwmXqjWt1GYs4iQ== 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:(13230028)(4636009)(396003)(39860400002)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(336012)(36860700001)(47076005)(83380400001)(4326008)(70586007)(70206006)(107886003)(6666004)(2616005)(956004)(1076003)(110136005)(26005)(16526019)(186003)(478600001)(30864003)(86362001)(2906002)(8676002)(8936002)(44832011)(5660300002)(36756003)(316002)(81166007)(82960400001)(356005)(82740400003)(41300700001)(40480700001)(40460700003)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 12:46:54.7704 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ad04797-18c7-445a-8cba-08db5c54f446 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: VE1EUR01FT011.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR10MB4108 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header. Signed-off-by: Henning Schild --- drivers/leds/simple/Makefile | 4 +- .../simple/simatic-ipc-leds-gpio-apollolake.c | 66 +++++++ .../leds/simple/simatic-ipc-leds-gpio-core.c | 104 +++++++++++ .../simple/simatic-ipc-leds-gpio-f7188x.c | 66 +++++++ drivers/leds/simple/simatic-ipc-leds-gpio.c | 163 ------------------ drivers/leds/simple/simatic-ipc-leds-gpio.h | 22 +++ drivers/leds/simple/simatic-ipc-leds.c | 1 - drivers/platform/x86/simatic-ipc.c | 7 +- 8 files changed, 265 insertions(+), 168 deletions(-) create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-core.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c delete mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.h diff --git a/drivers/leds/simple/Makefile b/drivers/leds/simple/Makefile index 1c7ef5e1324b..ed9057f7b6da 100644 --- a/drivers/leds/simple/Makefile +++ b/drivers/leds/simple/Makefile @@ -1,3 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-core.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-apollolake.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-f7188x.o diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c b/drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file mode 100644 index 000000000000..e1c712729dcf --- /dev/null +++ b/drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Siemens SIMATIC IPC driver for GPIO based LEDs + * + * Copyright (c) Siemens AG, 2023 + * + * Author: + * Henning Schild + */ + +#include +#include +#include +#include +#include +#include + +#include "simatic-ipc-leds-gpio.h" + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table = { + .dev_id = "leds-gpio", + .table = { + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL, 0, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL, 1, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL, 2, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 3, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 4, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, GPIO_ACTIVE_LOW), + {} /* Terminating entry */ + }, +}; + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_extra = { + .dev_id = NULL, /* Filled during initialization */ + .table = { + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH), + {} /* Terminating entry */ + }, +}; + +static int simatic_ipc_leds_gpio_apollolake_probe(struct platform_device *pdev) +{ + return simatic_ipc_leds_gpio_probe(pdev, &simatic_ipc_led_gpio_table, + &simatic_ipc_led_gpio_table_extra); +} + +static int simatic_ipc_leds_gpio_apollolake_remove(struct platform_device *pdev) +{ + return simatic_ipc_leds_gpio_remove(pdev, &simatic_ipc_led_gpio_table, + &simatic_ipc_led_gpio_table_extra); +} + +static struct platform_driver simatic_ipc_led_gpio_apollolake_driver = { + .probe = simatic_ipc_leds_gpio_apollolake_probe, + .remove = simatic_ipc_leds_gpio_apollolake_remove, + .driver = { + .name = KBUILD_MODNAME, + }, +}; +module_platform_driver(simatic_ipc_led_gpio_apollolake_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" KBUILD_MODNAME); +MODULE_SOFTDEP("pre: simatic-ipc-leds-gpio-core platform:apollolake-pinctrl"); +MODULE_AUTHOR("Henning Schild "); diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio-core.c b/drivers/leds/simple/simatic-ipc-leds-gpio-core.c new file mode 100644 index 000000000000..2a21b663df87 --- /dev/null +++ b/drivers/leds/simple/simatic-ipc-leds-gpio-core.c @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Siemens SIMATIC IPC driver for GPIO based LEDs + * + * Copyright (c) Siemens AG, 2023 + * + * Author: + * Henning Schild + */ + +#include +#include +#include +#include +#include +#include + +#include "simatic-ipc-leds-gpio.h" + +static struct platform_device *simatic_leds_pdev; + +static const struct gpio_led simatic_ipc_gpio_leds[] = { + { .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 = { + .num_leds = ARRAY_SIZE(simatic_ipc_gpio_leds), + .leds = simatic_ipc_gpio_leds, +}; + +int simatic_ipc_leds_gpio_remove(struct platform_device *pdev, + struct gpiod_lookup_table *table, + struct gpiod_lookup_table *table_extra) +{ + gpiod_remove_lookup_table(table); + gpiod_remove_lookup_table(table_extra); + platform_device_unregister(simatic_leds_pdev); + + return 0; +} +EXPORT_SYMBOL_GPL(simatic_ipc_leds_gpio_remove); + +int simatic_ipc_leds_gpio_probe(struct platform_device *pdev, + struct gpiod_lookup_table *table, + struct gpiod_lookup_table *table_extra) +{ + const struct simatic_ipc_platform *plat = pdev->dev.platform_data; + struct device *dev = &pdev->dev; + struct gpio_desc *gpiod; + int err; + + switch (plat->devmode) { + case SIMATIC_IPC_DEVICE_127E: + case SIMATIC_IPC_DEVICE_227G: + break; + default: + return -ENODEV; + } + + gpiod_add_lookup_table(table); + simatic_leds_pdev = platform_device_register_resndata(NULL, + "leds-gpio", PLATFORM_DEVID_NONE, NULL, 0, + &simatic_ipc_gpio_leds_pdata, + sizeof(simatic_ipc_gpio_leds_pdata)); + if (IS_ERR(simatic_leds_pdev)) { + err = PTR_ERR(simatic_leds_pdev); + goto out; + } + + table_extra->dev_id = dev_name(dev); + gpiod_add_lookup_table(table_extra); + + /* PM_BIOS_BOOT_N */ + gpiod = gpiod_get_index(dev, NULL, 6, GPIOD_OUT_LOW); + if (IS_ERR(gpiod)) { + err = PTR_ERR(gpiod); + goto out; + } + gpiod_put(gpiod); + + /* PM_WDT_OUT */ + gpiod = gpiod_get_index(dev, NULL, 7, GPIOD_OUT_LOW); + if (IS_ERR(gpiod)) { + err = PTR_ERR(gpiod); + goto out; + } + gpiod_put(gpiod); + + return 0; +out: + simatic_ipc_leds_gpio_remove(pdev, table, table_extra); + + return err; +} +EXPORT_SYMBOL_GPL(simatic_ipc_leds_gpio_probe); + +MODULE_LICENSE("GPL v2"); +MODULE_SOFTDEP("pre: platform:leds-gpio"); +MODULE_AUTHOR("Henning Schild "); diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c b/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c new file mode 100644 index 000000000000..583a6b6c7c22 --- /dev/null +++ b/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Siemens SIMATIC IPC driver for GPIO based LEDs + * + * Copyright (c) Siemens AG, 2023 + * + * Author: + * Henning Schild + */ + +#include +#include +#include +#include +#include +#include + +#include "simatic-ipc-leds-gpio.h" + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table = { + .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), + {} /* Terminating entry */ + }, +}; + +static struct gpiod_lookup_table simatic_ipc_led_gpio_table_extra = { + .dev_id = NULL, /* Filled during initialization */ + .table = { + GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, NULL, 6, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("gpio-f7188x-3", 7, NULL, 7, GPIO_ACTIVE_HIGH), + {} /* Terminating entry */ + }, +}; + +static int simatic_ipc_leds_gpio_f7188x_probe(struct platform_device *pdev) +{ + return simatic_ipc_leds_gpio_probe(pdev, &simatic_ipc_led_gpio_table, + &simatic_ipc_led_gpio_table_extra); +} + +static int simatic_ipc_leds_gpio_f7188x_remove(struct platform_device *pdev) +{ + return simatic_ipc_leds_gpio_remove(pdev, &simatic_ipc_led_gpio_table, + &simatic_ipc_led_gpio_table_extra); +} + +static struct platform_driver simatic_ipc_led_gpio_driver = { + .probe = simatic_ipc_leds_gpio_f7188x_probe, + .remove = simatic_ipc_leds_gpio_f7188x_remove, + .driver = { + .name = KBUILD_MODNAME, + }, +}; +module_platform_driver(simatic_ipc_led_gpio_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" KBUILD_MODNAME); +MODULE_SOFTDEP("pre: simatic-ipc-leds-gpio-core gpio_f7188x"); +MODULE_AUTHOR("Henning Schild "); diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.c b/drivers/leds/simple/simatic-ipc-leds-gpio.c deleted file mode 100644 index 0f1fde44e8d9..000000000000 --- a/drivers/leds/simple/simatic-ipc-leds-gpio.c +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Siemens SIMATIC IPC driver for GPIO based LEDs - * - * Copyright (c) Siemens AG, 2022 - * - * Authors: - * Henning Schild - */ - -#include -#include -#include -#include -#include -#include - -static struct gpiod_lookup_table *simatic_ipc_led_gpio_table; -static struct gpiod_lookup_table *simatic_ipc_led_gpio_table_extra; - -static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = { - .dev_id = "leds-gpio", - .table = { - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL, 0, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL, 1, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL, 2, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 3, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 4, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, GPIO_ACTIVE_LOW), - {} /* Terminating entry */ - }, -}; - -static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e_extra = { - .dev_id = NULL, /* Filled during initialization */ - .table = { - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW), - GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH), - {} /* Terminating entry */ - }, -}; - -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), - {} /* Terminating entry */ - }, -}; - -static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g_extra = { - .dev_id = NULL, /* Filled during initialization */ - .table = { - GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, NULL, 6, GPIO_ACTIVE_HIGH), - GPIO_LOOKUP_IDX("gpio-f7188x-3", 7, NULL, 7, GPIO_ACTIVE_HIGH), - {} /* Terminating entry */ - }, -}; - -static const struct gpio_led simatic_ipc_gpio_leds[] = { - { .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 = { - .num_leds = ARRAY_SIZE(simatic_ipc_gpio_leds), - .leds = simatic_ipc_gpio_leds, -}; - -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_extra); - platform_device_unregister(simatic_leds_pdev); - - return 0; -} - -static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev) -{ - const struct simatic_ipc_platform *plat = pdev->dev.platform_data; - struct device *dev = &pdev->dev; - struct gpio_desc *gpiod; - int err; - - switch (plat->devmode) { - case SIMATIC_IPC_DEVICE_127E: - if (!IS_ENABLED(CONFIG_PINCTRL_BROXTON)) - return -ENODEV; - simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_127e; - simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_127e_extra; - 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; - simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_227g_extra; - 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, - sizeof(simatic_ipc_gpio_leds_pdata)); - if (IS_ERR(simatic_leds_pdev)) { - err = PTR_ERR(simatic_leds_pdev); - goto out; - } - - simatic_ipc_led_gpio_table_extra->dev_id = dev_name(dev); - gpiod_add_lookup_table(simatic_ipc_led_gpio_table_extra); - - /* PM_BIOS_BOOT_N */ - gpiod = gpiod_get_index(dev, NULL, 6, GPIOD_OUT_LOW); - if (IS_ERR(gpiod)) { - err = PTR_ERR(gpiod); - goto out; - } - gpiod_put(gpiod); - - /* PM_WDT_OUT */ - gpiod = gpiod_get_index(dev, NULL, 7, GPIOD_OUT_LOW); - if (IS_ERR(gpiod)) { - err = PTR_ERR(gpiod); - goto out; - } - gpiod_put(gpiod); - - return 0; -out: - simatic_ipc_leds_gpio_remove(pdev); - - return err; -} - -static struct platform_driver simatic_ipc_led_gpio_driver = { - .probe = simatic_ipc_leds_gpio_probe, - .remove = simatic_ipc_leds_gpio_remove, - .driver = { - .name = KBUILD_MODNAME, - } -}; -module_platform_driver(simatic_ipc_led_gpio_driver); - -MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:" KBUILD_MODNAME); -MODULE_SOFTDEP("pre: platform:leds-gpio"); -MODULE_AUTHOR("Henning Schild "); diff --git a/drivers/leds/simple/simatic-ipc-leds-gpio.h b/drivers/leds/simple/simatic-ipc-leds-gpio.h new file mode 100644 index 000000000000..bf258c32f83d --- /dev/null +++ b/drivers/leds/simple/simatic-ipc-leds-gpio.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Siemens SIMATIC IPC driver for GPIO based LEDs + * + * Copyright (c) Siemens AG, 2023 + * + * Author: + * Henning Schild + */ + +#ifndef _SIMATIC_IPC_LEDS_GPIO_H +#define _SIMATIC_IPC_LEDS_GPIO_H + +int simatic_ipc_leds_gpio_probe(struct platform_device *pdev, + struct gpiod_lookup_table *table, + struct gpiod_lookup_table *table_extra); + +int simatic_ipc_leds_gpio_remove(struct platform_device *pdev, + struct gpiod_lookup_table *table, + struct gpiod_lookup_table *table_extra); + +#endif /* _SIMATIC_IPC_LEDS_GPIO_H */ diff --git a/drivers/leds/simple/simatic-ipc-leds.c b/drivers/leds/simple/simatic-ipc-leds.c index 4894c228c165..2124f6d09930 100644 --- a/drivers/leds/simple/simatic-ipc-leds.c +++ b/drivers/leds/simple/simatic-ipc-leds.c @@ -126,7 +126,6 @@ static struct platform_driver simatic_ipc_led_driver = { .name = KBUILD_MODNAME, } }; - module_platform_driver(simatic_ipc_led_driver); MODULE_LICENSE("GPL v2"); diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c index b3622419cd1a..c773995b230d 100644 --- a/drivers/platform/x86/simatic-ipc.c +++ b/drivers/platform/x86/simatic-ipc.c @@ -68,9 +68,10 @@ static int register_platform_devices(u32 station_id) } if (ledmode != SIMATIC_IPC_DEVICE_NONE) { - if (ledmode == SIMATIC_IPC_DEVICE_127E || - ledmode == SIMATIC_IPC_DEVICE_227G) - pdevname = KBUILD_MODNAME "_leds_gpio"; + if (ledmode == SIMATIC_IPC_DEVICE_127E) + pdevname = KBUILD_MODNAME "_leds_gpio_apollolake"; + if (ledmode == SIMATIC_IPC_DEVICE_227G) + pdevname = KBUILD_MODNAME "_leds_gpio_f7188x"; platform_data.devmode = ledmode; ipc_led_platform_device = platform_device_register_data(NULL, From patchwork Wed May 24 12:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 685537 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 AE921C7EE2C for ; Wed, 24 May 2023 12:47:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234513AbjEXMrM (ORCPT ); Wed, 24 May 2023 08:47:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233822AbjEXMrK (ORCPT ); Wed, 24 May 2023 08:47:10 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2063.outbound.protection.outlook.com [40.107.241.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A216E42; Wed, 24 May 2023 05:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2UR3vGWsmlOYgEClIBg1BRLZg5PCCQXcVD59ql030D8LNGPUApMeOW8M7eP/0lcEF7rDkjCJ2ToSzsSI9Mft4fNYoM1A4K4dFdtREqiBqHJPvn91M8oLwmlnj/QAXU3zdYSNfYJHmf59gUsqR+oX2aTLsPH9Wz6Ne33pd859YEogoyGhUSpPkhTxf9SGZRmwIB5h40ILutwr5IA9DsHjQhvJnZoUsvLdn+zPBTRdlbuRQ4wU3GVwxtMvYmV53t0iBbdqEORHLG1xPFJEmHQ1Pa9WyDC1UCY3+2uIJcGBgffD81kuz1bw5COXkaqD8Ww44TILnNfgy8utzPglC8uyw== 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=WDIbHt+GIdNrdOWSe2pZSzaoc3EgQgnGfKLokJlxn5o=; b=Pvb4PuPl1qtwRszyeebjP1abjw8RVl6ZxOxHnVS00LClFCVwEUXDE9c15vuhuEY+GTYx3MKp4azINjr+tfoj97yvkrP38IKSh27M54X7MlOgWJ7jiaSGO5mvZWOpeiNGEvXednhbBexEVwkw0tvg7FKpPhkQfG43Npw11Ph+JFSx8o/QZb66WIL5u1N1Qks8PSmkcnn0aaMnsCccwqVc3UBFUkT6XPPq5nFkcBDuXYqNIyxYNQasxbNylP7Cs9lE2GMryPcq4a0tUnTGtlqD2QktkHVm3uyhGzxpTRhMtkpgFOY3HB1015Zj1vFPQxv+9KAjNt4Ir4BNlzqfYekcag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.75) smtp.rcpttodomain=ucw.cz smtp.mailfrom=siemens.com; dmarc=pass (p=reject sp=reject 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=WDIbHt+GIdNrdOWSe2pZSzaoc3EgQgnGfKLokJlxn5o=; b=NkY/6L5hU8PaIzVUyB7/9sCTmfSwRr13zuxzBPeiY6o3TkzS9Tat87VY1z5+/y9aG4FRNLKI/cATsxGHABIrhlQQvtjcO1GECnJCPi38ZICQT5eQFKX4YpjfBh4I61qtSwkIfpUKNFIXp0Hho2o3Zv0o2UnGNsxp6qE914sD3aj2R0OqxWuZmq9XdYAaymivnM/NmA1GvSB9JUtabVDRO7mNxZMO03en+EaG1c1bXIFCTufQednnw1/D/Tmoz619ldXx6E6VquNfyA687bxShEPZnpOZBzw3MbM/+5EehQp/wiiFsulXQgu/GMfW6DJiI7+2dlrAGdfNC5AUIwcg6Q== Received: from DB6PR0301CA0051.eurprd03.prod.outlook.com (2603:10a6:4:54::19) by DB3PR10MB6884.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:428::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 12:46:56 +0000 Received: from DB5EUR01FT052.eop-EUR01.prod.protection.outlook.com (2603:10a6:4:54:cafe::88) by DB6PR0301CA0051.outlook.office365.com (2603:10a6:4:54::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29 via Frontend Transport; Wed, 24 May 2023 12:46:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.75) 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.75 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.75; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.75) by DB5EUR01FT052.mail.protection.outlook.com (10.152.5.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 12:46:55 +0000 Received: from DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) 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.25; Wed, 24 May 2023 14:46:54 +0200 Received: from localhost.localdomain (139.22.37.129) by DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 24 May 2023 14:46:54 +0200 From: Henning Schild To: Pavel Machek , Lee Jones , Hans de Goede , Mark Gross , Andy Shevchenko , , , CC: Henning Schild Subject: [PATCH v4 4/4] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches Date: Wed, 24 May 2023 14:46:28 +0200 Message-ID: <20230524124628.32295-5-henning.schild@siemens.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230524124628.32295-1-henning.schild@siemens.com> References: <20230524124628.32295-1-henning.schild@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.22.37.129] X-ClientProxiedBy: DEMCHDC8WAA.ad011.siemens.net (139.25.226.104) To DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5EUR01FT052:EE_|DB3PR10MB6884:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d84974d-e11a-44a5-a0c9-08db5c54f4e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 52P0WMZL11Ws+CPPlMr0RgFx95a6czfa8NPX/1Yb8b4NnAozwhhgqJdIXGtgaYB4uQ0SQAmuTZw9v/iE5HzNydQ7XvreP2D2YYkEfSnLYzCSQRgmpespFRJ/1KIF229Uep0k4vXGNFIqaA9SYARAKilfGI+dykmvu2+i8Lq5vJoFkRyGkmk6QdnBDFqrXPz2nJ4xpCAUX8JS0FYGMyFBJ1xWtezMa++JRwRum4WngnHxUd8bKkijQKebbtrgADi4eugc2HHGM3jgsXVin/ihoxEauK8Ql1NGpo+8SXIYbWTkuQmhTajj+JuUn/dGv/slTmggiZhnbMwuGOwViPwEWk2pwRxtGwmzYYlM5SK004IMu5xcqkUlZYAXCgnEjBCW8c6w8OiHIF1/5cMZahkt3dJRbJB90PMYYa6I6rq5JM/Xa/fkF7Ws8sgLKf2hJc0B9lcxOtPmh/Xzmd/6gPxf3qCPVPoYvQ30sE4UwwN9CtEnb3E/AZbyjurMS2ZN7hxRBb+38vpQuFD+nRjP5uFY3bKkCDizy48QsdK9tvx9tks3UknfmJlq+4J/tBKkdJgAcKH3IZTXrvELR/25o8uRVfGFH8xXx75J0iZWiV7WUn61A6JoIJAtHxzIlWmGSH9tPAwABMD1QVoeZo+a07ZSsdlt3sFZzBqizSrnLXZJN2dlvnk1L2itdtBFCkPifEapF/MtlrYO8BURIPZXSVqkgJAC3XbckT+hzv4NDely/G8idIJbn+Xq/tUG9oNXUoFxTT/9H4dIL5UwntMhafXCKw== 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:(13230028)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(6666004)(26005)(1076003)(16526019)(186003)(316002)(356005)(82960400001)(5660300002)(107886003)(41300700001)(44832011)(82740400003)(40480700001)(40460700003)(36756003)(82310400005)(86362001)(956004)(2616005)(36860700001)(478600001)(83380400001)(47076005)(110136005)(336012)(81166007)(2906002)(8936002)(8676002)(4326008)(70206006)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 12:46:55.7711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d84974d-e11a-44a5-a0c9-08db5c54f4e1 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: DB5EUR01FT052.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR10MB6884 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers. Signed-off-by: Henning Schild Acked-by: Hans de Goede --- drivers/leds/simple/Kconfig | 31 ++++++++++++++++++++++++++++--- drivers/leds/simple/Makefile | 7 +++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/leds/simple/Kconfig b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig +++ b/drivers/leds/simple/Kconfig @@ -1,11 +1,36 @@ # SPDX-License-Identifier: GPL-2.0-only config LEDS_SIEMENS_SIMATIC_IPC tristate "LED driver for Siemens Simatic IPCs" - depends on LEDS_GPIO depends on SIEMENS_SIMATIC_IPC help This option enables support for the LEDs of several Industrial PCs from Siemens. - To compile this driver as a module, choose M here: the modules - will be called simatic-ipc-leds and simatic-ipc-leds-gpio. + To compile this driver as a module, choose M here: the module + will be called simatic-ipc-leds. + +config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE + tristate "LED driver for Siemens Simatic IPCs based on Intel Apollo Lake GPIO" + depends on LEDS_GPIO + depends on PINCTRL_BROXTON + depends on SIEMENS_SIMATIC_IPC + default LEDS_SIEMENS_SIMATIC_IPC + help + This option enables support for the LEDs of several Industrial PCs + from Siemens based on Apollo Lake GPIO i.e. IPC127E. + + To compile this driver as a module, choose M here: the module + will be called simatic-ipc-leds-gpio-apollolake. + +config LEDS_SIEMENS_SIMATIC_IPC_F7188X + tristate "LED driver for Siemens Simatic IPCs based on Nuvoton GPIO" + depends on LEDS_GPIO + depends on GPIO_F7188X + depends on SIEMENS_SIMATIC_IPC + default LEDS_SIEMENS_SIMATIC_IPC + help + This option enables support for the LEDs of several Industrial PCs + from Siemens based on Nuvoton GPIO i.e. IPC227G. + + To compile this driver as a module, choose M here: the module + will be called simatic-ipc-leds-gpio-f7188x. diff --git a/drivers/leds/simple/Makefile b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile +++ b/drivers/leds/simple/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-core.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-apollolake.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-f7188x.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) += simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o +obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) += simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o