Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp858299pxf; Thu, 8 Apr 2021 14:34:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIwB69IwPWHYBysGb7Ghz4THTwCvquS3ItaWCrNR966wGcJO3Gar6+BCWOn6itZVw2O77b X-Received: by 2002:a17:906:2759:: with SMTP id a25mr13420916ejd.122.1617917683192; Thu, 08 Apr 2021 14:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617917683; cv=none; d=google.com; s=arc-20160816; b=U8fWaWPPKj+L8/QjJ1CxYoNpGyNGDHl+na2ZTI04XS3nld3RmaYziPgf6fAhVuYFPy +RIuH86Iy7V18aoYE95DfuwW9fEJ3kryHCUxnyGamKulCK/3+bDt4EirhjF/EEBgzXp3 Msdmtp7tk6yYMpvhIaZGIinmSgmqNgTmTINxeblQBvFhSSLt4KfMp6NHYpJyS8vecrOb KSQ7iiZKLUq+On36869GiW0nctstxnvtk7Drx+/umWfhKzWsfqEPX3uFPwihXt+sS8Y9 aRWaeFhd4I9IWShkglQGxktZH48FQ9SNw5hoa4qMa6ts3S1mRczQWy6rwby4kvUKVM5b NNJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mySPQZAxeKxPZ6g7lCnXPm49GveuRCHUb1NT0KmJXUE=; b=Nb3Sff1o3dE8Tk4HG5WEhB3jb9u7qJy2s+rFGOshZ5zg3OpVubLwSBzlDgmvaG8/o+ RYmB8XK+I4FGdrGxWfCKOUYcso11DUqBDmmlesGy9+6KXMJjY2wgWpmwaaPXYQ2VPTzM YsYphzMgOqMIH+3GSKZ5GK6q2DjAV3Th09AMkeE1SMyzdGoRXv8rNSLy7Rs1C9ewo0Q2 dHrL4/IOGMKVfBSPqosii6GGUZdSWam04ltt6/m93tJd74TNPEi3+nMsdsMimlWNF6KM /GQ+9YjyDM5sUMpsOSMDyM/ncZuHSRoq3KvzIEcAKO2v4qWf2kmXboqkOHMfeP4ZC0oZ ZWuw== 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 b11si684182edq.208.2021.04.08.14.34.17; Thu, 08 Apr 2021 14:34:43 -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 S232350AbhDHVd1 (ORCPT + 99 others); Thu, 8 Apr 2021 17:33:27 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:44633 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232236AbhDHVd0 (ORCPT ); Thu, 8 Apr 2021 17:33:26 -0400 Received: by mail-oi1-f174.google.com with SMTP id a8so3671900oic.11 for ; Thu, 08 Apr 2021 14:33:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mySPQZAxeKxPZ6g7lCnXPm49GveuRCHUb1NT0KmJXUE=; b=lrwMW8K4VVCKuUAHiBiwJZNwOoLG0ZxnMwt4a5w9DEgwsY7PvkPwHcH/OiajwXqNX+ 9xKUBtnNkV3bWU/ULdwVQZkEbI8QyAtOEL8M1BNSmNkfOm7eVVaGi2Qu2S83eE6QoZCU qjE8CCapZDz6XpmPz61Y5gtXI/tyNMZxC3d4HF4XpMLbQgJ13O5poBFJIsykZ9xRm5Xg hhOD1I9ahavYSXchCvpZ90p6c7PYEOEduNspUeANOjrqoDgY0tF20jevA2S/KHA8jqUd qh4htY4POXa09L7DmAHifp5jSRry6C8jYoV14mbtwo2KEv7qmD1re9roaWDkxPPpBZmf WJvg== X-Gm-Message-State: AOAM532QbPrVZeVVrt2R2MTXYxpm+fzfbC3/WwmxU1rWnO5L1G8M+7GN M0Gpwxe/x6e7svtQ3JCNPKlpN4MjUqA= X-Received: by 2002:a54:4708:: with SMTP id k8mr7752421oik.22.1617917594426; Thu, 08 Apr 2021 14:33:14 -0700 (PDT) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com. [209.85.167.175]) by smtp.gmail.com with ESMTPSA id a7sm135107ooo.30.2021.04.08.14.33.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Apr 2021 14:33:14 -0700 (PDT) Received: by mail-oi1-f175.google.com with SMTP id n8so3666643oie.10 for ; Thu, 08 Apr 2021 14:33:13 -0700 (PDT) X-Received: by 2002:aca:3456:: with SMTP id b83mr7828412oia.51.1617917593399; Thu, 08 Apr 2021 14:33:13 -0700 (PDT) MIME-Version: 1.0 References: <20210408030353.37193-1-ran.wang_1@nxp.com> In-Reply-To: <20210408030353.37193-1-ran.wang_1@nxp.com> From: Li Yang Date: Thu, 8 Apr 2021 16:33:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7] soc: fsl: enable acpi support in RCPM driver To: Ran Wang Cc: Christophe Leroy , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , lkml , Peng Ma Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 7, 2021 at 9:58 PM Ran Wang wrote: > > From: Peng Ma > > This patch enables ACPI support in RCPM driver. > > Signed-off-by: Peng Ma > Signed-off-by: Ran Wang Applied for next. Thanks. > --- > Change in v7: > - Update comment for checking RCPM node which refferred to > > Change in v6: > - Remove copyright udpate to rebase on latest mainline > > 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 | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c > index 4ace28cab314..90d3f4060b0c 100644 > --- a/drivers/soc/fsl/rcpm.c > +++ b/drivers/soc/fsl/rcpm.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > > #define RCPM_WAKEUP_CELL_MAX_SIZE 7 > > @@ -78,10 +79,20 @@ 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; > > + /* > + * For DT mode, would handle devices with "fsl,rcpm-wakeup" > + * pointing to the current RCPM node. > + * > + * For ACPI mode, currently we assume there is only one > + * RCPM controller existing. > + */ > + if (is_of_node(dev->fwnode)) > + 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: @@ -172,10 +183,19 @@ static const struct of_device_id rcpm_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, rcpm_of_match); > > +#ifdef CONFIG_ACPI > +static const struct acpi_device_id rcpm_acpi_ids[] = { > + {"NXP0015",}, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, rcpm_acpi_ids); > +#endif > + > static struct platform_driver rcpm_driver = { > .driver = { > .name = "rcpm", > .of_match_table = rcpm_of_match, > + .acpi_match_table = ACPI_PTR(rcpm_acpi_ids), > .pm = &rcpm_pm_ops, > }, > .probe = rcpm_probe, > -- > 2.25.1 >