Commit e6609f2c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'media/v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "A couple of driver fixes:

   - hantro: Fix check for single irq

   - cedrus: Fix SUNXI tile size calculation

   - s5p-jpeg: rename JPEG marker constants to prevent build warnings

   - ir_toy: prevent device from hanging during transmit"

* tag 'media/v5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: ir_toy: prevent device from hanging during transmit
  media: s5p-jpeg: rename JPEG marker constants to prevent build warnings
  media: cedrus: Fix SUNXI tile size calculation
  media: hantro: Fix check for single irq
parents c388a189 f0c15b36
...@@ -1140,8 +1140,8 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, ...@@ -1140,8 +1140,8 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
continue; continue;
length = 0; length = 0;
switch (c) { switch (c) {
/* SOF0: baseline JPEG */ /* JPEG_MARKER_SOF0: baseline JPEG */
case SOF0: case JPEG_MARKER_SOF0:
if (get_word_be(&jpeg_buffer, &word)) if (get_word_be(&jpeg_buffer, &word))
break; break;
length = (long)word - 2; length = (long)word - 2;
...@@ -1172,7 +1172,7 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, ...@@ -1172,7 +1172,7 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
notfound = 0; notfound = 0;
break; break;
case DQT: case JPEG_MARKER_DQT:
if (get_word_be(&jpeg_buffer, &word)) if (get_word_be(&jpeg_buffer, &word))
break; break;
length = (long)word - 2; length = (long)word - 2;
...@@ -1185,7 +1185,7 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, ...@@ -1185,7 +1185,7 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
skip(&jpeg_buffer, length); skip(&jpeg_buffer, length);
break; break;
case DHT: case JPEG_MARKER_DHT:
if (get_word_be(&jpeg_buffer, &word)) if (get_word_be(&jpeg_buffer, &word))
break; break;
length = (long)word - 2; length = (long)word - 2;
...@@ -1198,15 +1198,15 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, ...@@ -1198,15 +1198,15 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
skip(&jpeg_buffer, length); skip(&jpeg_buffer, length);
break; break;
case SOS: case JPEG_MARKER_SOS:
sos = jpeg_buffer.curr - 2; /* 0xffda */ sos = jpeg_buffer.curr - 2; /* 0xffda */
break; break;
/* skip payload-less markers */ /* skip payload-less markers */
case RST ... RST + 7: case JPEG_MARKER_RST ... JPEG_MARKER_RST + 7:
case SOI: case JPEG_MARKER_SOI:
case EOI: case JPEG_MARKER_EOI:
case TEM: case JPEG_MARKER_TEM:
break; break;
/* skip uninteresting payload markers */ /* skip uninteresting payload markers */
......
...@@ -37,15 +37,15 @@ ...@@ -37,15 +37,15 @@
#define EXYNOS3250_IRQ_TIMEOUT 0x10000000 #define EXYNOS3250_IRQ_TIMEOUT 0x10000000
/* a selection of JPEG markers */ /* a selection of JPEG markers */
#define TEM 0x01 #define JPEG_MARKER_TEM 0x01
#define SOF0 0xc0 #define JPEG_MARKER_SOF0 0xc0
#define DHT 0xc4 #define JPEG_MARKER_DHT 0xc4
#define RST 0xd0 #define JPEG_MARKER_RST 0xd0
#define SOI 0xd8 #define JPEG_MARKER_SOI 0xd8
#define EOI 0xd9 #define JPEG_MARKER_EOI 0xd9
#define SOS 0xda #define JPEG_MARKER_SOS 0xda
#define DQT 0xdb #define JPEG_MARKER_DQT 0xdb
#define DHP 0xde #define JPEG_MARKER_DHP 0xde
/* Flags that indicate a format can be used for capture/output */ /* Flags that indicate a format can be used for capture/output */
#define SJPEG_FMT_FLAG_ENC_CAPTURE (1 << 0) #define SJPEG_FMT_FLAG_ENC_CAPTURE (1 << 0)
...@@ -187,11 +187,11 @@ struct s5p_jpeg_marker { ...@@ -187,11 +187,11 @@ struct s5p_jpeg_marker {
* @fmt: driver-specific format of this queue * @fmt: driver-specific format of this queue
* @w: image width * @w: image width
* @h: image height * @h: image height
* @sos: SOS marker's position relative to the buffer beginning * @sos: JPEG_MARKER_SOS's position relative to the buffer beginning
* @dht: DHT markers' positions relative to the buffer beginning * @dht: JPEG_MARKER_DHT' positions relative to the buffer beginning
* @dqt: DQT markers' positions relative to the buffer beginning * @dqt: JPEG_MARKER_DQT' positions relative to the buffer beginning
* @sof: SOF0 marker's position relative to the buffer beginning * @sof: JPEG_MARKER_SOF0's position relative to the buffer beginning
* @sof_len: SOF0 marker's payload length (without length field itself) * @sof_len: JPEG_MARKER_SOF0's payload length (without length field itself)
* @size: image buffer size in bytes * @size: image buffer size in bytes
*/ */
struct s5p_jpeg_q_data { struct s5p_jpeg_q_data {
......
...@@ -24,6 +24,7 @@ static const u8 COMMAND_VERSION[] = { 'v' }; ...@@ -24,6 +24,7 @@ static const u8 COMMAND_VERSION[] = { 'v' };
// End transmit and repeat reset command so we exit sump mode // End transmit and repeat reset command so we exit sump mode
static const u8 COMMAND_RESET[] = { 0xff, 0xff, 0, 0, 0, 0, 0 }; static const u8 COMMAND_RESET[] = { 0xff, 0xff, 0, 0, 0, 0, 0 };
static const u8 COMMAND_SMODE_ENTER[] = { 's' }; static const u8 COMMAND_SMODE_ENTER[] = { 's' };
static const u8 COMMAND_SMODE_EXIT[] = { 0 };
static const u8 COMMAND_TXSTART[] = { 0x26, 0x24, 0x25, 0x03 }; static const u8 COMMAND_TXSTART[] = { 0x26, 0x24, 0x25, 0x03 };
#define REPLY_XMITCOUNT 't' #define REPLY_XMITCOUNT 't'
...@@ -309,12 +310,30 @@ static int irtoy_tx(struct rc_dev *rc, uint *txbuf, uint count) ...@@ -309,12 +310,30 @@ static int irtoy_tx(struct rc_dev *rc, uint *txbuf, uint count)
buf[i] = cpu_to_be16(v); buf[i] = cpu_to_be16(v);
} }
buf[count] = cpu_to_be16(0xffff); buf[count] = 0xffff;
irtoy->tx_buf = buf; irtoy->tx_buf = buf;
irtoy->tx_len = size; irtoy->tx_len = size;
irtoy->emitted = 0; irtoy->emitted = 0;
// There is an issue where if the unit is receiving IR while the
// first TXSTART command is sent, the device might end up hanging
// with its led on. It does not respond to any command when this
// happens. To work around this, re-enter sample mode.
err = irtoy_command(irtoy, COMMAND_SMODE_EXIT,
sizeof(COMMAND_SMODE_EXIT), STATE_RESET);
if (err) {
dev_err(irtoy->dev, "exit sample mode: %d\n", err);
return err;
}
err = irtoy_command(irtoy, COMMAND_SMODE_ENTER,
sizeof(COMMAND_SMODE_ENTER), STATE_COMMAND);
if (err) {
dev_err(irtoy->dev, "enter sample mode: %d\n", err);
return err;
}
err = irtoy_command(irtoy, COMMAND_TXSTART, sizeof(COMMAND_TXSTART), err = irtoy_command(irtoy, COMMAND_TXSTART, sizeof(COMMAND_TXSTART),
STATE_TX); STATE_TX);
kfree(buf); kfree(buf);
......
...@@ -919,7 +919,7 @@ static int hantro_probe(struct platform_device *pdev) ...@@ -919,7 +919,7 @@ static int hantro_probe(struct platform_device *pdev)
if (!vpu->variant->irqs[i].handler) if (!vpu->variant->irqs[i].handler)
continue; continue;
if (vpu->variant->num_clocks > 1) { if (vpu->variant->num_irqs > 1) {
irq_name = vpu->variant->irqs[i].name; irq_name = vpu->variant->irqs[i].name;
irq = platform_get_irq_byname(vpu->pdev, irq_name); irq = platform_get_irq_byname(vpu->pdev, irq_name);
} else { } else {
......
...@@ -135,7 +135,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) ...@@ -135,7 +135,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt)
sizeimage = bytesperline * height; sizeimage = bytesperline * height;
/* Chroma plane size. */ /* Chroma plane size. */
sizeimage += bytesperline * height / 2; sizeimage += bytesperline * ALIGN(height, 64) / 2;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment