public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Samuel Ortiz <sameo@linux.intel.com>,
	Paul Mundt <lethal@linux-sh.org>, Ben Dooks <ben@simtec.co.uk>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	psas-avionics@lists.psas.pdx.edu
Subject: [PATCH] sm501: When registering the GPIO, turn on the GPIO unit's power
Date: Tue, 5 Jul 2011 20:41:40 -0700	[thread overview]
Message-ID: <20110706034138.GA8987@leaf> (raw)

When attempting to use GPIO via the sm501 unit on the TQM5200 board,
GPIO operations would only function if during the same boot u-boot's
"fkt led" command had initialized the sm501.  Comparing the sm501's
registers with and without running the "fkt led" command turned up one
significant difference: u-boot had enabled the GPIO power gate.
Changing the Linux sm501 driver to enable the GPIO power gate allows
GPIO to work without first initializing it with u-boot.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
 drivers/mfd/sm501.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index df3702c..d7a0ab9 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1089,6 +1089,7 @@ static int __devinit sm501_register_gpio(struct sm501_devdata *sm)
 		goto err_low_chip;
 	}
 
+	sm501_unit_power(sm->dev, SM501_GATE_GPIO, 1);
 	gpio->registered = 1;
 
 	return 0;
@@ -1118,6 +1119,8 @@ static void sm501_gpio_remove(struct sm501_devdata *sm)
 	if (!sm->gpio.registered)
 		return;
 
+	sm501_unit_power(sm->dev, SM501_GATE_GPIO, 0);
+
 	ret = gpiochip_remove(&gpio->low.gpio);
 	if (ret)
 		dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
-- 
1.7.5.4


                 reply	other threads:[~2011-07-06  3:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110706034138.GA8987@leaf \
    --to=josh@joshtriplett.org \
    --cc=ben@simtec.co.uk \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=psas-avionics@lists.psas.pdx.edu \
    --cc=sameo@linux.intel.com \
    /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