omap3530/shared/tps65950/tps65950_int.cpp
branchgeneric_fixes_and_updates
changeset 99 30b472f724b4
parent 0 6663340f3fc9
equal deleted inserted replaced
98:b3e9a64f6a92 99:30b472f724b4
    40 namespace TPS65950
    40 namespace TPS65950
    41 {
    41 {
    42 
    42 
    43 struct TInterruptBank
    43 struct TInterruptBank
    44 	{
    44 	{
    45 	TInt	iBit[8]; 
    45 	TInt	iBit[8];
    46 	};
    46 	};
    47 
    47 
    48 struct TSubInterruptBank
    48 struct TSubInterruptBank
    49 	{
    49 	{
    50 	TUint8	iLen;
    50 	TUint8	iLen;
    51 	TUint16	iRegs[6];		
    51 	TUint16	iRegs[6];
    52 	};
    52 	};
    53 
    53 
    54 enum TMaskPolarity
    54 enum TMaskPolarity
    55 	{
    55 	{
    56 	EClearToEnable,
    56 	EClearToEnable,
    92 
    92 
    93 static SInterruptHandler TheHandlers[ TPS65950::KNumTPSInts ];
    93 static SInterruptHandler TheHandlers[ TPS65950::KNumTPSInts ];
    94 
    94 
    95 static const TControl KControl[ TPS65950::KNumTPSInts ] =
    95 static const TControl KControl[ TPS65950::KNumTPSInts ] =
    96 	{
    96 	{
    97 //iimr iReg      group      bitoffset					/*	
    97 //iimr iReg      group      bitoffset					/*
    98 /*0*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_SC_DETECT,	ESetToEnable}, 		
    98 /*0*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_SC_DETECT,	ESetToEnable},
    99 /*1*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_MBCHG,		ESetToEnable},
    99 /*1*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_MBCHG,		ESetToEnable},
   100 /*2*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_PWROK_TIMEOUT, ESetToEnable},
   100 /*2*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_PWROK_TIMEOUT, ESetToEnable},
   101 /*3*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_HOT_DIE,		ESetToEnable},	
   101 /*3*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_HOT_DIE,		ESetToEnable},
   102 /*4*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_RTC_IT,		ESetToEnable},
   102 /*4*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_RTC_IT,		ESetToEnable},
   103 /*5*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_USB_PRES,		ESetToEnable},
   103 /*5*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_USB_PRES,		ESetToEnable},
   104 /*6*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_CHG_PRES,		ESetToEnable},
   104 /*6*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_CHG_PRES,		ESetToEnable},
   105 /*7*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_CHG_PWRONS,	ESetToEnable},
   105 /*7*/{	Register::PWR_IMR1,	Register::PWR_IMR1,	Register::PWR_ISR1,	PWR_IMR1::PWR_CHG_PWRONS,	ESetToEnable},
   106 			
   106 
   107 /*8*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_USB_ISR1,	EClearToEnable},
   107 /*8*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_USB_ISR1,	EClearToEnable},
   108 /*9*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_SW2_ISR1,	EClearToEnable},
   108 /*9*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_SW2_ISR1,	EClearToEnable},
   109 /*10*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_SW1_ISR1,	EClearToEnable},
   109 /*10*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_SW1_ISR1,	EClearToEnable},
   110 /*11*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_RT_ISR1,	EClearToEnable},
   110 /*11*/{	Register::MADC_IMR1,	Register::MADC_IMR1,	Register::MADC_ISR1,	MADC_IMR1::MADC_RT_ISR1,	EClearToEnable},
   111 			
   111 
   112 /*12*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO7ISR1,	EClearToEnable},
   112 /*12*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO7ISR1,	EClearToEnable},
   113 /*13*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO6ISR1,	EClearToEnable},
   113 /*13*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO6ISR1,	EClearToEnable},
   114 /*14*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO5ISR1,	EClearToEnable},	
   114 /*14*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO5ISR1,	EClearToEnable},
   115 /*15*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO4ISR1,	EClearToEnable},
   115 /*15*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO4ISR1,	EClearToEnable},
   116 /*16*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO3ISR1,	EClearToEnable},
   116 /*16*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO3ISR1,	EClearToEnable},
   117 /*17*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO2ISR1,	EClearToEnable},
   117 /*17*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO2ISR1,	EClearToEnable},
   118 /*18*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO1ISR1,	EClearToEnable},
   118 /*18*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO1ISR1,	EClearToEnable},
   119 /*19*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO0ISR1,	EClearToEnable},
   119 /*19*/{	Register::GPIO_IMR1A,			Register::GPIO_IMR1A, Register::GPIO_ISR1A,	GPIO_IMR1A::GPIO0ISR1,	EClearToEnable},
   120 			
   120 
   121 /*20*/	{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO15ISR2,	EClearToEnable},
   121 /*20*/	{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO15ISR2,	EClearToEnable},
   122 /*22*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO14ISR2,	EClearToEnable},
   122 /*22*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO14ISR2,	EClearToEnable},
   123 /*23*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO13ISR2,	EClearToEnable},
   123 /*23*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO13ISR2,	EClearToEnable},
   124 /*24*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO12ISR2,	EClearToEnable},
   124 /*24*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO12ISR2,	EClearToEnable},
   125 /*25*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO11ISR2,	EClearToEnable},
   125 /*25*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO11ISR2,	EClearToEnable},
   127 /*27*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO9ISR2,	EClearToEnable},
   127 /*27*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO9ISR2,	EClearToEnable},
   128 /*28*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO8ISR2,	EClearToEnable},
   128 /*28*/{	Register::GPIO_IMR2A,			Register::GPIO_IMR2A, Register::GPIO_ISR2A,	GPIO_IMR2A::GPIO8ISR2,	EClearToEnable},
   129 
   129 
   130 /*29*/{	Register::GPIO_IMR3A,			Register::GPIO_IMR3A, Register::GPIO_ISR3A,	GPIO_IMR3A::GPIO17ISR3,	EClearToEnable},
   130 /*29*/{	Register::GPIO_IMR3A,			Register::GPIO_IMR3A, Register::GPIO_ISR3A,	GPIO_IMR3A::GPIO17ISR3,	EClearToEnable},
   131 /*30*/{	Register::GPIO_IMR3A,			Register::GPIO_IMR3A, Register::GPIO_ISR3A,	GPIO_IMR3A::GPIO16ISR3,	EClearToEnable},
   131 /*30*/{	Register::GPIO_IMR3A,			Register::GPIO_IMR3A, Register::GPIO_ISR3A,	GPIO_IMR3A::GPIO16ISR3,	EClearToEnable},
   132 			
   132 
   133 /*31*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_BATSTS_ISR1,	EClearToEnable},
   133 /*31*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_BATSTS_ISR1,	EClearToEnable},
   134 /*32*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TBATOR1_ISR1,	EClearToEnable},
   134 /*32*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TBATOR1_ISR1,	EClearToEnable},
   135 /*33*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TBATOR2_ISR1,	EClearToEnable},
   135 /*33*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TBATOR2_ISR1,	EClearToEnable},
   136 /*34*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_ICHGEOC_ISR1,	EClearToEnable},
   136 /*34*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_ICHGEOC_ISR1,	EClearToEnable},
   137 /*35*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_ICHGLOW_ISR1ASTO,	EClearToEnable},
   137 /*35*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_ICHGLOW_ISR1ASTO,	EClearToEnable},
   138 /*36*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_IICHGHIGH_ISR1,	EClearToEnable},
   138 /*36*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_IICHGHIGH_ISR1,	EClearToEnable},
   139 /*37*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TMOVF_ISR1,	EClearToEnable},
   139 /*37*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_TMOVF_ISR1,	EClearToEnable},
   140 /*38*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_WOVF_ISR1,	EClearToEnable},
   140 /*38*/{	Register::BCIIMR1A,				Register::BCIIMR1A,		Register::BCIISR1A,	BCIIMR1A::BCI_WOVF_ISR1,	EClearToEnable},
   141 	
   141 
   142 /*39*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_ACCHGOV_ISR1,	EClearToEnable},
   142 /*39*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_ACCHGOV_ISR1,	EClearToEnable},
   143 /*40*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBUSOV_ISR1,	EClearToEnable},
   143 /*40*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBUSOV_ISR1,	EClearToEnable},
   144 /*41*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBATOV_ISR1,	EClearToEnable},
   144 /*41*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBATOV_ISR1,	EClearToEnable},
   145 /*42*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBATLVL_ISR1,	EClearToEnable},
   145 /*42*/{	Register::BCIIMR2A,				Register::BCIIMR2A,		Register::BCIISR2A,	BCIIMR2A::BCI_VBATLVL_ISR1,	EClearToEnable},
   146 			
   146 
   147 /*43*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITMISR1,	EClearToEnable},
   147 /*43*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITMISR1,	EClearToEnable},
   148 /*44*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITTOISR1,	EClearToEnable},
   148 /*44*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITTOISR1,	EClearToEnable},
   149 /*45*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITLKISR1,	EClearToEnable},
   149 /*45*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITLKISR1,	EClearToEnable},
   150 /*46*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITKPISR1,	EClearToEnable},
   150 /*46*/{	Register::KEYP_IMR1,			Register::KEYP_IMR1,	Register::KEYP_ISR1,	KEYP_IMR1::KEYP_ITKPISR1,	EClearToEnable},
   151 			
   151 
   152 /*46*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_IDGND,		ESetToEnable }, 
   152 /*46*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_IDGND,		ESetToEnable },
   153 /*47*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_SESSEND,		ESetToEnable },
   153 /*47*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_SESSEND,		ESetToEnable },
   154 /*48*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_SESSVALID,	ESetToEnable },
   154 /*48*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_SESSVALID,	ESetToEnable },
   155 /*49*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_VBUSVALID,	ESetToEnable },	
   155 /*49*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_VBUSVALID,	ESetToEnable },
   156 /*50*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_HOSTDISCONNECT, ESetToEnable },
   156 /*50*/{	Register::USB_INT_EN_RISE_SET,	Register::USB_INT_EN_RISE_CLR,	Register::USB_INT_STS, USB_INT_STS::USB_INTSTS_HOSTDISCONNECT, ESetToEnable },
   157 			
   157 
   158 /*51*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_CARDP,	ESetToEnable },
   158 /*51*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_CARDP,	ESetToEnable },
   159 /*52*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_CARINTDET,	ESetToEnable },
   159 /*52*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_CARINTDET,	ESetToEnable },
   160 /*53*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_IDFLOAT,	ESetToEnable },
   160 /*53*/{	Register::CARKIT_INT_EN_SET,	Register::CARKIT_INT_EN_CLR,	Register::CARKIT_INT_STS,	CARKIT_INT_STS::CARKIT_IDFLOAT,	ESetToEnable },
   161 	
   161 
   162 /*54*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_VB_SESS_VLD,	ESetToEnable },
   162 /*54*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_VB_SESS_VLD,	ESetToEnable },
   163 /*55*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_DM_HI,	ESetToEnable },
   163 /*55*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_DM_HI,	ESetToEnable },
   164 /*56*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_DP_HI,	ESetToEnable },
   164 /*56*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_DP_HI,	ESetToEnable },
   165 /*57*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_MANU,	ESetToEnable },
   165 /*57*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_MANU,	ESetToEnable },
   166 /*58*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_ABNORMAL_STRESS,	ESetToEnable },
   166 /*58*/{	Register::OTHER_INT_EN_RISE_SET, Register::OTHER_INT_EN_RISE_CLR, Register::OTHER_INT_STS,	OTHER_INT_STS::OTHER_INT_ABNORMAL_STRESS,	ESetToEnable },
   167 			
   167 
   168 /*59*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_FLOAT,	ESetToEnable },
   168 /*59*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_FLOAT,	ESetToEnable },
   169 /*60*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_440K,	ESetToEnable },
   169 /*60*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_440K,	ESetToEnable },
   170 /*61*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_200K,	ESetToEnable },
   170 /*61*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_200K,	ESetToEnable },
   171 /*62*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_102K,	ESetToEnable },
   171 /*62*/{	Register::ID_INT_EN_RISE_SET,	Register::ID_INT_EN_RISE_CLR,	Register::ID_INT_STS,		ID_INT_STS::ID_INTID_RES_102K,	ESetToEnable },
   172 				
   172 
   173 /*63*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_PSM_ERROR,	ESetToEnable },	
   173 /*63*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_PSM_ERROR,	ESetToEnable },
   174 /*64*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_PH_ACC,	ESetToEnable },
   174 /*64*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_PH_ACC,	ESetToEnable },
   175 /*65*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_CHARGER,	ESetToEnable },
   175 /*65*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_CHARGER,	ESetToEnable },
   176 /*66*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_USB_HOST,	ESetToEnable },
   176 /*66*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_USB_HOST,	ESetToEnable },
   177 /*67*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_USB_OTG_B,	ESetToEnable },
   177 /*67*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_USB_OTG_B,	ESetToEnable },
   178 /*68*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_CARKIT,	ESetToEnable },
   178 /*68*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_CARKIT,	ESetToEnable },
   179 /*69*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_DISCONNECTED,	ESetToEnable },
   179 /*69*/	{	Register::CARKIT_SM_1_INT_EN_SET, Register::CARKIT_SM_1_INT_EN_CLR, Register::CARKIT_SM_1_INT_STS, CARKIT_SM_1_INT_STS::CARKIT_SM_1_DISCONNECTED,	ESetToEnable },
   180 			
   180 
   181 /*70*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_STOP_PLS_MISS,	ESetToEnable },
   181 /*70*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_STOP_PLS_MISS,	ESetToEnable },
   182 /*71*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_STEREO_TO_MONO,	ESetToEnable },
   182 /*71*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_STEREO_TO_MONO,	ESetToEnable },
   183 /*72*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_PHONE_UART,	ESetToEnable },
   183 /*72*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_PHONE_UART,	ESetToEnable },
   184 /*73*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_PH_NO_ACK,	ESetToEnable }
   184 /*73*/	{	Register::CARKIT_SM_2_INT_EN_SET, Register::CARKIT_SM_2_INT_EN_CLR, Register::CARKIT_SM_2_INT_STS, CARKIT_SM_2_INT_STS::CARKIT_SM_2_PH_NO_ACK,	ESetToEnable }
   185 	};
   185 	};
   203 		ETPS65950_IRQ_MADC_USB_ISR1,
   203 		ETPS65950_IRQ_MADC_USB_ISR1,
   204 };
   204 };
   205 
   205 
   206 const static TInterruptBank gpioBank0 = {
   206 const static TInterruptBank gpioBank0 = {
   207 		ETPS65950_IRQ_GPIO_0ISR1,
   207 		ETPS65950_IRQ_GPIO_0ISR1,
   208 		ETPS65950_IRQ_GPIO_1ISR1,	
   208 		ETPS65950_IRQ_GPIO_1ISR1,
   209 		ETPS65950_IRQ_GPIO_2ISR1,
   209 		ETPS65950_IRQ_GPIO_2ISR1,
   210 		ETPS65950_IRQ_GPIO_3ISR1,
   210 		ETPS65950_IRQ_GPIO_3ISR1,
   211 		ETPS65950_IRQ_GPIO_4ISR1,
   211 		ETPS65950_IRQ_GPIO_4ISR1,
   212 		ETPS65950_IRQ_GPIO_5ISR1,
   212 		ETPS65950_IRQ_GPIO_5ISR1,
   213 		ETPS65950_IRQ_GPIO_6ISR1,
   213 		ETPS65950_IRQ_GPIO_6ISR1,
   214 		ETPS65950_IRQ_GPIO_7ISR2	
   214 		ETPS65950_IRQ_GPIO_7ISR2
   215 };
   215 };
   216 
   216 
   217 const static TInterruptBank gpioBank1 = {
   217 const static TInterruptBank gpioBank1 = {
   218 		ETPS65950_IRQ_GPIO_8ISR2,
   218 		ETPS65950_IRQ_GPIO_8ISR2,
   219 		ETPS65950_IRQ_GPIO_9ISR2,
   219 		ETPS65950_IRQ_GPIO_9ISR2,
   254 		ETPS65950_IRQ_KEYP_ITTOISR1,
   254 		ETPS65950_IRQ_KEYP_ITTOISR1,
   255 		ETPS65950_IRQ_KEYP_ITMISR1,
   255 		ETPS65950_IRQ_KEYP_ITMISR1,
   256 };
   256 };
   257 
   257 
   258 const static TInterruptBank usbINTSTSBank = {
   258 const static TInterruptBank usbINTSTSBank = {
   259 		ETPS65950_IRQ_USB_INTSTS_IDGND, 
   259 		ETPS65950_IRQ_USB_INTSTS_IDGND,
   260 		ETPS65950_IRQ_USB_INTSTS_SESSEND,
   260 		ETPS65950_IRQ_USB_INTSTS_SESSEND,
   261 		ETPS65950_IRQ_USB_INTSTS_SESSVALID,
   261 		ETPS65950_IRQ_USB_INTSTS_SESSVALID,
   262 		ETPS65950_IRQ_USB_INTSTS_VBUSVALID,	
   262 		ETPS65950_IRQ_USB_INTSTS_VBUSVALID,
   263 		ETPS65950_IRQ_USB_INTSTS_HOSTDISCONNECT
   263 		ETPS65950_IRQ_USB_INTSTS_HOSTDISCONNECT
   264 };
   264 };
   265 
   265 
   266 const static TInterruptBank usbCARKITBank = {
   266 const static TInterruptBank usbCARKITBank = {
   267 		ETPS65950_IRQ_USB_CARKIT_CARDP,
   267 		ETPS65950_IRQ_USB_CARKIT_CARDP,
   283 		ETPS65950_IRQ_USB_ID_INT_ID_RES_200K,
   283 		ETPS65950_IRQ_USB_ID_INT_ID_RES_200K,
   284 		ETPS65950_IRQ_USB_ID_INT_ID_RES_102K
   284 		ETPS65950_IRQ_USB_ID_INT_ID_RES_102K
   285 };
   285 };
   286 
   286 
   287 const static TInterruptBank usbSM1Bank = {
   287 const static TInterruptBank usbSM1Bank = {
   288 		ETPS65950_IRQ_USB_CARKIT_SM_1_PSM_ERROR,	
   288 		ETPS65950_IRQ_USB_CARKIT_SM_1_PSM_ERROR,
   289 		ETPS65950_IRQ_USB_CARKIT_SM_1_PH_ACC,
   289 		ETPS65950_IRQ_USB_CARKIT_SM_1_PH_ACC,
   290 		ETPS65950_IRQ_USB_CARKIT_SM_1_CHARGER,
   290 		ETPS65950_IRQ_USB_CARKIT_SM_1_CHARGER,
   291 		ETPS65950_IRQ_USB_CARKIT_SM_1_USB_HOST,
   291 		ETPS65950_IRQ_USB_CARKIT_SM_1_USB_HOST,
   292 		ETPS65950_IRQ_USB_CARKIT_SM_1_USB_OTG_B,
   292 		ETPS65950_IRQ_USB_CARKIT_SM_1_USB_OTG_B,
   293 		ETPS65950_IRQ_USB_CARKIT_SM_1_CARKIT
   293 		ETPS65950_IRQ_USB_CARKIT_SM_1_CARKIT
   299 		ETPS65950_IRQ_USB_CARKIT_SM_2_PHONE_UART,
   299 		ETPS65950_IRQ_USB_CARKIT_SM_2_PHONE_UART,
   300 		ETPS65950_IRQ_USB_CARKIT_SM_2_PH_NO_ACK
   300 		ETPS65950_IRQ_USB_CARKIT_SM_2_PH_NO_ACK
   301 };
   301 };
   302 
   302 
   303 const static TInterruptBank* TheMapTable [6][6]  = {
   303 const static TInterruptBank* TheMapTable [6][6]  = {
   304  //maps against PIH_ISR bits		
   304  //maps against PIH_ISR bits
   305  //reg banks	sub modules
   305  //reg banks	sub modules
   306 				{&gpioBank0,		&gpioBank1,		&gpioBank2,		NULL,			NULL,			NULL},
   306 				{&gpioBank0,		&gpioBank1,		&gpioBank2,		NULL,			NULL,			NULL},
   307 				{&keypBank,			NULL,			NULL,			NULL,			NULL,			NULL},
   307 				{&keypBank,			NULL,			NULL,			NULL,			NULL,			NULL},
   308 				{&bciBank0,			&bciBank1,		NULL,			NULL,			NULL,			NULL},
   308 				{&bciBank0,			&bciBank1,		NULL,			NULL,			NULL,			NULL},
   309 				{&madcBank,			NULL,			NULL,			NULL,			NULL,			NULL},
   309 				{&madcBank,			NULL,			NULL,			NULL,			NULL,			NULL},
   310 				{&usbINTSTSBank,	&usbCARKITBank,	&usbOTHERBank,	&usbIDINTBank,	&usbSM1Bank,	&usbSM2Bank},
   310 				{&usbINTSTSBank,	&usbCARKITBank,	&usbOTHERBank,	&usbIDINTBank,	&usbSM1Bank,	&usbSM2Bank},
   311 				{&pwrBank,			NULL,			NULL,			NULL,			NULL,			NULL}							
   311 				{&pwrBank,			NULL,			NULL,			NULL,			NULL,			NULL}
   312 };
   312 };
   313 
   313 
   314 const static TSubInterruptBank subBank[6] = { 
   314 const static TSubInterruptBank subBank[6] = {
   315 	/*gpio*/{3,{Register::GPIO_ISR1A,Register::GPIO_ISR2A,Register::GPIO_ISR3A,NULL,NULL,NULL}},
   315 	/*gpio*/{3,{Register::GPIO_ISR1A,Register::GPIO_ISR2A,Register::GPIO_ISR3A,NULL,NULL,NULL}},
   316 		/*keyp*/{1,{Register::KEYP_ISR1,NULL,NULL,NULL,NULL,NULL}},
   316 		/*keyp*/{1,{Register::KEYP_ISR1,NULL,NULL,NULL,NULL,NULL}},
   317 		/*bci*/	{2,{Register::BCIISR1A,Register::BCIISR2A,NULL,NULL,NULL,NULL}},
   317 		/*bci*/	{2,{Register::BCIISR1A,Register::BCIISR2A,NULL,NULL,NULL,NULL}},
   318 		/*madc*/{1,{Register::MADC_ISR1,NULL,NULL,NULL,NULL,NULL}},
   318 		/*madc*/{1,{Register::MADC_ISR1,NULL,NULL,NULL,NULL,NULL}},
   319 		/*usb*/ {6,{Register::USB_INT_STS,Register::CARKIT_INT_STS,Register::OTHER_INT_STS,Register::ID_INT_STS, Register::CARKIT_SM_1_INT_STS, Register::CARKIT_SM_2_INT_STS}},
   319 		/*usb*/ {6,{Register::USB_INT_STS,Register::CARKIT_INT_STS,Register::OTHER_INT_STS,Register::ID_INT_STS, Register::CARKIT_SM_1_INT_STS, Register::CARKIT_SM_2_INT_STS}},
   354 	}
   354 	}
   355 
   355 
   356 
   356 
   357 TInt TPS65950Int::InitialiseTPS65950IntController()
   357 TInt TPS65950Int::InitialiseTPS65950IntController()
   358 	{
   358 	{
   359 	__KTRACE_OPT(KTPS65950,Kern::Printf("+TPS65950Int:InitIntController"));	
   359 	__KTRACE_OPT(KTPS65950,Kern::Printf("+TPS65950Int:InitIntController"));
   360 
   360 
   361 	struct TInitRegList
   361 	struct TInitRegList
   362 		{
   362 		{
   363 		TUint16	iReg;
   363 		TUint16	iReg;
   364 		TUint8	iValue;
   364 		TUint8	iValue;
   385 		{ Register::OTHER_INT_EN_RISE_CLR,0xe3 },
   385 		{ Register::OTHER_INT_EN_RISE_CLR,0xe3 },
   386 		{ Register::OTHER_INT_EN_FALL_CLR,0xe3 },
   386 		{ Register::OTHER_INT_EN_FALL_CLR,0xe3 },
   387 		{ Register::ID_INT_EN_RISE_CLR,	0x0f },
   387 		{ Register::ID_INT_EN_RISE_CLR,	0x0f },
   388 		{ Register::ID_INT_EN_FALL_CLR,	0x0f },
   388 		{ Register::ID_INT_EN_FALL_CLR,	0x0f },
   389 		{ Register::CARKIT_SM_1_INT_EN_CLR,0xff },
   389 		{ Register::CARKIT_SM_1_INT_EN_CLR,0xff },
   390 		{ Register::CARKIT_SM_2_INT_EN_CLR,0xff },		
   390 		{ Register::CARKIT_SM_2_INT_EN_CLR,0xff },
   391 		{ KEYP_SIH_CTRL::Addr,	KEYP_SIH_CTRL::SIH_PENDDIS |  KEYP_SIH_CTRL::SIH_COR | KEYP_SIH_CTRL::SIH_EXCLEN },
   391 		{ KEYP_SIH_CTRL::Addr,	KEYP_SIH_CTRL::SIH_PENDDIS |  KEYP_SIH_CTRL::SIH_COR | KEYP_SIH_CTRL::SIH_EXCLEN },
   392 		{ Register::KEYP_IMR1,		0x0f },
   392 		{ Register::KEYP_IMR1,		0x0f },
   393 		{ Register::KEYP_IMR2,		0x0f },
   393 		{ Register::KEYP_IMR2,		0x0f },
   394 		{ Register::KEYP_EDR,		FULL_RISING_EDGEMASK },
   394 		{ Register::KEYP_EDR,		FULL_RISING_EDGEMASK },
   395 		{ BCISIHCTRL::Addr,	BCISIHCTRL::SIH_PENDDIS |  BCISIHCTRL::SIH_COR | BCISIHCTRL::SIH_EXCLEN },
   395 		{ BCISIHCTRL::Addr,	BCISIHCTRL::SIH_PENDDIS |  BCISIHCTRL::SIH_COR | BCISIHCTRL::SIH_EXCLEN },
   440 	for( TInt i = 0; (i < KInitListCount) && (KErrNone == r); ++i )
   440 	for( TInt i = 0; (i < KInitListCount) && (KErrNone == r); ++i )
   441 		{
   441 		{
   442 		r = WriteSync( KInitList[i].iReg, KInitList[i].iValue );
   442 		r = WriteSync( KInitList[i].iReg, KInitList[i].iValue );
   443 		}
   443 		}
   444 
   444 
   445 	// Clear all interrupts
   445 	if(r == KErrNone)
   446 	for( TInt i = 0; (i < KClearListCount) && (KErrNone == r); ++i )
   446 		{
   447 		{
   447 		// Clear all interrupts
   448 		TUint8 dummy;
   448 		for( TInt i = 0; (i < KClearListCount) && (KErrNone == r); ++i )
   449 		r = ReadSync( KClearList[i], dummy );
   449 			{
   450 		}
   450 			// some registers need more reads to clear them, e.g. PWR_ISR1 needs 3- why is that?
   451 
   451 			TInt num_attempts = 5;
   452 	__KTRACE_OPT(KTPS65950,Kern::Printf("-TPS65950Int:InitIntController:%d", r));	
   452 			TUint8 dummy = 3;
       
   453 			while(dummy && (num_attempts > 0))
       
   454 				{
       
   455 				num_attempts--;
       
   456 				r = ReadSync( KClearList[i], dummy );
       
   457 				if(r != KErrNone)
       
   458 					{
       
   459 					break;
       
   460 					}
       
   461 				}
       
   462 			}
       
   463 		}
       
   464 
       
   465 	__KTRACE_OPT(KTPS65950,Kern::Printf("-TPS65950Int:InitIntController:%d", r));
   453 
   466 
   454 	return r;
   467 	return r;
   455 	}
   468 	}
   456 
   469 
   457 
   470 
   517 	if( (TUint)aId < KTPS65950IrqLast )
   530 	if( (TUint)aId < KTPS65950IrqLast )
   518 		{
   531 		{
   519 		CHECK_PRECONDITIONS(MASK_NOT_ISR | MASK_NOT_IDFC,"tps65950::InterruptEnable Cant enable a slow src in ISR Context");
   532 		CHECK_PRECONDITIONS(MASK_NOT_ISR | MASK_NOT_IDFC,"tps65950::InterruptEnable Cant enable a slow src in ISR Context");
   520 
   533 
   521 		TUint tblOffset = aId - KTPS65950IrqFirst;
   534 		TUint tblOffset = aId - KTPS65950IrqFirst;
   522 		
   535 
   523 		TInt irq=__SPIN_LOCK_IRQSAVE_R(BeagleExtIVTLock);
   536 		TInt irq=__SPIN_LOCK_IRQSAVE_R(BeagleExtIVTLock);
   524 		if( TheHandlers[ tblOffset ].iIsr == Spurious )
   537 		if( TheHandlers[ tblOffset ].iIsr == Spurious )
   525 			{
   538 			{
   526 			r = KErrNotReady;
   539 			r = KErrNotReady;
   527 			}
   540 			}
   528 		__SPIN_UNLOCK_IRQRESTORE_R(BeagleExtIVTLock,irq);
   541 		__SPIN_UNLOCK_IRQRESTORE_R(BeagleExtIVTLock,irq);
   529 				
   542 
   530 		if( r != KErrNone )
   543 		if( r != KErrNone )
   531 			{
   544 			{
   532 			__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Enable:%d NOT BOUND", aId ));	
   545 			__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Enable:%d NOT BOUND", aId ));
   533 			}
   546 			}
   534 		else
   547 		else
   535 			{
   548 			{
   536 			const TControl& control = KControl[ tblOffset ];
   549 			const TControl& control = KControl[ tblOffset ];
   537 		
   550 
   538 			TUint8 val;
   551 			TUint8 val;
   539 			ReadSync( control.iSetReg, val );
   552 			ReadSync( control.iSetReg, val );
   540 			if( EClearToEnable == control.iPolarity )
   553 			if( EClearToEnable == control.iPolarity )
   541 				{
   554 				{
   542 				ClearSetSync( control.iSetReg, control.iBitMask, KSetNone );
   555 				ClearSetSync( control.iSetReg, control.iBitMask, KSetNone );
   566 	if( (TUint)aId < KTPS65950IrqLast )
   579 	if( (TUint)aId < KTPS65950IrqLast )
   567 		{
   580 		{
   568 		CHECK_PRECONDITIONS(MASK_NOT_ISR | MASK_NOT_IDFC,"tps65950::InterruptDisable Cant disable a slow src in ISR Context");
   581 		CHECK_PRECONDITIONS(MASK_NOT_ISR | MASK_NOT_IDFC,"tps65950::InterruptDisable Cant disable a slow src in ISR Context");
   569 
   582 
   570 		TUint tblOffset = aId - KTPS65950IrqFirst;
   583 		TUint tblOffset = aId - KTPS65950IrqFirst;
   571 		
   584 
   572 		TInt irq=__SPIN_LOCK_IRQSAVE_R(BeagleExtIVTLock);
   585 		TInt irq=__SPIN_LOCK_IRQSAVE_R(BeagleExtIVTLock);
   573 		if( TheHandlers[ tblOffset ].iIsr == Spurious )
   586 		if( TheHandlers[ tblOffset ].iIsr == Spurious )
   574 			{
   587 			{
   575 			r = KErrNotReady;
   588 			r = KErrNotReady;
   576 			}
   589 			}
   577 		__SPIN_UNLOCK_IRQRESTORE_R(BeagleExtIVTLock,irq);
   590 		__SPIN_UNLOCK_IRQRESTORE_R(BeagleExtIVTLock,irq);
   578 				
   591 
   579 		if( r != KErrNone )
   592 		if( r != KErrNone )
   580 			{
   593 			{
   581 			__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Disable:%d NOT BOUND", aId ));	
   594 			__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Disable:%d NOT BOUND", aId ));
   582 			}
   595 			}
   583 		else
   596 		else
   584 			{
   597 			{
   585 			const TControl& control = KControl[ tblOffset ];
   598 			const TControl& control = KControl[ tblOffset ];
   586 		
   599 
   587 			if( EClearToEnable == control.iPolarity )
   600 			if( EClearToEnable == control.iPolarity )
   588 				{
   601 				{
   589 				ClearSetSync( control.iClrReg, KClearNone, control.iBitMask );
   602 				ClearSetSync( control.iClrReg, KClearNone, control.iBitMask );
   590 				}
   603 				}
   591 			else
   604 			else
   610 	TInt r = KErrNone;
   623 	TInt r = KErrNone;
   611 
   624 
   612 	if( (TUint)aId < KTPS65950IrqLast )
   625 	if( (TUint)aId < KTPS65950IrqLast )
   613 		{
   626 		{
   614 		CHECK_PRECONDITIONS(MASK_NOT_ISR,"tps65950::InterruptClear Cant clear a slow src in ISR Context");
   627 		CHECK_PRECONDITIONS(MASK_NOT_ISR,"tps65950::InterruptClear Cant clear a slow src in ISR Context");
   615 		
   628 
   616 		TUint tblOffset = aId - KTPS65950IrqFirst;
   629 		TUint tblOffset = aId - KTPS65950IrqFirst;
   617 		TUint8 value;
   630 		TUint8 value;
   618 		//clear on read !  //we may lose some of the other ints if many enabled
   631 		//clear on read !  //we may lose some of the other ints if many enabled
   619 		ReadSync( KControl[ tblOffset ].iStatReg, value );
   632 		ReadSync( KControl[ tblOffset ].iStatReg, value );
   620 		}
   633 		}
   633 	return KErrNotSupported;
   646 	return KErrNotSupported;
   634 	}
   647 	}
   635 
   648 
   636 
   649 
   637 void TPS65950Int::Dispatch(TAny * aParam )
   650 void TPS65950Int::Dispatch(TAny * aParam )
   638 	{	
   651 	{
   639 	Interrupt::Disable(EOmap3530_IRQ7_SYS_NIRQ);
   652 	Interrupt::Disable(EOmap3530_IRQ7_SYS_NIRQ);
   640 	reinterpret_cast<TPS65950Int*>(aParam)->iDfc.Add();	
   653 	reinterpret_cast<TPS65950Int*>(aParam)->iDfc.Add();
   641 	}
   654 	}
   642 
   655 
   643 void TPS65950Int::Dfc( TAny* aParam )
   656 void TPS65950Int::Dfc( TAny* aParam )
   644 	{	
   657 	{
   645 	__KTRACE_OPT(KTPS65950,Kern::Printf("+tps65950Int:Dfc" ));
   658 	__KTRACE_OPT(KTPS65950,Kern::Printf("+tps65950Int:Dfc" ));
   646 
   659 
   647 	TUint8 highVectors=0;
   660 	TUint8 highVectors=0;
   648 	TUint8 subVector=0;
   661 	TUint8 subVector=0;
   649 	
   662 
   650 	ReadSync( PIH_ISR_P1::Addr, highVectors );
   663 	ReadSync( PIH_ISR_P1::Addr, highVectors );
   651 	__ASSERT_DEBUG( highVectors != 0,Kern::Fault("tps65950 int signalled but no vector ",highVectors));
   664 	__ASSERT_DEBUG( highVectors != 0,Kern::Fault("tps65950 int signalled but no vector ",highVectors));
   652 	
   665 
   653 	for(TInt i=0; i<=5;i++,highVectors >>=1)
   666 	for(TInt i=0; i<=5;i++,highVectors >>=1)
   654 		{
   667 		{
   655 		if(highVectors & 0x1)			
   668 		if(highVectors & 0x1)
   656 			{
   669 			{
   657 			for(TInt8 j=0;j<subBank[i].iLen;j++)
   670 			for(TInt8 j=0;j<subBank[i].iLen;j++)
   658 				{
   671 				{
   659 				ReadSync( subBank[i].iRegs[j], subVector );
   672 				ReadSync( subBank[i].iRegs[j], subVector );
   660 				for(TInt k=0;k < 8;k++)
   673 				for(TInt k=0;k < 8;k++)
   661 					{
   674 					{
   662 					if(subVector & 0x1)
   675 					if(subVector & 0x1)
   663 						{	
   676 						{
   664 						TInt tblOffset =  TheMapTable[i][j]->iBit[k] - KTPS65950IrqFirst;
   677 						TInt tblOffset =  TheMapTable[i][j]->iBit[k] - KTPS65950IrqFirst;
   665 
   678 
   666 						__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Dfc:BIT_%d HIGH on REG %x VECTOR is %x ISR %x",
   679 						__KTRACE_OPT(KTPS65950,Kern::Printf("=tps65950:Dfc:BIT_%d HIGH on REG %x VECTOR is %x ISR %x",
   667 													k,subBank[i].iRegs[j], tblOffset, TheHandlers[tblOffset].iIsr));
   680 													k,subBank[i].iRegs[j], tblOffset, TheHandlers[tblOffset].iIsr));
   668 						
   681 
   669 						(TheHandlers[tblOffset].iIsr)(TheHandlers[tblOffset].iPtr);
   682 						(TheHandlers[tblOffset].iIsr)(TheHandlers[tblOffset].iPtr);
   670 						}	
   683 						}
   671 					subVector >>= 1;
   684 					subVector >>= 1;
   672 					}
   685 					}
   673 				}		
   686 				}
   674 			}
   687 			}
   675 		}		
   688 		}
   676 	Interrupt::Enable(EOmap3530_IRQ7_SYS_NIRQ);	
   689 	Interrupt::Enable(EOmap3530_IRQ7_SYS_NIRQ);
   677 
   690 
   678 	__KTRACE_OPT(KTPS65950,Kern::Printf("-tps65950:Dfc" ));
   691 	__KTRACE_OPT(KTPS65950,Kern::Printf("-tps65950:Dfc" ));
   679 	}
   692 	}
   680 
   693 
   681 
   694