Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285435
b: refs/heads/master
c: a612780
h: refs/heads/master
i:
  285433: 44b825e
  285431: 4dea3c8
v: v3
  • Loading branch information
Xi Wang authored and Mauro Carvalho Chehab committed Dec 30, 2011
1 parent 73a1aa6 commit 357907b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27d3e366091b13c26d5d996709fd9d99858455eb
refs/heads/master: a61278037b57b1d75467dcfeb255584d5f11743d
58 changes: 28 additions & 30 deletions trunk/drivers/media/radio/wl128x/fmdrv_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static void send_tasklet(unsigned long arg)
* Queues FM Channel-8 packet to FM TX queue and schedules FM TX tasklet for
* transmission
*/
static u32 fm_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
static int fm_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
int payload_len, struct completion *wait_completion)
{
struct sk_buff *skb;
Expand Down Expand Up @@ -456,22 +456,22 @@ static u32 fm_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
}

/* Sends FM Channel-8 command to the chip and waits for the response */
u32 fmc_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
int fmc_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
unsigned int payload_len, void *response, int *response_len)
{
struct sk_buff *skb;
struct fm_event_msg_hdr *evt_hdr;
unsigned long flags;
u32 ret;
int ret;

init_completion(&fmdev->maintask_comp);
ret = fm_send_cmd(fmdev, fm_op, type, payload, payload_len,
&fmdev->maintask_comp);
if (ret)
return ret;

ret = wait_for_completion_timeout(&fmdev->maintask_comp, FM_DRV_TX_TIMEOUT);
if (!ret) {
if (!wait_for_completion_timeout(&fmdev->maintask_comp,
FM_DRV_TX_TIMEOUT)) {
fmerr("Timeout(%d sec),didn't get reg"
"completion signal from RX tasklet\n",
jiffies_to_msecs(FM_DRV_TX_TIMEOUT) / 1000);
Expand Down Expand Up @@ -508,7 +508,7 @@ u32 fmc_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload,
}

/* --- Helper functions used in FM interrupt handlers ---*/
static inline u32 check_cmdresp_status(struct fmdev *fmdev,
static inline int check_cmdresp_status(struct fmdev *fmdev,
struct sk_buff **skb)
{
struct fm_event_msg_hdr *fm_evt_hdr;
Expand Down Expand Up @@ -1058,7 +1058,7 @@ static void fm_irq_handle_intmsk_cmd_resp(struct fmdev *fmdev)
}

/* Returns availability of RDS data in internel buffer */
u32 fmc_is_rds_data_available(struct fmdev *fmdev, struct file *file,
int fmc_is_rds_data_available(struct fmdev *fmdev, struct file *file,
struct poll_table_struct *pts)
{
poll_wait(file, &fmdev->rx.rds.read_queue, pts);
Expand All @@ -1069,7 +1069,7 @@ u32 fmc_is_rds_data_available(struct fmdev *fmdev, struct file *file,
}

/* Copies RDS data from internal buffer to user buffer */
u32 fmc_transfer_rds_from_internal_buff(struct fmdev *fmdev, struct file *file,
int fmc_transfer_rds_from_internal_buff(struct fmdev *fmdev, struct file *file,
u8 __user *buf, size_t count)
{
u32 block_count;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ u32 fmc_transfer_rds_from_internal_buff(struct fmdev *fmdev, struct file *file,
return ret;
}

u32 fmc_set_freq(struct fmdev *fmdev, u32 freq_to_set)
int fmc_set_freq(struct fmdev *fmdev, u32 freq_to_set)
{
switch (fmdev->curr_fmmode) {
case FM_MODE_RX:
Expand All @@ -1127,7 +1127,7 @@ u32 fmc_set_freq(struct fmdev *fmdev, u32 freq_to_set)
}
}

u32 fmc_get_freq(struct fmdev *fmdev, u32 *cur_tuned_frq)
int fmc_get_freq(struct fmdev *fmdev, u32 *cur_tuned_frq)
{
if (fmdev->rx.freq == FM_UNDEFINED_FREQ) {
fmerr("RX frequency is not set\n");
Expand All @@ -1153,7 +1153,7 @@ u32 fmc_get_freq(struct fmdev *fmdev, u32 *cur_tuned_frq)

}

u32 fmc_set_region(struct fmdev *fmdev, u8 region_to_set)
int fmc_set_region(struct fmdev *fmdev, u8 region_to_set)
{
switch (fmdev->curr_fmmode) {
case FM_MODE_RX:
Expand All @@ -1167,7 +1167,7 @@ u32 fmc_set_region(struct fmdev *fmdev, u8 region_to_set)
}
}

u32 fmc_set_mute_mode(struct fmdev *fmdev, u8 mute_mode_toset)
int fmc_set_mute_mode(struct fmdev *fmdev, u8 mute_mode_toset)
{
switch (fmdev->curr_fmmode) {
case FM_MODE_RX:
Expand All @@ -1181,7 +1181,7 @@ u32 fmc_set_mute_mode(struct fmdev *fmdev, u8 mute_mode_toset)
}
}

u32 fmc_set_stereo_mono(struct fmdev *fmdev, u16 mode)
int fmc_set_stereo_mono(struct fmdev *fmdev, u16 mode)
{
switch (fmdev->curr_fmmode) {
case FM_MODE_RX:
Expand All @@ -1195,7 +1195,7 @@ u32 fmc_set_stereo_mono(struct fmdev *fmdev, u16 mode)
}
}

u32 fmc_set_rds_mode(struct fmdev *fmdev, u8 rds_en_dis)
int fmc_set_rds_mode(struct fmdev *fmdev, u8 rds_en_dis)
{
switch (fmdev->curr_fmmode) {
case FM_MODE_RX:
Expand All @@ -1210,10 +1210,10 @@ u32 fmc_set_rds_mode(struct fmdev *fmdev, u8 rds_en_dis)
}

/* Sends power off command to the chip */
static u32 fm_power_down(struct fmdev *fmdev)
static int fm_power_down(struct fmdev *fmdev)
{
u16 payload;
u32 ret;
int ret;

if (!test_bit(FM_CORE_READY, &fmdev->flag)) {
fmerr("FM core is not ready\n");
Expand All @@ -1234,7 +1234,7 @@ static u32 fm_power_down(struct fmdev *fmdev)
}

/* Reads init command from FM firmware file and loads to the chip */
static u32 fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name)
static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name)
{
const struct firmware *fw_entry;
struct bts_header *fw_header;
Expand Down Expand Up @@ -1299,7 +1299,7 @@ static u32 fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name)
}

/* Loads default RX configuration to the chip */
static u32 load_default_rx_configuration(struct fmdev *fmdev)
static int load_default_rx_configuration(struct fmdev *fmdev)
{
int ret;

Expand All @@ -1311,7 +1311,7 @@ static u32 load_default_rx_configuration(struct fmdev *fmdev)
}

/* Does FM power on sequence */
static u32 fm_power_up(struct fmdev *fmdev, u8 mode)
static int fm_power_up(struct fmdev *fmdev, u8 mode)
{
u16 payload, asic_id, asic_ver;
int resp_len, ret;
Expand Down Expand Up @@ -1374,7 +1374,7 @@ static u32 fm_power_up(struct fmdev *fmdev, u8 mode)
}

/* Set FM Modes(TX, RX, OFF) */
u32 fmc_set_mode(struct fmdev *fmdev, u8 fm_mode)
int fmc_set_mode(struct fmdev *fmdev, u8 fm_mode)
{
int ret = 0;

Expand Down Expand Up @@ -1427,7 +1427,7 @@ u32 fmc_set_mode(struct fmdev *fmdev, u8 fm_mode)
}

/* Returns current FM mode (TX, RX, OFF) */
u32 fmc_get_mode(struct fmdev *fmdev, u8 *fmmode)
int fmc_get_mode(struct fmdev *fmdev, u8 *fmmode)
{
if (!test_bit(FM_CORE_READY, &fmdev->flag)) {
fmerr("FM core is not ready\n");
Expand Down Expand Up @@ -1483,10 +1483,10 @@ static void fm_st_reg_comp_cb(void *arg, char data)
* This function will be called from FM V4L2 open function.
* Register with ST driver and initialize driver data.
*/
u32 fmc_prepare(struct fmdev *fmdev)
int fmc_prepare(struct fmdev *fmdev)
{
static struct st_proto_s fm_st_proto;
u32 ret;
int ret;

if (test_bit(FM_CORE_READY, &fmdev->flag)) {
fmdbg("FM Core is already up\n");
Expand All @@ -1512,10 +1512,8 @@ u32 fmc_prepare(struct fmdev *fmdev)
fmdev->streg_cbdata = -EINPROGRESS;
fmdbg("%s waiting for ST reg completion signal\n", __func__);

ret = wait_for_completion_timeout(&wait_for_fmdrv_reg_comp,
FM_ST_REG_TIMEOUT);

if (!ret) {
if (!wait_for_completion_timeout(&wait_for_fmdrv_reg_comp,
FM_ST_REG_TIMEOUT)) {
fmerr("Timeout(%d sec), didn't get reg "
"completion signal from ST\n",
jiffies_to_msecs(FM_ST_REG_TIMEOUT) / 1000);
Expand Down Expand Up @@ -1589,10 +1587,10 @@ u32 fmc_prepare(struct fmdev *fmdev)
* This function will be called from FM V4L2 release function.
* Unregister from ST driver.
*/
u32 fmc_release(struct fmdev *fmdev)
int fmc_release(struct fmdev *fmdev)
{
static struct st_proto_s fm_st_proto;
u32 ret;
int ret;

if (!test_bit(FM_CORE_READY, &fmdev->flag)) {
fmdbg("FM Core is already down\n");
Expand Down Expand Up @@ -1631,7 +1629,7 @@ u32 fmc_release(struct fmdev *fmdev)
static int __init fm_drv_init(void)
{
struct fmdev *fmdev = NULL;
u32 ret = -ENOMEM;
int ret = -ENOMEM;

fmdbg("FM driver version %s\n", FM_DRV_VERSION);

Expand Down
28 changes: 14 additions & 14 deletions trunk/drivers/media/radio/wl128x/fmdrv_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,27 +368,27 @@ struct fm_event_msg_hdr {
#define FM_TX_ANT_IMP_500 2

/* Functions exported by FM common sub-module */
u32 fmc_prepare(struct fmdev *);
u32 fmc_release(struct fmdev *);
int fmc_prepare(struct fmdev *);
int fmc_release(struct fmdev *);

void fmc_update_region_info(struct fmdev *, u8);
u32 fmc_send_cmd(struct fmdev *, u8, u16,
int fmc_send_cmd(struct fmdev *, u8, u16,
void *, unsigned int, void *, int *);
u32 fmc_is_rds_data_available(struct fmdev *, struct file *,
int fmc_is_rds_data_available(struct fmdev *, struct file *,
struct poll_table_struct *);
u32 fmc_transfer_rds_from_internal_buff(struct fmdev *, struct file *,
int fmc_transfer_rds_from_internal_buff(struct fmdev *, struct file *,
u8 __user *, size_t);

u32 fmc_set_freq(struct fmdev *, u32);
u32 fmc_set_mode(struct fmdev *, u8);
u32 fmc_set_region(struct fmdev *, u8);
u32 fmc_set_mute_mode(struct fmdev *, u8);
u32 fmc_set_stereo_mono(struct fmdev *, u16);
u32 fmc_set_rds_mode(struct fmdev *, u8);
int fmc_set_freq(struct fmdev *, u32);
int fmc_set_mode(struct fmdev *, u8);
int fmc_set_region(struct fmdev *, u8);
int fmc_set_mute_mode(struct fmdev *, u8);
int fmc_set_stereo_mono(struct fmdev *, u16);
int fmc_set_rds_mode(struct fmdev *, u8);

u32 fmc_get_freq(struct fmdev *, u32 *);
u32 fmc_get_region(struct fmdev *, u8 *);
u32 fmc_get_mode(struct fmdev *, u8 *);
int fmc_get_freq(struct fmdev *, u32 *);
int fmc_get_region(struct fmdev *, u8 *);
int fmc_get_mode(struct fmdev *, u8 *);

/*
* channel spacing
Expand Down

0 comments on commit 357907b

Please sign in to comment.