From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"shawnguo@kernel.org" <shawnguo@kernel.org>,
"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
dl-linux-imx <linux-imx@nxp.com>, Ying Liu <victor.liu@nxp.com>,
Peng Fan <peng.fan@nxp.com>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
Pankaj Bansal <pankaj.bansal@nxp.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 5/6] can: flexcan: add CAN wakeup function for i.MX8QM
Date: Fri, 16 Oct 2020 10:00:31 +0000 [thread overview]
Message-ID: <DB8PR04MB67952A058934D5013946EE97E6030@DB8PR04MB6795.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <DB8PR04MB6795DEDFA271889A162539EFE6030@DB8PR04MB6795.eurprd04.prod.outlook.com>
Hi Marc,
[...]
> > > +static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv,
> > > +bool enabled) {
> > > + u8 idx = priv->can_idx;
> > > + u32 rsrc_id, val;
> > > +
> > > + if (idx == 0)
> > > + rsrc_id = IMX_SC_R_CAN_0;
> > > + else if (idx == 1)
> > > + rsrc_id = IMX_SC_R_CAN_1;
> > > + else
> > > + rsrc_id = IMX_SC_R_CAN_2;
> >
> > Can you introduce something like and make use of it:
> >
> > #define IMX_SC_R_CAN(x) (105 + (x))
> OK.
I thought it over again, from my point of view, use macro here directly could be more intuitive, and can achieve a direct jump.
If change to above wrapper, on the contrary make confusion, and generate the magic number 105. ☹
> > > +
> > > + if (enabled)
> > > + val = 1;
> > > + else
> > > + val = 0;
> > > +
> > > + /* stop mode request via scu firmware */
> > > + return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id,
> > > +IMX_SC_C_IPG_STOP, val); }
We still need use IMX_SC_C_IPG_STOP, why not be consistent?
Best Regards,
Joakim Zhang
next prev parent reply other threads:[~2020-10-16 10:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 13:43 [PATCH 0/6] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
2020-10-16 13:43 ` [PATCH 1/6] firmware: imx: always export SCU symbols Joakim Zhang
2020-10-16 13:43 ` [PATCH 2/6] dt-bindings: can: flexcan: fix fsl,clk-source property Joakim Zhang
2020-10-16 6:21 ` Marc Kleine-Budde
2020-10-16 6:52 ` Joakim Zhang
2020-10-16 13:43 ` [PATCH 3/6] dt-bindings: can: flexcan: add fsl,can-index property to indicate a resource Joakim Zhang
2020-10-16 6:20 ` [PATCH 3/6] dt-bindings: can: flexcan: add fsl, can-index " Marc Kleine-Budde
2020-10-16 6:52 ` Joakim Zhang
2020-10-16 7:47 ` Marc Kleine-Budde
2020-10-16 13:43 ` [PATCH 4/6] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR Joakim Zhang
2020-10-16 6:22 ` Marc Kleine-Budde
2020-10-16 13:43 ` [PATCH 5/6] can: flexcan: add CAN wakeup function for i.MX8QM Joakim Zhang
2020-10-16 5:59 ` Marc Kleine-Budde
2020-10-16 6:46 ` Joakim Zhang
2020-10-16 7:44 ` Marc Kleine-Budde
2020-10-16 6:18 ` Marc Kleine-Budde
2020-10-16 6:51 ` Joakim Zhang
2020-10-16 10:00 ` Joakim Zhang [this message]
2020-10-16 10:40 ` Marc Kleine-Budde
2020-10-16 10:57 ` Joakim Zhang
2020-10-16 13:43 ` [PATCH 6/6] can: flexcan: fix ECC function on LS1021A/LX2160A Joakim Zhang
2020-10-16 6:04 ` Marc Kleine-Budde
2020-10-16 6:49 ` Joakim Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB8PR04MB67952A058934D5013946EE97E6030@DB8PR04MB6795.eurprd04.prod.outlook.com \
--to=qiangqing.zhang@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pankaj.bansal@nxp.com \
--cc=peng.fan@nxp.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=victor.liu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).