Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250173
b: refs/heads/master
c: 474fdc0
h: refs/heads/master
i:
  250171: 69e771a
v: v3
  • Loading branch information
Joonyoung Shim authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 0f58b07 commit 2a208b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 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: 949cf31cb00c16a1011c73c43f30cd3e2dfb6610
refs/heads/master: 474fdc0822abd36d38041c0f02513adb5006f6cb
32 changes: 9 additions & 23 deletions trunk/drivers/media/radio/si470x/radio-si470x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,11 @@ int si470x_vidioc_querycap(struct file *file, void *priv,
**************************************************************************/

/*
* si470x_i2c_interrupt_work - rds processing function
* si470x_i2c_interrupt - interrupt handler
*/
static void si470x_i2c_interrupt_work(struct work_struct *work)
static irqreturn_t si470x_i2c_interrupt(int irq, void *dev_id)
{
struct si470x_device *radio = container_of(work,
struct si470x_device, radio_work);
struct si470x_device *radio = dev_id;
unsigned char regnr;
unsigned char blocknum;
unsigned short bler; /* rds block errors */
Expand All @@ -278,26 +277,26 @@ static void si470x_i2c_interrupt_work(struct work_struct *work)
/* check Seek/Tune Complete */
retval = si470x_get_register(radio, STATUSRSSI);
if (retval < 0)
return;
goto end;

if (radio->registers[STATUSRSSI] & STATUSRSSI_STC)
complete(&radio->completion);

/* safety checks */
if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0)
return;
goto end;

/* Update RDS registers */
for (regnr = 1; regnr < RDS_REGISTER_NUM; regnr++) {
retval = si470x_get_register(radio, STATUSRSSI + regnr);
if (retval < 0)
return;
goto end;
}

/* get rds blocks */
if ((radio->registers[STATUSRSSI] & STATUSRSSI_RDSR) == 0)
/* No RDS group ready, better luck next time */
return;
goto end;

for (blocknum = 0; blocknum < 4; blocknum++) {
switch (blocknum) {
Expand Down Expand Up @@ -351,19 +350,8 @@ static void si470x_i2c_interrupt_work(struct work_struct *work)

if (radio->wr_index != radio->rd_index)
wake_up_interruptible(&radio->read_queue);
}


/*
* si470x_i2c_interrupt - interrupt handler
*/
static irqreturn_t si470x_i2c_interrupt(int irq, void *dev_id)
{
struct si470x_device *radio = dev_id;

if (!work_pending(&radio->radio_work))
schedule_work(&radio->radio_work);

end:
return IRQ_HANDLED;
}

Expand All @@ -385,7 +373,6 @@ static int __devinit si470x_i2c_probe(struct i2c_client *client,
goto err_initial;
}

INIT_WORK(&radio->radio_work, si470x_i2c_interrupt_work);
radio->users = 0;
radio->client = client;
mutex_init(&radio->lock);
Expand Down Expand Up @@ -454,7 +441,7 @@ static int __devinit si470x_i2c_probe(struct i2c_client *client,
radio->stci_enabled = true;
init_completion(&radio->completion);

retval = request_irq(client->irq, si470x_i2c_interrupt,
retval = request_threaded_irq(client->irq, NULL, si470x_i2c_interrupt,
IRQF_TRIGGER_FALLING, DRIVER_NAME, radio);
if (retval) {
dev_err(&client->dev, "Failed to register interrupt\n");
Expand Down Expand Up @@ -492,7 +479,6 @@ static __devexit int si470x_i2c_remove(struct i2c_client *client)
struct si470x_device *radio = i2c_get_clientdata(client);

free_irq(client->irq, radio);
cancel_work_sync(&radio->radio_work);
video_unregister_device(radio->videodev);
kfree(radio);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/media/radio/si470x/radio-si470x.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ struct si470x_device {

#if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE)
struct i2c_client *client;
struct work_struct radio_work;
#endif
};

Expand Down

0 comments on commit 2a208b0

Please sign in to comment.