int s3cfb_lcd_on(struct platform_device *pdev) { int err; err = gpio_request(S5P6450_GPN(5), "GPN"); if (err) { printk(KERN_ERR "failed to request GPN for " "lcd reset control\n"); return err; } gpio_direction_output(S5P6450_GPN(5), 1); mdelay(100); gpio_set_value(S5P6450_GPN(5), 0); mdelay(10); gpio_set_value(S5P6450_GPN(5), 1); mdelay(10); gpio_free(S5P6450_GPN(5)); return 0; }
static int __init mendoza_pb_init(void) { int rc; /* needed as Samsung still needs to add a generic gpio function selection method */ if (machine_arch_type == MACH_TYPE_TARANTO || machine_arch_type == MACH_TYPE_VALDEZ) { s3c_gpio_cfgpin(vgpio_to_gpio(TT_VGPIO_ON_OFF), S5P64XX_GPN4_EINT4); s3c_gpio_setpull(S5P6450_GPN(4), S3C_GPIO_PULL_NONE); } /* The debounce interval is set to 500 msec. If this needs to be changed then */ /* it should be done in init.rc (matching device) and NOT here. The reason is */ /* that the powerbutton might have different function before reaching android */ /* and till then we dont want a to high debounce interval */ set_debounce_time(500); rc = platform_device_register(&mendoza_keypad_device); if (!rc) { rc = platform_device_register(&mendoza_pb_pdev); if (rc) platform_device_unregister(&mendoza_keypad_device); } return rc; }
/* LCD power controller */ static void smdk6450_lte480_reset_power(struct plat_lcd_data *pd, unsigned int power) { int err; if (power) { err = gpio_request(S5P6450_GPN(5), "GPN"); if (err) { printk(KERN_ERR "failed to request GPN for lcd reset\n"); return; } gpio_direction_output(S5P6450_GPN(5), 1); gpio_set_value(S5P6450_GPN(5), 0); gpio_set_value(S5P6450_GPN(5), 1); gpio_free(S5P6450_GPN(5)); } }
static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type) { int offs = eint_offset(data->irq); int shift; u32 ctrl, mask; u32 newvalue = 0; if (offs > 15) return -EINVAL; switch (type) { case IRQ_TYPE_NONE: printk(KERN_WARNING "No edge setting!\n"); break; case IRQ_TYPE_EDGE_RISING: newvalue = S3C2410_EXTINT_RISEEDGE; break; case IRQ_TYPE_EDGE_FALLING: newvalue = S3C2410_EXTINT_FALLEDGE; break; case IRQ_TYPE_EDGE_BOTH: newvalue = S3C2410_EXTINT_BOTHEDGE; break; case IRQ_TYPE_LEVEL_LOW: newvalue = S3C2410_EXTINT_LOWLEV; break; case IRQ_TYPE_LEVEL_HIGH: newvalue = S3C2410_EXTINT_HILEV; break; default: printk(KERN_ERR "No such irq type %d", type); return -EINVAL; } shift = (offs / 2) * 4; mask = 0x7 << shift; ctrl = __raw_readl(S5P64X0_EINT0CON0) & ~mask; ctrl |= newvalue << shift; __raw_writel(ctrl, S5P64X0_EINT0CON0); /* Configure the GPIO pin for 6450 or 6440 based on CPU ID */ if (soc_is_s5p6450()) s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2)); else s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2)); return 0; }
//.disabled = 1, }, .initial_state = PM_SUSPEND_MEM, }, .num_consumer_supplies = ARRAY_SIZE(smdk6450_vddarm_consumers), .consumer_supplies = smdk6450_vddarm_consumers, }; static struct s5m8751_backlight_pdata smdk6450_backlight_pdata = { .brightness = 31, }; static struct s5m8751_power_pdata smdk6450_power_pdata = { .constant_voltage = 4200, .fast_chg_current = 400, .gpio_hadp_lusb = S5P6450_GPN(15), }; static struct s5m8751_audio_pdata smdk6450_audio_pdata = { .dac_vol = 0x18, .hp_vol = 0x14, }; static struct s5m8751_pdata smdk6450_s5m8751_pdata = { .regulator = { &smdk6450_vddsys_ext, /* LDO1 */ &smdk6450_vddlcd, /* LDO2 */ &smdk6450_vddalive, /* LDO3 */ &smdk6450_vddpll, /* LDO4 */ &smdk6450_vddmem_ss, /* LDO5 */ NULL, &smdk6450_vddgps, /* BUCK1 */
.ngpio = S5P6450_GPIO_I_NR, .label = "GPI", }, }, { .base = S5P64X0_GPJ_BASE, .config = &s5p64x0_gpio_cfgs[3], .chip = { .base = S5P6450_GPJ(0), .ngpio = S5P6450_GPIO_J_NR, .label = "GPJ", }, }, { .base = S5P64X0_GPN_BASE, .config = &s5p64x0_gpio_cfgs[4], .chip = { .base = S5P6450_GPN(0), .ngpio = S5P6450_GPIO_N_NR, .label = "GPN", }, }, { .base = S5P64X0_GPP_BASE, .config = &s5p64x0_gpio_cfgs[5], .chip = { .base = S5P6450_GPP(0), .ngpio = S5P6450_GPIO_P_NR, .label = "GPP", }, }, { .base = S5P6450_GPQ_BASE, .config = &s5p64x0_gpio_cfgs[4], .chip = {