All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Leilk Liu <leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Applied "spi: mediatek: remove mtk_spi_config" to the spi tree
Date: Tue, 27 Oct 2015 13:50:13 +0900	[thread overview]
Message-ID: <E1ZqwD7-00057t-5w@finisterre> (raw)
In-Reply-To: <1444793015-30359-3-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

The patch

   spi: mediatek: remove mtk_spi_config

has been applied to the spi tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 79b5d3f24dcec547ea5db7d2e0b557a36f92b16b Mon Sep 17 00:00:00 2001
From: Leilk Liu <leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Date: Mon, 26 Oct 2015 16:09:41 +0800
Subject: [PATCH] spi: mediatek: remove mtk_spi_config

mtk_spi_config() and mtk_spi_prepare_message() both initialize
spi register, so remove mtk_spi_config() and init all register
in mtk_spi_prepare_message().

Signed-off-by: Leilk Liu <leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi-mt65xx.c | 59 +++++++++++++++++++++---------------------------
 1 file changed, 26 insertions(+), 33 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index ecb6c58..7bd84c8 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -131,10 +131,34 @@ static void mtk_spi_reset(struct mtk_spi *mdata)
 	writel(reg_val, mdata->base + SPI_CMD_REG);
 }
 
-static void mtk_spi_config(struct mtk_spi *mdata,
-			   struct mtk_chip_config *chip_config)
+static int mtk_spi_prepare_message(struct spi_master *master,
+				   struct spi_message *msg)
 {
+	u16 cpha, cpol;
 	u32 reg_val;
+	struct mtk_chip_config *chip_config;
+	struct spi_device *spi = msg->spi;
+	struct mtk_spi *mdata = spi_master_get_devdata(master);
+
+	cpha = spi->mode & SPI_CPHA ? 1 : 0;
+	cpol = spi->mode & SPI_CPOL ? 1 : 0;
+
+	chip_config = spi->controller_data;
+	if (!chip_config) {
+		chip_config = (void *)&mtk_default_chip_info;
+		spi->controller_data = chip_config;
+	}
+
+	reg_val = readl(mdata->base + SPI_CMD_REG);
+	if (cpha)
+		reg_val |= SPI_CMD_CPHA;
+	else
+		reg_val &= ~SPI_CMD_CPHA;
+	if (cpol)
+		reg_val |= SPI_CMD_CPOL;
+	else
+		reg_val &= ~SPI_CMD_CPOL;
+	writel(reg_val, mdata->base + SPI_CMD_REG);
 
 	reg_val = readl(mdata->base + SPI_CMD_REG);
 
@@ -171,37 +195,6 @@ static void mtk_spi_config(struct mtk_spi *mdata,
 	/* pad select */
 	if (mdata->dev_comp->need_pad_sel)
 		writel(mdata->pad_sel, mdata->base + SPI_PAD_SEL_REG);
-}
-
-static int mtk_spi_prepare_message(struct spi_master *master,
-				   struct spi_message *msg)
-{
-	u32 reg_val;
-	u8 cpha, cpol;
-	struct mtk_chip_config *chip_config;
-	struct spi_device *spi = msg->spi;
-	struct mtk_spi *mdata = spi_master_get_devdata(master);
-
-	cpha = spi->mode & SPI_CPHA ? 1 : 0;
-	cpol = spi->mode & SPI_CPOL ? 1 : 0;
-
-	reg_val = readl(mdata->base + SPI_CMD_REG);
-	if (cpha)
-		reg_val |= SPI_CMD_CPHA;
-	else
-		reg_val &= ~SPI_CMD_CPHA;
-	if (cpol)
-		reg_val |= SPI_CMD_CPOL;
-	else
-		reg_val &= ~SPI_CMD_CPOL;
-	writel(reg_val, mdata->base + SPI_CMD_REG);
-
-	chip_config = spi->controller_data;
-	if (!chip_config) {
-		chip_config = (void *)&mtk_default_chip_info;
-		spi->controller_data = chip_config;
-	}
-	mtk_spi_config(mdata, chip_config);
 
 	return 0;
 }
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-10-27  4:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14  3:23 [PATCH 0/5] mt8173 spi multiple devices support Leilk Liu
2015-10-14  3:23 ` Leilk Liu
2015-10-14  3:23 ` Leilk Liu
2015-10-14  3:23 ` Leilk Liu
2015-10-14  3:23 ` [PATCH 1/5] dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23 ` [PATCH 2/5] spi: mediatek: remove mtk_spi_config Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
     [not found]   ` <1444793015-30359-3-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-27  4:50     ` Mark Brown [this message]
2015-10-14  3:23 ` [PATCH 3/5] spi: mediatek: handle controller_data in mtk_spi_setup Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
     [not found]   ` <1444793015-30359-4-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-27  4:50     ` Applied "spi: mediatek: handle controller_data in mtk_spi_setup" to the spi tree Mark Brown
2015-10-14  3:23 ` [PATCH 4/5] spi: mediatek: mt8173 spi multiple devices support Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
     [not found]   ` <1444793015-30359-5-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-27  4:50     ` Applied "spi: mediatek: mt8173 spi multiple devices support" to the spi tree Mark Brown
2015-10-14  3:23 ` [PATCH 5/5] arm64: dts: spi bus dts support multiple devices Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  3:23   ` Leilk Liu
2015-10-14  5:58   ` Sascha Hauer
2015-10-14  5:58     ` Sascha Hauer
2015-10-14  5:58     ` Sascha Hauer
2015-10-26  5:39     ` lei liu
2015-10-26  5:39       ` lei liu
2015-10-26  5:39       ` lei liu
2015-10-26  5:39       ` lei liu
2015-10-19 19:27 ` [PATCH 0/5] mt8173 spi multiple devices support Mark Brown
2015-10-19 19:27   ` Mark Brown
2015-10-19 19:27   ` Mark Brown
2015-10-26  5:35   ` lei liu
2015-10-26  5:35     ` lei liu
2015-10-26  5:35     ` lei liu
2015-10-26  5:35     ` lei liu

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=E1ZqwD7-00057t-5w@finisterre \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.