Hi there,
I am using i.MX6Q. I want to use CLKO2 as the MCLK source of my camera. The steps I did are as followed.
1. Setup Pad , set gpio3 as clko2 output pin
MX6Q_PAD_GPIO_3__CCM_CLKO2, // setup gpio3 as output pin of clko2
2. get/set osc_clk as parent clock of clko2, set rate, and enable clko2
clko2 = clk_get(NULL, "clko2_clk");
if (IS_ERR(clko2))
printk("can't get CLKO2 clock.\n");
new_parent = clk_get(NULL, "osc"); // in sabresd bsp source code, "osc_clk" is a wrong name, tested already
if (!IS_ERR(new_parent)) {
clk_set_parent(clko2, new_parent);
clk_put(new_parent);
}
rate = clk_round_rate(clko2, 24000000);
clk_set_rate(clko2, rate);
clk_enable(clko2);
However, there is nothing on gpio_3 pin, no clock on CLKO2 output pin. It seems the I miss some steps.
I print out the register CCOSR, MXC_CCM_CCOSR=0x010E000F (1 00001110 00000000 00001111)
It seems the value is correctly be set, but it did not function as it should be.
The same way I used is okay to enable/disable CLKO, any idea? I use SABRESD android bsp as my source code base.
thanks anyway
avex