From patchwork Tue Jan 3 07:47:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 638899 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 D7A26C46467 for ; Tue, 3 Jan 2023 07:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236903AbjACHqm (ORCPT ); Tue, 3 Jan 2023 02:46:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjACHql (ORCPT ); Tue, 3 Jan 2023 02:46:41 -0500 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2045.outbound.protection.outlook.com [40.107.15.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4865FB11; Mon, 2 Jan 2023 23:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DeNRghVnwxJk9jhBtxdnJigo6Y6lHASXCeUrrxrHv+CGRtiPLmH4S68T+iFYtlhtu3GeUQeN+5Q8Ywkh0fwE+CpB67kw29iU9NtUkan6WWu9mok8WkM7/1pehWJ0C/YmJv8Xim9ZTwJDdk1bS5NRH0CwV5FKgXJE+ql6a4Aa/0qNiSomqwA43k13/meD1VAIlnISVvkxk15tgUKHqAiDax3PvqqWVrOr0jWAA+mTzQZTplMBITwY2L5mTPOCfJ3IcXB7n4XjaRQqzoASOvh2zhMeY3eyHSZ6gJkqjicK+Jcb5dIig3qb9EyamPpoUG0DBANbcVE9oI42BbqQLoCE8A== 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=qbq+1S/My0nG+foNSTCZdaBMPPvDkGM3ynEhyXEX1lQ=; b=jBJMqdUf4ghscEI6oxGjN2nxbBd+sF59BN79eYlvEW64ejJApEIFt8U7/lv5OqnsChFJgsxQpFE/qnBnxsc60EH6hkgVsGACq/VZzOB5cgNUXo1tuXKlGj7kE1nUWfsIvwete7EcaHQ+4Km6E5PhgTV8NhErTbpqDlU+7aXqbdev6ASEPGk7AJ2tNEW8FBO1eNziYQvOe57QokuCHBJrscUSYtdSkSjNM6lLPSL8tjivyxMb1nov3i7Z9T2S1YL8h72bu4ja5ObswxS434/Hl7jYcNLCAOaI9Bu3vWsgncv7HRKQvaQI7Dk9vh+3LEQ3/YrDTyRUXi/yp2jWO8iIPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qbq+1S/My0nG+foNSTCZdaBMPPvDkGM3ynEhyXEX1lQ=; b=Xtct89v4ORwe0d+l7T5xupe2imfbjRiYizGxsCAQAkNgegK+jfRm+AD7FX5pFD5Xh9yfX+Ponuzi/QBhaSn9aobvcGwfb3ulog4Nw6cU0kPU/qafVheG7eHezGWPPRFpd21uA7XmZ6RgobsDA6L15i4momZbjKJEFg9yiYTRZQQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8650.eurprd04.prod.outlook.com (2603:10a6:20b:43d::18) by VI1PR04MB6894.eurprd04.prod.outlook.com (2603:10a6:803:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 07:46:37 +0000 Received: from AM9PR04MB8650.eurprd04.prod.outlook.com ([fe80::286e:e16f:828f:f4ce]) by AM9PR04MB8650.eurprd04.prod.outlook.com ([fe80::286e:e16f:828f:f4ce%8]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 07:46:37 +0000 From: Jacky Bai To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, dmitry.torokhov@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com, festevam@gmail.com Subject: [PATCH v3 2/4] input: bbnsm_pwrkey: Add bbnsm power key support Date: Tue, 3 Jan 2023 15:47:40 +0800 Message-Id: <20230103074742.2324924-3-ping.bai@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230103074742.2324924-1-ping.bai@nxp.com> References: <20230103074742.2324924-1-ping.bai@nxp.com> X-ClientProxiedBy: SG2PR02CA0020.apcprd02.prod.outlook.com (2603:1096:3:17::32) To AM9PR04MB8650.eurprd04.prod.outlook.com (2603:10a6:20b:43d::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8650:EE_|VI1PR04MB6894:EE_ X-MS-Office365-Filtering-Correlation-Id: ef5c0efb-66e0-459b-e00b-08daed5ea4f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CWJZp5r4tYrUK1Er9eZcO066Wu4TyK9oMwM6RRXRXoLXlZjzMpGEobb/Z18FEcbM7AA5EKRKlzNLEVKfJqADScL5/n6LGRsDlXcAY/HDl7Hlto1BqB+kpwNxB2HFSi8jZu08Gy+cAQD70kQxObE6lQs1xkfpTOqZSTVZWiPwW9xmIEn0yIUD9d1MIIuqg1ugXUeDA2KUx/D01EV9zUzfsbLAAJiipZif32uyVIAsOKxI2BMcMve9ayrq4JjApAgTegx4orkceoyzfNZkNseYcHFO3GcrpeyXtM5Zvz/WuMMXGDXUVI3MhbZpP2YcdCJFV0bLbLPxfTJJJCq5FS0jUxXdb404rTo4wylkAXQ6vjP8+769ylBkQVwWgk07rcIBos0Z3QSvvzxngxjljBx0e3f3z3sprMwYCp5hP4k16Ap4mKVjoaTpirLrlFSv3VHfa04saD+ja+b1bYU1kR+zPII16pNNMOLfOFqrKoR7ZAHJeO5jkito9/O6ln9DUCWTpVNLPg+6cBtrSm4s6w9x3RxZODju1l6E+r9Rugxdl4lBtnTutOMK/O7rlUIy3vITA9bvT9fFu3MJfqwcbDkpo07lv+bimtThfjWbJjBusXfCGgQSDT+IsbUig1gYy5RBBeMt3r6Z3hssEhHc/x+hBn5C5/RqAUYezujbTPOSRSPEvNNuPQYytxfudw57vlXHvmHBq+1T8GvrnPJJFKx7KTI3qqAEgykX33+p67kdcxE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8650.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(376002)(346002)(366004)(39860400002)(451199015)(8936002)(41300700001)(6666004)(2906002)(8676002)(38100700002)(66946007)(1076003)(38350700002)(7416002)(83380400001)(66476007)(5660300002)(66556008)(4326008)(186003)(478600001)(6512007)(26005)(2616005)(316002)(6486002)(52116002)(36756003)(6506007)(86362001)(22166006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S1dXNIyNjZxo2nDjIvmbvM3C+3yVfrzl+W+55VKxLaiKajqfwjuBCL7Grw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aCzyWn49ksptFWEMWenThdePDPhjVcIaAGWmBm9QiIv5GJHmm2Sjrk5sPmDFMpXGGVtiSwTFmo8CjFFa0U6iUdwoMRMDgQMHgsPpxKidKr9R6zBTkCSCtOKMU8jrvFC4t6GAYmgJFcQ36dPhR0oK+SoJ5U5F/CkOkYIyl9hpcZBOjCc23c9qGqofi9PlsTeV/An+BymsycBuQ9NEPxo4krgNaXgXCTazMNKT1Qns4lAtPpondDZPd92D9e0xLI12x0zTODodAtRDfTml1ipLdKTqJxSuWKTRZqIMf0rTdJdJGBsqv1IAdFSURnhAmioZPWetA0yyT1zgXv63hu7NSgHVsTgvtlS8/RliKCufugzHgSq1U+c1mvyyOdsAV236z3g//O6sCoyw3LiH2+hy1DjmK8ffCQK9Sqx+91iSkiCyqp8RWyBvYJggGWk0NBE689k27BF5jGwYVFLP4qaGE6HGF9X X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef5c0efb-66e0-459b-e00b-08daed5ea4f3 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8650.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 07:46:37.8375 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9Odw5MPELLn0Jvhun389oMKM3MOGQSB5Vey5HDlJjZ4dNNEA6OC4MfY+4DP+n8choaN9Auw27imFC7HMpj0ejw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6894 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ON/OFF logic inside the BBNSM allows for connecting directly into a PMIC or other voltage regulator device. The module has an button input signal and a wakeup request input signal. It also has two interrupts (set_pwr_off_irq and set_pwr_on_irq) and an active-low PMIC enable (pmic_en_b) output. Add the power key support for the ON/OFF button function found in BBNSM module. Signed-off-by: Jacky Bai Reviewed-by: Peng Fan --- - v2 changes: - use device_property_read_u32() to read the property - clean up the goto return, return directly - sort the header file alphabetically - rename the file to add 'nxp' prefix - v3 changes: - get the regmap directly from the parent node --- drivers/input/keyboard/Kconfig | 11 ++ drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/nxp-bbnsm-pwrkey.c | 190 ++++++++++++++++++++++ 3 files changed, 202 insertions(+) create mode 100644 drivers/input/keyboard/nxp-bbnsm-pwrkey.c diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 84490915ae4d..43827e34f276 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -456,6 +456,17 @@ config KEYBOARD_SNVS_PWRKEY To compile this driver as a module, choose M here; the module will be called snvs_pwrkey. +config KEYBOARD_BBNSM_PWRKEY + tristate "NXP BBNSM Power Key Driver" + depends on ARCH_MXC || COMPILE_TEST + depends on OF + help + This is the bbnsm powerkey driver for the NXP i.MX application + processors. + + To compile this driver as a module, choose M here; the + module will be called bbnsm_pwrkey. + config KEYBOARD_IMX tristate "IMX keypad support" depends on ARCH_MXC || COMPILE_TEST diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 5f67196bb2c1..e34dd65a34c3 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_APPLESPI) += applespi.o obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o +obj-$(CONFIG_KEYBOARD_BBNSM_PWRKEY) += nxp-bbnsm-pwrkey.o obj-$(CONFIG_KEYBOARD_BCM) += bcm-keypad.o obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o diff --git a/drivers/input/keyboard/nxp-bbnsm-pwrkey.c b/drivers/input/keyboard/nxp-bbnsm-pwrkey.c new file mode 100644 index 000000000000..dc937036c952 --- /dev/null +++ b/drivers/input/keyboard/nxp-bbnsm-pwrkey.c @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Copyright 2022 NXP. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BBNSM_CTRL 0x8 +#define BBNSM_INT_EN 0x10 +#define BBNSM_EVENTS 0x14 +#define BBNSM_PAD_CTRL 0x24 + +#define BBNSM_BTN_PRESSED BIT(7) +#define BBNSM_PWR_ON BIT(6) +#define BBNSM_BTN_OFF BIT(5) +#define BBNSM_EMG_OFF BIT(4) +#define BBNSM_PWRKEY_EVENTS (BBNSM_PWR_ON | BBNSM_BTN_OFF | BBNSM_EMG_OFF) +#define BBNSM_DP_EN BIT(24) + +#define DEBOUNCE_TIME 30 +#define REPEAT_INTERVAL 60 + +struct bbnsm_pwrkey { + struct regmap *regmap; + int irq; + int keycode; + int keystate; /* 1:pressed */ + struct timer_list check_timer; + struct input_dev *input; +}; + +static void bbnsm_pwrkey_check_for_events(struct timer_list *t) +{ + struct bbnsm_pwrkey *bbnsm = from_timer(bbnsm, t, check_timer); + struct input_dev *input = bbnsm->input; + u32 state; + + regmap_read(bbnsm->regmap, BBNSM_EVENTS, &state); + + state = state & BBNSM_BTN_PRESSED ? 1 : 0; + + /* only report new event if status changed */ + if (state ^ bbnsm->keystate) { + bbnsm->keystate = state; + input_event(input, EV_KEY, bbnsm->keycode, state); + input_sync(input); + pm_relax(bbnsm->input->dev.parent); + } + + /* repeat check if pressed long */ + if (state) { + mod_timer(&bbnsm->check_timer, + jiffies + msecs_to_jiffies(REPEAT_INTERVAL)); + } +} + +static irqreturn_t bbnsm_pwrkey_interrupt(int irq, void *dev_id) +{ + struct platform_device *pdev = dev_id; + struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev); + struct input_dev *input = bbnsm->input; + u32 event; + + regmap_read(bbnsm->regmap, BBNSM_EVENTS, &event); + if (event & BBNSM_BTN_OFF) + mod_timer(&bbnsm->check_timer, jiffies + msecs_to_jiffies(DEBOUNCE_TIME)); + else + return IRQ_NONE; + + pm_wakeup_event(input->dev.parent, 0); + + /* clear PWR OFF */ + regmap_write(bbnsm->regmap, BBNSM_EVENTS, BBNSM_BTN_OFF); + + return IRQ_HANDLED; +} + +static void bbnsm_pwrkey_act(void *pdata) +{ + struct bbnsm_pwrkey *bbnsm = pdata; + + del_timer_sync(&bbnsm->check_timer); +} + +static int bbnsm_pwrkey_probe(struct platform_device *pdev) +{ + struct bbnsm_pwrkey *bbnsm; + struct input_dev *input; + struct device_node *np = pdev->dev.of_node; + int error; + + bbnsm = devm_kzalloc(&pdev->dev, sizeof(*bbnsm), GFP_KERNEL); + if (!bbnsm) + return -ENOMEM; + + bbnsm->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(bbnsm->regmap)) { + dev_err(&pdev->dev, "bbnsm pwerkey get regmap failed\n"); + return PTR_ERR(bbnsm->regmap); + } + + if (of_property_read_u32(np, "linux,code", &bbnsm->keycode)) { + bbnsm->keycode = KEY_POWER; + dev_warn(&pdev->dev, "KEY_POWER without setting in dts\n"); + } + + bbnsm->irq = platform_get_irq(pdev, 0); + if (bbnsm->irq < 0) + return -EINVAL; + + /* config the BBNSM power related register */ + regmap_update_bits(bbnsm->regmap, BBNSM_CTRL, BBNSM_DP_EN, BBNSM_DP_EN); + + /* clear the unexpected interrupt before driver ready */ + regmap_write_bits(bbnsm->regmap, BBNSM_EVENTS, BBNSM_PWRKEY_EVENTS, BBNSM_PWRKEY_EVENTS); + + timer_setup(&bbnsm->check_timer, bbnsm_pwrkey_check_for_events, 0); + + input = devm_input_allocate_device(&pdev->dev); + if (!input) { + dev_err(&pdev->dev, "failed to allocate the input device\n"); + return -ENOMEM; + } + + input->name = pdev->name; + input->phys = "bbnsm-pwrkey/input0"; + input->id.bustype = BUS_HOST; + + input_set_capability(input, EV_KEY, bbnsm->keycode); + + /* input customer action to cancel release timer */ + error = devm_add_action(&pdev->dev, bbnsm_pwrkey_act, bbnsm); + if (error) { + dev_err(&pdev->dev, "failed to register remove action\n"); + return error; + } + + bbnsm->input = input; + platform_set_drvdata(pdev, bbnsm); + + error = devm_request_irq(&pdev->dev, bbnsm->irq, bbnsm_pwrkey_interrupt, + IRQF_SHARED, pdev->name, pdev); + if (error) { + dev_err(&pdev->dev, "interrupt not available.\n"); + return error; + } + + error = input_register_device(input); + if (error < 0) { + dev_err(&pdev->dev, "failed to register input device\n"); + return error; + } + + device_init_wakeup(&pdev->dev, true); + dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq); + + return 0; +} + +static const struct of_device_id bbnsm_pwrkey_ids[] = { + { .compatible = "nxp,bbnsm-pwrkey" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, bbnsm_pwrkey_ids); + +static struct platform_driver bbnsm_pwrkey_driver = { + .driver = { + .name = "bbnsm_pwrkey", + .of_match_table = bbnsm_pwrkey_ids, + }, + .probe = bbnsm_pwrkey_probe, +}; +module_platform_driver(bbnsm_pwrkey_driver); + +MODULE_AUTHOR("Jacky Bai "); +MODULE_DESCRIPTION("NXP bbnsm power key Driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Jan 3 07:47:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Bai X-Patchwork-Id: 638898 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 BBA6EC54EBD for ; Tue, 3 Jan 2023 07:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236942AbjACHqx (ORCPT ); Tue, 3 Jan 2023 02:46:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236919AbjACHqw (ORCPT ); Tue, 3 Jan 2023 02:46:52 -0500 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2042.outbound.protection.outlook.com [40.107.15.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2D01A1; Mon, 2 Jan 2023 23:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jSn3i1wyavlqmMlsAhURTLShnqzyKx048gtkyA9cmkEwALT3hH5PNrpLLqCyNXDhoC2zV5IENvCNGuuLmiXOocG8w039Cg6+pqv9fQ/Q5VVamZ3xDc3KmZApviTJO+bQm5Mq4zUXQPouL94j4+9XqUo1cvBWFZyW5AIkJ4fmKNnqgp3+KD7e0oLiGPxKzlkgnduzutfQ2F1GiVGQYQCUCxkRcORISGOqPxkVCi9CCpvs/vSsBp9FHgVN/swcQI6pFq7KZywbOESejtKoPmEuZVPehQJsDdrZGIwetWzpTLk1KwTQaR6JJAhdpiG2JLwjV+7UyBnPDXbQ9eGRt9BsrA== 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=MNlQVwb74W5iMtsoxgWGgPRcmkQt8vMxbn60Ftt5VJQ=; b=mRw8kJp5IodycpDGNO4vhlbBtGAvm7rGVD2YHSoaA8/2MUxg6en4RppHOLxP9BFHNkSwXZV8crxBQcQNOsjNWMoNqFPS1xjC+bNtnBvUwZqg5Wan5yLmO1CwNdfSBHZm+aejhNxyTO6KYcyvw441RfzN5lGUJPbvYk7jpCoNv6qR6+j3hsE+BjdwpzR8W8P+J+VpB2z6rTQ3jcVQWDJbXH1/usq5s/zR+vpbP8mqBtBF60WWCPgk2O6DrWiCCcSUSPBu30+K7tw1Rkx/rwajw5WT9pZI62zL2jSvRADTTzXQH+A26YsNnw4/k4BwPU7SZvpzgW1Ze+MNwVUKDWHFBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNlQVwb74W5iMtsoxgWGgPRcmkQt8vMxbn60Ftt5VJQ=; b=W9B5DIgW1owjlIL85YMxU/2bKaKLcVc5nWolIMSm/4koi8+JF7JBw6zPf8VIGL4rrBf25RvGzvo8bphvrrVIqgaqTVV77qs10WsA3c6S+zh7B7RaXDKDE2SV4QlDQLYiZ/U8OU+37ojqhMnUsA/J8PnziEiT2CxXK4qEt7JEZZY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8650.eurprd04.prod.outlook.com (2603:10a6:20b:43d::18) by VI1PR04MB6894.eurprd04.prod.outlook.com (2603:10a6:803:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 07:46:49 +0000 Received: from AM9PR04MB8650.eurprd04.prod.outlook.com ([fe80::286e:e16f:828f:f4ce]) by AM9PR04MB8650.eurprd04.prod.outlook.com ([fe80::286e:e16f:828f:f4ce%8]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 07:46:49 +0000 From: Jacky Bai To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, dmitry.torokhov@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com, festevam@gmail.com Subject: [PATCH v3 4/4] arm64: dts: imx93: Add the bbnsm dts node Date: Tue, 3 Jan 2023 15:47:42 +0800 Message-Id: <20230103074742.2324924-5-ping.bai@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230103074742.2324924-1-ping.bai@nxp.com> References: <20230103074742.2324924-1-ping.bai@nxp.com> X-ClientProxiedBy: SG2PR02CA0020.apcprd02.prod.outlook.com (2603:1096:3:17::32) To AM9PR04MB8650.eurprd04.prod.outlook.com (2603:10a6:20b:43d::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8650:EE_|VI1PR04MB6894:EE_ X-MS-Office365-Filtering-Correlation-Id: 501982b5-00d8-4c35-489b-08daed5eab9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TzLB1CUM2kAUpPYKzY7Q4PKI/PSYplQT4WhhbEnRk8KWaAA3LmT+2oQGDaYf2MQH4JTXj4aa4+dKVjLfjc34nqeFTIWw91D9ZYNujOqtbF6Xqwk8QmITV3IyP/J7CaKfWRKxXIepsMquVrqx7QQXxMCtr8IBB3eDKWfmZmRhmEn1WJFZTbZ/aRxsEjd5v9TXh1ou4L+44cyROXkRDl0gYEJiyrLHAWEohDOGW7ZwlEj84j1Z8QEwU720fpieSqIKwNeHdy2pd+Lnlb2qJKNAiDH6gzZ1ZGmHr6g5cBePPiaYpLrZhk18ow2qC3W+28PD2LG5qYeN6DrBIQKJ7yQufjRHEhRhClT920cFGaHhUSvAjkoMdXgGr0xuOQyrDYPmfPwquXakKI/wHnmEeZfqORb1iAKtVylbeHzkNX9TJm59O2FRiAza+XqMhkt+WaUfUGkihfw4otiofhr7lTDqnurVGdIJHx7gUWKudDsa9AropQl1Ts0xWzTTWOlK8qYpg+Hpt7/mqPjdZGGdr/qEEz/WJ6Yzl8RpiLKywr59gWf0w5IyVcwEDaEf8zkIqpzqbEX3CQWb6Kca3FFW8taDGnPFfc4FqdG+Gzp/Z4TMMPH1RrOh5Gnz+LvPtH5UpL3WoQw9Egmc7bGDlGorlfy6QFMuV5Ku/Jab/Qi1/JXFNWPk5GMsz1cgz8yt2m74pZ0dYTbWCQ5SO0eW3lrzD0vahKcqj2S1ypKevPyFxNGiQOI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8650.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(376002)(346002)(366004)(39860400002)(451199015)(8936002)(41300700001)(6666004)(2906002)(8676002)(38100700002)(66946007)(1076003)(38350700002)(7416002)(83380400001)(66476007)(5660300002)(66556008)(4326008)(186003)(478600001)(6512007)(26005)(2616005)(316002)(6486002)(52116002)(36756003)(6506007)(86362001)(22166006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Eo5EPRFQHm65OiFmOgxIkOXynnLQ1wb9OzdwPzFyLI0hYIaVsPx5upczDT9+DzL2fOSfPuxTKQubqilC/ycEGhnvrVVKncPIhj9tsnyYRIxo8Z4Z5t4xkh2vuXxbvinqCDqEXkF54Lm6YRMZWZmJBBe8Ia1Mb67lM844hJ67rAkXiKeh8V/MFcluK9kSTQMYlMwOhSxBnVEKx5aZWfmJ9RgFhxLzvgcPNYFyVo+icAUCb5muaF9jZvtWrKS9DHXapQPRAVB17BH0y7ql5gZWtOB/iuolrXFyt1yW55UigNgWudPu6U8iY/9/7ZznIOWraGRLTcQUKPi5UHb6/YQWfU9tGqkNwiyAhJk77gn/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pkgij3CX3oMaht/TzX8ycHcGozYNbNKUwA72DXv9M8eryeymep2isO8ppInBN5mdKWy+qwPQMOK0Ezf9DLqb6bcz9t/cVFD6GMNP/dXr8maGvC+0oMYfSjopgQopYApVZgWOdXhoCnyBUD2s9WJwrfyDXt41 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 501982b5-00d8-4c35-489b-08daed5eab9a X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8650.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 07:46:49.1049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lCklA6mxXmCn559d65CoY3WtE3UHueTg1UihoYs32AKUSbKeWDyIxBHt/91ic+7p5w3aEQpg2coupbiov8LUhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6894 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the bbnsm node for RTC & ON/OFF button support Signed-off-by: Jacky Bai --- - v2 changes: - update the regmap property to align with binding doc - v3 changes: - remove 'nxp,bbnsm-regmap' property to align with binding doc --- arch/arm64/boot/dts/freescale/imx93.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi index 5d79663b3b84..bac3fdd0041e 100644 --- a/arch/arm64/boot/dts/freescale/imx93.dtsi +++ b/arch/arm64/boot/dts/freescale/imx93.dtsi @@ -229,6 +229,22 @@ iomuxc: pinctrl@443c0000 { status = "okay"; }; + bbnsm: bbnsm@44440000 { + compatible = "nxp,bbnsm", "syscon", "simple-mfd"; + reg = <0x44440000 0x10000>; + + bbnsm_rtc: rtc { + compatible = "nxp,bbnsm-rtc"; + interrupts = ; + }; + + bbnsm_pwrkey: pwrkey { + compatible = "nxp,bbnsm-pwrkey"; + interrupts = ; + linux,code = ; + }; + }; + clk: clock-controller@44450000 { compatible = "fsl,imx93-ccm"; reg = <0x44450000 0x10000>;