summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Marklund <robert.marklund@stericsson.com>2011-06-13 16:19:02 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:05:51 +0200
commit1830023a6aff95f3bd619a001ccbbe5065c273b1 (patch)
tree8267a43bb64c1e5b9aa192a0f7b68ed64a23cdfe
parent3892569aed0cb65d18b56afe21d963c636581b05 (diff)
cg2900: Fix chip enable
Update chip enable to use the new sugested procedure. The only change was to lower the reset time from 100 ms to just 20 ms. This should be investigated to see what the chip acually needs. Signed-off-by: Robert Marklund <robert.marklund@stericsson.com> Change-Id: Ibff160fb46708b9f6c96613e623b7d90be35b3eb Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25039 Reviewed-by: Dmitry TARNYAGIN <dmitry.tarnyagin@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r--drivers/staging/cg2900/devices-cg2900.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/staging/cg2900/devices-cg2900.c b/drivers/staging/cg2900/devices-cg2900.c
index f1bf3d48113..3c9f8e3e16f 100644
--- a/drivers/staging/cg2900/devices-cg2900.c
+++ b/drivers/staging/cg2900/devices-cg2900.c
@@ -46,8 +46,7 @@
#define CG2900_PG2_HCI_REV 0x0200
#define CG2900_PG1_SPECIAL_HCI_REV 0x0700
-#define CHIP_INITIAL_HIGH_TIMEOUT 5 /* ms */
-#define CHIP_INITIAL_LOW_TIMEOUT 2 /* us */
+#define CHIP_INITIAL_LOW_TIMEOUT 20 /* ms */
struct vs_power_sw_off_cmd {
__le16 op_code;
@@ -77,32 +76,22 @@ struct dcg2900_info {
static void dcg2900_enable_chip(struct cg2900_chip_dev *dev)
{
struct dcg2900_info *info = dev->b_data;
- unsigned long flags;
if (info->gbf_gpio == -1)
return;
/*
- * Due to a bug in some CG2900 we cannot just set GPIO high to enable
- * the chip. We must do the following:
- * 1: Set PDB high
- * 2: Wait a few milliseconds
- * 3: Set PDB low
- * 4: Wait 2 microseconds
- * 5: Set PDB high
- * We disable interrupts step 3-5 to assure that step 4 does not take
- * too long time (which would invalidate the fix).
+ * Due to a bug in CG2900 we cannot just set GPIO high to enable
+ * the chip. We must wait more than 20 msecs before enbling the
+ * chip.
+ * - Set PDB to low.
+ * - Wait for 20 msecs
+ * - Set PDB to high.
*/
- gpio_set_value(info->gbf_gpio, 1);
-
- schedule_timeout_uninterruptible(
- msecs_to_jiffies(CHIP_INITIAL_HIGH_TIMEOUT));
-
- spin_lock_irqsave(&info->pdb_toggle_lock, flags);
gpio_set_value(info->gbf_gpio, 0);
- udelay(CHIP_INITIAL_LOW_TIMEOUT);
+ schedule_timeout_uninterruptible(msecs_to_jiffies(
+ CHIP_INITIAL_LOW_TIMEOUT));
gpio_set_value(info->gbf_gpio, 1);
- spin_unlock_irqrestore(&info->pdb_toggle_lock, flags);
}
static void dcg2900_disable_chip(struct cg2900_chip_dev *dev)