int YushanII_got_INT1(void){ Ilp0100_interruptReadStatus(&pInterruptId2, INTR_PIN_1); pr_info("[CAM]pInterruptId2 : 0x%x",pInterruptId2); Ilp0100_interruptClearStatus(pInterruptId2, INTR_PIN_1); enable_irq(yushanII_intr1); return 0; }
/*! * \fn ilp0100_error Ilp0100_interruptManager(uint32_t InterruptId, bool_t Pin) * \brief Ilp0100 function manage Interrupts. It calls the ISR as per the Interrupt Id. * Once the Interrupt is served, it calls Core function interruptClearStatus to clear * the status. * \ingroup Platform_Functions * \param[in] InterruptId : Id of the Interrupt * \param[in] Pin : Pin Value of GPIO Pin * \retval ILP0100_ERROR_NONE : Success * \retval "Other Error Code" : Failure */ ilp0100_error Ilp0100_interruptManager(uint32_t InterruptId, bool_t Pin) { ilp0100_error Ret=ILP0100_ERROR_NONE; ILP0100_LOG_FUNCTION_START((void*)&InterruptId, (void*)&Pin); #ifdef ST_SPECIFIC if(Pin==INTR_PIN_0) { for(i=0;i<32;i++) { //Switch Case for interrupt Id on Pin0 switch (InterruptId&(0x01<<i)) { case INTR_LONGEXP_GLACE_STATS_READY: break; case INTR_LONGEXP_HISTOGRAM_STATS_READY: break; case INTR_SHORTEXP_GLACE_STATS_READY: break; case INTR_SHORTEXP_HISTOGRAM_STATS_READY: break; default: break; } } } else { //Switch Case for interrupt Id on Pin1 } //! Clear the Interrupt Status Ret= Ilp0100_interruptClearStatus(InterruptId, Pin); if (Ret!=ILP0100_ERROR_NONE) { ILP0100_ERROR_LOG("Ilp0100_core_interruptClearStatus failed"); ILP0100_LOG_FUNCTION_END(Ret); return Ret; } #else /* Should contain customer's implementation */ /* Guidelines: */ /* Serve InterruptId interrupt */ #endif /*ST_SPECIFIC*/ ILP0100_LOG_FUNCTION_END(Ret); return Ret; }
ilp0100_error Ilp0100_interruptManager(uint32_t InterruptId, bool_t Pin) { ilp0100_error Ret=ILP0100_ERROR_NONE; ILP0100_LOG_FUNCTION_START((void*)&InterruptId, (void*)&Pin); #ifdef ST_SPECIFIC if(Pin==INTR_PIN_0) { for(i=0;i<32;i++) { switch (InterruptId&(0x01<<i)) { case INTR_LONGEXP_GLACE_STATS_READY: break; case INTR_LONGEXP_HISTOGRAM_STATS_READY: break; case INTR_SHORTEXP_GLACE_STATS_READY: break; case INTR_SHORTEXP_HISTOGRAM_STATS_READY: break; default: break; } } } else { } Ret= Ilp0100_interruptClearStatus(InterruptId, Pin); if (Ret!=ILP0100_ERROR_NONE) { ILP0100_ERROR_LOG("Ilp0100_core_interruptClearStatus failed"); ILP0100_LOG_FUNCTION_END(Ret); return Ret; } #else #endif ILP0100_LOG_FUNCTION_END(Ret); return Ret; }
int YushanII_got_INT0(void __user *argp){ struct yushanii_stats_event_ctrl event; static int got_short = 0; Ilp0100_interruptReadStatus(&pInterruptId, INTR_PIN_0); event.type = pInterruptId; Ilp0100_interruptClearStatus(pInterruptId, INTR_PIN_0); enable_irq(yushanII_intr0); if (pInterruptId & START_OF_SHORTFRAME) { if (g_sensor->func_tbl->sensor_yushanII_ae_updated) { if (g_sensor->func_tbl->sensor_yushanII_ae_updated() == 0) { got_short++; if (got_short >= 2) { if (g_sensor->func_tbl->sensor_yushanII_active_hold) g_sensor->func_tbl->sensor_yushanII_active_hold(); got_short = 0; } } } } switch(pInterruptId){ case SPI_COMMS_READY: pr_info("[CAM]%s, SPI_COMMS_READY", __func__); break; case IDLE_COMPLETE: pr_info("[CAM]%s, IDLE_COMPLETE", __func__); break; case ISP_STREAMING: pr_info("[CAM]%s, ISP_STREAMING", __func__); break; case MODE_CHANGE_COMPLETE: pr_info("[CAM]%s, MODE_CHANGE_COMPLETE", __func__); break; } if(copy_to_user((void *)argp, &event, sizeof(struct yushanii_stats_event_ctrl))){ pr_err("[CAM]%s, copy to user error\n", __func__); return -EFAULT; } return 0; }