#ifdef CONFIG_PMAC_PBOOK 
pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs){	unsigned char ints, pirq;	int i = 0;	asleep = 0;	if (drop_interrupts || len < 1) {		adb_int_pending = 0;		pmu_irq_stats[8]++;		return;	}	/* Get PMU interrupt mask */	ints = data[0];	/* Record zero interrupts for stats */	if (ints == 0)		pmu_irq_stats[9]++;	/* Hack to deal with ADB autopoll flag */	if (ints & PMU_INT_ADB)		ints &= ~(PMU_INT_ADB_AUTO | PMU_INT_AUTO_SRQ_POLL);next:	if (ints == 0) {		if (i > pmu_irq_stats[10])			pmu_irq_stats[10] = i;		return;	}	for (pirq = 0; pirq < 8; pirq++)		if (ints & (1 << pirq))			break;	pmu_irq_stats[pirq]++;	i++;	ints &= ~(1 << pirq);	/* Note: for some reason, we get an interrupt with len=1,	 * data[0]==0 after each normal ADB interrupt, at least	 * on the Pismo. Still investigating...  --BenH	 */	if ((1 << pirq) & PMU_INT_ADB) {		if ((data[0] & PMU_INT_ADB_AUTO) == 0) {			struct adb_request *req = req_awaiting_reply;			if (req == 0) {				printk(KERN_ERR "PMU: extra ADB reply\n");				return;			}			req_awaiting_reply = NULL;			if (len <= 2)				req->reply_len = 0;			else {				memcpy(req->reply, data + 1, len - 1);				req->reply_len = len - 1;			}			pmu_done(req);		} else {#if defined(CONFIG_XMON) && !defined(CONFIG_PPC64)			if (len == 4 && data[1] == 0x2c) {				extern int xmon_wants_key, xmon_adb_keycode;				if (xmon_wants_key) {					xmon_adb_keycode = data[2];					return;				}			}#endif /* defined(CONFIG_XMON) && !defined(CONFIG_PPC64) */#ifdef CONFIG_ADB			/*			 * XXX On the [23]400 the PMU gives us an up			 * event for keycodes 0x74 or 0x75 when the PC			 * card eject buttons are released, so we			 * ignore those events.			 */			if (!(pmu_kind == PMU_OHARE_BASED && len == 4			      && data[1] == 0x2c && data[3] == 0xff			      && (data[2] & ~1) == 0xf4))				adb_input(data+1, len-1, regs, 1);#endif /* CONFIG_ADB */				}	}	/* Sound/brightness button pressed */	else if ((1 << pirq) & PMU_INT_SNDBRT) {#ifdef CONFIG_PMAC_BACKLIGHT		if (len == 3)#ifdef CONFIG_INPUT_ADBHID			if (!disable_kernel_backlight)#endif /* CONFIG_INPUT_ADBHID */				set_backlight_level(data[1] >> 4);#endif /* CONFIG_PMAC_BACKLIGHT */	}	/* Tick interrupt */	else if ((1 << pirq) & PMU_INT_TICK) {#ifdef CONFIG_PMAC_PBOOK		/* Environement or tick interrupt, query batteries */		if (pmu_battery_count) {			if ((--query_batt_timer) == 0) {				query_battery_state();				query_batt_timer = BATTERY_POLLING_COUNT;			}		}        }	else if ((1 << pirq) & PMU_INT_ENVIRONMENT) {		if (pmu_battery_count)			query_battery_state();		pmu_pass_intr(data, len);	} else {	       pmu_pass_intr(data, len);#endif /* CONFIG_PMAC_PBOOK */	}	goto next;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8c8709334cec803368a432a33e0f2e116d48fe07/via-pmu.c/buggy/drivers/macintosh/via-pmu.c