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: handle controller_data in mtk_spi_setup" to the spi tree
Date: Tue, 27 Oct 2015 13:50:06 +0900 [thread overview]
Message-ID: <E1ZqwD0-00057N-GI@finisterre> (raw)
In-Reply-To: <1444793015-30359-4-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
The patch
spi: mediatek: handle controller_data in mtk_spi_setup
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 58a984c79a68d508ccfccf4b82c0eaf7f487c399 Mon Sep 17 00:00:00 2001
From: Leilk Liu <leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Date: Mon, 26 Oct 2015 16:09:43 +0800
Subject: [PATCH] spi: mediatek: handle controller_data in mtk_spi_setup
controller_data is related with device, so move to master->setup
function.
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 | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 7bd84c8..406695a 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -136,19 +136,13 @@ static int mtk_spi_prepare_message(struct spi_master *master,
{
u16 cpha, cpol;
u32 reg_val;
- struct mtk_chip_config *chip_config;
struct spi_device *spi = msg->spi;
+ struct mtk_chip_config *chip_config = spi->controller_data;
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;
@@ -406,6 +400,16 @@ static bool mtk_spi_can_dma(struct spi_master *master,
return xfer->len > MTK_SPI_MAX_FIFO_SIZE;
}
+static int mtk_spi_setup(struct spi_device *spi)
+{
+ struct mtk_spi *mdata = spi_master_get_devdata(spi->master);
+
+ if (!spi->controller_data)
+ spi->controller_data = (void *)&mtk_default_chip_info;
+
+ return 0;
+}
+
static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
{
u32 cmd, reg_val, cnt;
@@ -493,6 +497,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
master->prepare_message = mtk_spi_prepare_message;
master->transfer_one = mtk_spi_transfer_one;
master->can_dma = mtk_spi_can_dma;
+ master->setup = mtk_spi_setup;
of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node);
if (!of_id) {
--
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
next prev parent reply other threads:[~2015-10-27 4:50 UTC|newest]
Thread overview: 13+ 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 ` [PATCH 1/5] dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices Leilk Liu
[not found] ` <1444793015-30359-1-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-14 3:23 ` [PATCH 2/5] spi: mediatek: remove mtk_spi_config Leilk Liu
[not found] ` <1444793015-30359-3-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-27 4:50 ` Applied "spi: mediatek: remove mtk_spi_config" to the spi tree Mark Brown
2015-10-14 3:23 ` [PATCH 3/5] spi: mediatek: handle controller_data in mtk_spi_setup Leilk Liu
[not found] ` <1444793015-30359-4-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 5/5] arm64: dts: spi bus dts support multiple devices Leilk Liu
[not found] ` <1444793015-30359-6-git-send-email-leilk.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-10-14 5:58 ` Sascha Hauer
[not found] ` <20151014055809.GN7858-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-10-26 5:39 ` lei liu
2015-10-19 19:27 ` [PATCH 0/5] mt8173 spi multiple devices support Mark Brown
[not found] ` <20151019192713.GR32054-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-10-26 5:35 ` lei liu
2015-10-14 3:23 ` [PATCH 4/5] spi: mediatek: " 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
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=E1ZqwD0-00057N-GI@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox