コード例 #1
0
static void pda_udc_command(int cmd)
{
	switch (cmd) {
		case PXA2XX_UDC_CMD_DISCONNECT:
			DPM_DEBUG("pda_udc: Turning off port\n");
			dpm_power(&pdata->power_ctrl, 0);
			break;
		case PXA2XX_UDC_CMD_CONNECT:
			DPM_DEBUG("pda_udc: Turning on port\n");
			dpm_power(&pdata->power_ctrl, 1);
			break;
		default:
			printk("pda_udc: unknown command!\n");
			break;
	}
}
コード例 #2
0
static void serial_detect(struct rs232_serial_pdata *pdata)
{
	int connected = gpiodev_get_value(&pdata->detect_gpio);
	if (!connected)
		DPM_DEBUG("rs232-serial: Turning off port\n");
	dpm_power(&pdata->power_ctrl, connected);
	if (connected)
		DPM_DEBUG("rs232-serial: Turning on port\n");
}