On Tuesday, November 16, 2010 14:18:11 manjunatha_ha...@ti.com wrote:
From: Manjunatha Halli manjunatha_ha...@ti.com
These are the sources for the common interfaces required by the FM
V4L2 driver for TI WL127x and WL128x chips.
These implement the FM channel-8 protocol communication with
the chip. This makes use of the Shared Transport as its transport.
Signed-off-by: Manjunatha Halli manjunatha_ha...@ti.com
---
drivers/staging/ti-st/fmdrv_common.c | 2141
++
drivers/staging/ti-st/fmdrv_common.h | 458
2 files changed, 2599 insertions(+), 0 deletions(-)
create mode 100644 drivers/staging/ti-st/fmdrv_common.c
create mode 100644 drivers/staging/ti-st/fmdrv_common.h
diff --git a/drivers/staging/ti-st/fmdrv_common.c
b/drivers/staging/ti-st/fmdrv_common.c
new file mode 100644
index 000..7b8f2da
--- /dev/null
+++ b/drivers/staging/ti-st/fmdrv_common.c
@@ -0,0 +1,2141 @@
+/*
+ * FM Driver for Connectivity chip of Texas Instruments.
+ *
+ * This sub-module of FM driver is common for FM RX and TX
+ * functionality. This module is responsible for:
+ * 1) Forming group of Channel-8 commands to perform particular
+ * functionality (eg., frequency set require more than
+ * one Channel-8 command to be sent to the chip).
+ * 2) Sending each Channel-8 command to the chip and reading
+ * response back over Shared Transport.
+ * 3) Managing TX and RX Queues and Tasklets.
+ * 4) Handling FM Interrupt packet and taking appropriate action.
+ * 5) Loading FM firmware to the chip (common, FM TX, and FM RX
+ * firmware files based on mode selection)
+ *
+ * Copyright (C) 2010 Texas Instruments
+ * Author: Raja Mani raja_m...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include linux/module.h
+#include linux/firmware.h
+#include linux/delay.h
+#include fmdrv.h
+#include fmdrv_v4l2.h
+#include fmdrv_common.h
+#include linux/ti_wilink_st.h
+#include fmdrv_rx.h
+#include fmdrv_tx.h
+
+/* FM chip register table */
+static struct fm_reg_table fm_reg_info[] = {
+ /* - FM RX registers ---*/
+ /* opcode, type(rd/wr), reg name */
+ {0x00, REG_RD, STEREO_GET},
+ {0x01, REG_RD, RSSI_LVL_GET},
+ {0x02, REG_RD, IF_COUNT_GET},
+ {0x03, REG_RD, FLAG_GET},
+ {0x04, REG_RD, RDS_SYNC_GET},
+ {0x05, REG_RD, RDS_DATA_GET},
+ {0x0a, REG_WR, FREQ_SET},
+ {0x0a, REG_RD, FREQ_GET},
+ {0x0b, REG_WR, AF_FREQ_SET},
+ {0x0b, REG_RD, AF_FREQ_GET},
+ {0x0c, REG_WR, MOST_MODE_SET},
+ {0x0c, REG_RD, MOST_MODE_GET},
+ {0x0d, REG_WR, MOST_BLEND_SET},
+ {0x0d, REG_RD, MOST_BLEND_GET},
+ {0x0e, REG_WR, DEMPH_MODE_SET},
+ {0x0e, REG_RD, DEMPH_MODE_GET},
+ {0x0f, REG_WR, SEARCH_LVL_SET},
+ {0x0f, REG_RD, SEARCH_LVL_GET},
+ {0x10, REG_WR, RX_BAND_SET},
+ {0x10, REG_RD, RX_BAND_GET},
+ {0x11, REG_WR, MUTE_STATUS_SET},
+ {0x11, REG_RD, MUTE_STATUS_GET},
+ {0x12, REG_WR, RDS_PAUSE_LVL_SET},
+ {0x12, REG_RD, RDS_PAUSE_LVL_GET},
+ {0x13, REG_WR, RDS_PAUSE_DUR_SET},
+ {0x13, REG_RD, RDS_PAUSE_DUR_GET},
+ {0x14, REG_WR, RDS_MEM_SET},
+ {0x14, REG_RD, RDS_MEM_GET},
+ {0x15, REG_WR, RDS_BLK_B_SET},
+ {0x15, REG_RD, RDS_BLK_B_GET},
+ {0x16, REG_WR, RDS_MSK_B_SET},
+ {0x16, REG_RD, RDS_MSK_B_GET},
+ {0x17, REG_WR, RDS_PI_MASK_SET},
+ {0x17, REG_RD, RDS_PI_MASK_GET},
+ {0x18, REG_WR, RDS_PI_SET},
+ {0x18, REG_RD, RDS_PI_GET},
+ {0x19, REG_WR, RDS_SYSTEM_SET},
+ {0x19, REG_RD, RDS_SYSTEM_GET},
+ {0x1a, REG_WR, INT_MASK_SET},
+ {0x1a, REG_RD, INT_MASK_GET},
+ {0x1b, REG_WR, SRCH_DIR_SET},
+ {0x1b, REG_RD, SRCH_DIR_GET},
+ {0x1c, REG_WR, VOLUME_SET},
+ {0x1c, REG_RD, VOLUME_GET},
+ {0x1d, REG_WR, AUDIO_ENABLE(SET)},
+ {0x1d, REG_RD, AUDIO_ENABLE(GET)},
+ {0x1e, REG_WR, PCM_MODE_SET},
+ {0x1e, REG_RD, PCM_MODE_SET},
+ {0x1f, REG_WR, I2S_MD_CFG_SET},
+ {0x1f, REG_RD, I2S_MD_CFG_GET},
+ {0x20, REG_WR, POWER_SET},
+ {0x20, REG_RD, POWER_GET},
+ {0x21, REG_WR, INTx_CONFIG_SET},
+ {0x21, REG_RD, INTx_CONFIG_GET},
+ {0x22, REG_WR, PULL_EN_SET},
+ {0x22, REG_RD, PULL_EN_GET},
+ {0x23, REG_WR, HILO_SET},
+