static void __init rx1950_init_machine(void) { int i; s3c24xx_fb_set_platdata(&rx1950_lcd_cfg); s3c24xx_udc_set_platdata(&rx1950_udc_cfg); s3c24xx_ts_set_platdata(&rx1950_ts_cfg); s3c24xx_mci_set_platdata(&rx1950_mmc_cfg); s3c_i2c0_set_platdata(NULL); s3c_nand_set_platdata(&rx1950_nand_info); /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */ s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | S3C2410_MISCCR_USBSUSPND0 | S3C2410_MISCCR_USBSUSPND1, 0x0); /* mmc power is disabled by default */ WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power")); gpio_direction_output(S3C2410_GPJ(1), 0); for (i = 0; i < 8; i++) WARN_ON(gpio_request(S3C2410_GPC(i), "LCD power")); for (i = 10; i < 16; i++) WARN_ON(gpio_request(S3C2410_GPC(i), "LCD power")); for (i = 2; i < 8; i++) WARN_ON(gpio_request(S3C2410_GPD(i), "LCD power")); for (i = 11; i < 16; i++) WARN_ON(gpio_request(S3C2410_GPD(i), "LCD power")); WARN_ON(gpio_request(S3C2410_GPB(1), "LCD power")); WARN_ON(gpio_request(S3C2410_GPA(3), "Red blink")); WARN_ON(gpio_request(S3C2410_GPA(4), "Green blink")); WARN_ON(gpio_request(S3C2410_GPJ(6), "LED blink")); gpio_direction_output(S3C2410_GPA(3), 0); gpio_direction_output(S3C2410_GPA(4), 0); gpio_direction_output(S3C2410_GPJ(6), 0); platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); i2c_register_board_info(0, rx1950_i2c_devices, ARRAY_SIZE(rx1950_i2c_devices)); }
static void s3c2416_fb_gpio_setup_24bpp(void) { unsigned int gpio; for (gpio = S3C2410_GPC(1); gpio <= S3C2410_GPC(4); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } for (gpio = S3C2410_GPC(8); gpio <= S3C2410_GPC(15); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } for (gpio = S3C2410_GPD(0); gpio <= S3C2410_GPD(15); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } }
void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, int enable) { printk(KERN_INFO "%s(%d)\n", __func__, enable); if (enable) { s3c2410_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); s3c2410_gpio_pullup(S3C2410_GPD(10), 0); s3c2410_gpio_pullup(S3C2410_GPD(9), 0); } else { s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); s3c2410_gpio_pullup(S3C2410_GPD(10), 1); s3c2410_gpio_pullup(S3C2410_GPD(9), 1); s3c2410_gpio_pullup(S3C2410_GPD(8), 1); } }
static void __init mini2440_machine_init(void) { s3c24xx_fb_set_platdata(&s3c24xx_fb_info); s3c_i2c0_set_platdata(NULL); s3c2410_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND); printk("S3C2410_GPA=%d\n",S3C2410_GPA(0)); printk("S3C2410_GPB=%d\n",S3C2410_GPB(0)); printk("S3C2410_GPC=%d\n",S3C2410_GPC(0)); printk("S3C2410_GPD=%d\n",S3C2410_GPD(0)); printk("S3C2410_GPE=%d\n",S3C2410_GPE(0)); printk("S3C2410_GPF=%d\n",S3C2410_GPF(0)); printk("S3C2410_GPG=%d\n",S3C2410_GPG(0)); printk("S3C2410_GPH=%d\n",S3C2410_GPH(0)); s3c_device_nand.dev.platform_data = &friendly_arm_nand_info; s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; platform_add_devices(mini2440_devices, ARRAY_SIZE(mini2440_devices)); platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1); //GPIO resource MAP s3c_pm_init(); }
.platform_data = &n35_button_data, } }; /* This is the bluetooth LED on the device. */ static struct s3c24xx_led_platdata n30_blue_led_pdata = { .name = "blue_led", .gpio = S3C2410_GPG(6), .def_trigger = "", }; /* This is the blue LED on the device. Originally used to indicate GPS activity * by flashing. */ static struct s3c24xx_led_platdata n35_blue_led_pdata = { .name = "blue_led", .gpio = S3C2410_GPD(8), .def_trigger = "", }; /* This LED is driven by the battery microcontroller, and is blinking * red, blinking green or solid green when the battery is low, * charging or full respectively. By driving GPD9 low, it's possible * to force the LED to blink red, so call that warning LED. */ static struct s3c24xx_led_platdata n30_warning_led_pdata = { .name = "warning_led", .flags = S3C24XX_LEDF_ACTLOW, .gpio = S3C2410_GPD(9), .def_trigger = "", }; static struct s3c24xx_led_platdata n35_warning_led_pdata = {
static void rx1950_lcd_power(int enable) { int i; static int enabled; if (enabled == enable) return; if (!enable) { /* GPC11-GPC15->OUTPUT */ for (i = 11; i < 16; i++) gpio_direction_output(S3C2410_GPC(i), 1); /* Wait a bit here... */ mdelay(100); /* GPD2-GPD7->OUTPUT */ /* GPD11-GPD15->OUTPUT */ /* GPD2-GPD7->1, GPD11-GPD15->1 */ for (i = 2; i < 8; i++) gpio_direction_output(S3C2410_GPD(i), 1); for (i = 11; i < 16; i++) gpio_direction_output(S3C2410_GPD(i), 1); /* Wait a bit here...*/ mdelay(100); /* GPB0->OUTPUT, GPB0->0 */ gpio_direction_output(S3C2410_GPB(0), 0); /* GPC1-GPC4->OUTPUT, GPC1-4->0 */ for (i = 1; i < 5; i++) gpio_direction_output(S3C2410_GPC(i), 0); /* GPC15-GPC11->0 */ for (i = 11; i < 16; i++) gpio_direction_output(S3C2410_GPC(i), 0); /* GPD15-GPD11->0, GPD2->GPD7->0 */ for (i = 11; i < 16; i++) gpio_direction_output(S3C2410_GPD(i), 0); for (i = 2; i < 8; i++) gpio_direction_output(S3C2410_GPD(i), 0); /* GPC6->0, GPC7->0, GPC5->0 */ gpio_direction_output(S3C2410_GPC(6), 0); gpio_direction_output(S3C2410_GPC(7), 0); gpio_direction_output(S3C2410_GPC(5), 0); /* GPB1->OUTPUT, GPB1->0 */ gpio_direction_output(S3C2410_GPB(1), 0); pwm_config(lcd_pwm, 0, LCD_PWM_PERIOD); pwm_disable(lcd_pwm); /* GPC0->0, GPC10->0 */ gpio_direction_output(S3C2410_GPC(0), 0); gpio_direction_output(S3C2410_GPC(10), 0); } else { pwm_config(lcd_pwm, LCD_PWM_DUTY, LCD_PWM_PERIOD); pwm_enable(lcd_pwm); gpio_direction_output(S3C2410_GPC(0), 1); gpio_direction_output(S3C2410_GPC(5), 1); s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPB1_TOUT1); gpio_direction_output(S3C2410_GPC(7), 1); for (i = 1; i < 5; i++) s3c_gpio_cfgpin(S3C2410_GPC(i), S3C_GPIO_SFN(2)); for (i = 11; i < 16; i++) s3c_gpio_cfgpin(S3C2410_GPC(i), S3C_GPIO_SFN(2)); for (i = 2; i < 8; i++) s3c_gpio_cfgpin(S3C2410_GPD(i), S3C_GPIO_SFN(2)); for (i = 11; i < 16; i++) s3c_gpio_cfgpin(S3C2410_GPD(i), S3C_GPIO_SFN(2)); gpio_direction_output(S3C2410_GPC(10), 1); gpio_direction_output(S3C2410_GPC(6), 1); } enabled = enable; }
}, }; static struct gpio_keys_platform_data rx1950_gpio_keys_data = { .buttons = rx1950_gpio_keys_table, .nbuttons = ARRAY_SIZE(rx1950_gpio_keys_table), }; static struct platform_device rx1950_device_gpiokeys = { .name = "gpio-keys", .dev.platform_data = &rx1950_gpio_keys_data, }; static struct uda1380_platform_data uda1380_info = { .gpio_power = S3C2410_GPJ(0), .gpio_reset = S3C2410_GPD(0), .dac_clk = UDA1380_DAC_CLK_SYSCLK, }; static struct i2c_board_info rx1950_i2c_devices[] = { { I2C_BOARD_INFO("uda1380", 0x1a), .platform_data = &uda1380_info, }, }; static struct platform_device *rx1950_devices[] __initdata = { &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c0, &s3c_device_iis,
.chip = { .base = S3C2410_GPB(0), .owner = THIS_MODULE, .label = "GPIOB", .ngpio = 11, }, }, { .chip = { .base = S3C2410_GPC(0), .owner = THIS_MODULE, .label = "GPIOC", .ngpio = 16, }, }, { .chip = { .base = S3C2410_GPD(0), .owner = THIS_MODULE, .label = "GPIOD", .ngpio = 16, }, }, { .chip = { .base = S3C2410_GPE(0), .label = "GPIOE", .owner = THIS_MODULE, .ngpio = 16, }, }, { .chip = { .base = S3C2410_GPF(0), .owner = THIS_MODULE,
static struct i2c_board_info anubis_i2c_devs[] __initdata = { { I2C_BOARD_INFO("tps65011", 0x48), .irq = IRQ_EINT20, } }; /* Audio setup */ static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = { .have_mic = 1, .have_lout = 1, .output_cdclk = 1, .use_mpllin = 1, .amp_gpio = S3C2410_GPB(2), .amp_gain[0] = S3C2410_GPD(10), .amp_gain[1] = S3C2410_GPD(11), }; static void __init anubis_map_io(void) { /* initialise the clocks */ s3c24xx_dclk0.parent = &clk_upll; s3c24xx_dclk0.rate = 12*1000*1000; s3c24xx_dclk1.parent = &clk_upll; s3c24xx_dclk1.rate = 24*1000*1000; s3c24xx_clkout0.parent = &s3c24xx_dclk0; s3c24xx_clkout1.parent = &s3c24xx_dclk1;
#include <linux/gpio.h> #include <mach/spi.h> #include <mach/regs-gpio.h> void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, int enable) { printk(KERN_INFO "%s(%d)\n", __func__, enable); if (enable) { s3c_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); s3c2410_gpio_pullup(S3C2410_GPD(10), 0); s3c2410_gpio_pullup(S3C2410_GPD(9), 0); } else { s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); <<<<<<< HEAD s3c_gpio_setpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); s3c_gpio_setpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); ======= s3c_gpio_cfgpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); s3c_gpio_cfgpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); s3c_gpio_cfgpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a } }