aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-s3c6410/mach-om-3d7k.c4
-rw-r--r--drivers/power/hdq.c11
-rw-r--r--include/linux/hdq.h2
3 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c6410/mach-om-3d7k.c b/arch/arm/mach-s3c6410/mach-om-3d7k.c
index 6afd12e487d..e52561d5a67 100644
--- a/arch/arm/mach-s3c6410/mach-om-3d7k.c
+++ b/arch/arm/mach-s3c6410/mach-om-3d7k.c
@@ -95,7 +95,7 @@ extern struct platform_device s3c_device_usbgadget;
#define DIVISOR_FROM_US(x) ((x) * 23)
#ifdef CONFIG_HDQ_GPIO_BITBANG
-#define FIQ_DIVISOR_HDQ DIVISOR_FROM_US(20)
+#define FIQ_DIVISOR_HDQ DIVISOR_FROM_US(HDQ_SAMPLE_PERIOD_US)
extern int hdq_fiq_handler(void);
#endif
@@ -128,7 +128,7 @@ static void om_3d7k_fiq_handler(void)
#ifdef CONFIG_HDQ_GPIO_BITBANG
if (hdq_fiq_handler())
- divisor = FIQ_DIVISOR_HDQ;
+ divisor = (u16)FIQ_DIVISOR_HDQ;
#endif
if (divisor == 0xffff) /* mask the fiq irq source */
diff --git a/drivers/power/hdq.c b/drivers/power/hdq.c
index 693d643407d..8b1aee82b9c 100644
--- a/drivers/power/hdq.c
+++ b/drivers/power/hdq.c
@@ -53,7 +53,6 @@ struct hdq_priv {
struct hdq_platform_data *pdata;
} hdq_priv;
-#define HDQ_SAMPLE_PERIOD_US 20
int hdq_fiq_handler(void)
{
@@ -157,7 +156,7 @@ int hdq_fiq_handler(void)
hdq_priv.hdq_ctr2 = 1;
hdq_priv.hdq_bit = 8; /* 8 bits of data */
/* timeout */
- hdq_priv.hdq_ctr = 300 / HDQ_SAMPLE_PERIOD_US;
+ hdq_priv.hdq_ctr = 500 / HDQ_SAMPLE_PERIOD_US;
hdq_priv.hdq_state = HDQB_DATA_RX_LOW;
break;
}
@@ -267,8 +266,10 @@ int hdq_read(int address)
if (fiq_busy())
continue;
- if (hdq_priv.hdq_error)
+ if (hdq_priv.hdq_error) {
+ printk(KERN_ERR "HDQ error: %d\n", hdq_priv.hdq_error);
goto done; /* didn't see a response in good time */
+ }
ret = hdq_priv.hdq_rx_data;
goto done;
@@ -306,8 +307,10 @@ int hdq_write(int address, u8 data)
if (fiq_busy())
continue; /* something bad with FIQ */
- if (hdq_priv.hdq_error)
+ if (hdq_priv.hdq_error) {
+ printk(KERN_ERR "HDQ error: %d\n", hdq_priv.hdq_error);
goto done; /* didn't see a response in good time */
+ }
ret = 0;
goto done;
diff --git a/include/linux/hdq.h b/include/linux/hdq.h
index e706790648b..377ab387eb3 100644
--- a/include/linux/hdq.h
+++ b/include/linux/hdq.h
@@ -3,6 +3,8 @@
#include <linux/device.h>
+#define HDQ_SAMPLE_PERIOD_US 10
+
/* platform data */
struct hdq_platform_data {