Commit 03dc3b07 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Add command to change byrshift in circbuf

parent 0a06b6ec
......@@ -694,6 +694,7 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig)
unsigned short circbuf_quality = 100;
unsigned short circbuf_height = 1936;
unsigned short circbuf_width = 2592;
unsigned char circbuf_byrshift = 3;
ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *off)
{
unsigned long p;
......@@ -714,6 +715,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
camera_interrupts(1);
break;
case 3:
/* update image quality */
buf_copy[count - 1] = 0;
ret = kstrtol(&buf_copy[2], 10, &val);
dev_dbg(g_dev_ptr, "ret: %d, buf[2]: %s\n", ret, &buf_copy[2]);
......@@ -732,6 +734,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
dump_state(chn);
break;
case 5:
/* print debug statistics */
{
int j, cntr;
long long res;
......@@ -749,6 +752,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
}
break;
case 6:
/* update frame size */
{
unsigned int w, h;
int res = sscanf(&buf[2], "%u:%u", &w, &h);
......@@ -759,6 +763,17 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
}
}
break;
case 7:
/* update Bayer shift */
{
unsigned char val;
int res = sscanf(&buf[2], "%u", &val);
if (res == 1) {
circbuf_byrshift = val;
dev_dbg(g_dev_ptr, "set new bayer shift: %u\n", val);
}
}
break;
}
/* debug code end */
......
......@@ -46,6 +46,7 @@ extern struct circbuf_priv_t *circbuf_priv_ptr;
extern unsigned short circbuf_quality;
extern unsigned short circbuf_height;
extern unsigned short circbuf_width;
extern unsigned char circbuf_byrshift;
/* end of debug code */
#endif /* _CIRCBUF_H */
......@@ -363,7 +363,8 @@ inline static void set_default_interframe(struct interframe_params_t *params)
// params->width = 2592;
params->height = circbuf_height;
params->width = circbuf_width;
params->byrshift = 3;
// params->byrshift = 3;
params->byrshift = circbuf_byrshift;
params->color = 0;
params->quality2 = circbuf_quality;
//params->quality2 = 100;
......
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