Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210340

[PATCH v2 2/4] spi: medaitek: revise quirks compatibility style

From Leilk Liu <leilk.liu@mediatek.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/4] spi: medaitek: revise quirks compatibility style
Date 2015-08-20 11:30 +0200
Message-ID <pZukA-Ig-57@gated-at.bofh.it> (permalink)
References <pZuaS-wx-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The quirks are true/false, so define these as bool.

Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
---
 drivers/spi/spi-mt65xx.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 79286c8..4fa4332 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -71,10 +71,6 @@
 #define SPI_CMD_FINISH_IE            BIT(16)
 #define SPI_CMD_PAUSE_IE             BIT(17)
 
-#define MTK_SPI_QUIRK_PAD_SELECT 1
-/* Must explicitly send dummy Tx bytes to do Rx only transfer */
-#define MTK_SPI_QUIRK_MUST_TX 1
-
 #define MT8173_SPI_MAX_PAD_SEL 3
 
 #define MTK_SPI_IDLE 0
@@ -84,8 +80,9 @@
 #define MTK_SPI_PACKET_SIZE 1024
 
 struct mtk_spi_compatible {
-	u32 need_pad_sel;
-	u32 must_tx;
+	bool need_pad_sel;
+	/* Must explicitly send dummy Tx bytes to do Rx only transfer */
+	bool must_tx;
 };
 
 struct mtk_spi {
@@ -100,19 +97,11 @@ struct mtk_spi {
 	const struct mtk_spi_compatible *dev_comp;
 };
 
-static const struct mtk_spi_compatible mt6589_compat = {
-	.need_pad_sel = 0,
-	.must_tx = 0,
-};
-
-static const struct mtk_spi_compatible mt8135_compat = {
-	.need_pad_sel = 0,
-	.must_tx = 0,
-};
-
+static const struct mtk_spi_compatible mt6589_compat;
+static const struct mtk_spi_compatible mt8135_compat;
 static const struct mtk_spi_compatible mt8173_compat = {
-	.need_pad_sel = MTK_SPI_QUIRK_PAD_SELECT,
-	.must_tx = MTK_SPI_QUIRK_MUST_TX,
+	.need_pad_sel = true,
+	.must_tx = true,
 };
 
 /*
-- 
1.8.1.1.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] Fixup mediatek spi driver  Leilk Liu <leilk.liu@mediatek.com> - 2015-08-20 11:20 +0200
  [PATCH v2 3/4] spi: mediatek: use BIT() to instead of SPI_CMD_*_OFFSET Leilk Liu <leilk.liu@mediatek.com> - 2015-08-20 11:30 +0200
  [PATCH v2 4/4] spi: mediatek: revise coding style Leilk Liu <leilk.liu@mediatek.com> - 2015-08-20 11:30 +0200
    Re: [PATCH v2 4/4] spi: mediatek: revise coding style Mark Brown <broonie@kernel.org> - 2015-08-20 20:20 +0200
  [PATCH v2 2/4] spi: medaitek: revise quirks compatibility style Leilk Liu <leilk.liu@mediatek.com> - 2015-08-20 11:30 +0200
  [PATCH v2 1/4] spi: mediatek: fix spi incorrect endian usage Leilk Liu <leilk.liu@mediatek.com> - 2015-08-20 11:30 +0200

csiph-web