1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 18:34:37 +02:00
openwrt-xburst/target/linux/s3c24xx/patches-2.6.24/1172-introduce-pcf50633-resume-dependency-list.patch.patch
mirko fc54b9bf15 changed Makefile and profiles, added patches for kernel 2.6.24
(stable-branch of Openmoko)


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13613 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-12-12 11:58:53 +00:00

116 lines
3.2 KiB
Diff

From bf63ca6b17328413611a9d7594ca2c2f710a1def Mon Sep 17 00:00:00 2001
From: Andy Green <andy@openmoko.com>
Date: Wed, 2 Jul 2008 22:38:06 +0100
Subject: [PATCH] introduce-pcf50633-resume-dependency-list.patch
Adds resume dependency support to pcf50633
Signed-off-by: Andy Green <andy@openmoko.com>
---
drivers/i2c/chips/pcf50633.c | 26 ++++++++++++++++++++++++--
include/linux/pcf50633.h | 5 +++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index 2ed6dc0..ec6b9f1 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -53,6 +53,7 @@
#include <asm/arch/gta02.h>
#include "pcf50633.h"
+#include <linux/resume-dependency.h>
#if 0
#define DEBUGP(x, args ...) printk("%s: " x, __FUNCTION__, ## args)
@@ -167,6 +168,9 @@ struct pcf50633_data {
u_int8_t ena;
} ldo[__NUM_PCF50633_REGS];
} standby_regs;
+
+ struct resume_dependency resume_dependency;
+
#endif
};
@@ -1933,6 +1937,8 @@ static int pcf50633_detect(struct i2c_adapter *adapter, int address, int kind)
pcf50633_global = data;
+ init_resume_dependency_list(data->resume_dependency);
+
populate_sysfs_group(data);
err = sysfs_create_group(&new_client->dev.kobj, &pcf_attr_group);
@@ -2142,6 +2148,17 @@ int pcf50633_report_resumers(struct pcf50633_data *pcf, char *buf)
#ifdef CONFIG_PM
+/*
+ * we need to export this because pcf50633_data is kept opaque
+ */
+
+void pcf50633_register_resume_dependency(struct pcf50633_data *pcf,
+ struct pcf50633_resume_dependency *dep)
+{
+ register_resume_dependency(pcf->resume_dependency, dep);
+}
+EXPORT_SYMBOL_GPL(pcf50633_register_resume_dep);
+
static int pcf50633_suspend(struct device *dev, pm_message_t state)
{
@@ -2234,8 +2251,11 @@ static int pcf50633_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct pcf50633_data *pcf = i2c_get_clientdata(client);
int i;
+ struct list_head *pos, *q;
+ struct pcf50633_resume_dependency *dep;
+
- /* mutex_lock(&pcf->lock); */ /* resume in atomic context */
+ mutex_lock(&pcf->lock);
__reg_write(pcf, PCF50633_REG_LEDENA, 0x01);
@@ -2274,10 +2294,12 @@ static int pcf50633_resume(struct device *dev)
__reg_write(pcf, reg_out+1, pcf->standby_regs.ldo[i].ena);
}
- /* mutex_unlock(&pcf->lock); */ /* resume in atomic context */
+ mutex_unlock(&pcf->lock);
pcf50633_irq(pcf->irq, pcf);
+ callback_all_resume_dependencies(pcf->resume_dependency);
+
return 0;
}
#else
diff --git a/include/linux/pcf50633.h b/include/linux/pcf50633.h
index 837037e..2bef616 100644
--- a/include/linux/pcf50633.h
+++ b/include/linux/pcf50633.h
@@ -2,6 +2,7 @@
#define _LINUX_PCF50633_H
#include <linux/pcf506xx.h>
+#include <linux/resume-dependency.h>
/* public in-kernel pcf50633 api */
@@ -124,6 +125,10 @@ pcf50633_battvolt(struct pcf50633_data *pcf);
extern int
pcf50633_report_resumers(struct pcf50633_data *pcf, char *buf);
+extern void
+pcf50633_register_resume_dependency(struct pcf50633_data *pcf,
+ struct pcf50633_resume_dependency *dep);
+
#define PCF50633_FEAT_EXTON 0x00000001 /* not yet supported */
#define PCF50633_FEAT_MBC 0x00000002
--
1.5.6.5