Example #1
0
/*
 * Send StationReset message
 * Parameters supplied by application:
 *    none
 * Parameters supplied in the message
 *     - reset type (RESTART)
 */
int
sip_platform_ui_restart (void)
{
    phone_reset(DEVICE_RESTART);
    return TRUE;
}
static void
htcuniversal_phone_configure( int state )
{
	int tries;
	unsigned short statusb;

	printk( KERN_NOTICE "htcuniversal configure phone: %d\n", state );
	switch (state) {
	
	case PXA_UART_CFG_PRE_STARTUP:
		break;

	case PXA_UART_CFG_POST_STARTUP:
		/* pre-serial-up hardware configuration */

		SET_HTCUNIVERSAL_GPIO(PHONE_START,0);   /* "bootloader" */
		SET_HTCUNIVERSAL_GPIO(PHONE_UNKNOWN,0); /* not used     */
		SET_HTCUNIVERSAL_GPIO(PHONE_OFF,0);     /* PHONE_OFF    */

		phone_reset();

		SET_HTCUNIVERSAL_GPIO(PHONE_START,1); /* phone */

		phone_reset();

		asic3_set_gpio_dir_b(&htcuniversal_asic3.dev, 1<<GPIOB_BB_READY, 0);
		asic3_set_gpio_dir_b(&htcuniversal_asic3.dev, 1<<GPIOB_BB_UNKNOWN3, 0);
		
		/*
		 */
		tries = 0;
		do {
			mdelay(10);
			statusb = asic3_get_gpio_status_b( &htcuniversal_asic3.dev );
		} while ( (statusb & (1<<GPIOB_UMTS_DCD)) == 0 && tries++ < 200);

		printk("UMTS_DCD tries=%d of 200\n",tries);

		tries = 0;
		do {
			SET_HTCUNIVERSAL_GPIO(PHONE_OFF,1);
			mdelay(10);
			SET_HTCUNIVERSAL_GPIO(PHONE_OFF,0);
			mdelay(20);
			statusb = asic3_get_gpio_status_b( &htcuniversal_asic3.dev );
		} while ( (statusb & (1<<GPIOB_BB_READY)) == 0 && tries++ < 200);

		printk("BB_READY tries=%d of 200\n",tries);

		break;

	case PXA_UART_CFG_PRE_SHUTDOWN:

			phone_off();

		break;

	default:
		break;
	}
}