#define ISO_BUFFER_SIZE (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
#define MAX_ISOC_ERRORS 20
-/* TODO: These should be moved to V4L2 API */
-#define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 12-bit */
-#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics MSi2500 format 384 */
+/*
+ * TODO: These formats should be moved to V4L2 API. Formats are currently
+ * disabled from formats[] table, not visible to userspace.
+ */
+ /* signed 12-bit */
+#define MSI2500_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2')
+/* Mirics MSi2500 format 384 */
+#define MSI2500_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4')
static const struct v4l2_frequency_band bands[] = {
{
#if 0
}, {
.name = "10+2-bit signed",
- .pixelformat = V4L2_PIX_FMT_SDR_MSI2500_384,
+ .pixelformat = MSI2500_PIX_FMT_SDR_MSI2500_384,
}, {
.name = "12-bit signed",
- .pixelformat = V4L2_PIX_FMT_SDR_S12,
+ .pixelformat = MSI2500_PIX_FMT_SDR_S12,
#endif
}, {
.name = "Complex S14LE",
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - jiffies_to_msecs(s->jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies_now;
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
if (unlikely(time_is_before_jiffies(s->jiffies_next))) {
#define MSECS 10000UL
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies + msecs_to_jiffies(MSECS);
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - jiffies_to_msecs(s->jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies_now;
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - jiffies_to_msecs(s->jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies_now;
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
unsigned long jiffies_now = jiffies;
unsigned long msecs = jiffies_to_msecs(jiffies_now) - jiffies_to_msecs(s->jiffies_next);
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies_now;
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
int i, j, i_max, dst_len = 0;
u32 sample_num[3];
u16 *u16dst = (u16 *) dst;
- struct {signed int x:14;} se;
+ struct {signed int x:14; } se;
/* There could be 1-3 1024 bytes URB frames */
i_max = src_len / 1024;
if (unlikely(time_is_before_jiffies(s->jiffies_next))) {
#define MSECS 10000UL
unsigned int samples = sample_num[i_max - 1] - s->sample;
+
s->jiffies_next = jiffies + msecs_to_jiffies(MSECS);
s->sample = sample_num[i_max - 1];
dev_dbg(&s->udev->dev,
static void msi3101_iso_stop(struct msi3101_state *s)
{
int i;
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
/* Unlinking ISOC buffers one by one */
static void msi3101_iso_free(struct msi3101_state *s)
{
int i;
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
/* Freeing ISOC buffers one by one */
struct usb_device *udev;
struct urb *urb;
int i, j, ret;
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
s->isoc_errors = 0;
static void msi3101_cleanup_queued_bufs(struct msi3101_state *s)
{
unsigned long flags = 0;
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
spin_lock_irqsave(&s->queued_bufs_lock, flags);
struct v4l2_device *v = usb_get_intfdata(intf);
struct msi3101_state *s =
container_of(v, struct msi3101_state, v4l2_dev);
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
mutex_lock(&s->vb_queue_lock);
struct v4l2_capability *cap)
{
struct msi3101_state *s = video_drvdata(file);
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
{
struct msi3101_state *s = vb2_get_drv_priv(vq);
+
dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers);
/* Absolute min and max number of buffers available for mmap() */
#define CMD_STOP_STREAMING 0x45
#define CMD_READ_UNKNOW 0x48
-#define msi3101_dbg_usb_control_msg(udev, r, t, v, _i, b, l) { \
- char *direction; \
- if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \
- direction = ">>>"; \
+#define msi3101_dbg_usb_control_msg(_udev, _r, _t, _v, _i, _b, _l) { \
+ char *_direction; \
+ if (_t & USB_DIR_IN) \
+ _direction = "<<<"; \
else \
- direction = "<<<"; \
- dev_dbg(&udev->dev, "%s: %02x %02x %02x %02x %02x %02x %02x %02x " \
- "%s %*ph\n", __func__, t, r, v & 0xff, v >> 8, \
- _i & 0xff, _i >> 8, l & 0xff, l >> 8, direction, l, b); \
+ _direction = ">>>"; \
+ dev_dbg(&_udev->dev, "%s: %02x %02x %02x %02x %02x %02x %02x %02x " \
+ "%s %*ph\n", __func__, _t, _r, _v & 0xff, _v >> 8, \
+ _i & 0xff, _i >> 8, _l & 0xff, _l >> 8, _direction, \
+ _l, _b); \
}
static int msi3101_ctrl_msg(struct msi3101_state *s, u8 cmd, u32 data)
f_sr = s->f_adc;
/* set tuner, subdev, filters according to sampling rate */
- bandwidth_auto = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH_AUTO);
+ bandwidth_auto = v4l2_ctrl_find(&s->hdl,
+ V4L2_CID_RF_TUNER_BANDWIDTH_AUTO);
if (v4l2_ctrl_g_ctrl(bandwidth_auto)) {
- bandwidth = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH);
+ bandwidth = v4l2_ctrl_find(&s->hdl,
+ V4L2_CID_RF_TUNER_BANDWIDTH);
v4l2_ctrl_s_ctrl(bandwidth, s->f_adc);
}
s->convert_stream = msi3101_convert_stream_504;
reg7 = 0x000c9407;
break;
- case V4L2_PIX_FMT_SDR_MSI2500_384:
+ case MSI2500_PIX_FMT_SDR_MSI2500_384:
s->convert_stream = msi3101_convert_stream_384;
reg7 = 0x0000a507;
break;
- case V4L2_PIX_FMT_SDR_S12:
+ case MSI2500_PIX_FMT_SDR_S12:
s->convert_stream = msi3101_convert_stream_336;
reg7 = 0x00008507;
break;
dev_dbg(&s->udev->dev,
"%s: f_sr=%d f_vco=%d div_n=%d div_m=%d div_r_out=%d reg3=%08x reg4=%08x\n",
- __func__, f_sr, f_vco, div_n, div_m, div_r_out, reg3, reg4);
+ __func__, f_sr, f_vco, div_n, div_m, div_r_out, reg3,
+ reg4);
ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00608008);
if (ret)
{
struct msi3101_state *s = vb2_get_drv_priv(vq);
int ret;
+
dev_dbg(&s->udev->dev, "%s:\n", __func__);
if (!s->udev)
struct v4l2_fmtdesc *f)
{
struct msi3101_state *s = video_drvdata(file);
+
dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, f->index);
if (f->index >= s->num_formats)
struct v4l2_format *f)
{
struct msi3101_state *s = video_drvdata(file);
+
dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
(char *)&s->pixelformat);
struct msi3101_state *s = video_drvdata(file);
struct vb2_queue *q = &s->vb_queue;
int i;
+
dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
(char *)&f->fmt.sdr.pixelformat);
{
struct msi3101_state *s = video_drvdata(file);
int i;
+
dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
(char *)&f->fmt.sdr.pixelformat);
{
struct msi3101_state *s = video_drvdata(file);
int ret;
+
dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, v->index);
if (v->index == 0)
{
struct msi3101_state *s = video_drvdata(file);
int ret;
+
dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, v->index);
if (v->index == 0) {
{
struct msi3101_state *s = video_drvdata(file);
int ret = 0;
+
dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d\n",
__func__, f->tuner, f->type);
{
struct msi3101_state *s = video_drvdata(file);
int ret;
+
dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d frequency=%u\n",
__func__, f->tuner, f->type, f->frequency);
{
struct msi3101_state *s = video_drvdata(file);
int ret;
+
dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d index=%d\n",
__func__, band->tuner, band->type, band->index);