Other Parts Discussed in Thread: TLV320AIC3104
Hi,
I am using the AM335x processor for my customized board. Audio codec also the part of my board. As per the AM335x EVM audio codec getting the 12 MHz in different way. But in my board just i need same 12Mhz from CLKOUT2. So i want to access some register for clkout2. So i saw one header file "arch/arm/mach-omap2/cm33xx.h" in the kernel code of Sitra.
is that a correct file for access the AM335x processor?
Table 8-161. CM_CLKOUT_CTRL Register:
As per the CM_CLKOUT_CTRL Register, Just i added some code with in a clkout2_enable fucniton.
static void __init clkout2_enable(void)
{
struct clk *ck_32;
int cm_clkout_ctrl_value;
ck_32 = clk_get(NULL, "clkout2_ck");
if (IS_ERR(ck_32)) {
pr_err("Cannot clk_get ck_32\n");
return;
}
clk_enable(ck_32);
setup_pin_mux(clkout2_pin_mux);
//**************************************************************************
cm_clkout_ctrl_value = readl(AM33XX_CM_CLKOUT_CTRL);
cm_clkout_ctrl_value |= 0x000000B9; //---------------------------------------------------------> Example value
writel(cm_clkout_ctrl_value, AM33XX_CM_CLKOUT_CTRL);
//**************************************************************************
}
Is that above three lines is enough to set the some frequency in CLKOUT2? are we need any other lines.
BIT 7:
This bit controls the external clock activity
0x0 = DIS : SYS_CLKOUT2 is disabled
0x1 = EN : SYS_CLKOUT2 is enabled ============> enable
BIT 5-3:
THis field controls the external clock divison factor
0x0 = DIV1 : SYS_CLKOUT2/1
0x1 = DIV2 : SYS_CLKOUT2/2
0x2 = DIV3 : SYS_CLKOUT2/3
0x3 = DIV4 : SYS_CLKOUT2/4
0x4 = DIV5 : SYS_CLKOUT2/5
0x5 = DIV6 : SYS_CLKOUT2/6
0x6 = DIV7 : SYS_CLKOUT2/7 ======================> may i use this value?
0x7 = DIV8 : SYS_CLKOUT2/8
BIT 2-0: CLKOUT2SOURCE
This field selects the external output clock source
0x0 = SEL0 : Select 32KHz Oscillator O/P
0x1 = SEL1 : Select L3 Clock
0x2 = SEL2 : Select DDR PHY Clock
0x3 = SEL4 : Select 192Mhz clock from PER PLL
0x4 = SEL5 : Select LCD Pixel Clock =========================> may i use this value?
I need 12MHz in the CLKOUT2? can you help me to get this value from AM335x processor.
Thanks,
Veera