aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-sharp-decoder.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-03 20:16:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-03 20:16:59 -0400
commitef1c4a6fa91bbbe9b09f770d28eba31a9edf770c (patch)
tree52f5d175031c553160d14890e876ffc5432d2467 /drivers/media/rc/ir-sharp-decoder.c
parent147a89bc71e7db40f011454a40add7ff2d10f8d8 (diff)
parentf8a695c4b43d02c89b8bba9ba6058fd5db1bc71d (diff)
Merge tag 'media/v4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - new CEC pin injection code for testing purposes - DVB frontend cxd2099 promoted from staging - new platform driver for Sony cxd2880 DVB devices - new sensor drivers: mt9t112, ov2685, ov5695, ov772x, tda1997x, tw9910.c - removal of unused cx18 and ivtv alsa mixers - the reneseas-ceu driver doesn't depend on soc_camera anymore and moved from staging - removed the mantis_vp3028 driver, unused since 2009 - s5p-mfc: add support for version 10 of the MSP - added a decoder for imon protocol - atomisp: lots of cleanups - imx074 and mt9t031: don't depend on soc_camera anymore, being promoted from staging - added helper functions to better support DVB I2C binding - lots of driver improvements and cleanups * tag 'media/v4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (438 commits) media: v4l2-ioctl: rename a temp var that stores _IOC_SIZE(cmd) media: fimc-capture: get rid of two warnings media: dvb-usb-v2: fix a missing dependency of I2C_MUX media: uvc: to the right check at uvc_ioctl_enum_framesizes() media: cec-core: fix a bug at cec_error_inj_write() media: tda9840: cleanup a warning media: tm6000: avoid casting just to print pointer address media: em28xx-input: improve error handling code media: zr364xx: avoid casting just to print pointer address media: vivid-radio-rx: add a cast to avoid a warning media: saa7134-alsa: don't use casts to print a buffer address media: solo6x10: get rid of an address space warning media: zoran: don't cast pointers to print them media: ir-kbd-i2c: change the if logic to avoid a warning media: ir-kbd-i2c: improve error handling code media: saa7134-input: improve error handling media: s2255drv: fix a casting warning media: ivtvfb: Cleanup some warnings media: videobuf-dma-sg: Fix a weird cast soc_camera: fix a weird cast on printk ...
Diffstat (limited to 'drivers/media/rc/ir-sharp-decoder.c')
-rw-r--r--drivers/media/rc/ir-sharp-decoder.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/media/rc/ir-sharp-decoder.c b/drivers/media/rc/ir-sharp-decoder.c
index df296991906c..6a38c50566a4 100644
--- a/drivers/media/rc/ir-sharp-decoder.c
+++ b/drivers/media/rc/ir-sharp-decoder.c
@@ -54,8 +54,8 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
54 return 0; 54 return 0;
55 } 55 }
56 56
57 IR_dprintk(2, "Sharp decode started at state %d (%uus %s)\n", 57 dev_dbg(&dev->dev, "Sharp decode started at state %d (%uus %s)\n",
58 data->state, TO_US(ev.duration), TO_STR(ev.pulse)); 58 data->state, TO_US(ev.duration), TO_STR(ev.pulse));
59 59
60 switch (data->state) { 60 switch (data->state) {
61 61
@@ -149,9 +149,9 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
149 msg = (data->bits >> 15) & 0x7fff; 149 msg = (data->bits >> 15) & 0x7fff;
150 echo = data->bits & 0x7fff; 150 echo = data->bits & 0x7fff;
151 if ((msg ^ echo) != 0x3ff) { 151 if ((msg ^ echo) != 0x3ff) {
152 IR_dprintk(1, 152 dev_dbg(&dev->dev,
153 "Sharp checksum error: received 0x%04x, 0x%04x\n", 153 "Sharp checksum error: received 0x%04x, 0x%04x\n",
154 msg, echo); 154 msg, echo);
155 break; 155 break;
156 } 156 }
157 157
@@ -159,16 +159,15 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
159 command = bitrev8((msg >> 2) & 0xff); 159 command = bitrev8((msg >> 2) & 0xff);
160 160
161 scancode = address << 8 | command; 161 scancode = address << 8 | command;
162 IR_dprintk(1, "Sharp scancode 0x%04x\n", scancode); 162 dev_dbg(&dev->dev, "Sharp scancode 0x%04x\n", scancode);
163 163
164 rc_keydown(dev, RC_PROTO_SHARP, scancode, 0); 164 rc_keydown(dev, RC_PROTO_SHARP, scancode, 0);
165 data->state = STATE_INACTIVE; 165 data->state = STATE_INACTIVE;
166 return 0; 166 return 0;
167 } 167 }
168 168
169 IR_dprintk(1, "Sharp decode failed at count %d state %d (%uus %s)\n", 169 dev_dbg(&dev->dev, "Sharp decode failed at count %d state %d (%uus %s)\n",
170 data->count, data->state, TO_US(ev.duration), 170 data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
171 TO_STR(ev.pulse));
172 data->state = STATE_INACTIVE; 171 data->state = STATE_INACTIVE;
173 return -EINVAL; 172 return -EINVAL;
174} 173}