linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, kernel@pengutronix.de,
	david@protonic.nl, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 05/12] can: flexcan: rename feature into quirks
Date: Tue,  1 Sep 2015 11:29:08 +0200	[thread overview]
Message-ID: <1441099755-8601-6-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1441099755-8601-1-git-send-email-mkl@pengutronix.de>

This patch renames the "features" member of struct flexcan_devtype_data to
"quirks". The corresponding defines are renamed too, to reflect what they
actually do.

    FLEXCAN_HAS_V10_FEATURES      -> FLEXCAN_QUIRK_DISABLE_RXFG
    FLEXCAN_HAS_BROKEN_ERR_STATE  -> FLEXCAN_QUIRK_BROKEN_ERR_STATE
    FLEXCAN_HAS_MECR_FEATURES     -> FLEXCAN_QUIRK_DISABLE_MECR

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 70cdbfcebb46..dd5a9353e0c5 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -187,9 +187,9 @@
  *
  * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
  */
-#define FLEXCAN_HAS_V10_FEATURES	BIT(1) /* For core version >= 10 */
-#define FLEXCAN_HAS_BROKEN_ERR_STATE	BIT(2) /* [TR]WRN_INT not connected */
-#define FLEXCAN_HAS_MECR_FEATURES	BIT(3) /* Memory error detection */
+#define FLEXCAN_QUIRK_BROKEN_ERR_STATE	BIT(1) /* [TR]WRN_INT not connected */
+#define FLEXCAN_QUIRK_DISABLE_RXFG	BIT(2) /* Disable RX FIFO Global mask */
+#define FLEXCAN_QUIRK_DISABLE_MECR	BIT(3) /* Disble Memory error detection */
 
 /* Structure of the message buffer */
 struct flexcan_mb {
@@ -244,7 +244,7 @@ struct flexcan_regs {
 };
 
 struct flexcan_devtype_data {
-	u32 features;	/* hardware controller features */
+	u32 quirks;		/* quirks needed for different IP cores */
 };
 
 struct flexcan_priv {
@@ -263,17 +263,17 @@ struct flexcan_priv {
 };
 
 static struct flexcan_devtype_data fsl_p1010_devtype_data = {
-	.features = FLEXCAN_HAS_BROKEN_ERR_STATE,
+	.quirks = FLEXCAN_QUIRK_BROKEN_ERR_STATE,
 };
 
 static struct flexcan_devtype_data fsl_imx28_devtype_data;
 
 static struct flexcan_devtype_data fsl_imx6q_devtype_data = {
-	.features = FLEXCAN_HAS_V10_FEATURES,
+	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG,
 };
 
 static struct flexcan_devtype_data fsl_vf610_devtype_data = {
-	.features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_MECR_FEATURES,
+	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_DISABLE_MECR,
 };
 
 static const struct can_bittiming_const flexcan_bittiming_const = {
@@ -870,7 +870,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	 * on most Flexcan cores, too. Otherwise we don't get
 	 * any error warning or passive interrupts.
 	 */
-	if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE ||
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_BROKEN_ERR_STATE ||
 	    priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
 		reg_ctrl |= FLEXCAN_CTRL_ERR_MSK;
 	else
@@ -900,7 +900,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	flexcan_write(0x0, &regs->rx14mask);
 	flexcan_write(0x0, &regs->rx15mask);
 
-	if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES)
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
 		flexcan_write(0x0, &regs->rxfgmask);
 
 	/* On Vybrid, disable memory error detection interrupts
@@ -909,7 +909,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	 * false positive memory errors and put the device in
 	 * freeze mode.
 	 */
-	if (priv->devtype_data->features & FLEXCAN_HAS_MECR_FEATURES) {
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_DISABLE_MECR) {
 		/* Follow the protocol as described in "Detection
 		 * and Correction of Memory Errors" to write to
 		 * MECR register
-- 
2.5.0


  parent reply	other threads:[~2015-09-01  9:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  9:29 [PATCH 00/12] RFC: cleanup flexcan driver, introduce and make use of IRQ offloading Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 01/12] can: headers: make header files self contained Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 02/12] can: flexcan: cleanup coding style and fix typos Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 03/12] can: flexcan: remove unused header files Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 04/12] can: flexcan: flexcan_chip_start(): cleanup writing of reg_mcr Marc Kleine-Budde
2015-09-01  9:29 ` Marc Kleine-Budde [this message]
2015-09-01  9:29 ` [PATCH 06/12] can: flexcan: use pointer to struct regs instead of void pointer for mmio address space Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 07/12] can: flexcan: give member of flexcan_priv holding mailboxes a sensible name Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 08/12] can: flexcan: enable interrupts atomically at the end of flexcan_chip_start() Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 09/12] can: flexcan: calculate default value for imask1 during runtime Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 10/12] can: flexcan: make TX mailbox selectable " Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 11/12] can: rx-fifo: Add support for simple irq offloading Marc Kleine-Budde
2015-09-01  9:29 ` [PATCH 12/12] can: flexcan: make use of rx-fifos's irq_offload_simple Marc Kleine-Budde
     [not found]   ` <CAOpc7mGfu7kT9qTNOC1P-_=7cRicscoLzqKpPE1kMx1HkueCwA@mail.gmail.com>
2015-12-10 12:21     ` Marc Kleine-Budde

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=1441099755-8601-6-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    /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).