summaryrefslogtreecommitdiff
path: root/drivers/staging/cg2900/devices-cg2900-u5500.c
diff options
context:
space:
mode:
authorGrzegorz Sygieda <grzegorz.sygieda@tieto.com>2011-09-02 14:23:10 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:05:53 +0200
commitd79c17dfa54a096b7c197bdf6555ff5a0b6b4690 (patch)
tree1719d3136abcfb0bc9fa6570fcfe0c41d88d62f8 /drivers/staging/cg2900/devices-cg2900-u5500.c
parente5cbb2e48412db6884abe4c01194df9ac86b396b (diff)
cg2900: bluetooth support for 5500
This patch enables cg2900 functionality in 5500 boards. All tests have been made on B5500 (big board BBM R1A) with new CG2900 hardware. NOTE: For proper work new B5500 FPGA firmware is needed (v536). Depends-On: I7820139cc44e347c5b113b1beb665c2489bf74c2 ST-Ericsson Linux next: NA ST-Ericsson ID: 281802 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I3df0bc1e41e60ce6abf4be9cb18465073ba8d738 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30348 Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com> Reviewed-by: Virupax SADASHIVPETIMATH <virupax.sadashivpetimath@stericsson.com> Tested-by: Virupax SADASHIVPETIMATH <virupax.sadashivpetimath@stericsson.com>
Diffstat (limited to 'drivers/staging/cg2900/devices-cg2900-u5500.c')
-rw-r--r--drivers/staging/cg2900/devices-cg2900-u5500.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/staging/cg2900/devices-cg2900-u5500.c b/drivers/staging/cg2900/devices-cg2900-u5500.c
new file mode 100644
index 00000000000..5b8c5fb8064
--- /dev/null
+++ b/drivers/staging/cg2900/devices-cg2900-u5500.c
@@ -0,0 +1,64 @@
+/*
+ * arch/arm/mach-ux500/devices-cg2900-u5500.c
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Authors:
+ * Par-Gunnar Hjalmdahl (par-gunnar.p.hjalmdahl@stericsson.com) for ST-Ericsson.
+ * Henrik Possung (henrik.possung@stericsson.com) for ST-Ericsson.
+ * Josef Kindberg (josef.kindberg@stericsson.com) for ST-Ericsson.
+ * Dariusz Szymszak (dariusz.xd.szymczak@stericsson.com) for ST-Ericsson.
+ * Kjell Andersson (kjell.k.andersson@stericsson.com) for ST-Ericsson.
+ * License terms: GNU General Public License (GPL), version 2
+ *
+ * Board specific device support for the Linux Bluetooth HCI H:4 Driver
+ * for ST-Ericsson connectivity controller.
+ */
+
+#include <linux/delay.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/clk.h>
+#include <linux/types.h>
+#include <linux/mfd/abx500/ab5500.h>
+
+#include <mach/prcmu-db5500.h>
+
+#include "devices-cg2900.h"
+
+/* prcmu resout1 pin is used for CG2900 reset*/
+void dcg2900_enable_chip(struct cg2900_chip_dev *dev)
+{
+ struct dcg2900_info *info = dev->b_data;
+
+ clk_enable(info->lpoclk);
+ /*
+ * Due to a bug in CG2900 we cannot just set GPIO high to enable
+ * the chip. We must wait more than 100 msecs before enbling the
+ * chip.
+ * - Set PDB to low.
+ * - Wait for 100 msecs
+ * - Set PDB to high.
+ */
+ prcmu_resetout(1, 0);
+ schedule_timeout_uninterruptible(msecs_to_jiffies(
+ CHIP_ENABLE_PDB_LOW_TIMEOUT));
+ prcmu_resetout(1, 1);
+}
+
+void dcg2900_disable_chip(struct cg2900_chip_dev *dev)
+{
+ struct dcg2900_info *info = dev->b_data;
+
+ prcmu_resetout(1, 0);
+ clk_disable(info->lpoclk);
+}
+
+int dcg2900_setup(struct cg2900_chip_dev *dev,
+ struct dcg2900_info *info)
+{
+ info->lpoclk = clk_get(dev->dev, "lpoclk");
+ if (IS_ERR(info->lpoclk))
+ return PTR_ERR(info->lpoclk);
+
+ return 0;
+}