void s3c_fimc0_cfg_gpio(struct platform_device *pdev) { int i = 0; /* CAM A port(b0010) : PCLK, VSYNC, HREF, DATA[0-4] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_NONE); } /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_NONE); } #if !defined(CONFIG_MX100) /*Shanghai ewada*/ /* CAM B port(b0011) : DATA[0-7] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); } #endif }
void s3c_fimc0_cfg_gpio(struct platform_device *pdev) { int i = 0; /* CAM A port(b0010) : PCLK, VSYNC, HREF, DATA[0-4] */ for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_NONE); } /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ // for (i=0; i < 5; i++) {///////////////////////////////////////////////////// for (i=0; i < 4; i++) {//////////////////////////////////////////////////////disable FIELD s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_NONE); } #if defined(CONFIG_MACH_SMDKC110) || defined(CONFIG_MACH_SMDKV210) s3c_gpio_cfgpin(S5PV210_GPE1(4), S5PV210_GPE1_4_CAM_A_FIELD); s3c_gpio_setpull(S5PV210_GPE1(4), S3C_GPIO_PULL_NONE); /* CAM B port(b0011) : DATA[0-7] */ for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i = 0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); } #endif /* note : driver strength to max is unnecessary */ }
void s3c_fimc0_cfg_gpio(struct platform_device *pdev) { int i = 0; /* CAM A port(b0010) : PCLK, VSYNC, HREF, DATA[0-4] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_NONE); } /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : DATA[0-7] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); } /* note : driver strength to max is unnecessary */ }
static void __x210_led_remove(void) { gpio_free(S5PV210_GPJ0(3)); gpio_free(S5PV210_GPJ0(4)); gpio_free(S5PV210_GPJ0(5)); gpio_free(S5PV210_GPD0(1)); }
void s3c_fimc0_cfg_gpio_suspend(struct platform_device *pdev) { int i = 0; for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_UP); } /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_UP); } /* CAM B port(b0011) : DATA[0-7] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_UP); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i=0; i < 5; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_UP); } }
void s3c_fimc0_cfg_gpio(struct platform_device *pdev) { int i = 0; /* CAM A port(b0010) 0.3Mps : PCLK, VSYNC, HREF, DATA[0-4] */ for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_NONE); } /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ for (i = 0; i < 4; i++) { s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_NONE); } //set CAM 3M data and clock pin as input. //Modify by endy,2011.12.7 #ifdef CONFIG_PRODUCT_USING_V7E_COST_DOWN /* CAM B port(b0011) 5Mps : DATA[0-7] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i=0; i < 3; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); } /* CAM MCLK */ s3c_gpio_cfgpin(S5PV210_GPJ1(4), S3C_GPIO_INPUT); s3c_gpio_setpull(S5PV210_GPJ1(4), S3C_GPIO_PULL_NONE); #else #if 1 /* CAM B port(b0011) 5Mps : DATA[0-7] */ for (i=0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); } /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ for (i=0; i < 3; i++) { s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); } /* CAM MCLK */ s3c_gpio_cfgpin(S5PV210_GPJ1(4), S3C_GPIO_SFN(3)); s3c_gpio_setpull(S5PV210_GPJ1(4), S3C_GPIO_PULL_NONE); #endif #endif /* note : driver strength to max is unnecessary */ }
static ssize_t x210_led_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { printk("--------------hello-----------------\n"); unsigned long on = simple_strtoul(buf, NULL, 10); if(!strcmp(attr->attr.name, "led1")) { if(on) { gpio_set_value(S5PV210_GPJ0(3), 0); __x210_led_status[0] = 1; } else { gpio_set_value(S5PV210_GPJ0(3), 1); __x210_led_status[0] = 0; } } else if(!strcmp(attr->attr.name, "led2")) { if(on) { gpio_set_value(S5PV210_GPJ0(4), 0); __x210_led_status[1] = 1; } else { gpio_set_value(S5PV210_GPJ0(4), 1); __x210_led_status[1] = 0; } } else if(!strcmp(attr->attr.name, "led3")) { if(on) { gpio_set_value(S5PV210_GPJ0(5), 0); __x210_led_status[2] = 1; } else { gpio_set_value(S5PV210_GPJ0(5), 1); __x210_led_status[2] = 0; } } else if(!strcmp(attr->attr.name, "led4")) { if(on) { gpio_set_value(S5PV210_GPD0(1), 0); __x210_led_status[3] = 1; } else { gpio_set_value(S5PV210_GPD0(1), 1); __x210_led_status[3] = 0; } } return count; }
void s5pv210_ide_setup_gpio(void) { /* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST, CF_DMACK */ s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8); /* CF_Data[0 - 7] */ s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8); /* CF_Data[8 - 15] */ s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8); /* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */ s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4); }
void s5pv210_ide_setup_gpio(void) { /* */ s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8); /* */ s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8); /* */ s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8); /* */ s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4); }
static void __init goni_tsp_init(void) { int gpio; gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */ gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON"); gpio_export(gpio, 0); gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */ gpio_request(gpio, "TSP_INT"); s5p_register_gpio_interrupt(gpio); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); i2c2_devs[0].irq = gpio_to_irq(gpio); }
.ngpio = S5PV210_GPIO_H3_NR, .label = "GPH3", }, }, { .base = S5PV210_GPI_BASE, .config = &gpio_cfg, .chip = { .base = S5PV210_GPI(0), .ngpio = S5PV210_GPIO_I_NR, .label = "GPI", }, }, { .base = S5PV210_GPJ0_BASE, .config = &gpio_cfg, .chip = { .base = S5PV210_GPJ0(0), .ngpio = S5PV210_GPIO_J0_NR, .label = "GPJ0", }, }, { .base = S5PV210_GPJ1_BASE, .config = &gpio_cfg, .chip = { .base = S5PV210_GPJ1(0), .ngpio = S5PV210_GPIO_J1_NR, .label = "GPJ1", }, }, { .base = S5PV210_GPJ2_BASE, .config = &gpio_cfg, .chip = {
}; struct platform_device gpioi2c4_device = { .name = "i2c-gpio", .id = 4, .dev = { .platform_data = &gpioi2c4_platdata, }, }; /* For SF */ static struct i2c_gpio_platform_data gpioi2c5_platdata = { .sda_pin = S5PV210_GPC0(4), .scl_pin = S5PV210_GPJ0(6), .udelay = 0, .timeout = 0, .sda_is_open_drain = 0, .scl_is_open_drain = 0, .scl_is_output_only = 0, }; struct platform_device gpioi2c5_device = { .name = "i2c-gpio", .id = 5, .dev = { .platform_data = &gpioi2c5_platdata, },
static u8 read_chg(void) { return gpio_get_value(S5PV210_GPJ0(5)); }
static void __x210_led_probe(void) { int ret; ret = gpio_request(S5PV210_GPJ0(3), "GPJ0"); if(ret) printk("x210-led: request gpio GPJ0(3) fail\n"); s3c_gpio_setpull(S5PV210_GPJ0(3), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5PV210_GPJ0(3), S3C_GPIO_SFN(1)); gpio_set_value(S5PV210_GPJ0(3), 1); ret = gpio_request(S5PV210_GPJ0(4), "GPJ0"); if(ret) printk("x210-led: request gpio GPJ0(4) fail\n"); s3c_gpio_setpull(S5PV210_GPJ0(4), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5PV210_GPJ0(4), S3C_GPIO_SFN(1)); gpio_set_value(S5PV210_GPJ0(4), 1); ret = gpio_request(S5PV210_GPJ0(5), "GPJ0"); if(ret) printk("x210-led: request gpio GPJ0(5) fail\n"); s3c_gpio_setpull(S5PV210_GPJ0(5), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5PV210_GPJ0(5), S3C_GPIO_SFN(1)); gpio_set_value(S5PV210_GPJ0(5), 1); ret = gpio_request(S5PV210_GPD0(1), "GPD0"); if(ret) printk("x210-led: request gpio GPD0(1) fail\n"); s3c_gpio_setpull(S5PV210_GPD0(1), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5PV210_GPD0(1), S3C_GPIO_SFN(1)); gpio_set_value(S5PV210_GPD0(1), 1); __x210_led_status[0] = 0; __x210_led_status[1] = 0; __x210_led_status[2] = 0; __x210_led_status[3] = 0; }