static void lcd_lte480wv_set_power(struct plat_lcd_data *pd, unsigned int power) { if (power) { #if !defined(CONFIG_BACKLIGHT_PWM) gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_HIGH, "GPD0"); gpio_free(EXYNOS4_GPD0(1)); #endif /* fire nRESET on power up */ gpio_request(EXYNOS4_GPX0(6), "GPX0"); gpio_direction_output(EXYNOS4_GPX0(6), 1); mdelay(100); gpio_set_value(EXYNOS4_GPX0(6), 0); mdelay(10); gpio_set_value(EXYNOS4_GPX0(6), 1); mdelay(10); gpio_free(EXYNOS4_GPX0(6)); } else { #if !defined(CONFIG_BACKLIGHT_PWM) gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_LOW, "GPD0"); gpio_free(EXYNOS4_GPD0(1)); #endif } }
int s3cfb_lcd_on(struct platform_device *pdev) { int err; #ifdef CONFIG_MACH_SMDKC210 err = gpio_request_one(EXYNOS4_GPX0(6), GPIOF_OUT_INIT_HIGH, "GPX0"); if (err) { printk(KERN_ERR "failed to request GPX0 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4_GPX0(6), 0); mdelay(1); gpio_set_value(EXYNOS4_GPX0(6), 1); gpio_free(EXYNOS4_GPX0(6)); #elif defined(CONFIG_MACH_SMDK4X12) if (samsung_board_rev_is_0_1()) { err = gpio_request_one(EXYNOS4212_GPM3(6), GPIOF_OUT_INIT_HIGH, "GPM3"); if (err) { printk(KERN_ERR "failed to request GPM3 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4212_GPM3(6), 0); mdelay(1); gpio_set_value(EXYNOS4212_GPM3(6), 1); gpio_free(EXYNOS4212_GPM3(6)); } else { err = gpio_request_one(EXYNOS4_GPX1(5), GPIOF_OUT_INIT_HIGH, "GPX0"); if (err) { printk(KERN_ERR "failed to request GPX0 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4_GPX1(5), 0); mdelay(1); gpio_set_value(EXYNOS4_GPX1(5), 1); gpio_free(EXYNOS4_GPX1(5)); } #endif return 0; }
int s3cfb_lcd_on(struct platform_device *pdev) { int err; if (machine_is_smdkc210()) { err = gpio_request_one(EXYNOS4_GPX0(6), GPIOF_OUT_INIT_HIGH, "GPX0"); if (err) { printk(KERN_ERR "failed to request GPX0 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4_GPX0(6), 0); mdelay(1); gpio_set_value(EXYNOS4_GPX0(6), 1); gpio_free(EXYNOS4_GPX0(6)); } else if (machine_is_smdk4412()) { if (samsung_board_rev_is_0_1()) { err = gpio_request_one(EXYNOS4212_GPM3(6), GPIOF_OUT_INIT_HIGH, "GPM3"); if (err) { printk(KERN_ERR "failed to request GPM3 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4212_GPM3(6), 0); mdelay(1); gpio_set_value(EXYNOS4212_GPM3(6), 1); gpio_free(EXYNOS4212_GPM3(6)); } else { err = gpio_request_one(EXYNOS4_GPX1(5), GPIOF_OUT_INIT_HIGH, "GPX0"); if (err) { printk(KERN_ERR "failed to request GPX0 for " "lcd reset control\n"); return err; } gpio_set_value(EXYNOS4_GPX1(5), 0); mdelay(1); gpio_set_value(EXYNOS4_GPX1(5), 1); gpio_free(EXYNOS4_GPX1(5)); } } return 0; }
static void __init nuri_power_init(void) { int gpio; int irq_base = IRQ_GPIO_END + 1; int ta_en = 0; nuri_max8997_pdata.irq_base = irq_base; irq_base += MAX8997_IRQ_NR; gpio = EXYNOS4_GPX0(7); gpio_request(gpio, "AP_PMIC_IRQ"); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); gpio = EXYNOS4_GPX2(3); gpio_request(gpio, "FUEL_ALERT"); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); gpio = nuri_max8903.dok; gpio_request(gpio, "TA_nCONNECTED"); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); ta_en = gpio_get_value(gpio) ? 0 : 1; gpio = nuri_max8903.chg; gpio_request(gpio, "TA_nCHG"); gpio_direction_input(gpio); gpio = nuri_max8903.dcm; gpio_request(gpio, "CURR_ADJ"); gpio_direction_output(gpio, ta_en); }
static void __init nuri_machine_init(void) { nuri_sdhci_init(); nuri_tsp_init(); nuri_power_init(); s3c_i2c0_set_platdata(&nuri_i2c0_platdata); i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); s3c_i2c3_set_platdata(&i2c3_data); i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); s3c_i2c5_set_platdata(NULL); i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7)); i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); s5p_fimd0_set_platdata(&nuri_fb_pdata); nuri_camera_init(); nuri_ehci_init(); clk_xusbxti.rate = 24000000; /* Last */ platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev; s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev; s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev; s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev; s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev; s5p_device_fimc3.dev.parent = &exynos4_device_pd[PD_CAM].dev; s5p_device_mipi_csis0.dev.parent = &exynos4_device_pd[PD_CAM].dev; }
s3c_gpio_pull_t s3c_gpio_get_slp_cfgpin(unsigned int pin) { struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); void __iomem *reg; unsigned long flags; int offset; u32 con; int shift; if (!chip) return -EINVAL; if ((pin >= EXYNOS4_GPX0(0)) && (pin <= EXYNOS4_GPX3(7))) return -EINVAL; reg = chip->base + 0x10; offset = pin - chip->chip.base; shift = offset * 2; local_irq_save(flags); con = __raw_readl(reg); con >>= shift; con &= 0x3; local_irq_restore(flags); return (__force s3c_gpio_pull_t)con; }
int s3c_gpio_slp_setpull_updown(unsigned int pin, unsigned int config) { struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); void __iomem *reg; unsigned long flags; int offset; u32 con; int shift; if (!chip) return -EINVAL; if ((pin >= EXYNOS4_GPX0(0)) && (pin <= EXYNOS4_GPX3(7))) return -EINVAL; if (config > S3C_GPIO_PULL_UP) return -EINVAL; reg = chip->base + 0x14; offset = pin - chip->chip.base; shift = offset * 2; local_irq_save(flags); con = __raw_readl(reg); con &= ~(3 << shift); con |= config << shift; __raw_writel(con, reg); local_irq_restore(flags); return 0; }
static void mx_power_off(void) { struct task_struct *task = get_current(); char task_com[TASK_COMM_LEN]; int regs; int gpio; pr_emerg("func:%s, process is:%d:%s\n", __func__, task->pid, get_task_comm(task_com, task)); if (task->parent) { task = task->parent; pr_emerg("func:%s, parent:%d:%s\n", __func__, task->pid, get_task_comm(task_com, task)); if (task->parent) { task = task->parent; pr_emerg("func:%s, pparent:%d:%s\n", __func__, task->pid, get_task_comm(task_com, task)); } } if (machine_is_m030()) gpio = EXYNOS4_GPX2(5); else gpio = EXYNOS4_GPX0(3); mx_disable_inand(); if (gpio_get_value(gpio)) { /* 1. Check reboot charging */ mx_reboot_internal("charge"); } else { /* 2. Power off */ regs = __raw_readl(S5P_PS_HOLD_CONTROL); /* dead loop to avoid sometimes auto restart*/ while(1) { pr_emerg("%s: waiting for power off\n", __func__); __raw_writel(regs & 0xFFFFFEFF, S5P_PS_HOLD_CONTROL); } } }
static void __init nuri_machine_init(void) { nuri_sdhci_init(); nuri_tsp_init(); nuri_power_init(); s3c_i2c0_set_platdata(&nuri_i2c0_platdata); i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); s3c_i2c3_set_platdata(&i2c3_data); i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); s3c_i2c5_set_platdata(NULL); i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7)); i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); s3c_i2c6_set_platdata(&nuri_i2c6_platdata); #ifdef CONFIG_DRM_EXYNOS s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; exynos4_fimd0_gpio_setup_24bpp(); #else s5p_fimd0_set_platdata(&nuri_fb_pdata); #endif nuri_camera_init(); nuri_ehci_init(); s3c_hsotg_set_platdata(&nuri_hsotg_pdata); /* Last */ platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); }
static void __init nuri_machine_init(void) { nuri_sdhci_init(); nuri_tsp_init(); nuri_power_init(); s3c_i2c0_set_platdata(&nuri_i2c0_platdata); i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); s3c_i2c3_set_platdata(&i2c3_data); i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); s3c_i2c5_set_platdata(NULL); i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7)); i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); s3c_i2c6_set_platdata(&nuri_i2c6_platdata); s5p_fimd0_set_platdata(&nuri_fb_pdata); nuri_camera_init(); nuri_ehci_init(); /* Last */ platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); }
/* * Common code for BQ275xx devices */ static int __init bq27425_gpio_init(void) { int ret = 0; ret=gpio_request(EXYNOS4_GPX0(0), "GPX0(0)"); if(ret<0) { printk("gpio requst fail for charger: S5PV310_GPX0(0) (cen) pin!! "); return ret; } s3c_gpio_cfgpin(EXYNOS4_GPX0(0), S3C_GPIO_SFN(0xF)); s3c_gpio_setpull(EXYNOS4_GPX0(0), S3C_GPIO_PULL_UP); #ifdef DEBUG_BATTERY printk("-----bq27425_EXYNOS4_GPX0(0): %d-----\n",gpio_get_value(EXYNOS4_GPX0(0))); #endif return ret; }
static inline int is_cable_insert(void) { int gpio; gpio = EXYNOS4_GPX0(2); return gpio_get_value(gpio); }
int bcm_wlan_get_oob_irq(void) { int host_oob_irq = 0; #if 0 #ifdef CONFIG_MACH_ODROID_4210 printk("GPIO(WL_HOST_WAKE) = EXYNOS4_GPX0(7) = %d\n", EXYNOS4_GPX0(7)); host_oob_irq = gpio_to_irq(EXYNOS4_GPX0(7)); gpio_direction_input(EXYNOS4_GPX0(7)); printk("host_oob_irq: %d \r\n", host_oob_irq); #endif #endif host_oob_irq = gpio_to_irq(WL_HoST_WAKE); gpio_direction_input(WL_HoST_WAKE); printk("host_oob_irq: %d \r\n", host_oob_irq); return host_oob_irq; }
static void bq27425_timer_func(void) { power_supply_changed(&bq_this_chip->bat); #ifdef DEBUG_BATTERY printk("bq27425 start timer again\n"); printk("-----bq27425_EXYNOS4_GPX0(0): %d-----\n",gpio_get_value(EXYNOS4_GPX0(0))); #endif mod_timer(&bq27425_timer,jiffies + msecs_to_jiffies(9000)); }
static void __init nuri_tsp_init(void) { int gpio; /* TOUCH_INT: XEINT_4 */ gpio = EXYNOS4_GPX0(4); gpio_request(gpio, "TOUCH_INT"); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); }
uint bcm_wlan_get_oob_irq(void) { uint host_oob_irq = 0; #ifdef CONFIG_MACH_ODROID_4210 printk("GPIO(WL_HOST_WAKE) = EXYNOS4_GPX0(7) = %d\n", EXYNOS4_GPX0(7)); host_oob_irq = gpio_to_irq(EXYNOS4_GPX0(7)); gpio_direction_input(EXYNOS4_GPX0(7)); #endif #ifdef CUSTOMER_HW_ALLWINNER script_item_value_type_e type; script_item_u val; int ret, wl_host_wake = 0; type = script_get_item("wifi_para", "wl_host_wake", &val); if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) { printk("get bcmdhd wl_host_wake gpio failed\n"); return 0; } else { wl_host_wake = val.gpio.gpio; } printk("GPIO(WL_HOST_WAKE) = %d\n", wl_host_wake); ret = gpio_request(wl_host_wake, "oob irq"); if (ret < 0) { printk("Failed to request gpio [%d] for WL_HOST_WAKE\n", wl_host_wake); return ret; } gpio_direction_input(wl_host_wake); host_oob_irq = gpio_to_irq(wl_host_wake); if (IS_ERR_VALUE(host_oob_irq)) { gpio_free(wl_host_wake); printk("map gpio [%d] to virq failed, errno = %d\n",wl_host_wake, host_oob_irq); return 0; } #endif printk("host_oob_irq: %d \r\n", host_oob_irq); return host_oob_irq; }
static void config_sleep_gpio_table(int array_size, unsigned int (*gpio_table)[3]) { u32 i, gpio; for (i = 0; i < array_size; i++) { gpio = gpio_table[i][0]; s3c_gpio_slp_cfgpin(gpio, gpio_table[i][1]); s3c_gpio_slp_setpull_updown(gpio, gpio_table[i][2]); } /* GPX GPIO setting */ s3c_gpio_cfgpin(EXYNOS4_GPX1(7), S3C_GPIO_INPUT); s3c_gpio_setpull(EXYNOS4_GPX1(7), S3C_GPIO_PULL_DOWN); #if defined(CONFIG_MACH_Q1_CMCC_BD) s3c_gpio_cfgpin(EXYNOS4_GPX0(5), S3C_GPIO_OUTPUT); s3c_gpio_setpull(EXYNOS4_GPX0(5), S3C_GPIO_PULL_NONE); gpio_set_value(EXYNOS4_GPX0(5), GPIO_LEVEL_LOW); #endif }
/* This function will return: * 1) return : Host gpio interrupt number per customer platform * 2) irq_flags_ptr : Type of Host interrupt as Level or Edge * * NOTE : * Customer should check his platform definitions * and his Host Interrupt spec * to figure out the proper setting for his platform. * Broadcom provides just reference settings as example. * */ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr) { int host_oob_irq = 0; #ifdef CUSTOMER_HW2 host_oob_irq = wifi_get_irq_number(irq_flags_ptr); #elif defined(HARDKERNEL_OOB) printk("GPIO(WL_HOST_WAKE) = EXYNOS4_GPX0(7) = %d\n", EXYNOS4_GPX0(7)); host_oob_irq = gpio_to_irq(EXYNOS4_GPX0(7)); gpio_direction_input(EXYNOS4_GPX0(7)); printk("host_oob_irq: %d \r\n", host_oob_irq); #else #if defined(CUSTOM_OOB_GPIO_NUM) if (dhd_oob_gpio_num < 0) { dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM; } #endif /* CUSTOMER_HW2 */ if (dhd_oob_gpio_num < 0) { WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined \n", __FUNCTION__)); return (dhd_oob_gpio_num); } WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n", __FUNCTION__, dhd_oob_gpio_num)); #if defined CUSTOMER_HW host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num); #elif defined CUSTOMER_HW3 gpio_request(dhd_oob_gpio_num, "oob irq"); host_oob_irq = gpio_to_irq(dhd_oob_gpio_num); gpio_direction_input(dhd_oob_gpio_num); #endif /* CUSTOMER_HW */ #endif /* CUSTOMER_HW2 */ return (host_oob_irq); }
int s3cfb_lcd_on(struct platform_device *pdev) { int err; err = gpio_request_one(EXYNOS4_GPX0(6), GPIOF_OUT_INIT_HIGH, "GPX0"); if (err) { printk(KERN_ERR "failed to request GPX0 for " "lcd reset control\n"); return err; } msleep(100); gpio_set_value(EXYNOS4_GPX0(6), 0); msleep(10); gpio_set_value(EXYNOS4_GPX0(6), 1); msleep(10); gpio_free(EXYNOS4_GPX0(6)); return 0; }
static irqreturn_t bq27425_int_handler(int irq, void *data) { #ifdef DEBUG_BATTERY printk("bq27425_int_handler start!\n"); printk("-----bq27425_EXYNOS4_GPX0(0): %d-----\n",gpio_get_value(EXYNOS4_GPX0(0))); #endif schedule_work(&bq27425_work); #ifdef DEBUG_BATTERY printk("bq27425_int_handler end!\n"); #endif return IRQ_HANDLED; }
static int bq275xx_battery_status(struct bq275xx_device_info *di) { int ret = POWER_SUPPLY_STATUS_UNKNOWN; if(gpio_get_value(EXYNOS4_GPX0(4)) == 0x0) { ret = POWER_SUPPLY_STATUS_NOT_CHARGING; } if(gpio_get_value(EXYNOS4_GPX0(4)) == 0x1) //charger int detect { if(bq275xx_battery_rsoc(di) == 100) { ret = POWER_SUPPLY_STATUS_FULL; } else ret = POWER_SUPPLY_STATUS_CHARGING; } else if(bq275xx_battery_flags(di) & 0x1) { ret = POWER_SUPPLY_STATUS_DISCHARGING; } return ret; }
static inline int exynos4_irq_to_gpio(unsigned int irq) { if (irq < IRQ_EINT(0)) return -EINVAL; irq -= IRQ_EINT(0); if (irq < 8) return EXYNOS4_GPX0(irq); irq -= 8; if (irq < 8) return EXYNOS4_GPX1(irq); irq -= 8; if (irq < 8) return EXYNOS4_GPX2(irq); irq -= 8; if (irq < 8) return EXYNOS4_GPX3(irq); return -EINVAL; }
S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* SENSE_SDA_2.8V */ {EXYNOS4_GPD1(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* SENSE_SCL_2.8V */ {EXYNOS4_GPK3(1), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_CMD */ {EXYNOS4_GPK3(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_D(0) */ {EXYNOS4_GPK3(4), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_D(1) */ {EXYNOS4_GPK3(5), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_D(2) */ {EXYNOS4_GPK3(6), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_D(3) */ {EXYNOS4_GPX0(1), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* VOL_UP */ {EXYNOS4_GPX0(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* VOL_DOWN */ {EXYNOS4_GPX0(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* GPIO_BOOT_MODE */ {EXYNOS4_GPX2(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* GPIO_FUEL_ALERT */ {EXYNOS4_GPX3(1), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, {EXYNOS4_GPX3(2), S3C_GPIO_SFN(GPIO_DET_35_AF), S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* GPIO_DET_35 */ {EXYNOS4_GPX3(3), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1},
static void __init origen_power_init(void) { gpio_request(EXYNOS4_GPX0(4), "PMIC_IRQ"); s3c_gpio_cfgpin(EXYNOS4_GPX0(4), S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(EXYNOS4_GPX0(4), S3C_GPIO_PULL_NONE); }
}; static struct max8997_platform_data __initdata origen_max8997_pdata = { .num_regulators = ARRAY_SIZE(origen_max8997_regulators), .regulators = origen_max8997_regulators, .wakeup = true, .buck1_gpiodvs = false, .buck2_gpiodvs = false, .buck5_gpiodvs = false, .irq_base = IRQ_GPIO_END + 1, .ignore_gpiodvs_side_effect = true, .buck125_default_idx = 0x0, .buck125_gpios[0] = EXYNOS4_GPX0(0), .buck125_gpios[1] = EXYNOS4_GPX0(1), .buck125_gpios[2] = EXYNOS4_GPX0(2), .buck1_voltage[0] = 1350000, .buck1_voltage[1] = 1300000, .buck1_voltage[2] = 1250000, .buck1_voltage[3] = 1200000, .buck1_voltage[4] = 1150000, .buck1_voltage[5] = 1100000, .buck1_voltage[6] = 1000000, .buck1_voltage[7] = 950000, .buck2_voltage[0] = 1100000, .buck2_voltage[1] = 1100000, .buck2_voltage[2] = 1100000,
.ulcon = UNIVERSAL_ULCON_DEFAULT, .ufcon = UNIVERSAL_UFCON_DEFAULT, }, [3] = { .hwport = 3, .ucon = UNIVERSAL_UCON_DEFAULT, .ulcon = UNIVERSAL_ULCON_DEFAULT, .ufcon = UNIVERSAL_UFCON_DEFAULT, }, }; static struct regulator_consumer_supply max8952_consumer = REGULATOR_SUPPLY("vdd_arm", NULL); static struct max8952_platform_data universal_max8952_pdata __initdata = { .gpio_vid0 = EXYNOS4_GPX0(3), .gpio_vid1 = EXYNOS4_GPX0(4), .gpio_en = -1, /* Not controllable, set "Always High" */ .default_mode = 0, /* vid0 = 0, vid1 = 0 */ .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */ .sync_freq = 0, /* default: fastest */ .ramp_speed = 0, /* default: fastest */ .reg_data = { .constraints = { .name = "VARM_1.2V", .min_uV = 770000, .max_uV = 1400000, .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, .always_on = 1, .boot_on = 1,
.muic_pdata = &max8997_muic_pdata, .wakeup = true, .buck1_gpiodvs = true, .buck2_gpiodvs = true, .buck5_gpiodvs = false, .ignore_gpiodvs_side_effect = true, .buck125_default_idx = 0x0, .irq_base = IRQ_GPIO_END, .buck125_gpios[0] = EXYNOS4_GPX1(6), .buck125_gpios[1] = EXYNOS4_GPX1(7), .buck125_gpios[2] = EXYNOS4_GPX0(4), .buck1_voltage[0] = 1350000, .buck1_voltage[1] = 1300000, .buck1_voltage[2] = 1250000, .buck1_voltage[3] = 1200000, .buck1_voltage[4] = 1150000, .buck1_voltage[5] = 1100000, .buck1_voltage[6] = 1000000, .buck1_voltage[7] = 950000, .buck2_voltage[0] = 1100000, .buck2_voltage[1] = 1100000, .buck2_voltage[2] = 1100000, .buck2_voltage[3] = 1100000, .buck2_voltage[4] = 1000000,
{ EXYNOS4_GPA1(5), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1 }, /* NC */ { EXYNOS4_GPD0(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, { EXYNOS4_GPD0(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, { EXYNOS4_GPD1(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, /* GSENSE_SDA_1.8V */ { EXYNOS4_GPD1(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, /* GSENSE_SCL_1.8V */ { EXYNOS4_GPX0(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_UP, S5P_GPIO_DRVSTR_LV1 }, /* PS_ALS_INT */ { EXYNOS4_GPX0(3), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, { EXYNOS4_GPX0(4), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1 }, { EXYNOS4_GPX0(5), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1 }, { EXYNOS4_GPX0(6), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1 }, /* 3G_DET */ { EXYNOS4_GPX0(7), S3C_GPIO_SFN(0xF), S3C_GPIO_SETPIN_NONE,
static int s3c_pm_enter(suspend_state_t state) { /* ensure the debug is initialised (if enabled) */ s3c_pm_debug_init(); S3C_PMDBG("%s(%d)\n", __func__, state); if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) { printk(KERN_ERR "%s: error: no cpu sleep function\n", __func__); return -EINVAL; } /* check if we have anything to wake-up with... bad things seem * to happen if you suspend with no wakeup (system will often * require a full power-cycle) */ if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) && !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) { printk(KERN_ERR "%s: No wake-up sources!\n", __func__); printk(KERN_ERR "%s: Aborting sleep\n", __func__); return -EINVAL; } /* save all necessary core registers not covered by the drivers */ gpio_set_value(EXYNOS4_GPX0(1), 0); s3c_gpio_cfgpin(EXYNOS4_GPX0(1), S3C_GPIO_SFN(1)); s3c_pm_save_gpios(); s3c_pm_saved_gpios(); s3c_pm_save_uarts(); s3c_pm_save_core(); if(s3c_config_sleep_gpio_table) s3c_config_sleep_gpio_table(); /* set the irq configuration for wake */ s3c_pm_configure_extint(); S3C_PMDBG("sleep: irq wakeup masks: %08lx,%08lx\n", s3c_irqwake_intmask, s3c_irqwake_eintmask); s3c_pm_arch_prepare_irqs(); printk("****************************************************************\n"); printk("BEFORE SLEEP: WAKEUP_STAT: 0x%x\n", __raw_readl(S5P_WAKEUP_STAT)); printk("BEFORE SLEEP: ICCICR_CPU0: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+4)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+8)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0xc)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x10)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x14)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x18)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x1c)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x40)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0x44)); printk("BEFORE SLEEP: 0x%x\n", __raw_readl(S5P_VA_GIC_CPU+0xFC)); printk("****************************************************************\n"); /* call cpu specific preparation */ pm_cpu_prep(); /* flush cache back to ram */ flush_cache_all(); s3c_pm_check_store(); /* send the cpu to sleep... */ s3c_pm_arch_stop_clocks(); /* s3c_cpu_save will also act as our return point from when * we resume as it saves its own register state and restores it * during the resume. */ s3c_cpu_save(0, PLAT_PHYS_OFFSET - PAGE_OFFSET); /* restore the cpu state using the kernel's cpu init code. */ cpu_init(); gpio_set_value(EXYNOS4_GPX0(1), 0); s3c_gpio_cfgpin(EXYNOS4_GPX0(1), S3C_GPIO_SFN(1)); s3c_pm_restore_core(); s3c_pm_restore_uarts(); s3c_pm_restore_gpios(); s3c_pm_restored_gpios(); s3c_pm_debug_init(); /* restore the system state */ if (pm_cpu_restore) pm_cpu_restore(); /* check what irq (if any) restored the system */ s3c_pm_arch_show_resume_irqs(); S3C_PMDBG("%s: post sleep, preparing to return\n", __func__); /* LEDs should now be 1110 */ s3c_pm_debug_smdkled(1 << 1, 0); s3c_pm_check_restore(); /* ok, let's return from sleep */ S3C_PMDBG("S3C PM Resume (post-restore)\n"); return 0; }
.label = "GPY5", }, }, { .base = (S5P_VA_GPIO2 + 0x1E0), .config = &gpio_cfg_noint, .chip = { .base = EXYNOS4_GPY6(0), .ngpio = EXYNOS4_GPIO_Y6_NR, .label = "GPY6", }, }, { .base = (S5P_VA_GPIO2 + 0xC00), .config = &gpio_cfg_noint, .irq_base = IRQ_EINT(0), .chip = { .base = EXYNOS4_GPX0(0), .ngpio = EXYNOS4_GPIO_X0_NR, .label = "GPX0", .to_irq = samsung_gpiolib_to_irq, }, }, { .base = (S5P_VA_GPIO2 + 0xC20), .config = &gpio_cfg_noint, .irq_base = IRQ_EINT(8), .chip = { .base = EXYNOS4_GPX1(0), .ngpio = EXYNOS4_GPIO_X1_NR, .label = "GPX1", .to_irq = samsung_gpiolib_to_irq, }, }, {