Skip to contentSkip to conversation

ir-keytable: do not fail at the first transmit-only device

PATCH New Sean Young 1 participant 5 messages Aug 3, 2017

Subsystems (3)
lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH 1/4 ir-keytable: do not fail at the first transmit-only device

It is not possible to list all rc devices without this, since it fails when ir-keytable encounters an rc device without an input device (ie. IR transmitters).

Note that IR transmitters are not listed, but they are of no interest to ir-keytable anyway.

---
 utils/keytable/keytable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/keytable/keytable.c +1 -1
index 634f4561..5572072a 100644
@@ -1448,7 +1448,7 @@ static int show_sysfs_attribs(struct rc_device *rc_dev)
 	for (cur = names; cur->next; cur = cur->next) {
 		if (cur->name) {
 			if (get_attribs(rc_dev, cur->name))
-				return -1;
+				continue;
 			fprintf(stderr, _("Found %s (%s) with:\n"),
 				rc_dev->sysfs_name,
 				rc_dev->input_name);
Signature · 1 line
2.11.0
author
#1 lore raw

PATCH 1/1 lirc_zilog: driver only sends LIRCCODE

This driver cannot send pulse, it only accepts driver-dependent codes.

---
 drivers/staging/media/lirc/lirc_zilog.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/lirc/lirc_zilog.c +4 -4
index c9f2bd324767..d138ca494176 100644
@@ -290,7 +290,7 @@ static void release_ir_tx(struct kref *ref)
 	struct IR_tx *tx = container_of(ref, struct IR_tx, ref);
 	struct IR *ir = tx->ir;
 
-	ir->l->features &= ~LIRC_CAN_SEND_PULSE;
+	ir->l->features &= ~LIRC_CAN_SEND_LIRCCODE;
 	/* Don't put_ir_device(tx->ir) here, so our lock doesn't get freed */
 	ir->tx = NULL;
 	kfree(tx);
@@ -1269,14 +1269,14 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 		if (!(features & LIRC_CAN_SEND_MASK))
 			return -ENOTTY;
 
-		result = put_user(LIRC_MODE_PULSE, uptr);
+		result = put_user(LIRC_MODE_LIRCCODE, uptr);
 		break;
 	case LIRC_SET_SEND_MODE:
 		if (!(features & LIRC_CAN_SEND_MASK))
 			return -ENOTTY;
 
 		result = get_user(mode, uptr);
-		if (!result && mode != LIRC_MODE_PULSE)
+		if (!result && mode != LIRC_MODE_LIRCCODE)
 			return -EINVAL;
 		break;
 	default:
@@ -1484,7 +1484,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		kref_init(&tx->ref);
 		ir->tx = tx;
 
-		ir->l->features |= LIRC_CAN_SEND_PULSE;
+		ir->l->features |= LIRC_CAN_SEND_LIRCCODE;
 		mutex_init(&tx->client_lock);
 		tx->c = client;
 		tx->need_boot = 1;
Signature · 1 line
2.13.3
author
#2 lore raw

PATCH 2/4 ir-ctl: "ir-ctl -S rc6_mce:0x800f0410" does not work on 32-bit

In reply to Sean Young

0x800f0410 does not fit in 32-bit signed long.

---
 utils/ir-ctl/ir-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/ir-ctl/ir-ctl.c +1 -1
index 3d66063a..562a05da 100644
@@ -152,7 +152,7 @@ static int strtoint(const char *p, const char *unit)
 static bool strtoscancode(const char *p, unsigned *ret)
 {
 	char *end;
-	long arg = strtol(p, &end, 0);
+	long long arg = strtoll(p, &end, 0);
 	if (end == NULL || end[0] != 0)
 		return false;
 
Signature · 1 line
2.11.0
author
#3 lore raw

PATCH 3/4 ir-ctl: lirc resolution is in microseconds

In reply to Sean Young
---
 utils/ir-ctl/ir-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/ir-ctl/ir-ctl.c +1 -1
index 562a05da..e7275989 100644
@@ -689,7 +689,7 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
 	if (features & LIRC_CAN_REC_MODE2) {
 		printf(_(" - Device can receive raw IR\n"));
 		if (resolution)
-			printf(_(" - Resolution %u nanoseconds\n"), resolution);
+			printf(_(" - Resolution %u microseconds\n"), resolution);
 		if (features & LIRC_CAN_SET_REC_CARRIER)
 			printf(_(" - Set receive carrier\n"));
 		if (features & LIRC_CAN_USE_WIDEBAND_RECEIVER)
Signature · 1 line
2.11.0
author
#4 lore raw

PATCH 4/4 ir-ctl: report LIRCCODE drivers even if we don't supported them

In reply to Sean Young
---
 utils/ir-ctl/ir-ctl.c | 4 ++++
 1 file changed, 4 insertions(+)
utils/ir-ctl/ir-ctl.c +4 -0
index e7275989..544ad341 100644
@@ -715,6 +715,8 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
 			if (min_timeout || max_timeout)
 				printf(_(" - Can set recording timeout min:%u microseconds max:%u microseconds\n"), min_timeout, max_timeout);
 		}
+	} else if (features & LIRC_CAN_REC_LIRCCODE) {
+		printf(_(" - Device can receive using device dependent LIRCCODE mode (not supported)\n"));
 	} else {
 		printf(_(" - Device cannot receive\n"));
 	}
@@ -736,6 +738,8 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
 			else
 				printf(_(" - Set transmitter (%d available)\n"), rc);
 		}
+	} else if (features & LIRC_CAN_SEND_LIRCCODE) {
+		printf(_(" - Device can send using device dependent LIRCCODE mode (not supported)\n"));
 	} else {
 		printf(_(" - Device cannot send\n"));
 	}
Signature · 1 line
2.11.0