/* Enable the specified interrupt to trigger on UCB_RISING, UCB_FALLING or both edges. The interrupt should have been hooked by ucb1x00_hook_irq.  */
void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges)
/* Enable the specified interrupt to trigger on UCB_RISING, UCB_FALLING or both edges. The interrupt should have been hooked by ucb1x00_hook_irq.  */
void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges)
{
	unsigned long flags;
	if (idx < 16) {
		spin_lock_irqsave(&ucb->lock, flags);
		ucb1x00_enable(ucb);
		if (edges & UCB_RISING) {
			ucb->irq_ris_enbl |= 1 << idx;
			ucb1x00_reg_write(ucb, UCB_IE_RIS, ucb->irq_ris_enbl);
		}
		if (edges & UCB_FALLING) {
			ucb->irq_fal_enbl |= 1 << idx;
			ucb1x00_reg_write(ucb, UCB_IE_FAL, ucb->irq_fal_enbl);
		}
		ucb1x00_disable(ucb);
		spin_unlock_irqrestore(&ucb->lock, flags);
	}
}