public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Trimarchi <michael@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] spi: mxc_spi: Fix chipselect on DM_SPI driver uclass
Date: Wed, 20 Jun 2018 22:51:18 +0200	[thread overview]
Message-ID: <1529527879-26495-2-git-send-email-michael@amarulasolutions.com> (raw)
In-Reply-To: <1529527879-26495-1-git-send-email-michael@amarulasolutions.com>

CS GPIO activation low/high is determinated by the device tree
so we don't need to take in accoung in cs_activate and cs_deactivate

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 drivers/spi/mxc_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index fcb214a..0dccc38 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -60,7 +60,7 @@ static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
 static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
 {
 	if (CONFIG_IS_ENABLED(DM_SPI)) {
-		dm_gpio_set_value(&mxcs->ss, mxcs->ss_pol);
+		dm_gpio_set_value(&mxcs->ss, 1);
 	} else {
 		if (mxcs->gpio > 0)
 			gpio_set_value(mxcs->gpio, mxcs->ss_pol);
@@ -70,7 +70,7 @@ static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
 static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
 {
 	if (CONFIG_IS_ENABLED(DM_SPI)) {
-		dm_gpio_set_value(&mxcs->ss, !(mxcs->ss_pol));
+		dm_gpio_set_value(&mxcs->ss, 0);
 	} else {
 		if (mxcs->gpio > 0)
 			gpio_set_value(mxcs->gpio, !(mxcs->ss_pol));
@@ -508,7 +508,7 @@ static int mxc_spi_probe(struct udevice *bus)
 	if (plat->base == FDT_ADDR_T_NONE)
 		return -ENODEV;
 
-	ret = dm_gpio_set_value(&plat->ss, !(mxcs->ss_pol));
+	ret = dm_gpio_set_value(&plat->ss, 0);
 	if (ret) {
 		dev_err(bus, "Setting cs error\n");
 		return ret;
-- 
2.7.4

  reply	other threads:[~2018-06-20 20:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 20:51 [U-Boot] [PATCH 1/3] spi: mxc: Fix compilation problem of DM_SPI class driver Michael Trimarchi
2018-06-20 20:51 ` Michael Trimarchi [this message]
2018-06-24 11:40   ` [U-Boot] [PATCH 2/3] spi: mxc_spi: Fix chipselect on DM_SPI driver uclass Peng Fan
2018-06-25  9:54   ` Jagan Teki
2018-06-20 20:51 ` [U-Boot] [PATCH 3/3] spi: mxc_spi: Fix spi mode communication where clock is inverted Michael Trimarchi
2018-06-24 11:44   ` Peng Fan
2018-06-30 10:35     ` Michael Nazzareno Trimarchi
2018-06-20 20:52 ` [U-Boot] [PATCH 1/3] spi: mxc: Fix compilation problem of DM_SPI class driver Fabio Estevam
2018-06-24 11:41 ` Peng Fan
2018-06-25  8:54 ` Jagan Teki

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=1529527879-26495-2-git-send-email-michael@amarulasolutions.com \
    --to=michael@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    /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