Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp326366pxk; Thu, 3 Sep 2020 00:12:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtGXM8y+zGt1YR6m8scY4tC+/cNJMD00Po/q42P0NXLurlDhTKJJ/HRvJnIHoYLK5aOiTS X-Received: by 2002:a17:906:c7da:: with SMTP id dc26mr678528ejb.491.1599117140275; Thu, 03 Sep 2020 00:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599117140; cv=none; d=google.com; s=arc-20160816; b=kUHv/T1I4aduZghx9bYLcD5+odQ9435yltXa0yHehdqigtWZbzbSTsJRnB0paQL5dN LlChcvdm7w3Dztmq3PyIl2DM/3jsbL0O02mT+VHRhUc46OtBxox74f3nrGgAugfNMKqB yeEiXLDDhY0+QMBq6i2joloj8QVS8/ZlTT4Gw2XhomEew7pMNJKRKjlEWdZDB3vINOEc AO+9CwKhkmDDBlNrCLtKeUz3+G+khcOe4CZFan3DDt8Iq2A3XBljeMPqTdVChP/gFSaK nVlcIL8+ZGXc+gZbooGkI7kpLXZdoJvQ9q7F+OTU0EcFDmQSJJ5gS/2NSNMLV3WiP5sm /eww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=rBUkuTmOl2WIMZdkcAWh8EO9zd5FjIGvqh/VYVilpPs=; b=NKWEj3cKQEFu2W7fZfxdmiCTQFLKKejs8eWTQHl71r3ZnSdh56rUzqSOOtlF9RO11R 6D1b3tyqOAUHA+kl+0x+E2AKhqzg6v1NsogxkUIldt3fwwJIAaen1DNk58KQijoSdcgJ h3LX5mbryujJqpq7drDWSCd8BQPNoV993JRZ0ec7FpyC9xbQbSJAoPvRt2pGuAmo8LWj TXz2W+ihG+GPuf4sJBqospNEctdyt+biSN1PduOFqhwcPbXCZzTLsPbT6usEPP9HTcz8 PfeQ1EmWTPZHnwRjB9RkRjHwzmLwwhR+t1D8oDvRZiRlhpz1g5/DHRDlt+Ludc/Fxt6X tTgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz18si1295562ejb.598.2020.09.03.00.11.56; Thu, 03 Sep 2020 00:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727943AbgICHJs (ORCPT + 99 others); Thu, 3 Sep 2020 03:09:48 -0400 Received: from inva021.nxp.com ([92.121.34.21]:35968 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbgICHJs (ORCPT ); Thu, 3 Sep 2020 03:09:48 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 80C1C2014D3; Thu, 3 Sep 2020 09:09:46 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7748E200233; Thu, 3 Sep 2020 09:09:43 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 52FB640249; Thu, 3 Sep 2020 09:09:39 +0200 (CEST) From: Ran Wang To: Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Ma , Ran Wang Subject: [PATCH v5] soc: fsl: enable acpi support in RCPM driver Date: Thu, 3 Sep 2020 15:01:58 +0800 Message-Id: <20200903070158.27399-1-ran.wang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Ma This patch enables ACPI support in RCPM driver. Signed-off-by: Peng Ma Signed-off-by: Ran Wang --- Change in v5: - Fix panic when dev->of_node is null Change in v4: - Make commit subject more accurate - Remove unrelated new blank line Change in v3: - Add #ifdef CONFIG_ACPI for acpi_device_id - Rename rcpm_acpi_imx_ids to rcpm_acpi_ids Change in v2: - Update acpi_device_id to fix conflict with other driver drivers/soc/fsl/rcpm.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c index a093dbe..58870f4 100644 --- a/drivers/soc/fsl/rcpm.c +++ b/drivers/soc/fsl/rcpm.c @@ -2,7 +2,7 @@ // // rcpm.c - Freescale QorIQ RCPM driver // -// Copyright 2019 NXP +// Copyright 2019-2020 NXP // // Author: Ran Wang @@ -13,6 +13,7 @@ #include #include #include +#include #define RCPM_WAKEUP_CELL_MAX_SIZE 7 @@ -56,10 +57,14 @@ static int rcpm_pm_prepare(struct device *dev) "fsl,rcpm-wakeup", value, rcpm->wakeup_cells + 1); - /* Wakeup source should refer to current rcpm device */ - if (ret || (np->phandle != value[0])) + if (ret) continue; + if (is_of_node(dev->fwnode)) + /* Should refer to current rcpm device */ + if (np->phandle != value[0]) + continue; + /* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the * number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup" * of wakeup source IP contains an integer array: