vm0_cma_reserved:linux,vm0_cma {
compatible = "shared-dma-pool";
reusable;
- size = <0x0 0x2000000>;
- alignment = <0x0 0x400000>;
+ size = <0x2000000>;
+ alignment = <0x400000>;
};
};
compatible = "amlogic, amvdec_656in";
dev_name = "amvdec_656in";
status = "disabled";
- reg = <0x0 0xffe02000 0x0 0x7c>;
+ reg = <0xffe02000 0x7c>;
clocks = <&clkc CLKID_BT656_COMP>,
<&clkc CLKID_BT656>;
clock-names = "cts_bt656_clk1",
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
+ vm0_cma_reserved:linux,vm0_cma {
+ compatible = "shared-dma-pool";
+ reusable;
+ size = <0x2000000>;
+ alignment = <0x400000>;
+ };
};
gpioleds {
dev_name = "ionvideo";
status = "okay";
};
+ vm0 {
+ compatible = "amlogic, vm";
+ memory-region = <&vm0_cma_reserved>;
+ dev_name = "vm0";
+ status = "disabled";
+ vm_id = <0>;
+ };
+
+ amvdec_656in {
+ /*bt656 gpio conflict with i2c0*/
+ compatible = "amlogic, amvdec_656in";
+ dev_name = "amvdec_656in";
+ status = "disabled";
+ reg = <0xffe02000 0x7c>;
+ clocks = <&clkc CLKID_BT656_COMP>,
+ <&clkc CLKID_BT656>;
+ clock-names = "cts_bt656_clk1",
+ "clk_gate_bt656";
+ /* bt656in1, bt656in2 */
+ bt656in1 {
+ bt656_id = <1>;
+ status = "disabled";
+ };
+ };
+
+ aml_cams {
+ compatible = "amlogic, cams_prober";
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&cam_dvp_pins &gen_clk_ee_z>;
+ clocks = <&clkc CLKID_GEN_CLK>;
+ clock-names = "g12a_24m";
+ cam_0{
+ cam_name = "gc2145";
+ front_back = <0>;
+ /*u200 i2c2 gpio conflict with ethmac*/
+ camera-i2c-bus = <&i2c2>;
+ gpio_pwdn-gpios = <&gpio GPIOZ_2 GPIO_ACTIVE_HIGH>;
+ gpio_rst-gpios = <&gpio GPIOZ_12 GPIO_ACTIVE_HIGH>;
+ mirror_flip = <1>;
+ vertical_flip = <1>;
+ spread_spectrum = <0>;
+ bt_path = "gpio";
+ bt_path_count = <1>;
+ vdin_path = <0>;
+ status = "okay";
+ };
+ };
gpio_keypad{
compatible = "amlogic, gpio_keypad";
};
};
+&i2c2 {
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_master_pins2>;
+ clock-frequency = <100000>;
+};
+
&i2c3 {
status = "okay";
pinctrl-names="default";
};
};
+ clk12_24_z_pins:clk12_24_z_pins {
+ mux {
+ groups = "clk12_24_z";
+ function = "clk12_24_ee";
+ drive-strength = <3>;
+ };
+ };
+
+ gen_clk_ee_z: gen_clk_ee_z {
+ mux {
+ groups="gen_clk_ee_z";
+ function="gen_clk_ee";
+ drive-strength = <3>;
+ };
+ };
+
+ cam_dvp_pins:cam_dvp_pins {
+ mux {
+ groups = "bt656_a_vs", "bt656_a_hs", "bt656_a_clk",
+ "bt656_a_din0", "bt656_a_din1", "bt656_a_din2",
+ "bt656_a_din3", "bt656_a_din4", "bt656_a_din5",
+ "bt656_a_din6", "bt656_a_din7";
+ function = "bt656";
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
size = <0x0 0x04000000>;
alignment = <0x0 0x400000>;
};
+ vm0_cma_reserved:linux,vm0_cma {
+ compatible = "shared-dma-pool";
+ reusable;
+ size = <0x0 0x2000000>;
+ alignment = <0x0 0x400000>;
+ };
};
gpioleds {
dev_name = "ionvideo";
status = "okay";
};
+ vm0 {
+ compatible = "amlogic, vm";
+ memory-region = <&vm0_cma_reserved>;
+ dev_name = "vm0";
+ status = "disabled";
+ vm_id = <0>;
+ };
+
+ amvdec_656in {
+ /*bt656 gpio conflict with i2c0*/
+ compatible = "amlogic, amvdec_656in";
+ dev_name = "amvdec_656in";
+ status = "disabled";
+ reg = <0x0 0xffe02000 0x0 0x7c>;
+ clocks = <&clkc CLKID_BT656_COMP>,
+ <&clkc CLKID_BT656>;
+ clock-names = "cts_bt656_clk1",
+ "clk_gate_bt656";
+ /* bt656in1, bt656in2 */
+ bt656in1 {
+ bt656_id = <1>;
+ status = "disabled";
+ };
+ };
+
+ aml_cams {
+ compatible = "amlogic, cams_prober";
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&cam_dvp_pins &gen_clk_ee_z>;
+ clocks = <&clkc CLKID_GEN_CLK>;
+ clock-names = "g12a_24m";
+ cam_0{
+ cam_name = "gc2145";
+ front_back = <0>;
+ /*u200 i2c2 gpio conflict with ethmac*/
+ camera-i2c-bus = <&i2c2>;
+ gpio_pwdn-gpios = <&gpio GPIOZ_2 GPIO_ACTIVE_HIGH>;
+ gpio_rst-gpios = <&gpio GPIOZ_12 GPIO_ACTIVE_HIGH>;
+ mirror_flip = <1>;
+ vertical_flip = <1>;
+ spread_spectrum = <0>;
+ bt_path = "gpio";
+ bt_path_count = <1>;
+ vdin_path = <0>;
+ status = "okay";
+ };
+ };
gpio_keypad{
compatible = "amlogic, gpio_keypad";
};
};
+&i2c2 {
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_master_pins2>;
+ clock-frequency = <100000>;
+};
+
&i2c3 {
status = "okay";
pinctrl-names="default";
};
};
+ clk12_24_z_pins:clk12_24_z_pins {
+ mux {
+ groups = "clk12_24_z";
+ function = "clk12_24_ee";
+ drive-strength = <3>;
+ };
+ };
+
+ gen_clk_ee_z: gen_clk_ee_z {
+ mux {
+ groups="gen_clk_ee_z";
+ function="gen_clk_ee";
+ drive-strength = <3>;
+ };
+ };
+
+ cam_dvp_pins:cam_dvp_pins {
+ mux {
+ groups = "bt656_a_vs", "bt656_a_hs", "bt656_a_clk",
+ "bt656_a_din0", "bt656_a_din1", "bt656_a_din2",
+ "bt656_a_din3", "bt656_a_din4", "bt656_a_din5",
+ "bt656_a_din6", "bt656_a_din7";
+ function = "bt656";
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
***********************************************
*/
-int vm_buffer_init(struct vm_device_s *vdevp)
+int alloc_vm_canvas(struct vm_device_s *vdevp)
{
- int i, j;
- u32 canvas_width, canvas_height;
- u32 decbuf_size;
- resource_size_t buf_start;
- unsigned int buf_size;
- int buf_num = 0;
- int local_pool_size = 0;
-
- init_completion(&vdevp->vb_start_sema);
- init_completion(&vdevp->vb_done_sema);
-
- buf_start = vdevp->buffer_start;
- buf_size = vdevp->buffer_size;
-
+ int j;
if (vdevp->index == 0) {
for (j = 0; j < MAX_CANVAS_INDEX; j++) {
memset(&(vdevp->vm_canvas[j]), -1, sizeof(int));
}
}
+ return 0;
+}
+
+int vm_buffer_init(struct vm_device_s *vdevp)
+{
+ int i;
+ u32 canvas_width, canvas_height;
+ u32 decbuf_size;
+ resource_size_t buf_start;
+ unsigned int buf_size;
+ int buf_num = 0;
+ int local_pool_size = 0;
+
+ init_completion(&vdevp->vb_start_sema);
+ init_completion(&vdevp->vb_done_sema);
+
+ buf_start = vdevp->buffer_start;
+ buf_size = vdevp->buffer_size;
+
if (!buf_start || !buf_size)
goto exit;
vm_device[vdevp->index] = vdevp;
vdevp->pdev = pdev;
platform_set_drvdata(pdev, vdevp);
+ ret = alloc_vm_canvas(vdevp);
+ if (ret != 0) {
+ pr_err("alloc vm canvas failed\n");
+ return ret;
+ }
vm_buffer_init(vdevp);
ret = init_vm_device(vdevp, pdev);
if (ret != 0)
int start_vm_task(struct vm_device_s *vdevp);
int start_simulate_task(void);
+int alloc_vm_canvas(struct vm_device_s *vdevp);
extern int get_vm_status(void);
extern void set_vm_status(int flag);
static struct v4l2_frmsize_discrete gc2145_pic_resolution[] = {
{1600, 1200},
- {800, 600}
+ {800, 600},
+ {640, 480}
};
#ifndef GC2145_MIRROR
if ((width * height < 1600 * 1200)) {
while (1) {
- buf[0] = gc2145_svga[i].addr;
- buf[1] = gc2145_svga[i].val;
- if (gc2145_svga[i].val == 0xff &&
- gc2145_svga[i].addr == 0xff) {
- pr_info("success in gc2145_svga.\n");
+ buf[0] = gc2145_uxga[i].addr;
+ buf[1] = gc2145_uxga[i].val;
+ if (gc2145_uxga[i].val == 0xff &&
+ gc2145_uxga[i].addr == 0xff) {
+ pr_info("success in gc2145_uxga.\n");
break;
}
if ((i2c_put_byte_add8(client, buf, 2)) < 0) {
- pr_err("fail in gc2145_svga.\n");
+ pr_err("fail in gc2145_uxga.\n");
return;
}
i++;
}
gc2145_frmintervals_active.numerator = 1;
gc2145_frmintervals_active.denominator = 15;
- GC2145_h_active = 800;
- GC2145_v_active = 600;
+ GC2145_h_active = 1600;
+ GC2145_v_active = 1200;
mdelay(80);
} else if (width * height >= 1200 * 1600) {
buf[0] = 0xfe;
pr_err("Create class gc2145 fail.\n");
return -ENOMEM;
}
+
gc2145_dev = device_create(gc2145_class, NULL,
MKDEV(0, 1), NULL, "dev");
device_create_file(gc2145_dev, &dev_attr_gc2145);