Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242153
b: refs/heads/master
c: 12d896e
h: refs/heads/master
i:
  242151: f8e1daf
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent cde9e48 commit 45804be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 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: b443ac5a2836532af2315a4acb95c7a2cf721cbd
refs/heads/master: 12d896e1c17978599a98510fdfaff27a4e82c0bf
27 changes: 20 additions & 7 deletions trunk/drivers/staging/lirc/lirc_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ static int add_to_buf(struct IR *ir)
return -ENODATA;
}
schedule_timeout((100 * HZ + 999) / 1000);
ir->tx->need_boot = 1;
if (ir->tx != NULL)
ir->tx->need_boot = 1;

++failures;
mutex_unlock(&ir->ir_lock);
Expand Down Expand Up @@ -1032,9 +1033,10 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
int result;
unsigned long mode, features = 0;

features |= LIRC_CAN_SEND_PULSE;
if (ir->rx != NULL)
features |= LIRC_CAN_REC_LIRCCODE;
if (ir->tx != NULL)
features |= LIRC_CAN_SEND_PULSE;

switch (cmd) {
case LIRC_GET_LENGTH:
Expand All @@ -1061,9 +1063,15 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
result = -EINVAL;
break;
case LIRC_GET_SEND_MODE:
if (!(features&LIRC_CAN_SEND_MASK))
return -ENOSYS;

result = put_user(LIRC_MODE_PULSE, (unsigned long *) arg);
break;
case LIRC_SET_SEND_MODE:
if (!(features&LIRC_CAN_SEND_MASK))
return -ENOSYS;

result = get_user(mode, (unsigned long *) arg);
if (!result && mode != LIRC_MODE_PULSE)
return -EINVAL;
Expand Down Expand Up @@ -1242,8 +1250,10 @@ static int ir_remove(struct i2c_client *client)
}

/* Good-bye Tx */
i2c_set_clientdata(ir->tx->c, NULL);
kfree(ir->tx);
if (ir->tx != NULL) {
i2c_set_clientdata(ir->tx->c, NULL);
kfree(ir->tx);
}

/* Good-bye IR */
del_ir_device(ir);
Expand Down Expand Up @@ -1393,9 +1403,12 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
* after registering with lirc as otherwise hotplug seems to take
* 10s to create the lirc device.
*/
ret = tx_init(ir->tx);
if (ret != 0)
goto out_unregister;
if (ir->tx != NULL) {
/* Special TX init */
ret = tx_init(ir->tx);
if (ret != 0)
goto out_unregister;
}

zilog_info("probe of IR %s on %s (i2c-%d) done. IR unit ready.\n",
tx_probe ? "Tx" : "Rx", adap->name, adap->nr);
Expand Down

0 comments on commit 45804be

Please sign in to comment.