diff options
50 files changed, 188 insertions, 208 deletions
diff --git a/drivers/hid/hid-picolcd_cir.c b/drivers/hid/hid-picolcd_cir.c index 34da38d5b0cd..d6faa0e00f95 100644 --- a/drivers/hid/hid-picolcd_cir.c +++ b/drivers/hid/hid-picolcd_cir.c @@ -59,10 +59,10 @@ int picolcd_raw_cir(struct picolcd_data *data, for (i = 0; i+1 < sz; i += 2) { w = (raw_data[i] << 8) | (raw_data[i+1]); rawir.pulse = !!(w & 0x8000); - rawir.duration = US_TO_NS(rawir.pulse ? (65536 - w) : w); + rawir.duration = rawir.pulse ? (65536 - w) : w; /* Quirk!! - see above */ - if (i == 0 && rawir.duration > 15000000) - rawir.duration -= 15000000; + if (i == 0 && rawir.duration > 15000) + rawir.duration -= 15000; ir_raw_event_store(data->rc_dev, &rawir); } ir_raw_event_handle(data->rc_dev); @@ -114,8 +114,8 @@ int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report) rdev->dev.parent = &data->hdev->dev; rdev->driver_name = PICOLCD_NAME; rdev->map_name = RC_MAP_RC6_MCE; - rdev->timeout = MS_TO_NS(100); - rdev->rx_resolution = US_TO_NS(1); + rdev->timeout = MS_TO_US(100); + rdev->rx_resolution = 1; ret = rc_register_device(rdev); if (ret) diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index 562792f545ac..3ee16f672d68 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -309,7 +309,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, adap->rc->allowed_protocols = RC_PROTO_BIT_CEC; adap->rc->priv = adap; adap->rc->map_name = RC_MAP_CEC; - adap->rc->timeout = MS_TO_NS(550); + adap->rc->timeout = MS_TO_US(550); #endif return adap; } diff --git a/drivers/media/cec/platform/seco/seco-cec.c b/drivers/media/cec/platform/seco/seco-cec.c index 075dd79beb6f..ae138cc253fd 100644 --- a/drivers/media/cec/platform/seco/seco-cec.c +++ b/drivers/media/cec/platform/seco/seco-cec.c @@ -369,7 +369,7 @@ static int secocec_ir_probe(void *priv) cec->ir->allowed_protocols = RC_PROTO_BIT_RC5; cec->ir->priv = cec; cec->ir->map_name = RC_MAP_HAUPPAUGE; - cec->ir->timeout = MS_TO_NS(100); + cec->ir->timeout = MS_TO_US(100); /* Clear the status register */ status = smb_rd16(SECOCEC_STATUS_REG_1, &val); diff --git a/drivers/media/common/siano/smsir.c b/drivers/media/common/siano/smsir.c index 79bd627f84b8..d85c78c104b9 100644 --- a/drivers/media/common/siano/smsir.c +++ b/drivers/media/common/siano/smsir.c @@ -27,7 +27,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len) for (i = 0; i < len >> 2; i++) { struct ir_raw_event ev = { - .duration = abs(samples[i]) * 1000, /* Convert to ns */ + .duration = abs(samples[i]), .pulse = (samples[i] > 0) ? false : true }; @@ -48,7 +48,7 @@ int sms_ir_init(struct smscore_device_t *coredev) return -ENOMEM; coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ - coredev->ir.timeout = IR_DEFAULT_TIMEOUT; + coredev->ir.timeout = US_TO_NS(IR_DEFAULT_TIMEOUT); pr_debug("IR port %d, timeout %d ms\n", coredev->ir.controller, coredev->ir.timeout); diff --git a/drivers/media/i2c/cx25840/cx25840-ir.c b/drivers/media/i2c/cx25840/cx25840-ir.c index 2181c8a347fc..2cf3e6a1f9e1 100644 --- a/drivers/media/i2c/cx25840/cx25840-ir.c +++ b/drivers/media/i2c/cx25840/cx25840-ir.c @@ -688,7 +688,7 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, } v = (unsigned) pulse_width_count_to_ns( - (u16) (p->hw_fifo_data & FIFO_RXTX), divider); + (u16)(p->hw_fifo_data & FIFO_RXTX), divider) / 1000; if (v > IR_MAX_DURATION) v = IR_MAX_DURATION; diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index ad7f8ccad526..ddfd2eb37484 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -663,7 +663,7 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, } v = (unsigned) pulse_width_count_to_ns( - (u16) (p->hw_fifo_data & FIFO_RXTX), divider); + (u16)(p->hw_fifo_data & FIFO_RXTX), divider) / 1000; if (v > IR_MAX_DURATION) v = IR_MAX_DURATION; diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index 7e0fed9cd200..ce0ef0b8186f 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -479,7 +479,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) dev->scancode_mask = hardware_mask; if (ir->sampling) { - dev->timeout = 10 * 1000 * 1000; /* 10 ms */ + dev->timeout = MS_TO_US(10); /* 10 ms */ } else { dev->driver_type = RC_DRIVER_SCANCODE; dev->allowed_protocols = rc_proto; @@ -544,7 +544,7 @@ void cx88_ir_irq(struct cx88_core *core) for (todo = 32; todo > 0; todo -= bits) { ev.pulse = samples & 0x80000000 ? false : true; bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples)); - ev.duration = (bits * (NSEC_PER_SEC / 1000)) / ir_samplerate; + ev.duration = (bits * (USEC_PER_SEC / 1000)) / ir_samplerate; ir_raw_event_store_with_filter(ir->dev, &ev); samples <<= bits; } diff --git a/drivers/media/pci/smipcie/smipcie-ir.c b/drivers/media/pci/smipcie/smipcie-ir.c index 9445d792bfc9..e6b74e161a05 100644 --- a/drivers/media/pci/smipcie/smipcie-ir.c +++ b/drivers/media/pci/smipcie/smipcie-ir.c @@ -87,8 +87,7 @@ static void smi_ir_decode(struct smi_rc *ir) struct ir_raw_event rawir = {}; rawir.pulse = 0; - rawir.duration = US_TO_NS(SMI_SAMPLE_PERIOD * - SMI_SAMPLE_IDLEMIN); + rawir.duration = SMI_SAMPLE_PERIOD * SMI_SAMPLE_IDLEMIN; ir_raw_event_store_with_filter(rc_dev, &rawir); smi_set(IR_Init_Reg, rbIRhighidle); } @@ -151,8 +150,8 @@ int smi_ir_init(struct smi_dev *dev) rc_dev->dev.parent = &dev->pci_dev->dev; rc_dev->map_name = dev->info->rc_map; - rc_dev->timeout = MS_TO_NS(100); - rc_dev->rx_resolution = US_TO_NS(SMI_SAMPLE_PERIOD); + rc_dev->timeout = MS_TO_US(100); + rc_dev->rx_resolution = SMI_SAMPLE_PERIOD; ir->rc_dev = rc_dev; ir->dev = dev; diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 82867a2a60b0..6049e5c95394 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -432,27 +432,27 @@ static void ene_rx_setup(struct ene_device *dev) select_timeout: if (dev->rx_fan_input_inuse) { - dev->rdev->rx_resolution = US_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN); + dev->rdev->rx_resolution = ENE_FW_SAMPLE_PERIOD_FAN; /* Fan input doesn't support timeouts, it just ends the input with a maximum sample */ dev->rdev->min_timeout = dev->rdev->max_timeout = - US_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK * - ENE_FW_SAMPLE_PERIOD_FAN); + ENE_FW_SMPL_BUF_FAN_MSK * + ENE_FW_SAMPLE_PERIOD_FAN; } else { - dev->rdev->rx_resolution = US_TO_NS(sample_period); + dev->rdev->rx_resolution = sample_period; /* Theoreticly timeout is unlimited, but we cap it * because it was seen that on one device, it * would stop sending spaces after around 250 msec. * Besides, this is close to 2^32 anyway and timeout is u32. */ - dev->rdev->min_timeout = US_TO_NS(127 * sample_period); - dev->rdev->max_timeout = US_TO_NS(200000); + dev->rdev->min_timeout = 127 * sample_period; + dev->rdev->max_timeout = 200000; } if (dev->hw_learning_and_tx_capable) - dev->rdev->tx_resolution = US_TO_NS(sample_period); + dev->rdev->tx_resolution = sample_period; if (dev->rdev->timeout > dev->rdev->max_timeout) dev->rdev->timeout = dev->rdev->max_timeout; @@ -798,7 +798,7 @@ static irqreturn_t ene_isr(int irq, void *data) dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space"); - ev.duration = US_TO_NS(hw_sample); + ev.duration = hw_sample; ev.pulse = pulse; ir_raw_event_store_with_filter(dev->rdev, &ev); } @@ -818,7 +818,7 @@ static void ene_setup_default_settings(struct ene_device *dev) dev->learning_mode_enabled = learning_mode_force; /* Set reasonable default timeout */ - dev->rdev->timeout = US_TO_NS(150000); + dev->rdev->timeout = MS_TO_US(150); } /* Upload all hardware settings at once. Used at load and resume time */ diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 8e3177c5b586..b0d580566e4e 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -299,8 +299,8 @@ static void fintek_process_rx_ir_data(struct fintek_dev *fintek) case PARSE_IRDATA: fintek->rem--; rawir.pulse = ((sample & BUF_PULSE_BIT) != 0); - rawir.duration = US_TO_NS((sample & BUF_SAMPLE_MASK) - * CIR_SAMPLE_PERIOD); + rawir.duration = (sample & BUF_SAMPLE_MASK) + * CIR_SAMPLE_PERIOD; fit_dbg("Storing %s with duration %d", rawir.pulse ? "pulse" : "space", @@ -524,9 +524,9 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id rdev->dev.parent = &pdev->dev; rdev->driver_name = FINTEK_DRIVER_NAME; rdev->map_name = RC_MAP_RC6_MCE; - rdev->timeout = US_TO_NS(1000); + rdev->timeout = 1000; /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ - rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); + rdev->rx_resolution = CIR_SAMPLE_PERIOD; fintek->rdev = rdev; diff --git a/drivers/media/rc/igorplugusb.c b/drivers/media/rc/igorplugusb.c index b981f7290c1b..effaa5751d6c 100644 --- a/drivers/media/rc/igorplugusb.c +++ b/drivers/media/rc/igorplugusb.c @@ -69,7 +69,7 @@ static void igorplugusb_irdata(struct igorplugusb *ir, unsigned len) overflow); do { - rawir.duration = ir->buf_in[i] * 85333; + rawir.duration = ir->buf_in[i] * 85; rawir.pulse = i & 1; ir_raw_event_store_with_filter(ir->rc, &rawir); @@ -202,8 +202,8 @@ static int igorplugusb_probe(struct usb_interface *intf, rc->priv = ir; rc->driver_name = DRIVER_NAME; rc->map_name = RC_MAP_HAUPPAUGE; - rc->timeout = MS_TO_NS(100); - rc->rx_resolution = 85333; + rc->timeout = MS_TO_US(100); + rc->rx_resolution = 85; ir->rc = rc; ret = rc_register_device(rc); diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c index b5b993b33b80..84949baf9f6b 100644 --- a/drivers/media/rc/iguanair.c +++ b/drivers/media/rc/iguanair.c @@ -59,7 +59,7 @@ struct iguanair { #define MAX_IN_PACKET 8u #define MAX_OUT_PACKET (sizeof(struct send_packet) + BUF_SIZE) #define TIMEOUT 1000 -#define RX_RESOLUTION 21333 +#define RX_RESOLUTION 21 struct packet { uint16_t start; @@ -124,7 +124,7 @@ static void process_ir_data(struct iguanair *ir, unsigned len) for (i = 0; i < 7; i++) { if (ir->buf_in[i] == 0x80) { rawir.pulse = false; - rawir.duration = US_TO_NS(21845); + rawir.duration = 21845; } else { rawir.pulse = (ir->buf_in[i] & 0x80) == 0; rawir.duration = ((ir->buf_in[i] & 0x7f) + 1) * diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c index aae0a3cc9479..d41580f6e4c7 100644 --- a/drivers/media/rc/imon_raw.c +++ b/drivers/media/rc/imon_raw.c @@ -8,7 +8,7 @@ #include <media/rc-core.h> /* Each bit is 250us */ -#define BIT_DURATION 250000 +#define BIT_DURATION 250 struct imon { struct device *dev; diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c index d80cfa455c73..0ffc27514fab 100644 --- a/drivers/media/rc/ir-hix5hd2.c +++ b/drivers/media/rc/ir-hix5hd2.c @@ -214,12 +214,12 @@ static irqreturn_t hix5hd2_ir_rx_interrupt(int irq, void *data) data_h = ((symb_val >> 16) & 0xffff) * 10; symb_time = (data_l + data_h) / 10; - ev.duration = US_TO_NS(data_l); + ev.duration = data_l; ev.pulse = true; ir_raw_event_store(priv->rdev, &ev); if (symb_time < IR_CFG_SYMBOL_MAXWIDTH) { - ev.duration = US_TO_NS(data_h); + ev.duration = data_h; ev.pulse = false; ir_raw_event_store(priv->rdev, &ev); } else { @@ -311,8 +311,8 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) rdev->input_id.vendor = 0x0001; rdev->input_id.product = 0x0001; rdev->input_id.version = 0x0100; - rdev->rx_resolution = US_TO_NS(10); - rdev->timeout = US_TO_NS(IR_CFG_SYMBOL_MAXWIDTH * 10); + rdev->rx_resolution = 10; + rdev->timeout = IR_CFG_SYMBOL_MAXWIDTH * 10; ret = rc_register_device(rdev); if (ret < 0) diff --git a/drivers/media/rc/ir-imon-decoder.c b/drivers/media/rc/ir-imon-decoder.c index a0efe2605393..41dbbef27fa6 100644 --- a/drivers/media/rc/ir-imon-decoder.c +++ b/drivers/media/rc/ir-imon-decoder.c @@ -8,7 +8,7 @@ #include <linux/module.h> #include "rc-core-priv.h" -#define IMON_UNIT 415662 /* ns */ +#define IMON_UNIT 416 /* us */ #define IMON_BITS 30 #define IMON_CHKBITS (BIT(30) | BIT(25) | BIT(24) | BIT(22) | \ BIT(21) | BIT(20) | BIT(19) | BIT(18) | \ @@ -102,8 +102,7 @@ static int ir_imon_decode(struct rc_dev *dev, struct ir_raw_event ev) dev_dbg(&dev->dev, "iMON decode started at state %d bitno %d (%uus %s)\n", - data->state, data->count, TO_US(ev.duration), - TO_STR(ev.pulse)); + data->state, data->count, ev.duration, TO_STR(ev.pulse)); /* * Since iMON protocol is a series of bits, if at any point @@ -116,7 +115,7 @@ static int ir_imon_decode(struct rc_dev *dev, struct ir_raw_event ev) * we're at a new scancode. */ if (data->state == STATE_ERROR) { - if (!ev.pulse && ev.duration > MS_TO_NS(10)) + if (!ev.pulse && ev.duration > MS_TO_US(10)) data->state = STATE_INACTIVE; return 0; } @@ -169,8 +168,7 @@ static int ir_imon_decode(struct rc_dev *dev, struct ir_raw_event ev) err_out: dev_dbg(&dev->dev, "iMON decode failed at state %d bitno %d (%uus %s)\n", - data->state, data->count, TO_US(ev.duration), - TO_STR(ev.pulse)); + data->state, data->count, ev.duration, TO_STR(ev.pulse)); data->state = STATE_ERROR; diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c index 864d9e316c33..470f2e1fd507 100644 --- a/drivers/media/rc/ir-jvc-decoder.c +++ b/drivers/media/rc/ir-jvc-decoder.c @@ -9,7 +9,7 @@ #include "rc-core-priv.h" #define JVC_NBITS 16 /* dev(8) + func(8) */ -#define JVC_UNIT 525000 /* ns */ +#define JVC_UNIT 525 /* us */ #define JVC_HEADER_PULSE (16 * JVC_UNIT) /* lack of header -> repeat */ #define JVC_HEADER_SPACE (8 * JVC_UNIT) #define JVC_BIT_PULSE (1 * JVC_UNIT) @@ -49,7 +49,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) goto out; dev_dbg(&dev->dev, "JVC decode started at state %d (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); again: switch (data->state) { @@ -157,7 +157,7 @@ again: out: dev_dbg(&dev->dev, "JVC decode failed at state %d (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; } diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c b/drivers/media/rc/ir-mce_kbd-decoder.c index cfe837f773c1..90350f25d8dd 100644 --- a/drivers/media/rc/ir-mce_kbd-decoder.c +++ b/drivers/media/rc/ir-mce_kbd-decoder.c @@ -21,7 +21,7 @@ * input device for the remote, rather than the keyboard/mouse one. */ -#define MCIR2_UNIT 333333 /* ns */ +#define MCIR2_UNIT 333 /* us */ #define MCIR2_HEADER_NBITS 5 #define MCIR2_MOUSE_NBITS 29 #define MCIR2_KEYBOARD_NBITS 32 @@ -231,7 +231,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) again: dev_dbg(&dev->dev, "started at state %i (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); if (!geq_margin(ev.duration, MCIR2_UNIT, MCIR2_UNIT / 2)) return 0; @@ -353,7 +353,7 @@ again: out: dev_dbg(&dev->dev, "failed at state %i (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; } diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c index 6a8973ae3684..b4c3e4baf34d 100644 --- a/drivers/media/rc/ir-nec-decoder.c +++ b/drivers/media/rc/ir-nec-decoder.c @@ -8,7 +8,7 @@ #include "rc-core-priv.h" #define NEC_NBITS 32 -#define NEC_UNIT 562500 /* ns */ +#define NEC_UNIT 563 /* us */ #define NEC_HEADER_PULSE (16 * NEC_UNIT) #define NECX_HEADER_PULSE (8 * NEC_UNIT) /* Less common NEC variant */ #define NEC_HEADER_SPACE (8 * NEC_UNIT) @@ -50,7 +50,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) } dev_dbg(&dev->dev, "NEC decode started at state %d (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); switch (data->state) { @@ -163,7 +163,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) } dev_dbg(&dev->dev, "NEC decode failed at count %d state %d (%uus %s)\n", - data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->count, data->state, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; } diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c index 63624654a71e..d58b6226afeb 100644 --- a/drivers/media/rc/ir-rc5-decoder.c +++ b/drivers/media/rc/ir-rc5-decoder.c @@ -16,7 +16,7 @@ #define RC5_SZ_NBITS 15 #define RC5X_NBITS 20 #define CHECK_RC5X_NBITS 8 -#define RC5_UNIT 888888 /* ns */ +#define RC5_UNIT 889 /* us */ #define RC5_BIT_START (1 * RC5_UNIT) #define RC5_BIT_END (1 * RC5_UNIT) #define RC5X_SPACE (4 * RC5_UNIT) @@ -55,7 +55,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) again: dev_dbg(&dev->dev, "RC5(x/sz) decode started at state %i (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2)) return 0; @@ -164,7 +164,7 @@ again: out: dev_dbg(&dev->dev, "RC5(x/sz) decode failed at state %i count %d (%uus %s)\n", - data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, data->count, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; } diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c index 95727ca910f7..df8cd53a9005 100644 --- a/drivers/media/rc/ir-rc6-decoder.c +++ b/drivers/media/rc/ir-rc6-decoder.c @@ -15,7 +15,7 @@ * RC6-6A-32 (MCE version with toggle bit in body) */ -#define RC6_UNIT 444444 /* nanosecs */ +#define RC6_UNIT 444 /* microseconds */ #define RC6_HEADER_NBITS 4 /* not including toggle bit */ #define RC6_0_NBITS 16 #define RC6_6A_32_NBITS 32 @@ -95,7 +95,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) again: dev_dbg(&dev->dev, "RC6 decode started at state %i (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); if (!geq_margin(ev.duration, RC6_UNIT, RC6_UNIT / 2)) return 0; @@ -270,7 +270,7 @@ again: out: dev_dbg(&dev->dev, "RC6 decode failed at state %i (%uus %s)\n", - data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->state, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; } diff --git a/drivers/media/rc/ir-rcmm-decoder.c b/drivers/media/rc/ir-rcmm-decoder.c index 028df5cb1828..fd9ec69a3718 100644 --- a/drivers/media/rc/ir-rcmm-decoder.c +++ b/drivers/media/rc/ir-rcmm-decoder.c @@ -6,12 +6,12 @@ #include "rc-core-priv.h" #include <linux/module.h> -#define RCMM_UNIT 166667 /* nanosecs */ -#define RCMM_PREFIX_PULSE 416666 /* 166666.666666666*2.5 */ -#define RCMM_PULSE_0 277777 /* 166666.666666666*(1+2/3) */ -#define RCMM_PULSE_1 444444 /* 166666.666666666*(2+2/3) */ -#define RCMM_PULSE_2 611111 /* 166666.666666666*(3+2/3) */ -#define RCMM_PULSE_3 777778 /* 166666.666666666*(4+2/3) */ +#define RCMM_UNIT 166 /* microseconds */ +#define RCMM_PREFIX_PULSE 417 /* 166.666666666666*2.5 */ +#define RCMM_PULSE_0 278 /* 166.666666666666*(1+2/3) */ +#define RCMM_PULSE_1 444 /* 166.666666666666*(2+2/3) */ +#define RCMM_PULSE_2 611 /* 166.666666666666*(3+2/3) */ +#define RCMM_PULSE_3 778 /* 166.666666666666*(4+2/3) */ enum rcmm_state { STATE_INACTIVE, @@ -64,8 +64,8 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev) int value; if (!(dev->enabled_protocols & (RC_PROTO_BIT_RCMM32 | - RC_PROTO_BIT_RCMM24 | - RC_PROTO_BIT_RCMM12))) + RC_PROTO_BIT_RCMM24 | + RC_PROTO_BIT_RCMM12))) return 0; if (!is_timing_event(ev)) { @@ -165,7 +165,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev) } dev_dbg(&dev->dev, "RC-MM decode failed at count %d state %d (%uus %s)\n", - data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse)); + data->count, data->state, ev.duration, TO_STR(ev.pulse)); data->state = STATE_INACTIVE; return -EINVAL; |