32 #include <assp/omap3530_assp/omap3530_prcm.h> |
32 #include <assp/omap3530_assp/omap3530_prcm.h> |
33 //#include <resourceman.h> |
33 //#include <resourceman.h> |
34 |
34 |
35 #include "serialmouse.h" |
35 #include "serialmouse.h" |
36 |
36 |
|
37 #ifdef USE_SYMBIAN_PRM |
37 _LIT( KName, "SERMOUSE" ); |
38 _LIT( KName, "SERMOUSE" ); |
|
39 #endif |
38 |
40 |
39 #ifdef _FRAME_BUFFER_CURSOR_ |
41 #ifdef _FRAME_BUFFER_CURSOR_ |
40 # define CURSOR_SIZE 5 |
42 # define CURSOR_SIZE 5 |
41 #endif |
43 #endif |
42 |
44 |
96 // We don't want to return an error here, just don't bother to initialize |
98 // We don't want to return an error here, just don't bother to initialize |
97 return KErrNone; |
99 return KErrNone; |
98 } |
100 } |
99 */ |
101 */ |
100 |
102 |
|
103 #ifdef USE_SYMBIAN_PRM |
101 // Register with the power resource manager |
104 // Register with the power resource manager |
102 //r = PowerResourceManager::RegisterClient( iPrmClientId, KName ); |
105 r = PowerResourceManager::RegisterClient( iPrmClientId, KName ); |
103 //if( r != KErrNone ) |
106 __KTRACE_OPT(KBOOT,Kern::Printf("+TSerialMouse::Init:PRM client ID=%x, r=%d", iPrmClientId, r )) ; |
104 // { |
107 if( r != KErrNone ) |
105 // return r; |
108 { |
106 // } |
109 return r; |
107 |
110 } |
108 //__KTRACE_OPT(KBOOT,Kern::Printf("+TSerialMouse::Init:PRM client ID=%x", iPrmClientId )) ; |
111 #endif |
109 |
112 |
110 Prcm::SetClockState(iUart.PrcmInterfaceClk(), Prcm::EClkOn); |
113 Prcm::SetClockState(iUart.PrcmInterfaceClk(), Prcm::EClkOn); |
111 Prcm::SetClockState(iUart.PrcmFunctionClk(), Prcm::EClkOn); |
114 Prcm::SetClockState(iUart.PrcmFunctionClk(), Prcm::EClkOn); |
112 |
115 |
113 r =Interrupt::Bind( iUart.InterruptId(),Isr,this); |
116 r =Interrupt::Bind( iUart.InterruptId(),Isr,this); |
115 { |
118 { |
116 Kern::Printf("TSerialMouse::Create Cant Bind to Interrupt %d ret %d",iUart.InterruptId(), r ); |
119 Kern::Printf("TSerialMouse::Create Cant Bind to Interrupt %d ret %d",iUart.InterruptId(), r ); |
117 return r; |
120 return r; |
118 } |
121 } |
119 |
122 |
|
123 #ifdef USE_SYMBIAN_PRM |
120 // Ask power resource manager to turn on clocks to the UART |
124 // Ask power resource manager to turn on clocks to the UART |
121 // (this could take some time but we're not in any hurry) |
125 // (this could take some time but we're not in any hurry) |
122 //r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmFunctionClk(), Prcm::EClkAuto ); |
126 r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmFunctionClk(), Prcm::EClkAuto ); |
123 //if( KErrNone != r ) |
127 if( r = KErrNone ) |
124 // { |
128 { |
125 // return r; |
129 r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmInterfaceClk(), Prcm::EClkAuto ); |
126 // } |
130 } |
127 |
131 |
128 //r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmInterfaceClk(), Prcm::EClkAuto ); |
132 if( r != KErrNone ) |
129 //if( KErrNone != r ) |
133 { |
130 // { |
134 __KTRACE_OPT(KBOOT, Kern::Printf("+TSerialMouse:PRM ChangeResourceState(clock(s)) failed, client ID=%x, err=%d", iPrmClientId, r)); |
131 // return r; |
135 return r; |
132 // } |
136 } |
|
137 #endif |
133 |
138 |
134 iUart.Init(); |
139 iUart.Init(); |
135 iUart.DefineMode( Omap3530Uart::TUart::EUart ); |
140 iUart.DefineMode( Omap3530Uart::TUart::EUart ); |
136 iUart.SetBaud( Omap3530Uart::TUart::E1200 ); |
141 iUart.SetBaud( Omap3530Uart::TUart::E1200 ); |
137 iUart.SetDataFormat( Omap3530Uart::TUart::E7Data, Omap3530Uart::TUart::E1Stop, Omap3530Uart::TUart::ENone ); |
142 iUart.SetDataFormat( Omap3530Uart::TUart::E7Data, Omap3530Uart::TUart::E1Stop, Omap3530Uart::TUart::ENone ); |