.start = IRQ_EINT9, .end = IRQ_EINT9, .flags = IORESOURCE_IRQ, }, }; static struct platform_device qt2410_cs89x0 = { .name = "cirrus-cs89x0", .num_resources = ARRAY_SIZE(qt2410_cs89x0_resources), .resource = qt2410_cs89x0_resources, }; /* LED */ static struct s3c24xx_led_platdata qt2410_pdata_led = { .gpio = S3C2410_GPB(0), .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led", .def_trigger = "timer", }; static struct platform_device qt2410_led = { .name = "s3c24xx_led", .id = 0, .dev = { .platform_data = &qt2410_pdata_led, }, }; /* SPI */
static void __init jive_machine_init(void) { /* register system core operations for managing low level suspend */ register_syscore_ops(&jive_pm_syscore_ops); /* write our sleep configurations for the IO. Pull down all unused * IO, ensure that we have turned off all peripherals we do not * need, and configure the ones we do need. */ /* Port B sleep */ __raw_writel(S3C2412_SLPCON_IN(0) | S3C2412_SLPCON_PULL(1) | S3C2412_SLPCON_HIGH(2) | S3C2412_SLPCON_PULL(3) | S3C2412_SLPCON_PULL(4) | S3C2412_SLPCON_PULL(5) | S3C2412_SLPCON_PULL(6) | S3C2412_SLPCON_HIGH(7) | S3C2412_SLPCON_PULL(8) | S3C2412_SLPCON_PULL(9) | S3C2412_SLPCON_PULL(10), S3C2412_GPBSLPCON); /* Port C sleep */ __raw_writel(S3C2412_SLPCON_PULL(0) | S3C2412_SLPCON_PULL(1) | S3C2412_SLPCON_PULL(2) | S3C2412_SLPCON_PULL(3) | S3C2412_SLPCON_PULL(4) | S3C2412_SLPCON_PULL(5) | S3C2412_SLPCON_LOW(6) | S3C2412_SLPCON_PULL(6) | S3C2412_SLPCON_PULL(7) | S3C2412_SLPCON_PULL(8) | S3C2412_SLPCON_PULL(9) | S3C2412_SLPCON_PULL(10) | S3C2412_SLPCON_PULL(11) | S3C2412_SLPCON_PULL(12) | S3C2412_SLPCON_PULL(13) | S3C2412_SLPCON_PULL(14) | S3C2412_SLPCON_PULL(15), S3C2412_GPCSLPCON); /* Port D sleep */ __raw_writel(S3C2412_SLPCON_ALL_PULL, S3C2412_GPDSLPCON); /* Port F sleep */ __raw_writel(S3C2412_SLPCON_LOW(0) | S3C2412_SLPCON_LOW(1) | S3C2412_SLPCON_LOW(2) | S3C2412_SLPCON_EINT(3) | S3C2412_SLPCON_EINT(4) | S3C2412_SLPCON_EINT(5) | S3C2412_SLPCON_EINT(6) | S3C2412_SLPCON_EINT(7), S3C2412_GPFSLPCON); /* Port G sleep */ __raw_writel(S3C2412_SLPCON_IN(0) | S3C2412_SLPCON_IN(1) | S3C2412_SLPCON_IN(2) | S3C2412_SLPCON_IN(3) | S3C2412_SLPCON_IN(4) | S3C2412_SLPCON_IN(5) | S3C2412_SLPCON_IN(6) | S3C2412_SLPCON_IN(7) | S3C2412_SLPCON_PULL(8) | S3C2412_SLPCON_PULL(9) | S3C2412_SLPCON_IN(10) | S3C2412_SLPCON_PULL(11) | S3C2412_SLPCON_PULL(12) | S3C2412_SLPCON_PULL(13) | S3C2412_SLPCON_IN(14) | S3C2412_SLPCON_PULL(15), S3C2412_GPGSLPCON); /* Port H sleep */ __raw_writel(S3C2412_SLPCON_PULL(0) | S3C2412_SLPCON_PULL(1) | S3C2412_SLPCON_PULL(2) | S3C2412_SLPCON_PULL(3) | S3C2412_SLPCON_PULL(4) | S3C2412_SLPCON_PULL(5) | S3C2412_SLPCON_PULL(6) | S3C2412_SLPCON_IN(7) | S3C2412_SLPCON_IN(8) | S3C2412_SLPCON_PULL(9) | S3C2412_SLPCON_IN(10), S3C2412_GPHSLPCON); /* initialise the power management now we've setup everything. */ s3c_pm_init(); /** TODO - check that this is after the cmdline option! */ s3c_nand_set_platdata(&jive_nand_info); /* initialise the spi */ gpio_request(S3C2410_GPG(13), "lcm reset"); gpio_direction_output(S3C2410_GPG(13), 0); gpio_request(S3C2410_GPB(7), "jive spi"); gpio_direction_output(S3C2410_GPB(7), 1); gpio_request_one(S3C2410_GPB(6), GPIOF_OUT_INIT_LOW, NULL); gpio_free(S3C2410_GPB(6)); gpio_request_one(S3C2410_GPG(8), GPIOF_OUT_INIT_HIGH, NULL); gpio_free(S3C2410_GPG(8)); /* initialise the WM8750 spi */ gpio_request(S3C2410_GPH(10), "jive wm8750 spi"); gpio_direction_output(S3C2410_GPH(10), 1); /* 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); s3c24xx_udc_set_platdata(&jive_udc_cfg); s3c24xx_fb_set_platdata(&jive_lcd_config); spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs)); s3c_i2c0_set_platdata(&jive_i2c_cfg); i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs)); pm_power_off = jive_power_off; platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); }
.gpcup_mask = 0xffffffff, .gpdcon = 0xaa95aaa1, .gpdcon_mask = 0xffc0fff0, .gpdup = 0x0000faff, .gpdup_mask = 0xffffffff, .lpcsel = 0xf82, }; #endif #endif static struct s3c24xx_uda134x_platform_data s3c24xx_uda134x_data = { .l3_clk = S3C2410_GPB(4), .l3_data = S3C2410_GPB(3), .l3_mode = S3C2410_GPB(2), .model = UDA134X_UDA1341, }; static struct platform_device s3c24xx_uda134x = { .name = "s3c24xx_uda134x", .dev = { .platform_data = &s3c24xx_uda134x_data, } }; static struct mtd_partition friendly_arm_default_nand_part[] = { [0] = { .name = "u-boot",
/* I2C devices. */ 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) { s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); /* check for the newer revision boards with large page nand */ if ((__raw_readb(ANUBIS_VA_IDREG) & ANUBIS_IDREG_REVMASK) >= 4) { printk(KERN_INFO "ANUBIS-B detected (revision %d)\n", __raw_readb(ANUBIS_VA_IDREG) & ANUBIS_IDREG_REVMASK);
.rgb_if1 = (ILI9320_RGBIF1_RIM_RGB18 | ILI9320_RGBIF1_RM | ILI9320_RGBIF1_CLK_RGBIF), .rgb_if2 = ILI9320_RGBIF2_DPL, .interface2 = 0x0, .interface3 = 0x3, .interface4 = (ILI9320_INTERFACE4_RTNE(16) | ILI9320_INTERFACE4_DIVE(1)), .interface5 = 0x0, .interface6 = 0x0, }; /* LCD SPI support */ static struct spi_gpio_platform_data jive_lcd_spi = { .sck = S3C2410_GPG(8), .mosi = S3C2410_GPB(8), .miso = SPI_GPIO_NO_MISO, }; static struct platform_device jive_device_lcdspi = { .name = "spi-gpio", .id = 1, .dev.platform_data = &jive_lcd_spi, }; /* WM8750 audio code SPI definition */ static struct spi_gpio_platform_data jive_wm8750_spi = { .sck = S3C2410_GPB(4), .mosi = S3C2410_GPB(9),
static struct platform_device vr1000_dm9k1 = { .name = "dm9000", .id = 1, .num_resources = ARRAY_SIZE(vr1000_dm9k1_resource), .resource = vr1000_dm9k1_resource, .dev = { .platform_data = &vr1000_dm9k_platdata, } }; /* LEDS */ static struct s3c24xx_led_platdata vr1000_led1_pdata = { .name = "led1", .gpio = S3C2410_GPB(0), .def_trigger = "", }; static struct s3c24xx_led_platdata vr1000_led2_pdata = { .name = "led2", .gpio = S3C2410_GPB(1), .def_trigger = "", }; static struct s3c24xx_led_platdata vr1000_led3_pdata = { .name = "led3", .gpio = S3C2410_GPB(2), .def_trigger = "", };
static void vr1000_power_off(void) { gpio_direction_output(S3C2410_GPB(9), 1); }
struct samsung_gpio_chip s3c24xx_gpios[] = { #ifdef CONFIG_PLAT_S3C24XX { .config = &s3c24xx_gpiocfg_banka, .chip = { .base = S3C2410_GPA(0), .owner = THIS_MODULE, .label = "GPIOA", .ngpio = 27, .direction_input = s3c24xx_gpiolib_banka_input, .direction_output = s3c24xx_gpiolib_banka_output, }, }, { .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",
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; }
#include <linux/errno.h> #include <linux/ioctl.h> #include <linux/cdev.h> #include <linux/string.h> #include <linux/list.h> #include <linux/pci.h> #include <linux/gpio.h> #include <asm/uaccess.h> #include <asm/atomic.h> #include <asm/unistd.h> #define DEVICE_NAME "leds" static unsigned long led_table [] = { S3C2410_GPB(5), S3C2410_GPB(6), S3C2410_GPB(7), S3C2410_GPB(8), }; static unsigned int led_cfg_table [] = { S3C2410_GPIO_OUTPUT, S3C2410_GPIO_OUTPUT, S3C2410_GPIO_OUTPUT, S3C2410_GPIO_OUTPUT, }; static int sbc2440_leds_ioctl( struct inode *inode, struct file *file,
static void vr1000_power_off(void) { s3c2410_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT); s3c2410_gpio_setpin(S3C2410_GPB(9), 1); }
static void h1940_backlight_exit(struct device *dev) { gpio_direction_output(S3C2410_GPB(0), 1); gpio_set_value(H1940_LATCH_MAX1698_nSHUTDOWN, 0); }