Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp404783lqb; Fri, 24 May 2024 01:49:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3ACMYNfNbtd2BIpEBET8UhdtkqU/93XlhIinkUmpHufXgPP1Lnk7Qtsc08tqRAMwNKIJOuPYtZM91px9HP1U5fSbMeaKJHZaU+rk9eg== X-Google-Smtp-Source: AGHT+IGD+JXlJVUU5MaafJylTAM2QP7SbIoJnnLqpomyCOo1DGRvbWwL+UfIc92jIzFXWQM0F6pv X-Received: by 2002:a05:6214:5691:b0:6ab:3dce:30e with SMTP id 6a1803df08f44-6abbbc5e6e0mr14204486d6.4.1716540561198; Fri, 24 May 2024 01:49:21 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac070f0d75si11580046d6.254.2024.05.24.01.49.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 01:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=SAJfiW5a; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-188485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D74C71C20A0F for ; Fri, 24 May 2024 08:49:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32949129E8A; Fri, 24 May 2024 08:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="SAJfiW5a" Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2050.outbound.protection.outlook.com [40.107.21.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 845D712AACB; Fri, 24 May 2024 08:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.50 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716540509; cv=fail; b=fV5t0+nb5K6xbRUK510SoWpYKp1pXREqgtEsAoOnKIBBXT/Ii0oTUu/0XDd5K2OZb36WSJFIxX6pcw+VptS0le6lglBu+0EtBXvma62ZGSUmCkbj1+Z7apmaATSB7DkTXXfUqyjm2tng/At+gGcbRrGa5cO13EspzdiD4Sw8jjQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716540509; c=relaxed/simple; bh=UST1CuimqEbriXSDjaucQsENlov7zvfPaJsa85c4Yn0=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=lO1oHV//BPbc2e+QfZixbi+hLuDTV8xUEdgWndMzU1nme1kFQ//FLO7iGUZ7vzgypB3Pgmc+T/Q0FIl7nrchx0YzPUtCFcr6QfeJSJPaEqzvE74cB27TUW2l0pD547OnHgm8tNOBoW+BXxf1r5pt6NQtnNoJjvvq4PR60xymxYY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=SAJfiW5a; arc=fail smtp.client-ip=40.107.21.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Od9Dug1wopLwMXwUL55VG8anG97DPn8ndU1FkEUUbobKP6WThlDCBhNd0WfLyF5tOj42GhZt+9MlaL0bFIoMUi7RuovcDEl+TV9NdbvO/ulvj83wgCqhQh1ZUu8RSPN9FQv6cEnt+bJmWuuOiQuXi5JofItSIvwAqFFVwJ75+LBJS2FH8Qqn5KcGE35sFK2dEDbpiTDbsZL8U1Kk8bJBuph+pCINHIXFqMYy5dfM/ml1TfX8b1udlWg/AL4g0tery4exmptmS2iUN8JqqJmFW49dRBBJKsFQPWU6Vwy6vYhi13HNQSxoj/DzJb/jKJcCmjK75EwKZOT+gVoRhQ3WQQ== 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=8NQY5udEZ6Omsl8pKuZ+IUofTK0jwbagvhq1E6uaoio=; b=RRv5CmxBCetvPEzHILcoovO13oC6u/lLkzNNorr40jGu0b7YSfEH+l+USPZEwb1z3201x3zsA3x8eP6fpZdcDBksNoI8QvT7KF6ovy723y1oR9T0wLnKY3qbgui46vquzvE81rQPa4EnroJ0nYF5XjGFVd30gTDsC703wfL3XcDLxhupQ3PUn+aHdKzpxoRfTEbPscFgqcSiKdWgaiXVaOMU1RNKVhvlcWWR4Sdr8wWBOsFy+WaUmCYEZ9TU8F05y4NNg+ARFevP7rBFtIJmzrgQL4dEB6gvpmK6QgiDoO8aNBVuiAFvzkPeTEtoT7/GSh2bO+3X5I8UEfA95ApYXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8NQY5udEZ6Omsl8pKuZ+IUofTK0jwbagvhq1E6uaoio=; b=SAJfiW5aouMleQ5Veb08DJDuibkTFZL8sfsj2IXX9ljqpWUaeYzz3H2uTKyopD0m6DoqVNjDhVmQ+QqqRxRUPoEbIVpflmRus6J0qiaJV+/NL9IIjCR1aeJhdFSEQ/tDUk7Th2lngcQw6YsDu6mTXbqNxnG201x0U+I/cMFc/lQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VI1PR04MB7149.eurprd04.prod.outlook.com (2603:10a6:800:12e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Fri, 24 May 2024 08:48:24 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::557f:6fcf:a5a7:981c%7]) with mapi id 15.20.7611.016; Fri, 24 May 2024 08:48:24 +0000 From: "Peng Fan (OSS)" Date: Fri, 24 May 2024 16:56:47 +0800 Subject: [PATCH v4 5/6] firmware: imx: support i.MX95 BBM module Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240524-imx95-bbm-misc-v2-v4-5-dc456995d590@nxp.com> References: <20240524-imx95-bbm-misc-v2-v4-0-dc456995d590@nxp.com> In-Reply-To: <20240524-imx95-bbm-misc-v2-v4-0-dc456995d590@nxp.com> To: Jonathan Corbet , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sudeep Holla , Cristian Marussi , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peng Fan Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716541024; l=9301; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=KYTXizoOVzSc57FIiRlksrodLSf5KroN9SCC/ukM9b0=; b=yQzW0dtrAJUl8NZNLs95d+aCLrCAYAH+il+T0WnEUyCaHfk+nhykqizedGrUSiGgfaYDwqKz6 f7gXNnWnILGBorWfVBmjCoFW+ONWzK7wLbfPvXQIigaoBN5HTQugmHb X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0023.apcprd02.prod.outlook.com (2603:1096:4:1f4::19) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VI1PR04MB7149:EE_ X-MS-Office365-Filtering-Correlation-Id: 262250b7-d1cf-4bcc-a00e-08dc7bce45b1 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;AR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uTkpLd2F2OVFKRmdZNjNhbkpuT1lTalFkZnBZ?= =?utf-8?B?U0J1MlZjYnFRakRhYkYzV2tFMk1WdFBMaW9aQnlGbGc5TjlQSU9VV1o2ZUk3?= =?utf-8?Q?FXjnlRdMLB98H9yL1iy9FcRsBT4e0ELi8XSfw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(7416005)(52116005)(1800799015)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d1F6WU42MVp3dHhnQWI4akxYam5id1BYT1Nvc3RUeVUzaEROa255UEpINzZw?= =?utf-8?B?a3A4VUxaeTNsV0l5dWwzb2VnNVcxdVdoaDhFSzFFREdDdHU4VmVtZ2x2Z3cx?= =?utf-8?B?WW1kdnhxck5ncnZ0ZktGYkdPS04rU0VjMDhiWHBDSGJTelA2SGxXNGlrcFZm?= =?utf-8?B?akxkKzRTNXJsMGRDRXhKT2x0UzgrYmFleXM5TlgybVdQQlBub2gzdFFySzFq?= =?utf-8?B?MmpGdHBONlk3QkpETjdrTXA4WDFUNENENDc5Rll1QVlydU9GSCt3aDZxdkhr?= =?utf-8?B?cEJDZVVyVStwbWJtSDdvdjlvQXVaelR1ekF1U21kNlphYnVHY0NyeDN0d3VK?= =?utf-8?B?YXVyUktGdjdrc0Y1dlIvQ0toRjhmTGZleWoxNTlnTjN3bmRaTDhPOEs5ekYy?= =?utf-8?B?d20zUnc4ZXdPZXM3R0JrWHp6Q2l4eDBHTjNMN2pFWGVJczBaeFNOTWdkVEZN?= =?utf-8?B?R2U1ZGphNkkzWnJiOWRtc2NFMFRsWEd5ekl1OEFnM1FlckQzdjVVNkU1MHNt?= =?utf-8?B?RjlSL2kvYk51VjdIK21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?B?TnJ3bll4dmJZeVRYbmtXVTdPTDdTRGlXMFlPVlI0aGpGTnJBL0RxTnU0Z1ov?= =?utf-8?B?THo1V1BTSytoUms4cWlCLzFyaEI3UnB6MFdycXp2djluVHlhbFJvWTJQc2lT?= =?utf-8?B?OGZzLzA5c0drRkozT2I0bWRBSnZQMUpTUzNPaGYyY2FxUTYzc1VWNUlBVlB1?= =?utf-8?B?c3dycENDZzhpbk1SZ3ovUGs3bDFsclJrRDVkejJad2RqQTF5THBYa2Vwd0N6?= =?utf-8?B?YlRpOEJ2YnpVZDFtbEovVlBIaGhXZ2U1aVZMMmlrdjZ4WFFyckt1WTRrdVpM?= =?utf-8?B?TStYaTB4Z3NBTm5COTZDa3ZScU1FdHFxTTlITDc3Uk5Fc29sNEM5aEh0Rzlp?= =?utf-8?B?eGZPLzFDb2U5VURwTnpVNjZrbjg1OE1rRlBodk81T3ZOZmF0RWY0MC9kemk0?= =?utf-8?B?MytXWE9lbTJPUWZUcVFScFp5M05TVzkyZ0hXMkVtL1VXWVpGTDUzY2wyaDVh?= =?utf-8?B?TGFvczkxMFY5c0Y0TTFxY3l1SXVBQTJOWFhqQ0VZTWM4VzVqeDhmUHdORWJH?= =?utf-8?B?VXBlanhUTTFLVnNuNnB2TG9ZbnlBZEhLcjF3VUlwNEN4MXJsaEc1MGhGSlNW?= =?utf-8?B?QnAyb0k3L2crWURKVVpLRWo5Y3RPNUxaV2tySHVqdlE1QVgzU2hFZGJMSFp0?= =?utf-8?Q?Bc7YtZ4SULCmx6OH0IUvAObbW?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 262250b7-d1cf-4bcc-a00e-08dc7bce45b1 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2024 08:48:24.3637 (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: a2TFUp60S/dgfReowZnMSULWUWnHTpC+ysNpiLzhTDAphiEW7pqgzvs4YgJ0dopOuny93hTUC8Nf8pKOwy6P2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7149 From: Peng Fan The BBM module provides RTC and BUTTON feature. To i.MX95, this module is managed by System Manager. Linux could use i.MX SCMI BBM Extension protocol to use RTC and BUTTON feature. This driver is to use SCMI interface to get/set RTC, enable pwrkey. Signed-off-by: Peng Fan --- drivers/firmware/imx/Makefile | 1 + drivers/firmware/imx/sm-bbm.c | 314 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 315 insertions(+) diff --git a/drivers/firmware/imx/Makefile b/drivers/firmware/imx/Makefile index 8f9f04a513a8..fb20e22074e1 100644 --- a/drivers/firmware/imx/Makefile +++ b/drivers/firmware/imx/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_IMX_DSP) += imx-dsp.o obj-$(CONFIG_IMX_SCU) += imx-scu.o misc.o imx-scu-irq.o rm.o imx-scu-soc.o +obj-${CONFIG_IMX_SCMI_BBM_EXT} += sm-bbm.o diff --git a/drivers/firmware/imx/sm-bbm.c b/drivers/firmware/imx/sm-bbm.c new file mode 100644 index 000000000000..5e7083bf8fd3 --- /dev/null +++ b/drivers/firmware/imx/sm-bbm.c @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEBOUNCE_TIME 30 +#define REPEAT_INTERVAL 60 + +struct scmi_imx_bbm { + struct rtc_device *rtc_dev; + struct scmi_protocol_handle *ph; + const struct scmi_imx_bbm_proto_ops *ops; + struct notifier_block nb; + int keycode; + int keystate; /* 1:pressed */ + bool suspended; + struct delayed_work check_work; + struct input_dev *input; +}; + +static int scmi_imx_bbm_read_time(struct device *dev, struct rtc_time *tm) +{ + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + struct scmi_protocol_handle *ph = bbnsm->ph; + u64 val; + int ret; + + ret = bbnsm->ops->rtc_time_get(ph, 0, &val); + if (ret) + dev_err(dev, "%s: %d\n", __func__, ret); + + rtc_time64_to_tm(val, tm); + + return 0; +} + +static int scmi_imx_bbm_set_time(struct device *dev, struct rtc_time *tm) +{ + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + struct scmi_protocol_handle *ph = bbnsm->ph; + u64 val; + int ret; + + val = rtc_tm_to_time64(tm); + + ret = bbnsm->ops->rtc_time_set(ph, 0, val); + if (ret) + dev_err(dev, "%s: %d\n", __func__, ret); + + return 0; +} + +static int scmi_imx_bbm_alarm_irq_enable(struct device *dev, unsigned int enable) +{ + return 0; +} + +static int scmi_imx_bbm_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) +{ + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + struct scmi_protocol_handle *ph = bbnsm->ph; + struct rtc_time *alrm_tm = &alrm->time; + u64 val; + int ret; + + val = rtc_tm_to_time64(alrm_tm); + + ret = bbnsm->ops->rtc_alarm_set(ph, 0, val); + if (ret) + dev_err(dev, "%s: %d\n", __func__, ret); + + return 0; +} + +static const struct rtc_class_ops smci_imx_bbm_rtc_ops = { + .read_time = scmi_imx_bbm_read_time, + .set_time = scmi_imx_bbm_set_time, + .set_alarm = scmi_imx_bbm_set_alarm, + .alarm_irq_enable = scmi_imx_bbm_alarm_irq_enable, +}; + +static void scmi_imx_bbm_pwrkey_check_for_events(struct work_struct *work) +{ + struct scmi_imx_bbm *bbnsm = container_of(work, struct scmi_imx_bbm, check_work.work); + struct scmi_protocol_handle *ph = bbnsm->ph; + struct input_dev *input = bbnsm->input; + u32 state = 0; + int ret; + + ret = bbnsm->ops->button_get(ph, &state); + if (ret) { + pr_err("%s: %d\n", __func__, ret); + return; + } + + pr_debug("%s: state: %d, keystate %d\n", __func__, state, bbnsm->keystate); + + /* 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); + pr_debug("EV_KEY: %x\n", bbnsm->keycode); + } + + /* repeat check if pressed long */ + if (state) + schedule_delayed_work(&bbnsm->check_work, msecs_to_jiffies(REPEAT_INTERVAL)); +} + +static int scmi_imx_bbm_pwrkey_event(struct scmi_imx_bbm *bbnsm) +{ + struct input_dev *input = bbnsm->input; + + schedule_delayed_work(&bbnsm->check_work, msecs_to_jiffies(DEBOUNCE_TIME)); + + /* + * Directly report key event after resume to make no key press + * event is missed. + */ + if (bbnsm->suspended) { + bbnsm->keystate = 1; + input_event(input, EV_KEY, bbnsm->keycode, 1); + input_sync(input); + bbnsm->suspended = false; + } + + return 0; +} + +static void scmi_imx_bbm_pwrkey_act(void *pdata) +{ + struct scmi_imx_bbm *bbnsm = pdata; + + cancel_delayed_work_sync(&bbnsm->check_work); +} + +static int scmi_imx_bbm_notifier(struct notifier_block *nb, unsigned long event, void *data) +{ + struct scmi_imx_bbm *bbnsm = container_of(nb, struct scmi_imx_bbm, nb); + struct scmi_imx_bbm_notif_report *r = data; + + if (r->is_rtc) + rtc_update_irq(bbnsm->rtc_dev, 1, RTC_AF | RTC_IRQF); + if (r->is_button) { + pr_debug("BBM Button Power key pressed\n"); + scmi_imx_bbm_pwrkey_event(bbnsm); + } + + return 0; +} + +static int scmi_imx_bbm_pwrkey_init(struct scmi_device *sdev) +{ + const struct scmi_handle *handle = sdev->handle; + struct device *dev = &sdev->dev; + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + struct input_dev *input; + int ret; + + if (device_property_read_u32(dev, "linux,code", &bbnsm->keycode)) { + bbnsm->keycode = KEY_POWER; + dev_warn(dev, "key code is not specified, using default KEY_POWER\n"); + } + + INIT_DELAYED_WORK(&bbnsm->check_work, scmi_imx_bbm_pwrkey_check_for_events); + + input = devm_input_allocate_device(dev); + if (!input) { + dev_err(dev, "failed to allocate the input device for SCMI IMX BBM\n"); + return -ENOMEM; + } + + input->name = dev_name(dev); + input->phys = "bbnsm-pwrkey/input0"; + input->id.bustype = BUS_HOST; + + input_set_capability(input, EV_KEY, bbnsm->keycode); + + ret = devm_add_action_or_reset(dev, scmi_imx_bbm_pwrkey_act, bbnsm); + if (ret) { + dev_err(dev, "failed to register remove action\n"); + return ret; + } + + bbnsm->input = input; + + ret = handle->notify_ops->devm_event_notifier_register(sdev, SCMI_PROTOCOL_IMX_BBM, + SCMI_EVENT_IMX_BBM_BUTTON, + NULL, &bbnsm->nb); + + if (ret) + dev_err(dev, "Failed to register BBM Button Events %d:", ret); + + ret = input_register_device(input); + if (ret) { + dev_err(dev, "failed to register input device\n"); + return ret; + } + + return 0; +} + +static int scmi_imx_bbm_rtc_init(struct scmi_device *sdev) +{ + const struct scmi_handle *handle = sdev->handle; + struct device *dev = &sdev->dev; + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + int ret; + + bbnsm->rtc_dev = devm_rtc_allocate_device(dev); + if (IS_ERR(bbnsm->rtc_dev)) + return PTR_ERR(bbnsm->rtc_dev); + + bbnsm->rtc_dev->ops = &smci_imx_bbm_rtc_ops; + bbnsm->rtc_dev->range_min = 0; + bbnsm->rtc_dev->range_max = U32_MAX; + + ret = devm_rtc_register_device(bbnsm->rtc_dev); + if (ret) + return ret; + + bbnsm->nb.notifier_call = &scmi_imx_bbm_notifier; + return handle->notify_ops->devm_event_notifier_register(sdev, SCMI_PROTOCOL_IMX_BBM, + SCMI_EVENT_IMX_BBM_RTC, + NULL, &bbnsm->nb); +} + +static int scmi_imx_bbm_probe(struct scmi_device *sdev) +{ + const struct scmi_handle *handle = sdev->handle; + struct device *dev = &sdev->dev; + struct scmi_protocol_handle *ph; + struct scmi_imx_bbm *bbnsm; + int ret; + + if (!handle) + return -ENODEV; + + bbnsm = devm_kzalloc(dev, sizeof(struct scmi_imx_bbm), GFP_KERNEL); + if (!bbnsm) + return -ENOMEM; + + bbnsm->ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_IMX_BBM, &ph); + if (IS_ERR(bbnsm->ops)) + return PTR_ERR(bbnsm->ops); + + bbnsm->ph = ph; + + device_init_wakeup(dev, true); + + dev_set_drvdata(dev, bbnsm); + + ret = scmi_imx_bbm_rtc_init(sdev); + if (ret) { + dev_err(dev, "rtc init failed: %d\n", ret); + return ret; + } + + ret = scmi_imx_bbm_pwrkey_init(sdev); + if (ret) { + dev_err(dev, "pwr init failed: %d\n", ret); + return ret; + } + + return 0; +} + +static int __maybe_unused scmi_imx_bbm_suspend(struct device *dev) +{ + struct scmi_imx_bbm *bbnsm = dev_get_drvdata(dev); + + bbnsm->suspended = true; + + return 0; +} + +static int __maybe_unused scmi_imx_bbm_resume(struct device *dev) +{ + return 0; +} + +static SIMPLE_DEV_PM_OPS(scmi_imx_bbm_pm_ops, scmi_imx_bbm_suspend, scmi_imx_bbm_resume); + +static const struct scmi_device_id scmi_id_table[] = { + { SCMI_PROTOCOL_IMX_BBM, "imx-bbm" }, + { }, +}; +MODULE_DEVICE_TABLE(scmi, scmi_id_table); + +static struct scmi_driver scmi_imx_bbm_driver = { + .driver = { + .pm = &scmi_imx_bbm_pm_ops, + }, + .name = "scmi-imx-bbm", + .probe = scmi_imx_bbm_probe, + .id_table = scmi_id_table, +}; +module_scmi_driver(scmi_imx_bbm_driver); + +MODULE_AUTHOR("Peng Fan "); +MODULE_DESCRIPTION("IMX SM BBM driver"); +MODULE_LICENSE("GPL"); -- 2.37.1