lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 5 Jul 2011 20:41:40 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Samuel Ortiz <sameo@...ux.intel.com>,
	Paul Mundt <lethal@...ux-sh.org>, Ben Dooks <ben@...tec.co.uk>
Cc:	linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	psas-avionics@...ts.psas.pdx.edu
Subject: [PATCH] sm501: When registering the GPIO, turn on the GPIO unit's
 power

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@...htriplett.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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ