Hi,

Andy Green wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Somebody in the thread at some point said:
| Hi,
|> | - power off does't work
|>
|> Power off broken was told before Christmas, but when I tested it here
|> reboot command worked fine.  Is it shutdown -h that is broken?  Is it
|> broken for everyone Android or not?
| I think that a correct power off is obtained by register the
| pm_power_off function.
| This function must if I have a good u-boot source must write 0x1 using the
|
| pcf50633_reg_write(PCF50633_REG_OOCSHDWN, 0x01);
|
| So I saw there is a i2c pcf50633 driver chips. I don't know why it is
| not active,
| maybe because it don't compile? So if I provide this function the halt
| sequence
| must be work. It is correct?

That's right.  Somewhere along the regulator changes it looks like we
lost this?  There's still code in drivers/i2c/chips/pcf50633.c

/* go into 'STANDBY' mode, i.e. power off the main CPU and peripherals */
void pcf50633_go_standby(struct pcf50633_data *pcf)
{
~        pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN,
~                  PCF50633_OOCSHDWN_GOSTDBY, PCF50633_OOCSHDWN_GOSTDBY);
}
EXPORT_SYMBOL_GPL(pcf50633_go_standby);

but the main usage of it says

~       /* register power off handler with core power management */
~        /* FIXME : pm_power_off = &pcf50633_go_standby; */

Balaji does this ring any bells from the regulator changes?

- -Andy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAklfzvIACgkQOjLpvpq7dMrSugCfYmA9VmJZO5b567GgyCiYjMhg
frkAn3iXTCpJXwP9OHPQniKcJzuX1Hav
=F7sZ
-----END PGP SIGNATURE-----

Like this?

I must test...

Regards Michael

diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index f668b9a..78b6a37 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -28,9 +28,12 @@
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
 #include <linux/platform_device.h>
+#include <linux/pm.h>
 
 #include <linux/mfd/pcf50633/core.h>
 
+struct pcf50633 *pcf_ptr;
+
 /* Read a block of upto 32 regs  */
 int pcf50633_read_block(struct pcf50633 *pcf , u8 reg,
 					int nr_regs, u8 *data)
@@ -474,6 +477,13 @@ static int pcf50633_resume(struct device *dev)
 #define pcf50633_resume NULL
 #endif
 
+void pcf50633_go_standby(void)
+{
+	if (pcf_ptr)
+		pcf50633_reg_set_bit_mask(pcf_ptr, PCF50633_REG_OOCSHDWN,
+					  0x01, 0x01);
+}
+
 static int pcf50633_probe(struct i2c_client *client,
 				const struct i2c_device_id *ids)
 {
@@ -577,6 +587,10 @@ static int pcf50633_probe(struct i2c_client *client,
 	if (pdata->probe_done)
 		pdata->probe_done(pcf);
 
+	/* register power off handler with core power management */
+	pm_power_off = &pcf50633_go_standby;
+	pcf_ptr = pcf;
+
 	return 0;
 
 err:
@@ -590,6 +604,7 @@ static int pcf50633_remove(struct i2c_client *client)
 
 	free_irq(pcf->irq, pcf);
 	kfree(pcf);
+	pcf_ptr = NULL;
 
 	return 0;
 }

Reply via email to