Exemple #1
0
static void gsm_on_off(struct device *dev, int on)
{
	if (!on) {
		s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPIO_INPUT);
		s3c2410_gpio_cfgpin(S3C2410_GPH2, S3C2410_GPIO_INPUT);

		pcf50633_gpio_set(gta02_pcf, PCF50633_GPIO2, 0);

		if (gta02_gsm.con) {
			s3c24xx_serial_console_set_silence(0);
			console_start(gta02_gsm.con);

			dev_dbg(dev, "powered down gta02 GSM, enabling "
					"serial console\n");
		}

		return;
	}

	if (gta02_gsm.con) {
		dev_dbg(dev, "powering up GSM, thus "
				"disconnecting serial console\n");

		console_stop(gta02_gsm.con);
		s3c24xx_serial_console_set_silence(1);
	}

	/* allow UART to talk to GSM side now we will power it */
	s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPH1_nRTS0);
	s3c2410_gpio_cfgpin(S3C2410_GPH2, S3C2410_GPH2_TXD0);

	pcf50633_gpio_set(gta02_pcf, PCF50633_GPIO2, 7);

	msleep(100);

	s3c2410_gpio_setpin(GTA02_GPIO_MODEM_ON, 1);
	msleep(500);
	s3c2410_gpio_setpin(GTA02_GPIO_MODEM_ON, 0);

	/*
	 * workaround for calypso firmware moko10 and earlier,
	 * without this it will leave IRQ line high after
	 * booting
	 */
	s3c2410_gpio_setpin(S3C2410_GPH1, 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPH1_OUTP);
	msleep(1000);
	s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPH1_nRTS0);

}
Exemple #2
0
static void
gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
{
	int  ma;

	/* Interpret charger type */
	if (res < ((ADC_NOM_CHG_DETECT_USB + ADC_NOM_CHG_DETECT_1A) / 2)) {

		/* Stop GPO driving out now that we have a IA charger */
		pcf50633_gpio_set(pcf, PCF50633_GPO, 0);

		ma = 1000;
	} else
		ma = 100;

	pcf50633_mbc_usb_curlim_set(pcf, ma);
}