diff options
author | Jarod Wilson <jarod@redhat.com> | 2011-04-21 14:21:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 14:54:16 -0400 |
commit | 46872d27dadb9d7401d8edc20393e443c573526f (patch) | |
tree | a23a20a10c7812ebb24e42199230a1614e7e2c47 | |
parent | 7225a1dcc38f28fcc6178258b2072d12742f68d9 (diff) |
[media] nuvoton-cir: minor tweaks to rc dev init
- Set a default timeout (matching mceusb.c) and use
ir_raw_event_store_with_filter, which leads to better behavior when
using lirc userspace decoding with this hardware
- Fill in rx_resolution with the value we're using here (50us)
- Wire up input phys and device parent pointer
- Use device_init_wakeup() instead of device_set_wakeup_*()
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 5d93384d2d35..bf3060ea6107 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -674,7 +674,7 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
674 | rawir.pulse ? "pulse" : "space", | 674 | rawir.pulse ? "pulse" : "space", |
675 | rawir.duration); | 675 | rawir.duration); |
676 | 676 | ||
677 | ir_raw_event_store(nvt->rdev, &rawir); | 677 | ir_raw_event_store_with_filter(nvt->rdev, &rawir); |
678 | } | 678 | } |
679 | 679 | ||
680 | /* | 680 | /* |
@@ -1104,18 +1104,20 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1104 | rdev->tx_ir = nvt_tx_ir; | 1104 | rdev->tx_ir = nvt_tx_ir; |
1105 | rdev->s_tx_carrier = nvt_set_tx_carrier; | 1105 | rdev->s_tx_carrier = nvt_set_tx_carrier; |
1106 | rdev->input_name = "Nuvoton w836x7hg Infrared Remote Transceiver"; | 1106 | rdev->input_name = "Nuvoton w836x7hg Infrared Remote Transceiver"; |
1107 | rdev->input_phys = "nuvoton/cir0"; | ||
1107 | rdev->input_id.bustype = BUS_HOST; | 1108 | rdev->input_id.bustype = BUS_HOST; |
1108 | rdev->input_id.vendor = PCI_VENDOR_ID_WINBOND2; | 1109 | rdev->input_id.vendor = PCI_VENDOR_ID_WINBOND2; |
1109 | rdev->input_id.product = nvt->chip_major; | 1110 | rdev->input_id.product = nvt->chip_major; |
1110 | rdev->input_id.version = nvt->chip_minor; | 1111 | rdev->input_id.version = nvt->chip_minor; |
1112 | rdev->dev.parent = &pdev->dev; | ||
1111 | rdev->driver_name = NVT_DRIVER_NAME; | 1113 | rdev->driver_name = NVT_DRIVER_NAME; |
1112 | rdev->map_name = RC_MAP_RC6_MCE; | 1114 | rdev->map_name = RC_MAP_RC6_MCE; |
1115 | rdev->timeout = US_TO_NS(1000); | ||
1116 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ | ||
1117 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); | ||
1113 | #if 0 | 1118 | #if 0 |
1114 | rdev->min_timeout = XYZ; | 1119 | rdev->min_timeout = XYZ; |
1115 | rdev->max_timeout = XYZ; | 1120 | rdev->max_timeout = XYZ; |
1116 | rdev->timeout = XYZ; | ||
1117 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ | ||
1118 | rdev->rx_resolution = XYZ; | ||
1119 | /* tx bits */ | 1121 | /* tx bits */ |
1120 | rdev->tx_resolution = XYZ; | 1122 | rdev->tx_resolution = XYZ; |
1121 | #endif | 1123 | #endif |
@@ -1124,8 +1126,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1124 | if (ret) | 1126 | if (ret) |
1125 | goto failure; | 1127 | goto failure; |
1126 | 1128 | ||
1127 | device_set_wakeup_capable(&pdev->dev, 1); | 1129 | device_init_wakeup(&pdev->dev, true); |
1128 | device_set_wakeup_enable(&pdev->dev, 1); | ||
1129 | nvt->rdev = rdev; | 1130 | nvt->rdev = rdev; |
1130 | nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n"); | 1131 | nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n"); |
1131 | if (debug) { | 1132 | if (debug) { |