diff options
author | Manjunatha Halli <manjunatha_halli@ti.com> | 2010-12-02 12:45:34 +0530 |
---|---|---|
committer | Manjunatha Halli <manjunatha_halli@ti.com> | 2010-12-17 16:22:58 +0530 |
commit | edd21ecd4415c6cb6f7e57b951844200f8d033f6 (patch) | |
tree | ff0fc69a7187c45fd39b3d3eca1b4066d4bb2bc0 | |
parent | ab51bbbb88435f810036eb9ebc4e27fa55387065 (diff) |
staging:ti-st:fmdrv: Set to default frequency if BL reached while seek.
When seeking down from 88 MHz(channel spacing is set to 200 KHz), we see
band limit reached. At that moment FM chip is reporting frq_index as
0xFFFE (-2), this is wrong as frq_index should be within 0 to 410.
So, to solve this problem this patch is setting the default freq to
87.5/108 MHz depending on seek direction if BL interrupt is received.
Signed-off-by: Manjunatha Halli <manjunatha_halli@ti.com>
-rw-r--r-- | drivers/staging/ti-st/fmdrv_common.c | 5 | ||||
-rw-r--r-- | drivers/staging/ti-st/fmdrv_rx.c | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/staging/ti-st/fmdrv_common.c b/drivers/staging/ti-st/fmdrv_common.c index 0dcb5773781f..ae3641a04da9 100644 --- a/drivers/staging/ti-st/fmdrv_common.c +++ b/drivers/staging/ti-st/fmdrv_common.c @@ -194,14 +194,14 @@ static struct fm_reg_table fm_reg_info[] = { static struct region_info region_configs[] = { /* Europe/US */ { - .channel_spacing = FM_CHANNEL_SPACING_50KHZ * FM_FREQ_MUL, + .channel_spacing = FM_CHANNEL_SPACING_200KHZ * FM_FREQ_MUL, .bottom_frequency = 87500, /* 87.5 MHz */ .top_frequency = 108000, /* 108 MHz */ .region_index = 0, }, /* Japan */ { - .channel_spacing = FM_CHANNEL_SPACING_50KHZ * FM_FREQ_MUL, + .channel_spacing = FM_CHANNEL_SPACING_200KHZ * FM_FREQ_MUL, .bottom_frequency = 76000, /* 76 MHz */ .top_frequency = 90000, /* 90 MHz */ .region_index = 1, @@ -1017,7 +1017,6 @@ static void fm_irq_handle_rds_finish(void *arg) static void fm_irq_handle_tune_op_ended(void *arg) { struct fmdrv_ops *fmdev; - fmdev = arg; if (fmdev->irq_info.flag & (FM_FR_EVENT | FM_BL_EVENT) & fmdev-> irq_info.mask) { diff --git a/drivers/staging/ti-st/fmdrv_rx.c b/drivers/staging/ti-st/fmdrv_rx.c index fa509f718d44..5fb182f06a35 100644 --- a/drivers/staging/ti-st/fmdrv_rx.c +++ b/drivers/staging/ti-st/fmdrv_rx.c @@ -163,7 +163,7 @@ int fm_rx_seek(struct fmdrv_ops *fmdev, unsigned int seek_upward, unsigned short payload, int_reason; char offset, spacing; unsigned long timeleft; - int ret; + int ret, band_lmt_reach = 0; if (fmdev->curr_fmmode != FM_MODE_RX) { ret = -EPERM; @@ -239,6 +239,9 @@ int fm_rx_seek(struct fmdrv_ops *fmdev, unsigned int seek_upward, } int_reason = fmdev->irq_info.flag & 0x3; + if (fmdev->irq_info.flag & FM_BL_EVENT) + band_lmt_reach = 1; + /* Re-enable default FM interrupts */ fmdev->irq_info.mask &= ~(FM_FR_EVENT | FM_BL_EVENT); FM_STORE_LE16_TO_BE16(payload, fmdev->irq_info.mask); @@ -246,6 +249,11 @@ int fm_rx_seek(struct fmdrv_ops *fmdev, unsigned int seek_upward, &fmdev->maintask_completion, NULL, NULL); FM_CHECK_SEND_CMD_STATUS(ret); + if (band_lmt_reach == 1) + fmdev->rx.curr_freq = seek_upward ? + fmdev->rx.region.top_frequency : + fmdev->rx.region.bottom_frequency; + else { /* Read freq to know where operation tune operation stopped */ ret = fmc_send_cmd(fmdev, FREQ_GET, NULL, 2, &fmdev->maintask_completion, &curr_frq, &resp_len); @@ -255,6 +263,7 @@ int fm_rx_seek(struct fmdrv_ops *fmdev, unsigned int seek_upward, fmdev->rx.curr_freq = (fmdev->rx.region.bottom_frequency + ((unsigned int)curr_frq * FM_FREQ_MUL)); + } /* Reset RDS cache and current station pointers */ fm_rx_reset_rds_cache(fmdev); fm_rx_reset_curr_station_info(fmdev); |